/*
  Treblemonsters 2027 theme
  -------------------------
  A dark, glassy layer over style.css. base.html sets data-bs-theme="dark" (Bootstrap 5.3) so forms, tables,
  dropdowns and modals are dark by default; this file sets the design tokens and restyles the app's own classes.
  Remove the theme.css <link> in base.html (and the data-bs-theme attribute) to go back to the previous look.
*/

/* ---------- design tokens ---------- */

:root {
  --tm-bg: #0a0f1d;
  --tm-bg-raised: #0f1629;
  --tm-surface: rgba(255, 255, 255, 0.03);
  --tm-surface-hover: rgba(255, 255, 255, 0.06);
  --tm-surface-strong: rgba(255, 255, 255, 0.08);
  --tm-border: rgba(255, 255, 255, 0.08);
  --tm-border-strong: rgba(255, 255, 255, 0.14);
  --tm-text: #e6edf6;
  --tm-text-muted: #94a3b8;
  /* Treblemonsters brand: Turquoise and Magenta */
  --tm-turquoise: #2dd4bf;
  --tm-turquoise-bright: #00f2fe;
  --tm-magenta: #ff2a85;
  --tm-magenta-deep: #e02475;
  --tm-accent: var(--tm-turquoise);
  --tm-accent-2: var(--tm-turquoise-bright);
  --tm-accent-3: var(--tm-magenta);
  --tm-accent-ink: #04121a;       /* text on accent backgrounds */
  /* Brand colour is an accent, not a fill: thin lines, primary buttons, active tabs and focus only */
  --tm-accent-gradient: linear-gradient(135deg, #2dd4bf 0%, #ff2a85 100%);     /* hairlines and borders */
  --tm-cta-fill: linear-gradient(135deg, #2dd4bf 0%, #00f2fe 100%);            /* primary buttons: turquoise only */
  --tm-cta-glow: 0 0 0 1px rgba(45, 212, 191, 0.55), 0 0 15px rgba(255, 42, 133, 0.3);
  --tm-focus-ring: 0 0 0 3px rgba(255, 42, 133, 0.18);
  --tm-success: #34d399;
  --tm-danger: #f87171;
  --tm-warning: #fbbf24;
  --tm-radius: 12px;
  --tm-radius-lg: 16px;
  --tm-blur: blur(12px);
  --tm-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --tm-glow: 0 0 0 1px rgba(45, 212, 191, 0.35), 0 8px 28px rgba(45, 212, 191, 0.18);
  --tm-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tm-menu-font-size: 13px;      /* sidebar links and every pop-up menu / "are you sure?" (one size, Kice 2026-11-03) */
  --tm-menu-item-padding: 7px 12px;
}

[data-bs-theme="dark"] {
  --bs-body-bg: var(--tm-bg);
  --bs-body-color: var(--tm-text);
  --bs-secondary-color: var(--tm-text-muted);
  --bs-emphasis-color: #ffffff;
  --bs-border-color: var(--tm-border);
  --bs-border-radius: var(--tm-radius);
  --bs-border-radius-lg: var(--tm-radius-lg);
  --bs-tertiary-bg: var(--tm-bg-raised);
  --bs-secondary-bg: var(--tm-bg-raised);
  --bs-link-color: #5eead4;
  --bs-link-color-rgb: 94, 234, 212;
  --bs-link-hover-color: #99f6e4;
  --bs-link-hover-color-rgb: 153, 246, 228;
  --bs-font-sans-serif: var(--tm-font);
}

/* ---------- page ---------- */

body {
  font-family: var(--tm-font);
  color: var(--tm-text);
  background-color: var(--tm-bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(45, 212, 191, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 42, 133, 0.035), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--tm-font); letter-spacing: -0.01em; }
label { font-weight: 600; color: var(--tm-text); }

.content-window { background: transparent !important; }
main { font-size: 14px; }

/* style.css forces grey table text; on a dark page it needs to be light */
table tbody tr td { color: var(--tm-text) !important; }
.fc-dark-gray, .fc-md-gray { color: var(--tm-text-muted) !important; }
.fc-mint { color: var(--tm-accent) !important; }
.text-muted { color: var(--tm-text-muted) !important; }
::placeholder { color: #64748b !important; }

/* ---------- sign in / sign up: the form, centered on the page ---------- */

.sign-in-splash .row { justify-content: center; }
.sign-in-splash .sign-in-panel { background-color: transparent !important; }

/* ---------- top bar ---------- */

.top-bar {
  background: rgba(10, 15, 29, 0.72);
  backdrop-filter: saturate(160%) var(--tm-blur);
  -webkit-backdrop-filter: saturate(160%) var(--tm-blur);
  border-bottom: 1px solid var(--tm-border);
}
.top-bar .btn-light-gray {
  background: var(--tm-surface-hover);
  color: var(--tm-text);
  border: 1px solid var(--tm-border);
  border-radius: 10px;
}
.top-bar .btn-light-gray:hover { background: var(--tm-surface-strong); color: #ffffff; }
.profile-icon { color: var(--tm-text-muted); cursor: pointer; }
.profile-icon:hover { color: var(--tm-accent); }
.profile-icon { background: none; border: 0; padding: 0; line-height: 1; }
.profile-icon:focus-visible { outline: none; box-shadow: var(--tm-focus-ring); border-radius: 50%; }
/* The profile menu (includes/topbar.html): one card for every user type, the same surface and radius as the others */
.tm-profile-menu { min-width: 260px; max-width: min(320px, calc(100vw - 24px)); padding: 6px 0; }
.tm-profile-menu .tm-profile-head { padding: 8px 16px 10px; border-bottom: 1px solid var(--tm-border); margin-bottom: 6px; }
.tm-profile-name { font-weight: 600; color: var(--tm-text); overflow-wrap: anywhere; }
.tm-profile-role { margin: 4px 0; background: rgba(45, 212, 191, 0.14); color: var(--tm-turquoise); border: 1px solid rgba(45, 212, 191, 0.4); font-weight: 600; }
.tm-profile-email { font-size: 12px; color: var(--tm-text-muted); overflow-wrap: anywhere; }
.tm-profile-note { margin: 0 12px 6px; padding: 6px 10px; border-radius: 8px; font-size: 12px; color: var(--tm-text);
                   background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.45); display: flex; gap: 6px; align-items: flex-start; }
.tm-profile-menu .dropdown-item { display: flex; align-items: center; gap: 8px; }
.tm-profile-menu .dropdown-item .bi { width: 1.1em; color: var(--tm-text-muted); }
.tm-profile-menu .dropdown-divider { border-color: var(--tm-border); margin: 6px 0; }
.tm-profile-menu .tm-profile-signout, .tm-profile-menu .tm-profile-signout .bi { color: var(--tm-danger); }
html[data-tm-theme="light"] .tm-profile-role { color: #0f766e; }

/* ---------- sidebar drawer ---------- */

.side-bar.bg-dark-blue, .side-bar {
  background: rgba(12, 18, 34, 0.86) !important;
  backdrop-filter: var(--tm-blur);
  -webkit-backdrop-filter: var(--tm-blur);
  border-right: 1px solid var(--tm-border);
}
/* Open drawer is 235px; closed it's the 80px labelled rail (below), 0 on phones */
.side-bar.open, .side-bar.open .accordion { width: 235px; }
.side-bar .nav-link { width: auto !important; }
.accordion-button,
.accordion-button:not(.collapsed) {
  background-color: transparent;
  color: var(--tm-text);
  border-radius: 8px;
  border: none;
  border-left: 3px solid transparent;
  box-shadow: none;
  margin: 2px 6px;
  width: calc(100% - 12px);
  padding: 9px 30px 9px 9px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: background-color .15s ease, border-color .15s ease;
}
.accordion-button:hover { background-color: var(--tm-surface-hover); }
/* Chevron only on sections that open a sub-menu (single links are divs, not buttons) */
.side-bar button.accordion-button::after {
  display: block;
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  width: auto;
  height: auto;
  margin: 0;
  background-image: none;
  font-size: 12px;
  line-height: 1;
  color: var(--tm-text-muted);
  transform: translateY(-50%) rotate(0deg);
  transition: transform .2s ease;
}
.side-bar button.accordion-button:not(.collapsed)::after { transform: translateY(-50%) rotate(180deg); }
.accordion-body { background-color: transparent; padding: 0; }
.accordion a { color: var(--tm-text); }
.side-bar ul { list-style: none; margin: 0; padding: 0; }
.side-bar ul li a {
  display: block;
  margin: 1px 6px;
  padding: 7px 12px 7px 36px;
  border-left: 3px solid transparent;
  border-radius: 8px;
  color: var(--tm-text-muted);
  font-size: var(--tm-menu-font-size);
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.side-bar ul li a:hover, .side-bar ul li a:focus { color: #ffffff; background-color: var(--tm-surface-hover); }
/* The page you're on: turquoise edge and a faint turquoise wash */
.side-bar ul li a.active,
.side-bar .accordion-button.active {
  color: var(--tm-text);
  background-color: rgba(0, 242, 210, 0.08);
  border-left-color: var(--tm-turquoise);
}
.backdrop { background-color: #000000; }
.backdrop.active { opacity: 0.5; }

/* ---------- page headers: the flat mint banners become a quiet glass strip ---------- */

.content-window .container-fluid.bg-mint {
  background: transparent !important;
  border-bottom: 1px solid var(--tm-border);
  position: relative;
}
.content-window .container-fluid.bg-mint::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 120px;
  background: var(--tm-accent-gradient);
  border-radius: 2px;
}
.content-window .container-fluid.bg-mint h1 {
  color: var(--tm-text) !important;
  font-weight: 700;
  font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.1rem);
}

/* ---------- cards: translucent glass ---------- */

/* The title of a one-card page (errors, sign-in help, links from emails) */
.tm-card-title, #contentSection .tm-card-title { font-size: 1.25rem; font-weight: 600; margin: 0 0 .5rem; }
.card {
  --bs-card-bg: var(--tm-surface);
  --bs-card-border-color: var(--tm-border);
  --bs-card-border-radius: var(--tm-radius-lg);
  --bs-card-inner-border-radius: calc(var(--tm-radius-lg) - 1px);
  --bs-card-cap-bg: transparent;
  color: var(--tm-text);
  backdrop-filter: var(--tm-blur);
  -webkit-backdrop-filter: var(--tm-blur);
}

/* ---------- action cards: gradient border, lift on hover ---------- */

#homeBlueBoxes .card.flex-fill:not(.bg-blue) { background: transparent; border: none; backdrop-filter: none; }
#homeBlueBoxes .card.bg-blue,
#venueRequestCard,
.card.bg-blue {
  background:
    linear-gradient(var(--tm-bg-raised), var(--tm-bg-raised)) padding-box,
    var(--tm-accent-gradient) border-box !important;
  border: 1px solid transparent !important;
  border-radius: var(--tm-radius-lg);
  box-shadow: var(--tm-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
#homeBlueBoxes .card.bg-blue,
#venueRequestCard,
.card.bg-blue {
  background:
    linear-gradient(var(--tm-bg-raised), var(--tm-bg-raised)) padding-box,
    linear-gradient(var(--tm-border-strong), var(--tm-border-strong)) border-box !important;
  position: relative;
}
/* The bright border is a masked layer so it can fade in (gradients themselves can't be transitioned) */
#venueRequestCard::before,
.card.bg-blue::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--tm-accent-gradient);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
#homeBlueBoxes .card.bg-blue:hover,
#venueRequestCard:hover,
.card.bg-blue:hover {
  transform: translateY(-1px);
  box-shadow: var(--tm-shadow), 0 0 14px rgba(45, 212, 191, 0.12), 0 0 18px rgba(255, 42, 133, 0.10);
}
#venueRequestCard:hover::before,
.card.bg-blue:hover::before { opacity: 1; }
#homeBlueBoxes .card-header.bg-alt-blue {
  background: transparent !important;
  color: var(--tm-text-muted) !important;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--tm-border);
}
#homeBlueBoxes .hp-card-body { color: var(--tm-text); }
#homeBlueBoxes .bi-check-circle-fill { color: var(--tm-success); filter: drop-shadow(0 0 6px rgba(52, 211, 153, .5)); }

/* ---------- buttons ---------- */

.btn { border-radius: 10px; transition: transform .2s ease, box-shadow .25s ease, background-color .15s ease, background-position .4s ease, border-color .2s ease, color .15s ease; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--tm-bg), 0 0 0 4px rgba(255, 42, 133, 0.55); }

/* Primary CTAs (Send FCFS Blast, Submit Request, Confirm Selected): Turquoise fill, dark text, Magenta-tinged glow on hover */
.btn-blue,
.btn-blue:focus,
.btn-green,
.btn-green:focus {
  background: var(--tm-cta-fill);
  color: var(--tm-accent-ink);
  border: none;
  font-weight: 700;
}
.btn-blue:hover, .btn-blue:active,
.btn-green:hover, .btn-green:active {
  background: var(--tm-cta-fill);
  color: var(--tm-accent-ink);
  box-shadow: var(--tm-cta-glow);
}
.btn-blue:hover:not(:disabled), .btn-green:hover:not(:disabled) { transform: translateY(-1px); }
button.btn-blue:disabled { background: var(--tm-surface-strong) !important; color: var(--tm-text-muted) !important; border: none !important; }

button.btn-green:disabled { background: var(--tm-surface-strong) !important; color: var(--tm-text-muted) !important; }

/* Secondary actions (Send reminder, Edit, Filter, Download...): Turquoise outline, never grey. Only disabled
   buttons, Cancel and Close stay grey; the top bar's icon buttons keep their own look (.top-bar .btn-light-gray). */
.btn-light-gray, .btn-md-gray,
.btn-outline-secondary:not(.btn-cancel):not([data-bs-dismiss]) {
  background: rgba(45, 212, 191, 0.08);
  color: #ccfbf1;
  border: 1px solid rgba(45, 212, 191, 0.55);
}
.btn-light-gray:hover, .btn-md-gray:hover,
.btn-outline-secondary:not(.btn-cancel):not([data-bs-dismiss]):hover { background: rgba(45, 212, 191, 0.18); color: #ffffff; border-color: var(--tm-turquoise); }
.btn-light-gray:disabled, .btn-md-gray:disabled { background: var(--tm-surface-hover); color: var(--tm-text-muted); border-color: var(--tm-border); }

.btn-outline-white { border: 1px solid var(--tm-border-strong); color: var(--tm-text); background: var(--tm-surface); }
.btn-outline-white:hover { border-color: rgba(255, 255, 255, 0.35); background: var(--tm-surface-hover); color: #ffffff; }

.btn-outline-blue { background: transparent; border: 1px solid rgba(45, 212, 191, 0.45); color: #ccfbf1; }
.btn-outline-blue:hover { background: rgba(45, 212, 191, 0.08); color: #ffffff; border-color: var(--tm-turquoise); }
/* Cancel on edit forms: quiet glass outline beside the primary button */
/* Every pop-up's Close / Cancel (any button that dismisses a pop-up) is this quiet grey, whatever class it was given */
.btn-cancel, .btn[data-bs-dismiss] { background: transparent !important; border: 1px solid var(--tm-border-strong) !important; color: var(--tm-text-muted) !important; }
.btn-cancel:hover, .btn[data-bs-dismiss]:hover { background: var(--tm-surface-hover) !important; border-color: rgba(255, 255, 255, 0.35) !important; color: #ffffff !important; }
.btn-outline-gray { border-color: var(--tm-border-strong); color: var(--tm-text-muted); }
.btn-outline-danger { border-color: rgba(248, 113, 113, 0.5); color: var(--tm-danger); background: transparent; }
.btn-outline-danger:hover { background: rgba(248, 113, 113, 0.12); border-color: var(--tm-danger); color: #fecaca; }
.btn-link.text-danger { color: var(--tm-danger) !important; }
.btn-mint-dark { border: 1px solid var(--tm-border-strong); color: var(--tm-text); }
.btn-mint-dark:hover, .btn-mint-dark:focus, .btn-mint-dark:active { background: var(--tm-surface-hover); border-color: rgba(255, 255, 255, 0.35); color: #ffffff; }

/* ---------- status badges: soft fills with a glow ---------- */

.badge { border-radius: 999px; font-weight: 600; letter-spacing: .01em; padding: .4em .75em; }
.badge.bg-green { background: rgba(52, 211, 153, 0.16) !important; color: #6ee7b7; box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .4), 0 0 12px rgba(52, 211, 153, .25); }
.badge.bg-red { background: rgba(248, 113, 113, 0.16) !important; color: #fca5a5; box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .4), 0 0 12px rgba(248, 113, 113, .22); }
.badge.bg-yellow { background: rgba(251, 191, 36, 0.16) !important; color: #fcd34d; box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .4), 0 0 12px rgba(251, 191, 36, .2); }
.badge.bg-orange { background: rgba(251, 146, 60, 0.16) !important; color: #fdba74; box-shadow: inset 0 0 0 1px rgba(251, 146, 60, .4); }
.badge.bg-blue { background: rgba(45, 212, 191, 0.14) !important; color: #99f6e4; box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .4); }
.badge.bg-dark-gray, .badge.bg-gray { background: var(--tm-surface-strong) !important; color: var(--tm-text-muted); box-shadow: inset 0 0 0 1px var(--tm-border-strong); }
.badge.badge-gcal { background: rgba(255, 42, 133, 0.12) !important; color: #ffc2da; box-shadow: inset 0 0 0 1px rgba(255, 42, 133, .45); }
.find-replacement-gcal { color: #ffc2da; }
.pulse-circle { box-shadow: 0 0 0 0 rgba(248, 113, 113, .6); }

/* ---------- tables ---------- */

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--tm-text);
  --bs-table-border-color: var(--tm-border);
  --bs-table-hover-bg: var(--tm-surface-hover);
}
.events_list table {
  background: var(--tm-surface);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-lg);
  overflow: hidden;
}
.table.dataTable thead th,
.table thead th {
  background: var(--tm-surface-hover) !important;
  color: var(--tm-text-muted);
  border-bottom: 1px solid var(--tm-border);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.events_list table.dataTable thead .sorting_asc,
.events_list table.dataTable thead .sorting_desc { background: var(--tm-surface-strong) !important; color: var(--tm-text); }
.table tbody tr:hover td { background-color: var(--tm-surface-hover); }
.inactive-user, .inactive-user-icon::before { color: #64748b !important; }
table.dataTable.no-footer { border-bottom: none; }

/* pagination */
a.paginate_button { background: var(--tm-surface-hover); color: var(--tm-text) !important; border: 1px solid var(--tm-border); border-radius: 8px; }
a.paginate_button:hover { background: rgba(45, 212, 191, 0.15); color: #ffffff !important; }
a.paginate_button.current, a.current { background: var(--tm-turquoise); color: var(--tm-accent-ink) !important; border: none; font-weight: 700; }
a.paginate_button.disabled { opacity: .4; }

/* ---------- forms ---------- */

.form-control, .form-select {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: var(--tm-border-strong);
  color: var(--tm-text);
  border-radius: 10px;
}
.form-control, .form-select { transition: border-color .2s ease, box-shadow .2s ease; }
.form-control:focus, .form-select:focus {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 42, 133, 0.6);
  box-shadow: var(--tm-focus-ring);
  color: #ffffff;
}
/* locked / read-only fields */
.form-control.bg-light, .form-control[readonly] {
  background-color: rgba(255, 255, 255, 0.02) !important;
  color: var(--tm-text-muted) !important;
  border-style: dashed;
}
.form-check-input { background-color: rgba(255, 255, 255, 0.06); border-color: var(--tm-border-strong); }
.form-check-input:checked, .form-check-input:indeterminate { background-color: var(--tm-turquoise); border-color: var(--tm-turquoise); }
.form-check-input:focus { border-color: rgba(255, 42, 133, 0.6); box-shadow: var(--tm-focus-ring); }
/* Date and time fields: dark mode (data-bs-theme="dark" sets color-scheme: dark) already draws the browser's calendar
   and clock icons light, so they must not be inverted (that made them near-black and invisible on the dark field).
   Every date and time field is typed into (click puts the cursor in it); the calendar / clock icon opens the picker. */
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="month"], input[type="week"] { color-scheme: dark; }
/* An empty date box (formGuard.js sets data-empty): its mm/dd/yyyy guide is dimmed, so it reads as "Select date" */
input[data-empty]::-webkit-datetime-edit { opacity: .45; }
input[data-empty] { color: var(--tm-text-muted); }
input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.9; }
input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.input-group.bg-white { background: transparent !important; }

/* ---------- modals, dropdowns, alerts ---------- */

.modal-content {
  background: rgba(15, 22, 41, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--tm-border-strong);
  border-radius: var(--tm-radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  color: var(--tm-text);
}
.modal-header {
  background: transparent;
  color: var(--tm-text);
  border-bottom: 1px solid var(--tm-border);
  position: relative;
}
.modal-header::after {
  content: '';
  position: absolute;
  left: 16px;
  bottom: -1px;
  width: 64px;
  height: 2px;
  background: var(--tm-accent-gradient);
  border-radius: 2px;
}
.modal-footer { border-top: 1px solid var(--tm-border); }
.modal-backdrop.show { opacity: .65; }
/* The app's "are you sure?" pop-up (static/js/confirmBox.js): line breaks kept, and above any pop-up it was asked from */
.tm-confirm-text { white-space: pre-line; font-size: 14px; }
#tmConfirmModal .modal-body { padding: 1rem 1.1rem .5rem; }
#tmConfirmModal .modal-footer { padding: .5rem 1.1rem .9rem; border-top: 0; }
#tmConfirmModal .modal-footer .btn { font-size: var(--tm-menu-font-size); padding: 5px 14px; }
#tmConfirmModal .modal-dialog { max-width: 380px; }
#tmConfirmModal { z-index: 1075; }
.modal-backdrop + .modal-backdrop { z-index: 1070; }

.dropdown-menu {
  /* Every pop-up menu, every page and role: the sidebar's size, minimal */
  --bs-dropdown-font-size: var(--tm-menu-font-size);
  --bs-dropdown-padding-y: 4px;
  --bs-dropdown-min-width: 9rem;
  font-size: var(--tm-menu-font-size);
  background: rgba(15, 22, 41, 0.96);
  backdrop-filter: var(--tm-blur);
  border: 1px solid var(--tm-border-strong);
  border-radius: var(--tm-radius);
  box-shadow: var(--tm-shadow);
}
.dropdown-item { color: var(--tm-text); border-radius: 8px; margin: 0 6px; width: calc(100% - 12px); font-size: var(--tm-menu-font-size);
                 padding: var(--tm-menu-item-padding); line-height: 1.3; }
.dropdown-header { font-size: 11px; padding: 6px 18px 2px; }
.dropdown-divider { margin: 4px 0; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--tm-surface-hover); color: #ffffff; }

.alert { border-radius: var(--tm-radius); backdrop-filter: var(--tm-blur); }
.alert-blue {
  background: rgba(45, 212, 191, 0.06);
  border: 1px solid rgba(45, 212, 191, 0.3);
  color: var(--tm-text);
}

/* tabs and pills */
.nav-pills .nav-link { color: var(--tm-text-muted) !important; border-radius: 999px; }
.nav-pills .nav-link:hover { color: #ffffff !important; background: var(--tm-surface-hover); }
.nav-pills .nav-link { transition: background-color .2s ease, box-shadow .25s ease, color .15s ease; }
.nav-pills .nav-item .active, .confirm-tabs .nav-link.active {
  background: var(--tm-turquoise) !important;
  color: var(--tm-accent-ink) !important;
  font-weight: 700;
  box-shadow: none;
}
.confirm-tabs .badge { background: rgba(4, 18, 26, 0.18); color: inherit; box-shadow: none; }
/* Tabs and filter pills, everywhere: one row that scrolls sideways when it doesn't fit (Accounting Settings' tabs were
   cut off on phones; All artists' pills stacked into seven rows) */
.confirm-tabs, .nav-tabs, .nav-pills { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.confirm-tabs::-webkit-scrollbar, .nav-tabs::-webkit-scrollbar, .nav-pills::-webkit-scrollbar { display: none; }
.nav-tabs .nav-item, .nav-pills .nav-item { flex: 0 0 auto; }
/* Each tab and pill is as wide as its title: style.css gives every .nav-link a fixed 325px, which pushed Onboard User's
   pills off the row and cut the highlighted one */
.nav-tabs .nav-link, .nav-pills .nav-link { white-space: nowrap; width: auto !important; }
/* Artist Types pop-up: the counts line up, so every Save and Disable sits in the same place */
.artist-type-count { min-width: 5.5rem; }
/* Phones: small buttons are still easy to tap (36px, the size a fingertip needs) */
@media (max-width: 575.98px) {
  .btn-sm { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
}
.confirm-tabs .nav-link { white-space: nowrap; padding: .45rem .95rem; font-size: 14px; }
.batch-confirm-bar {
  background: rgba(45, 212, 191, 0.10) !important;
  border: 1px solid rgba(45, 212, 191, 0.45) !important;
  backdrop-filter: var(--tm-blur);
}

/* misc light surfaces from style.css */
.highlight-block { background: var(--tm-surface-hover); color: var(--tm-text-muted); }
.dropzone { background: var(--tm-surface) !important; border: 1px dashed var(--tm-border-strong) !important; color: var(--tm-text-muted) !important; }
.bg-highlight-change { background: rgba(251, 191, 36, 0.18) !important; color: #fde68a; }
hr { border-color: var(--tm-border); opacity: 1; }

/* FullCalendar (availability pages) */
.fc { --fc-border-color: var(--tm-border); --fc-page-bg-color: transparent; --fc-neutral-bg-color: var(--tm-surface); --fc-today-bg-color: rgba(45, 212, 191, 0.08); color: var(--tm-text); }

/* ---------- shared look classes (2026-10-25): used instead of inline colours, so the theme decides them ---------- */
.section-heading { font-size: 1rem; font-weight: 600; border-bottom: 1px solid var(--tm-border); padding: 0 0 5px 0; margin-bottom: .75rem; }
.section-heading.section-heading-lg { font-size: 1.25rem; margin-bottom: 1rem; }
.soft-card { background-color: var(--tm-surface-hover); color: var(--tm-text); }
.muted-note { color: var(--tm-text-muted); }
.link-accent { color: var(--tm-accent); text-decoration: none; font-weight: 700; }
.link-accent:hover { color: var(--tm-accent-2); }
.line-top { border-top: 1px solid var(--tm-border); }
.line-bottom { border-bottom: 1px solid var(--tm-border); }
.line-right { border-right: 1px solid var(--tm-border); }
.line-all { border: 1px solid var(--tm-border); }
/* A notice pinned to the bottom of the screen (saved, error): above the phone's home bar and the app's own banners */
.tm-sticky-alert { display: block; position: fixed; z-index: 999; width: 90%; left: 5%; bottom: 30px;
                   border: 1px solid var(--tm-border-strong); }
@media (max-width: 575.98px) { .tm-sticky-alert { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- mobile: tables become cards ---------- */
/* base.html adds .tm-cards and per-cell data-label attributes; tables marked .table-keep keep their own layout */

@media (max-width: 767.98px) {
  table.tm-cards { border: none !important; background: transparent !important; }
  table.tm-cards thead { display: none; }
  table.tm-cards, table.tm-cards tbody, table.tm-cards tr, table.tm-cards td { display: block; width: 100% !important; }
  table.tm-cards tr {
    margin-bottom: 12px;
    padding: 10px 14px;
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius-lg);
    background: var(--tm-surface);
    backdrop-filter: var(--tm-blur);
  }
  table.tm-cards tbody tr:hover td { background: transparent; }
  /* Label floats left, the cell's own content (which may be several lines) sits on the right */
  table.tm-cards td {
    padding: 6px 0 !important;
    border: none !important;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  table.tm-cards td::after { content: ''; display: block; clear: both; }
  table.tm-cards td::before {
    content: attr(data-label);
    float: left;
    margin-right: 16px;
    color: var(--tm-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 1.9;
    text-transform: uppercase;
    text-align: left;
  }
  table.tm-cards td:not([data-label])::before, table.tm-cards td[data-label=""]::before { display: none; }
  table.tm-cards td.dataTables_empty { text-align: center; }
  table.tm-cards td.dataTables_empty::before { display: none; }
}

/* ---------- universal booking tables: dropdown filters + phone cards (static/js/bookingTable.js) ---------- */

.booking-filters .bf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.booking-filters select { width: auto; min-width: 140px; max-width: 220px; }
.booking-filters .bf-count { color: var(--tm-text-muted); font-size: 13px; margin-left: auto; }
.booking-filters .bf-reset { flex: 0 0 auto; white-space: nowrap; }
.booking-filters:empty { display: none; }
/* Laptops and up: every filter fits on one line (Upcoming Bookings has seven dropdowns plus Reset and the count): each
   dropdown is as wide as its text, a size smaller, with tighter gaps */
@media (min-width: 992px) {
  .booking-filters .bf-row { gap: 6px; }
  .booking-filters select { min-width: 0; max-width: 175px; font-size: 13px; padding-top: 4px; padding-bottom: 4px;
                            padding-left: 8px; padding-right: 26px; background-position: right 8px center; }
  .booking-filters .bf-reset { font-size: 13px; padding: 4px 8px; }
  .booking-filters .bf-count { font-size: 12px; white-space: nowrap; }
}
td.bc-card, th.bc-card { display: none; }

@media (max-width: 767.98px) {
  /* Sticky, one swipeable row of dropdowns */
  .booking-filters {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-bottom: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
    background: rgba(10, 15, 29, 0.92);
    backdrop-filter: var(--tm-blur);
    -webkit-backdrop-filter: var(--tm-blur);
    border-bottom: 1px solid var(--tm-border);
  }
  .booking-filters .bf-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .booking-filters .bf-row::-webkit-scrollbar { display: none; }
  .booking-filters select { flex: 0 0 auto; min-width: 0; max-width: 170px; font-size: 13px; padding-top: 4px; padding-bottom: 4px; }
  .booking-filters .bf-count { flex: 0 0 auto; font-size: 12px; }

  /* One compact card per row: only the card cell (and a .bc-keep cell, e.g. a checkbox) shows */
  table.tm-cards.tm-booking-cards tr { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; padding: 7px 10px; }
  table.tm-cards.tm-booking-cards td { display: none; }
  table.tm-cards.tm-booking-cards td.bc-keep { display: block; flex: 0 0 auto; width: auto !important; padding: 2px 0 0 !important; }
  table.tm-cards.tm-booking-cards td.bc-keep::before { display: none; }
  table.tm-cards.tm-booking-cards td.bc-card,
  table.tm-cards.tm-booking-cards td.dataTables_empty { display: block; flex: 1 1 auto; min-width: 0; padding: 0 !important; text-align: left; }
  table.tm-cards.tm-booking-cards td.bc-card::before { display: none; }
  .bc-card .bc-line { display: flex; align-items: center; gap: 8px; line-height: 1.3; font-size: 13px; min-width: 0; }
  .bc-card .bc-line + .bc-line { margin-top: 2px; }
  .bc-card .bc-top { justify-content: space-between; }
  .bc-card .bc-venue { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bc-card .bc-id { flex: 0 0 auto; color: var(--tm-text-muted); font-size: 11px; }
  .bc-card .bc-when, .bc-card .bc-who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .bc-card .bc-when { color: var(--tm-text-muted); }
  .bc-card .bc-bottom { justify-content: space-between; flex-wrap: wrap; row-gap: 4px; margin-top: 4px; }
  .bc-card .bc-bottom:empty { display: none; }
  .bc-card .bc-bottom .badge { padding: .3em .6em; font-size: 11px; }
  .bc-card .bc-bottom .btn { padding: 2px 10px; font-size: 12px; }
  .bc-card .bc-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 8px; margin-left: auto; }

  /* Card menus must never be clipped: the table's scroll wrapper lets them overflow, and the card with an open menu
     sits above the cards, status pills and pagination below it */
  .bc-overflow-visible { overflow: visible !important; }
  table.tm-cards.tm-booking-cards tr { position: relative; }
  table.tm-cards.tm-booking-cards tr.bc-menu-open { z-index: 1055; }
  .bc-card .dropdown-menu { z-index: 1060; min-width: 10rem; }
  .bc-card .bc-bottom, .bc-card .bc-actions { overflow: visible; }
}

/* Find Replacement: someone ticked under "Why isn't someone listed?" will be sent the link */
/* Find Replacement: menu-sized text (13px, like the sidebar and dropdowns), small badges, tight rows */
#fcfsModal .modal-body { font-size: 14px; }
#fcfsModal .modal-body legend { font-size: 14px !important; }
.fcfs-candidate-list, #fcfsExclusions ul { font-size: 13px; line-height: 1.45; }
.fcfs-candidate-list .form-check { padding-top: 3px !important; padding-bottom: 3px !important; margin-bottom: 0; }
.fcfs-candidate-list .badge, #fcfsExclusions .badge { font-size: 10.5px; padding: 2px 6px; vertical-align: 1px; }
.fcfs-candidate-list .small, .fcfs-candidate-list .text-muted { font-size: 12px; }
.fcfs-exclusion .fcfs-override-note { display: none; }
.fcfs-exclusion.fcfs-override-selected { background: rgba(45, 212, 191, 0.08); border-left: 2px solid var(--tm-turquoise); padding-left: 6px; border-radius: 4px; }
.fcfs-exclusion.fcfs-override-selected .fcfs-override-note { display: inline-block; }

/* Header refresh button (phones) */
.top-bar .tm-refresh { padding: .15rem .5rem; line-height: 1.6; }
.top-bar .tm-refresh.spinning i { display: inline-block; animation: tm-spin .8s linear infinite; }
@keyframes tm-spin { to { transform: rotate(360deg); } }

/* ---------- pop-ups: never clipped or hidden under the next card (static/js/popups.js) ---------- */
.tm-popup-raised { z-index: 1055 !important; }
.tm-popup-positioned { position: relative !important; }
.tm-popup-unclipped { overflow: visible !important; }
.dropdown-menu.show { z-index: 1060; }

/* Lists inside phone-card cells (e.g. a venue user's venues): plain right-aligned lines, no stray bullets */
@media (max-width: 767.98px) {
  table.tm-cards td ul:not(.dropdown-menu), table.tm-cards td ol:not(.dropdown-menu) { list-style: none; margin: 0; padding: 0; display: inline-block; text-align: right; }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- motion: keep the colour changes, drop the lifts, for people who ask for less motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn, .card.bg-blue, #venueRequestCard, .card.bg-blue::before, #venueRequestCard::before { transition: none !important; }
  .btn:hover, .card.bg-blue:hover, #venueRequestCard:hover { transform: none !important; }
}

/* ---------- admin Home: Command Center (templates/preview_dashboard.html) ---------- */
.cc-section-title { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tm-text-muted); margin-bottom: .6rem; }
.cc-card {
  display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1rem 1.1rem;
  background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: var(--tm-radius);
  color: var(--tm-text); text-decoration: none; transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
a.cc-card:hover, a.cc-card:focus-visible { background: var(--tm-surface-hover); border-color: var(--tm-accent); color: var(--tm-text); transform: translateY(-1px); }
a.cc-card:focus-visible { outline: none; box-shadow: var(--tm-focus-ring); }
.cc-card-label { font-size: .9rem; font-weight: 600; color: var(--tm-text); }
.cc-card-count { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--tm-text); }
.cc-metric .cc-card-count { margin-top: auto; }
.cc-card-count-label { font-size: .8rem; font-weight: 500; color: var(--tm-text-muted); }
.cc-card-note { font-size: .8rem; color: var(--tm-text-muted); }
.cc-alert-active { border-color: rgba(248, 113, 113, .45); }
/* A card that filters the page's table (artist home: includes/cc_card.html alert_card with row_filter) looks and
   moves like a linked card; with nothing to filter it's a plain card */
button.cc-card { width: 100%; text-align: left; font: inherit; cursor: pointer; }
button.cc-card:hover, button.cc-card:focus-visible { background: var(--tm-surface-hover); border-color: var(--tm-accent); color: var(--tm-text); transform: translateY(-1px); }
button.cc-card:focus-visible { outline: none; box-shadow: var(--tm-focus-ring); }
button.cc-card:disabled { cursor: default; transform: none; background: var(--tm-surface); border-color: var(--tm-border); }
.cc-unread-dot {
  flex: none; width: .7rem; height: .7rem; margin-top: .3rem; border-radius: 50%;
  background: var(--tm-danger); box-shadow: 0 0 0 3px rgba(248, 113, 113, .2), 0 0 10px rgba(248, 113, 113, .6);
}
.cc-alert-badge { background: var(--tm-danger); color: #fff; }
.cc-watchlist { padding: .4rem 1.1rem; }
.cc-watchlist > p { padding: .6rem 0; }
.cc-watch-row + .cc-watch-row { border-top: 1px solid var(--tm-border); }
.cc-watch-row > a { padding: .65rem 0; color: var(--tm-text); text-decoration: none; }
.cc-watch-row > a:hover .cc-watch-venue { color: var(--tm-accent); }
.cc-watch-when { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 8.5rem; }
.cc-watch-venue { font-weight: 500; }
.cc-reason-unassigned, .cc-reason-needs-booking, .cc-reason-flagged, .cc-reason-late { background: var(--tm-danger); color: #fff; }
.cc-reason-unconfirmed { background: var(--tm-warning); color: var(--tm-accent-ink); }
/* Command Center watchlist: an instrumentalist's music for a DJ booking isn't approved yet (prominent, outlined red) */
.cc-reason-music { background: rgba(239, 68, 68, 0.15); color: var(--tm-danger); border: 1px solid var(--tm-danger); font-weight: 700; }
@media (max-width: 575.98px) {
  .cc-card-count { font-size: 1.6rem; }
  .cc-watch-when { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  a.cc-card:hover, a.cc-card:focus-visible { transform: none; }
}

/* ---------- Access Matrix (static/js/permissions.js) ---------- */
.tm-perm-hidden { display: none !important; }
.tm-read-only-banner { display: flex; align-items: center; gap: .5rem; padding: .55rem .9rem; margin-bottom: .75rem;
  border: 1px solid var(--tm-border-strong); border-radius: var(--tm-radius); background: var(--tm-surface); color: var(--tm-text-muted); font-size: .9rem; }
.perm-matrix .perm-section th { background: var(--tm-surface-strong); color: var(--tm-text-muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.perm-matrix .perm-level-head { white-space: nowrap; font-size: .8rem; }
.perm-matrix td { min-width: 4.5rem; }
.perm-matrix .form-check-input { width: 1.15rem; height: 1.15rem; cursor: pointer; }
.perm-matrix .form-check-input:disabled { cursor: not-allowed; }

/* ---------- Contact Artist ---------- */
.artist-message-text { white-space: pre-line; border-left: 3px solid var(--tm-accent); padding-left: .75rem; }

/* ---------- Venue SOP badges and viewer (templates/includes/sop_viewer.html) ---------- */
.sop-badge { border: 1px solid var(--tm-border-strong); background: var(--tm-surface); color: var(--tm-text); font-size: .78rem; font-weight: 600; padding: .35em .6em; cursor: pointer; }
.sop-badge-required { border-color: rgba(248, 113, 113, .6); color: var(--tm-danger); }
.sop-badge-confirmed { border-color: rgba(52, 211, 153, .5); color: var(--tm-success); }
.sop-badge:focus-visible { outline: none; box-shadow: var(--tm-focus-ring); }
/* Music pills sit beside the SOP badge, same size and shape (artist dashboard) */
.venue-pills, .badge-group {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  margin-top: 4px;
}
/* Artist booking tables (same columns as staff and client): the venue's address in small print under its name, and
   the row's pills (View SOP, Add Feedback, Confirm, Complete Reminder, music, Guest List) in the right-hand column */
#mainTable td.venue-col .venue-address { margin-top: 2px; }
#mainTable th.select-col { width: 40px; }
#mainTable td.booking-actions .venue-pills, #mainTable td.booking-actions .row-actions { justify-content: flex-end !important; margin-top: 0; }
/* Each pill keeps its own width on the one row: never stretched, stacked or given its own line */
.venue-pills > *, .badge-group > * { flex: 0 0 auto; width: auto; margin: 0 !important; display: inline-flex; align-items: center; white-space: nowrap; }
.music-badge-share { background: var(--tm-turquoise); border-color: var(--tm-turquoise); color: var(--tm-accent-ink); }
.music-badge-revise { border-color: rgba(248, 113, 113, .6); color: var(--tm-danger); }
.music-badge-approved { border-color: rgba(52, 211, 153, .5); color: var(--tm-success); }
.music-badge-review { color: var(--tm-text-muted); }
.music-badge-locked { background: var(--tm-bg, #0b1120); color: var(--tm-text-muted); cursor: default; }
.music-badge:disabled { opacity: .85; }
/* In-row actions (artist dashboard): Complete Reminder / Add Feedback, then done */
.todo-badge-due { background: var(--tm-turquoise); border-color: var(--tm-turquoise); color: var(--tm-accent-ink); }
.todo-badge-done { border-color: rgba(52, 211, 153, .5); color: var(--tm-success); cursor: default; }
/* 5-star picker: highest first in the markup, shown left to right; hovering or picking lights that star and those before it */
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; font-size: 1.8rem; line-height: 1; }
.star-input label { color: var(--tm-border-strong); cursor: pointer; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #facc15; }
.star-input input:focus-visible + label { outline: 2px solid var(--tm-turquoise); border-radius: 4px; }
.sop-viewer-body { display: flex; flex-direction: column; gap: .75rem; }
.sop-frame { display: block; width: 100%; flex: 1 1 auto; height: min(68vh, 680px); min-height: 320px; border: 1px solid var(--tm-border); border-radius: var(--tm-radius); background: #fff; }
.sop-frame[hidden], .sop-text[hidden] { display: none; }
.sop-text { max-height: 60vh; overflow-y: auto; }
.sop-agree { padding-top: .75rem; border-top: 1px solid var(--tm-border); }

/* ---------- GPS Attendance Settings (templates/dashboards/dashboards_gps_settings.html) ---------- */
.gps-table .gps-coordinate { min-width: 7.5rem; }
/* Global check-ins off: every row switch is on hold */
.gps-overridden .gps-row-switch { opacity: 0.5; pointer-events: none; }

/* ---------- Command Center card grids: fluid, auto-fitting, never one card left alone on a row ---------- */
/* Every card row: as many columns of at least 240px as fit, sharing the width. min(100%, ...) keeps a single
   column on phones narrower than the minimum, so nothing is clipped. */
.cc-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--cc-card-min, 240px)), 1fr)); }
.cc-grid-item { min-width: 0; }
/* Balanced card grids (card_grid_style() in utilities.py sets the columns): rows fill evenly at every screen size, and
   where a row would hold a single card, that last card spans the row. Phones: one card per row. */
.cc-grid.cc-grid-balanced { grid-template-columns: repeat(var(--cc-cols-wide, 4), minmax(0, 1fr)); }
.cc-grid.cc-grid-balanced > .cc-grid-item:last-child { grid-column: var(--cc-last-wide, auto); }
@media (min-width: 992px) and (max-width: 1199.98px) {
  .cc-grid.cc-grid-balanced { grid-template-columns: repeat(var(--cc-cols-desk, 4), minmax(0, 1fr)); }
  .cc-grid.cc-grid-balanced > .cc-grid-item:last-child { grid-column: var(--cc-last-desk, auto); }
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .cc-grid.cc-grid-balanced { grid-template-columns: repeat(var(--cc-cols-tablet, 3), minmax(0, 1fr)); }
  .cc-grid.cc-grid-balanced > .cc-grid-item:last-child { grid-column: var(--cc-last-tablet, auto); }
}
@media (min-width: 576px) and (max-width: 767.98px) {
  .cc-grid.cc-grid-balanced { grid-template-columns: repeat(var(--cc-cols-small, 2), minmax(0, 1fr)); }
  .cc-grid.cc-grid-balanced > .cc-grid-item:last-child { grid-column: var(--cc-last-small, auto); }
}
@media (max-width: 575.98px) {
  .cc-grid.cc-grid-balanced { grid-template-columns: minmax(0, 1fr); }
  .cc-grid.cc-grid-balanced > .cc-grid-item:last-child { grid-column: auto; }
}
.cc-grid-item > .cc-card { height: 100%; }
/* Alerts (up to 5 cards): at 240px a ~1116px laptop row fits only 4 and leaves the 5th alone, so these go down to
   172px: all 5 side by side from 992px screens up (a 936px row), 3 + 2 on tablets, one per row on phones */
.cc-grid-alerts { --cc-card-min: 172px; }
.cc-grid-alerts .cc-card-label { overflow-wrap: anywhere; }
/* Rows of 4 (Pipeline, Quick Actions): 4 across on desktops, 2 + 2 on tablets, one per row on phones */
@media (min-width: 576px) and (max-width: 991.98px) {
  .cc-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Alerts on tablets: 3 + 2 (auto-fit would make 2 + 2 + 1 between 576 and 767px); phones: one per row */
@media (min-width: 576px) and (max-width: 991.98px) {
  .cc-grid-alerts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .cc-grid-alerts, .cc-grid-4 { grid-template-columns: minmax(0, 1fr); }
}


/* ---------- sidebar single links (Home, and artist/venue pages): the whole row, icon included, is the link ---------- */
/* On phones people tap the house icon or the row, not just the word, so the link's hit area covers the row. */
.side-bar .accordion-button { position: relative; display: flex; align-items: center; gap: 12px; }
.side-bar .accordion-header .accordion-button { line-height: 1.25; }   /* sections sit in an <h2>, single links in a <div>: one line height for both */
.side-bar .accordion-button i { margin: 0; }
.side-bar .single-item { margin: 0; padding: 0; }   /* every row the same height: style.css padded single links by 14px */
.side-bar .single-item::after { content: ""; position: absolute; inset: 0; z-index: 1; }

/* ---------- Feedback phone cards (Venue Feedback and Artist Feedback): start date/time first, when it was left last ---------- */
@media (max-width: 767.98px) {
  .vf-card .vf-when { font-size: 14px; }
  .vf-card .vf-stars { font-size: 15px; letter-spacing: 1px; }
  .vf-card .vf-note { display: block; white-space: normal; color: var(--tm-text); }
  .vf-card .vf-created { color: var(--tm-text-muted); font-size: 11px; margin-top: 4px; }
  .vf-card .vf-stars .btn { padding: 2px 12px; font-size: 12px; }
  .vf-card .vf-history { text-align: left; font-size: 12px; }
  .vf-card .vf-history .review-history { margin-top: 2px !important; }
  table.tm-cards.tm-booking-cards tbody tr:has(> td.bc-whole) { cursor: default; }
}
/* Star ratings (includes/_widgets.html star_rating) always stay on one line */
.tm-star-rating { white-space: nowrap; }

/* ---------- compact phone cards on list pages (users, venues, requests, holds, activity, overlaps, SOPs) ---------- */
/* The row's own Actions cell (td.bc-end) stays visible at the right of its card, so menus aren't duplicated */
@media (max-width: 767.98px) {
  table.tm-cards.tm-booking-cards td.bc-end { display: block; order: 2; flex: 0 0 auto; width: auto !important; padding: 2px 0 0 !important; text-align: right; }
  table.tm-cards.tm-booking-cards td.bc-end::before { display: none; }
  .bc-card .bc-muted { color: var(--tm-text-muted); font-size: 11px; }
  .bc-card .bc-note { display: block; white-space: normal; }
  .bc-card .bc-badges { flex-wrap: wrap; gap: 4px; }
  .bc-card .bc-badges:empty { display: none; }
  .bc-card .bc-badges .badge, .bc-card .bc-top .badge { font-size: 11px; padding: .3em .6em; }
}

/* Set Availability: the bulk action bar stays in view while scrolling; rows with unsaved bulk changes are marked */
.availability-bulk-bar { position: sticky; top: 0; z-index: 5; }
tr.availability-unsaved > td { background-color: rgba(250, 204, 21, 0.06); }

/* ---------- Accounting Review: the 16-column audit table scrolls sideways inside its .table-responsive wrapper ---------- */
/* Compact cells on one line each, so no column is cut off at the screen's right edge; long comments are truncated
   (the full text is in the cell's title, and in the box while editing) */
.accounting-table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.accounting-table { width: max-content; min-width: 100%; margin-bottom: 0; }
.accounting-table > :not(caption) > * > th,
.accounting-table > :not(caption) > * > td { padding: .3rem .5rem; white-space: nowrap; vertical-align: middle; }
.accounting-table > :not(caption) > * > td.cell-notes { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
.accounting-table > :not(caption) > * > td.cell-notes:has(textarea) { max-width: none; overflow: visible; }

/* Accounting & Rates Settings tabs: all four on one row, each as wide as its title (style.css gives every .nav-link a
   fixed 325px, which wrapped Xero Chart of Accounts onto a second row); on a narrow screen the row scrolls sideways */
#accountingSettingsTabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
#accountingSettingsTabs .nav-item { flex: 0 0 auto; }
#accountingSettingsTabs .nav-link { width: auto !important; white-space: nowrap; padding: .5rem 1rem; }

/* Venue users: the searchable venue checkbox list (templates/includes/venue_checkbox_list.html) */
.venue-checkbox-container { max-height: 280px; overflow-y: auto; border: 1px solid var(--tm-border-strong); border-radius: 8px; padding: 12px; }
.venue-checkbox-item { display: flex; align-items: flex-start; gap: 10px; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.venue-checkbox-item:hover { background: var(--tm-surface); }
.venue-checkbox-item .form-check-input { margin-top: .2rem; flex: 0 0 auto; }
.venue-checkbox-name { display: block; }
.venue-checkbox-address { display: block; font-size: 12px; color: var(--tm-text-muted); }
.venue-search { flex: 1 1 12rem; min-width: 0; }
/* includes/view_bar.html: tabs, buttons and search on one row */
.tm-view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.tm-view-bar .tm-view-search { flex: 1 1 16rem; width: auto; min-width: 0; }

/* ---------- Data tables: one spec on every portal ---------- */
/* Top bar (title, primary action, Download, search) > filter bar (dropdowns and one Reset, tableFilters.js /
   bookingTable.js) > the table: compact cells, headers that sort on one click, and badges side by side */
@media (min-width: 768px) {
  table.tm-booking-cards > :not(caption) > * > th,
  table.tm-booking-cards > :not(caption) > * > td { padding: .4rem .45rem; vertical-align: middle; }
  table.tm-booking-cards > thead > tr > th.sorting,
  table.tm-booking-cards > thead > tr > th.sorting_asc,
  table.tm-booking-cards > thead > tr > th.sorting_desc { cursor: pointer; }
}
.tm-badges, .bc-badges { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }


/* ---------- Closed sidebar (the 80px labelled icon rail on tablets and desktops) ---------- */
/* Icons only, centred: labels, chevrons and sub-menus wait for the drawer to open, so nothing is cut off at the
   rail's edge. Labels shrink to zero size rather than display: none, so screen readers still read each link and the
   Home / page rows stay one tap to their page. */
.side-bar:not(.open) .accordion { width: 100%; }
.side-bar:not(.open) .accordion-button { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
.side-bar:not(.open) .accordion-button i { font-size: 15px; }
.side-bar:not(.open) .nav-text { font-size: 0; letter-spacing: 0; }
.side-bar:not(.open) .single-item { flex-grow: 0; }   /* single links (Home, artist and venue pages) don't push their icon left */
.side-bar:not(.open) button.accordion-button::after { display: none; }
.side-bar:not(.open) .accordion-collapse { display: none; }


/* ---------- Phone cards (< 768px): full labels, never "Vie…" ---------- */
/* Line 1: venue (left), booking # and status (right). Line 2: date and time. Then the action buttons and pills as one
   full-width row at the base of the card that wraps instead of squeezing: no fixed or percentage widths, no ellipsis
   on a button or pill. Only the venue name and the date / who lines may trim, and they wrap before trimming a word. */
@media (max-width: 767.98px) {
  .bc-card .bc-top { justify-content: flex-start; flex-wrap: wrap; row-gap: 2px; }
  .bc-card .bc-top .bc-venue { margin-right: auto; white-space: normal; overflow: visible; }
  .bc-card .bc-top .badge.bc-status { flex: 0 0 auto; font-size: 11px; padding: .3em .6em; white-space: nowrap; }
  .bc-card .bc-when, .bc-card .bc-who { white-space: normal; overflow: visible; }
  .bc-card .bc-bottom .bc-actions { flex: 1 1 100%; justify-content: flex-start; margin-left: 0; gap: 6px; }
  .bc-card .bc-bottom .btn, .bc-card .bc-bottom .badge, .bc-card .badge-group > * {
    flex: 0 0 auto; width: auto; max-width: none; overflow: visible; text-overflow: clip; white-space: nowrap;
  }
  .badge-group, .venue-pills { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; max-width: 100%; }
  /* Notice and help text spans the device */
  .notice-text, .content-window .card-body > span { width: 100%; max-width: 100%; }
}


/* ---------- Set Availability on phones (< 768px): one card per shift, no "DATE: / HOURS:" labels ---------- */
/* Top: the date, with the row's checkbox top right. Middle: the shift and hours, with its status badge on the right.
   Bottom: Set Availability and Add Note side by side. The batch menu always shows its whole label. */
.bulk-actions-toggle { min-width: auto; padding: 6px 12px; white-space: nowrap; }
@media (max-width: 767.98px) {
  table.availability-table thead { display: none; }
  table.availability-table, table.availability-table tbody { display: block; width: 100%; }
  table.availability-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date check" "hours status" "set note";
    align-items: center; gap: 6px 10px; margin-bottom: 8px; padding: 10px 12px;
    border: 1px solid var(--tm-border); border-radius: 12px; background: var(--tm-surface);
  }
  table.availability-table td { display: block; padding: 0 !important; border: 0; width: auto !important; text-align: left; }
  table.availability-table td::before { display: none; }
  table.availability-table td.av-date { grid-area: date; font-weight: 600; font-size: 14px; }
  table.availability-table td.av-check { grid-area: check; justify-self: end; }
  table.availability-table td.av-hours { grid-area: hours; color: var(--tm-text-muted); font-size: 13px; }
  table.availability-table td.av-status { grid-area: status; justify-self: end; text-align: right; }
  table.availability-table td.av-set { grid-area: set; justify-self: start; }
  table.availability-table td.av-note { grid-area: note; justify-self: end; }
  table.availability-table td.av-note:empty { display: none; }
  table.availability-table .btn { white-space: nowrap; }
}


/* ---------- Long text in tables (static/js/longText.js): two lines, then "Read more" opens the whole text ---------- */
.tm-clamp-text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; white-space: normal; overflow-wrap: anywhere; max-width: 32rem;
}
.tm-read-more { display: inline-block; padding: 0; margin-top: 2px; border: 0; background: none; color: var(--tm-turquoise);
  font-size: 12px; font-weight: 600; cursor: pointer; }
.tm-read-more:hover, .tm-read-more:focus-visible { text-decoration: underline; outline: none; }
.tm-long-text-full { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.55; }

/* ---------- Phone cards never collapse into a one-letter column ---------- */
/* A row's own Actions / review cell (td.bc-end) sits beside its card, but it may never squeeze the card: the card keeps
   at least 60% of the row, and a wide cell wraps to its own line underneath instead. Overlapping Bookings' Admin Review
   (Approved by ... on ..., Approve / Revoke) always goes underneath, full width. */
@media (max-width: 767.98px) {
  table.tm-cards.tm-booking-cards tr { flex-wrap: wrap; }
  table.tm-cards.tm-booking-cards td.bc-card { min-width: 60%; flex-basis: 60%; }
  table.tm-cards.tm-booking-cards td.bc-end { max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
  table.tm-cards.tm-booking-cards td.bc-end.overlap-review {
    order: 3; flex: 1 1 100%; width: 100% !important; text-align: left; padding-top: 6px !important;
    border-top: 1px solid var(--tm-border);
  }
  table.tm-cards.tm-booking-cards td.overlap-review .overlap-stamp { white-space: normal; }
}

/* ---------- Light mode (the sun / moon button in the top bar; static/js/sidebar.js tmToggleTheme) ---------- */
/* Dark is the default. Light swaps the design tokens, Bootstrap's own colours (data-bs-theme="light") and the few
   places the dark design used fixed colours. The choice is remembered on each device. */
html[data-tm-theme="light"] {
  --tm-bg: #f4f6fa;
  --tm-bg-raised: #ffffff;
  --tm-surface: rgba(15, 23, 42, 0.03);
  --tm-surface-hover: rgba(15, 23, 42, 0.06);
  --tm-surface-strong: rgba(15, 23, 42, 0.09);
  --tm-border: rgba(15, 23, 42, 0.10);
  --tm-border-strong: rgba(15, 23, 42, 0.18);
  --tm-text: #0f172a;
  --tm-text-muted: #556070;
  --tm-turquoise: #0d9488;
  --tm-accent: #0d9488;
  --tm-success: #059669;
  --tm-danger: #dc2626;
  --tm-warning: #b45309;
}
html[data-tm-theme="light"] [data-bs-theme="light"], html[data-tm-theme="light"][data-bs-theme="light"] {
  --bs-body-bg: var(--tm-bg);
  --bs-body-color: var(--tm-text);
  --bs-secondary-color: var(--tm-text-muted);
  --bs-emphasis-color: #000000;
  --bs-border-color: var(--tm-border);
  --bs-tertiary-bg: #ffffff;
  --bs-secondary-bg: #ffffff;
  --bs-link-color: #0f766e;
  --bs-link-color-rgb: 15, 118, 110;
  --bs-link-hover-color: #115e59;
  --bs-link-hover-color-rgb: 17, 94, 89;
  --bs-font-sans-serif: var(--tm-font);
}
html[data-tm-theme="light"] body { background-image: radial-gradient(1200px 600px at 85% -10%, rgba(13, 148, 136, 0.06), transparent 60%); }
html[data-tm-theme="light"] .top-bar { background: rgba(255, 255, 255, 0.88); }
html[data-tm-theme="light"] .side-bar.bg-dark-blue, html[data-tm-theme="light"] .side-bar { background: rgba(255, 255, 255, 0.95) !important; }
html[data-tm-theme="light"] .backdrop { background-color: #0f172a; }
html[data-tm-theme="light"] .modal-content, html[data-tm-theme="light"] .dropdown-menu { background: rgba(255, 255, 255, 0.98); }
html[data-tm-theme="light"] .form-control, html[data-tm-theme="light"] .form-select { background-color: #ffffff; }
html[data-tm-theme="light"] .form-control:focus, html[data-tm-theme="light"] .form-select:focus { background-color: #ffffff; color: var(--tm-text); }
html[data-tm-theme="light"] .form-control.bg-light, html[data-tm-theme="light"] .form-control[readonly] { background-color: var(--tm-surface) !important; }
html[data-tm-theme="light"] .form-check-input:not(:checked):not(:indeterminate) { background-color: #ffffff; }
@media (max-width: 767.98px) {
  html[data-tm-theme="light"] .booking-filters { background: rgba(244, 246, 250, 0.96); }
}
/* Hover text that was white on dark */
html[data-tm-theme="light"] .top-bar .btn-light-gray:hover, html[data-tm-theme="light"] .side-bar ul li a:hover,
html[data-tm-theme="light"] .side-bar ul li a:focus, html[data-tm-theme="light"] .btn-light-gray:hover,
html[data-tm-theme="light"] .btn-md-gray:hover, html[data-tm-theme="light"] .btn-outline-white:hover,
html[data-tm-theme="light"] .btn-outline-blue:hover, html[data-tm-theme="light"] .btn-outline-secondary:hover,
html[data-tm-theme="light"] .btn-cancel:hover, html[data-tm-theme="light"] .btn-mint-dark:hover,
html[data-tm-theme="light"] .dropdown-item:hover, html[data-tm-theme="light"] .dropdown-item:focus,
html[data-tm-theme="light"] .nav-pills .nav-link:hover, html[data-tm-theme="light"] a.paginate_button:hover { color: var(--tm-text) !important; }
html[data-tm-theme="light"] .btn-outline-white { color: var(--tm-text); border-color: var(--tm-border-strong); }
html[data-tm-theme="light"] .btn-outline-blue,
html[data-tm-theme="light"] .btn-light-gray:not(:disabled):not([data-bs-dismiss]), html[data-tm-theme="light"] .btn-md-gray:not(:disabled):not([data-bs-dismiss]),
html[data-tm-theme="light"] .btn-outline-secondary:not(.btn-cancel):not([data-bs-dismiss]) { color: #0f766e; }
html[data-tm-theme="light"] .top-bar .btn-light-gray { color: var(--tm-text); }
/* Page titles were white on the dark banner; close buttons were white */
html[data-tm-theme="light"] .content-window .container-fluid.bg-mint .text-white,
html[data-tm-theme="light"] .content-window h1.text-white, html[data-tm-theme="light"] .modal-content .text-white:not(.btn):not(.badge) { color: var(--tm-text) !important; }
html[data-tm-theme="light"] .btn-close-white { filter: none; }
html[data-tm-theme="light"] .pwa-install-banner { background: rgba(255, 255, 255, 0.98); color: var(--tm-text); }
html[data-tm-theme="light"] .pwa-install-banner .btn-close { filter: none; }
/* The logo: the light (white) wordmark on dark, the dark one on light */
.tm-logo-for-light { display: none; }
html[data-tm-theme="light"] .tm-logo-for-dark { display: none; }
html[data-tm-theme="light"] .tm-logo-for-light { display: inline; }
.tm-theme-toggle .bi-sun { display: none; }
html[data-tm-theme="light"] .tm-theme-toggle .bi-sun { display: inline; }
html[data-tm-theme="light"] .tm-theme-toggle .bi-moon-stars { display: none; }
/* Status badges: the pale text and glow made for dark backgrounds wash out on light, so darker text and no glow */
html[data-tm-theme="light"] .badge.bg-green { background: rgba(16, 185, 129, 0.14) !important; color: #047857; box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .45); }
html[data-tm-theme="light"] .badge.bg-red { background: rgba(239, 68, 68, 0.12) !important; color: #b91c1c; box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .45); }
html[data-tm-theme="light"] .badge.bg-yellow { background: rgba(245, 158, 11, 0.16) !important; color: #92400e; box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .5); }
html[data-tm-theme="light"] .badge.bg-orange { background: rgba(249, 115, 22, 0.14) !important; color: #9a3412; box-shadow: inset 0 0 0 1px rgba(249, 115, 22, .45); }
html[data-tm-theme="light"] .badge.bg-blue { background: rgba(13, 148, 136, 0.12) !important; color: #0f766e; box-shadow: inset 0 0 0 1px rgba(13, 148, 136, .45); }
/* Found by the light-mode contrast check (every admin page) */
/* Count bubbles on the selected tab: dark ink on the turquoise pill, in both modes */
.nav-pills .nav-link.active .badge { background: rgba(4, 18, 26, 0.18) !important; color: var(--tm-accent-ink) !important; box-shadow: none; }
/* Overlap gap badges (style.css's pale green / red fills): dark text, readable in both modes */
.badge.bg-light-green, .badge.bg-light-red { color: #10230a; }
/* Star ratings: gold and pale grey disappear on white, so deeper amber and slate in light mode */
html[data-tm-theme="light"] .active-star { color: #d97706; }
html[data-tm-theme="light"] .star { color: #b6bfcc; }
html[data-tm-theme="light"] .star-input input:checked ~ label, html[data-tm-theme="light"] .star-input label:hover,
html[data-tm-theme="light"] .star-input label:hover ~ label { color: #d97706; }

/* Client Communications: one line per venue, its contacts beside it as checkboxes */
.contact-venue { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 14px; padding: 8px 4px; border-bottom: 1px solid var(--tm-border); }
.contact-venue:last-child { border-bottom: 0; }
.contact-venue-name { display: flex; align-items: center; gap: 8px; flex: 0 0 13rem; max-width: 100%; cursor: pointer; }
.contact-venue-people { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 14rem; min-width: 0; }
.contact-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--tm-border-strong);
  border-radius: 999px; font-size: 13px; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; }
.contact-chip:has(input:checked) { border-color: var(--tm-turquoise); background: rgba(45, 212, 191, 0.10); }

/* ---------- bulk actions on admin tables (static/js/bulkSelect.js) ---------- */
.bulk-bar { position: sticky; top: 64px; z-index: 5; padding: 8px 12px; border-radius: var(--tm-radius); background: var(--tm-surface);
            border: 1px solid var(--tm-turquoise); }
tr.bulk-selected > td { background: rgba(45, 212, 191, 0.08) !important; }
.bulk-check { cursor: pointer; vertical-align: middle; }
/* Banned (bans.py): stands apart from Inactive */
.badge.user-banned { background: #18181b !important; color: #fca5a5; box-shadow: inset 0 0 0 1px #ef4444; }

/* Every Actions menu button (includes/_widgets.html actions_toggle): only ⋮, same colors as before */
.btn.tm-actions-toggle { padding: .2rem .3rem; line-height: 1; }
/* Combos (static/js/bookingTable.js comboHtml): "Plays with ... [music status]" under the artist on admin booking tables */
.combo-line { color: var(--tm-text-muted); margin-top: 2px; white-space: normal; }
.combo-line .badge { font-size: .7em; vertical-align: middle; }
/* Only an arrow right after the artist's name; it opens the line below (bookingTable.js comboToggle) */
.combo-toggle { display: inline; padding: 0 0 0 4px; border: 0; font-size: .75em; line-height: 1; vertical-align: baseline; color: var(--tm-text-muted); text-decoration: none; }
.combo-toggle:hover, .combo-toggle:focus { filter: brightness(1.25); }
.combo-toggle.combo-green { color: var(--tm-success); }
.combo-toggle.combo-amber { color: var(--tm-warning); }
.combo-toggle.combo-red { color: var(--tm-danger); }
.bc-card .bc-line.bc-combo { display: block; white-space: normal; }
/* Every booking table, every role: one line per cell on desktop (the table scrolls sideways if it must); long free
   text is cut with "…", full text on hover (bookingTable.js clipLongText). Phones use cards. */
@media (min-width: 768px) {
  table.tm-booking-cards > tbody > tr > td { white-space: nowrap; }
  /* Headings may break ("START / TIME") and no column keeps a width set when the table was built, so a column is as
     wide as what's in it (times and dates stay narrow) and the table fits without scrolling sideways */
  table.tm-booking-cards > thead > tr > th { white-space: normal; width: auto !important; }
  table.tm-booking-cards > tbody > tr > td.bt-clip { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
  table.tm-booking-cards td.venue-col .venue-address { display: inline; margin: 0 0 0 .5rem; }
  /* The column that gives (bookingTable.js clipLongText): whatever width is left, its text cut with "…", so the table
     always fits its box */
  table.tm-booking-cards > thead > tr > th.bt-flex { width: 100% !important; max-width: 0; }
  table.tm-booking-cards > tbody > tr > td.bt-flex { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }
  table.tm-booking-cards > tbody > tr > td.bt-flex .tm-clamp-text { display: block; max-width: 100%; }
}
/* Desktop booking tables: long text is one line cut with "…" (click it for the whole text, longText.js), stars are small */
@media (min-width: 768px) {
  table.tm-booking-cards > tbody > tr > td .tm-clamp-text {
    display: inline-block; vertical-align: bottom; -webkit-line-clamp: unset; line-clamp: unset; white-space: nowrap;
    text-overflow: ellipsis; overflow-wrap: normal; max-width: 14rem; cursor: pointer; }
  table.tm-booking-cards > tbody > tr > td .tm-read-more { display: none; }
  table.tm-booking-cards > tbody > tr > td:not(.bc-card) .tm-star-rating span { font-size: 15px !important; }
  table.tm-booking-cards .vf-stars-cell { width: auto; line-height: 1; }
}
/* Laptop screens: a touch smaller so a full booking table fits beside the sidebar */
@media (min-width: 768px) and (max-width: 1599.98px) {
  table.tm-booking-cards > tbody > tr > td { font-size: .875rem; }
  table.tm-booking-cards > tbody > tr > td .badge { font-size: .7rem; }
}

/* Artist Availability (dashboards_artist_availability.html): the table's rows laid out as a grid of cards */
/* A table only grows to its content: as a block it takes the page's full width, so the grid gets every column */
table.availability-cards { display: block; width: 100% !important; }
table.availability-cards thead { display: none; }
table.availability-cards tbody { display: grid; width: 100%; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
table.availability-cards tbody tr { display: block; background: transparent; }
table.availability-cards tbody td { display: block; padding: 0; border: 0; background: transparent; }
table.availability-cards tbody td.dataTables_empty { grid-column: 1 / -1; padding: 16px; color: var(--tm-text-muted); }
.availability-card { display: flex; flex-direction: column; gap: 10px; height: 100%; color: var(--tm-text); text-decoration: none; }
.availability-week { display: flex; gap: 4px; }
.availability-night { flex: 1; display: inline-flex; flex-direction: column; align-items: center; padding: 3px 0; border-radius: 6px;
                      font-size: 11px; line-height: 1.2; border: 1px solid var(--tm-border); }
.availability-night .night-date { font-weight: 600; font-size: 12px; }
.availability-night.night-yes { background: rgba(52, 211, 153, 0.18); border-color: rgba(52, 211, 153, 0.55); }
.availability-night.night-booked { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.6); }
.availability-night.night-no { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.45); }
.availability-night.night-none { color: var(--tm-text-muted); }
.availability-night.legend { display: inline-block; width: 14px; height: 14px; padding: 0; vertical-align: middle; flex: none; }


/* ---------- Labelled rail: a short name under each icon, so nobody needs the Menu button to tell pages apart ---------- */
.rail-label { display: none; }
.tm-menu-button { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: .15rem .55rem; }
.tm-menu-label { font-size: 13px; font-weight: 500; }
@media (max-width: 575.98px) { .tm-menu-label { display: none; } }   /* phones: the icon alone (the top bar is tight) */
@media (min-width: 576px) {
  .side-bar:not(.open) { width: 80px; }
  .content-window { left: 80px; }
  .side-bar:not(.open) .accordion-button { flex-direction: column; justify-content: center; gap: 2px; padding: 6px 2px; margin: 1px 4px; width: calc(100% - 8px); }
  /* The open menu's look (same colour and weight), small and compact so each name fits under its icon */
  .side-bar:not(.open) .rail-label { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.2px; line-height: 1.2;
                                     text-align: center; color: var(--tm-text); white-space: normal; max-width: 100%; }
}


/* ---------- Matrix grid (dashboards_matrix.html): artists x venues, sticky artist column and venue headers ---------- */
.matrix-scroll { overflow: auto; max-height: calc(100vh - 260px); border: 1px solid var(--tm-border); border-radius: var(--tm-radius); }
.matrix-grid { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.matrix-grid th, .matrix-grid td { border-bottom: 1px solid var(--tm-border); border-right: 1px solid var(--tm-border); background: var(--tm-bg); }
#availabilityTable thead th { background: var(--tm-bg-raised); }     /* its header stays put: rows scroll under it, not through it */
.matrix-grid thead th { position: sticky; top: 0; z-index: 2; vertical-align: bottom; background: var(--tm-bg-raised); }
.matrix-grid .matrix-artist { position: sticky; left: 0; z-index: 1; min-width: 190px; max-width: 220px; padding: 6px 10px; text-align: left; background: var(--tm-bg-raised); }
.matrix-grid thead .matrix-artist { z-index: 3; }
.matrix-grid .matrix-artist a { color: var(--tm-text); text-decoration: none; font-weight: 500; }
.matrix-grid .matrix-meta { display: block; color: var(--tm-text-muted); font-size: 11px; font-weight: 400; }
.matrix-grid .matrix-venue { width: 96px; min-width: 96px; max-width: 96px; padding: 6px 6px; font-weight: 500; color: var(--tm-text-muted); text-align: center; vertical-align: bottom; }
/* Venue names read across (Kice, 2026-10-28), up to three lines; the full name is in the tooltip */
.matrix-grid .matrix-venue span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.matrix-grid .matrix-cell { width: 96px; min-width: 96px; height: 34px; text-align: center; padding: 2px; }
.matrix-grid .matrix-cell.editable { cursor: pointer; }
.matrix-grid .matrix-cell.editable:hover { background: var(--tm-surface-hover); }
.matrix-grid .matrix-cell .badge { font-size: 10px; padding: .3em .45em; }
.coverage-card.coverage-thin { border-color: rgba(234, 179, 8, 0.5); }
.coverage-card a { color: var(--tm-text); text-decoration: none; }
.coverage-card a:hover { color: var(--tm-accent); }
.coverage-card .coverage-type { display: inline-block; padding: 1px 6px; border-radius: 6px; background: var(--tm-surface); }
.perm-matrix .perm-section-set { font-size: .7rem; color: var(--tm-text-muted); text-decoration: none; }
.perm-matrix .perm-section-set:hover { color: var(--tm-accent); }


/* Star ratings with their action (venue Past Bookings & Feedback, table and phone card): stars and the button or note
   sit side by side and wrap rather than overlap */
.tm-rating { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.tm-rating .tm-stars { display: inline-flex; gap: .15rem; line-height: 1; }
.tm-rating .tm-stars .star { font-size: 20px; cursor: pointer; }
/* A client's past booking: stars, who reviewed it and the comment on one line; what's written gives way first */
.tm-review-line { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.tm-review-line > * { flex: 0 0 auto; }
.tm-review-line .tm-rating { flex-wrap: nowrap; gap: .75rem; }
.tm-review-line .tm-rating .btn { padding: 2px 10px; font-size: 12px; }
.tm-review-line .reviewed-by, .tm-review-line .reviewed-comment { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tm-rating-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; font-size: 14px; }
.tm-title-row:has(> .d-none) { display: none; }
.bc-card .tm-rating .tm-stars .star { font-size: 22px; }
.tm-rating .tm-rating-note { font-size: 12px; font-style: italic; color: var(--tm-text-muted, #797979); }

/* Onboarding: the whole application's progress stays at the bottom of the screen while the artist scrolls; on the
   signing page it sits above the contract instead, so it never covers signNow's buttons */
.onboarding-progress { position: sticky; bottom: 12px; z-index: 5; background: var(--tm-bg-raised); box-shadow: 0 -4px 16px rgba(0, 0, 0, .25); margin-top: 1rem; }
.onboarding-progress.onboarding-progress-inline { position: static; box-shadow: none; margin-top: 0; }
/* The sticky bar never hides what they're reading or typing in: jumping to a step, or tabbing to a field, keeps it
   clear of the bar; the bar itself is slimmer on phones */
html:has(#onboardingProgress:not(.onboarding-progress-inline)) { scroll-padding-bottom: 140px; }
#onboardingProgress:not(.onboarding-progress-inline) ~ *, .onboarding-step:last-of-type { margin-bottom: 1rem; }
@media (max-width: 575.98px) { .onboarding-progress:not(.onboarding-progress-inline) { padding: .5rem .75rem !important; bottom: 6px; } }

/* Venue Feedback (dashboards_venue_reviews.html): the stars column, and each review's History */
.vf-stars-cell { width: 170px; line-height: 17px; }
.review-history summary, .account-history summary { cursor: pointer; }

/* Update My Info (onboarding/onboarding_update.html): the same width as the onboarding checklist */
.onboarding-update { max-width: 820px; }

/* Account History (includes/account_history.html, staff pages): one line per event, wrapping on phones */
.account-history summary { list-style: none; }
.account-history .account-event { overflow-wrap: anywhere; }

/* Staff table row buttons (includes/row_actions.html): the main action and a "⋯" menu, on one line */
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: nowrap; }
.row-actions form { margin: 0; }
.row-actions .dropdown-menu form { display: block; }
.row-actions .dropdown-menu .dropdown-item { white-space: nowrap; }
.row-note { font-size: .78rem; color: var(--tm-text-muted); margin-top: 2px; }

/* Phones: compact rows that expand (table.tm-expand, base.html). Collapsed, a row shows only its data-summary cells on
   one line with a chevron; tapped open, it shows every cell as the usual labelled card. */
@media (max-width: 767.98px) {
  table.tm-cards.tm-expand tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; position: relative;
                                margin-bottom: 6px; padding: 9px 36px 9px 12px; cursor: pointer; }
  table.tm-cards.tm-expand tr::after { content: ''; position: absolute; right: 14px; top: 17px; width: 8px; height: 8px;
                                       border-right: 2px solid var(--tm-text-muted); border-bottom: 2px solid var(--tm-text-muted);
                                       transform: rotate(45deg); transition: transform .15s ease; }
  table.tm-cards.tm-expand tr.tm-open::after { transform: rotate(-135deg); top: 21px; }
  table.tm-cards.tm-expand tr:focus-visible { outline: none; box-shadow: var(--tm-focus-ring); }
  table.tm-cards.tm-expand td { display: none; }
  table.tm-cards.tm-expand td[data-summary] { display: block; width: auto !important; padding: 0 !important; text-align: left; }
  table.tm-cards.tm-expand td[data-summary]::before { display: none; }
  table.tm-cards.tm-expand td[data-summary]:first-child { flex: 1 1 auto; min-width: 0; }
  table.tm-cards.tm-expand td[data-summary] .row-note { display: none; }
  table.tm-cards.tm-expand tr.tm-open td { display: block; width: 100% !important; padding: 6px 0 !important; text-align: right; }
  table.tm-cards.tm-expand tr.tm-open td[data-label]:not([data-label=""])::before { display: block; }
  table.tm-cards.tm-expand tr.tm-open td[data-summary]:first-child { text-align: left; }
  table.tm-cards.tm-expand tr.tm-open td[data-summary]:first-child::before { display: none; }
  table.tm-cards.tm-expand tr.tm-open td[data-summary] .row-note { display: block; }
}

/* Phones: an empty-table message or a one-cell row (colspan) in a tap-to-open table is always shown */
@media (max-width: 767.98px) {
  table.tm-cards.tm-expand td.dataTables_empty, table.tm-cards.tm-expand td[colspan] { display: block; width: 100% !important; text-align: center; }
  table.tm-cards.tm-expand tr:has(> td.dataTables_empty)::after, table.tm-cards.tm-expand tr:has(> td[colspan])::after { display: none; }

  /* The compact booking cards open too (base.html toggleRow): collapsed they look exactly as before; tapped open, the
     row's other columns follow the card as labelled lines (cells with no heading, e.g. a duplicate button column, stay hidden) */
  table.tm-cards.tm-booking-cards tbody tr { cursor: pointer; }
  table.tm-cards.tm-booking-cards tr:focus-visible { outline: none; box-shadow: var(--tm-focus-ring); }
  table.tm-cards.tm-booking-cards tr.tm-open { flex-wrap: wrap; }
  table.tm-cards.tm-booking-cards tr.tm-open td.bc-keep { order: 1; }
  table.tm-cards.tm-booking-cards tr.tm-open td.bc-card { order: 2; }
  table.tm-cards.tm-booking-cards tr.tm-open td[data-label]:not([data-label=""]):not(.bc-card):not(.bc-keep) {
    display: block; order: 3; flex: 0 0 100%; width: 100% !important; padding: 5px 0 !important; text-align: right;
    border-top: 1px solid var(--tm-border) !important; font-size: 13px;
  }
  table.tm-cards.tm-booking-cards tr.tm-open td[data-label]:not([data-label=""]):not(.bc-card):not(.bc-keep)::before { display: block; }
}

/* Music Approvals: the review card a Review button jumps to stands out */
.music-submission { scroll-margin-top: 90px; }
.music-submission:target { outline: 2px solid var(--tm-accent); outline-offset: 2px; }

/* Back button at the top of inner pages (navigation.py) */
.tm-back-row { padding: .6rem 1rem 0; }
.tm-back { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: .25rem .75rem .25rem .5rem; border: 1px solid var(--tm-border, rgba(127,127,127,.35)); border-radius: 999px; color: inherit; font-size: .875rem; font-weight: 500; text-decoration: none; }
.tm-back:hover { background: var(--tm-surface-hover, rgba(127,127,127,.15)); color: inherit; }
