.event-code { font: 600 0.82em/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); letter-spacing: 0.02em; text-decoration: none; white-space: nowrap; }
a.event-code:hover { text-decoration: underline; }
h1 .event-code { font-size: 0.5em; vertical-align: middle; margin-left: 0.45em; }

:root {
  --ink: #101318;
  --muted: #6f7582;
  --soft: #eef0f3;
  --line: #dfe3e8;
  --panel: #fff;
  --bg: #f7f8fa;
  --black: #03070b;
  --red: #ef4338;
  --green: #0f8f46;
  --blue: #1268c7;
  --amber: #d99100;
  --danger: #c72525;
  --shadow: 0 8px 22px rgba(20, 25, 32, .08), 0 1px 2px rgba(20, 25, 32, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
pb-app-shell,
pb-dashboard,
pb-event-calendar,
pb-pipeline-board,
pb-events-list,
pb-template-picker,
pb-event-workspace,
pb-lineup-editor,
pb-run-sheet,
pb-open-items,
pb-asset-manager,
pb-settlement-form,
pb-public-event-page,
pb-invite-acceptance,
pb-login-page,
pb-toast-stack,
pb-loading-state {
  display: block;
}
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .button {
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  font-weight: 750;
  cursor: pointer;
}
button.secondary, .button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
button.danger { background: var(--red); }
button.danger, .button.danger { background: var(--red); color: #fff; border-color: var(--red); }
button.small, .button.small { padding: 7px 10px; font-size: 13px; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd5dd;
  border-radius: 7px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 92px; }
label { display: grid; gap: 6px; font-weight: 760; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(30px, 4vw, 46px); line-height: 1.02; letter-spacing: 0; }
h2 { margin-bottom: 12px; font-size: 22px; line-height: 1.15; }
h3 { margin-bottom: 8px; font-size: 15px; }
.muted { color: var(--muted); }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  grid-template-rows: 92px minmax(0, 1fr) 70px;
}
.sidebar {
  grid-row: 1 / 4;
  background: radial-gradient(circle at 90% 22%, #111923 0, #03070b 40%, #000 100%);
  color: #fff;
  padding: 22px 28px;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 28px;
}
.brand, .mobile-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 34px;
  font-weight: 950;
  letter-spacing: 0;
}
.brand-mark {
  width: 50px;
  height: 50px;
  position: relative;
  flex: 0 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, #fff 0 28%, transparent 29%), conic-gradient(from 0deg, var(--red), var(--red) 52%, transparent 53%);
}
.brand-mark:before {
  content: "";
  position: absolute;
  width: 26px;
  height: 24px;
  left: 12px;
  top: 17px;
  border-radius: 11px 11px 7px 7px;
  background: #fff;
  box-shadow: inset 7px 4px 0 #05080c, inset -7px 4px 0 #05080c;
}
.brand-mark:after {
  content: "";
  position: absolute;
  width: 18px;
  height: 10px;
  left: 16px;
  top: 36px;
  background: repeating-linear-gradient(90deg, #fff 0 3px, transparent 3px 5px);
}
.side-nav { display: grid; gap: 8px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 58px;
  padding: 0 13px;
  border-radius: 6px;
  color: rgba(255,255,255,.9);
  font-size: 18px;
  font-weight: 700;
  position: relative;
}
.side-nav a.active { background: rgba(255,255,255,.08); }
.side-nav a.active:before {
  content: "";
  position: absolute;
  left: -28px;
  top: 0;
  bottom: 0;
  width: 6px;
  border-radius: 0 4px 4px 0;
  background: var(--red);
}
.side-card, .venue-switch {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  border-radius: 8px;
}
.side-card {
  align-self: end;
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  text-transform: uppercase;
  font-size: 20px;
  line-height: 1.1;
}
.side-card strong { color: #fff; }
.side-card strong span { color: var(--red); }
.bolt {
  width: 17px;
  height: 32px;
  display: inline-block;
  background: #fff;
  clip-path: polygon(54% 0, 100% 0, 64% 42%, 100% 42%, 30% 100%, 48% 55%, 10% 55%);
}
.small-bolt { width: 10px; height: 18px; vertical-align: middle; margin-right: 10px; background: #fff; }
.venue-switch {
  width: 100%;
  min-height: 58px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  padding: 0 17px;
  font-size: 17px;
  font-weight: 650;
}
.chev {
  margin-left: auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.copyright { align-self: end; margin: 0; color: rgba(255,255,255,.72); font-size: 14px; }

.topbar {
  background: var(--black);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  padding: 0 34px;
}
.mobile-brand { display: none; margin-right: auto; font-size: 28px; }
.nav-toggle { display: none; }
.search {
  width: min(420px, 38vw);
  position: relative;
  display: block;
  font-weight: 400;
}
.search input {
  height: 50px;
  padding-left: 48px;
  background: #05080c;
  color: #fff;
  border-color: rgba(255,255,255,.35);
}
.bell, .avatar, .logout {
  position: relative;
  background: transparent;
  border: 0;
  padding: 0;
  color: #fff;
}
.bell {
  width: 30px;
  height: 34px;
  border: 2px solid #fff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border-bottom: 0;
}
.bell:after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -4px;
  height: 2px;
  background: #fff;
}
.bell span {
  position: absolute;
  right: -9px;
  top: -10px;
  min-width: 21px;
  height: 21px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  display: grid;
  place-items: center;
}
.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #222832;
  display: grid;
  place-items: center;
  font-weight: 900;
}
.logout { opacity: .72; font-weight: 700; }
.topbar-create {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent, #2563eb);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: opacity .15s;
}
.topbar-create:hover { opacity: .9; }
.topbar-create i { font-size: 13px; }
.session-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 760;
  white-space: nowrap;
}
.workspace { padding: 30px 34px 38px; min-width: 0; }
.app-footer {
  background: var(--black);
  color: rgba(255,255,255,.76);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 34px;
  font-size: 15px;
}
.app-footer span:last-child { justify-self: end; }
.app-footer a { text-decoration: underline; }

.page-head, .section-head, .toolbar, .inline-actions, .tabs, .status-line {
  display: flex;
  align-items: center;
  gap: 12px;
}
.inline-actions { flex-wrap: wrap; }
.page-head { justify-content: space-between; margin-bottom: 28px; }
.section-head { justify-content: space-between; margin-bottom: 0; }
.subtle { color: var(--muted); font-size: 18px; }
.panel, .metric-card, .attention-card, .event-summary, .next-action, .today-card, .mobile-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.panel { margin-bottom: 18px; overflow: hidden; }
.panel-body { padding: 18px; }
.padded { padding: 18px; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 22px;
  margin-bottom: 28px;
}
.metric-card {
  min-height: 150px;
  padding: 22px;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 18px;
  align-items: start;
}
.metric-card .icon-bubble { grid-row: span 2; }
.metric-card strong { font-size: 52px; line-height: 1; color: var(--muted); }
.metric-card h3 { font-size: 18px; margin: 8px 0 0; }
.metric-card p { grid-column: 2; margin: 0; color: var(--muted); font-size: 15px; }
.metric-card.green strong, .metric-card.green h3 { color: var(--green); }
.metric-card.red strong, .metric-card.red h3 { color: var(--danger); }
.metric-card.amber strong, .metric-card.amber h3 { color: var(--amber); }
.icon-bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eceef1;
  color: #101318;
}
.icon-bubble.red { background: #ffe0df; color: var(--danger); }
.icon-bubble.amber { background: #fff0c9; color: var(--amber); }
.icon-bubble.green { background: #d9f2e5; color: var(--green); }
.icon-bubble.blue { background: #dbeafe; color: var(--blue); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, .9fr);
  gap: 24px;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  text-align: left;
  vertical-align: middle;
}
.data-table th { color: var(--muted); font-size: 13px; font-weight: 760; }
.data-table th.sorted { color: var(--ink); }
.data-table th .th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
}
.data-table th .th-sort:hover { color: var(--ink); }
.data-table th .sort-arrow { font-size: 11px; line-height: 1; }
.status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 8px;
}
.status-dot.green { background: var(--green); }
.status-dot.blue { background: var(--blue); }
.status-dot.amber { background: #f5b21b; }
.status-dot.red { background: var(--danger); }
.status-dot.gray { background: #a8aeb8; }
.legend {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  padding: 16px 18px;
  color: var(--muted);
  font-size: 14px;
}
.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  background: #e7e9ed;
  color: #4b5563;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-empty { background: #eef0f3; color: #5a606b; }
.status-proposed { background: #efe5ff; color: #6a2bb7; }
.status-hold { background: #ffd7d7; color: #ae1f1f; }
.status-confirmed { background: #e5e7eb; color: #4b5563; }
.status-needs_assets { background: #ffedc2; color: #a06400; }
.status-ready_to_announce { background: #d9f3ef; color: #0b766b; }
.status-published { background: #d9ebff; color: #1466bd; }
.status-advanced { background: #d8f0e1; color: #0f7c3f; }
.status-completed, .status-settled { background: #e6e0ff; color: #5240a9; }
.status-canceled { background: #fde2e1; color: #b42318; }

.attention-list { display: grid; gap: 18px; padding: 18px; }
.attention-card {
  box-shadow: none;
  padding: 22px;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 18px;
  align-items: center;
  background: #fff8f7;
  border-color: #f5c8c5;
}
.attention-card.amber { background: #fff8ec; border-color: #f4d697; }
.attention-card strong { display: block; font-size: 18px; color: var(--danger); }
.attention-card.amber strong { color: #b97700; }
.attention-card p { margin: 2px 0 10px; color: #3d4148; }
.arrow {
  width: 13px;
  height: 13px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.calendar-page .filters {
  display: grid;
  grid-template-columns: 260px repeat(3, 1fr) auto;
  gap: 16px;
  margin-bottom: 18px;
}
.filter, .view-toggle {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #3d4450;
  box-shadow: 0 3px 10px rgba(20,25,32,.05);
}
.calendar-shell { padding: 0; }
.calendar-toolbar {
  min-height: 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.calendar-toolbar h2 { margin: 0; text-align: center; }
.calendar-controls, .calendar-actions { display: flex; gap: 8px; align-items: center; }
.calendar-actions { justify-content: flex-end; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
}
.calendar-day, .weekday {
  min-height: 106px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 11px 13px;
}
.weekday {
  min-height: 34px;
  background: #fbfbfc;
  color: #4f5663;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}
.calendar-day:nth-child(7n), .weekday:nth-child(7n) { border-right: 0; }
.day-num { display: block; color: #4f5663; font-size: 13px; margin-bottom: 8px; }
.mini-event {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 760;
}
.program-night {
  border: 1px dashed #c5ccd6;
  border-radius: 7px;
  color: #657084;
  text-align: center;
  padding: 8px 3px;
  font-size: 12px;
  transition: background .12s, border-color .12s, color .12s;
}
.calendar-day.calendar-clickable {
  cursor: pointer;
  transition: background .12s;
}
.calendar-day.calendar-clickable:hover {
  background: #f6f8fc;
}
.calendar-day.calendar-clickable:hover .program-night {
  border-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
  background: #fff;
}
.calendar-day.calendar-clickable:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: -2px;
}
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 24px;
}
.pipe-col {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(#fff, #f7f8fa);
  padding: 10px;
  min-height: 300px;
}
.pipe-col h3 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; }
.pipe-count { background: rgba(16,19,24,.08); border-radius: 999px; padding: 3px 8px; font-size: 12px; }
.pipe-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 9px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.pipe-card strong { display: block; margin-bottom: 5px; }
.pipe-card span, .pipe-card small { color: var(--muted); display: block; margin-bottom: 8px; }

.event-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}
.back-link { color: var(--muted); font-weight: 750; margin-bottom: 6px; display: inline-block; }
.event-actions { display: flex; gap: 12px; align-items: center; }
.print-menu { position: relative; }
.print-menu > summary { list-style: none; cursor: pointer; user-select: none; }
.print-menu > summary::-webkit-details-marker { display: none; }
.print-menu > summary::marker { content: ''; }
.print-menu .print-menu-items {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.print-menu .print-menu-items button {
  background: transparent;
  color: var(--ink);
  border: 0;
  text-align: left;
  padding: 9px 12px;
  font: inherit;
  border-radius: 4px;
  cursor: pointer;
}
.print-menu .print-menu-items button:hover { background: #f3f3f3; }

.guest-totals { font-size: 13px; }
.guest-list-body { padding: 8px 18px 16px; }
.guest-section { margin-top: 14px; }
.guest-section-head { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #555; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.guest-section-head .muted { font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 8px; font-size: 12px; }
.guest-row { align-items: center; }
.guest-row.checked-in { background: #f1f8f1; }
.guest-row .guest-check { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #555; min-width: 56px; }
.guest-row .guest-check input { margin: 0; }
.guest-add { background: #fafafa; border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 12px; }
.workspace-tabs {
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
}
.workspace-tabs a {
  padding: 14px 13px;
  color: #4b5360;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.workspace-tabs a.active { color: #111; border-color: var(--red); font-weight: 900; }
.event-summary {
  padding: 12px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 220px;
  gap: 20px;
  margin-bottom: 18px;
}
.flyer {
  min-height: 160px;
  border-radius: 6px;
  background: radial-gradient(circle at 80% 55%, var(--red) 0 10%, transparent 11%),
    linear-gradient(135deg, #111 0 60%, #2f3136);
  color: #fff;
  padding: 22px;
  font-size: 34px;
  font-weight: 950;
  text-transform: uppercase;
  line-height: .95;
  display: flex;
  align-items: flex-start;
}
.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0;
}
.fact {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 76px;
}
.fact label { color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.fact strong { display: block; font-size: 16px; }
.event-stats { border-left: 1px solid var(--line); display: grid; align-content: start; }
.event-stat { padding: 16px 20px; border-bottom: 1px solid var(--line); color: #4b5360; }
.event-stat strong { display: block; color: var(--danger); font-size: 28px; line-height: 1; }
.next-action {
  border-color: #f2c86e;
  background: #fffaf0;
  box-shadow: none;
  padding: 17px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
/* Workspace summary/readiness/next-action cards are web components; make the
   custom-element hosts layout-transparent so their inner markup sits exactly
   where the old inline markup did (block flow or overview-grid grid items). */
pb-event-summary, pb-event-readiness, pb-event-next-action { display: contents; }
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, .75fr);
  gap: 18px;
}
.health-row, .task-row, .schedule-row, .asset-row, .performer-row {
  display: grid;
  align-items: center;
  border-top: 1px solid var(--line);
}
.health-row { grid-template-columns: repeat(6, 1fr); padding: 18px; gap: 10px; }
.health-item { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.check, .warn-mark, .neutral {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
}
.check { background: var(--green); }
.warn-mark { background: var(--amber); }
.neutral { background: #9299a4; }
.task-row { grid-template-columns: 26px 1fr 110px 80px; gap: 12px; padding: 12px 18px; }
.box { width: 18px; height: 18px; border: 1px solid #8b93a0; border-radius: 3px; }
.schedule-row { grid-template-columns: 92px 1fr 1.2fr 80px; gap: 14px; padding: 11px 18px; }
.performer-row { grid-template-columns: 36px 1fr 80px; gap: 10px; padding: 9px 18px; }
.asset-row { grid-template-columns: 90px 1fr auto; gap: 12px; padding: 14px 18px; }
.asset-thumb { width: 86px; height: 60px; border-radius: 5px; background: #111; color: #fff; padding: 8px; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.notes { padding: 18px; line-height: 1.55; }
.empty-state { text-align: center; color: var(--muted); padding: 34px 18px; }
.loading-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--red);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-form.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check-label input { width: auto; }
.wide { grid-column: 1 / -1; }
.save-status { margin: 4px 0 0; font-size: 14px; color: var(--muted); transition: color .2s ease; }
.save-status[data-state="saving"] { color: var(--muted); opacity: 0.85; }
.save-status[data-state="saved"] { color: #2fa84f; }
.save-status[data-state="saved"]::before { content: "\2713\00a0"; font-weight: 700; }
.save-status[data-state="error"] { color: #ef4338; }
.row-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  align-items: end;
}

/* --- Editable record lists: read-only review tables with hover-to-edit --- */
.section-head-actions { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.add-toggle {
  width: 32px; height: 32px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; line-height: 1; flex: 0 0 auto;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.add-toggle:hover { background: var(--red); border-color: var(--red); color: #fff; }
.add-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.add-toggle.active { background: var(--red); border-color: var(--red); color: #fff; transform: rotate(45deg); }

[data-add-form] { border-top: 1px solid var(--line); background: var(--soft); }
[data-add-form][hidden] { display: none !important; }

.record-table { display: block; }
.record-head {
  display: none; gap: 8px; padding: 9px 18px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--soft);
  border-bottom: 1px solid var(--line);
}
.record + .record { border-top: 1px solid var(--line); }
.record-view {
  display: grid; gap: 8px; align-items: center;
  padding: 11px 18px; position: relative;
  transition: background .12s ease;
}
.record-view:hover { background: var(--soft); }
.record.checked-in .record-view { background: #f1f8f1; }
.record.checked-in .record-view:hover { background: #e7f4e7; }
.record-cell { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.record-label { display: none; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.record-value { font-size: 14px; color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
.record-value .muted { color: var(--muted); }
.record-empty { color: var(--line); }

.record-edit {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  width: 28px; height: 28px; padding: 0; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0;
  transition: opacity .12s ease, color .12s ease, border-color .12s ease, background .12s ease;
}
.record-view:hover .record-edit, .record-edit:focus-visible { opacity: 1; }
.record-edit:hover { color: #fff; background: var(--red); border-color: var(--red); }

.record .record-form { display: none; }
.record.editing .record-view { display: none; }
.record.editing .record-form { display: grid; background: var(--soft); border-top: none; }

.record-table--labeled .record-label { display: block; }

.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5;
  background: var(--soft); color: var(--ink); border: 1px solid var(--line);
  white-space: nowrap;
}
.guest-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; }
.guest-check input { margin: 0; }

@media (min-width: 861px) {
  .record-head { display: grid; }
  .record-table:not(.record-table--labeled) .record-label { display: none !important; }
}
@media (max-width: 860px) {
  .record-head { display: none; }
  .record-view { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; padding-right: 48px; }
  .record-label { display: block; }
  .record-edit { opacity: 1; top: 12px; transform: none; }
}
.asset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 250px)); gap: 14px; padding: 18px; justify-content: start; }
.asset-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 8px; }
.asset-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 5px; background: #111; }
.asset-card img.asset-image { cursor: zoom-in; transition: filter 0.12s ease, transform 0.12s ease; }
.asset-card img.asset-image:hover { filter: brightness(1.05); }
.asset-card img.asset-image:focus-visible { outline: 2px solid var(--accent, #4c6fff); outline-offset: 2px; }
.list-controls { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.checkbox-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; user-select: none; }
.checkbox-inline input { width: 16px; height: 16px; cursor: pointer; }
.inline-status {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.invite-list {
  display: grid;
  gap: 0;
}
.invite-row {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 12px 18px;
}
.invite-row input {
  font-size: 13px;
  color: var(--muted);
}
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-top: 1px solid var(--line); padding: 12px 18px; }

.tonight-page { display: none; }
.tonight-page[aria-hidden="true"] { display: none !important; }
.mobile-tabs { display: none; }
.auth-card {
  max-width: 460px;
  margin: 64px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 22px; margin-bottom: 20px; }
.passkey-btn {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  background: var(--accent, #2563eb);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity .15s;
}
.passkey-btn:disabled { opacity: .55; cursor: default; }
.passkey-btn:hover:not(:disabled) { opacity: .9; }
.passkey-icon { font-size: 18px; }
.auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0;
}
.auth-or::before, .auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-email-link > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 4px 0;
  list-style: none;
}
.auth-email-link > summary::-webkit-details-marker { display: none; }
.auth-email-link[open] > summary { margin-bottom: 14px; }
.auth-notice {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-notice.success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.auth-notice.error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.auth-card .primary.block,
.auth-card button.primary.block {
  width: 100%;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
  background: var(--accent, #2563eb);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 4px;
}
.auth-card .primary.block:disabled { opacity: .55; cursor: default; }
.auth-card .primary.block:hover:not(:disabled) { opacity: .9; }
.auth-greeting { margin: 0 0 12px; font-size: 15px; }
.auth-greeting a.small { font-size: 12px; margin-left: 8px; color: var(--muted); }
.auth-sub { margin-top: 14px; text-align: center; font-size: 13px; }
.auth-sub a { color: var(--muted); }
.muted.small { font-size: 12px; }

/* Quick-create event modal — opened from topbar + button and calendar days. */
.quick-create-blank-fields {
  border: 0;
  padding: 0;
  margin: 0;
  display: contents;
}
.quick-create-blank-fields[hidden] { display: none; }
.quick-create-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}
.quick-create-actions .primary {
  background: var(--accent, #2563eb);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}
.quick-create-actions .primary:disabled { opacity: .55; cursor: default; }
.quick-create-actions .secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid var(--line, #e3e4e8);
  border-radius: 6px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

/* Credential-setup modal — shown after sign-in for accounts with no
   passkey/password (until they set one or opt out). */
.credential-setup-card { width: min(640px, 100%); }
.credential-setup-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0 14px;
}
@media (max-width: 560px) {
  .credential-setup-options { grid-template-columns: 1fr; }
}
.credential-setup-option {
  border: 1px solid var(--line, #e3e4e8);
  border-radius: 8px;
  padding: 14px;
  background: #fafbfd;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.credential-setup-option h3 { font-size: 14px; margin: 0; display: flex; align-items: center; gap: 8px; }
.credential-setup-option form { margin: 0; }
.credential-setup-option .primary.block {
  margin-top: auto;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  background: var(--accent, #2563eb);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.credential-setup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line, #e3e4e8);
  padding-top: 14px;
}
.credential-setup-footer .secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid var(--line, #e3e4e8);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
}
.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] { width: auto; }

/* Account settings panel */
.account-section { border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 22px; }
.account-section:last-child { border-bottom: none; margin-bottom: 0; }
.account-section h2 { font-size: 16px; margin-bottom: 14px; }
.passkey-list { display: grid; gap: 8px; margin-bottom: 14px; }
.passkey-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface, #f9fafb);
}
.passkey-item-info { flex: 1; }
.passkey-item-name { font-weight: 700; font-size: 14px; }
.passkey-item-meta { color: var(--muted); font-size: 12px; }
.stack { display: grid; gap: 14px; }
.error-text { color: var(--danger); }
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 30;
}
.toast {
  width: min(360px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 12px 14px;
  background: #101318;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 760;
}
.toast.error { background: var(--danger); }
.public-body { background: #111827; color: white; }
.public-container { width: min(980px, calc(100% - 28px)); margin: 32px auto; }
.public-event { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 32px; align-items: start; }
.public-flyer { width: 100%; border-radius: 8px; }
.public-copy { font-size: 18px; line-height: 1.55; }
.public-copy h1 { font-size: 44px; }
.public-copy .muted, .public-copy .eyebrow { color: #cbd5e1; }

/* Font Awesome icon sizing — nav, sidebar, topbar */
.side-nav a i,
.venue-switch i {
  font-size: 19px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.search > i {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: rgba(255,255,255,.5);
  pointer-events: none;
}
.icon-bubble i { font-size: 22px; }
.mobile-tabs a i { font-size: 22px; display: block; }

/* Legacy CSS-drawn icon base — kept for any remaining usages */
.icon {
  width: 28px;
  height: 28px;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
}
.icon.people:before, .icon.people:after { content: ""; position: absolute; border: 3px solid currentColor; border-radius: 50%; }
.icon.people:before { width: 9px; height: 9px; left: 2px; top: 2px; }
.icon.people:after { width: 13px; height: 13px; right: 1px; top: 6px; }
.icon.bars:before { content: ""; position: absolute; left: 3px; right: 3px; bottom: 3px; height: 20px; background: linear-gradient(90deg, currentColor 0 3px, transparent 3px 8px, currentColor 8px 11px, transparent 11px 16px, currentColor 16px 19px); }
.icon.gear { border: 3px solid currentColor; border-radius: 50%; }
.icon.dots:before { content: ""; position: absolute; top: 12px; left: 3px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 9px 0 0 currentColor, 18px 0 0 currentColor; }

/* ── Desktop app shell ────────────────────────────────────────────────────
   Fixed to the viewport (100vw/100vh) so the shell never scrolls; only the
   content pane (and the nav rail, if it overflows) scroll. The footer is
   dropped here to maximize vertical space, and the sidebar can collapse to an
   icon-only rail via the topbar toggle. Mobile (≤860px) keeps its own layout. */
@media (min-width: 861px) {
  .app-shell {
    height: 100vh;
    min-height: 0;
    grid-template-rows: 92px minmax(0, 1fr);
    overflow: hidden;
  }
  .sidebar { grid-row: 1 / 3; overflow-y: auto; }
  .workspace { overflow-y: auto; min-height: 0; }
  .app-footer { display: none; }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: auto;
    width: 42px;
    height: 42px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 19px;
    cursor: pointer;
    opacity: .78;
    transition: opacity .15s;
  }
  .nav-toggle:hover { opacity: 1; }

  /* Collapsed → icon-only rail. */
  .app-shell.nav-collapsed { grid-template-columns: 84px minmax(0, 1fr); }
  .nav-collapsed .sidebar { padding: 18px 12px; gap: 20px; justify-items: center; }
  .nav-collapsed .brand { justify-content: center; }
  .nav-collapsed .brand span:last-child,
  .nav-collapsed .side-card,
  .nav-collapsed .copyright { display: none; }
  .nav-collapsed .side-nav a,
  .nav-collapsed .venue-switch { font-size: 0; gap: 0; }
  .nav-collapsed .side-nav a i,
  .nav-collapsed .venue-switch i { font-size: 22px; }
  .nav-collapsed .side-nav a,
  .nav-collapsed .venue-switch {
    width: 58px;
    min-height: 58px;
    justify-content: center;
    padding: 0;
  }
  .nav-collapsed .side-nav a.active:before { left: -12px; }
}

@media (max-width: 1320px) {
  .app-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .sidebar { padding: 20px; }
  .brand { font-size: 29px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .calendar-page .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline-board {
    grid-template-columns: repeat(8, minmax(190px, 1fr));
    overflow-x: auto;
    padding-bottom: 8px;
  }
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 94px minmax(0, 1fr); }
  .sidebar { padding: 18px 14px; gap: 20px; justify-items: center; }
  .brand { justify-content: center; }
  .brand span:last-child,
  .side-nav a,
  .venue-switch,
  .side-card,
  .copyright { font-size: 0; }
  .brand span:last-child, .side-card, .copyright { display: none; }
  .side-nav a i,
  .venue-switch i { font-size: 22px; }
  .side-nav a {
    width: 58px;
    min-height: 58px;
    justify-content: center;
    padding: 0;
    gap: 0;
  }
  .side-nav a.active:before { left: -14px; }
  .workspace { padding: 26px 24px 34px; }
  .topbar { padding: 0 24px; }
  .search { width: min(420px, 52vw); }
  .dashboard-grid, .overview-grid { grid-template-columns: 1fr; }
  .event-summary { grid-template-columns: 220px 1fr; }
  .event-stats { grid-column: 1 / -1; grid-template-columns: repeat(2, 1fr); border-left: 0; display: grid; }
  .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calendar-grid {
    overflow-x: auto;
    grid-template-columns: repeat(7, minmax(132px, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
    min-height: 100vh;
    padding-bottom: 82px;
    background: #f4f5f7;
  }
  .sidebar, .search, .logout, .app-footer { display: none; }
  .topbar {
    min-height: 106px;
    padding: 16px 28px;
    justify-content: flex-end;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .mobile-brand { display: flex; font-size: 32px; }
  .mobile-brand .brand-mark { width: 58px; height: 58px; }
  .workspace { padding: 18px; }
  h1 { font-size: 34px; }
  .page-head, .event-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .event-actions { flex-wrap: wrap; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .metric-card {
    min-height: 132px;
    padding: 16px;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
  }
  .metric-card strong { font-size: 38px; }
  .metric-card h3 { font-size: 16px; overflow-wrap: anywhere; }
  .metric-card p { font-size: 14px; }
  .icon-bubble { width: 46px; height: 46px; }
  .dashboard-grid, .overview-grid { grid-template-columns: 1fr; gap: 16px; }
  .calendar-page .filters { grid-template-columns: 1fr 1fr; gap: 10px; }
  .filter { min-height: 46px; padding: 0 12px; font-size: 14px; }
  .calendar-toolbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
  .calendar-toolbar h2 { order: -1; text-align: left; }
  .calendar-actions { justify-content: flex-start; flex-wrap: wrap; }
  .calendar-grid {
    display: grid;
    overflow-x: auto;
    grid-template-columns: repeat(7, minmax(128px, 1fr));
  }
  .calendar-day { min-height: 98px; }
  .pipeline-board {
    grid-template-columns: repeat(8, minmax(210px, 1fr));
    overflow-x: auto;
    margin-inline: -18px;
    padding: 0 18px 10px;
  }
  .event-summary {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .flyer {
    min-height: 150px;
    font-size: 30px;
  }
  .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-stats { grid-template-columns: repeat(2, 1fr); }
  .next-action {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .next-action button { grid-column: 1 / -1; justify-self: stretch; }
  .health-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-row, .schedule-row, .asset-row, .performer-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .row-form, .grid-form, .grid-form.compact {
    grid-template-columns: 1fr;
  }
  .workspace-tabs {
    margin-inline: -18px;
    padding-inline: 18px;
  }
  .tonight-page {
    display: grid;
    gap: 17px;
    padding: 0 0 26px;
    border-radius: 16px 16px 0 0;
    background: #f7f8fa;
    overflow: hidden;
  }
  .tonight-head { display: flex; gap: 24px; align-items: center; font-size: 30px; font-weight: 850; }
  .back-arrow { width: 26px; height: 26px; border-left: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg); }
  .today-card { padding: 18px; display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 18px; }
  .today-card .icon-bubble { width: 80px; height: 80px; }
  .today-card h1 { font-size: 25px; overflow-wrap: anywhere; }
  .today-meta { display: grid; gap: 9px; color: #3f4651; font-size: 17px; }
  .today-status { display: flex; gap: 16px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; font-size: 15px; flex-wrap: wrap; }
  .next-action { border-color: #b7e2cc; background: #f2fbf6; grid-template-columns: 60px minmax(0, 1fr) 18px; padding: 20px; }
  .next-action .icon-bubble { width: 56px; height: 56px; background: var(--green); color: #fff; }
  .next-action h2 { margin: 0 0 9px; color: var(--green); font-size: 19px; text-transform: uppercase; }
  .next-action p { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 900; overflow-wrap: anywhere; }
  .mobile-panel { overflow: hidden; }
  .mobile-panel h2 { padding: 16px 24px; margin: 0; border-bottom: 1px solid var(--line); font-size: 28px; display: flex; justify-content: space-between; }
  .mobile-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 61px; padding: 0 18px; border-bottom: 1px solid var(--line); font-size: 19px; }
  .mobile-row:last-child { border-bottom: 0; }
  .mobile-check { width: 31px; height: 31px; border: 2px solid #323841; border-radius: 5px; }
  .mobile-time { font-weight: 900; }
  .mobile-kpis { display: grid; grid-template-columns: repeat(4, 1fr); }
  .mobile-kpi { min-height: 150px; display: grid; place-items: center; text-align: center; border-right: 1px solid var(--line); padding: 16px; }
  .mobile-kpi:last-child { border-right: 0; }
  .mobile-kpi strong { display: block; margin-top: 6px; font-size: 20px; }
  .mobile-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 104px;
    background: #05080c;
    color: rgba(255,255,255,.84);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    z-index: 12;
  }
  .mobile-tabs a {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    font-size: 17px;
  }
  .mobile-tabs a.active {
    color: var(--red);
    background: rgba(255,255,255,.08);
    border-radius: 11px;
    margin: 10px;
  }
  .public-container { width: min(100% - 28px, 680px); }
  .public-event { grid-template-columns: 1fr; }
  .public-copy h1 { font-size: 34px; }
}

@media (max-width: 560px) {
  .topbar { min-height: 92px; padding: 14px 18px; gap: 14px; }
  .mobile-brand { font-size: 28px; gap: 9px; }
  .mobile-brand .brand-mark { width: 46px; height: 46px; }
  .bell { transform: scale(.9); }
  .avatar { width: 46px; height: 46px; }
  .workspace { padding: 14px; }
  h1 { font-size: 30px; }
  .subtle { font-size: 16px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card {
    min-height: 0;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
  }
  .metric-card .icon-bubble { grid-row: auto; }
  .metric-card p { grid-column: 2 / -1; }
  .attention-card {
    grid-template-columns: 44px minmax(0, 1fr) 12px;
    padding: 16px;
    gap: 12px;
  }
  .panel { border-radius: 7px; }
  .section-head {
    align-items: flex-start;
    gap: 10px;
  }
  .section-head .button, .section-head button { flex: 0 0 auto; }
  .data-table, .data-table thead, .data-table tbody, .data-table tr, .data-table td {
    display: block;
    width: 100%;
  }
  .data-table thead { display: none; }
  .data-table tr {
    border-top: 1px solid var(--line);
    padding: 12px 16px;
  }
  .data-table td {
    border: 0;
    padding: 6px 0;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }
  .data-table td:before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
  }
  .legend { gap: 12px; }
  .calendar-page .filters { grid-template-columns: 1fr; }
  .calendar-grid { grid-template-columns: repeat(7, minmax(116px, 1fr)); }
  .calendar-day { min-height: 88px; padding: 9px; }
  .weekday { min-height: 30px; }
  .program-night { font-size: 11px; }
  .event-summary { padding: 10px; }
  .facts-grid, .event-stats, .health-row, .mobile-kpis { grid-template-columns: 1fr; }
  .fact { min-height: auto; }
  .event-stat { border-left: 0; }
  .next-action { grid-template-columns: 42px minmax(0, 1fr); padding: 14px; }
  .today-card { grid-template-columns: 1fr; text-align: left; }
  .today-card .icon-bubble { width: 68px; height: 68px; }
  .today-card h1 { font-size: 24px; }
  .tonight-head { font-size: 28px; }
  .mobile-panel h2 { font-size: 22px; padding: 14px 16px; }
  .mobile-row { font-size: 17px; padding: 0 16px; grid-template-columns: 40px minmax(0, 1fr) auto; }
  .mobile-kpi { border-right: 0; border-bottom: 1px solid var(--line); min-height: 104px; }
  .mobile-kpi:last-child { border-bottom: 0; }
  .mobile-tabs { height: 88px; }
  .mobile-tabs a { font-size: 13px; }
  .mobile-tabs a i { font-size: 19px; }
  .workspace-tabs {
    margin-inline: -14px;
    padding-inline: 14px;
  }
}

@media (max-width: 860px) {
  .tonight-page[aria-hidden="true"] { display: none !important; }
}

/* ── Admin pages ──────────────────────────────────────────────────────── */
.admin-tabs { margin-bottom: 22px; }
.admin-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.admin-tabs i { font-size: 14px; }
.admin-table th, .admin-table td { vertical-align: top; }
.admin-table tr.muted-row td { color: var(--muted, #5a606b); }
.admin-table .row-actions {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.admin-table small.muted { font-size: 12px; }

/* Lightweight modal for edit dialogs (Users / Staff / Templates) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 17, 22, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 18px;
  overflow-y: auto;
}
.modal-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  width: min(640px, 100%);
  overflow: hidden;
}
.modal-card.wide { width: min(820px, 100%); }
.modal-card .section-head { background: #f7f8fb; border-bottom: 1px solid var(--line, #e3e4e8); }
.modal-card form { padding: 18px 22px 22px; }
.modal-card textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* ── Image lightbox ───────────────────────────────────────────────────── */
body.lightbox-open { overflow: hidden; }
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 9, 12, 0.92);
  cursor: zoom-out;
  animation: lightbox-fade 0.12s ease-out;
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.lightbox-close {
  position: fixed;
  top: 14px;
  right: 18px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  color: #fff;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }
@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Event staffing ───────────────────────────────────────────────────── */
.staffing-body { padding: 12px 18px 18px; }
.staffing-section + .staffing-section { margin-top: 14px; }
.staffing-row {
  align-items: center;
  position: relative;
  padding-bottom: 14px;
}
.staffing-row .staffing-contact {
  flex-basis: 100%;
  margin-top: 4px;
  font-size: 12px;
}
.staffing-add {
  background: #fafafa;
  border-top: 1px dashed var(--line, #e3e4e8);
  margin-top: 14px;
  padding-top: 12px;
}
.staffing-totals { font-size: 13px; }

/* ── Help page ─────────────────────────────────────────────────────────── */
.help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 8px;
  border-radius: 50%;
  color: var(--muted, #5a606b);
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
  vertical-align: middle;
  transition: background-color .12s ease, color .12s ease;
}
.help-link:hover,
.help-link:focus-visible {
  background: rgba(0,0,0,.06);
  color: var(--red, #c0392b);
  outline: none;
}
.help-link i { font-size: 14px; }

.help-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.help-toc {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line, #e3e4e8);
  border-radius: 8px;
  padding: 14px 12px;
  font-size: 14px;
}
.help-toc-group + .help-toc-group { margin-top: 14px; }
.help-toc-group h4 {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: var(--muted, #5a606b);
}
.help-toc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.help-toc a {
  display: block;
  padding: 5px 8px;
  border-radius: 4px;
  color: #1f2230;
  text-decoration: none;
  line-height: 1.3;
}
.help-toc a:hover { background: rgba(0,0,0,.04); }
.help-toc a.active {
  background: rgba(192,57,43,.08);
  color: var(--red, #c0392b);
  font-weight: 700;
}

.help-content { padding: 22px 28px; }
.help-section {
  scroll-margin-top: 90px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line, #e3e4e8);
}
.help-section:last-child { border-bottom: 0; margin-bottom: 0; }
.help-section h2 {
  font-size: 24px;
  margin: 0 0 12px;
  line-height: 1.25;
}
.help-section h3 {
  font-size: 16px;
  margin: 18px 0 8px;
  letter-spacing: 0.01em;
}
.help-section p,
.help-section li { line-height: 1.55; }
.help-section ul,
.help-section ol { margin: 8px 0 12px 22px; padding: 0; }
.help-section li { margin-bottom: 4px; }
.help-section code {
  background: #f4f5f8;
  border: 1px solid var(--line, #e3e4e8);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 90%;
}
.help-section a { color: var(--red, #c0392b); text-decoration: underline; }
.help-section .help-back {
  margin-top: 14px;
  font-size: 13px;
}
.help-section .help-back a {
  color: var(--muted, #5a606b);
  text-decoration: none;
}
.help-section .help-back a:hover { color: var(--red, #c0392b); }

@media (max-width: 1100px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-toc {
    position: static;
    max-height: none;
  }
}

