@font-face { font-family: 'Unbounded'; font-weight: 200 900; font-display: swap; src: url('fonts/unbounded-latin.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --page: #0a0b0f;
  --surface: #121419;          /* povrch kariet a grafov (farby radov sú overené práve naň) */
  --surface-2: #191c22;
  --surface-3: #20242c;
  --line: #22252c;             /* mriežka */
  --axis: #343842;             /* základná čiara */
  --border: rgba(255, 255, 255, 0.07);
  --ink: #f4f6fb;
  --ink-2: #bcc3cf;
  --muted: #828a99;
  --accent: #3b6cf6;           /* len ovládanie (aktívna stránka, tlačidlá, panely), nikdy dáta */
  --brand: #7ff4f2;            /* „GOD" v logu */
  --good: #34d17a;
  --warn: #fab219;
  --bad: #f2605e;
  --radius: 18px;
  --pad: clamp(14px, 2vw, 28px);
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0; color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.ico { flex: none; }

body.demo::before {
  content: 'DEMO: vymyslené dáta na ukážku, nič sa nezbiera'; display: block; padding: 6px var(--pad);
  background: var(--warn); color: #0b0b0b; font-weight: 600; font-size: 13px; text-align: center;
}

/* ── rám: úzky pás s ikonami (názov stránky v bubline) a obsah ── */
.shell { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: start; }
.shell[hidden] { display: none; }
.side {
  position: sticky; top: 14px; height: calc(100vh - 28px); margin: 14px 0 14px 14px; padding: 16px 0;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand img { height: 28px; width: auto; }
.brand span, .brand b { display: none; font: 700 13px/1 'Unbounded', system-ui, sans-serif; text-transform: uppercase; }
.brand b { color: var(--brand); }
.tabs { display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tab, .logout {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 13px;
  border: 1px solid var(--border); text-decoration: none; color: var(--ink-2); white-space: nowrap; font-weight: 550;
}
.tab span, .logout span { display: none; }
.tab:hover, .logout:hover { background: var(--surface-2); color: var(--ink); }
.tab.on { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 22px rgba(59, 108, 246, 0.35); }
.logout { border-color: transparent; color: var(--muted); }
.main { min-width: 0; }

/* ── filtre (jeden riadok nad všetkým, platia pre celú stránku) ── */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 22px var(--pad) 0; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.seg button:hover { background: var(--surface-2); color: var(--ink); }
.seg button.on { background: var(--surface-3); color: var(--ink); font-weight: 650; }
.dates { display: flex; align-items: center; gap: 6px; }
input[type='date'], select, .note-form input {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; font-size: 14px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.freshness { font-size: 13px; text-decoration: none; }
.freshness:hover { color: var(--ink); }
.run-now { margin-left: auto; }
.filters > .freshness:not(.run-now + .freshness) { margin-left: auto; }

/* ── obsah ── */
.view { padding: 18px var(--pad) 60px; transition: opacity 0.15s; }
.view.loading { opacity: 0.5; pointer-events: none; }
.view-head { margin: 6px 0 16px; }
.view-head h1 { font: 700 24px/1.2 'Unbounded', system-ui, sans-serif; text-transform: uppercase; }
.section { margin-top: 30px; }
.section-head { margin-bottom: 12px; }
.section-head h2 { font-size: 18px; }
.section-head p { margin: 4px 0 0; max-width: 80ch; font-size: 14px; }

.up { color: var(--good); font-weight: 650; }
.down { color: var(--bad); font-weight: 650; }
.flat { color: var(--muted); font-weight: 650; }

/* ── dlaždice na stránkach platforiem ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 6px 0 22px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.tile-label { color: var(--ink-2); font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.tile-label::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--ink); flex: none; }
.tile-value { font-size: 28px; font-weight: 650; margin: 6px 0 2px; letter-spacing: -0.01em; }
.tile-delta, .tile-prev { font-size: 13px; color: var(--ink-2); }
.tile-prev { margin-top: 2px; }
.tile-spark { margin-top: 8px; height: 32px; }
.tile-value.none { color: var(--muted); font-size: 20px; font-weight: 550; }

/* ── prehľad: spojené dlaždice ako v Power BI (1 px škáry medzi nimi tvoria mriežku), dva samostatné bloky ── */
.pbi {
  display: grid; gap: 1px; overflow: hidden;
  background: var(--axis); border: 1px solid var(--axis); border-radius: var(--radius);
}
.pbi-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pbi-platforms { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 18px; }
.ptile { --tint: var(--accent); min-width: 0; padding: 18px 20px 14px; background: var(--surface); display: flex; flex-direction: column; }
.ptile.big { padding: 22px 28px 18px; background: radial-gradient(80% 90% at 100% 0%, rgba(59, 108, 246, 0.14), transparent 70%), var(--surface); }
.ptile-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ptile-bar { width: 3px; height: 18px; border-radius: 2px; background: var(--tint); flex: none; }
.big .ptile-bar { background: var(--ink); }
.ptile-title { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 650; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.big .ptile-title { font-size: 17px; }
a.ptile-title:hover { text-decoration: underline; }
.ptile-ic {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: #07080b; border: 1px solid var(--border); color: var(--ink);
}
.ptile-ic .ico { width: 17px; height: 17px; }
.ptile-now { margin-top: 12px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; color: var(--muted); font-size: 13px; }
.ptile-now b { color: var(--ink); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.big .ptile-now b { font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; }
/* veľké dlaždice majú riadok „teraz" rovnako vysoký, aby riadky dnes/týždeň/mesiac sedeli vedľa seba */
.big .ptile-now { min-height: 44px; align-items: flex-end; }
.ptile-caption { margin-top: 14px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.ptile-rows { margin: 4px 0 0; display: grid; }
.ptile-rows div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ptile-rows div:last-child { border-bottom: 0; }
.ptile-rows dt { color: var(--ink-2); font-size: 14px; }
.ptile-rows dd { margin: 0; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.big .ptile-rows dd { font-size: 32px; }
.ptile-rows dd.muted { font-size: 14px; font-weight: 500; }
/* obdobie zvolené hore */
.ptile-rows div.on { margin: 4px -10px 0; padding: 9px 10px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.ptile-rows div.on dt { color: var(--ink); font-weight: 600; }

.pmatrix-wrap { margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--line); }
.pmatrix { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; table-layout: fixed; }
.pmatrix th, .pmatrix td { padding: 6px 4px; border: 0; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pmatrix thead th { padding-bottom: 8px; }
.pmatrix tbody th { width: 30%; text-align: left; color: var(--ink-2); font-weight: 450; padding-left: 0; }
.pmatrix td { font-weight: 700; color: var(--ink); }
.pmatrix td.zero { color: var(--muted); font-weight: 500; }
.pmatrix tr.on > * { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.pmatrix tr.on th { color: var(--ink); font-weight: 600; padding-left: 10px; border-radius: 10px 0 0 10px; }
.pmatrix tr.on td:last-child { border-radius: 0 10px 10px 0; }
.pm-ic {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: #07080b; border: 1px solid var(--border);
}
.pm-ic .ico { width: 16px; height: 16px; }
.pmatrix th.off .pm-ic { opacity: 0.35; }
.ptile.off .ptile-title { color: var(--ink-2); }
.ptile.off .ptile-ic { color: var(--muted); }
.ptile-off { margin: auto 0; padding: 28px 0; color: var(--muted); font-size: 14px; text-align: center; }
@media (max-width: 1100px) { .pbi-platforms { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .pbi-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .pbi-platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ptile.big { padding: 18px 18px 14px; }
  .pmatrix tbody th { width: 34%; font-size: 13px; }
  .pm-ic { width: 26px; height: 26px; }
  .ptile { padding: 14px 14px 10px; }
  .ptile-rows dd { font-size: 20px; }
  .big .ptile-rows dd { font-size: 26px; }
  .ptile-ic { display: none; }
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 16px; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.chip:hover { color: var(--ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ── karty s grafmi a rozpadmi ── */
.grid-2, .grid-3 { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.card {
  min-width: 0; padding: 16px 18px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: radial-gradient(90% 70% at 50% -25%, rgba(59, 108, 246, 0.13), transparent 70%), var(--surface);
}
.card.wide { grid-column: 1 / -1; }
.section > .card + .card { margin-top: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.card-head h3 { font-size: 16px; font-weight: 600; }
.card-head p { margin: 2px 0 0; font-size: 13px; }
.card-actions { display: flex; gap: 4px; flex: none; }
.ghost { border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 5px 10px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.ghost:hover { color: var(--ink); background: var(--surface-3); }
.ghost:disabled { opacity: 0.5; }
.primary {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--accent); color: #fff; font-weight: 650;
  border-radius: 12px; padding: 9px 16px; cursor: pointer; box-shadow: 0 8px 22px rgba(59, 108, 246, 0.28);
}
.primary .ico { width: 17px; height: 17px; }
.primary:disabled { opacity: 0.6; cursor: default; }

/* ── grafy ── */
.chart-plot { position: relative; }
.chart svg { display: block; overflow: visible; }
.gridline { stroke: var(--line); stroke-width: 1; }
.baseline { stroke: var(--axis); stroke-width: 1; }
.tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.end-label { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.end-dot, .hover-dot { stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.crosshair { stroke: var(--muted); stroke-width: 1; pointer-events: none; }
.bar { transition: opacity 0.1s; }
.bar.active { opacity: 0.75; }
.note-line { stroke: var(--warn); stroke-width: 1; opacity: 0.45; pointer-events: none; }
.note-dot { fill: var(--warn); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.chart-empty { color: var(--muted); padding: 30px 0; text-align: center; margin: 0; font-size: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.key-line { display: inline-block; width: 14px; height: 2px; border-radius: 2px; flex: none; }
.key-rect { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px; max-width: 280px;
  background: #f4f6fb; color: #0a0b0f; border-radius: 12px; padding: 8px 11px; font-size: 13px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.tip-head { color: #555c69; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row strong { font-variant-numeric: tabular-nums; }
.tip-row span { color: #3b414c; }
.tip-note { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(0, 0, 0, 0.12); color: #8a5a00; }

/* ── rozpady (vodorovné pruhy) a lievik ── */
.bars, .funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.bars li, .funnel li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(60px, 1fr) auto 64px; align-items: center; gap: 10px; font-size: 13.5px; }
.funnel li { grid-template-columns: minmax(0, 1fr) minmax(80px, 2fr) auto 110px; font-size: 14.5px; }
.bar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.bar-track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.bar-ch { font-size: 12px; text-align: right; font-weight: 500; }

/* ── tabuľky ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--axis); padding: 0; white-space: nowrap; }
th.num { text-align: right; }
th .sort { border: 0; background: none; padding: 7px 8px; cursor: pointer; color: inherit; font-weight: 600; width: 100%; text-align: inherit; }
th .sort:hover { color: var(--ink); }
td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 220px; }
td.text a { text-decoration: none; color: var(--ink); }
td.text a:hover { text-decoration: underline; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
.status { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.status i { font-style: normal; }
.status.ok { color: var(--good); }
.status.err { color: var(--bad); }
.status.run { color: var(--warn); }
.status.off { color: var(--muted); }

.note-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.note-form label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.note-form label:nth-child(3) { flex: 1; min-width: 240px; }
.note-form input { width: 100%; }

.empty-state { padding: 60px 0; max-width: 60ch; }
.empty-state h2 { margin-bottom: 8px; }

/* ── užšie obrazovky: menu hore ako vodorovný pás ── */
@media (max-width: 960px) {
  .shell { display: block; }
  .side {
    position: sticky; top: 0; z-index: 10; height: auto; margin: 0; border-radius: 0; border-width: 0 0 1px;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px var(--pad);
    background: rgba(18, 20, 25, 0.96);
  }
  .brand span, .brand b { display: inline; }
  .tabs { order: 3; flex-basis: 100%; flex-direction: row; overflow-x: auto; }
  .tab { display: flex; gap: 8px; width: auto; height: 40px; padding: 0 12px; }
  .tab span { display: inline; }
  .logout { margin-left: auto; }
}
@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 12px; }
  .tile-value { font-size: 23px; }
  .run-now { margin-left: 0; }
  .bars li { grid-template-columns: minmax(0, 1fr) 60px auto 54px; }
  .funnel li { grid-template-columns: minmax(0, 1fr) 70px auto; }
  .funnel .bar-ch { display: none; }
}

/* ── prihlásenie (heslo odomkne zašifrované dáta priamo v prehliadači) ── */
.login {
  min-height: 100vh; width: min(360px, calc(100% - 48px)); margin: 0 auto; display: grid; gap: 12px;
  align-content: center; text-align: center;
}
.login[hidden] { display: none; }
.login img { justify-self: center; height: auto; }
.login h1 { margin: 4px 0 18px; font: 700 22px/1.2 'Unbounded', system-ui, sans-serif; text-transform: uppercase; }
.login h1 b { color: var(--brand); }
.login label { text-align: left; font-size: 14px; color: var(--ink-2); }
.login input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 16px; }
.login .primary { justify-content: center; padding: 14px 16px; font: 700 15px/1 'Unbounded', system-ui, sans-serif; text-transform: uppercase; }
.login-error { color: var(--bad); margin: 4px 0 0; }
