/* Watoto PM dashboard. Tokens first; light and dark are both chosen, not inverted.
   Watoto brand: green #008C15 (logo, highlights), deep green #007041 (anything carrying white text),
   accent yellow #FBD110 (only as a small complement to the green), chart blue #2774AE. Flat colours only. */
:root {
  color-scheme: light;
  --brand: #007041;
  --brand-2: #005c35;
  --brand-bright: #008C15;
  --brand-ink: #ffffff;
  --accent: #FBD110;
  --link: #007041;
  --info-ink: #004C97;
  --page: #f4f3ef;
  --surface: #fcfcfb;
  --surface-2: #f7f6f2;
  --surface-3: #efede6;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #75736d;
  --hairline: #e1e0d9;
  --axis: #c3c2b7;
  --ring: rgba(11, 11, 11, 0.10);
  --focus: #2774AE;
  --shadow: 0 1px 2px rgba(20, 24, 32, .05), 0 4px 16px rgba(20, 24, 32, .05);
  --shadow-lg: 0 10px 40px rgba(20, 24, 32, .18);
  --series-1: #2774AE; --series-2: #008C15;
  --track-1: color-mix(in srgb, #2774AE 20%, #fcfcfb);
  --neutral-mark: #898781;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --good-ink: #006300; --warning-ink: #7a5300; --serious-ink: #9a3f12; --critical-ink: #a52626;
  --good-bg: #e6f4e6; --warning-bg: #fdf3dc; --serious-bg: #fcebe3; --critical-bg: #fae6e6;
  --neutral-bg: #eceae4;
  --side: #007041;
  --side-ink: #ffffff;
  --side-ink-2: #d4e8dd;
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #212120; --surface-3: #2a2a28;
    --ink: #ffffff; --ink-2: #c3c2b7; --ink-3: #9a988f; --hairline: #2c2c2a; --axis: #383835; --ring: rgba(255,255,255,.10);
    --series-1: #2774AE; --series-2: #008C15; --track-1: color-mix(in srgb, #2774AE 32%, #1a1a19);
    --good-ink: #3ccf3c; --warning-ink: #fab219; --serious-ink: #f09a77; --critical-ink: #f08585;
    --good-bg: #13301a; --warning-bg: #3a2c08; --serious-bg: #3a1f14; --critical-bg: #3d1717; --neutral-bg: #2a2a28;
    --side: #003d24; --side-ink-2: #b9d6c6; --shadow: 0 1px 2px rgba(0,0,0,.4); --link: #78BE20; --info-ink: #71C5E8; --focus: #71C5E8;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #212120; --surface-3: #2a2a28;
  --ink: #ffffff; --ink-2: #c3c2b7; --ink-3: #9a988f; --hairline: #2c2c2a; --axis: #383835; --ring: rgba(255,255,255,.10);
  --series-1: #2774AE; --series-2: #008C15; --track-1: color-mix(in srgb, #2774AE 32%, #1a1a19);
  --good-ink: #3ccf3c; --warning-ink: #fab219; --serious-ink: #f09a77; --critical-ink: #f08585;
  --good-bg: #13301a; --warning-bg: #3a2c08; --serious-bg: #3a1f14; --critical-bg: #3d1717; --neutral-bg: #2a2a28;
  --side: #003d24; --side-ink-2: #b9d6c6; --shadow: 0 1px 2px rgba(0,0,0,.4); --link: #78BE20; --info-ink: #71C5E8; --focus: #71C5E8;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); }
.small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.hidden { display: none !important; }
.mt-6 { margin-top: 6px; } .mt-16 { margin-top: 16px; } .mt-18 { margin-top: 18px; } .mb-10 { margin-bottom: 10px; } .mb-14 { margin-bottom: 14px; } .mb-0 { margin-bottom: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.icon.sm { width: 15px; height: 15px; vertical-align: -3px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; color: var(--side-ink);
  background: var(--side);
  display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 8px 18px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.icon.wordmark { width: 118px; height: 46px; stroke: none; vertical-align: 0; }
.brand .wordmark { color: #fff; }
.brand-sub { font-size: 12px; color: var(--side-ink-2); padding-left: 2px; }
.nav-group { margin: 14px 0 4px; padding: 0 10px; font-size: 10.5px; letter-spacing: .9px; text-transform: uppercase; color: var(--side-ink-2); }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--side-ink); font-weight: 500; text-decoration: none; position: relative; }
.nav a:hover { background: rgba(255,255,255,.10); }
.nav a.on { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav .count { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.18); padding: 1px 7px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.nav .count.alert { background: var(--critical); color: #fff; }
.side-foot { margin-top: auto; padding: 14px 10px 0; font-size: 11.5px; color: var(--side-ink-2); border-top: 1px solid rgba(255,255,255,.18); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--hairline); }
.top h1 { font-size: 19px; }
.top .crumb { font-size: 12px; color: var(--ink-3); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.content { padding: 22px 28px 48px; max-width: 1480px; width: 100%; }

.search { position: relative; }
.search input[type=search] { width: 280px; padding: 8px 52px 8px 34px; border-radius: 10px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); font: inherit; }
.search > .icon { position: absolute; left: 10px; top: 9px; color: var(--ink-3); }
.search kbd { position: absolute; right: 8px; top: 7px; font: 11px var(--font); color: var(--ink-3); border: 1px solid var(--hairline); border-radius: 5px; padding: 1px 5px; background: var(--surface-2); }
.search-results { position: absolute; top: calc(100% + 6px); right: 0; width: 420px; max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.search-results a:hover, .search-results a.sel { background: var(--surface-3); }
.search-results .k { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; width: 64px; flex: none; }

.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); padding: 5px 10px; border-radius: 20px; background: var(--surface); border: 1px solid var(--hairline); white-space: nowrap; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(12,163,12,.5); animation: pulse 2.4s infinite; }
.live.off .dot { background: var(--ink-3); animation: none; }
.live.err .dot { background: var(--critical); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(12,163,12,.45); } 70% { box-shadow: 0 0 0 7px rgba(12,163,12,0); } 100% { box-shadow: 0 0 0 0 rgba(12,163,12,0); } }
@media (prefers-reduced-motion: reduce) { .live .dot { animation: none; } * { transition: none !important; } }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 13px; color: #fff; background: var(--brand-2); }
.user-menu { position: relative; }
.user-menu > button { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; color: var(--ink); font: inherit; padding: 2px; border-radius: 22px; }
.user-menu .who { text-align: left; line-height: 1.2; }
.user-menu .who small { display: block; color: var(--ink-3); font-size: 11.5px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; }
.dropdown a, .dropdown button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-3); }
.dropdown hr { border: 0; border-top: 1px solid var(--hairline); margin: 6px 0; }

/* ---------- Building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 14px 20px 0; }
.card-head h2 { font-size: 14.5px; }
.card-head .sub { font-size: 12px; color: var(--ink-3); }
.card-head .tools { margin-left: auto; display: flex; gap: 6px; }
.card-body { padding: 14px 20px 18px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 2fr); }
.span-2 { grid-column: span 2; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); font: inherit; font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--critical-ink); border-color: color-mix(in srgb, var(--critical) 40%, var(--hairline)); }
.btn.danger:hover { background: var(--critical-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--surface-3); }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
label.field > small, .hint { display: block; color: var(--ink-3); font-size: 12px; margin-top: 4px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=date], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--axis); background: var(--surface); color: var(--ink); font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--focus) 55%, transparent); outline-offset: 0; border-color: var(--focus); }
.check { display: flex; gap: 9px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }
.check small { display: block; color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.filters select, .filters input { min-width: 150px; padding: 7px 10px; height: 36px; font-weight: 400; }
.filters label.toggle { flex-direction: row; align-items: center; height: 36px; font-weight: 500; }
.filters .toggle input { min-width: 0; height: auto; }

.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a, .seg button { padding: 5px 11px; border-radius: 8px; color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 600; background: none; border: 0; cursor: pointer; text-decoration: none; }
.seg a.on, .seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--neutral-bg); color: var(--ink-2); white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; vertical-align: 0; }
.badge.good { background: var(--good-bg); color: var(--good-ink); }
.badge.warning { background: var(--warning-bg); color: var(--warning-ink); }
.badge.serious { background: var(--serious-bg); color: var(--serious-ink); }
.badge.critical { background: var(--critical-bg); color: var(--critical-ink); }
.badge.info { background: color-mix(in srgb, var(--series-1) 14%, transparent); color: var(--info-ink); }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Tables */
.table-wrap { position: relative; overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t a.rowlink { color: var(--ink); font-weight: 600; }
table.t tr.fresh td { animation: fresh 3s ease-out; }
@keyframes fresh { from { background: color-mix(in srgb, var(--accent) 30%, transparent); } to { background: transparent; } }
.kv { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 0 12px; font-size: 13.5px; }
.kv > div { padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.kv > div:nth-child(odd) { color: var(--ink-2); font-weight: 600; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; font-size: 13px; color: var(--ink-2); }
.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.empty .icon { width: 34px; height: 34px; margin-bottom: 8px; stroke-width: 1.4; }

/* Alerts and toasts */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; background: var(--neutral-bg); color: var(--ink); font-size: 13.5px; }
.alert .icon { margin-top: 1px; }
.alert.good { background: var(--good-bg); } .alert.good .icon { color: var(--good-ink); }
.alert.warning { background: var(--warning-bg); } .alert.warning .icon { color: var(--warning-ink); }
.alert.critical { background: var(--critical-bg); } .alert.critical .icon { color: var(--critical-ink); }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: var(--page); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px; max-width: 360px; }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 16px 18px; position: relative; overflow: hidden; }
.tile .label, .hero .label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.tile .label .icon, .hero .label .icon { color: var(--ink-3); }
.tile .value { font-size: 30px; font-weight: 650; letter-spacing: -.5px; margin-top: 6px; line-height: 1.1; }
.tile .note { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.tile .note b { color: var(--ink-2); font-weight: 600; }
.tile.alerting .value { color: var(--critical-ink); }
.hero { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border-top: 4px solid var(--brand-bright); }
.hero .big { font-size: 56px; font-weight: 700; letter-spacing: -1.5px; line-height: 1; }
.hero .of { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.meter { height: 10px; border-radius: 6px; background: var(--track-1); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 6px; background: var(--series-1); min-width: 2px; transition: width .6s ease; }
.meter.sm { height: 7px; }
.meter.good > span { background: var(--good); } .meter.warning > span { background: var(--warning); } .meter.critical > span { background: var(--critical); }
.campus-list { display: grid; gap: 14px; }
.campus-list.multi { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 11px 24px; }
.campus-list.multi .campus-row .top-line { margin-bottom: 4px; }
.campus-list.multi .campus-row .name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.campus-list.multi .campus-row .val { font-size: 12px; white-space: nowrap; }
.campus-row .top-line { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.campus-row .name { font-weight: 600; }
.campus-row .val { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; }
.campus-row .flash { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: none; }
.campus-row.recent .flash { display: inline-block; animation: pulse 2s 3; }
.impact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.impact .cell { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.impact .cell .v { font-size: 20px; font-weight: 650; }
.impact .cell .l { font-size: 12px; color: var(--ink-2); }
.stackbar { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-3); }
.stackbar > span { display: block; height: 100%; }
.stackbar > span:first-child { border-radius: 7px 0 0 7px; } .stackbar > span:last-child { border-radius: 0 7px 7px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend b { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 4px; }
.sev-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sev { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.sev .n { font-size: 22px; font-weight: 650; }
.sev .l { font-size: 12px; display: flex; gap: 6px; align-items: center; color: var(--ink-2); }
.chart-box { position: relative; height: 240px; transition: opacity .2s; }
.chart-box.tall { height: 300px; }
.chart-box.loading { opacity: .55; }
/* Pie (doughnut) cards: ring with the total in the middle, legend beside it (below it on narrow cards). */
.donut-layout { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.donut-box { position: relative; width: 168px; height: 168px; flex: none; margin: 0 auto; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.donut-center b { font-size: 26px; font-weight: 700; line-height: 1.1; }
.donut-center span { font-size: 11.5px; color: var(--ink-3); max-width: 96px; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 170px; min-width: 0; display: grid; gap: 8px; font-size: 13px; }
.donut-legend li { display: grid; grid-template-columns: 10px 15px minmax(0, 1fr) auto 38px; align-items: center; gap: 7px; color: var(--ink-2); }
.donut-legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend .icon { color: var(--ink-3); }
.donut-legend .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.donut-legend .share { color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.chart-table { margin-top: 10px; max-height: 260px; overflow: auto; }
.feed td:first-child, .feed td:last-child { white-space: nowrap; }
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.filterbar select { width: auto; min-width: 200px; padding: 6px 10px; font-weight: 400; }
.filterbar > label:not(.toggle):not(.sr-only) { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.toggle input { accent-color: var(--brand); width: 15px; height: 15px; }

.narrow { max-width: 440px; } .narrow-card { max-width: 820px; }
.steps { margin: 0 0 12px; padding-left: 20px; } .steps li { margin-bottom: 4px; }
.empty-chart { opacity: .35; }

/* Detail pages */
.detail-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.detail-head .title { font-size: 22px; font-weight: 700; }
.detail-head .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; align-items: center; color: var(--ink-2); font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--brand-bright); }
.check-section h3 { margin: 18px 0 8px; font-size: 13px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .5px; }
.ans { font-weight: 650; }
.ans.Yes { color: var(--good-ink); } .ans.No { color: var(--critical-ink); } .ans.NA { color: var(--ink-3); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--hairline); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand-2); }
.timeline .when { font-size: 12px; color: var(--ink-3); }
.frame { width: 100%; height: 75vh; border: 1px solid var(--hairline); border-radius: 10px; background: #fff; }
.perm-group { border: 1px solid var(--hairline); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.perm-group h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.key-box { font-family: var(--mono); font-size: 14px; padding: 12px; background: var(--surface-3); border-radius: 8px; word-break: break-all; user-select: all; }
.qr { background: #fff; padding: 12px; border-radius: 10px; display: inline-block; }
.qr img, .qr svg { display: block; width: 190px; height: 190px; }
.codes { columns: 2; font-family: var(--mono); font-size: 14px; background: var(--surface-3); padding: 12px 16px; border-radius: 8px; }

/* Lists, chips, reports */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink-2); font-size: 13px; text-decoration: none; }
.chip b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.chip:hover { background: var(--surface-3); text-decoration: none; }
.chip.on { border-color: var(--brand-bright); box-shadow: inset 0 0 0 1px var(--brand-bright); }
.chip.critical b { color: var(--critical-ink); } .chip.warning b { color: var(--warning-ink); } .chip.good b { color: var(--good-ink); }
a.link-tile { color: inherit; text-decoration: none; display: block; }
a.link-tile:hover { box-shadow: var(--shadow-lg); text-decoration: none; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; }
details.more { border-top: 1px solid var(--hairline); }
details.more > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
table.t tr.total td { font-weight: 650; background: var(--surface-2); }
table.t .w-meter { min-width: 120px; } table.t .w-cond { min-width: 170px; }
.stackbar.sm { height: 9px; }
.text-critical { color: var(--critical-ink); } .text-serious { color: var(--serious-ink); } .text-good { color: var(--good-ink); }
.print-only { display: none; }
.role-card .perm-count { font-size: 12px; color: var(--ink-3); }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.perm-grid label { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-size: 13.5px; }
.perm-grid label input { margin-top: 3px; accent-color: var(--brand); }
.perm-grid label code { font-size: 11px; color: var(--ink-3); }
.matrix th, .matrix td { text-align: center; } .matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix .yes { color: var(--good-ink); } .matrix .no { color: var(--ink-3); }
.campus-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.field > .label-text { display: block; font-weight: 600; font-size: 13px; margin-bottom: 7px; }
div.field { margin-bottom: 14px; }
.stack-sm { display: grid; gap: 8px; max-width: 560px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }

/* ---------- Sign-in pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: var(--side); }
.auth-art h2 { font-size: 34px; line-height: 1.15; max-width: 520px; font-weight: 700; letter-spacing: -.5px; }
.auth-art p { color: #ffffff; max-width: 460px; font-size: 15px; }
.auth-art .auth-wordmark { width: 190px; height: 74px; color: #fff; }
.install-logo { width: 110px; height: 43px; color: var(--brand-bright); margin-right: 8px; }
.auth-org { margin-top: 6px; font-weight: 600; color: var(--side-ink-2); }
.auth-card .auth-logo { display: none; width: 132px; height: 52px; color: var(--brand-bright); margin-bottom: 18px; }
.auth-stats { display: flex; gap: 28px; }
.auth-stats div b { display: block; font-size: 26px; color: var(--accent); }
.auth-stats div b .icon { width: 24px; height: 24px; }
.auth-stats div span { color: var(--side-ink-2); font-size: 12.5px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .lead { color: var(--ink-2); margin-bottom: 22px; }
.ms-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px; border-radius: 10px; border: 1px solid var(--axis); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; }
.ms-btn:hover { background: var(--surface-3); text-decoration: none; }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
.ms-logo .c1 { background: #f25022; } .ms-logo .c2 { background: #7fba00; } .ms-logo .c3 { background: #00a4ef; } .ms-logo .c4 { background: #ffb900; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.code-input { font-family: var(--mono); font-size: 24px !important; letter-spacing: 8px; text-align: center; }
.install { max-width: 760px; margin: 30px auto; padding: 0 16px; }
.checks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.checks li { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-hero { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 50; inset: 0 auto 0 0; width: 264px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-grid; }
  .g-2, .g-3, .g-4, .form-grid, .perm-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .search input { width: 180px; }
  .search kbd, .user-menu .who { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-card .auth-logo { display: block; }
}
@media (max-width: 640px) {
  .top, .content { padding-left: 16px; padding-right: 16px; }
  .kpis, .impact, .sev-row { grid-template-columns: 1fr 1fr; }
  .search { display: none; }
  .top { gap: 10px; }
  .top h1 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top > div:first-of-type { min-width: 0; }
  .live .txt { display: none; }
  .live { padding: 7px; }
  .kv { grid-template-columns: 1fr; }
  .kv > div:nth-child(odd) { border-bottom: 0; padding-bottom: 0; }
  .hero .big { font-size: 44px; }
}
@media print {
  .side, .top, .filterbar, .filters, .chips, .tools, .btn, .no-print, .pager { display: none !important; }
  .print-only { display: block; } .print-head { margin-bottom: 14px; font-size: 14px; }
  .shell { display: block; } .content { padding: 0; } .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  body { background: #fff; }
}
@media (forced-colors: active) { .meter > span, .stackbar > span { forced-color-adjust: none; } }
