/* SeatMap admin — layout and components. Tokens match the builder's
   (vendor/srm-admin-tokens.css) so both feel like one product. */
:root {
  --bg: #f5f5f7; --surface: #fff; --surface-2: #f5f5f7; --line: #e5e5ea; --line-2: #d2d2d7;
  --text: #1d1d1f; --text-2: #6e6e73; --text-3: #aeaeb2;
  --accent: #0071e3; --accent-hover: #0077ed; --accent-soft: #e8f0fe;
  --success: #30d158; --warning: #ff9f0a; --danger: #ff3b30;
  --radius: 12px; --radius-lg: 16px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --sidebar: 236px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --surface: #1c1c1e; --surface-2: #2c2c2e; --line: #38383a; --line-2: #48484a;
    --text: #f5f5f7; --text-2: #98989d; --text-3: #636366; --accent-soft: #0a2a4d;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: 0 0 auto; background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; color: var(--text); padding: 4px 10px 18px; }
.brand svg { color: var(--accent); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav .sep { height: 1px; background: var(--line); margin: 10px 4px; }
.sidebar .grow { flex: 1; }
.userbox { border-top: 1px solid var(--line); padding: 14px 10px 0; font-size: 13px; }
.userbox strong { display: block; } .userbox span { color: var(--text-2); }
.userbox form { margin-top: 8px; }
.main { flex: 1; min-width: 0; padding: 28px 36px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar p { margin: 4px 0 0; color: var(--text-2); }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; }

/* Cards & grid */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; }
.card + .card { margin-top: 18px; }
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.grid { display: grid; gap: 16px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 18px; }
.grid--2 { grid-template-columns: 1fr 1fr; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.stat__label { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.stat__value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.stat__value small { font-size: 13px; color: var(--text-3); font-weight: 500; margin-left: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn svg { width: 15px; height: 15px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: #fff1f0; border-color: var(--danger); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); }
.btn--sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, textarea.input { width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.18); }
.input--color { width: 44px; height: 38px; padding: 3px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; } .row > * { flex: 1; min-width: 160px; }
.switch { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.switch:last-child { border-bottom: 0; }
.switch input { width: 40px; height: 22px; appearance: none; background: var(--line-2); border-radius: 999px; position: relative; cursor: pointer; flex: 0 0 auto; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--success); } .switch input:checked::after { left: 20px; }
.switch b { font-weight: 600; display: block; } .switch span { color: var(--text-2); font-size: 12.5px; }
.error { color: var(--danger); font-size: 12.5px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--text-2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }
.table .muted { color: var(--text-2); font-size: 12.5px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty svg { width: 40px; height: 40px; color: var(--text-3); margin-bottom: 8px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--pending { background: #fff4e0; color: #b25e00; }
.badge--confirmed { background: #e3f8ea; color: #147a3a; }
.badge--cancelled { background: #fde8e6; color: #b3261e; }
.badge--no_show { background: var(--surface-2); color: var(--text-2); }
.badge--draft { background: var(--surface-2); color: var(--text-2); }
.badge--live { background: #e3f8ea; color: #147a3a; }
@media (prefers-color-scheme: dark) {
  .badge--pending { background: #3a2a0a; color: #ffb75a; } .badge--confirmed { background: #0f3320; color: #5ee08a; } .badge--cancelled { background: #3d1210; color: #ff7b72; }
}

/* Tabs & filters */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 12px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--accent); border-color: var(--accent); }
.tabs a small { color: var(--text-3); margin-left: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .input, .filters .select { width: auto; min-width: 140px; }
.toast { position: fixed; top: 18px; right: 18px; background: #1d1d1f; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; z-index: 100; animation: toast 4s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal__dow { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; padding: 4px 8px; }
.cal__day { min-height: 96px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--surface); font-size: 12.5px; }
.cal__day--pad { background: transparent; border-style: dashed; opacity: .5; }
.cal__day--today { border-color: var(--accent); }
.cal__num { font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.cal__item { display: block; padding: 2px 6px; border-radius: 6px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--accent-soft); color: var(--accent); }
.cal__item--no_show { background: var(--surface-2); color: var(--text-2); }
.cal__item--pending { background: #fff4e0; color: #b25e00; } .cal__item--cancelled { background: #fde8e6; color: #b3261e; text-decoration: line-through; }

/* Bars */
.card--chart { display: flex; flex-direction: column; }
.bars { display: flex; align-items: flex-end; gap: 6px; flex: 1; min-height: 160px; max-height: 260px; margin: 26px 0 22px !important; }
.bars div { flex: 1; background: var(--accent-soft); border-radius: 6px 6px 2px 2px; position: relative; min-height: 3px; transition: background .15s; }
.bars div:hover { background: color-mix(in srgb, var(--accent) 35%, var(--accent-soft)); }
.bars div b { position: absolute; bottom: 100%; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--text-2); }
.bars div i { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--text-3); font-style: normal; margin-top: 4px; }
.bars div.hot { background: var(--accent); }

/* Auth / install */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth__box { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.auth__box .brand { padding: 0 0 14px; }
.auth__box h1 { font-size: 22px; margin-bottom: 4px; } .auth__box p.lead { color: var(--text-2); margin: 0 0 22px; }
.steps { display: flex; gap: 8px; margin-bottom: 22px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); } .steps span.on { background: var(--accent); }
.check { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.check .ok { color: var(--success); font-weight: 600; } .check .bad { color: var(--danger); font-weight: 600; }

/* Embed snippet */
.snippet { background: #1d1d1f; color: #e6e6e6; padding: 14px 16px; border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; overflow-x: auto; white-space: pre; position: relative; }
.snippet .copy { position: absolute; top: 8px; right: 8px; }

/* Builder host */
.builder-host { margin: -28px -36px -60px; height: calc(100vh - 0px); }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .main { padding: 18px 16px 50px; }
  .menu-btn { display: inline-flex; }
  .grid--2 { grid-template-columns: 1fr; }
  .builder-host { margin: -18px -16px -50px; }
  .cal__day { min-height: 60px; }
}

/* ── Audit fixes ───────────────────────────────────────────────────────── */
.main { min-width: 0; }
.grid--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.btn.menu-btn { display: none; }
@media (max-width: 900px) { .btn.menu-btn { display: inline-flex; } }
.snippet { white-space: pre-wrap; word-break: break-all; }
.cal { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal__day { min-width: 0; }
.cal__legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 12px; }
.cal__legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--accent-soft); border: 1px solid var(--accent); }
.cal__legend .p::before { background: #fff4e0; border-color: #b25e00; } .cal__legend .c::before { background: #fde8e6; border-color: #b3261e; }
.bars div { background: color-mix(in srgb, var(--accent) 32%, transparent); }
.builder-host { margin: 0 -36px -60px; }
@media (max-width: 900px) { .builder-host { margin: 0 -16px -50px; } }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.pager__links { display: flex; gap: 4px; }
.pager__btn { min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); font-weight: 500; }
.pager__btn:hover { background: var(--surface-2); }
.pager__btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager__btn.is-disabled { opacity: .4; }
.pager__dots { padding: 0 4px; align-self: center; }
.table .thumb { width: 64px; height: 40px; border-radius: 6px; overflow: hidden; background: var(--surface-2); position: relative; }
.table .thumb .mp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.table .thumb .mp svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.iconbtn { width: 32px; height: 32px; padding: 0; justify-content: center; }
.iconbtn svg { width: 15px; height: 15px; }
.table td.actions-cell { white-space: nowrap; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chips a { font-size: 12px; background: var(--accent-soft); color: var(--accent); padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: none; align-items: center; justify-content: center; z-index: 90; padding: 20px; }
.modal.open { display: flex; }
.modal__box { background: var(--surface); border-radius: 16px; padding: 24px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.sidebar .nav .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--warning); color: #fff; padding: 1px 7px; border-radius: 999px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 18px; position: relative; border-left: 2px solid var(--line); font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline .muted { color: var(--text-2); display: block; }
form button[data-busy] { opacity: .6; pointer-events: none; }
.mp { position: absolute; inset: 0; }
.mp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.mp__grid { position: absolute; inset: 0; background: #eef1f6; }
.mp svg { position: absolute; inset: 0; width: 100%; height: 100%; }
