/* Mission Control — internal operator dashboard.
   Design references documented in DESIGN.md. Deliberately plain:
   hairline borders, one accent per action, tabular numerals, no gradients. */

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #1a1a18;
  --muted: #6b6a65;
  --line: #e3e1dc;
  --approve: #1f7a4c;
  --reject: #a32b1f;
  --warn: #8a6d1f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --surface: #1c1c1a;
    --ink: #eceae5;
    --muted: #918f88;
    --line: #2e2e2b;
    --approve: #4cc38a;
    --reject: #e5644f;
    --warn: #d6b45c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 ui-sans-serif, -apple-system, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-wrap: break-word; /* URLs and long tokens must never widen the page */
}

.bar {
  border-bottom: 1px solid var(--line);
}
.bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 16px 12px;
  max-width: 720px; /* same measure as main, so the header lines up with it */
  margin: 0 auto;
}
.bar-inner > div { min-width: 0; } /* let long phase text wrap instead of widening the row */

h1 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 28px 0 8px;
}

main { padding: 0 16px 40px; max-width: 720px; margin: 0 auto; }
p { margin: 0; }
.dim { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; white-space: nowrap; flex: none; }
.footer { margin-top: 32px; }

.count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  text-align: center;
  letter-spacing: 0;
}
.count:empty { display: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

/* Budget — the figure carries the hierarchy, label above, context below. */
.budget { margin-top: 20px; }
.label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.figure {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 12px;
}
.meter { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 0.3s ease;
}

/* Queue cards — full-width rows, actions given real thumb room. */
.item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}
.item .kind {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.item .title { font-weight: 600; margin: 3px 0; letter-spacing: -0.01em; }
.item .detail { color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.item .amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin-top: 6px;
}
.item .amount.over { color: var(--warn); }

.actions { display: flex; gap: 10px; margin-top: 14px; }
button {
  flex: 1;
  min-height: 46px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:active { transform: translateY(1px); }
button[disabled] { opacity: 0.5; cursor: default; }
.approve { border-color: var(--approve); color: var(--approve); }
.reject { border-color: var(--reject); color: var(--reject); }

/* Confirm step: label and position change, never colour alone. */
.confirm { border-color: var(--ink); background: var(--ink); color: var(--bg); }

/* Rows: ledger, log, team, decided */
.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row .num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.entry { padding: 12px 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry h3 { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.entry dl { margin: 0; font-size: 13px; }
.entry dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 6px;
}
.entry dd { margin: 1px 0 0; }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.dot.approved { background: var(--approve); }
.dot.rejected { background: var(--reject); }
