:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #16181d;
  --muted: #5d6573;
  --border: #dde1e7;
  --accent: #0f766e;
  --accent-contrast: #ffffff;
  --good: #15803d;
  --bad: #b91c1c;
  --warn: #b45309;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1f232b;
    --text: #e7e9ee;
    --muted: #9aa3b2;
    --border: #2b303a;
    --accent: #2dd4bf;
    --accent-contrast: #062421;
    --good: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top {
  position: sticky; top: 0; z-index: 10; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.top-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 16px; }
.brand { font-weight: 700; color: var(--text); white-space: nowrap; }
nav.main { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
nav.main::-webkit-scrollbar { display: none; }
nav.main a { padding: 6px 10px; border-radius: 8px; color: var(--muted); white-space: nowrap; font-size: 14px; }
nav.main a.active, nav.main a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 12px; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; } }
.tile .label { font-size: 13px; color: var(--muted); }
.tile .value { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tile .unit { font-size: 13px; color: var(--muted); margin-left: 3px; }
.tile .delta { font-size: 12px; }
.up-good { color: var(--good); } .up-bad { color: var(--bad); }
.chart { width: 100%; height: 260px; }
.chart.tall { height: 360px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.H, .badge.failed { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.badge.L { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.extracted { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.reviewed, .badge.done { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
form.inline { display: inline; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; width: 100%;
}
textarea { min-height: 90px; }
input[type=checkbox] { width: auto; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-contrast);
  padding: 7px 14px; border-radius: 8px; display: inline-block; white-space: nowrap;
}
button.secondary, .btn.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn:hover { text-decoration: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.flash { padding: 10px 14px; border-radius: 8px; background: var(--surface-2); margin-bottom: 16px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.review-table input, .review-table select { padding: 4px 6px; font-size: 14px; min-width: 70px; }
.review-table .name { min-width: 160px; }
pre.text { white-space: pre-wrap; font-size: 12px; max-height: 420px; overflow: auto; background: var(--surface-2); padding: 12px; border-radius: 8px; }
.login { max-width: 360px; margin: 10vh auto; }
.login form > div { margin-bottom: 12px; }

/* mobil: navigácia na samostatnom riadku pod logom */
@media (max-width: 640px) {
  .top-inner { flex-wrap: wrap; gap: 8px 12px; padding-bottom: 6px; }
  .top-inner .brand { flex: 1 1 auto; }
  .top-inner nav.main { order: 3; flex: 1 1 100%; }
}
