/* ==========================================================================
   Interaktívny report — moderný čistý dizajn s light/dark témou
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-card: #ffffff;
  --text: #1f2933;
  --text-muted: #5e6b7a;
  --primary: #1a3a5c;
  --primary-light: #2e5e8a;
  --accent: #1a9850;
  --accent-warn: #d73027;
  --accent-export: #f0b132;
  --border: #e3e6eb;
  --border-strong: #c8cdd4;
  --highlight: #fff8d6;
  --table-stripe: #f5f7fa;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 6px;
  --max-width: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0f141a;
    --bg-soft: #1a1f27;
    --bg-card: #1a1f27;
    --text: #e4e8ec;
    --text-muted: #98a2b3;
    --primary: #6fa8dc;
    --primary-light: #93c2ee;
    --border: #2a3038;
    --border-strong: #3a414b;
    --highlight: #4a3f1a;
    --table-stripe: #161b22;
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #0f141a;
  --bg-soft: #1a1f27;
  --bg-card: #1a1f27;
  --text: #e4e8ec;
  --text-muted: #98a2b3;
  --primary: #6fa8dc;
  --primary-light: #93c2ee;
  --border: #2a3038;
  --border-strong: #3a414b;
  --highlight: #4a3f1a;
  --table-stripe: #161b22;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Top bar ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 16px;
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand strong { color: var(--primary); font-size: 15px; }
.brand .meta { font-size: 12px; color: var(--text-muted); }
.actions { display: flex; align-items: center; gap: 8px; }

#theme-toggle, .btn-pdf {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
#theme-toggle:hover, .btn-pdf:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== Layout ============================================================= */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  padding: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .toc { display: none; }
}

/* ===== TOC ================================================================ */
.toc {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.toc-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.toc-title {
  margin: 0 0 8px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}
#toc-nav ul { list-style: none; padding-left: 0; margin: 0; }
#toc-nav ul ul { padding-left: 12px; margin-top: 2px; }
#toc-nav li { margin: 3px 0; }
#toc-nav a {
  display: block;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 3px 6px;
  border-radius: 3px;
  border-left: 2px solid transparent;
}
#toc-nav a:hover {
  color: var(--primary);
  background: var(--bg-soft);
}
#toc-nav a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}

/* ===== Content ============================================================ */
.content { min-width: 0; max-width: 100%; }
.content h1 {
  font-size: 32px;
  color: var(--primary);
  margin: 0 0 8px 0;
  line-height: 1.2;
}
.content h2 {
  font-size: 24px;
  color: var(--primary);
  margin: 36px 0 12px 0;
  padding-top: 12px;
  border-top: 2px solid var(--border);
}
.content h2:first-of-type { border-top: none; padding-top: 0; }
.content h3 {
  font-size: 19px;
  color: var(--primary-light);
  margin: 24px 0 8px 0;
}
.content h4 { font-size: 16px; margin: 18px 0 6px 0; }

.content p { margin: 8px 0 12px 0; }
.content strong { color: var(--text); font-weight: 600; }
.content em { color: var(--text-muted); }

.content ul, .content ol { padding-left: 24px; margin: 8px 0 14px 0; }
.content li { margin: 4px 0; }

.content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

.content code {
  font-family: "JetBrains Mono", Consolas, monospace;
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--primary-light);
}

.content pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  overflow-x: auto;
  font-size: 13px;
}

.content pre code { background: transparent; padding: 0; }

.content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--bg-soft);
  padding: 8px 14px;
  margin: 12px 0;
  color: var(--text);
}

.content a { color: var(--primary-light); }
.content a:hover { text-decoration: none; }

/* ===== Tables ============================================================= */
.content table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}

.content th, .content td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.content th {
  background: var(--bg-soft);
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid var(--border-strong);
}

.content tr:nth-child(even) td { background: var(--table-stripe); }
.content tr:hover td { background: var(--highlight); transition: background 0.15s; }

.content tr:last-child td {
  border-bottom: none;
  font-weight: 600;
  background: var(--bg-soft) !important;
}

.content td[align="right"], .content th[align="right"] { text-align: right; }
.content td[align="center"], .content th[align="center"] { text-align: center; }

/* ===== Images ============================================================= */
.content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ===== Plotly chart containers =========================================== */
.chart {
  width: 100%;
  min-height: 460px;
  margin: 20px 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 8px;
}

/* ===== Footer ============================================================= */
.footer {
  margin-top: 60px;
  padding: 24px 0;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
}
.footer p {
  margin: 4px 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ===== Print -- otvorene v prehliadaci a Ctrl+P ========================== */
@media print {
  .topbar, .toc, .footer, #theme-toggle, .btn-pdf { display: none !important; }
  .layout { grid-template-columns: 1fr; padding: 0; }
  body { font-size: 11pt; }
  .content h2 { page-break-after: avoid; }
  .content table, .content img, .chart { page-break-inside: avoid; }
}

/* ===== Drobne ============================================================ */
.cover { display: none; } /* cover pouzivame len v PDF */


/* ===== NAVRH 6 — Hero + dlazdice ========================================== */
body.design6 { background: var(--bg-soft); }
/* plna sirka obrazovky - obsah sa tiahne na celu dostupnu sirku */
.wrap-narrow, .tn-in, .ft-in,
.stats, .tiles, .layout6 { max-width: none; margin-inline: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Horny svetly panel s navigaciou --- */
.topnav6 {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.tn-in { display: flex; align-items: center; gap: 16px; padding: 12px 32px; flex-wrap: wrap; }
.topnav6 .brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 16px; color: var(--text); text-decoration: none;
}
.topnav6 .brand .dot {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #fb7185);
  display: grid; place-items: center; color: #fff;
}
.topnav6 .links { display: flex; gap: 4px; flex-wrap: wrap; margin-left: 8px; }
.topnav6 .links a {
  padding: 7px 12px; border-radius: 9px; font-size: 14px;
  color: var(--text-muted); text-decoration: none;
}
.topnav6 .links a:hover { background: var(--bg-soft); color: var(--primary); }
.topnav6 .links a.active { background: #0f172a; color: #fff; font-weight: 600; }
.topnav6 .links a.nav-ext { color: var(--primary-light); font-style: italic; }
.tbtn {
  margin-left: auto; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; width: 38px; height: 38px; cursor: pointer; font-size: 16px;
}
.tbtn:hover { border-color: var(--primary); }

/* --- Hero --- */
.hero { background: linear-gradient(135deg, #fff7ed, #fef2f2); padding: 54px 24px 70px; }
:root[data-theme="dark"] .hero,
:root[data-theme="auto"] .hero { } /* hero ostava teply aj v tmavej teme */
.hero-in { max-width: 760px; margin: 0 auto; text-align: center; }
.hero .kick {
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
  color: #b45309; font-weight: 700;
}
.hero h1 { font-size: 40px; line-height: 1.12; margin: 12px 0 14px; color: #0f172a; }
.hero .lead { font-size: 18px; line-height: 1.6; color: #475569; margin: 0 auto 28px; max-width: 620px; }
.hero .cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn { padding: 12px 22px; border-radius: 12px; font-weight: 600; text-decoration: none; font-size: 15px; }
.btn.p { background: #f59e0b; color: #fff; }
.btn.p:hover { background: #d97706; }
.btn.s { background: #fff; color: #0f172a; border: 1px solid #e2e8f0; }
.btn.s:hover { border-color: #cbd5e1; }

/* --- KPI pas (prekryva spodok hera) --- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px;
  padding: 0 32px; margin-top: -42px;
}
.stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px; text-align: center; box-shadow: var(--shadow-lg);
}
.stat .v { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat .v .val-good, .stat .v .val-bad { font-size: inherit; }
.stat .l { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }

/* --- Dlazdice --- */
.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px;
  padding: 0 32px; margin-top: 28px;
}
.tile {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 18px; padding: 22px; text-decoration: none; color: inherit;
  transition: transform .15s, box-shadow .15s; box-shadow: var(--shadow);
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile .ic {
  width: 46px; height: 46px; border-radius: 12px; background: var(--bg-soft);
  display: grid; place-items: center; font-size: 22px; margin-bottom: 12px;
}
.tile h3 { margin: 0 0 6px; font-size: 17px; color: var(--text); }
.tile p { margin: 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.5; }

/* --- Hlavny obsah na prehlade (plna sirka) --- */
.wrap-narrow { padding: 36px 32px 10px; }
.content.panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px 32px; box-shadow: var(--shadow);
}
.content.panel.reading { max-width: none; margin: 0; }
.content.panel h1 { border-top: none; margin-top: 0; }

/* --- Hlavicka podstranok (gradient) --- */
.pagehead { background: linear-gradient(135deg, #fff7ed, #fdf2f8); padding: 30px 32px 26px; }
.ph-in { }
.pagehead .crumb { font-size: 12.5px; color: #b45309; font-weight: 600; margin-bottom: 6px; }
.pagehead .ph-title { margin: 0; font-size: 30px; color: #0f172a; }

/* --- Layout podstranok: lava navigacia po stranke + obsah --- */
.layout6 {
  display: grid; grid-template-columns: 260px 1fr; gap: 28px;
  padding: 26px 32px 12px; align-items: start;
}
.side-l { position: sticky; top: 78px; }
.side-inner {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; box-shadow: var(--shadow);
  max-height: calc(100vh - 100px); overflow-y: auto;
}
.side-toc-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin: 0 0 8px 4px;
}
.side-l #toc-nav ul { list-style: none; padding-left: 0; margin: 0; }
.side-l #toc-nav ul ul { padding-left: 12px; margin: 2px 0; }
.side-l #toc-nav li { margin: 2px 0; }
.side-l #toc-nav a {
  display: block; padding: 5px 10px; border-radius: 8px; font-size: 13px;
  color: var(--text-muted); text-decoration: none; border-left: 2px solid transparent;
}
.side-l #toc-nav a:hover { color: var(--primary); background: var(--bg-soft); }
.side-l #toc-nav a.active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.main-d { min-width: 0; }

/* --- Footer --- */
.footer6 { margin-top: 30px; border-top: 1px solid var(--border); background: var(--bg-card); }
.ft-in { padding: 22px 32px; color: var(--text-muted); font-size: 12.5px; line-height: 1.6; }
.ft-in p { margin: 4px 0; }

/* Spolocne */
.val-good { color: #1a9850; font-weight: 700; }
.val-bad  { color: #d8443c; font-weight: 700; }
.shop-note { font-size: 12px; color: var(--text-muted, #64748b); }
.schema { margin: 22px 0; text-align: center; }
.schema img {
  width: 100%; max-width: 1180px; height: auto; display: block; margin: 0 auto;
  border: 1px solid var(--border, #cfd8e3); border-radius: var(--radius, 10px);
  background: #fff; box-shadow: 0 1px 4px rgba(15,23,42,0.08);
}
.schema figcaption { font-size: 12.5px; color: var(--text-muted, #64748b); margin-top: 8px; }

/* --- Responzivita --- */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: 1fr 1fr; }
  .layout6 { grid-template-columns: 1fr; }
  .side-l { position: static; }
  .side-inner { max-height: none; }
  .hero h1 { font-size: 30px; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  .content.panel { padding: 18px 16px; }
}
