/* Vantage dashboard — Portillo Technologies brand. Black anodized + warm bone,
   one signal red used only for active / armed / alert. No corporate blue, no
   saturated green, no gradients. Restrained, security-grade. */
:root {
  --bg: #0A0A0A;              /* black anodized */
  --panel: #121211;
  --panel-2: #181816;
  --line: #2a2a26;
  --text: #E8E5E0;           /* warm bone */
  --muted: #8C8782;          /* warm gray */
  --faint: #5f5b55;
  --accent: #C7361E;          /* the one signal red — active / armed / alert */
  --ok: #8C8782;             /* calm: "normal" is unremarkable; red is the only color */
  --warn: #b8923f;           /* muted amber, never neon */
  --alert: #C7361E;
  --radius: 8px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }

/* Sidebar */
.side {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: baseline; gap: 8px; padding: 0 8px 18px; }
.brand b { font-size: 17px; letter-spacing: 0.04em; }
.brand span { color: var(--faint); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.nav a {
  display: block; padding: 9px 12px; border-radius: 8px; color: var(--muted);
  font-weight: 500;
}
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.side .foot { margin-top: auto; color: var(--faint); font-size: 11px; padding: 12px 8px 0; }

/* Main */
.main { padding: 26px 30px 60px; max-width: 1100px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; letter-spacing: 0.01em; }
.sub { color: var(--muted); margin: 0; }
h2 { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase;
     letter-spacing: 0.08em; margin: 28px 0 12px; }

/* Source label badge — always visible */
.source {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.source .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.source.replay .dot { background: var(--accent); }
.source.live .dot { background: var(--ok); }
.source.simulated .dot { background: var(--warn); }
.source.degraded .dot { background: var(--alert); }
.source.offline .dot { background: var(--faint); }

/* Cards / grid */
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .n { font-size: 30px; font-weight: 600; letter-spacing: -0.01em; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; }
.stat .n.accent { color: var(--accent); }
.stat .n.warn { color: var(--warn); }
.stat .n.alert { color: var(--alert); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--faint); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }
tr:hover td { background: var(--panel-2); }
td.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* Pills for gate state / severity */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px;
        letter-spacing: 0.03em; border: 1px solid var(--line); color: var(--muted); }
.pill.accept { color: var(--ok); border-color: rgba(63,174,107,.4); }
.pill.predict_only { color: var(--accent); border-color: rgba(78,161,211,.4); }
.pill.reject_low_confidence, .pill.signal_degraded, .pill.recalibrate_required {
  color: var(--warn); border-color: rgba(217,154,58,.4); }
.pill.high { color: var(--alert); border-color: rgba(217,89,76,.4); }
.pill.medium { color: var(--warn); border-color: rgba(217,154,58,.4); }
.pill.low, .pill.info { color: var(--muted); }

/* Confidence bar */
.conf { display: inline-flex; align-items: center; gap: 8px; }
.conf .bar { width: 70px; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.conf .bar i { display: block; height: 100%; background: var(--accent); }

/* Live view */
.liveview { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.liveview svg { max-width: 100%; height: auto; border-radius: 6px; }
.legend { color: var(--faint); font-size: 12px; margin-top: 10px; }

.selector { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.selector a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; }
.selector a.on { border-color: var(--accent); color: var(--text); }

dl.kv { display: grid; grid-template-columns: 190px 1fr; gap: 8px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

.note { color: var(--muted); font-size: 12px; }
.banner { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); margin-bottom: 16px; }
.banner.ok { border-color: rgba(63,174,107,.4); }
.report { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
          padding: 18px 22px; white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--text); }
.checklist { list-style: none; padding: 0; } .checklist li { padding: 6px 0; color: var(--muted); }
.checklist li::before { content: "○ "; color: var(--faint); }
.checklist li.done::before { content: "● "; color: var(--ok); }
