/* House of Bollywood - Door Ops. Dark by default (night venue), light available. */
:root {
  color-scheme: dark;
  --bg: #121211; --s1: #1a1a19; --s2: #232321; --s3: #2c2c29; --line: #36352f;
  --tx: #f0efec; --tx2: #c3c2b7; --mut: #96958a;
  --accent: #f5b83d; --accent-ink: #1a1306;
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --crit: #e0504f;
  /* categorical data slots (validated), always paired with a text label */
  --t-ga: #3987e5; --t-squad: #d95926; --t-student: #199e70; --t-vip: #c98500; --t-table: #d55181; --t-other: #8a8a80;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.35);
  --r: 14px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f3ef; --s1: #fcfcfb; --s2: #f0efec; --s3: #e6e5df; --line: #d9d8d0;
  --tx: #0b0b0b; --tx2: #3f3e3a; --mut: #6d6c64;
  --accent: #b36b00; --accent-ink: #fff;
  --good: #0a7a0a; --warn: #9a6a00; --serious: #b4501f; --crit: #c02f2f;
  --t-ga: #2a78d6; --t-squad: #eb6834; --t-student: #1baf7a; --t-vip: #eda100; --t-table: #e87ba4;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f4f3ef; --s1: #fcfcfb; --s2: #f0efec; --s3: #e6e5df; --line: #d9d8d0;
    --tx: #0b0b0b; --tx2: #3f3e3a; --mut: #6d6c64; --accent: #b36b00; --accent-ink: #fff;
    --good: #0a7a0a; --warn: #9a6a00; --serious: #b4501f; --crit: #c02f2f;
    --t-ga: #2a78d6; --t-squad: #eb6834; --t-student: #1baf7a; --t-vip: #eda100; --t-table: #e87ba4;
    --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.06);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
.num, .tabnum { font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); font-weight: 650; }
a { color: var(--accent); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.demo-banner { background: var(--warn); color: #1a1306; text-align: center; font-weight: 700; font-size: 13px; padding: 6px 12px; letter-spacing: .02em; }
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; line-height: 1.1; margin-right: 6px; }
.brand b { font-size: 15px; letter-spacing: .06em; }
.brand span { font-size: 11px; color: var(--accent); letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.spacer { flex: 1; }
select, .input { background: var(--s2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-height: 40px; }
#event-select { flex: 1 1 260px; max-width: 460px; min-width: 0; text-overflow: ellipsis; }
.input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--s2); border: 1px solid var(--line); font-size: 13px; color: var(--tx2); white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mut); flex: none; }
.pill.live .dot { background: var(--good); box-shadow: 0 0 0 0 rgba(12,163,12,.6); animation: pulse 2s infinite; }
.pill.stale .dot { background: var(--warn); }
.pill.off .dot { background: var(--crit); }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(12,163,12,0); } 100% { box-shadow: 0 0 0 0 rgba(12,163,12,0); } }
.icon-btn { background: var(--s2); border: 1px solid var(--line); border-radius: 10px; min-width: 40px; min-height: 40px; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--s3); }

.nav { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; color: var(--mut); cursor: pointer; font-weight: 650; white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.nav button:hover { color: var(--tx); }
.nav button[aria-current="page"] { color: var(--tx); border-bottom-color: var(--accent); }
.nav .count { font-size: 11px; background: var(--crit); color: #fff; border-radius: 999px; padding: 1px 7px; font-weight: 700; }

main { max-width: 1280px; margin: 0 auto; padding: 18px 16px 90px; }
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (max-width: 1000px) { .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card > h2 { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .sub { color: var(--mut); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- hero + kpis ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.hero-main { padding: 20px; }
.big { font-size: clamp(44px, 9vw, 84px); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.big small { font-size: .38em; color: var(--mut); font-weight: 600; letter-spacing: 0; margin-left: 6px; }
.pct { font-size: 20px; font-weight: 700; color: var(--accent); margin-left: 10px; }
.track { height: 14px; background: var(--s3); border-radius: 999px; overflow: hidden; margin-top: 16px; display: flex; gap: 2px; }
.track > i { display: block; height: 100%; background: var(--accent); }
.track.thin { height: 8px; margin-top: 10px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.kpi .v { font-size: 28px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.kpi .l { color: var(--mut); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; margin-top: 4px; font-weight: 600; }
.kpi .d { color: var(--tx2); font-size: 12px; margin-top: 2px; }

.tier-card { position: relative; padding-top: 14px; }
.tier-head { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.chip { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.tier-nums { margin-top: 8px; font-size: 26px; font-weight: 780; letter-spacing: -.02em; }
.tier-nums small { font-size: 14px; color: var(--mut); font-weight: 600; }
.tier-cred { color: var(--tx2); font-size: 12.5px; margin-top: 10px; line-height: 1.35; }
.lane { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--mut); text-transform: uppercase; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--s3); color: var(--tx); letter-spacing: .02em; white-space: nowrap; }
.badge i { width: 8px; height: 8px; border-radius: 3px; display: block; }
.badge.good { background: color-mix(in srgb, var(--good) 22%, var(--s1)); }
.badge.warn { background: color-mix(in srgb, var(--warn) 24%, var(--s1)); }
.badge.crit { background: color-mix(in srgb, var(--crit) 26%, var(--s1)); }

/* ---------- alerts ---------- */
.alerts { display: grid; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--s1); border-left-width: 5px; }
.alert b { display: block; }
.alert.warn { border-left-color: var(--warn); } .alert.crit { border-left-color: var(--crit); } .alert.info { border-left-color: var(--t-ga); }
.alert .ic { font-weight: 800; width: 20px; text-align: center; flex: none; }
.alert.warn .ic { color: var(--warn); } .alert.crit .ic { color: var(--crit); } .alert.info .ic { color: var(--t-ga); }
.alert button { margin-left: auto; }
.alert .go { margin-left: auto; align-self: center; }

/* ---------- buttons ---------- */
.btn { background: var(--s3); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; min-height: 40px; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { filter: brightness(1.12); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: transparent; border-color: var(--crit); color: var(--crit); }
.btn.sm { min-height: 34px; padding: 5px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; background: var(--s2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; border: 0; border-radius: 8px; padding: 6px 12px; cursor: pointer; color: var(--tx2); font-weight: 600; min-height: 32px; }
.seg button[aria-pressed="true"] { background: var(--s1); color: var(--tx); box-shadow: 0 0 0 1px var(--line); }

/* ---------- guest search ---------- */
.search-bar { display: grid; gap: 10px; margin-bottom: 14px; }
.search-input { width: 100%; font-size: 20px; padding: 14px 16px; border-radius: 14px; min-height: 56px; }
.guest { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr) auto; gap: 14px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.guest:last-child { border-bottom: 0; }
.guest.in { background: color-mix(in srgb, var(--good) 8%, transparent); }
.guest.void { background: color-mix(in srgb, var(--crit) 10%, transparent); }
.g-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-sub { color: var(--mut); font-size: 12.5px; margin-top: 3px; overflow-wrap: anywhere; }
.g-cred { font-size: 13.5px; font-weight: 650; color: var(--tx); }
.g-cred small { display: block; color: var(--mut); font-weight: 500; margin-top: 2px; }
.g-act { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.in-at { color: var(--good); font-weight: 700; font-size: 13px; }
:root[data-theme="light"] .in-at { color: var(--good); }
@media (max-width: 760px) { .guest { grid-template-columns: 1fr; gap: 10px; } .g-act { justify-content: flex-start; } }

/* ---------- tables ---------- */
.table-card { display: grid; gap: 10px; }
.slots { display: flex; gap: 6px; flex-wrap: wrap; }
.slot { width: 26px; height: 26px; border-radius: 8px; border: 2px dashed var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.slot.scan { background: var(--good); border: 2px solid var(--good); color: #fff; }
.slot.roster { background: transparent; border: 2px solid var(--good); color: var(--good); }
.slot.over { background: var(--crit); border-color: var(--crit); color: #fff; }
.tno { width: 90px; text-align: center; font-weight: 800; }
.guest-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--s3); border-radius: 8px; padding: 3px 4px 3px 10px; font-size: 13px; }
.guest-chip button { background: none; border: 0; color: var(--mut); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; }

/* ---------- tables / lists ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--mut); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 650; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.scroll-x { overflow-x: auto; }
tr.in-row td { background: color-mix(in srgb, var(--good) 14%, transparent); }
tr.void-row td { color: var(--mut); text-decoration: line-through; }
.mini-bar { height: 8px; background: var(--s3); border-radius: 999px; overflow: hidden; min-width: 90px; }
.mini-bar i { display: block; height: 100%; border-radius: 999px; }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--mut); font-size: 11px; font-family: inherit; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .ref { stroke: var(--mut); stroke-dasharray: 5 5; stroke-width: 1.5; fill: none; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: color-mix(in srgb, var(--tx) 6%, transparent); }
.tip { position: absolute; z-index: 5; pointer-events: none; background: var(--s3); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow); min-width: 150px; }
.tip b { display: block; margin-bottom: 4px; }
.tip .tr { display: flex; justify-content: space-between; gap: 14px; color: var(--tx2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--tx2); margin-top: 8px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.empty { color: var(--mut); padding: 28px 12px; text-align: center; }

/* ---------- playbook ---------- */
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.checklist label:last-child { border-bottom: 0; }
.checklist input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); }
.checklist input:checked + span { color: var(--mut); text-decoration: line-through; }
.contact { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact:last-child { border-bottom: 0; }
.cred-row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cred-row:last-child { border-bottom: 0; }
@media (max-width: 600px) { .cred-row { grid-template-columns: 1fr; gap: 4px; } }
.qr { background: #fff; padding: 14px; border-radius: 14px; display: inline-block; }
.qr svg { display: block; width: 220px; height: 220px; }
ul.tight { margin: 6px 0 0; padding-left: 20px; } ul.tight li { margin: 4px 0; }

/* ---------- dialogs, toasts, login ---------- */
dialog { background: var(--s1); color: var(--tx); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: min(480px, calc(100vw - 28px)); box-shadow: 0 20px 60px rgba(0,0,0,.55); }
dialog::backdrop { background: rgba(0,0,0,.6); }
.confirm-name { font-size: 24px; font-weight: 800; margin: 6px 0 2px; }
.confirm-cred { background: var(--s2); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-weight: 700; font-size: 16px; }
.confirm-cred small { display: block; color: var(--mut); font-weight: 500; margin-top: 3px; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 80; display: grid; gap: 8px; width: min(440px, calc(100vw - 28px)); }
.toast { background: var(--s3); border: 1px solid var(--line); border-left: 5px solid var(--good); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); font-weight: 600; animation: rise .18s ease-out; }
.toast.err { border-left-color: var(--crit); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(400px, 100%); padding: 26px; }
.login h1 { font-size: 22px; margin-bottom: 4px; }
.login .input { width: 100%; font-size: 18px; margin: 16px 0 12px; }
.err-text { color: var(--crit); font-weight: 600; min-height: 22px; margin-top: 8px; }
.footer-note { color: var(--mut); font-size: 12px; margin-top: 22px; line-height: 1.6; }

@media (max-width: 760px) {
  .nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--s1); border-top: 1px solid var(--line); padding: 0 6px env(safe-area-inset-bottom); justify-content: space-between; max-width: none; }
  .nav button { flex-direction: column; gap: 2px; font-size: 11px; padding: 8px 6px; border-bottom: 0; border-top: 3px solid transparent; flex: 1; }
  .nav button[aria-current="page"] { border-top-color: var(--accent); }
  .nav .ico { font-size: 18px; }
  .toasts { bottom: 78px; }
}
@media (min-width: 761px) { .nav .ico { display: none; } }

/* ---------- print: the fallback paper manifest from the SOP ---------- */
.print-only { display: none; }
@media print {
  :root, :root[data-theme] { color-scheme: light; --bg: #fff; --s1: #fff; --s2: #fff; --s3: #eee; --line: #bbb; --tx: #000; --tx2: #000; --mut: #333; }
  body { background: #fff; font-size: 11px; }
  .topbar, .nav, .no-print, .toasts, .demo-banner { display: none !important; }
  main { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .print-only { display: block; }
  .tbl th, .tbl td { padding: 4px 6px; border-bottom: 1px solid #999; }
  tr { break-inside: avoid; }
  thead { display: table-header-group; }
  tr.in-row td { background: #ffe58a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .box { display: inline-block; width: 13px; height: 13px; border: 1.5px solid #000; vertical-align: middle; }
}
.box { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--mut); border-radius: 4px; vertical-align: middle; }
.box.on { background: var(--good); border-color: var(--good); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .topbar-in { padding: 8px 12px; gap: 8px; }
  #event-select { order: 9; flex: 1 1 100%; max-width: none; }
  .pill { font-size: 12px; padding: 5px 10px; }
  main { padding: 12px 12px 96px; }
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); } /* a filter would trap the fixed bottom nav inside the header */
  .alert { display: grid; grid-template-columns: 22px 1fr; gap: 4px 8px; }
  .alert .go { grid-column: 2; justify-self: start; margin: 4px 0 0; }
  .search-input { font-size: 17px; padding: 12px 14px; min-height: 52px; }
  .tbl th, .tbl td { padding: 8px 6px; }
  .hero-main { padding: 16px; }
  .hero-main h2 { flex-direction: column; align-items: flex-start; }
}
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a.btn { text-decoration: none; }
.checklist input { flex: none; }

.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.two-v { font-size: 26px; font-weight: 780; letter-spacing: -.02em; line-height: 1.1; }
.two-v small { font-size: 14px; color: var(--mut); font-weight: 600; letter-spacing: 0; }
.two-l { color: var(--mut); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; margin-top: 3px; }
.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- practice banner, sell-a-ticket button + full-screen QR ---------- */
.practice-banner {  background: repeating-linear-gradient(135deg, #7a3ff2 0 14px, #6a30dc 14px 28px); color: #fff; text-align: center; font-weight: 700; font-size: 13.5px; padding: 8px 14px; display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.practice-banner button { background: #fff; color: #4b1fb0; border: 0; border-radius: 8px; padding: 4px 12px; font-weight: 700; cursor: pointer; }
.fab { position: fixed; right: 16px; bottom: 18px; z-index: 35; display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 14px 20px; font-weight: 800; font-size: 15px; box-shadow: 0 8px 28px rgba(0,0,0,.45); cursor: pointer; }
.fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
@media (max-width: 760px) { .fab { bottom: calc(76px + env(safe-area-inset-bottom)); } }
dialog.qr-full { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; background: #fff; color: #111; padding: 18px; }
dialog.qr-full[open] { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center; gap: 10px; }
dialog.qr-full h2 { color: #111; font-size: 22px; letter-spacing: 0; text-transform: none; text-align: center; margin: 0; }
dialog.qr-full .qr-big { width: min(82vw, 58dvh, 520px); }
dialog.qr-full .qr-big svg { display: block; width: 100%; height: auto; }
dialog.qr-full .qr-link { font-weight: 700; font-size: 17px; word-break: break-all; text-align: center; color: #111; }
dialog.qr-full .btn { min-height: 52px; min-width: 180px; font-size: 17px; background: #111; color: #fff; border-color: #111; }
.settings-note { color: var(--mut); font-size: 12.5px; }
