/*
 * Slab Soft, restated for a browser.
 *
 * These values are copied from theme/tokens.ts, not imported from it — the console is a
 * separate plain web app with no build step and no React, so there is nothing to import
 * through. Two consequences worth being honest about:
 *
 *   · CLAUDE.md's "no literal hex in a screen or component" is about the app, where a token
 *     file exists to hold them. Here the custom properties below ARE that file: every colour,
 *     radius and space is defined once, at the top, and nothing further down writes a literal.
 *     A visual change is still a token change.
 *
 *   · When theme/tokens.ts moves, this does not follow automatically. It is a staff tool, so
 *     drifting a shade is survivable in a way it would not be in the product.
 *
 * The one thing worth keeping in step is the meaning, not the value: orange means "this wants
 * you", and nothing else is ever orange.
 */

:root {
  --bg: #edeae4;
  --surface: #ffffff;
  --surface2: #f7f4ee;
  --line: #e4dfd5;

  --ink: #1c1b20;
  --ink2: #6e6a64;
  --ink3: #a19c93;

  --accent: #ff5a1f;
  --accent-ink: #c43f0c;
  --accent-wash: #ffebe1;
  --on-accent: #ffffff;

  --info: #2f4bd8;

  /* Warm, never neutral black. The single choice that stops this reading as stock Material. */
  --shadow: 60 42 24;

  --r-inner: 12px;
  --r-card: 18px;
  --r-pill: 999px;

  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 12px;
  --s-lg: 16px;
  --s-xl: 24px;
  --s-xxl: 32px;

  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141317;
    --surface: #1f1d23;
    --surface2: #26242c;
    --line: #2c2a31;

    --ink: #efebe4;
    --ink2: #8f8a82;
    --ink3: #6b665f;

    --accent-ink: #ff7a45;
    --accent-wash: #33211a;

    --shadow: 0 0 0;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--s-lg);
}

main.wrap {
  padding-top: var(--s-xl);
  padding-bottom: var(--s-xxl);
}

/* ---------------------------------------------------------------- header */

header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: var(--s-md);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
}

/* The mark is the slab: a plain rectangle, seen straight on. docs/09 is firm about resisting
   the calendar, the clock and the little group of people. */
.mark {
  width: 22px;
  height: 14px;
  border-radius: 3px;
  background: var(--accent);
}

.name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.3px;
}

nav {
  display: flex;
  gap: var(--s-xs);
  margin-top: var(--s-md);
  overflow-x: auto;
}

nav a {
  padding: var(--s-sm) var(--s-md);
  border-radius: var(--r-inner) var(--r-inner) 0 0;
  color: var(--ink2);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

nav a:hover {
  color: var(--ink);
}

nav a.here {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------------------------------------------------------------- layout */

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-lg);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
  flex-wrap: wrap;
}

.row.tight {
  justify-content: flex-end;
  gap: var(--s-sm);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-md);
}

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: var(--s-xl);
  box-shadow: 0 1px 2px rgb(var(--shadow) / 0.06), 0 6px 18px rgb(var(--shadow) / 0.07);
}

.card > * + * {
  margin-top: var(--s-md);
}

.sign-in {
  max-width: 380px;
  margin: 10vh auto 0;
}

h1 {
  font-size: 22px;
  letter-spacing: -0.4px;
  margin: 0;
}

h2 {
  font-size: 16px;
  letter-spacing: -0.2px;
  margin: 0;
}

h3 {
  font-size: 14px;
  margin: 0;
}

p {
  margin: 0;
}

.muted {
  color: var(--ink2);
}

.hint {
  color: var(--ink3);
  font-size: 12px;
  max-width: 62ch;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

pre.mono {
  background: var(--surface2);
  padding: var(--s-md);
  border-radius: var(--r-inner);
  overflow-x: auto;
}

.empty {
  color: var(--ink2);
  padding: var(--s-xl);
  text-align: center;
  background: var(--surface2);
  border-radius: var(--r-inner);
}

.problem {
  color: var(--accent-ink);
  background: var(--accent-wash);
  padding: var(--s-md);
  border-radius: var(--r-inner);
}

/* A refusal is the system working. It should not shout like a crash. */
.problem.quiet {
  color: var(--ink2);
  background: var(--surface2);
}

/* ---------------------------------------------------------------- fields */

.field {
  display: block;
}

.field + .field,
.field + .actions {
  margin-top: var(--s-md);
}

.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: var(--s-xs);
}

input,
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--r-inner);
  padding: 10px var(--s-md);
  /* docs/11: hit targets ≥ 44pt. A staff tool is not exempt. */
  min-height: 44px;
}

textarea {
  font-family: var(--mono);
  font-size: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- buttons */

button {
  font: inherit;
  font-weight: 600;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  padding: 0 var(--s-lg);
  min-height: 44px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

.primary {
  background: var(--accent);
  color: var(--on-accent);
}

.secondary {
  background: var(--surface2);
  color: var(--ink);
  border-color: var(--line);
}

.danger {
  background: transparent;
  color: var(--accent-ink);
  border-color: currentColor;
}

.link {
  background: none;
  color: var(--accent-ink);
  padding: 0 var(--s-sm);
  min-height: 32px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.actions {
  display: flex;
  gap: var(--s-sm);
  align-items: center;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- tables */

.scroll {
  overflow-x: auto;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px rgb(var(--shadow) / 0.06), 0 6px 18px rgb(var(--shadow) / 0.07);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--ink3);
  font-weight: 400;
  padding: var(--s-md) var(--s-lg);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: var(--s-md) var(--s-lg);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tr.off td {
  opacity: 0.55;
}

tr.editing td {
  background: var(--surface2);
  padding: var(--s-md);
}

tr.editing .card {
  box-shadow: none;
}

/* ---------------------------------------------------------------- bits */

.pill {
  display: inline-block;
  padding: 3px 10px;
  margin-left: var(--s-xs);
  border-radius: var(--r-pill);
  background: var(--surface2);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
  white-space: nowrap;
}

tbody .pill:first-child,
.field + .pill {
  margin-left: 0;
}

/* Orange means "this wants you" — a suspension, a live role. It is never decoration. */
.pill.hot {
  background: var(--accent-wash);
  border-color: transparent;
  color: var(--accent-ink);
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-sm) var(--s-lg);
  margin: 0;
}

.facts.wide {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--s-lg);
}

.facts.wide dt {
  grid-row: 1;
}

.facts.wide dd {
  grid-row: 2;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--ink3);
}

dd {
  margin: 0;
}

.found {
  margin-top: var(--s-lg);
  padding-top: var(--s-lg);
  border-top: 1px solid var(--line);
}

.found > * + * {
  margin-top: var(--s-md);
}
