/* CipherBots admin console (docs/cipherbots-design.md §10.2). Self-contained: no web fonts, no
   third-party origin. Tokens on :root, redefined for dark mode. */
:root {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --text: #17181c;
  --muted: #5d616b;
  --line: #e2e4e9;
  --accent: #3355dd;
  --accent-text: #ffffff;
  --ok: #1d7a46;
  --warn: #9a6400;
  --bad: #b3261e;
  --chip: #eef0f4;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --panel: #1a1d23;
    --text: #e8e9ec;
    --muted: #9ba0aa;
    --line: #2b2f37;
    --accent: #7d97ff;
    --accent-text: #0d1020;
    --ok: #5cc98b;
    --warn: #e2b04a;
    --bad: #ff7a70;
    --chip: #252932;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.center { display: grid; place-items: center; min-height: 100vh; padding: 16px; text-align: center; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.shell {
  display: grid; grid-template-columns: 220px 1fr; min-height: 100vh;
  /* The sidebar's panel colour runs the page's full height, not just one sticky screen. */
  background: linear-gradient(to right, var(--panel) 220px, var(--line) 220px, var(--line) 221px, var(--bg) 221px);
}
nav.side {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 16px 10px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
nav.side .brand { font-weight: 650; padding: 4px 10px 2px; }
nav.side .org { padding: 0 10px 14px; font-size: 12px; }
nav.side a {
  display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); text-decoration: none;
}
nav.side a:hover { background: var(--chip); }
nav.side a.on { background: var(--accent); color: var(--accent-text); }
nav.side .phase { font-size: 11px; opacity: 0.75; margin-left: 4px; }
nav.side .who { margin-top: 18px; padding: 10px; border-top: 1px solid var(--line); font-size: 12px; }
main.page { padding: 22px 26px 60px; min-width: 0; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 22px 0 8px; }
.lede { margin: 0 0 18px; color: var(--muted); max-width: 70ch; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
}
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 22px; font-weight: 600; margin-top: 2px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow-x: auto;
}
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--chip); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--chip);
  font-size: 12px; white-space: nowrap;
}
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); } .chip.bad { color: var(--bad); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
button, select, input {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 10px;
}
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--bad); }
button:disabled { opacity: 0.5; cursor: default; }
.mt8 { margin-top: 8px; }
.pad { padding: 12px; }
.empty { padding: 22px; text-align: center; color: var(--muted); }
.note {
  border-left: 3px solid var(--accent); background: var(--panel); padding: 10px 14px;
  border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 14px; max-width: 80ch;
}
.note.warn { border-color: var(--warn); }
.toast {
  position: fixed; bottom: 18px; right: 18px; max-width: 420px; background: var(--text);
  color: var(--bg); padding: 10px 14px; border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.2);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel);
  border-left: 1px solid var(--line); padding: 20px; overflow-y: auto; box-shadow: -8px 0 30px rgba(0,0,0,.15);
}
.drawer .close { float: right; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.signin { max-width: 380px; }
.signin input { width: 100%; margin: 10px 0; }
pre.json {
  background: var(--chip); padding: 12px; border-radius: var(--radius); overflow-x: auto;
  font-family: var(--mono); font-size: 12px; margin: 0;
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .shell { background: var(--bg); }
  nav.side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  nav.side .brand, nav.side .org, nav.side .who { width: 100%; }
  main.page { padding: 16px; }
  dl.kv { grid-template-columns: 1fr; }
}
