:root {
  color-scheme: light;
  --surface: #fcfcfb; --plane: #f9f9f7; --ink: #0b0b0b; --ink-2: #52514e;
  --muted: #898781; --rule: #e1e0d9; --border: rgba(11,11,11,.10);
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --accent: #2a78d6;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme=light])) {
    color-scheme: dark;
    --surface: #1a1a19; --plane: #0d0d0d; --ink: #fff; --ink-2: #c3c2b7;
    --muted: #898781; --rule: #2c2c2a; --border: rgba(255,255,255,.10);
    --accent: #3987e5;
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --surface: #1a1a19; --plane: #0d0d0d; --ink: #fff; --ink-2: #c3c2b7;
  --rule: #2c2c2a; --border: rgba(255,255,255,.10); --accent: #3987e5;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--plane); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
nav.side {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.logo { font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  padding: 0 10px 4px; }
.agency { font-weight: 600; padding: 0 10px 16px; font-size: 15px; }
nav.side a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px;
}
nav.side a:hover { background: var(--plane); text-decoration: none; }
nav.side a.on { background: var(--plane); color: var(--ink); font-weight: 600; }
nav.side .group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 18px 10px 6px; }
.pill { background: var(--critical); color: #fff; border-radius: 999px; font-size: 11px;
  padding: 1px 7px; font-weight: 600; }
main { padding: 28px 32px 72px; max-width: 1180px; }

h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 28px 0 10px; }
.sub { color: var(--ink-2); font-size: 14px; margin: 0 0 4px; }
.muted { color: var(--muted); font-size: 13px; }

/* Cards & tiles */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  gap: 10px; margin: 18px 0; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; }
.tile .n { font-size: 30px; font-weight: 600; line-height: 1.1; }
.tile .k { font-size: 13px; color: var(--ink-2); display: flex; align-items: center;
  gap: 6px; margin-top: 2px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.cols.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; }
  nav.side { position: static; height: auto; }
  .cols, .cols.three { grid-template-columns: 1fr; } }

/* Status */
.dot { font-size: 11px; line-height: 1; }
.good .dot, .s-good { color: var(--good); }
.warning .dot, .s-warning { color: var(--warning); }
.serious .dot, .s-serious { color: var(--serious); }
.critical .dot, .s-critical { color: var(--critical); }
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 600;
  white-space: nowrap; }

/* Tables */
.scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 11px 14px;
  border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
td:first-child { white-space: nowrap; }
.addr { color: var(--ink-2); font-size: 13px; display: block; }

/* Forms & buttons */
label { display: block; font-size: 13px; color: var(--ink-2); margin: 10px 0 4px; }
input, select { width: 100%; padding: 8px 10px; border-radius: 8px; font: inherit;
  font-size: 14px; background: var(--plane); color: var(--ink);
  border: 1px solid var(--border); }
input[type=file] { padding: 6px; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 8px; font-size: 14px;
  font-weight: 600; border: 1px solid var(--border); background: var(--plane);
  color: var(--ink); cursor: pointer; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; font-weight: 500; }
.btn.danger { color: var(--critical); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  flex-wrap: wrap; }

/* Notices */
.notice { border-radius: 10px; padding: 11px 14px; font-size: 14px; margin: 14px 0;
  border: 1px solid var(--border); background: var(--surface); }
.notice.warn { border-left: 3px solid var(--warning); }
.notice.bad { border-left: 3px solid var(--critical); }
.notice.ok { border-left: 3px solid var(--good); }
.proto { font-size: 12px; color: var(--muted); border: 1px dashed var(--border);
  border-radius: 8px; padding: 8px 11px; margin-top: 14px; }
ul.notes { margin: 0; padding-left: 16px; color: var(--ink-2); font-size: 13px; }
ul.notes li { margin: 2px 0; }
.bar { height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px;
  font-size: 13px; color: var(--ink-2); background: var(--surface); }
.chip.on { background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; }
.chip:hover { text-decoration: none; }
