/* Alef10 Shield — duty operator console.
 *
 * Same civic register as the visitor page: light, high-contrast, generous,
 * legible across a desk. Colour carries the verdict and nothing else.
 *
 * (Tokens are duplicated from ../apply/styles.css for now. They want lifting
 * into a shared base stylesheet once a third surface exists.)
 */

:root {
  color-scheme: light;

  --paper:      #fbfaf8;
  --card:       #ffffff;
  --ink:        #16181c;
  --ink-muted:  #565c66;
  --rule:       #dbd7d0;
  --rule-firm:  #b9b4ab;

  --green:      #1a7f45;
  --red:        #b3261e;
  --amber:      #8a5a00;

  --focus:      #1c4fd8;

  --sans: system-ui, "Segoe UI", "Noto Sans", "Lucida Grande",
          "Trebuchet MS", Helvetica, Arial, sans-serif;

  --step: 1.5rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.tnum { font-variant-numeric: tabular-nums; }

.wrap {
  width: 100%;
  max-width: 62rem;
  margin-inline: auto;
  padding-inline: var(--step);
}

/* ─── Masthead ───────────────────────────────────────────────────────── */

.masthead { border-bottom: 1px solid var(--rule); background: var(--card); }
.masthead .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.15rem;
}
.wordmark {
  margin: 0;
  font-size: 1.0625rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  font-weight: 400;
}
.wordmark strong { font-weight: 700; }
.masthead-right { display: flex; align-items: baseline; gap: 1rem; }
.masthead-sub { color: var(--ink-muted); font-size: 0.9375rem; }
.who { font-size: 0.9375rem; font-weight: 600; }

/* ─── Panels ─────────────────────────────────────────────────────────── */

main { padding-block: 2.5rem 4rem; }

.panel { display: none; }
main[data-state="loading"]      [data-panel="loading"],
main[data-state="unconfigured"] [data-panel="unconfigured"],
main[data-state="signin"]       [data-panel="signin"],
main[data-state="console"]      [data-panel="console"],
main[data-state="error"]        [data-panel="error"] { display: block; }

.panel.narrow { max-width: 26rem; }

h1 {
  margin: 0 0 0.6rem;
  font-size: 1.9rem;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.lede { margin: 0 0 2rem; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f0eee9;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ─── Sections ───────────────────────────────────────────────────────── */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.section-head:first-child { margin-top: 0; }
.section-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.008em;
}
.count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: #efece6;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-variant-numeric: tabular-nums;
}
.section-note {
  margin: 0.6rem 0 1rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}
.empty {
  margin: 0 0 0.5rem;
  padding: 1.25rem 0;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

/* ─── Rows ───────────────────────────────────────────────────────────── */

.rows { display: flex; flex-direction: column; gap: 0.75rem; }

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.5rem;
  align-items: center;
  padding: 1rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule-firm);
  border-radius: 5px;
}
.row[data-tone="green"] { border-left-color: var(--green); }
.row[data-tone="red"]   { border-left-color: var(--red); }
.row[data-tone="amber"] { border-left-color: var(--amber); }

.row-who { min-width: 0; }
.row-name {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 650;
}
.row-meta {
  margin: 0.2rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}
.row-meta .sep { opacity: 0.5; padding-inline: 0.4rem; }

.row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.pill {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  border: 1px solid;
}
.pill[data-tone="green"] { color: var(--green); border-color: #b6ddc4; background: #f1f9f4; }
.pill[data-tone="red"]   { color: var(--red);   border-color: #eccbc8; background: #fdf3f2; }
.pill[data-tone="amber"] { color: var(--amber); border-color: #e6d3a8; background: #fdf8ec; }

.remaining { font-weight: 650; }

/* ─── Controls ───────────────────────────────────────────────────────── */

.field { margin-bottom: 1.25rem; }

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule-firm);
  border-radius: 4px;
}

input:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.btn {
  padding: 0.7rem 1.4rem;
  font: inherit;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
}
.btn:hover:not(:disabled) { background: #000; }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn-quiet {
  color: var(--ink);
  background: var(--card);
  border-color: var(--rule-firm);
}
.btn-quiet:hover:not(:disabled) { background: #f2f0eb; }

/* Decision buttons. Weight follows consequence: approve is the affirmative
 * default, deny and revoke are deliberate rather than decorative. */
.btn-sm {
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  background: var(--card);
}
.btn-approve { color: #fff; background: var(--green); border-color: var(--green); }
.btn-approve:hover:not(:disabled) { background: #16693a; }
.btn-deny    { color: var(--red); border-color: #ddb5b1; }
.btn-deny:hover:not(:disabled)    { background: #fdf3f2; }
.btn-revoke  { color: var(--red); border-color: #ddb5b1; }
.btn-revoke:hover:not(:disabled)  { background: #fdf3f2; }
.btn-sm:disabled { opacity: 0.45; cursor: default; }

.linkish {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--focus);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.form-error {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  color: var(--red);
  background: #fdf3f2;
  border: 1px solid #eccbc8;
  border-left: 3px solid var(--red);
  border-radius: 3px;
  font-size: 0.9375rem;
}

/* ─── Audit ──────────────────────────────────────────────────────────── */

.audit { margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.audit summary {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.008em;
}
.audit .rows { gap: 0; }

.audit-row {
  display: grid;
  grid-template-columns: 9.5rem 8rem 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
@media (max-width: 40rem) {
  .audit-row { grid-template-columns: 1fr; gap: 0.15rem; }
}
.audit-when  { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.audit-actor { font-weight: 600; }
.audit-what  { color: var(--ink-muted); }
.audit-what strong { color: var(--ink); font-weight: 600; }

/* ─── Footer ─────────────────────────────────────────────────────────── */

.footnote {
  padding-block: 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.875rem;
}
.footnote p { margin: 0; }

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

/* Approving has to say where, not just whether. */
.zones { display: flex; align-items: center; gap: 0.85rem; margin-top: 0.5rem; flex-wrap: wrap; }
.zones-label { color: var(--ink-muted); font-size: 0.875rem; }
.zone-pick { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; font-weight: 500; font-size: 0.9375rem; }
.zone-pick input { width: auto; margin: 0; }
