/* SQLNirvana — calm, action-first UI */
/* Pyro family design system (pyrogroup.com · NimbleDine): cream canvas, ink sidebar, Pyro orange */
:root {
  color-scheme: light;
  --bg: #f4f1e9; --surface: #ffffff; --surface-2: #f8f6f0; --surface-3: #ebe7dc; --border: #e4dfd3; --border-strong: #dcd7cc;
  --text: #171814; --text-2: #4a4c45; --muted: #62645d;
  --accent: #e45a08; --accent-2: #ff6a1a; --accent-ink: #ffffff; --accent-soft: #ffe7d8; --accent-text: #c24a04;
  --mint: #d8f4d2; --mint-ink: #1f5a24; --ink: #171814; --ink-2: #2b2d27;
  --good: #2f9e44; --warning: #e8a700; --serious: #e45a08; --critical: #c73422;
  --good-ink: #1f7a33; --warning-ink: #8a6200; --critical-ink: #b02e1e;
  --series-1: #171814; --series-fill: #171814; --grid: #ece8de; --track: #ebe7dc;
  --code-bg: #f6f3ec; --shadow: 0 1px 2px rgba(23,24,20,.04), 0 6px 20px rgba(23,24,20,.04);
  --side-bg: #171814; --side-text: #c9cbc2; --side-muted: #8a8c83; --side-hover: #22241f; --side-active: #2b2d27; --side-border: #34362f;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11120f; --surface: #191a16; --surface-2: #1f201b; --surface-3: #2b2d27; --border: #2b2d27; --border-strong: #3a3c35;
    --text: #f4f1e9; --text-2: #c9c6bc; --muted: #93958b;
    --accent: #ff6a1a; --accent-2: #ff8a45; --accent-ink: #171814; --accent-soft: #3a2316; --accent-text: #ff8a45;
    --mint: #1f3a22; --mint-ink: #9fe0a3; --ink: #f4f1e9; --ink-2: #dcd7cc;
    --good-ink: #6fd27c; --warning-ink: #f2c94c; --critical-ink: #ff7b6b;
    --series-1: #f4f1e9; --series-fill: #f4f1e9; --grid: #24251f; --track: #2b2d27; --code-bg: #1d1e19;
    --shadow: 0 1px 2px rgba(0,0,0,.35);
    --side-bg: #0b0c0a; --side-hover: #191a16; --side-active: #22241f; --side-border: #22241f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11120f; --surface: #191a16; --surface-2: #1f201b; --surface-3: #2b2d27; --border: #2b2d27; --border-strong: #3a3c35;
  --text: #f4f1e9; --text-2: #c9c6bc; --muted: #93958b;
  --accent: #ff6a1a; --accent-2: #ff8a45; --accent-ink: #171814; --accent-soft: #3a2316; --accent-text: #ff8a45;
  --mint: #1f3a22; --mint-ink: #9fe0a3; --ink: #f4f1e9; --ink-2: #dcd7cc;
  --good-ink: #6fd27c; --warning-ink: #f2c94c; --critical-ink: #ff7b6b;
  --series-1: #f4f1e9; --series-fill: #f4f1e9; --grid: #24251f; --track: #2b2d27; --code-bg: #1d1e19;
  --shadow: 0 1px 2px rgba(0,0,0,.35);
  --side-bg: #0b0c0a; --side-hover: #191a16; --side-active: #22241f; --side-border: #22241f;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent-text); text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
code, pre, .mono { font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
h1 { font-size: 26px; letter-spacing: -.03em; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 13px; margin: 0 0 8px; font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .grow { flex: 1; } .num, .tnum { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- shell */
body.shell #app { margin-left: 248px; }
.side { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--side-bg); color: var(--side-text); border-right: 1px solid var(--side-border);
  display: flex; flex-direction: column; padding: 18px 12px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); letter-spacing: -.02em; padding: 2px 8px 14px; }
.brand small { display: block; font-size: 10.5px; font-weight: 500; letter-spacing: .04em; color: var(--accent); margin-top: -2px; }
.side .brand { color: #fff; }
.workspace { padding: 0 8px 14px; font-size: 12px; color: var(--side-muted); border-bottom: 1px solid var(--side-border); margin-bottom: 10px; }
.workspace b { display: block; color: #fff; font-size: 13px; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .side .navbtn { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--side-text); font-weight: 500; border: 0; background: none; width: 100%; text-align: left; }
.nav a:hover, .side .navbtn:hover { background: var(--side-hover); color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav svg, .side .navbtn svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.side-label { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 16px 10px 6px; }
.side-label button { background: none; border: 0; color: var(--accent-2); font-size: 18px; line-height: 1; padding: 0 2px; }
.srv-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 1px; margin: 0 -4px; padding: 0 4px; }
.srv-list a { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 10px; color: var(--side-text); font-size: 13px; }
.srv-list a:hover { background: var(--side-hover); color: #fff; }
.srv-list a.active { background: var(--side-active); color: #fff; }
.srv-list .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-list .sc { font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600; color: var(--side-muted); }
.side-foot { border-top: 1px solid var(--side-border); padding-top: 10px; display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff;
  background: var(--accent); flex: none; }
.side-foot .who { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.3; }
.side-foot .who { color: var(--side-muted); }
.side-foot .who b { color: #fff; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: 1px solid var(--border); color: var(--text-2); border-radius: 99px; width: 32px; height: 32px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }
.side .icon-btn { border-color: var(--side-border); color: var(--side-text); }
.side .icon-btn:hover { background: var(--side-hover); color: #fff; }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 99px; background: var(--critical); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; margin-left: auto; }
.mobile-top { display: none; }

main#app { max-width: 1240px; padding: 28px 36px 64px; }
body.shell main#app { max-width: none; }
body.shell main#app > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.page { max-width: 1180px; margin: 0 auto; }

/* ---------------------------------------------------------------- primitives */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.two-col { grid-template-columns: 1fr 1fr; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 99px; padding: 8px 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ink { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn.ghost { border-color: transparent; background: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--critical-ink); }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--accent-text); padding: 0; font-weight: 550; }
input, select.input, textarea { width: 100%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 9px; padding: 9px 11px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
label { display: block; font-size: 12.5px; color: var(--text-2); margin: 12px 0 5px; font-weight: 550; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650; white-space: nowrap; border: 1px solid transparent; }
.chip.pass, .chip.good { color: var(--good-ink); background: color-mix(in srgb, var(--good) 13%, transparent); }
.chip.warn, .chip.medium { color: var(--warning-ink); background: color-mix(in srgb, var(--warning) 18%, transparent); }
.chip.fail, .chip.critical { color: var(--critical-ink); background: color-mix(in srgb, var(--critical) 13%, transparent); }
.chip.high { color: #b44406; background: color-mix(in srgb, var(--serious) 15%, transparent); }
.chip.low, .chip.na, .chip.neutral { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.chip.info { color: var(--accent-text); background: var(--accent-soft); }
:root[data-theme="dark"] .chip.high { color: #ff9a5c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.high { color: #ff9a5c; } }
.chip.mint { color: var(--mint-ink); background: var(--mint); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.connected, .dot.connected { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.status-dot.offline, .dot.offline { background: var(--critical); box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 20%, transparent); }
.status-dot.waiting, .dot.waiting { background: var(--warning); }
.progress { height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.error { color: var(--critical-ink); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); font-size: 14px; }
.hero { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.hero h1 { display: flex; align-items: center; gap: 10px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.meta span { white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.subnav { display: flex; gap: 2px; margin: 18px 0 22px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.subnav a { padding: 10px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav a:hover { color: var(--text); }
.subnav a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: -4px 0 16px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--muted); border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 550; }
.tabs .active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- summary + KPIs */
.summary { font-size: 17px; line-height: 1.5; color: var(--text); margin: 0 0 18px; letter-spacing: -.01em; }
.summary b { font-weight: 650; }
.kpis { display: grid; grid-template-columns: 1.25fr repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 10px; box-shadow: var(--shadow); position: relative; overflow: hidden; min-width: 0; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 550; display: flex; justify-content: space-between; gap: 6px; }
.kpi .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .v small { font-size: 13px; font-weight: 550; color: var(--muted); margin-left: 3px; }
.kpi .d { font-size: 11.5px; font-weight: 600; }
.kpi .d.up { color: var(--good-ink); } .kpi .d.down { color: var(--critical-ink); } .kpi .d.flat { color: var(--muted); }
.kpi svg.spark { display: block; width: 100%; height: 34px; margin-top: 6px; }
.kpi.score { background: #171814; color: #f4f1e9; border-color: #171814; }
.kpi.score .k { color: #a9aba2; }
:root[data-theme="dark"] .kpi.score { background: linear-gradient(150deg, #2c1a0f, #191a16 75%); border-color: #3a2316; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kpi.score { background: linear-gradient(150deg, #2c1a0f, #191a16 75%); border-color: #3a2316; } }
.kpi.score .band.good { color: #9fe0a3; } .kpi.score .band.average { color: #f2c94c; } .kpi.score .band.poor { color: #ff8a73; }
.kpi.score .v { font-size: 34px; }
.kpi.score .band { font-size: 12px; font-weight: 650; }
.band.good { color: var(--good-ink); } .band.average { color: var(--warning-ink); } .band.poor { color: var(--critical-ink); }

/* ---------------------------------------------------------------- attention list */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.attn { padding: 6px 0 4px; }
.attn-head { display: flex; align-items: center; gap: 10px; padding: 12px 20px 8px; }
.attn-head h2 { margin: 0; }
.filters { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.filters button { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 3px 10px; font-size: 12px; color: var(--text-2); font-weight: 550; }
.filters button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.attn-item { display: grid; grid-template-columns: 4px 1fr auto; gap: 14px; align-items: center; padding: 12px 20px 12px 16px; border-top: 1px solid var(--border); cursor: pointer; }
.attn-item:hover { background: var(--surface-2); }
.attn-item .sev { width: 4px; height: 34px; border-radius: 4px; background: var(--muted); }
.attn-item .sev.critical { background: var(--critical); } .attn-item .sev.high { background: var(--serious); }
.attn-item .sev.medium { background: var(--warning); } .attn-item .sev.low { background: var(--border-strong); }
.attn-item .t { font-weight: 600; }
.attn-item .s { font-size: 12.5px; color: var(--muted); margin-top: 1px; display: flex; gap: 8px; flex-wrap: wrap; }
.attn-item .s .cat { color: var(--text-2); font-weight: 550; }
.attn-more { padding: 10px 20px 12px; border-top: 1px solid var(--border); }
.calm { text-align: center; padding: 36px 20px; background: var(--mint); color: var(--mint-ink); border-radius: 0 0 var(--radius) var(--radius); }
.calm .lotus { font-size: 34px; }

/* ---------------------------------------------------------------- glance + timeline */
.glance-row { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.glance-row .lbl { color: var(--text-2); }
.glance-row .n { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; text-align: right; }
.seg { display: flex; gap: 3px; height: 8px; }
.seg i { flex: 1; border-radius: 3px; background: var(--track); }
.seg i.pass { background: color-mix(in srgb, var(--good) 75%, transparent); }
.seg i.warn { background: var(--warning); } .seg i.fail { background: var(--critical); }
.timeline { position: relative; padding-left: 16px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.tl { position: relative; padding: 0 0 12px; font-size: 13px; }
.tl::before { content: ""; position: absolute; left: -16px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.tl.alert::before { border-color: var(--critical); } .tl.config::before { border-color: var(--accent); } .tl.ok::before { border-color: var(--good); }
.tl .when { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------------- drawer */
.drawer-back { position: fixed; inset: 0; background: rgba(8,10,16,.4); z-index: 50; display: flex; justify-content: flex-end; }
.drawer { width: min(560px, 100%); height: 100%; background: var(--surface); border-left: 1px solid var(--border); padding: 26px 28px; overflow-y: auto;
  animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer h2 { font-size: 19px; margin-bottom: 6px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.facts div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.facts .k { font-size: 11.5px; color: var(--muted); } .facts .v { font-weight: 600; word-break: break-word; }

/* ---------------------------------------------------------------- charts */
.chart { position: relative; height: 240px; }
.chart.small { height: 150px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.12); white-space: nowrap; transform: translate(-50%, -110%); }
.empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; text-align: center; }
.db-metric-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.db-metric-tabs button { text-align: left; background: var(--surface-2); border: 1px solid transparent; border-radius: 10px; padding: 8px 12px; }
.db-metric-tabs button.active { background: var(--surface); border-color: var(--ink); box-shadow: var(--shadow); }
.db-metric-tabs .t { font-weight: 600; font-size: 12.5px; } .db-metric-tabs .s { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.sql { background: var(--code-bg); border-radius: 8px; padding: 6px 9px; display: block; white-space: pre-wrap; word-break: break-word; max-width: 560px; }
pre.block { background: var(--code-bg); padding: 12px 14px; border-radius: 10px; overflow-x: auto; margin: 0; border: 1px solid var(--border); white-space: pre-wrap; word-break: break-word; }
.bar { height: 6px; background: var(--track); border-radius: 99px; width: 80px; display: inline-block; vertical-align: middle; margin-left: 6px; }
.bar > span { display: block; height: 100%; background: var(--series-1); border-radius: 99px; }

/* ---------------------------------------------------------------- fleet */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 550; } .stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fleet-list .fl { display: grid; grid-template-columns: 52px minmax(0, 1.6fr) 1fr 80px 90px 190px; align-items: center; gap: 14px; padding: 13px 20px; border-top: 1px solid var(--border); color: var(--text); }
.fleet-list .fl:hover { background: var(--surface-2); }
.fleet-list .fl.head { color: var(--muted); font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; border-top: 0; padding-top: 4px; padding-bottom: 8px; }
.fleet-list .fl.head:hover { background: none; }
.score-badge { width: 42px; height: 42px; border-radius: 99px; display: grid; place-items: center; font-weight: 750; font-size: 15px; font-variant-numeric: tabular-nums; }
.score-badge.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-ink); }
.score-badge.average { background: color-mix(in srgb, var(--warning) 20%, transparent); color: var(--warning-ink); }
.score-badge.poor { background: color-mix(in srgb, var(--critical) 13%, transparent); color: var(--critical-ink); }
.score-badge.none { background: var(--surface-2); color: var(--muted); }
.fl svg.spark { width: 100%; height: 28px; display: block; }

/* ---------------------------------------------------------------- checks list (Checks tab) */
.check-item { display: grid; grid-template-columns: 92px 1fr 260px; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.check-item:last-child { border-bottom: 0; }
.check-item .fix { margin-top: 6px; font-size: 12.5px; }
.group-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 4px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.check-row .name { flex: 1; }

/* ---------------------------------------------------------------- auth, modal, toast */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.auth-art { background: var(--ink); color: var(--bg); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art h2 { font-size: 46px; line-height: 1.05; letter-spacing: -.04em; font-weight: 650; margin: 0; max-width: 520px; color: #fff; }
.auth-art h2 em { font-style: normal; color: var(--accent-2); }
.auth-art p { color: #c9cbc2; max-width: 440px; font-size: 15px; }
.auth-art .ticker { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12px; color: #8a8c83; display: grid; gap: 6px; }
.auth-art .ticker b { color: #d8f4d2; font-weight: 500; }
.auth-side { display: grid; place-items: center; padding: 32px; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } }
.auth { width: min(400px, 100%); }
.auth .brand { justify-content: center; font-size: 22px; padding-bottom: 6px; }
.modal-back { position: fixed; inset: 0; background: rgba(8,10,16,.45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; padding: 24px; width: min(620px, 100%); max-height: 90vh; overflow: auto; border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 70; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1150px) { .kpis { grid-template-columns: repeat(3, 1fr); } .kpi.score { grid-column: span 3; } .layout { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  body.shell #app { margin-left: 0; }
  .side { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  body.side-open .side { transform: none; }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--side-bg); position: sticky; top: 0; z-index: 15; }
  main#app { padding: 20px 16px 48px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .fleet-list .fl { grid-template-columns: 46px 1fr 70px; } .fleet-list .fl > :nth-child(n+4) { display: none; }
  .check-item { grid-template-columns: 80px 1fr; } .check-item .val { grid-column: 2; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .kpis { grid-template-columns: 1fr 1fr; } .kpi.score { grid-column: span 2; }
  .db-metric-tabs { grid-template-columns: 1fr 1fr; } .card { padding: 16px; }
  .attn-item { grid-template-columns: 4px 1fr; } .attn-item > :last-child { display: none; }
  .facts { grid-template-columns: 1fr; }
}
body:not(.shell) main#app { padding: 0; max-width: none; }
.mobile-top .brand { color: #fff; }
.hero h1 { flex-wrap: wrap; }
.hero h1 .pill { white-space: nowrap; }
@media (max-width: 600px) { .hero h1 { font-size: 22px; } }
