/* Operator Console shell.
   Colour comes ONLY from tokens.css — never a hex outside that file, per its own header.
   Layout numbers come from the design package's HANDOFF.md:93, which is the governing visual
   contract (never an order's enumerated list, never a number read off a mockup):
     admin — 260 sidebar · 64 topbar · 28 gutter · 40 table rows · tabular-nums on all figures */

:root {
  --admin-sidebar-w: 260px;
  --admin-topbar-h: 64px;
  --admin-gutter: 28px;
  --admin-row-h: 40px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Every figure is tabular — HANDOFF:93. A column of numbers that shifts as it updates is
   harder to read than one that does not, and this surface is read more than it is clicked. */
.figure, table, .metric { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

[hidden] { display: none !important; }

/* ── sign-in ───────────────────────────────────────────────────────────── */
.signin-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: var(--admin-gutter);
  background: var(--grad-auth-glow), var(--bg-base);
}
.signin {
  width: 100%;
  max-width: 22rem;
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-card);
  padding: var(--s7);
  box-shadow: var(--e1);
}
.brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 var(--s2);
}
.brand .b { color: var(--act-text); }
.signin p.hint { margin: 0 0 var(--s6); color: var(--text-secondary); font-size: 13px; }
label { display: block; margin-bottom: var(--s4); }
label span { display: block; margin-bottom: var(--s1); color: var(--text-secondary); font-size: 12px; }
input {
  width: 100%;
  height: var(--hit-min);
  padding: 0 var(--s4);
  background: var(--bg-inset);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font: inherit;
}
input:focus { outline: none; border-color: var(--act-border); box-shadow: var(--focus-ring); }
button {
  width: 100%;
  height: var(--hit-min);
  background: var(--act);
  color: var(--act-on);
  border: 0;
  border-radius: var(--r-btn);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: var(--act-hover); }
button:active { background: var(--act-pressed); }
button[disabled] { opacity: .6; cursor: default; }
button.ghost {
  width: auto; height: auto; padding: var(--s1) var(--s3);
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-hairline); border-radius: var(--r-sm);
  font-weight: 500; font-size: 12px;
}
button.ghost:hover { color: var(--text-primary); border-color: var(--border-strong); background: transparent; }
.error {
  margin: 0 0 var(--s4);
  padding: var(--s3) var(--s4);
  background: var(--heat-tint);
  border: 1px solid var(--heat-border);
  border-radius: var(--r-sm);
  color: var(--heat-text);
  font-size: 13px;
}

/* ── shell ─────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--admin-sidebar-w) 1fr; min-height: 100%; }

.sidebar {
  background: var(--bg-raised);
  border-right: 1px solid var(--border-hairline);
  padding: var(--s5) 0;
  display: flex;
  flex-direction: column;
}
.sidebar .brand { padding: 0 var(--s5) var(--s5); }
.nav { list-style: none; margin: 0; padding: 0; }
.nav li { margin: 0; }
.nav a, .nav span.disabled {
  display: flex;
  align-items: center;
  height: var(--admin-row-h);
  padding: 0 var(--s5);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  border-left: 2px solid transparent;
}
.nav a:hover { color: var(--text-primary); background: var(--bg-overlay); }
.nav a[aria-current="page"] {
  color: var(--act-text);
  border-left-color: var(--act);
  background: var(--act-tint);
}
/* A control an operator may not use is absent or visibly disabled WITH A REASON — never dead.
   C5 and C6 build these; until then they say so rather than failing silently on click. */
.nav span.disabled { color: var(--text-disabled); cursor: not-allowed; }
.nav span.disabled::after {
  content: attr(data-reason);
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}

.topbar {
  height: var(--admin-topbar-h);
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: 0 var(--admin-gutter);
  background: var(--bg-base);
}
.topbar h1 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.topbar .who { margin-left: auto; color: var(--text-secondary); font-size: 13px; }

main { padding: var(--admin-gutter); }
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-card);
  padding: var(--s6);
  max-width: 44rem;
}
.panel h2 { margin: 0 0 var(--s3); font-size: 14px; font-weight: 600; color: var(--text-primary); }
.panel p { margin: 0 0 var(--s3); color: var(--text-secondary); }
.panel p:last-child { margin-bottom: 0; }
code { font-family: var(--font-mono); font-size: 12px; color: var(--act-text); }

/* Table rows are 40px — HANDOFF:93. Declared now so C5/C6 inherit the density rather than
   inventing it, and so no later surface has to guess. */
table { width: 100%; border-collapse: collapse; }
th, td {
  height: var(--admin-row-h);
  padding: 0 var(--s4);
  text-align: left;
  border-bottom: 1px solid var(--border-hairline);
  font-size: 13px;
}
th { color: var(--text-muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }

/* Density over drama: no transition anywhere that delays information reaching the operator. */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
