/* ── Overwatch shared identity ─────────────────────────────────────────────
   Two rooms, one system: the monitor is the radar room (dark scope), the
   admin console is the tower cab (paper strip bay). Same wordmark, same
   mono data face, same amber. */

:root {
  --mono: "Cascadia Mono", Consolas, "SF Mono", ui-monospace, monospace;
  --ui: "Segoe UI", system-ui, -apple-system, sans-serif;

  /* dark scope (monitor + landing) */
  --page: #0e1420;
  --surface: #16202e;
  --surface-2: #1c2939;
  --line: #263248;
  --ink: #e8edf5;
  --ink-2: #a7b2c4;
  --muted: #66738a;
  --amber: #ffb454;        /* brand accent: live things, the wordmark tick */
  --cyan: #7fd8ea;         /* secondary: out-of-region, links */
  --series: #3987e5;       /* chart bars (dark-mode categorical slot 1) */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --focus: #7fd8ea;
}

[data-theme="light"] {
  --page: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --line: #dbe1ea;
  --ink: #16202e;
  --ink-2: #4c596d;
  --muted: #7c8798;
  --amber: #a66300;        /* amber holds, darkened for paper */
  --amber-raw: #ffb454;    /* strip edges keep the true amber */
  --cyan: #0e7490;
  --series: #2a78d6;
  --good: #0ca30c;
  --warning: #b97f00;
  --serious: #c05621;
  --critical: #d03b3b;
  --focus: #2a78d6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── wordmark ── */
.wordmark {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.wordmark .tick { color: var(--amber); }
.wordmark small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: 2px;
}

/* ── header bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.topbar .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── chips ── */
.chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-2);
  background: var(--surface);
  white-space: nowrap;
}
.chip b { color: var(--ink); font-weight: 600; }
.chip.live b { color: var(--amber); }
.chip .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px; vertical-align: 1px; background: var(--muted);
}
.chip .dot.on  { background: var(--good); }
.chip .dot.off { background: var(--critical); }

/* ── stat tiles ── */
.tiles { display: flex; gap: 10px; flex-wrap: wrap; }
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 14px;
  min-width: 108px;
}
.tile .v {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.15;
}
.tile .v.accent { color: var(--amber); }
.tile .l {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 3px;
}

/* ── panels ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.panel > h2 {
  margin: 0;
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.panel > h2 .note { letter-spacing: 0.04em; color: var(--muted); text-transform: none; font-weight: 400; }
.panel .body { padding: 12px 14px; }

/* ── flight strips (the ATC progress-strip motif) ── */
.strip {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 3px;
  padding: 8px 10px 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
}
.strip.sadc   { border-left-color: var(--amber); }
.strip.action { border-left-color: var(--series); }
.strip + .strip { margin-top: 8px; }
.strip .cost {
  position: absolute; top: 8px; right: 10px;
  font-size: 10px; letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line); border-radius: 2px;
  padding: 1px 6px;
}
.strip.clickable { cursor: pointer; }
.strip.clickable:hover { border-color: var(--ink-2); }
.strip.selected { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }

/* ── tables ── */
table.data { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
table.data th {
  text-align: left; font-weight: 600; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
table.data td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.data td.k { color: var(--ink); }
table.data td.num, table.data th.num { text-align: right; }
table.data tr:last-child td { border-bottom: none; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--surface-2); }

/* ── forms ── */
label.field { display: block; margin-bottom: 10px; }
label.field .fl {
  display: block; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin-bottom: 4px;
}
input[type="text"], input[type="number"], select {
  width: 100%;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 7px 9px;
  font-family: var(--mono);
  font-size: 13px;
}
input:focus, select:focus { border-color: var(--focus); outline: none; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.check input { accent-color: var(--amber); width: 15px; height: 15px; }

button {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
}
button:hover { border-color: var(--ink-2); }
button.primary { background: var(--amber); border-color: var(--amber); color: #16202e; font-weight: 700; }
button.primary:hover { filter: brightness(1.08); }
button.danger-arm { background: var(--critical); border-color: var(--critical); color: #fff; font-weight: 700; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── status text ── */
.ok   { color: var(--good); }
.warn { color: var(--warning); }
.bad  { color: var(--critical); }
.mut  { color: var(--muted); }

/* ── toast ── */
#toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--good);
  color: var(--ink); font-family: var(--mono); font-size: 12px;
  padding: 10px 16px; border-radius: 3px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s; z-index: 50; max-width: 90vw;
}
#toast.show { opacity: 1; }
#toast.err { border-left-color: var(--critical); }
