/* ============================================================
   PRESHOW — House Style v1 · Dark & moody, one electric accent
   Backstage black does the work; Showtime Red is the spark.
   ============================================================ */

:root {
  --bg:            #0C0C10;   /* Backstage */
  --surface:       #16161D;   /* Surface — cards, sheets */
  --surface-2:     #1C1C25;   /* Surface Hi — inputs, pressed states */
  --border:        #26262F;   /* Line */
  --text:          #F5F4F7;   /* Spotlight */
  --text-muted:    #9A9AA6;   /* Haze */
  --faint:         #62626E;
  --header:        #0A0A0E;
  --accent:        #FF3355;   /* Showtime Red */
  --accent-dim:    rgba(255, 51, 85, 0.14);
  --accent-strong: #FF7088;   /* Red soft — brighter hover on dark */
  --accent-press:  #C81E43;
  --crimson:       #D6234A;   /* Tornado Crimson — gradients, family tie */
  --accent-text:   #ffffff;
  --danger:        #FF3355;
  --danger-bg:     rgba(255, 51, 85, 0.12);
  --success:       #36D399;   /* Cue Green — advanced / done */
  --warn:          #FFC154;   /* In progress / tentative */
  --radius:        12px;
  --radius-lg:     18px;
  --shadow:        0 2px 8px rgba(0,0,0,0.55), 0 18px 50px rgba(0,0,0,0.5);
  --font-d:        'Bricolage Grotesque', system-ui, sans-serif;
  --font-m:        'Hanken Grotesk', system-ui, sans-serif;
  --font-u:        'Hanken Grotesk', system-ui, sans-serif;
}

/* ---- Reset ---- */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-u);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--text);
  /* Moody red glow — dark-native, the spark in the dark */
  background:
    radial-gradient(60% 45% at 78% -5%, rgba(255,51,85,0.15), transparent 70%) fixed,
    radial-gradient(45% 40% at -5% 100%, rgba(255,51,85,0.07), transparent 70%) fixed,
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

/* ---- App header ---- */
.app-header {
  background: var(--header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header__inner {
  max-width: none;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-m);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
}
.brand:hover { color: var(--accent); }
/* Brand lockup: Pleat Rewind glyph + PreShow wordmark */
.brand__mark { width: 22px; height: 22px; flex-shrink: 0; display: block;
  filter: drop-shadow(0 3px 10px rgba(255,51,85,0.45)); }
.brand__word { font-family: var(--font-d); font-weight: 800; font-size: 1.05rem;
  letter-spacing: -0.02em; text-transform: none; }
.brand__word .pre { color: #C9C8D2; }
.brand__word .show { color: #fff; }

/* Nav */
.app-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-left: auto;
  height: 52px;
}
.app-nav a {
  display: flex;
  align-items: center;
  padding: 0 0.9rem;
  font-family: var(--font-u);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}
.app-nav a:hover { color: var(--text); border-bottom-color: var(--border); }
.app-nav__org {
  display: flex;
  align-items: center;
  font-family: var(--font-m);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding: 0 0.5rem 0 0.75rem;
  border-left: 1px solid var(--border);
  margin-left: 0.25rem;
  white-space: nowrap;
}

/* Slim-topbar right cluster: +New, org name, account menu */
.app-header__right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; height: 52px; }

/* Account ("admin") dropdown in the topbar */
.account-menu { position: relative; display: flex; align-items: stretch; }
.account-menu > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.6rem;
  font-family: var(--font-u);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover { color: var(--text); }
.account-menu__panel {
  position: absolute;
  right: 0;
  top: 48px;
  z-index: 40;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.account-menu__panel a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
}
.account-menu__panel a:hover { background: var(--surface-2); color: var(--accent); }
.account-menu__lang { margin: 0; padding: 0.25rem; }
.account-menu__lang select { font-size: 0.82rem; padding: 0.4rem 0.6rem; }

/* ---- App shell: sidebar + content ---- */
.app-body { display: flex; align-items: flex-start; }
.app-content { flex: 1 1 auto; min-width: 0; }
.app-body--full .app-content { width: 100%; }

.app-sidebar {
  flex: 0 0 216px;
  width: 216px;
  position: sticky;
  top: 52px;
  align-self: flex-start;
  height: calc(100vh - 52px);
  overflow-y: auto;
  padding: 1.1rem 0.75rem;
  background: var(--header);
  border-right: 1px solid var(--border);
}
.side-nav { display: flex; flex-direction: column; gap: 0.08rem; }
.side-nav__link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-family: var(--font-u);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.side-nav__link:hover { color: var(--text); background: var(--surface-2); }
.side-nav__link.is-active {
  color: var(--accent);
  background: var(--accent-dim);
}

.side-group { margin-top: 0.55rem; }
.side-group > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  font-family: var(--font-u);
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.7;
}
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary::after {
  content: "›";
  font-size: 0.95rem;
  opacity: 0.8;
  transition: transform 0.15s;
}
.side-group[open] > summary::after { transform: rotate(90deg); }
.side-group > summary:hover { color: var(--text); opacity: 1; }
.side-group .side-nav__link { padding-left: 1.4rem; }

/* Mobile drawer backdrop (shown only when the sidebar is open under 900px) */
.sidebar-backdrop { display: none; }

/* ---- Layout ---- */
.app-main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

/* Dashboard widgets: small breathing room between stacked cards */
.dash-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* ---- Typography ---- */
h1 {
  font-family: var(--font-d);
  font-size: 2rem;
  font-weight: 400;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.15;
}
h2 {
  font-family: var(--font-u);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.75rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
h3 {
  font-family: var(--font-u);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.25rem 0 0.5rem;
}

/* ---- Messages ---- */
.messages {
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
  list-style: none;
}
.messages li {
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-family: var(--font-u);
  letter-spacing: 0.02em;
}
.messages .error,
.messages .danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(255,51,85,0.3); }
.messages .success { background: rgba(54,211,153,0.08); color: var(--success); border-color: rgba(54,211,153,0.3); }
.messages .info    { background: var(--surface); color: var(--text-muted); border-color: var(--border); }

/* ---- Forms ---- */
form p { margin: 0 0 1rem; }
label {
  display: block;
  font-family: var(--font-u);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
input:not([type=checkbox]):not([type=radio]):not([type=submit]),
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-family: var(--font-m);
  font-size: 0.88rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.12s, box-shadow 0.12s;
  appearance: none;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239A9AA6' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.25rem; }
select option { background: var(--surface-2); color: var(--text); }
textarea { resize: vertical; min-height: 90px; }
.helptext,
.helptext small { color: var(--text-muted); font-size: 0.8rem; font-family: var(--font-u); }
ul.errorlist { color: var(--danger); list-style: none; padding: 0; margin: 0 0 0.4rem; font-size: 0.85rem; }

/* ---- Buttons ---- */
button, .btn, input[type=submit] {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-u);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  transition: background 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}
button:hover, .btn:hover, input[type=submit]:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 0 16px rgba(255,51,85,0.4);
  text-decoration: none;
}
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn--block { display: flex; width: 100%; justify-content: center; }
.btn--danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn--danger:hover { background: var(--danger); color: #fff; box-shadow: 0 0 14px rgba(255,51,85,0.4); }
.btn--success {
  background: rgba(54,211,153,0.13);
  border-color: rgba(54,211,153,0.5);
  color: var(--success);
}
.btn--success:hover { background: rgba(54,211,153,0.22); border-color: var(--success); color: var(--success); box-shadow: none; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-u);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  font-family: var(--font-u);
}
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

/* ---- Auth pages ---- */
.auth-body {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}
.auth-body::before {
  content: '';
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,51,85,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,51,85,0.05);
  padding: 2.5rem 2rem;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-card__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-m);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.4rem;
}
/* Login / auth hero — the "Opening Night" brand signature stacked over the wordmark */
.auth-card__brand--hero { flex-direction: column; gap: 0.85rem; margin-bottom: 0.5rem; }
.auth-card__brand .brand__mark--hero { width: 76px; height: 76px;
  filter: drop-shadow(0 8px 26px rgba(255,51,85,0.5)); }
.auth-card__brand .brand__word { font-size: 1.9rem; }
.auth-card__tagline { text-align: center; color: var(--text-muted); font-size: 0.88rem; margin: 0 0 2rem; letter-spacing: 0.05em; }
.auth-card h1 { text-align: center; font-size: 1.5rem; margin-bottom: 1.5rem; }
.auth-card button, .auth-card input[type=submit] { width: 100%; justify-content: center; padding: 0.65rem 1.25rem; margin-top: 0.5rem; }
.auth-card__alt { text-align: center; margin: 1.25rem 0 0; font-size: 0.88rem; color: var(--text-muted); }
.auth-card .messages { max-width: none; margin: 0 0 1rem; padding: 0; }

/* ---- Utility ---- */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.measure { max-width: 480px; }

/* ---- Page header ---- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

/* Show-detail header: title/date/status full width on top, actions wrap below */
.show-header { margin-bottom: 1.75rem; }
.show-header__title h1 { margin: 0; }
.show-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}
/* Compact action buttons — the header row is secondary chrome, not the focus */
.show-header__actions .btn {
  padding: 0.32rem 0.75rem;
  font-size: 0.68rem;
}
.page-header h1 { margin: 0; }
.page-header__meta {
  font-family: var(--font-m);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.4rem 0 0;
  letter-spacing: 0.05em;
}
.page-header__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; flex-shrink: 0; padding-top: 0.45rem; }

/* On narrow screens, stack the header so the action buttons wrap instead of
   bleeding off the right edge. */
@media (max-width: 640px) {
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header__actions { padding-top: 0; }
}

/* ---- Breadcrumbs ---- */
.breadcrumbs {
  font-family: var(--font-m);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs__sep { margin: 0 0.5em; opacity: 0.5; }
.breadcrumbs__current { color: var(--text); }

/* ---- Tab nav ---- */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
  gap: 0;
}
.tab-nav a {
  display: block;
  padding: 0.5rem 1rem;
  font-family: var(--font-u);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.tab-nav a:hover { color: var(--text); border-bottom-color: var(--border); }
.tab-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-nav__badge {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0 0.4em;
  min-width: 1.4em;
  font-size: 0.65rem;
  line-height: 1.5;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.tab-nav a.active .tab-nav__badge { color: var(--accent); border-color: var(--accent-dim); }

/* Grouped tab dropdowns — summary styled like a tab, panel like a menu */
.tab-group { position: relative; }
.tab-group > summary {
  list-style: none;
  cursor: pointer;
  display: block;
  padding: 0.5rem 1rem;
  font-family: var(--font-u);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.tab-group > summary::-webkit-details-marker { display: none; }
.tab-group > summary:hover { color: var(--text); border-bottom-color: var(--border); }
.tab-group.active > summary { color: var(--accent); border-bottom-color: var(--accent); }
.tab-group__panel {
  position: absolute;
  left: 0;
  z-index: 30;
  margin-top: 0.35rem;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
}
/* Sub-items read as a menu, not tabs — override the inherited .tab-nav a rules */
.tab-group__panel a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border-bottom: none;
  margin-bottom: 0;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.82rem;
}
.tab-group__panel a:hover { background: var(--surface-2); color: var(--accent); border-bottom: none; }
.tab-group__panel a.active { color: var(--accent); border-bottom: none; }

/* ---- Filter bar ---- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.filter-bar label { font-size: 0.68rem; letter-spacing: 0.14em; }
.filter-bar input,
.filter-bar select { width: auto; min-width: 140px; font-size: 0.85rem; }

.filter-bar--compact { align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; padding-bottom: 1.25rem; }
/* Selector mirrors the global `input:not()...{width:100%}` specificity so the
   compact controls size to content instead of stretching full-width. */
.filter-bar--compact input:not([type=checkbox]):not([type=radio]),
.filter-bar--compact select {
  width: auto;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}
.filter-bar--compact input[name="q"] { flex: 1 1 200px; }   /* search takes the slack */
.filter-bar--compact select { min-width: 130px; }
.filter-bar--compact input[type="date"] { min-width: 150px; color-scheme: dark; }
.filter-date {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Inline quick-edit of schedule times: clickable time, then compact inputs */
.sched-time {
  color: inherit;
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
}
.sched-time:hover { color: var(--accent); border-bottom-color: var(--accent-dim); }
/* Schedule times read calmer than the brand accent — red is reserved for
   accents + danger. Neutral but pronounced: bright + slightly heavier. */
#schedule-list .item-row__lead { color: var(--text); font-weight: 600; }
.sched-time-edit { display: contents; }
.sched-time-edit__inputs {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
/* match the global `input:not()…{width:100%}` specificity so the time inputs
   size to content instead of stretching */
.sched-time-edit__inputs input:not([type=checkbox]):not([type=radio]) {
  width: auto;
  min-width: 0;
  padding: 0.2rem 0.4rem;
  font-size: 0.82rem;
  color-scheme: dark;
}

/* ---- Show list (cue cards) ---- */
.show-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.show-list__empty {
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-align: center;
}
.show-list__item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  animation: cueIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  position: relative;
}
.show-list__item:last-child { border-bottom: none; }
.show-list__item:hover { background: var(--surface-2); margin-left: -1.75rem; margin-right: -1.75rem; padding-left: 1.75rem; padding-right: 1.75rem; }

/* Staggered reveal */
.show-list__item:nth-child(1)  { animation-delay: 0.03s; }
.show-list__item:nth-child(2)  { animation-delay: 0.07s; }
.show-list__item:nth-child(3)  { animation-delay: 0.11s; }
.show-list__item:nth-child(4)  { animation-delay: 0.15s; }
.show-list__item:nth-child(5)  { animation-delay: 0.19s; }
.show-list__item:nth-child(6)  { animation-delay: 0.23s; }
.show-list__item:nth-child(7)  { animation-delay: 0.27s; }
.show-list__item:nth-child(8)  { animation-delay: 0.31s; }
.show-list__item:nth-child(9)  { animation-delay: 0.35s; }
.show-list__item:nth-child(10) { animation-delay: 0.39s; }
.show-list__item:nth-child(n+11) { animation-delay: 0.43s; }

@keyframes cueIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.show-list__cb { flex-shrink: 0; accent-color: var(--accent); }

.show-list__date {
  font-family: var(--font-m);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
  min-width: 88px;
}

.show-list__title {
  font-family: var(--font-d);
  font-size: 1.2rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.1s;
}
.show-list__title:hover { color: var(--accent); }

.show-list__venue {
  font-family: var(--font-u);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  display: none;
}
@media (min-width: 640px) { .show-list__venue { display: block; } }

/* Status chip */
.show-list__status {
  font-family: var(--font-u);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
/* Status colour coding — grey draft → gold confirmed → green done, red cancelled */
.show-list__status--draft,
.show-list__status--planning  { border-color: rgba(154,154,166,0.45); color: var(--text-muted); background: rgba(154,154,166,0.10); }
.show-list__status--confirmed { border-color: rgba(255,193,84,0.55);  color: var(--warn);      background: rgba(255,193,84,0.13); }
.show-list__status--done      { border-color: rgba(54,211,153,0.5);   color: var(--success);   background: rgba(54,211,153,0.13); }
.show-list__status--cancelled { border-color: rgba(255,51,85,0.5);    color: var(--danger);    background: rgba(255,51,85,0.12); }

/* Same colour coding for the editor's inline status dropdown.
   background-color (not the `background` shorthand) keeps the global select arrow. */
/* `select.status-select` (not `.status-select`) so the right-padding beats
   `.btn--sm`'s padding and leaves clear room for the dropdown arrow. */
select.status-select {
  font-family: var(--font-u);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.28rem 2.3rem 0.28rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.status-select--draft     { color: var(--text-muted); border-color: rgba(154,154,166,0.45); background-color: rgba(154,154,166,0.10); }
.status-select--confirmed { color: var(--warn);       border-color: rgba(255,193,84,0.55);  background-color: rgba(255,193,84,0.13); }
.status-select--done      { color: var(--success);    border-color: rgba(54,211,153,0.5);   background-color: rgba(54,211,153,0.13); }
.status-select--cancelled { color: var(--danger);     border-color: rgba(255,51,85,0.5);    background-color: rgba(255,51,85,0.12); }

/* Crew availability heads-up (#50) */
.availability-warning {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  margin: 0.75rem 0;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.show-list__status--free      { border-color: rgba(54,211,153,0.4); color: var(--success); }
.show-list__status--tentative { border-color: rgba(255,193,84,0.5); color: var(--warn); }
.show-list__status--busy      { border-color: rgba(255,51,85,0.3);  color: var(--danger); }

/* Script version diff (#82) */
.diff {
  font-family: var(--font-m, monospace);
  font-size: 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 0;
}
.diff span { display: block; white-space: pre-wrap; }
.diff--add { background: rgba(54,211,153,0.16); color: var(--success, #36D399); }
.diff--del { background: rgba(255,51,85,0.16); color: var(--danger); }
.diff--meta { color: var(--text-muted); }
.diff--context { color: var(--text); }

/* Guest list (#89) */
.guest-totals { font-size: 0.9rem; margin: 0; }
.guest-totals strong { color: var(--text); }
.guest-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.guest-table th, .guest-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
.guest-table th { font-family: var(--font-u); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.guest-table tr.is-checked-in { background: rgba(54,211,153,0.08); }
.guest-form { margin-top: 0.5rem; }

/* Per-show comments (#80) */
.comment-list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.comment {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.comment__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}
.comment__author { font-weight: 600; font-size: 0.9rem; }
.comment__time { color: var(--text-muted); font-size: 0.78rem; }
.comment__delete {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.comment__delete:hover { color: var(--danger); }
.comment__body { white-space: pre-line; color: var(--text); }
.comment-form { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.comment-form textarea { width: 100%; }

/* Quick-create (+ New) menu (#55) */
.quick-create { position: relative; display: inline-block; }
.quick-create > summary { list-style: none; cursor: pointer; }
.quick-create > summary::-webkit-details-marker { display: none; }
.quick-create__panel {
  position: absolute;
  left: 0;
  z-index: 40;
  margin-top: 0.4rem;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
}
.quick-create__panel a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
}
.quick-create__panel a:hover { background: var(--surface-2); color: var(--accent); }

/* ⌘K command palette (#55) */
.cmdk {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
/* The palette is toggled via the `hidden` attribute in JS; author `display`
   above otherwise overrides the UA `[hidden] { display:none }`, leaving the
   full-screen overlay stuck open and its backdrop swallowing every click (#160). */
.cmdk[hidden] { display: none; }
.cmdk__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.cmdk__dialog {
  position: relative;
  margin-top: 12vh;
  width: min(560px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}
.cmdk__input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  padding: 1rem 1.1rem;
  outline: none;
}
.cmdk__results { list-style: none; margin: 0; padding: 0.35rem; max-height: 50vh; overflow-y: auto; }
.cmdk__item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
}
.cmdk__item.is-active, .cmdk__item:hover { background: var(--surface-2); }
.cmdk__kind {
  font-family: var(--font-u);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  min-width: 56px;
}
.cmdk__label { color: var(--text); flex: 1; }
.cmdk__sub { color: var(--text-muted); font-size: 0.78rem; }
.cmdk__empty { padding: 1rem; color: var(--text-muted); text-align: center; }

/* Org switcher in nav (#54) */
.org-switcher { position: relative; display: inline-block; }
.org-switcher > summary { list-style: none; cursor: pointer; }
.org-switcher > summary::-webkit-details-marker { display: none; }
.org-switcher__panel {
  position: absolute;
  right: 0;
  z-index: 40;
  margin-top: 0.4rem;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
}
.org-switcher__panel a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
}
.org-switcher__panel a:hover { background: var(--surface-2); color: var(--accent); }
.org-switcher__panel a.is-active { color: var(--accent); font-weight: 600; }
.org-switcher__role {
  font-family: var(--font-u);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Consolidated Export dropdown (#65) */
.export-menu { position: relative; display: inline-block; }
.export-menu > summary {
  list-style: none;
  cursor: pointer;
}
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu__panel {
  position: absolute;
  right: 0;
  z-index: 30;
  margin-top: 0.35rem;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
}
.export-menu__panel a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  white-space: nowrap;
}
.export-menu__panel a:hover { background: var(--surface-2); color: var(--accent); }
.export-menu__heading {
  padding: 0.5rem 0.75rem 0.25rem;
  font-family: var(--font-u);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

/* Dashboard "next show" hero (#62) */
.hero-show {
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}
.hero-show__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.hero-show__label {
  font-family: var(--font-u);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-show__title { margin: 0.4rem 0 0.2rem; font-size: 1.8rem; }
.hero-show__title a { color: var(--text); }
.hero-show__title a:hover { color: var(--accent); }
.hero-show__meta { color: var(--text-muted); margin: 0 0 0.5rem; }
.hero-show__countdown {
  font-family: var(--font-m);
  font-size: 1.1rem;
  color: var(--accent);
  margin: 0 0 1rem;
}
.hero-show__links { flex-wrap: wrap; }

/* Inline quick actions on show-list rows (#63) */
.show-list__actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.show-list__actions .btn--sm { white-space: nowrap; }

/* ---- Bulk actions row (show list) ---- */
.bulk-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.bulk-bar label { font-size: 0.72rem; letter-spacing: 0.1em; margin: 0; color: var(--text-muted); }
.bulk-bar select { width: auto; font-size: 0.85rem; }

/* ---- Select-all bar ---- */
.select-all-bar {
  margin-bottom: 0.5rem;
}
.select-all-bar label {
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

/* ---- Pagination ---- */
.pagination-nav {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 1.25rem;
  font-family: var(--font-m);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.pagination-nav a { color: var(--text-muted); padding: 0.2rem 0.4rem; border-radius: var(--radius); }
.pagination-nav a:hover { color: var(--text); background: var(--surface-2); }
.pagination-nav strong {
  color: var(--accent);
  padding: 0.2rem 0.4rem;
  border: 1px solid rgba(255,51,85,0.35);
  border-radius: var(--radius);
}
.pagination-nav span { color: var(--text-muted); padding: 0.2rem 0.2rem; }

/* ---- Drag handle (sortable) ---- */
.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0 0.25rem;
  user-select: none;
}
.drag-handle:active { cursor: grabbing; }

/* ---- Inline edit / HTMX ---- */
[hx-indicator] { opacity: 1; transition: opacity 0.2s; }
.htmx-request [hx-indicator],
.htmx-request.hx-indicator { opacity: 0.5; }

/* In-flight rows fade slightly so edits/deletes feel acknowledged */
.htmx-request.item-row,
.htmx-request tr { opacity: 0.45; transition: opacity 0.15s; }

/* ============================================================
   COMPONENTS — added in the polish pass
   ============================================================ */

/* ---- Small / icon buttons ---- */
.btn--sm { padding: 0.3rem 0.7rem; font-size: 0.68rem; }
.btn--icon { padding: 0.3rem 0.5rem; font-size: 0.8rem; line-height: 1; }

/* ---- Section sub-heading row (heading + an action on the right) ---- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.section-head h2 { margin-top: 0; border-bottom: none; }
.btn-group { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* ---- Key / value spec grid (overview, stage specs, gear detail) ---- */
.data-list {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 0.55rem 1.5rem;
  margin: 0 0 1.5rem;
}
.data-list dt {
  font-family: var(--font-u);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  align-self: center;
}
.data-list dd {
  margin: 0;
  font-family: var(--font-u);
  font-size: 0.95rem;
  color: var(--text);
}
@media (max-width: 520px) {
  .data-list { grid-template-columns: 1fr; gap: 0.15rem 0; }
  .data-list dd { margin-bottom: 0.75rem; }
}

/* ---- Generic item list (schedule, crew, gear, scripts, attachments) ---- */
.item-list { list-style: none; padding: 0; margin: 0; }
.item-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.25rem;
  border-bottom: 1px solid var(--border);
}
.item-list .item-row:last-child { border-bottom: none; }
.item-row:hover { background: var(--surface-2); }
.item-row__lead {
  font-family: var(--font-m);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.item-row__main { flex: 1; min-width: 0; }
.item-row__title { font-family: var(--font-u); font-weight: 600; color: var(--text); margin-right: 0.45rem; }
.row-tag {
  display: inline-block;
  padding: 0 0.45em;
  font-family: var(--font-u);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.6;
  vertical-align: middle;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-right: 0.45rem;
}
.item-row__meta {
  font-family: var(--font-u);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.item-row__meta--warn { color: var(--danger); }
.item-row__note { display: block; margin-top: 0.15rem; }

/* ---- Capture inbox ---- */
.capture-inbox {
  margin: 0.75rem 0;
  padding: 0.6rem 0.8rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
}
.capture-inbox__addr { user-select: all; }
.capture-forms {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1rem 0;
}
.capture-forms .form-card { flex: 1; min-width: 240px; }

/* ---- Script file viewer ---- */
.script-viewer {
  width: 100%;
  height: 75vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

/* ---- Dashboard "this week" timeline ---- */
.week-day + .week-day { margin-top: 0.9rem; }
.week-day__head {
  font-family: var(--font-u);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.2rem;
  border-bottom: none;
}
.week-event__tag {
  font-family: var(--font-u);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.week-event__crew {
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0 0 0 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.week-event__crew li { margin-top: 0.1rem; }
.horizon-toggle { margin-left: 0.5rem; }
.horizon-toggle__opt {
  font-family: var(--font-u);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
}
.horizon-toggle__opt + .horizon-toggle__opt { margin-left: 0.2rem; }
.horizon-toggle__opt.is-active {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---- Row actions (replaces "edit | delete" pipe links) ---- */
.row-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  margin-left: auto;
}
.row-actions a,
.row-actions button {
  font-family: var(--font-u);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: color 0.1s, background 0.1s, border-color 0.1s;
}
.row-actions a:hover,
.row-actions button:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
  box-shadow: none;
}
.row-actions .is-danger:hover {
  color: var(--danger);
  border-color: rgba(230, 57, 70, 0.4);
  background: var(--danger-bg);
}

/* ---- Empty states (one consistent treatment) ---- */
.empty {
  padding: 1.75rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}
.empty--inline { padding: 0.9rem 0; text-align: left; }

/* ---- Error pages (404 / 403 / 400) ---- */
.error-page {
  max-width: 32rem;
  margin: 4rem auto;
  text-align: center;
}
.error-page__code {
  font-family: var(--font-d);
  font-size: 4.5rem;
  line-height: 1;
  margin: 0 0 0.5rem;
  color: var(--accent);
}
.error-page__title { margin: 0 0 0.75rem; }
.error-page__message {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.55;
  margin: 0 0 1.75rem;
}

/* ---- Hand-rendered form fields (via _form_fields.html) ---- */
.field { margin: 0 0 1.1rem; }
.field > label { margin-bottom: 0.35rem; }
.field__error {
  color: var(--danger);
  font-size: 0.8rem;
  font-family: var(--font-u);
  margin: 0.3rem 0 0;
}
.field--error input:not([type=checkbox]):not([type=radio]),
.field--error select,
.field--error textarea { border-color: rgba(230, 57, 70, 0.6); }
.field--check { display: flex; align-items: center; gap: 0.5rem; }
.field--check > label {
  margin: 0;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}
.field--check input { width: auto; accent-color: var(--accent); }

/* Group short fields side by side (e.g. doors / call / start times) */
.field-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.field-row .field { flex: 1; min-width: 140px; }

.form-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1.25rem;
}
.form-card { max-width: 620px; }

/* Inline edit forms sitting inside an item-list shouldn't use flex row layout */
.item-row--editing { display: block; padding: 1rem 0.25rem; }

/* Danger-zone heading (org settings) */
.danger-heading { color: var(--danger); margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }

/* ---- Setlist: act cards + song rows ---- */
.act-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
}
.act-card__head { display: flex; align-items: center; gap: 0.6rem; }
.act-card__title { font-family: var(--font-u); font-weight: 700; color: var(--text); }
.act-card__meta { font-family: var(--font-u); font-size: 0.88rem; color: var(--text-muted); }
.act-card__notes { margin: 0.4rem 0 0 1.7rem; color: var(--text-muted); font-size: 0.9rem; }
.song-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.song-row:last-child { border-bottom: none; }
.song-row .drag-handle { font-size: 0.8em; }
.song-row__num { text-align: right; }
.song-row__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-row__dur {
  justify-self: end;
  font-family: var(--font-m);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
/* Setlist section divider (e.g. "Encore", "Set 2") — a labelled break, red accent bar. */
.song-row--divider {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.4rem 0.7rem;
  background: var(--surface-2);
  border: none;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}
.song-row--divider:first-child { margin-top: 0; }
/* Pull actions out past the bar's right padding so Edit/✕ align with song rows. */
.song-row--divider .row-actions { margin-right: -0.7rem; }
.song-row__divider-label {
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
}
.song-empty { padding: 0.35rem 0; color: var(--text-muted); font-size: 0.9rem; }
.song-form { padding: 0.5rem 0; }

/* ---- Input list — aligned patch-sheet columns ----
   Fixed widths on Ch / 48V / actions so the flexible columns share equal slack
   on every row and line up like a real input list. */
.input-row {
  display: grid;
  grid-template-columns: 1.1rem 2.5rem minmax(110px, 1.5fr) minmax(80px, 0.9fr) minmax(90px, 1.1fr) minmax(70px, 0.85fr) 3rem 6rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.input-row:hover:not(.input-row--head) { background: var(--surface-2); }
.input-row .drag-handle { font-size: 0.8em; }
.input-row__ch { text-align: right; font-family: var(--font-m); color: var(--text-muted); }
.input-row__src { font-family: var(--font-u); font-weight: 600; color: var(--text); min-width: 0; }
.input-row__note { display: block; font-size: 0.78rem; font-weight: 400; color: var(--text-muted); }
.input-row__cell { color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.input-row__48v { text-align: center; }
.input-row__yes { color: var(--success); font-weight: 700; }
.input-row__off { color: var(--border); }
.input-row .row-actions { justify-self: end; }
.input-row--head {
  padding-bottom: 0.4rem;
}
.input-row--head span {
  font-family: var(--font-u);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
@media (max-width: 720px) {
  .input-row { grid-template-columns: 1.1rem 2.5rem 1fr 3rem 6rem; }
  .input-row--head span:nth-child(4),
  .input-row--head span:nth-child(5),
  .input-row--head span:nth-child(6),
  .input-row__cell { display: none; }
}

/* ---- Inline add-forms promoted to a popup (see base.html syncModals) ----
   Any element whose id ends in "-add-form" is lifted out of its list into a
   centered card over a backdrop. No view changes needed — the existing HTMX
   add flow (row + fresh form) keeps the popup open and cleared for rapid entry. */
#modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
}
#modal-backdrop[hidden] { display: none; }
body.modal-open { overflow: hidden; }
.is-modal {
  position: fixed;
  z-index: 1001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  margin: 0;
  padding: 1.75rem 1.5rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.is-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  width: auto;
  padding: 0.2rem 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  letter-spacing: 0;
}
.is-modal__close:hover { background: transparent; color: var(--text); box-shadow: none; }

/* ---- Responsive header nav ---- */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.35rem 0.6rem;
  font-size: 1rem;
  line-height: 1;
}
.nav-toggle:hover { background: var(--surface-2); box-shadow: none; }

/* Under 900px the sidebar becomes an off-canvas drawer toggled by the hamburger. */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .app-sidebar {
    position: fixed;
    top: 52px;
    left: 0;
    bottom: 0;
    height: auto;
    width: 260px;
    max-width: 80vw;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 200;
    box-shadow: var(--shadow);
  }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 52px 0 0 0;
    background: rgba(0, 0, 0, 0.55);
    border: 0;
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
}

/* ---- Show list: keep titles readable on small screens ---- */
@media (max-width: 560px) {
  .show-list__item { flex-wrap: wrap; gap: 0.5rem 0.75rem; }
  .show-list__title {
    flex-basis: 100%;
    order: 5;
    white-space: normal;
    font-size: 1.05rem;
  }
  .show-list__status { margin-left: auto; }
}

/* ---- Gear tabbed inventory ---- */
.gear-search-bar { margin-bottom: 1.25rem; }
.gear-search-bar input { width: 100%; max-width: 340px; }

.gear-tabs { display: flex; flex-direction: column; gap: 0; }

.gear-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1rem;
}
.gear-tab-btn {
  background: none;
  border: none;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.gear-tab-btn:hover { color: var(--text); }
.gear-tab-btn.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.gear-tab-count {
  font-size: 0.72rem;
  background: var(--border);
  border-radius: 10px;
  padding: 0.05rem 0.45rem;
  font-weight: 400;
}

.gear-tab-panel { display: none; }
.gear-tab-panel.active { display: block; }

.gear-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.gear-table th { text-align: left; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); }
.gear-table td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border); }
.gear-table__row:last-child td { border-bottom: none; }

.gear-category-heading {
  list-style: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 0 0.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}
.gear-category-heading:first-child { border-top: none; margin-top: 0; padding-top: 0; }

/* Compact, de-emphasised kit picker — keeps the select from stretching full-width. */
/* Mirror the global `input:not()...{width:100%}` specificity so the filter
   sits inline in the section head instead of stretching full-width. */
input.crew-search:not([type=checkbox]):not([type=radio]):not([type=submit]) {
  width: 200px;
  max-width: 100%;
  margin: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

/* ---- Day filter (multi-day shows: schedule / crew tabs) ---- */
.day-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1rem;
}
.day-filter__opt {
  font-family: var(--font-u);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
}
.day-filter__opt:hover { color: var(--text); border-color: var(--text-muted); }
.day-filter__opt.is-active { color: var(--accent); border-color: var(--accent); }

/* ---- Permissions: role matrix + per-person overrides ---- */
.mt-sm { margin-top: 0.75rem; }

.perm-matrix__scroll { overflow-x: auto; }
.perm-matrix { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.perm-matrix th,
.perm-matrix td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; }
.perm-matrix__cap {
  text-align: center;
  font-family: var(--font-u);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  vertical-align: bottom;
}
.perm-matrix__cell { text-align: center; }
.perm-matrix__role { min-width: 160px; }
.perm-matrix__role input[type="text"] { width: 100%; }
.perm-matrix__meta { font-size: 0.72rem; margin-top: 0.2rem; }
.perm-matrix input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.perm-matrix__del { text-align: right; white-space: nowrap; }

.perm-add-role { display: flex; gap: 0.5rem; align-items: center; }
.perm-add-role input { max-width: 260px; }

.perm-person { padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.perm-person:last-child { border-bottom: 0; }
.perm-person__head { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.55rem; }
.perm-person__caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.4rem 1.25rem; }
.perm-cap { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.perm-cap__name { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; }
.perm-cap select { width: auto; min-width: 118px; font-size: 0.78rem; padding: 0.3rem 0.5rem; }
.perm-cap__dot { color: var(--text-muted); font-size: 0.7rem; }
.perm-cap__dot.is-on { color: var(--success); }
.perm-cap--overridden select { border-color: var(--accent); }
