/* CueRoster — styles. Default palette from the LLTC parent deck; theatres override --navy/--lime. */
:root {
  --navy: #0b3550;
  --navy-2: #134a6b;
  --olive: #344a24;
  --sage: #6bb38a;
  --mint: #b2d8d2;
  --lime: #cde873;
  --beacon: #e2573b;          /* lighthouse red, for alerts */
  --bg: #f4f8f6;
  --surface: #ffffff;
  --surface-2: #eaf3f0;
  --text: #13232e;
  --muted: #5b6b74;
  --border: #d6e3df;
  --focus: #2f80c4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11,53,80,.06), 0 4px 14px rgba(11,53,80,.06);
  --nav-h: 64px;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.45; }
a { color: var(--navy-2); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* ---------- Layout ---------- */
.shell { min-height: 100vh; display: flex; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding: 16px 16px calc(var(--nav-h) + 24px); }
.page { max-width: 980px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; flex-wrap: wrap; }
.topbar h1 { font-size: 1.6rem; font-weight: 800; margin: 0; letter-spacing: -.01em; flex: 1; min-width: 0; }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--navy); display: flex; z-index: 20;
}
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #b9cfdc; text-decoration: none; font-size: .72rem; font-weight: 600; }
.bottomnav a svg { width: 22px; height: 22px; }
.bottomnav a.active { color: var(--lime); }

@media (min-width: 900px) {
  .bottomnav { display: none; }
  .sidebar { display: flex; flex-direction: column; width: 232px; flex-shrink: 0; background: var(--navy); color: #fff;
    position: sticky; top: 0; height: 100vh; padding: 20px 14px; }
  .sidebar .brand { margin: 4px 8px 26px; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c9dbe6;
    text-decoration: none; font-weight: 600; margin-bottom: 2px; }
  .sidebar nav a:hover { background: rgba(255,255,255,.06); }
  .sidebar nav a.active { background: rgba(205,232,115,.14); color: var(--lime); }
  .sidebar nav a svg { width: 20px; height: 20px; }
  .sidebar .me { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; color: #c9dbe6; }
  .main { padding: 28px 32px 40px; }
}

.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--lime); display: grid; place-items: center; color: var(--navy); }
.brand .mark svg { width: 20px; height: 20px; }
.brand b { font-weight: 800; letter-spacing: .02em; display: block; line-height: 1.1; }
.brand small { color: #9fbccd; font-size: .72rem; display: block; }

/* ---------- Cards & lists ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card, .stack > * + * { margin-top: 14px; }
.grid > .card + .card, .grid > * + * { margin-top: 0; }
.card h2 { font-size: 1.05rem; margin: 0 0 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card h2 .spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .who { flex: 1 1 150px; min-width: 0; }
.list .who a { color: inherit; text-decoration: none; font-weight: 700; }
.list .who .sub { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Person card (directory) */
.people-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .people-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .people-grid { grid-template-columns: repeat(3, 1fr); } }
.pcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--shadow); }
.pcard .info { flex: 1; min-width: 0; }
.pcard .name { font-weight: 700; color: inherit; text-decoration: none; display: block; }
.pcard .sub { color: var(--muted); font-size: .85rem; margin: 2px 0 8px; }
.contact-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--mint); color: var(--navy); display: grid; place-items: center;
  font-weight: 800; flex-shrink: 0; overflow: hidden; font-size: 1rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 88px; height: 88px; font-size: 1.6rem; }
.avatar.sm { width: 34px; height: 34px; font-size: .8rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; border: 1px solid transparent;
  padding: 9px 16px; font-weight: 700; font-size: .92rem; cursor: pointer; text-decoration: none; background: var(--navy); color: #fff;
  min-height: 40px; transition: filter .15s, background .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn.secondary { background: var(--surface); color: var(--navy); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); filter: none; }
.btn.lime { background: var(--lime); color: var(--navy); }
.btn.danger { background: var(--beacon); }
.btn.ghost { background: transparent; color: var(--navy-2); padding: 6px 10px; min-height: 32px; }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.sm { padding: 6px 12px; min-height: 32px; font-size: .84rem; }
.btn.block { width: 100%; }
.chipbtn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; background: var(--surface-2);
  color: var(--navy); font-weight: 700; font-size: .8rem; text-decoration: none; border: 1px solid var(--border); min-height: 32px; }
.chipbtn svg { width: 15px; height: 15px; }
.chipbtn:hover { background: var(--mint); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: var(--surface-2); color: var(--navy); border: 1px solid var(--border); white-space: nowrap; }
.badge.admin, .badge.director { background: var(--navy); color: #fff; border-color: var(--navy); }
.badge.crew { background: var(--sage); color: #fff; border-color: var(--sage); }
.badge.cast { background: var(--lime); color: var(--olive); border-color: #b9d55f; }
.badge.parent { background: var(--mint); color: var(--navy); }
.badge.warn { background: #fde9e4; color: #a33a22; border-color: #f6c7bb; }
.badge.ok { background: #e3f4ea; color: #1f6b43; border-color: #bfe3cd; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-weight: 600; font-size: .85rem; }
.field .hint { color: var(--muted); font-size: .78rem; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fff; min-height: 42px; }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .form-grid.three { grid-template-columns: repeat(3, 1fr); } }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--navy); }
.error { background: #fde9e4; color: #8a2d18; border: 1px solid #f6c7bb; border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.notice { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.success { background: #e3f4ea; color: #1f6b43; border: 1px solid #bfe3cd; border-radius: 10px; padding: 10px 12px; font-size: .9rem; }

/* Key/value display */
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.measure-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .measure-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .measure-grid { grid-template-columns: repeat(4, 1fr); } }
.measure { background: var(--surface-2); border-radius: 10px; padding: 9px 11px; }
.measure .l { font-size: .74rem; color: var(--muted); font-weight: 600; }
.measure .v { font-weight: 800; font-size: 1.05rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td .badge { margin-top: 2px; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr.dim td { opacity: .5; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }

/* ---------- Tabs / filters ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.tabs button { border: 1px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; cursor: pointer; white-space: nowrap; color: var(--navy); }
.tabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.searchbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.searchbar .input { flex: 1; min-width: 180px; }

/* ---------- Hero / auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 10% -10%, rgba(205,232,115,.25), transparent 60%), var(--navy); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 20px; padding: 28px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-card .brand { color: var(--navy); margin-bottom: 18px; }
.auth-card .brand small { color: var(--muted); }
.auth-card h1 { font-size: 1.4rem; margin: 0 0 4px; }
.auth-card .foot { margin-top: 18px; font-size: .88rem; color: var(--muted); text-align: center; }
.linkbtn { background: none; border: 0; color: var(--navy-2); font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }

.hero { background: var(--navy); color: #fff; border-radius: 18px; padding: 22px; position: relative; overflow: hidden; margin-bottom: 16px; }
.hero h1 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 800; }
.hero p { margin: 0; color: #c9dbe6; }
.hero .pill { position: absolute; border-radius: 999px; opacity: .9; }
.show-card { display: block; text-decoration: none; color: inherit; border-left: 6px solid var(--navy); }
.show-card .t { font-weight: 800; font-size: 1.1rem; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(9,30,45,.5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { margin: 0 0 14px; font-size: 1.2rem; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px); background: var(--olive); color: #fff; padding: 10px 16px;
  border-radius: 999px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

.code-pill { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--lime); color: var(--navy); padding: 3px 9px; border-radius: 8px; font-weight: 800; letter-spacing: .06em; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 22px 0 10px; }
.brand .mark { overflow: hidden; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* ---------- Outside a theatre (picker / platform) ---------- */
.bare { min-height: 100vh; }
.bare-top { background: var(--navy); padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.bare .main { max-width: 1040px; margin: 0 auto; }
.mobile-switch { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--muted);
  text-decoration: none; margin-bottom: 8px; }
.mobile-switch svg { width: 14px; height: 14px; }
@media (min-width: 900px) { .mobile-switch { display: none; } }
.theatre-tile { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.theatre-tile .logo { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.1rem; flex-shrink: 0; overflow: hidden; }
.theatre-tile .logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* ---------- Branding controls ---------- */
.brand .mark.platform { background: #fff; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.logo-preview { width: 84px; height: 84px; border-radius: 16px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--navy); }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-preview svg { width: 40px; height: 40px; }
.palette-row { display: flex; flex-wrap: wrap; gap: 8px; }
.palette-chip { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer; }
.palette-chip span { width: 18px; height: 18px; border-radius: 50%; display: inline-block; border: 2px solid #fff; }
.palette-chip span + span { margin-left: -6px; }
.palette-chip small { margin-left: 6px; font-weight: 700; color: var(--text); }
.palette-chip:hover { border-color: var(--navy-2); }
.brand-preview { display: flex; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); min-height: 170px; font-size: .8rem; background: #f4f8f6; }
.bp-side { width: 42%; max-width: 190px; background: var(--p); color: #fff; padding: 12px 10px; }
.bp-brand { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.bp-brand b { display: block; font-size: .85rem; }
.bp-brand small { display: block; opacity: .7; font-size: .68rem; }
.bp-mark { width: 26px; height: 26px; border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--p); flex-shrink: 0; }
.bp-mark img { width: 100%; height: 100%; object-fit: contain; }
.bp-mark svg { width: 16px; height: 16px; }
.bp-nav { padding: 5px 8px; border-radius: 7px; opacity: .8; font-weight: 600; }
.bp-nav.active { color: var(--a); background: rgba(255,255,255,.1); opacity: 1; }
.bp-main { flex: 1; padding: 12px; }
.bp-hero { background: var(--p); color: #fff; border-radius: 10px; padding: 10px; }
.bp-hero b { display: block; font-size: .95rem; }
.bp-hero small { opacity: .8; }
.bp-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.bp-btn { background: var(--p); color: #fff; border-radius: 999px; padding: 4px 12px; font-weight: 700; }
.bp-chip { background: var(--a); color: var(--p); border-radius: 999px; padding: 4px 12px; font-weight: 700; }
.mark-initials { font-weight: 800; font-size: .72rem; letter-spacing: .02em; }
