/* Portal design "Pokoj" – calm, one accent colour, hairlines instead of shadows. See docs/DESIGN.md.
   Light theme by default, dark by the system setting or the theme switch (data-theme on <html>). */

@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-latin-wght.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #F6F6F3; --surface: #FFFFFF; --surface-2: #EFEFEA; --border: #E2E2DC; --border-strong: #B9B9B0;
  --text: #16181D; --muted: #5C6069; --accent: #0F5F57; --accent-text: #FFFFFF; --accent-soft: #E6F0EE;
  --warn: #7A4B05; --warn-soft: #FBF1DE; --warn-dot: #C27C0E; --bad: #A12A2A; --bad-soft: #FBEAEA;
  --active: #E8E8E2; --chart-last: #CFCFC7; --chart-2: #8C9099;
  --radius: 16px; --radius-sm: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121413; --surface: #1A1C1B; --surface-2: #232625; --border: #2A2D2B; --border-strong: #565A57;
    --text: #ECEDEA; --muted: #A3A6A1; --accent: #6CC7B8; --accent-text: #0C1311; --accent-soft: #1E2B28;
    --warn: #F0BE6A; --warn-soft: #2A2213; --warn-dot: #F0BE6A; --bad: #F2948C; --bad-soft: #2E1A19;
    --active: #2A2D2B; --chart-last: #444845; --chart-2: #8A8E8B;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121413; --surface: #1A1C1B; --surface-2: #232625; --border: #2A2D2B; --border-strong: #565A57;
  --text: #ECEDEA; --muted: #A3A6A1; --accent: #6CC7B8; --accent-text: #0C1311; --accent-soft: #1E2B28;
  --warn: #F0BE6A; --warn-soft: #2A2213; --warn-dot: #F0BE6A; --bad: #F2948C; --bad-soft: #2E1A19;
  --active: #2A2D2B; --chart-last: #444845; --chart-2: #8A8E8B;
}

* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  font-size: 1rem; line-height: 1.5; font-variant-numeric: tabular-nums;
}
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
h2 { font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 600; }
a { color: var(--accent); text-underline-offset: 3px; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted, small { color: var(--muted); }
small { font-size: .875rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* --- Layout: sidebar on desktop, slim top bar + bottom navigation on phones --- */
.layout { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; width: 232px; display: flex; flex-direction: column; gap: 4px;
  padding: 24px 12px 16px; background: var(--bg); border-right: 1px solid var(--border); z-index: 10;
}
.brand { display: block; padding: 4px 12px 20px; color: var(--text); text-decoration: none; }
.brand strong { display: block; font-size: 1.0625rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.brand small { display: block; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--active); color: var(--text); font-weight: 600; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 16px; }
.who { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 0 12px; }
.who span { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; font-weight: 400; }
.content { grid-column: 2; grid-row: 1 / span 3; padding: 32px 48px 48px; max-width: 1200px; width: 100%; }
.topbar { display: none; }
.bottomnav { display: none; }

@media (max-width: 959px) {
  .sidebar { display: none; }
  .layout { display: block; }
  /* the fixed bottom navigation (56 px + padding + safe area) never covers the last block */
  .content { padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); }
  .copy { margin-top: 32px; }
  .topbar { display: flex; align-items: center; padding: 12px 16px 0; }
  .topbar .brand { display: flex; align-items: center; min-height: 44px; padding: 0; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 0 0 0; z-index: 10;
    background: var(--surface); border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottomnav > a, .more-menu > summary {
    display: flex; align-items: center; justify-content: center; min-height: 48px; cursor: pointer; list-style: none;
    color: var(--muted); text-decoration: none; font-size: .9375rem; font-weight: 500; border-radius: var(--radius-sm);
  }
  .more-menu > summary::-webkit-details-marker { display: none; }
  .bottomnav a[aria-current="page"], .more-menu[data-current] > summary { color: var(--text); font-weight: 600; background: var(--active); }
  .more-menu[open] > summary { background: var(--active); color: var(--text); }
  .more-menu { position: static; }
  .more-panel {
    position: absolute; right: 8px; bottom: calc(100% + 8px); width: min(280px, calc(100vw - 16px)); display: flex;
    flex-direction: column; gap: 4px; padding: 8px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .more-panel a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm);
    color: var(--text); text-decoration: none; font-weight: 500; }
  .more-panel a:hover, .more-panel a[aria-current="page"] { background: var(--active); }
  .more-panel .theme-switch { margin-top: 4px; }
  .more-panel .btn-ghost { width: 100%; justify-content: flex-start; padding: 0 12px; }
}

.page-head { margin-bottom: 24px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.section-title { margin: 32px 0 12px; }
.copy { margin-top: 48px; color: var(--muted); font-size: .875rem; }
.foot-note { margin-top: 24px; color: var(--muted); font-size: .875rem; max-width: 70ch; }

/* --- Buttons, inputs --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); filter: none; }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--bad-soft); filter: none; }
.btn-ghost { background: transparent; color: var(--muted); padding: 0 10px; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); filter: none; }
.btn-icon { width: 44px; padding: 0; }
.btn-block { width: 100%; }
input, select {
  font: inherit; color: var(--text); background: var(--surface); min-height: 44px; padding: 8px 12px; width: 100%;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: 20px; min-height: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
label { font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field small { font-weight: 400; }

/* --- Blocks --- */
.card, .panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.panel { margin-top: 16px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head > p { color: var(--muted); }
.card.flush, .panel.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid > .card + .card { margin-top: 0; }

/* --- Prehľad: header, pill, segments --- */
.hero { margin-bottom: 24px; }
.stamp { color: var(--muted); font-size: .875rem; margin-bottom: 6px; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.hero h1 { font-size: 1.75rem; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); font-size: .9375rem; font-weight: 500; text-decoration: none;
}
a.pill:hover { filter: brightness(.97); }
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.ok .dot { background: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn-dot); flex: none; }
.dot.ok { background: var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 16px; }
.segments, .theme-switch {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-sm); background: var(--surface-2);
}
.segments > *, .theme-switch button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 0;
  border-radius: 8px; background: none; color: var(--muted); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
.segments > *:hover, .theme-switch button:hover { color: var(--text); }
.segments > [aria-pressed="true"], .segments > [aria-current="true"], .theme-switch button[aria-pressed="true"] {
  background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border);
}
.theme-switch { display: flex; }
.theme-switch button { flex: 1; padding: 0 8px; }

/* --- Prehľad: media in one block with 1 px dividers --- */
.media-grid {
  display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.cell { padding: 20px 24px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cell + .cell { border-left: 1px solid var(--border); }
.cell-name { font-size: .9375rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.big { font-size: 3rem; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.big .unit { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.big.none { color: var(--muted); }
.cell-sub { color: var(--muted); font-size: .9375rem; }
.cell-sub.warn, .warn-text { color: var(--warn); }
.period-month { display: none; }
:root[data-period="month"] .period-day { display: none; }
:root[data-period="month"] .period-month { display: block; }
.spark { width: 100%; height: 40px; display: block; color: var(--accent); margin-top: 10px; }
.spark polygon, .spark circle { display: none; }
@media (max-width: 899px) {
  .media-grid { grid-template-columns: 1fr; }
  .cell + .cell { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 520px) { .cell { padding: 16px 16px 8px; } .hero h1 { font-size: 1.5rem; } }

details.more { margin-top: auto; }
details.more > summary {
  display: flex; align-items: center; gap: 6px; min-height: 44px; list-style: none; cursor: pointer;
  color: var(--muted); font-size: .875rem; font-weight: 500;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "▾"; transition: transform .15s; }
details.more[open] > summary::after { transform: rotate(180deg); }
details.more > summary:hover { color: var(--text); }
details.more[open] { padding-bottom: 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 8px; }
.kpis dt { color: var(--muted); font-size: .875rem; }
.kpis dd { font-weight: 500; }
.notes { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: .9375rem; }

.panel > h2 { margin-bottom: 12px; }
.climate-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.climate-values dt { color: var(--muted); font-size: .9375rem; }
.climate-values dd { font-size: 2rem; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.climate-values dd .unit { font-size: .9375rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.climate-values .warn dd, .climate-values .warn dd .unit { color: var(--warn); }
.panel .cell-sub { margin-top: 8px; }
@media (max-width: 520px) { .climate-values dd { font-size: 1.5rem; } }

/* --- Charts (server-side SVG) --- */
.chart-card > .muted { margin: -8px 0 4px; font-size: .9375rem; }
.chart-card .legend { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 16px; list-style: none; padding: 0; color: var(--muted); font-size: .875rem; }
.legend .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.swatch-this { background: var(--accent); }
.swatch-last { background: var(--chart-last); }
.chart { width: 100%; height: auto; display: block; margin-top: 12px; }
.chart line.grid { stroke: var(--border); }
.chart line.baseline { stroke: var(--border-strong); stroke-width: 1; }
.chart text { fill: var(--muted); font-family: inherit; }
.chart text[font-weight="700"] { fill: var(--text); }
.chart .bar-value { fill: var(--text); font-weight: 500; }
.chart rect { rx: 4px; }
.chart .bar-this { fill: var(--accent); }
.chart .bar-last { fill: var(--chart-last); }
.chart .bar-main { fill: var(--accent); }
.chart .bar-alt { fill: var(--chart-last); }
.chart .line-main, .chart .line-alt { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .line-main { stroke: var(--accent); }
.chart .line-alt { stroke: var(--chart-2); }
.chart .area-main { fill: var(--accent); fill-opacity: .12; }
.chart .area-alt { fill: var(--chart-2); fill-opacity: .12; }
.chart .dot-main { fill: var(--accent); }
.chart .dot-alt { fill: var(--chart-2); }
.chart line.hline { stroke: var(--border-strong); stroke-dasharray: 5 5; }
.chart-narrow { display: none; }
@media (max-width: 640px) { .chart-wide { display: none; } .chart-narrow { display: block; } }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
thead th { color: var(--muted); font-size: .875rem; font-weight: 500; }
tbody tr:last-child > * { border-bottom: 0; }

/* --- Senzory: one list --- */
.sensor-list { list-style: none; margin: 0; padding: 0; }
.sensor-row {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 2fr) minmax(0, .8fr) minmax(0, 1.5fr);
  gap: 8px 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border);
}
.sensor-row:first-child { border-top: 0; }
.sensor-row.head { padding-top: 12px; padding-bottom: 12px; color: var(--muted); font-size: .875rem; font-weight: 500; }
.sensor-row.problem { background: var(--warn-soft); }
.s-name strong { display: block; font-weight: 500; }
.s-name small { display: block; font-size: .875rem; }
.s-state { display: flex; align-items: flex-start; gap: 10px; }
.s-state .dot { margin-top: 9px; }
.reason { display: block; }
.sensor-row .lbl { display: none; }
.sensor-row.problem .reason, .sensor-row.problem small { color: var(--warn); }
@media (max-width: 719px) {
  .sensor-row.head { display: none; }
  .sensor-row { grid-template-columns: 1fr 1fr; padding: 14px 16px; }
  .s-name, .s-state { grid-column: 1 / -1; }
  .sensor-row .lbl { display: block; }
}
.help h2 { margin-bottom: 8px; }
.help ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); max-width: 70ch; }
.help strong { color: var(--text); font-weight: 500; }

/* --- Tooltip "?" --- */
.tip { position: relative; display: inline-flex; vertical-align: middle; }
.tip > button {
  display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -6px 0; padding: 0;
  border: 0; background: none; color: var(--muted); cursor: help; border-radius: 50%;
}
.tip > button .icon { width: 16px; height: 16px; }
.tip > button:hover { color: var(--accent); }
.tip [role="tooltip"] {
  display: none; position: absolute; z-index: 20; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  width: max-content; max-width: min(280px, 80vw); padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--text); color: var(--bg); font-size: .875rem; font-weight: 400; line-height: 1.4;
  text-transform: none; letter-spacing: 0; white-space: normal;
}
.tip:hover [role="tooltip"], .tip:focus-within [role="tooltip"], .tip.open [role="tooltip"] { display: block; }

/* --- Messages, empty states, badges --- */
.msg { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; }
.msg.ok { background: var(--accent-soft); color: var(--accent); }
.msg.error { background: var(--bad-soft); color: var(--bad); }
.msg .icon { margin-top: 2px; }
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: .875rem; font-weight: 500;
  background: var(--surface-2); color: var(--muted); }
.empty { text-align: center; padding: 32px 20px; color: var(--muted); }
.empty .icon { width: 32px; height: 32px; color: var(--border-strong); margin-bottom: 8px; }
.empty strong { display: block; color: var(--text); font-size: 1.0625rem; font-weight: 500; margin-bottom: 4px; }
.sensor-name { font-weight: 500; }
.sensor-name small { display: block; font-weight: 400; }

/* --- Export steps --- */
.steps { display: grid; gap: 16px; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 0 16px; }
.step-no {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600;
  background: var(--surface-2); color: var(--text);
}
.step h2 { line-height: 32px; margin-bottom: 8px; }
.step fieldset { border: 0; padding: 0; margin: 0; min-width: 0; grid-column: 2; }
.step p.muted { margin: 4px 0 12px; }
@media (max-width: 520px) { .step { grid-template-columns: 1fr; } .step fieldset { grid-column: 1; } .step-no { margin-bottom: 4px; } }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-weight: 500;
}
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-card span { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; min-width: 220px; }
.choice-card small { font-weight: 400; }
@media (max-width: 520px) { .choice-card, .choice-card span { width: 100%; min-width: 0; } }
.checklist { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.check {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; min-height: 44px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check input { margin-top: 2px; }
.check .media-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: 6px; }
.check small { display: block; font-weight: 400; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > .field { flex: 1 1 160px; }
.custom-dates { margin-top: 12px; }
.custom-dates[hidden] { display: none; }
.sub-choices { margin-top: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 4px; }

/* --- Login --- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.login-box { width: 100%; max-width: 420px; }
.login-box .brand { text-align: center; padding: 0 0 24px; }
.login-box .brand strong { font-size: 1.5rem; }
.login-box form { display: grid; gap: 16px; }

/* --- Grafy --- */
.boards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); list-style: none; padding: 0; margin-bottom: 20px; }
.board a.board-link { display: block; height: 100%; min-height: 44px; padding: 14px 16px; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.board a.board-link:hover { border-color: var(--border-strong); }
.board a.board-link[aria-current] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.board strong { display: block; font-weight: 500; }
.board span { color: var(--muted); font-size: .9375rem; }
.embed iframe { width: 100%; height: 72vh; min-height: 480px; border: 0; border-radius: var(--radius-sm); background: var(--surface-2); margin-top: 12px; }

/* --- Grafy: Jednoduché --- */
.toolbar-between { justify-content: space-between; margin: 0 0 16px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 4px; }
.tabs a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.tabs a:hover { background: var(--surface-2); color: var(--text); }
.tabs a[aria-current="page"] { background: var(--active); color: var(--text); font-weight: 600; }
.tabs + .toolbar, .tabs + .media-grid, .tabs + .panel { margin-top: 12px; }
.toolbar + .media-grid, .toolbar + .panel { margin-top: 16px; }
.stats .cell { padding-bottom: 20px; }
.graf-empty { text-align: center; padding: 32px 20px; }
.graf-empty .cell-sub { margin-top: 4px; }
.swatch-grey { background: var(--chart-2); }
.table-wrap.scroll { max-height: 360px; overflow-y: auto; }
.chart-card details.more > summary { margin-top: 4px; }
@media (max-width: 520px) {
  .stats .big { font-size: 2.25rem; }
  .stats .cell { padding-bottom: 12px; }
  .toolbar .segments { width: 100%; }
  .toolbar .segments > * { flex: 1; padding: 0 8px; }
  .toolbar-between .btn { width: 100%; }
}

/* --- Správa --- */
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 160px; width: auto; }
.user-list { list-style: none; padding: 0; }
.user-list > li { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(0, 2fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.user-list > li:last-child { border-bottom: 0; }
@media (max-width: 720px) { .user-list > li { grid-template-columns: 1fr; } }
.tools { list-style: none; padding: 0; display: grid; gap: 8px; }
.tools a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 44px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-weight: 500; }
.tools a:hover { background: var(--surface-2); }
.tools small { display: block; font-weight: 400; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 24px; max-width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog h2 { margin-bottom: 8px; }
dialog .actions { justify-content: flex-end; margin-top: 20px; }

/* --- Desktop: slightly larger secondary text --- */
@media (min-width: 960px) {
  .muted, .notes { font-size: 1rem; }
  .hero h1 { font-size: 2rem; }
}
