/* Command Center: one dark operations-room look. */
:root {
  --bg: #0a0f1a; --panel: #0f1626; --panel-2: #131c30; --line: #1e2a44;
  --fg: #e6eefc; --muted: #8b9bb8; --accent: #5ee7ff;
  --ok: #5ee7ff; --warn: #ffb547; --bad: #ff5d6c; --none: #7b8bb0;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--sans); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding-block: 24px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
main { display: grid; gap: 18px; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); }
.title { margin: 0; font-family: var(--mono); font-weight: 500; font-size: 28px; letter-spacing: .02em; text-wrap: balance; }
.take { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.take b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn { font: inherit; font-size: 13px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--fg); cursor: pointer; }
.btn:hover { border-color: #2c3c60; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04121c; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .6; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.panel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-h h2 { margin: 0; font-size: 16px; font-weight: 600; }
.sub { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: 12px; }
.kpi { display: grid; gap: 4px; align-content: start; }
.kpi .lab { font-size: 12px; color: var(--muted); }
.kpi .big { font-family: var(--mono); font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .of { font-family: var(--sans); font-size: 14px; color: var(--muted); }
.kpi .delta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.up { color: var(--ok); } .down { color: var(--bad); }

.brain { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 20px; align-items: start; }
.brain-main { min-width: 0; }
.brainctl { display: flex; align-items: center; gap: 10px; }
.brainctl input { flex: 1; min-width: 0; accent-color: var(--accent); }
.brainread { margin: 8px 0 6px; min-height: 1.5em; font-variant-numeric: tabular-nums; }
.brainread b { color: var(--fg); font-weight: 600; }
.hud { position: relative; background: #070b18; border-radius: 8px; overflow: hidden; min-height: 300px; }
.hud canvas { display: block; cursor: crosshair; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.sw.ok { background: var(--ok); } .sw.warn { background: var(--warn); } .sw.down { background: var(--bad); } .sw.none { background: var(--none); }
.sw.dormant { border: 1px solid var(--none); }

.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.notes li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 8px; align-items: baseline; }
.pill { justify-self: start; font-size: 12px; border: 1px solid currentColor; border-radius: 999px; padding: 0 .55em; white-space: nowrap; }
.k-flag { color: var(--warn); } .k-win { color: var(--ok); } .k-suggestion { color: var(--muted); }

.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 18px; }
.chart { position: relative; min-height: 220px; }
.chart .empty { display: grid; place-items: center; min-height: 220px; text-align: center; max-width: 34ch; margin: 0 auto; }
.lbl { font: 12px var(--sans); }
.sw2 { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.chart svg { display: block; }
.tick { font: 12px var(--sans); fill: var(--muted); }
.tip { position: absolute; pointer-events: none; background: #111a2e; border: 1px solid #2a3a5c; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.4); padding: 6px 10px; font-size: 12px; white-space: nowrap; z-index: 2; color: var(--fg); font-variant-numeric: tabular-nums; }
.tip .h { color: var(--muted); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .n { text-align: right; }
.table .msg { min-width: 12rem; }
.table .msg .small { margin-top: 2px; }
.table .when { white-space: nowrap; color: var(--muted); }
.table code { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.st-healthy { color: var(--ok); } .st-warning, .st-stale { color: var(--warn); } .st-down { color: var(--bad); } .st-not-monitored { color: var(--none); }
.empty { color: var(--muted); padding: 14px 10px; }
.foot { display: flex; flex-wrap: wrap; gap: 6px 16px; }

.login { display: grid; place-items: center; min-height: 70vh; }
.login-box { width: min(100%, 360px); display: grid; gap: 10px; padding: 24px; }
.login-box label { font-size: 12px; color: var(--muted); }
.login-box input { font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.err { color: var(--bad); font-size: 13px; min-height: 1em; }

@media (max-width: 640px) { .hide-n { display: none; } .title { font-size: 24px; } .kpi .big { font-size: 28px; } .table .when { white-space: normal; width: 5.5rem; } }
