:root {
  --ink: #0C1220;
  --navy-900: #14203C;
  --navy-800: #1E2D59;
  --navy-700: #2A3D74;
  --navy-100: #E8ECF6;
  --terra: #F26522;
  --terra-deep: #C2410C;
  --terra-soft: #FDE7D6;
  --sand: #F4EFE7;
  --sand-light: #FAF7F2;
  --sky: #9FB8D8;
  --white: #FFFFFF;
  --text: #232A38;
  --text-soft: #5A6272;
  --line: rgba(20, 32, 60, 0.14);
  --line-soft: rgba(20, 32, 60, 0.08);
  --line-dark: rgba(159, 184, 216, 0.25);
  --ok: #3B6D11; --ok-bg: #EAF3DE;
  --warn: #854F0B; --warn-bg: #FAEEDA;
  --bad: #A32D2D; --bad-bg: #FCEBEB;
  --info: #185FA5; --info-bg: #E1ECFA;
  --font-display: "Bricolage Grotesque", "Arial Black", sans-serif;
  --font-body: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
  --radius: 14px;
  --shadow: 0 18px 50px -18px rgba(12, 18, 32, 0.35);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); color: var(--text); background: var(--sand-light);
  line-height: 1.5; font-size: 15px; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 700; line-height: 1.02; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--terra-deep); }
button { font: inherit; }
.mono { font-family: var(--font-mono); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 500;
}
.eyebrow.dash::before { content: "— "; }
.on-dark .eyebrow, .eyebrow.sky { color: var(--sky); }
.muted { color: var(--text-soft); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  font-weight: 600; font-size: 14px; line-height: 1.2; text-decoration: none; color: var(--navy-800);
  background: var(--white); transition: background .15s var(--ease), transform .15s var(--ease), border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-deep); }
.btn-navy { background: var(--navy-800); color: #fff; }
.btn-navy:hover { background: var(--navy-700); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--navy-100); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-danger:hover { background: #F7C1C1; }
.btn-ok { background: var(--ok-bg); color: var(--ok); }
.btn-lg { padding: 15px 24px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-soft); font-weight: 500; }
.field input, .field select, .field textarea, .input {
  font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); width: 100%; min-width: 0;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: 2px solid var(--terra); outline-offset: 1px; border-color: transparent; }
.field .hint { font-size: 12.5px; color: var(--text-soft); }
.field input.mono, .input.mono { font-family: var(--font-mono); letter-spacing: 0.06em; }
.error-text { color: var(--bad); font-size: 13.5px; font-weight: 500; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.card-head h2, .card-head h3 { font-size: 17px; }

/* stage badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.accepted { background: var(--navy-100); color: var(--navy-800); }
.badge.submitted { background: var(--info-bg); color: var(--info); }
.badge.processing { background: var(--warn-bg); color: var(--warn); }
.badge.docs_needed { background: var(--terra-soft); color: #9A3412; }
.badge.issued { background: var(--ok-bg); color: var(--ok); }
.badge.rejected { background: var(--bad-bg); color: var(--bad); }
.badge.expired { background: #EEE; color: var(--text-soft); }
.badge.waiting { background: var(--navy-100); color: var(--navy-800); }
.badge.serving { background: var(--terra-soft); color: var(--terra-deep); }
.badge.done { background: var(--ok-bg); color: var(--ok); }
.badge.noshow { background: #EEE; color: var(--text-soft); }
.badge.vip { background: #EEEDFE; color: #3C3489; }
.badge.gen { background: var(--navy-100); color: var(--navy-800); }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 10px 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-soft); font-weight: 500; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: var(--sand-light); }
.table td.r, .table th.r { text-align: right; }
.empty { padding: 36px 20px; text-align: center; color: var(--text-soft); }
.empty strong { display: block; color: var(--text); font-family: var(--font-display); font-size: 18px; margin-bottom: 4px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 100;
  transition: all .25s var(--ease); pointer-events: none; max-width: min(90vw, 480px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }

/* misc */
.stamp {
  display: inline-block; padding: 6px 12px; border: 2px solid var(--terra); border-radius: 6px; color: var(--terra);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 500;
  transform: rotate(-4deg); box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px var(--terra);
}
.stamp.ok { border-color: var(--ok); color: var(--ok); box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px var(--ok); }
.stamp.bad { border-color: var(--bad); color: var(--bad); box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px var(--bad); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 30px; width: auto; display: block; }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
