:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --border: #e2e1dc;
  --grid: #e8e7e2;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #6a6964;
  --accent: #2a78d6;
  /* text-safe ("ink") and strong-fill variants: at least 4.5:1 contrast on cards and page background */
  --accent-ink: #1f63b8;
  --btn: #1f66c2;
  --critical-ink: #b42b2b;
  --critical-strong: #c43333;
  --good-strong: #0a7d0a;
  --warn-ink: #8a5e00;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --info-ink: #256abf;
  --shadow: 0 1px 2px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211; --surface: #1a1a19; --surface-2: #242422; --border: #2e2e2b; --grid: #2a2a27;
    --text: #f0efec; --text-2: #c3c2b7; --muted: #9a9992; --accent: #3987e5;
    --accent-ink: #6da7ec; --btn: #2a6cc6; --critical-ink: #f07a7a; --critical-strong: #c43333; --good-strong: #0a7d0a; --warn-ink: #fab219;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #0ca30c; --info-ink: #6da7ec;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #242422; --border: #2e2e2b; --grid: #2a2a27;
  --text: #f0efec; --text-2: #c3c2b7; --muted: #9a9992; --accent: #3987e5;
    --accent-ink: #6da7ec; --btn: #2a6cc6; --critical-ink: #f07a7a; --critical-strong: #c43333; --good-strong: #0a7d0a; --warn-ink: #fab219;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #0ca30c; --info-ink: #6da7ec;
  --shadow: none;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
h2 { margin: 0; font-size: 20px; }
h3 { margin: 0; font-size: 14px; font-weight: 600; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.brand svg { color: var(--accent); }
.env { font-weight: 500; font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.tabs { display: flex; gap: 4px; }
.tabs a { color: var(--text-2); padding: 6px 12px; border-radius: 6px; font-weight: 500; }
.tabs a:hover { background: var(--surface-2); text-decoration: none; }
.tabs a.active { background: var(--surface-2); color: var(--text); }
.top-actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.badge { background: var(--critical-strong); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; margin-left: 4px; }

.btn, select, input[type=search] {
  font: inherit; font-size: 13px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px;
}
.btn { cursor: pointer; }
.btn:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; }
.btn.small { padding: 2px 8px; font-size: 12px; }

main { padding: 20px; max-width: 1400px; margin: 0 auto; display: block; }
.view { display: flex; flex-direction: column; gap: 16px; }
.view[hidden] { display: none; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; }
.card-h.filters { justify-content: flex-start; }
.card-h.filters h3 { margin-right: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .label { color: var(--text-2); font-size: 12px; }
.kpi .value { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .sub { font-size: 12px; color: var(--muted); }

/* status */
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 10px 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.s-healthy .dot, .dot.s-healthy { background: var(--good); }
.s-warning .dot, .dot.s-warning { background: var(--warning); }
.s-degraded .dot, .dot.s-degraded { background: var(--serious); }
.s-down .dot, .dot.s-down { background: var(--critical); }
.s-down .dot { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* charts */
.chart { position: relative; height: 220px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--border); stroke-width: 1; }
.chart .threshold { stroke: var(--critical); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .12; }
.chart .cross { stroke: var(--text-2); stroke-width: 1; opacity: .5; }
.chart .hover-dot { stroke: var(--surface); stroke-width: 2; }
.chart .incident-band { fill: var(--critical); opacity: .07; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.18); min-width: 140px; }
.tooltip .t { color: var(--muted); margin-bottom: 4px; }
.tooltip .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .row span:first-child { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.tooltip .row b { font-variant-numeric: tabular-nums; }
.tooltip i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }

/* health grid */
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.hcell { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.hcell:hover { border-color: var(--accent); text-decoration: none; }
.hcell .n { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.hcell .m { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hcell .inc { font-size: 11px; color: var(--text-2); }

/* table */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: bottom; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; }
.tbl .bad { color: var(--critical-ink); font-weight: 600; }
.kind { font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 6px; }
.spark { display: block; }

/* alerts */
.alert { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.alert:last-child { border-bottom: 0; }
.alert .sev { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; display: inline-flex; align-items: center; gap: 6px; min-width: 84px; }
.alert .title { font-weight: 600; }
.alert .meta { grid-column: 2 / 4; font-size: 12px; color: var(--muted); }
.alert.resolved { opacity: .65; }
.sev.critical .dot { background: var(--critical); }
.sev.warning .dot { background: var(--warning); }
.sev.resolved .dot { background: var(--good); }
.empty { color: var(--muted); padding: 20px 4px; text-align: center; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { font: inherit; font-size: 12px; background: transparent; color: var(--text-2); border: 0; padding: 4px 12px; cursor: pointer; }
.seg button.on { background: var(--surface-2); color: var(--text); font-weight: 600; }

/* logs */
.log-list { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; max-height: 65vh; overflow: auto; }
.log-list.compact { max-height: 260px; }
.log { display: grid; grid-template-columns: 92px 52px 150px 1fr; gap: 10px; padding: 3px 4px; border-bottom: 1px solid var(--grid); }
.log:hover { background: var(--surface-2); }
.log .ts { color: var(--muted); }
.log .svc { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.log .lvl { font-weight: 700; text-transform: uppercase; }
.log .lvl.info { color: var(--info-ink); }
.log .lvl.warn { color: var(--warn-ink); }
.log .lvl.error { color: var(--critical-ink); }
.log.new { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 18%, transparent); } }
.compact .log { grid-template-columns: 80px 46px 1fr; }

.detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head .spacer { flex: 1; }
.dep { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.dep:last-child { border-bottom: 0; }
.dep .m { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  main { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .top-actions { margin-left: 0; width: 100%; }
  #lastUpdated, .brand .env { display: none; }
  .log { grid-template-columns: 70px 44px 1fr; }
  .log .svc { display: none; }
}

/* buttons */
.btn.primary { background: var(--btn); border-color: var(--btn); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--btn); filter: brightness(1.1); }
.btn.danger { color: var(--critical-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* tags */
.tag { font-size: 11px; border-radius: 4px; padding: 0 6px; border: 1px solid var(--border); color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
.tag.real { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.s-up .dot, .dot.s-up { background: var(--good); }
.s-slow .dot, .dot.s-slow { background: var(--warning); }
.s-paused .dot, .s-pending .dot { background: var(--muted); }
.check-cell b { display: block; }
.check-cell .u { font-size: 12px; color: var(--muted); max-width: 340px; overflow: hidden; text-overflow: ellipsis; display: block; }
.warn-ink { color: var(--warn-ink); font-weight: 600; }
.url-line { margin-top: -8px; word-break: break-all; }

/* status strips */
.strip { display: flex; gap: 2px; align-items: stretch; height: 22px; }
.strip i { flex: 1 1 0; min-width: 2px; max-width: 6px; border-radius: 2px; background: var(--good); }
.strip i.slow, .strip-big i.slow, .sw.slow { background: var(--warning); }
.strip i.down, .strip-big i.down, .sw.down { background: var(--critical); }
.strip i.none { background: var(--grid); }
.strip-big { display: flex; gap: 2px; height: 34px; }
.strip-big i { flex: 1 1 0; border-radius: 2px; background: var(--good); min-width: 1px; }
.strip-big i.none { background: var(--grid); }
.sw { display: inline-block; width: 10px !important; height: 10px !important; border-radius: 2px !important; background: var(--good); }

/* timing breakdown */
.phases { display: flex; flex-direction: column; gap: 10px; }
.phase-bar { display: flex; height: 26px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.phase-bar span { min-width: 2px; }
.phase-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.phase-row i { width: 10px; height: 10px; border-radius: 2px; }
.phase-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.phase-total { border-top: 1px solid var(--border); padding-top: 8px; display: flex; justify-content: space-between; font-size: 13px; }

.grid-2.wide-left { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 900px) { .grid-2.wide-left { grid-template-columns: 1fr; } }

/* form */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.form-grid .wide { grid-column: span 3; }
@media (min-width: 900px) { .form-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } .form-grid .wide { grid-column: span 3; } .form-grid .form-actions { grid-column: span 6; } }
.form-grid input, .form-grid select { font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; width: 100%; }
.form-grid input:focus, .form-grid select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 0; border-color: var(--accent); }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.form-error { color: var(--critical-ink); font-size: 13px; margin-right: auto; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .wide, .form-grid .form-actions { grid-column: span 2; } }

@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 22px; }
  .tabs { overflow-x: auto; max-width: 100%; }
  .tabs a { padding: 6px 8px; }
}

/* ================= layout: sidebar navigation ================= */
.menu-btn { display: none; font-size: 18px; line-height: 1; padding: 4px 10px; }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
.sidebar { position: sticky; top: 53px; height: calc(100vh - 53px); overflow-y: auto; border-right: 1px solid var(--border); background: var(--surface); padding: 10px 8px 24px; }
.sidebar .tabs { display: flex; flex-direction: column; gap: 1px; overflow: visible; max-width: none; }
.sidebar .tabs a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; font-size: 13.5px; }
.nav-group { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 4px; }
.nd { width: 8px; height: 8px; border-radius: 50%; flex: none; background: transparent; border: 1px solid var(--border); }
.nd.dot { border: 0; }
.nd.s-warning { background: var(--warning); } .nd.s-degraded { background: var(--serious); } .nd.s-down { background: var(--critical); }
.sidebar .badge { margin-left: auto; }
main { max-width: none; width: 100%; margin: 0; }   /* use the full width next to the menu (no empty space on wide screens) */
@media (max-width: 900px) {
  .menu-btn { display: inline-block; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: var(--top, 53px); height: calc(100vh - var(--top, 53px)); left: 0; z-index: 20; width: 260px; transform: translateX(-105%); transition: transform .18s ease; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
  body.nav-open .sidebar { transform: none; }
}

/* page headers */
.page-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.page-h .spacer { flex: 1; }
.msg-line { margin-top: -8px; }
.explain { margin: 0; }

/* area tiles on overview */
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.area { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.area:hover { border-color: var(--accent); text-decoration: none; }
.area .n { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.area .st { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--text-2); }
.area .h { font-size: 13px; font-variant-numeric: tabular-nums; }
.area .d { font-size: 12px; color: var(--muted); }
.area.s-warning { border-left: 3px solid var(--warning); } .area.s-degraded { border-left: 3px solid var(--serious); } .area.s-down { border-left: 3px solid var(--critical); }

/* status extras */
.s-info .dot, .dot.s-info { background: var(--accent); }
.tag.new { color: var(--critical-ink); border-color: color-mix(in srgb, var(--critical) 40%, var(--border)); margin-left: 4px; }
.bad { color: var(--critical-ink); font-weight: 600; }
.tbl.click tbody tr { cursor: pointer; }
.tbl tbody tr { cursor: default; }
#servicesTable tbody tr, #checksTable tbody tr { cursor: pointer; }
.tbl code, .sql code, .msg-cell code { font-size: 12px; }
.sql { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-cell { white-space: normal !important; max-width: 460px; }
.issue { white-space: normal !important; max-width: 520px; }
.issue .msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 480px; }

/* progress + bars */
.progress { height: 8px; border-radius: 4px; background: var(--grid); overflow: hidden; margin: 6px 0; min-width: 60px; }
.progress span { display: block; height: 100%; border-radius: 4px; background: var(--good); }
.progress .s-warning { background: var(--warning); } .progress .s-degraded { background: var(--serious); } .progress .s-down { background: var(--critical); } .progress .s-info { background: var(--accent); }
.mini-prog { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.mini-prog .progress { flex: 1; margin: 0; min-width: 70px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hbar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .track { height: 12px; background: var(--grid); border-radius: 3px; overflow: hidden; }
.hbar .fill { display: block; height: 100%; border-radius: 3px; }
.hbar b { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.split { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; margin: 8px 0 4px; min-width: 120px; }
.split .g { background: var(--good); } .split .w { background: var(--warning); } .split .p { background: var(--critical); }
.split span { min-width: 1px; }
.split-l { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.split-cell { min-width: 190px; }

/* charts extras */
.chart.short { height: 170px; }
.chart.tall { height: 280px; }
.chart .marker line { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; }
.chart .marker path { fill: var(--text-2); opacity: .8; }
.chart .hl { fill: var(--text); opacity: .06; }
.chart .flag { font-size: 11px; fill: var(--critical); }
.tooltip .mk { color: var(--text); font-weight: 600; margin-bottom: 4px; }
.tooltip .row.tot { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }

/* infra */
.pods { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pod { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 4px; }
.pod .dot { width: 8px; height: 8px; }

/* trace waterfall */
.waterfall { font-size: 12.5px; }
.wf-axis { display: grid; grid-template-columns: 38% 1fr; gap: 8px; padding: 0 4px; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.wf-axis div { display: flex; justify-content: space-between; }
.wf-row { display: grid; grid-template-columns: 38% 1fr; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 4px; cursor: pointer; }
.wf-row:hover { background: var(--surface-2); }
.wf-row.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.wf-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-t { position: relative; height: 16px; background: var(--grid); border-radius: 3px; }
.wf-b { position: absolute; top: 2px; bottom: 2px; background: var(--accent); border-radius: 2px; min-width: 2px; }
.wf-row.err .wf-b { background: var(--critical); }
.wf-row.err .wf-l b { color: var(--critical-ink); }
.wf-v { position: absolute; top: 0; margin-left: 6px; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-all; }
.stack { font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; overflow-x: auto; margin: 0; white-space: pre; }

/* SLO cards */
.slo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card.slo { color: var(--text); display: block; }
.card.slo:hover { border-color: var(--accent); text-decoration: none; }
.slo-num { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 6px; }
.slo-num span { font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; }
.slo-num small { color: var(--muted); }
.slo-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-2); }

/* RUM */
.vitals { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.vital .status-pill { margin: 4px 0 0; }

/* journeys */
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.step.failed { border-color: color-mix(in srgb, var(--critical) 50%, var(--border)); }
.step.skipped { opacity: .55; }
.num-badge { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); }
.step.passed .num-badge { background: var(--good-strong); color: #fff; border-color: var(--good-strong); }
.step.failed .num-badge { background: var(--critical-strong); color: #fff; border-color: var(--critical-strong); }
.step-r { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* forms + banners */
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.banner { background: color-mix(in srgb, var(--critical) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--critical) 45%, var(--border)); color: var(--text); border-radius: 8px; padding: 10px 14px; font-weight: 600; }

.stack.code { white-space: pre; margin: 8px 0; }
.stack .lib { color: var(--muted); }
.stack .app { color: var(--text); font-weight: 600; }

/* applications page */
.kind-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.kind-pick legend { margin-bottom: 6px; color: var(--text-2); }
.choice { flex-direction: row !important; align-items: flex-start; gap: 10px !important; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px !important; color: var(--text) !important; }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.choice input { width: auto !important; margin-top: 3px; }
.hint { font-size: 11px; color: var(--muted); }
.setup { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.setup-step { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.setup-step:first-of-type { border-top: 0; }
.setup-step p { margin: 6px 0 0; }
.key-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.key { font-size: 13px; padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; word-break: break-all; }
.code-wrap { position: relative; }
.code-wrap > .btn { position: absolute; top: 14px; right: 8px; }
[data-agent-only][hidden] { display: none !important; }

.kind-pick { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
[data-not-mssql][hidden] { display: none !important; }
.finding { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); }
.finding:last-child { border-bottom: 0; }
.blocker { padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--critical) 40%, var(--border)); border-radius: 8px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.vol { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; }
.form-grid .kind-pick { grid-column: 1 / -1; }
[data-host-only][hidden] { display: none !important; }

/* notifications */
.settings-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px; }
.settings-row label { display: flex; flex-direction: column; gap: 4px; color: var(--text-2); }
.settings-row label.check { flex-direction: row; align-items: center; gap: 6px; }
.settings-row input[data-pub] { font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; min-width: 260px; }
.help p { margin: 0 0 8px; }
[data-t][hidden] { display: none !important; }

/* topology */
.topo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
@media (max-width: 1100px) { .topo-grid { grid-template-columns: 1fr; } }
.topo-wrap { overflow: auto; max-height: 75vh; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.topo { display: block; font-family: inherit; }
.topo .row-label { fill: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.topo .edge { fill: none; stroke: var(--muted); stroke-width: 1.4; opacity: .55; }
.topo .edge.cfg { stroke-dasharray: 4 4; opacity: .4; }
.topo .edge.infra { stroke-dasharray: 2 4; opacity: .3; }
.topo .edge.bad { stroke: var(--critical); opacity: .8; stroke-width: 2; }
.topo .arrow { fill: var(--muted); }
.topo .tn { cursor: pointer; }
.topo .tn rect:first-child { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.topo .tn .bar { fill: var(--good); }
.topo .tn.s-warning .bar, .topo .tn.s-slow .bar { fill: var(--warning); }
.topo .tn.s-degraded .bar { fill: var(--serious); }
.topo .tn.s-down .bar { fill: var(--critical); }
.topo .tn.s-paused .bar { fill: var(--muted); }
.topo .tn.s-down rect:first-child { stroke: var(--critical); }
.topo .tn .ico { font-size: 13px; font-weight: 700; fill: var(--text-2); }
.topo .tn .nm { font-size: 12px; font-weight: 600; fill: var(--text); }
.topo .tn .sb { font-size: 10.5px; fill: var(--muted); }
.topo .tn .lv { font-size: 8.5px; font-weight: 700; fill: var(--accent); letter-spacing: .05em; }
.topo .pbadge circle { fill: var(--critical); stroke: var(--surface); stroke-width: 2; }
.topo .pbadge text { fill: #fff; font-size: 11px; font-weight: 700; }
.topo .tn.root rect:first-child { stroke: var(--critical); stroke-width: 3; }
.topo .rootlbl { font-size: 9.5px; font-weight: 700; fill: var(--critical); letter-spacing: .06em; }
.topo .tn.dim-static { opacity: .45; }
.topo.focus .tn { opacity: .3; } .topo.focus .edge { opacity: .08; }
.topo.focus .tn.on { opacity: 1; } .topo.focus .edge.on { opacity: .95; stroke-width: 2.2; stroke: var(--accent); }
.topo .tn:focus-visible rect:first-child { stroke: var(--accent); stroke-width: 3; }
.topo-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; }
.topo-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.lg.s-healthy { background: var(--good); } .lg.s-warning { background: var(--warning); } .lg.s-degraded { background: var(--serious); } .lg.s-down { background: var(--critical); }
.topo-legend .pb { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--critical-strong); color: #fff; text-align: center; font-size: 11px; line-height: 14px; margin-right: 4px; }
.topo-legend .lvb { color: var(--accent-ink); font-size: 11px; margin-right: 4px; }
.topo-side { border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-size: 13px; max-height: 75vh; overflow: auto; }
.topo-side h3 { margin: 6px 0 8px; font-size: 16px; } .topo-side h4 { margin: 12px 0 4px; font-size: 12px; color: var(--text-2); }
.side-h { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
ul.rel, ul.why { margin: 0; padding-left: 18px; } ul.rel li, ul.why li { margin: 3px 0; }
.label.check, .small.check { display: inline-flex; align-items: center; gap: 5px; }
input[data-q] { font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; }

/* problems */
.problem { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-left-width: 4px; border-radius: 8px; margin-bottom: 8px; color: var(--text); }
.problem:hover { border-color: var(--accent); text-decoration: none; }
.problem.s-down { border-left-color: var(--critical); } .problem.s-warning { border-left-color: var(--warning); } .problem.s-healthy { border-left-color: var(--good); opacity: .8; }
.p-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .p-id { color: var(--muted); }
.rootcard { border-color: color-mix(in srgb, var(--critical) 45%, var(--border)); }
.root-ent { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.rootcard h4, .card h4 { margin: 12px 0 4px; font-size: 12px; color: var(--text-2); }
.timeline { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.timeline .ev { display: grid; grid-template-columns: 70px 18px 1fr; gap: 8px; align-items: baseline; }
.timeline .t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.timeline .alert .i { color: var(--critical-ink); } .timeline .resolved .i { color: var(--good); } .timeline .deploy .i { color: var(--accent); }

/* auth */
body.locked > header, body.locked > .layout { display: none; }
#authScreen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.auth-card h2 { margin: 4px 0; }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.auth-card input { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; }
.auth-card .btn.primary { padding: 8px; font-size: 14px; }
.user-menu { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
body:not(.role-admin) .admin-only { display: none !important; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90vw; }
.hist-title { margin: 4px 0 2px; }
[data-otel-only][hidden] { display: none !important; }

/* hide-demo mode */
body.hide-demo .demo-only, body.hide-demo .demo-toggle, body.hide-demo #injectKind { display: none !important; }
.demo-switch.on { border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tbl tr.sel td { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* dashboards */
.dash-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.dash-card { display: block; color: inherit; text-decoration: none; }
.dash-card:hover { border-color: var(--accent); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-grid .w2 { grid-column: span 2; }
.dash-grid .tile { margin: 0; min-width: 0; }
.tile-tools { display: inline-flex; gap: 2px; margin-left: auto; }
.stat-tile .value { font-size: 2.2rem; font-weight: 600; line-height: 1.1; }
.stat-tile .value small { font-size: 1rem; color: var(--muted); }
.mini-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; flex-wrap: wrap; }
.mini-row:last-child { border-bottom: 0; }
.check-list { display: flex; flex-wrap: wrap; gap: 6px 18px; }
@media (max-width: 800px) { .dash-grid { grid-template-columns: 1fr; } .dash-grid .w2 { grid-column: auto; } }

/* log search */
.log-q { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.log-q .grow { flex: 1 1 260px; min-width: 0; }
.log .lvl, td .lvl { font-size: 11px; text-transform: uppercase; padding: 0 4px; border-radius: 3px; margin: 0 6px; }
.lvl.error, .lvl.critical { color: var(--critical-ink); }
.lvl.warn { color: var(--warn-ink); }
.log .svc { color: var(--muted); margin-right: 6px; }

/* journey editor */
.step-edit { margin: 8px 0; }
.secret-row { display: flex; gap: 8px; align-items: center; margin: 4px 0; flex-wrap: wrap; }
.secret-row input { max-width: 260px; }
[data-jform] h4 { margin: 16px 0 6px; }

/* network discovery */
.disc-host { border-top: 1px solid var(--border); padding: 10px 0; }
.disc-host:first-of-type { border-top: 0; }
.disc-h { margin-bottom: 4px; }
.disc-sug { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.disc-changes { padding: 6px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }

[data-pats] code { white-space: pre-wrap; word-break: break-word; }
[data-pats] .tbl { table-layout: fixed; width: 100%; }
[data-pats] .tbl td.num { width: 56px; }

/* tables fit their card: text cells wrap; numbers, times, badges and sparklines stay on one line */
.tbl td.num, .tbl th.num, .tbl td .status-pill, .tbl td .tag, .tbl td .spark, .tbl td.row-actions, .tbl td .badge { white-space: nowrap; }
.tbl td.num, .tbl th.num { overflow-wrap: normal; }
.tbl td { min-width: 0; }
.tbl td.row-actions { width: 1%; }
.tbl td code { overflow-wrap: anywhere; word-break: break-word; }
.tbl td:has(> .status-pill:only-child), .tbl td:has(> .spark:only-child) { width: 1%; white-space: nowrap; }
/* the topology map keeps a readable minimum size and scrolls inside its card on narrow screens */
.topo-map { overflow-x: auto; }
@media (max-width: 1299px) { .tbl .col-trend { display: none; } }
@media (max-width: 1199px) {
  .grid-2:has(.table-wrap) { grid-template-columns: 1fr; }   /* boxes with tables stack instead of squeezing */
  .tbl .col-opt { display: none; }                            /* secondary columns: shown on wide screens */
}
@media (max-width: 900px) { .tbl td, .tbl th { padding-left: 6px; padding-right: 6px; } }

/* detail pass */
.tbl td code.nowrap, .nowrap { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
code, pre, kbd, samp { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.hide-demo #checkFilter { display: none; }   /* Real / Simulated filter only matters while demo checks are shown */

/* company branding */
.brand-logo { height: 28px; max-width: 170px; object-fit: contain; display: block; }
.auth-card .brand-logo { height: 40px; max-width: 220px; }
.brand-sub { font-size: 11px; font-weight: 600; color: var(--muted); padding: 1px 6px; border: 1px solid var(--border); border-radius: 4px; }
.brand-logo[hidden], .brand-default[hidden], .brand-sub[hidden] { display: none !important; }

.logo-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.logo-preview { width: 180px; height: 70px; border: 1px dashed var(--border); border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); }
.logo-preview img { max-width: 160px; max-height: 56px; object-fit: contain; }
.brand-preview { display: flex; flex-direction: column; gap: 12px; }
.bp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.bp-bar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bp-pill { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); }
.bp-noc { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 10px; color: #f1f5f9; font-weight: 800;
  background: linear-gradient(135deg, #070b14, #111827); border: 2px solid var(--pv, var(--accent)); box-shadow: 0 0 18px color-mix(in srgb, var(--pv, var(--accent)) 35%, transparent); }
.bp-noc .brand { display: flex; align-items: center; gap: 8px; }
.bp-noc .brand-sub { color: #cbd5e1; border-color: rgba(255,255,255,.2); }
.bp-noc > span { letter-spacing: .1em; color: var(--pv, var(--accent)); }
.bp-bar { flex-wrap: wrap; }
.bp-bar .brand, .bp-noc .brand { white-space: nowrap; min-width: 0; }
/* sign-in card: a company logo sits on its own row above the name */
.auth-card [data-brand] { flex-wrap: wrap; row-gap: 10px; }
.auth-card .brand-logo:not([hidden]) { flex: 0 0 100%; height: 48px; max-width: 100%; object-position: left center; }
.auth-card .brand-name, .auth-card .brand-sub { white-space: nowrap; }

/* company branding block at the top of the sidebar, above Overview */
.side-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 10px 12px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.side-brand[hidden], .side-brand .company-name[hidden] { display: none; }
.side-brand .brand-logo { height: auto; max-height: 48px; max-width: 100%; object-fit: contain; object-position: left center; }
.side-brand .company-name { font-weight: 700; font-size: 13.5px; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; }

.bp-app { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.bp-app .bp-bar { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.bp-bar .brand svg { color: var(--pv, var(--accent)); }
.bp-side { width: 200px; max-width: 100%; padding: 10px 8px; border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.bp-side .side-brand { padding-left: 6px; }
.bp-nav { font-size: 13px; padding: 5px 8px; border-radius: 6px; color: var(--text-2); }
.bp-nav.active { background: var(--surface-2); color: var(--text); }
.bp-noc .brand svg { stroke: none; color: var(--pv, var(--accent)); }
.bp-noc .brand-logo { height: 28px; max-width: 150px; object-fit: contain; }

/* company logo in the menu: centred tile using the menu's full width */
.side-brand { align-items: center; text-align: center; padding: 4px 6px 12px; }
.side-brand .brand-logo { width: auto; max-width: 100%; max-height: 72px; height: auto; object-position: center; border-radius: 8px; }
.side-brand .company-name { text-align: center; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.logo-row label.check { display: flex; align-items: center; gap: 6px; flex-direction: row; margin: 6px 0 0; }
.logo-row label.check input { width: auto; margin: 0; }
.side-brand .brand-logo { max-height: 96px; }
.side-brand { padding-top: 8px; }
/* menu logo: compact; transparent logos sit straight on the menu */
.side-brand .brand-logo { max-height: 56px; max-width: 170px; border-radius: 0; }
/* dark theme: a soft light backing keeps dark logo text readable */
:root[data-theme="dark"] .side-brand .brand-logo { background: #f3f3f1; border-radius: 8px; padding: 6px 10px; box-sizing: content-box; max-height: 48px; max-width: 160px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .side-brand .brand-logo { background: #f3f3f1; border-radius: 8px; padding: 6px 10px; box-sizing: content-box; max-height: 48px; max-width: 160px; }
}

/* menu logo uses the full width of the menu (height follows the logo's shape) */
.side-brand { padding: 6px 4px 12px; }
.side-brand .brand-logo { width: 100%; max-width: 100%; max-height: none; height: auto; }
:root[data-theme="dark"] .side-brand .brand-logo { width: calc(100% - 20px); max-width: none; max-height: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .side-brand .brand-logo { width: calc(100% - 20px); max-width: none; max-height: none; }
}
.logo-preview.noc-pv { background: linear-gradient(135deg, #070b14, #111827); }

/* Active Directory page */
.ad-tbl td { vertical-align: top; }
.ad-tbl tr.sub td { padding-top: 0; border-top: 0; }
.ad-tbl .ports { display: flex; flex-wrap: wrap; gap: 4px; }
.tag.ok { color: var(--good-strong, var(--text)); border-color: color-mix(in srgb, var(--good, #2e7d32) 45%, transparent); }
.tag.bad { color: var(--critical-ink, #b42318); border-color: color-mix(in srgb, var(--critical, #d92d20) 55%, transparent); }
.bad-text { color: var(--critical-ink, #b42318); }
.ad-issues { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; }
.ad-issues li.critical { color: var(--critical-ink, #b42318); }
.ad-issues li.warning { color: var(--warn-ink, #8a5a00); }
.card.focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.form-grid [hidden] { display: none !important; }
.form-grid label.check, .check-grid label.check { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.form-grid label.check input, .check-grid label.check input { width: auto; margin: 0; }
.nowrap { white-space: nowrap; }

.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.inline-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.form-grid .hint { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
/* action buttons inside table cells stay on one line (a flex <td> loses its table-cell layout) */
.tbl td.row-actions { display: table-cell; }
.tbl td.row-actions > .btn + .btn { margin-left: 6px; }
/* sign-in with Windows accounts: switch, domain, then the three groups side by side */
.form-grid.ad-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.ad-form .wide, .form-grid.ad-form .form-actions { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid.ad-form { grid-template-columns: 1fr; } }
.health-grid > .empty { grid-column: 1 / -1; }

/* ---- side menu: compact, foldable groups (fits the screen without scrolling) */
.sidebar { padding: 8px 8px 12px; overscroll-behavior: contain; }
.sidebar .tabs a { padding: 4px 10px; font-size: 13px; line-height: 1.35; }
.nav-sec { display: flex; flex-direction: column; gap: 1px; }
.nav-sec .nav-items { display: flex; flex-direction: column; gap: 1px; }
.nav-sec.closed .nav-items { display: none; }
button.nav-group { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; cursor: pointer;
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 9px 10px 3px; border-radius: 6px; }
button.nav-group:hover { color: var(--text); }
button.nav-group:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.nav-group .gl { flex: 1; }
button.nav-group .chev::before { content: "▾"; font-size: 11px; }
.nav-sec.closed button.nav-group .chev::before { content: "▸"; }
.gdot { width: 7px; height: 7px; border-radius: 50%; display: none; }
.nav-sec.closed .gdot.on { display: inline-block; }
.gdot.s-down, .gdot.s-degraded { background: var(--critical, #d92d20); }
.gdot.s-warning { background: var(--warning, #f79009); }

/* ---- System page */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: 16px; }
.modal { width: min(440px, 100%); display: flex; flex-direction: column; gap: 10px; margin: 0; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.modal input { font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.modal .form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn.danger-solid { background: var(--critical-strong, #b42318); border-color: var(--critical-strong, #b42318); color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.08); }
.danger-zone { border-color: color-mix(in srgb, var(--critical, #d92d20) 45%, var(--border)); }
.dz-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border); }
.dz-row:first-of-type { border-top: 0; }
.dz-row p { margin: 4px 0 0; max-width: 70ch; }
.form-grid.sys-form { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.form-grid.sys-form .form-actions { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid.sys-form { grid-template-columns: 1fr; } .dz-row { flex-direction: column; align-items: flex-start; } }

.form-grid.sys-form .wide-all { grid-column: 1 / -1; }
fieldset.gfs { display: grid; grid-template-columns: repeat(4, minmax(0, 120px)) 1fr; gap: 10px; align-items: end; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 12px; margin: 0; }
fieldset.gfs [data-gfs] { align-self: center; }
@media (max-width: 700px) { fieldset.gfs { grid-template-columns: repeat(2, 1fr); } }
.tag.tier-yearly { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.tag.tier-monthly { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* ---- security: sign-in steps, recovery codes, policy */
.setup-key { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .06em; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; margin: 4px 0; user-select: all; word-break: break-all; }
.steps-list { padding-left: 18px; margin: 4px 0; display: grid; gap: 6px; }
.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 6px 0 10px; }
.recovery code { font-size: 14px; padding: 4px 8px; background: var(--surface-2); border-radius: 6px; text-align: center; user-select: all; }
.form-ok { color: var(--good-strong, #067647); font-size: 13px; }
.auth-card [data-forgot], .auth-card [data-back] { display: block; text-align: center; margin-top: 4px; }
.form-grid.pol-form { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; }
.form-grid.pol-form .wide-all, .form-grid.one-col .wide { grid-column: 1 / -1; }
.form-grid.one-col { grid-template-columns: 1fr; }
@media (max-width: 700px) { .form-grid.pol-form { grid-template-columns: 1fr; } }
.applog { max-height: 360px; overflow: auto; font-size: 12px; line-height: 1.45; background: var(--surface-2); border-radius: 8px; padding: 10px; margin: 0; white-space: pre-wrap; word-break: break-word; }
.auth-card label.check { flex-direction: row; align-items: center; gap: 8px; }
.auth-card label.check input { width: auto; margin: 0; }

.form-grid.audit-filter { grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; }
.form-grid.audit-filter .form-actions { grid-column: 1 / -1; justify-content: flex-start; }
.form-grid.siem-form { grid-template-columns: auto 2fr 100px 1fr auto; align-items: end; }
.form-grid.siem-form .form-actions { grid-column: 1 / -1; }
.ok-note { padding: 8px 12px; border-radius: 6px; background: color-mix(in srgb, var(--good, #12b76a) 12%, transparent); font-size: 13px; margin: 8px 0; }
@media (max-width: 900px) { .form-grid.audit-filter, .form-grid.siem-form { grid-template-columns: 1fr 1fr; } }

/* off-site backup copies (System page) */
.warn-text { color: var(--warn-ink); }
.okey { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
.okey .setup-key { font-size: 12px; letter-spacing: 0; word-break: break-all; user-select: all; }
