:root {
  --accent: #049cdb;          /* odkazy, logo */
  --accent-dark: #0379a8;
  --navbar: #439fd0;          /* modrý pruh s taby */
  --tab-active: #4c4b4b;      /* aktivní tab / tmavá */
  --btn: #626060;             /* tlačítko HLEDAT */
  --btn-hover: #4c4b4b;
  --page-bg: #d4d4d4;         /* šedé pozadí okolo panelů */
  --panel: #ffffff;
  --border: #e3e3e3;
  --panel-border: #cfcfcf;
  --text: #333333;
  --muted: #8a8a8a;
  --code-bg: #1e1e2e;
  --code-text: #e4e4e7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 16px 50px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* ---------- Hlavička ---------- */
.site-header {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  overflow: hidden;
  margin-bottom: 18px;
}
.header-inner { padding: 18px 24px; }
.brand { display: inline-flex; align-items: center; gap: 16px; }
.brand:hover { text-decoration: none; }
.logo { height: 44px; width: auto; display: block; }
.site-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}

/* Modrý navigační pruh */
.tabbar {
  display: flex;
  background: var(--navbar);
  padding-left: 24px;
}
.tabbar .tab {
  color: #fff;
  padding: 11px 26px;
  font-size: 14px;
  text-decoration: none;
}
.tabbar .tab:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.tabbar .tab.active { background: var(--tab-active); }

/* ---------- Vyhledávání ---------- */
.search-panel { padding: 22px 24px; margin-bottom: 18px; }
.search-q { font-size: 22px; font-weight: 700; margin: 0 0 14px; color: var(--text); }
.search-row { display: flex; gap: 0; }
.search-field { position: relative; flex: 1; }
#search {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  border: 1px solid #cfcfcf;
  border-right: none;
  border-radius: 3px 0 0 3px;
  outline: none;
  color: #555;
}
#search:focus { border-color: var(--accent); }
.btn-search {
  background: var(--btn);
  color: #fff;
  border: none;
  padding: 0 26px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  border-radius: 0 3px 3px 0;
}
.btn-search:hover { background: var(--btn-hover); }

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  box-shadow: 0 8px 26px rgba(0,0,0,.18);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 40;
}
.search-results .res {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.search-results .res:last-child { border-bottom: none; }
.search-results .res:hover,
.search-results .res.active { background: #eef7fc; text-decoration: none; }
.search-results .res .t { font-weight: 600; color: var(--accent); }
.search-results .res .crumb { font-size: 12px; color: var(--muted); margin-top: 1px; }
.search-results .res .snippet { font-size: 12.5px; color: #666; margin-top: 2px; }
.search-results .res mark { background: #fff3b0; padding: 0 1px; }
.search-results .empty { padding: 14px; color: var(--muted); }

/* ---------- Obsah ---------- */
.content-panel { padding: 24px 28px 30px; }

/* Domovská stránka – znalostní databáze */
.kb-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 4px 0 4px;
}
.kb-rule {
  height: 2px;
  background: linear-gradient(to right, var(--accent), #bfe3f4 70%, transparent);
  margin: 6px 0 22px;
  border-radius: 2px;
}

.kb-category { margin-bottom: 26px; }
.kb-category > h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px;
}
.kb-folders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 40px;
}
.kb-folder { min-width: 0; }
.kb-folder .f-name {
  font-size: 15px;
  color: #555;
  margin: 0 0 8px;
}
.kb-folder .f-name .count { color: var(--muted); font-weight: 400; }
.kb-folder ul { list-style: none; margin: 0; padding: 0; }
.kb-folder li { margin: 0 0 7px; }
.kb-folder li a {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--accent);
  font-size: 14px;
  line-height: 1.4;
}
.icon-article {
  flex: 0 0 auto;
  width: 16px; height: 16px;
  margin-top: 1px;
  color: #9bb7c6;
}
.f-more {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 0 0 24px;
}
.f-more:hover { color: var(--accent); text-decoration: underline; }
.f-more::before { content: "» "; }

/* ---------- Článek ---------- */
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 6px; color: #c0c0c0; }

.article-layout { display: grid; grid-template-columns: 230px 1fr; gap: 32px; }
.article-aside { font-size: 13px; }
.article-aside .aside-h {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 10px;
}
.article-aside ul { list-style: none; margin: 0; padding: 0; }
.article-aside li { margin-bottom: 8px; }
.article-aside li a { color: var(--accent); display: inline-flex; gap: 7px; align-items: flex-start; }
.article-aside li.current a { color: var(--text); font-weight: 700; }
.article-aside li.current .icon-article { color: var(--accent); }

.article-main { min-width: 0; }
.article-main > h1 { font-size: 24px; font-weight: 700; margin: 0 0 18px; line-height: 1.25; color: var(--text); }

/* Tělo článku (HTML z Freshdesku) */
.article-body { overflow-wrap: break-word; color: #444; }
.article-body p { margin: 0 0 12px; }
.article-body img { max-width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--border); margin: 8px 0; }
.article-body a { color: var(--accent); }
.article-body table { border-collapse: collapse; width: 100%; margin: 14px 0; display: block; overflow-x: auto; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; }
.article-body th { background: #f6f6f6; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 14px 16px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  margin: 14px 0;
}
.article-body pre code { color: inherit; background: none; padding: 0; }
.article-body pre span { color: inherit !important; background: none !important; }
.article-body code {
  background: #eef1f4;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

/* „Naposledy upraveno" */
.article-meta { font-size: 12px; color: var(--muted); margin: -10px 0 18px; }

/* Obsah (TOC) */
.article-toc {
  background: #f7fafc;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 12px 16px;
  margin: 0 0 20px;
  font-size: 13px;
}
.article-toc .toc-h {
  font-weight: 700; color: var(--text); text-transform: uppercase;
  letter-spacing: .03em; font-size: 11px; margin-bottom: 6px;
}
.article-toc ul { list-style: none; margin: 0; padding: 0; }
.article-toc li { margin: 3px 0; }
.article-toc li.lvl-h3 { padding-left: 16px; }
.article-toc a { color: var(--accent); }

/* Tlačítko „kopírovat" u bloků kódu */
.article-body pre { position: relative; }
.code-copy {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,.12); color: #cfd3dc;
  border: 1px solid rgba(255,255,255,.18); border-radius: 4px;
  font-size: 11px; padding: 3px 8px; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.article-body pre:hover .code-copy { opacity: 1; }
.code-copy:hover { background: rgba(255,255,255,.22); color: #fff; }

/* Kotvy nadpisů */
.article-body h2[id], .article-body h3[id] { scroll-margin-top: 16px; }
.heading-anchor {
  opacity: 0; margin-left: 8px; color: var(--muted); text-decoration: none;
  font-weight: 400; font-size: .75em; cursor: pointer;
}
.article-body h2:hover .heading-anchor,
.article-body h3:hover .heading-anchor { opacity: .65; }
.heading-anchor:hover { opacity: 1 !important; text-decoration: none; }

/* Akční tlačítka u článku */
.article-actions { display: flex; gap: 8px; margin: 2px 0 18px; flex-wrap: wrap; }
.act-btn {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--text);
}
.act-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Štítky (tagy) */
.article-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.article-tags .tag {
  background: #eaf1ff; color: var(--accent); font-size: 12px;
  padding: 2px 10px; border-radius: 11px;
}

/* Kontaktní poznámka */
.article-contact {
  margin-top: 28px; padding: 12px 16px; font-size: 13px; color: #3a4654;
  background: #f0f7fb; border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 4px;
}

/* Tisk / PDF */
@media print {
  body { background: #fff; }
  .site-header, .search-panel, .article-aside, .article-toc, .article-actions,
  .site-footer, .code-copy, .heading-anchor, .breadcrumb { display: none !important; }
  .page-wrap { max-width: none; padding: 0; }
  .panel, .content-panel { border: none; box-shadow: none; padding: 0; }
  .article-layout { display: block; }
  .article-main > h1 { margin-top: 0; }
  .article-body pre {
    white-space: pre-wrap; word-break: break-word;
    background: #f6f6f6; color: #111; border: 1px solid #ccc;
  }
  .article-body a { color: #111; text-decoration: underline; }
}

/* ---------- Patička ---------- */
.site-footer {
  text-align: center;
  color: #9a9a9a;
  font-size: 12px;
  margin-top: 22px;
}

/* ---------- Responsivní ---------- */
@media (max-width: 760px) {
  .kb-folders { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { order: 2; border-top: 1px solid var(--border); padding-top: 16px; }
  .site-title { font-size: 20px; }
  .logo { height: 36px; }
}
