:root {
  --bg: #0f1419;
  --bg-card: #1a2332;
  --bg-elevated: #243044;
  --border: #2d3a4f;
  --text: #e8eef7;
  --muted: #8b9bb4;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #22c55e;
  --pink: #ec4899;
  --green: #22c55e;
  --yellow: #eab308;
  --injury: #ef4444;
  --trash: #a855f7;
  --bathroom: #06b6d4;
  --note: #64748b;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(15,20,25,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1rem;
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: grid; place-items: center; font-weight: 800; font-size: .85rem;
}
.brand h1 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.brand .sub { color: var(--muted); font-size: .75rem; }

.role-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .7rem; border-radius: 999px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  font-size: .8rem; color: var(--muted);
}
.role-pill strong { color: var(--text); }

.nav {
  display: flex; flex-wrap: wrap; gap: .35rem;
  padding: .65rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.nav a, .nav button.linkish {
  appearance: none; border: 1px solid transparent; background: transparent;
  color: var(--muted); padding: .45rem .7rem; border-radius: 8px;
  font-size: .85rem; cursor: pointer; font-family: inherit;
}
.nav a:hover, .nav button.linkish:hover { background: var(--bg-elevated); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.main { max-width: 1100px; margin: 0 auto; padding: 1rem; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.card h2 { margin: 0 0 .75rem; font-size: 1.15rem; }
.card h3 { margin: 1rem 0 .5rem; font-size: .95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card p.help { margin: 0 0 1rem; color: var(--muted); font-size: .9rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 800px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

label.field { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; color: var(--muted); margin-bottom: .75rem; }
label.field > span.req::after { content: " *"; color: var(--danger); }
input[type="text"], input[type="number"], input[type="time"], input[type="tel"],
select, textarea {
  width: 100%; padding: .65rem .75rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: inherit; font-size: 1rem;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.row > * { flex: 1; min-width: 140px; }

.btn {
  appearance: none; border: none; cursor: pointer; font: inherit; font-weight: 600;
  padding: .65rem 1rem; border-radius: 8px; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { border-color: var(--accent); }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: .4rem .7rem; font-size: .85rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }

.check-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .65rem; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--border); margin-bottom: .4rem; cursor: pointer;
}
.check-row input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.check-row.arena-only { border-color: #7c3aed; background: #1e1630; }

.toast {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 100;
  background: var(--ok); color: #052e16; font-weight: 600;
  padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); transition: .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }

/* Login */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(59,130,246,.25), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(139,92,246,.2), transparent 45%),
    var(--bg);
}
.login-card { width: min(440px, 100%); }
.login-card .roles { display: grid; gap: .65rem; margin: 1rem 0; }
.role-choice {
  text-align: left; padding: 1rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  cursor: pointer; font: inherit;
}
.role-choice:hover, .role-choice.selected { border-color: var(--accent); background: #172554; }
.role-choice strong { display: block; margin-bottom: .2rem; }
.role-choice span { color: var(--muted); font-size: .85rem; }

/* Arena stations */
.level-block { margin-bottom: 1.25rem; }
.level-header {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin-bottom: .6rem;
}
.level-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 700; font-size: .95rem;
}
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.swatch.pink { background: var(--pink); }
.swatch.green { background: var(--green); }
.swatch.yellow { background: var(--yellow); }

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: .45rem;
}
.station-btn {
  appearance: none; border: 2px solid var(--border); background: var(--bg);
  color: var(--text); border-radius: 10px; padding: .55rem .25rem;
  font-weight: 700; font-size: .9rem; cursor: pointer; position: relative;
  min-height: 52px; font-family: inherit;
}
.station-btn:hover { border-color: var(--accent); }
.station-btn.pulled {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.15);
}
.station-btn.pulled.floor { background: rgba(236,72,153,.25); border-color: var(--pink); }
.station-btn.pulled.lodge { background: rgba(34,197,94,.25); border-color: var(--green); }
.station-btn.pulled.terrace { background: rgba(234,179,8,.28); border-color: var(--yellow); color: #fef9c3; }
.station-btn .glass-p {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(160deg, rgba(255,255,255,.55), rgba(180,210,255,.22) 40%, rgba(80,120,180,.18));
  color: rgba(15,30,50,.85);
  border-radius: 8px;
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
  backdrop-filter: blur(1px);
  pointer-events: none;
}
.station-btn .glass-p span { opacity: .92; }

.preview-panel {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 120px;
}
.preview-panel h3 { margin-top: 0; }
.pulled-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .55rem; border-radius: 999px; font-weight: 700; font-size: .8rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
}
.chip.floor { border-color: var(--pink); color: #f9a8d4; }
.chip.lodge { border-color: var(--green); color: #86efac; }
.chip.terrace { border-color: var(--yellow); color: #fde047; }
.chip .mini-p {
  width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center;
  font-size: .7rem; font-weight: 800;
  background: linear-gradient(160deg, rgba(255,255,255,.6), rgba(180,210,255,.3));
  color: #1e293b;
}

/* Alerts */
.alert-item {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .75rem; border-radius: 10px; margin-bottom: .5rem;
  border: 1px solid var(--border); background: var(--bg);
}
.alert-item.injury { border-left: 4px solid var(--injury); background: rgba(239,68,68,.12); animation: flash 1.2s ease-in-out infinite; }
.alert-item.trash { border-left: 4px solid var(--trash); background: rgba(168,85,247,.12); }
.alert-item.bathroom { border-left: 4px solid var(--bathroom); background: rgba(6,182,212,.12); }
.alert-item.note, .alert-item.complaint { border-left: 4px solid var(--note); }
@keyframes flash {
  0%, 100% { background: rgba(239,68,68,.12); }
  50% { background: rgba(239,68,68,.35); }
}
.room-flash {
  display: inline-block; padding: .15rem .45rem; border-radius: 6px;
  background: var(--injury); color: #fff; font-weight: 800; animation: flash 1s infinite;
}

.space-tile {
  padding: 1rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); text-align: center;
}
.space-tile.open { border-color: var(--ok); background: rgba(34,197,94,.12); }
.space-tile.closed { border-color: var(--danger); background: rgba(239,68,68,.1); }
.space-tile .status { font-size: 1.4rem; font-weight: 800; margin: .4rem 0; }
.space-tile.open .status { color: var(--ok); }
.space-tile.closed .status { color: var(--danger); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: .5rem .55rem; border-bottom: 1px solid var(--border); text-align: left; }
table.data th { color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; }
table.data input { padding: .4rem .5rem; font-size: .9rem; }

.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
.dash-tile {
  padding: 1rem; border-radius: 12px; background: var(--bg); border: 1px solid var(--border);
}
.dash-tile .n { font-size: 1.6rem; font-weight: 800; }
.dash-tile .l { color: var(--muted); font-size: .8rem; }

.viewer-banner {
  background: #422006; color: #fde68a; padding: .6rem 1rem; text-align: center; font-size: .9rem;
  border-bottom: 1px solid #854d0e;
}

footer.app-footer {
  max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem;
  color: var(--muted); font-size: .8rem; text-align: center;
}

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* —— v2 additions —— */
.main.wide { max-width: 100%; padding: 1rem; }
.hq-banner { background: #0c4a6e; color: #e0f2fe; border-bottom-color: #0369a1; }

.checklist-stack { display: flex; flex-direction: column; gap: .85rem; max-width: 640px; }
.checklist-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.checklist-item h3 {
  margin: 0 0 .65rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.checklist-item .check-line {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
}
.checklist-item .check-line select,
.checklist-item .check-line input[type="text"],
.checklist-item .check-line input[type="number"] {
  flex: 1; min-width: 160px;
}
.checklist-item .stamp {
  font-weight: 700; color: var(--ok); min-width: 3.2rem; font-variant-numeric: tabular-nums;
}
.checklist-item .stamp.empty { color: var(--muted); font-weight: 500; }
.tt-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .45rem; }
.tt-row .tt-label { width: 2.2rem; color: var(--muted); font-size: .85rem; font-weight: 600; }

.arena-map-wrap {
  margin-bottom: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a0e14;
}
.arena-map-wrap img {
  display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain;
}
.doors-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }

/* HQ wide table */
.hq-scroll { overflow-x: auto; overflow-y: auto; max-height: calc(100vh - 220px); border: 1px solid var(--border); border-radius: 10px; }
table.hq {
  width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: .78rem; background: var(--bg-card);
}
table.hq th, table.hq td {
  padding: .35rem .4rem; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  vertical-align: top; white-space: nowrap;
}
table.hq thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--bg-elevated); color: var(--muted);
  font-weight: 600; font-size: .68rem; text-transform: uppercase; letter-spacing: .03em;
}
table.hq thead tr.sub th { top: 28px; font-size: .65rem; background: #1e2a3d; }
table.hq th.sticky-col, table.hq td.sticky-col {
  position: sticky; left: 0; z-index: 2; background: var(--bg-card);
  font-weight: 700; min-width: 4.5rem;
}
table.hq thead th.sticky-col { z-index: 4; background: var(--bg-elevated); }
table.hq td.sticky-col-2, table.hq th.sticky-col-2 {
  position: sticky; left: 4.5rem; z-index: 2; background: var(--bg-card); min-width: 3.5rem;
}
table.hq thead th.sticky-col-2 { z-index: 4; background: var(--bg-elevated); }
table.hq input.tiny, table.hq select.tiny {
  width: 4.5rem; padding: .25rem .3rem; font-size: .75rem;
}
table.hq input.loc { width: 7rem; padding: .25rem .3rem; font-size: .75rem; }
table.hq .time-cell { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ok); }
table.hq .time-cell.muted { color: var(--muted); font-weight: 400; }
table.hq .group-fri { background: rgba(59,130,246,.08); }
table.hq textarea.notes-cell {
  width: 10rem; min-height: 2.4rem; padding: .25rem .35rem; font-size: .75rem; resize: vertical;
}

@keyframes pulse-red {
  0%, 100% { background: rgba(239,68,68,.25); box-shadow: inset 0 0 0 1px var(--danger); }
  50% { background: rgba(239,68,68,.65); box-shadow: inset 0 0 0 2px #fecaca; }
}
.flash-red { animation: pulse-red 1s ease-in-out infinite; }

.tab-order-list { list-style: none; padding: 0; margin: 0; }
.tab-order-list li {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); margin-bottom: .4rem;
}
.tab-order-list li input[type="number"] { width: 4rem; }
.tab-order-list .tab-label { flex: 1; font-weight: 600; }

.access-names-input { min-width: 220px; }
.chip-row { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.chip-x {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .5rem; border-radius: 999px; font-size: .75rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
}
.chip-x button {
  appearance: none; border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: .85rem; padding: 0; line-height: 1;
}

.import-zone {
  border: 2px dashed var(--border); border-radius: 12px; padding: 1.25rem;
  background: var(--bg); text-align: center; margin-bottom: .75rem;
}
.import-zone.drag { border-color: var(--accent); background: #172554; }
.import-zone textarea { margin-top: .75rem; text-align: left; min-height: 100px; }
.import-preview { max-height: 160px; overflow: auto; margin-top: .5rem; font-size: .85rem; }

.notes-block textarea { min-height: 90px; font-size: 1rem; }

.period-bar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 1rem; }
.period-bar select { min-width: 280px; }

.btn.checkin { min-width: 6.5rem; }
.btn.checked { background: var(--ok); }

/* —— Security door-schedule sheet —— */
.sheet-toolbar h2 { font-size: 1.15rem; }
.sheet {
  background: #e8e6e1;
  color: #1a1a1a;
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: auto;
}
.sheet-inner { min-width: 980px; }
.sheet-cols {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(640px, 1.6fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 1100px) {
  .sheet-cols { grid-template-columns: 1fr; }
}
.sheet-sched, .sheet-grid {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.72rem;
  line-height: 1.25;
  border: 1px solid #333;
}
.sheet-sched th, .sheet-sched td,
.sheet-grid th, .sheet-grid td {
  border: 1px solid #444;
  padding: 0.28rem 0.35rem;
  vertical-align: middle;
}
.sheet-day-h {
  background: #1e3a5f !important;
  color: #fff !important;
  font-weight: 700;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.sheet-sched th, .sheet-grid th {
  background: #dbe4f0;
  font-weight: 600;
  text-align: center;
}
.sheet-grid th.row-label, .sheet-grid td.row-label,
.sheet-sched td.t {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  background: #f3f4f6;
  max-width: 160px;
}
.sheet-grid td.time-cell-sheet { text-align: center; white-space: nowrap; }
.sheet-grid tr.contact-row td { background: #fff8e7; font-weight: 500; }
.sheet-grid tr.spacer-row td { height: 0.4rem; background: #e5e7eb; border: none; padding: 0; }
.sheet-sched tr.custom-evt td { background: #ecfdf5; }
.evt-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: #059669;
  color: #fff;
  letter-spacing: 0.03em;
}
.sheet-footnote {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: #444;
}
.door-edit input { font-size: 0.8rem; min-width: 5rem; }
.ev-ul { margin: 0; padding-left: 1.2rem; }
.ev-ul li { margin-bottom: 0.4rem; }
.hq-event-row td { background: rgba(5, 150, 105, 0.12); }
.hq-event-row .evt-title { font-weight: 600; font-size: 0.8rem; max-width: 140px; white-space: normal; }
.hq-event-row .evt-meta { font-size: 0.65rem; color: var(--muted); white-space: normal; max-width: 140px; }

/* —— Radios table —— */
.radios-scroll {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
table.radios-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  min-width: 1100px;
}
table.radios-table th,
table.radios-table td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.4rem;
  vertical-align: middle;
}
table.radios-table thead th {
  background: var(--bg-elevated);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 3;
}
table.radios-table thead th.day-h {
  background: #1e3a5f;
  color: #fff;
  letter-spacing: 0.02em;
}
table.radios-table thead th.sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  background: #243044;
}
table.radios-table th.sticky-col,
table.radios-table td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-card);
  min-width: 8.5rem;
  max-width: 10rem;
}
table.radios-table thead th.sticky-col { z-index: 5; background: var(--bg-elevated); }
table.radios-table th.sticky-col-2,
table.radios-table td.sticky-col-2 {
  position: sticky;
  left: 8.5rem;
  z-index: 2;
  background: var(--bg-card);
  min-width: 8.5rem;
  max-width: 11rem;
}
table.radios-table thead th.sticky-col-2 { z-index: 5; background: var(--bg-elevated); }
table.radios-table td.c { text-align: center; }
table.radios-table .col-actions { width: 2.2rem; text-align: center; }
.radio-field {
  width: 100%;
  min-width: 0;
  font-size: 0.78rem;
  padding: 0.3rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
.radio-field.narrow { max-width: 4.5rem; margin: 0 auto; display: block; }
.stamp-cell { text-align: center; min-width: 3.6rem; }
.radio-stamp-btn,
.radio-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  padding: 0.28rem 0.4rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.radio-stamp { cursor: default; border-style: solid; }
.radio-stamp-btn:hover { border-color: var(--accent); color: var(--text); }
.radio-stamp-btn.filled,
.radio-stamp.filled {
  border-style: solid;
  border-color: var(--ok);
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}
.radio-stamp.empty { opacity: 0.55; }
.btn.danger-ish { color: var(--danger); border-color: var(--border); }
.btn.danger-ish:hover { background: rgba(239, 68, 68, 0.15); }


/* Registration */
.reg-list { display: flex; flex-direction: column; gap: 0.5rem; }
.reg-active-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.reg-num {
  font-size: 1.25rem; font-weight: 800;
  min-width: 3rem; color: #93c5fd;
}
.reg-meta { flex: 1; color: var(--muted); font-size: 0.9rem; }
.reg-meta strong { color: var(--text); }

/* People access sheet */
.people-scroll {
  overflow: auto;
  max-height: calc(100vh - 220px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
table.people-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  min-width: 1400px;
}
table.people-table th,
table.people-table td {
  border: 1px solid var(--border);
  padding: 0.3rem 0.35rem;
  vertical-align: middle;
}
table.people-table thead th {
  background: var(--bg-elevated);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 3;
  font-size: 0.68rem;
}
table.people-table th.sticky-col,
table.people-table td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-card);
  min-width: 9rem;
}
table.people-table thead th.sticky-col { z-index: 5; background: var(--bg-elevated); }
table.people-table th.tab-cb,
table.people-table td.tab-cb {
  text-align: center;
  min-width: 2.4rem;
  max-width: 3rem;
  padding: 0.2rem;
}
.people-field {
  width: 100%;
  min-width: 0;
  font-size: 0.78rem;
  padding: 0.3rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}


/* Incidents log */
.incidents-scroll {
  overflow: auto;
  max-height: calc(100vh - 220px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
table.incidents-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  min-width: 1500px;
}
table.incidents-table th,
table.incidents-table td {
  border: 1px solid var(--border);
  padding: 0.3rem 0.35rem;
  vertical-align: middle;
  white-space: nowrap;
}
table.incidents-table thead th {
  background: #1e3a5f;
  color: #fff;
  font-weight: 600;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 3;
}
table.incidents-table tr.from-check td { background: rgba(59, 130, 246, 0.06); }
table.incidents-table td.notes-cell {
  white-space: normal;
  min-width: 10rem;
  max-width: 14rem;
}
.src-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--muted);
}
.inc-field {
  width: 100%;
  min-width: 5rem;
  font-size: 0.72rem;
  padding: 0.25rem 0.3rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
.stamp-mini {
  appearance: none;
  min-width: 3.2rem;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.stamp-mini:hover { border-color: var(--accent); color: var(--text); }


/* Request service + summary */
.svc-cta .btn { display: inline-flex; }
.svc-summary { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; }
.svc-group h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}
.svc-group.svc-accident h3 { color: #fca5a5; }
.svc-group.svc-trash h3 { color: #d8b4fe; }
.svc-group.svc-bathroom h3 { color: #67e8f9; }
.svc-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}
table.svc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  min-width: 960px;
}
table.svc-table th,
table.svc-table td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.45rem;
  vertical-align: middle;
}
table.svc-table thead th {
  background: #1e3a5f;
  color: #fff;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
table.svc-table tr.svc-active td {
  background: rgba(245, 158, 11, 0.14);
  box-shadow: inset 3px 0 0 var(--warn);
}
table.svc-table tr.svc-done td {
  opacity: 0.72;
}
table.svc-table td.loc-cell,
table.svc-table td.desc-cell {
  white-space: normal;
  min-width: 9rem;
  max-width: 16rem;
}
.svc-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.svc-pill.active {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
}
.svc-pill.done {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.stamp-mini.stamped {
  border-style: solid;
  border-color: var(--ok);
  color: var(--text);
  background: rgba(34, 197, 94, 0.12);
}


/* Radios currently-out summary */
.radio-out-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.radio-out-stats .dash-tile {
  min-width: 7.5rem;
}
.radio-out-list {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.radio-out-list .muted { color: var(--muted); font-weight: 400; }


/* Accident notification form + wide summary */
.accident-panel {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(252, 165, 165, 0.35);
  border-radius: 10px;
  background: rgba(252, 165, 165, 0.06);
}
.accident-panel h3 {
  margin: 0 0 0.35rem;
  color: #fca5a5;
  font-size: 0.95rem;
}
.acc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.55rem 0.75rem;
}
.acc-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  margin-right: 1rem;
}
table.svc-accident-table {
  min-width: 1480px;
  font-size: 0.72rem;
}

/* —— Radios search / edit modal —— */
.radios-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.radios-search-wrap {
  flex: 1 1 280px;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.radios-search-wrap input[type="search"] {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
.radios-search-wrap .btn { white-space: nowrap; }
table.radios-table tbody tr.radio-match {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: rgba(56, 189, 248, 0.08);
}
table.radios-table tbody tr.radio-dept-start td.sticky-col {
  border-top: 2px solid var(--accent);
}
.radio-edit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem 1rem 2rem;
  overflow: auto;
}
.radio-edit-overlay.hidden { display: none !important; }
.radio-edit-panel {
  width: min(960px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.25rem;
  margin-top: 1rem;
}
.radio-edit-panel h2 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.radio-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem 0.75rem;
  margin: 0.85rem 0 1rem;
}
.radio-edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.radio-edit-grid .radio-field { font-weight: 500; color: var(--text); }
.radio-edit-days {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
}
.radio-edit-days table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  min-width: 520px;
}
.radio-edit-days th,
.radio-edit-days td {
  border: 1px solid var(--border);
  padding: 0.4rem;
  text-align: center;
}
.radio-edit-days thead th {
  background: #1e3a5f;
  color: #fff;
}
.radio-edit-days thead th.sub {
  background: #243044;
  color: var(--muted);
  font-size: 0.68rem;
}
.radio-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
}
.radio-edit-actions .right { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Per-day radio # under Out/In */
.radio-day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 3.6rem;
}
.radio-num-under {
  font-size: 0.68rem;
  font-weight: 700;
  color: #93c5fd;
  letter-spacing: 0.02em;
}
.radio-num-under.empty { color: var(--muted); font-weight: 500; opacity: 0.55; }
table.radios-table thead th.sub .sub-radio {
  display: block;
  font-weight: 500;
  color: #94a3b8;
  font-size: 0.62rem;
  margin-top: 0.1rem;
}
.radio-swap-tag {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 4px;
  padding: 0.05rem 0.25rem;
}

/* Edit day cards */
.radio-edit-hint { grid-column: 1 / -1; margin: 0; }
.radio-edit-day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 0.65rem;
}
.radio-edit-day-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  background: var(--bg-elevated);
}
.radio-edit-day-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
}
.radio-day-radio-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.radio-edit-day-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.radio-swap-list {
  margin: 0.45rem 0 0;
  padding-left: 1rem;
  font-size: 0.72rem;
  color: var(--text);
}
.radio-swap-list .muted { color: var(--muted); }

/* Bad radios log */
.bad-radios-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.bad-radios-table th,
.bad-radios-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
}
.bad-radios-table thead th {
  background: var(--bg-elevated);
  font-weight: 600;
  white-space: nowrap;
}
.bad-radios-table .bad-notes { color: var(--muted); max-width: 18rem; }
.bad-radios-table .muted { color: var(--muted); font-weight: 400; }


/* Form config (Edit → Done) */
.check-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.check-card-head h2 { margin: 0; }
.flag-edit-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
label.inline-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}
label.inline-check input { width: 1.05rem; height: 1.05rem; }
.na-cell { font-style: italic; letter-spacing: 0.02em; }
.flag-fieldset legend { font-weight: 600; }

/* Services location preview */
.loc-preview {
  margin: -.15rem 0 .55rem;
  font-weight: 600;
  color: var(--accent, #38bdf8);
}
.loc-preview.muted-empty {
  font-weight: 400;
  color: var(--muted, #94a3b8);
}
.field-hint {
  font-style: normal;
  font-weight: 400;
  color: var(--muted, #94a3b8);
  font-size: .85em;
}


/* —— Captain workshop assignments —— */
.day-tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.day-tab {
  appearance: none; border: 1px solid var(--border); background: var(--bg);
  color: var(--text); border-radius: 999px; padding: .35rem .75rem;
  font-size: .85rem; cursor: pointer; font-weight: 600;
}
.day-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cap-ws-assigned { margin-top: .75rem; }
.cap-ws-list { list-style: none; padding: 0; margin: 0; }
.cap-ws-list li {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); margin-bottom: .35rem;
}
.cap-ws-idx {
  width: 1.5rem; height: 1.5rem; border-radius: 999px; display: inline-flex;
  align-items: center; justify-content: center; font-size: .75rem; font-weight: 700;
  background: var(--bg-elevated); border: 1px solid var(--border);
}
.cap-ws-label { flex: 1; font-size: .9rem; }
.assigned-ws-wrap { margin: .75rem 0 1rem; }
.ws-jump-chip {
  appearance: none; border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--text); border-radius: 999px; padding: .3rem .7rem;
  font-size: .8rem; cursor: pointer; font-weight: 600;
}
.ws-jump-chip.active { border-color: var(--accent); color: var(--accent); }
