:root {
  color-scheme: light;

  --plane: #f9f9f7;
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --good: #006300;
  --wash: rgba(42, 120, 214, 0.07);

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-muted: #898781;
  --series-reference: #52514e;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;

    --plane: #0d0d0d;
    --surface-1: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --good: #0ca30c;
    --wash: rgba(57, 135, 229, 0.14);

    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-muted: #898781;
    --series-reference: #c3c2b7;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px clamp(12px, 3vw, 40px) 48px;
  background: var(--plane);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
  color: var(--text-secondary);
}

a {
  color: var(--series-1);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-head {
  margin-bottom: 20px;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--text-secondary);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.tile-label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tile-value {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  font-weight: 600;
}

.table-section,
.chart {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin: 0 0 20px;
}

.section-head,
.chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filters {
  display: flex;
  gap: 4px;
}

.filters a {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 13px;
}

.filters a:hover {
  background: var(--wash);
  text-decoration: none;
}

.filters a.active {
  background: var(--wash);
  border-color: var(--series-1);
  color: var(--text-primary);
}

.table-scroll,
.chart-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-bottom: 1px solid var(--axis);
}

td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--grid);
}

th.num,
td.num {
  text-align: right;
}

.badge {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}

tr.notified .badge {
  border-color: var(--good);
  color: var(--good);
  font-weight: 600;
}

.good {
  color: var(--good);
  font-weight: 600;
}

/* Stav ponuky nesie krúžok, číslo zostáva v čitateľnej farbe textu. */
td.edge {
  white-space: nowrap;
}

.muted {
  color: var(--text-muted);
}

.empty {
  margin: 8px 0;
  color: var(--text-secondary);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-secondary);
  font-size: 13px;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.chart-svg {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
}

.chart-svg .grid {
  stroke: var(--grid);
  stroke-width: 1;
}

.chart-svg .day-rule {
  stroke: var(--grid);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.chart-svg .hour-rule {
  stroke: var(--grid);
  stroke-width: 1;
  stroke-dasharray: 1 6;
}

.chart-svg .axis-day {
  fill: var(--text-secondary);
  font-weight: 600;
}

.chart-svg .axis {
  stroke: var(--axis);
  stroke-width: 1;
}

.chart-svg .rule {
  stroke: var(--axis);
  stroke-width: 2;
}

.chart-svg .rule-strong {
  stroke: var(--good);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}

.chart-svg .rule-label {
  fill: var(--text-secondary);
  font-size: 11px;
}

.chart-svg .axis-label {
  fill: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chart-svg .series-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-svg .mark {
  stroke: var(--surface-1);
  stroke-width: 2;
}

/* Farby sérií sa priraďujú triedou, nie inline štýlom, kvôli prísnemu CSP. */
.swatch.s1 { background: var(--series-1); }
.swatch.s2 { background: var(--series-2); }
.swatch.s3 { background: var(--series-3); }
.swatch.s-muted { background: var(--series-muted); }
.swatch.s-reference { background: var(--series-reference); }

.chart-svg .mark.s1 { fill: var(--series-1); }
.chart-svg .mark.s2 { fill: var(--series-2); }
.chart-svg .mark.s3 { fill: var(--series-3); }
.chart-svg .mark.s-muted { fill: var(--series-muted); }

.chart-svg .series-line.s-reference { stroke: var(--series-reference); }
.chart-svg .series-line.s1 { stroke: var(--series-1); }

.page-foot {
  color: var(--text-muted);
  font-size: 12px;
}

.table-scroll {
  max-height: 60vh;
  overflow: auto;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-1);
}

.load-more {
  margin: 12px 0 0;
}

.load-more a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 13px;
}

.load-more a:hover {
  background: var(--wash);
  color: var(--text-primary);
  text-decoration: none;
}

/* Prémia: bez nej zelená, do rozpočtu daného prahom žltá, nad ním červená.
   Odtiene sú volené na čitateľnosť textu, nie ako výplň značky. */
:root {
  --premium-none: #006300;
  --premium-ok: #8a5a00;
  --premium-high: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --premium-none: #0ca30c;
    --premium-ok: #fab219;
    --premium-high: #e66767;
  }
}

td.premium-none {
  color: var(--premium-none);
  font-weight: 600;
}

td.premium-ok {
  color: var(--premium-ok);
  font-weight: 600;
}

td.premium-high {
  color: var(--premium-high);
}

/* Nápoveda pri názve stĺpca. Natívny tooltip, žiadny skript – stránka je bez JavaScriptu. */
.hint {
  display: inline-block;
  margin-left: 4px;
  width: 13px;
  height: 13px;
  border: 1px solid var(--axis);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 12px;
  text-align: center;
  cursor: help;
  user-select: none;
}

.hint:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

th.num .hint {
  margin-left: 3px;
}

/* SHADOW: ponuka by prešla, ale notifikácie sú vypnuté – slabšia zelená než NOTIFY. */
:root {
  --good-weak: #4b7f4b;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --good-weak: #6aa06a;
  }
}

tr.shadowed .badge {
  border-color: var(--good-weak);
  color: var(--good-weak);
}

/* Zvýraznenie riadku pod kurzorom. Polopriehľadné, aby sa podfarbenie NOTIFY nestratilo. */
:root {
  --row-hover: rgba(11, 11, 11, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --row-hover: rgba(255, 255, 255, 0.06);
  }
}

tbody tr:hover td {
  background: var(--row-hover);
}
