:root {
  --bg: #0f1214;
  --bg-elev: #171b1f;
  --fg: #e8ecef;
  --muted: #8a939a;
  --accent: #4fd1c5;
  --accent-2: #a78bfa;
  --amber: #f6b73c;
  --red: #ef6464;
  --border: #262c33;
  --radius: 12px;
  --pad: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: "Outfit", system-ui, -apple-system, Segoe UI, sans-serif; }

#app { display: flex; flex-direction: column; min-height: 100vh; }

#top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.brand { font-weight: 600; font-size: 18px; letter-spacing: 0.3px; }

#screen { flex: 1; padding: 16px; padding-bottom: 100px; }

#tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--bg-elev); border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}
.tab {
  background: transparent; color: var(--muted); border: 0;
  padding: 10px 4px; font-family: inherit; font-size: 13px; font-weight: 500;
  border-radius: 8px;
}
.tab.active { color: var(--accent); background: rgba(79, 209, 197, 0.08); }

h2 { margin: 4px 0 16px; font-size: 22px; font-weight: 600; }
h3.section-head { margin: 24px 0 12px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.muted { color: var(--muted); }

.empty-state { padding: 40px 0; text-align: center; }

.card-list, .entry-list, .loop-list, .shift-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card, .entry, .loop, .shift {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px;
}
.card-title { font-weight: 600; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.entry-meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.entry-text { line-height: 1.4; }
.entry-tags { margin-top: 8px; }
.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  background: rgba(79, 209, 197, 0.12); color: var(--accent); margin-right: 4px;
}

.shift-name { font-weight: 600; }
.shift-time { color: var(--muted); font-size: 13px; margin-top: 2px; }
.shift-role { font-size: 12px; margin-top: 2px; }

.loop.resolved { opacity: 0.5; }
.loop-text { line-height: 1.4; }
.loop-meta { font-size: 11px; margin-top: 4px; }

.capture-bar { margin-top: 20px; }

.btn {
  display: inline-block; padding: 12px 16px; border-radius: 10px; border: 0;
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #0f1214; }
.btn-full { display: block; width: 100%; }

.banner {
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: 12px; font-size: 14px;
}
.banner-muted { background: rgba(138, 147, 154, 0.08); color: var(--muted); }
.banner-amber { background: rgba(246, 183, 60, 0.1); border-color: rgba(246, 183, 60, 0.4); color: var(--amber); }
.banner-red { background: rgba(239, 100, 100, 0.1); border-color: rgba(239, 100, 100, 0.4); color: var(--red); }

/* Voice overlay */
.voice-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 18, 20, 0.92); backdrop-filter: blur(8px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.voice-overlay.hidden { display: none; }
.voice-inner {
  width: 100%; max-width: 520px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.voice-indicator {
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,209,197,0.25), transparent 70%);
  position: relative;
}
.voice-indicator::after {
  content: ""; position: absolute; inset: 25px;
  border-radius: 50%; background: var(--red);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.6; }
}
.voice-text {
  min-height: 80px; text-align: center; font-size: 18px; line-height: 1.4;
  width: 100%; padding: 0 12px;
}
.voice-actions { display: flex; gap: 12px; width: 100%; }
.voice-actions .btn { flex: 1; }

/* Entry list refinements */
.entry { position: relative; padding-right: 36px; }
.entry-del {
  position: absolute; top: 8px; right: 8px;
  background: transparent; border: 0; color: var(--muted);
  font-size: 20px; line-height: 1; padding: 4px 8px; cursor: pointer;
  border-radius: 6px;
}
.entry-del:hover { background: rgba(239,100,100,0.12); color: var(--red); }
.mention { color: var(--accent-2); text-decoration: none; font-weight: 500; }
.hashtag { color: var(--accent); text-decoration: none; font-weight: 500; }

/* Tag pill colors by category */
.pill-incident { background: rgba(239,100,100,0.14); color: var(--red); }
.pill-staff { background: rgba(167,139,250,0.14); color: var(--accent-2); }
.pill-equipment { background: rgba(246,183,60,0.14); color: var(--amber); }
.pill-guest { background: rgba(79,209,197,0.14); color: var(--accent); }
.pill-cash { background: rgba(103,216,153,0.14); color: #67d899; }
.pill-note { background: rgba(138,147,154,0.14); color: var(--muted); }

.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.capture-bar { margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.capture-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; font-size: 16px; }
.capture-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); display: inline-block; }
.capture-text { padding: 8px; font-size: 13px; }

.top-actions #auth-btn { background: transparent; border: 1px solid var(--border); color: var(--muted); font-weight: 500; }

#live-banner { padding: 0 16px; }
.today-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.today-count { font-size: 12px; margin-bottom: 12px; }

/* Auditorium list */
.aud-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.aud-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer;
}
.aud-card:active { background: #1f2428; }
.aud-title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.aud-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.aud-sub .warn { color: var(--amber); font-weight: 600; }
.pill-dbox { background: rgba(167,139,250,0.16); color: var(--accent-2); font-size: 10px; padding: 2px 6px; }
.pill-imax { background: rgba(246,183,60,0.16); color: var(--amber); font-size: 10px; padding: 2px 6px; }
.pill-acc { background: rgba(79,209,197,0.16); color: var(--accent); font-size: 10px; padding: 2px 6px; }

/* Auditorium detail screen */
.aud-header {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 12px; margin-bottom: 12px;
}
.aud-h-title { font-weight: 600; font-size: 17px; text-align: center; }
.aud-h-count { font-size: 12px; }

.screen-bar {
  background: linear-gradient(to bottom, #0a0d10, #1a2026);
  color: var(--muted); text-align: center; padding: 10px; border-radius: 50% / 100%;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  margin: 8px 24px 20px;
  font-size: 10px; letter-spacing: 3px; font-weight: 600;
}
.screen-bar span { opacity: 0.7; }

.seat-grid {
  display: flex; flex-direction: column; gap: 4px;
  overflow-x: auto; padding: 4px 0;
}
.seat-aisle { height: 16px; }
.seat-row {
  display: grid; grid-template-columns: 18px 1fr 18px;
  align-items: center; gap: 6px;
}
.seat-row-label {
  font-size: 10px; color: var(--muted); text-align: center; font-weight: 600;
}
.seat-row-seats {
  display: flex; flex-wrap: nowrap; gap: 3px; justify-content: center;
}
.seat {
  width: 28px; height: 28px; min-width: 28px;
  border-radius: 6px 6px 3px 3px;
  background: transparent; color: var(--fg);
  border: 1.5px solid #5a6169;
  font-family: inherit; font-size: 10px; font-weight: 600;
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.08s, background 0.08s, border-color 0.08s;
}
.seat:hover { background: rgba(79,209,197,0.08); border-color: var(--accent); }
.seat:active { transform: scale(0.94); }
.seat-accessible,
.seat-wheelchair {
  border-color: #4fd1c5;
  background: rgba(79,209,197,0.12);
}
.seat-wheelchair .seat-glyph { color: var(--accent); font-size: 14px; font-weight: normal; }
.seat-companion {
  border-color: var(--accent-2);
  background: rgba(167,139,250,0.10);
}
.seat-companion .seat-comp-glyph { color: var(--accent-2); font-size: 11px; font-weight: 700; }
.seat-dbox {
  border-radius: 3px; /* DBOX = flat rectangle, matches booking UI */
  border-color: var(--accent-2);
}
.seat-open-issue {
  background: rgba(246,183,60,0.28);
  border-color: var(--amber);
  color: var(--amber);
}
.seat-repeat-issue {
  background: rgba(239,100,100,0.22);
  border-color: var(--red);
  color: var(--red);
}

.seat-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 11px; margin-top: 16px; padding: 12px;
  border-top: 1px solid var(--border);
}
.legend-item { display: inline-flex; align-items: center; gap: 4px; }
.seat-dot { width: 12px; height: 12px; border-radius: 3px 3px 1px 1px; border: 1.5px solid #5a6169; display: inline-block; }
.seat-dot.accessible { border-color: var(--accent); background: rgba(79,209,197,0.12); }
.seat-dot.dbox { border-color: var(--accent-2); border-radius: 2px; }
.seat-dot.open-issue { background: rgba(246,183,60,0.35); border-color: var(--amber); }

/* Seat drawer */
.seat-drawer {
  margin-top: 24px;
  border-top: 2px solid var(--accent);
  padding-top: 16px;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer-title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.seat-issue-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.seat-issue {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px;
}
.seat-issue-open { border-left: 3px solid var(--amber); }
.seat-issue-resolved { opacity: 0.6; }
.seat-issue-observation { border-left: 3px solid var(--muted); }
.seat-issue-meta { font-size: 11px; margin-bottom: 4px; text-transform: capitalize; }
.seat-issue-text { line-height: 1.4; margin-bottom: 8px; }


/* Seat glyphs inside buttons */
.seat-glyph { font-size: 14px; line-height: 1; font-weight: normal; }
.seat-comp-glyph { font-size: 11px; font-weight: 700; }

/* Seat-type corrector chips */
.seat-type-corrector {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin: 12px 0; padding: 10px; background: var(--bg-elev);
  border-radius: 10px; border: 1px solid var(--border);
  font-size: 12px;
}
.type-chip {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); padding: 5px 10px; border-radius: 999px;
  font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
}
.type-chip.active { background: var(--accent); color: #0f1214; border-color: var(--accent); }

/* Legend dots */
.seat-dot.wheelchair { border-color: var(--accent); background: rgba(79,209,197,0.14); }
.seat-dot.companion { border-color: var(--accent-2); background: rgba(167,139,250,0.10); }

/* Unverified seat indicator */
.seat-unverified {
  border-style: dashed !important;
  position: relative;
}
.seat-unverified::after {
  content: "?";
  position: absolute;
  top: -4px; right: -4px;
  background: var(--amber);
  color: #0f1214;
  width: 14px; height: 14px;
  border-radius: 50%;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.pill-unverified {
  background: rgba(246,183,60,0.18);
  color: var(--amber);
  font-size: 10px; padding: 2px 6px;
}
.type-chip-confirm {
  background: rgba(79,209,197,0.15);
  color: var(--accent);
  border-color: var(--accent);
}

/* Entry-side picker (auditorium detail) */
.entry-picker {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin: 0 0 14px; padding: 10px 12px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px;
  font-size: 12px;
}
.entry-prompt { color: var(--amber); font-weight: 600; font-size: 12px; }
.entry-label { font-size: 12px; }
.entry-chip {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); padding: 5px 10px; border-radius: 999px;
  font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
}
.entry-chip.active { background: var(--accent); color: #0f1214; border-color: var(--accent); }

/* Door indicator on the grid (rear of room = bottom, since A renders at top) */
.seat-grid { position: relative; }
.aud-doors.doors-left::before,
.aud-doors.doors-both::before,
.aud-doors.doors-right::after,
.aud-doors.doors-both::after {
  content: "\25A1"; /* unicode white square — simple door glyph */
  position: absolute; bottom: -8px;
  background: var(--accent); color: #0f1214;
  width: 28px; height: 16px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
  letter-spacing: 1px;
}
.aud-doors.doors-left::before { left: 2px; content: "DOOR"; }
.aud-doors.doors-right::after { right: 2px; content: "DOOR"; }
.aud-doors.doors-both::before { left: 2px; content: "DOOR"; }
.aud-doors.doors-both::after  { right: 2px; content: "DOOR"; }

/* Mini entry badge on aud list cards */
.entry-mini {
  font-size: 10px; color: var(--muted);
  padding: 2px 6px; border-radius: 999px;
  background: rgba(138,147,154,0.14);
  font-weight: 600;
}
.entry-mini-unset { color: var(--amber); background: rgba(246,183,60,0.14); }
