/* Colors come from the brand theme (/static/theme.css, linked first). */
:root {
  --bg: var(--bp-bg);
  --surface: var(--bp-card);
  --surface2: #eef1ea;
  --line: var(--bp-line-strong);
  --text: var(--bp-ink);
  --text-muted: var(--bp-muted);
  --text-secondary: #3d434b;
  --green-bg: var(--bp-ok-bg); --green-fg: var(--bp-ok);
  --amber-bg: var(--bp-warn-bg); --amber-fg: var(--bp-warn);
  --red-bg: var(--bp-err-bg);  --red-fg: var(--bp-err);
  --blue: var(--bp-navy); --blue-fg: var(--bp-blue);
  --seated: var(--bp-navy);
  --paid: var(--bp-purple); --paid-fg: var(--bp-purple);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--bp-font);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

.btn {
  border: 0; border-radius: 10px; padding: 10px 14px; min-height: 44px;
  background: var(--surface2); color: var(--text); font-weight: 600; font-size: 15px;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.green { background: var(--green-bg); color: var(--green-fg); }
.btn.amber { background: var(--amber-bg); color: var(--amber-fg); }
.btn.red { background: var(--red-bg); color: var(--red-fg); }
.btn.paid { background: var(--paid); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.big { font-size: 18px; min-height: 56px; width: 100%; }
.btn:disabled { opacity: 0.4; cursor: default; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--bp-line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; color: var(--text-muted); min-height: 40px; }
.seg button.on { background: var(--bp-navy); color: #fff; }

.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface2); color: var(--text-secondary); white-space: nowrap; }
.chip.green { background: var(--green-bg); color: var(--green-fg); }
.chip.amber { background: var(--amber-bg); color: var(--amber-fg); }
.chip.red { background: var(--red-bg); color: var(--red-fg); }
.chip.blue { background: var(--bp-blue-bg); color: var(--bp-blue); }
.chip.paid { background: var(--bp-purple-bg); color: var(--bp-purple); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--text-muted); }
.field input, .field select, .field textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; min-height: 44px; font-size: 16px;
}

/* ---------- floor plan ---------- */
svg.floor { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.room rect { fill: #fbfbf8; stroke: #d5d9cf; stroke-width: 2; }
.room-label { fill: #8a909a; font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.fixture rect { fill: #efe7da; stroke: #d6c7ae; stroke-width: 2; }
.fixture text { fill: #8a6d45; font-size: 13px; font-weight: 700; }
.fixture.wall rect { fill: #9aa0ab; stroke: none; }
.link { stroke: var(--blue-fg); stroke-width: 4; stroke-dasharray: 6 6; opacity: 0.7; }
.groups .ring, .groups .ring-track { pointer-events: none; }
.link.paid { stroke: var(--paid-fg); }

.table { cursor: pointer; outline: none; }
.table .top { fill: #ffffff; stroke: #9aa0ab; stroke-width: 2; transition: fill 0.25s; }
.table text { fill: var(--text-secondary); font-weight: 600; pointer-events: none; }
.table text.t-name { fill: var(--bp-navy); font-weight: 800; }
/* Seated 8 minutes with no check opened yet: the number blinks red (Jacob, 2026-10-26). */
.table.nocheck text.t-name { fill: var(--bp-err) !important; animation: nocheck 1s step-start infinite; }
@keyframes nocheck { 50% { opacity: 0.15; } }
.table text.soon { fill: var(--amber-fg); }
.table text.later { fill: var(--text-muted); }
.table text.late { fill: var(--red-fg); }
.ring-track { fill: none; stroke: #dfe3d8; stroke-width: 5; }
.ring { fill: none; stroke-width: 5; stroke-linecap: round; transition: stroke-dasharray 0.6s; }
.ring.pulse { animation: ringpulse 1.1s ease-in-out infinite; }
@keyframes ringpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .ring.pulse { animation: none; } }

.table.seated .top { fill: #dfe2f3; stroke: var(--seated); }
.table.seated text { fill: var(--bp-navy); }
.table.paid .top { fill: var(--bp-purple-bg); stroke: var(--paid-fg); stroke-dasharray: 5 4; }
.table.paid text { fill: var(--bp-purple); }
.table.dim { opacity: 0.35; }
.table.off .top { fill: url(#hatch); stroke: #c46a6a; stroke-dasharray: none; }
.table.off text { fill: #8a6f6f; }
.table.fits .top { stroke: var(--bp-green); stroke-width: 3; stroke-dasharray: 6 4; }
.table.picked .top { stroke: var(--bp-navy); stroke-width: 5; stroke-dasharray: none; fill: var(--bp-green-soft); }
.table.focus .top { stroke: var(--bp-navy); stroke-width: 4; }
.table:focus-visible .top { stroke: var(--bp-navy); stroke-width: 4; }

/* ---------- modal + snackbar ---------- */
.scrim { position: fixed; inset: 0; background: rgba(16, 16, 56, 0.45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.scrim.on { display: flex; }
.modal { background: var(--surface); border-radius: 18px; padding: 20px; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; }
.modal h2 { margin: 0 0 4px; font-size: 22px; color: var(--bp-navy); }
.modal .sub { color: var(--text-muted); margin: 0 0 16px; font-size: 14px; }
.modal .row { display: flex; gap: 10px; flex-wrap: wrap; }
.modal .row > .btn { flex: 1; }
.sizes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 16px; }
.sizes button { border: 0; border-radius: 10px; background: var(--surface2); min-height: 48px; font-size: 18px; font-weight: 700; }
.sizes button.on { background: var(--blue); color: #fff; }
.snack { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: var(--bp-navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; transition: transform 0.25s; z-index: 60; max-width: calc(100vw - 32px); box-shadow: 0 8px 30px rgba(16,16,56,0.3); }
.snack.on { transform: translateX(-50%) translateY(0); }
.snack.err { background: var(--red-bg); color: var(--red-fg); }
.snack-act { margin-left: 14px; border: 0; background: transparent; color: var(--bp-green); font-weight: 800; padding: 4px 6px; }
.table.qr.open .top { stroke-dasharray: 3 4; }
label.check { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 16px; }
label.check input { width: 22px; height: 22px; accent-color: var(--blue); }
label.check.consent { align-items: flex-start; font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
label.check.consent input { flex: 0 0 22px; margin-top: 1px; }
h1, h2 { color: var(--bp-navy); }
