:root {
  --bg: #111827;
  --nav: #0f1522;
  --surface: #1a2232;
  --row-alt: #1c2434;
  --head: #374151;
  --border: #2a3344;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --faint: #6b7280;
  --input: #1f2937;
  --input-border: #374151;
  --blue: #1d4ed8;
  --blue-hover: #2563eb;
  --link: #3b82f6;
  --green: #22c55e;
  --green-bg: #dcfce7;
  --green-text: #166534;
  --amber-bg: #fef3c7;
  --amber-text: #92400e;
  --sky-bg: #dbeafe;
  --sky-text: #1e40af;
  --red: #ef4444;
  --button: #e5e7eb;
  --button-text: #111827;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

svg { width: 1em; height: 1em; flex: none; }

button, input, select, textarea { font: inherit; color: inherit; }

/* Nav */

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 44px;
  padding: 0 16px;
  background: var(--nav);
  border-bottom: 1px solid var(--border);
}
.nav-links { display: flex; gap: 28px; }
.nav-links a, .nav-right a {
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  opacity: .85;
}
.nav-links a:hover, .nav-right a:hover, .nav a[aria-current="page"] { opacity: 1; }
.nav-links a[aria-current="page"] { font-weight: 600; }
.nav-right { margin-left: auto; display: flex; gap: 20px; align-items: center; }
.icon-link { display: flex; font-size: 18px; }
/* Pages someone can't see are hidden, whatever their display. */
.nav [hidden] { display: none; }
.icon-link[aria-current="page"] { color: var(--link); }

/* Page */

main { padding: 0 8px 96px; }

.page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  flex-wrap: wrap;
}
.page-header h1 { margin: 0 12px 0 0; font-size: 24px; font-weight: 700; }
.page-header .spacer { flex: 1; }

.panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
}
.summary strong { color: var(--text); font-size: 15px; }
.summary-sync { display: flex; align-items: center; gap: 10px; }
.sync { color: var(--green); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sync.error { color: var(--red); }

/* Controls */

a.btn { text-decoration: none; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: var(--button);
  color: var(--button-text);
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible, .icon-btn:focus-visible, .toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-hover); filter: none; }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--input-border); }
.btn[disabled] { opacity: .5; cursor: default; }

.toggle {
  width: 38px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: var(--button);
  color: #4b5563;
  cursor: pointer;
  font-size: 17px;
}
.toggle[aria-pressed="true"] { background: var(--link); color: white; }
.toggle.heart { color: var(--red); }
.toggle.heart[aria-pressed="true"] { background: var(--red); color: white; }

.input, select.input, textarea.input {
  height: 34px;
  padding: 0 10px;
  background: var(--input);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  color: var(--text);
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: 2px solid var(--link); outline-offset: -1px; }
.search { width: 200px; }
.date-range { display: flex; align-items: center; gap: 4px; }
.date-range .input { width: 140px; }

/* Table */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  background: var(--head);
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  text-align: left;
  padding: 9px 12px;
  white-space: nowrap;
}
th button.sort {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
th button.sort svg { color: var(--muted); font-size: 12px; }
th button.sort[data-active] svg { color: white; }
th button.sort:focus-visible { outline: 2px solid var(--link); }

tbody td { padding: 10px 12px; height: 41px; vertical-align: middle; white-space: nowrap; }
tbody tr:nth-child(even) { background: var(--row-alt); }
tbody tr:hover { background: #243047; }

td.date { white-space: nowrap; }
td.date small { color: var(--faint); font-size: 12px; margin-left: 2px; }
td.muted, .muted { color: var(--muted); }
.paid-icon { color: var(--green); font-size: 16px; vertical-align: -3px; }
/* Actions stay pinned to the right edge when the table scrolls sideways in a narrow window.
   The cell needs a solid background (matching its row) so scrolled content doesn't show through. */
.col-actions {
  position: sticky;
  right: 0;
  border-left: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg);
  box-shadow: -8px 0 8px -8px rgb(0 0 0 / .6);
}
thead th.col-actions { background: var(--head); }
tbody tr:nth-child(even) td.col-actions { background: var(--row-alt); }
tbody tr:hover td.col-actions { background: #243047; }
td.col-actions .icon-btn:last-child { margin-right: 0; }

.comment { display: flex; align-items: center; gap: 6px; max-width: 220px; }
.comment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav {
  all: unset;
  cursor: pointer;
  color: var(--faint);
  display: inline-flex;
  font-size: 15px;
}
.fav[aria-pressed="true"] { color: var(--red); }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.fav:focus-visible { outline: 2px solid var(--link); }

.pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.pill-delivered { background: var(--green-bg); color: var(--green-text); }
.pill-editing { background: var(--amber-bg); color: var(--amber-text); }
.pill-checkedIn { background: var(--sky-bg); color: var(--sky-text); }

.icon-btn {
  width: 34px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: var(--button);
  color: var(--button-text);
  cursor: pointer;
  font-size: 15px;
  margin-right: 6px;
}
.icon-btn:hover { filter: brightness(1.08); }

.empty { padding: 48px 16px; text-align: center; color: var(--muted); }

.fab {
  position: fixed;
  right: 36px;
  bottom: 16px;
  height: 40px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgb(0 0 0 / .4);
}
.fab svg { font-size: 20px; }

/* Settings */

.settings { max-width: 860px; }
.settings h2 { font-size: 16px; margin: 20px 0 4px; }
.settings p.hint { color: var(--muted); margin: 0 0 12px; }
.filmer-form { display: flex; gap: 10px; align-items: center; padding: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.filmer-form .input { flex: 1; min-width: 180px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.check input { width: 16px; height: 16px; accent-color: var(--link); }
td .inline-name { width: 100%; min-width: 120px; max-width: 240px; }
td .inline-email { width: 100%; min-width: 180px; max-width: 280px; }
tr.inactive td { color: var(--faint); }

/* Dialog */

dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgb(0 0 0 / .5);
}
dialog::backdrop { background: rgb(0 0 0 / .55); }
.dialog-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin: 0; font-size: 17px; margin-right: auto; }
.dialog-body { padding: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.dialog-body .full { grid-column: 1 / -1; }
.field { display: grid; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.field .input { width: 100%; }
.dialog-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.dialog-foot .spacer { margin-left: auto; }
.form-error { color: var(--red); grid-column: 1 / -1; margin: 0; }
.close-btn { all: unset; cursor: pointer; display: inline-flex; font-size: 18px; color: var(--muted); }
.close-btn:hover { color: var(--text); }


.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  translate: -50% 0;
  padding: 10px 16px;
  border-radius: 6px;
  background: #7f1d1d;
  color: white;
  box-shadow: 0 6px 20px rgb(0 0 0 / .4);
}

@media print {
  body * { visibility: hidden; }
  #qr-display, #qr-display * { visibility: visible; }
  #qr-display { position: absolute; inset: 0; color: black; }
  #qr-display p { color: black; }
}

/* Account */

.account-menu { position: relative; }
.account-button {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px;
  background: none; color: var(--text); font: inherit; cursor: pointer;
}
.account-button:hover, .account-button[aria-expanded="true"] { background: var(--surface); border-color: var(--border); }
.account-who { display: grid; text-align: right; line-height: 1.15; }
#user-name { font-size: 14px; font-weight: 600; }
#dropzone-name { font-size: 12px; color: var(--muted); }
.account-button svg { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .15s; color: var(--muted); }
.account-button[aria-expanded="true"] svg { transform: rotate(-90deg); }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 180px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.menu[hidden] { display: none; }
.menu a, .menu button {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 5px; background: none;
  color: var(--text); font: inherit; font-size: 14px; text-align: left; text-decoration: none; opacity: 1; cursor: pointer;
}
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--head); outline: none; }
.menu a[aria-current="page"] { font-weight: 600; }
.menu-divider { margin: 6px 4px; border: 0; border-top: 1px solid var(--border); }
@media (max-width: 560px) { #dropzone-name { display: none; } }
.btn-small { height: 26px; padding: 0 8px; font-size: 13px; }
body.signed-out .nav { display: none; }

/* Sign in */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.login-card {
  width: min(380px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  gap: 14px;
}
.login-card header { display: flex; align-items: center; gap: 10px; }
.login-card h1 { margin: 0; font-size: 20px; }
.login-card p { margin: 0; color: var(--muted); }
.login-card .btn { height: 36px; justify-content: center; }

/* Tokens */

.token-box {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input);
}
.token-box code { flex: 1; word-break: break-all; font-size: 13px; }
.warning { color: #fbbf24; }
.steps { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.steps li { margin: 2px 0; }

body.signed-out main { padding: 0; }

/* QR Codes */

.qr-step { max-width: 720px; }
.qr-toolbar { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); }
.qr-toolbar .input[type="search"] { flex: 1; min-width: 0; }
.sort-toggle { display: inline-flex; border: 1px solid var(--input-border); border-radius: 6px; overflow: hidden; flex: none; }
.sort-toggle button { all: unset; padding: 6px 12px; cursor: pointer; color: var(--muted); font-size: 14px; }
.sort-toggle button[aria-checked="true"] { background: var(--blue); color: white; }
.sort-toggle button:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.qr-list { display: grid; align-content: start; max-height: calc(100vh - 260px); min-height: 200px; overflow-y: auto; }
.qr-option {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}
.qr-option:first-child { border-top: 0; }
.qr-step .summary + .qr-list .qr-option:first-child { border-top: 1px solid var(--border); }
.qr-option:hover { background: #243047; }
.qr-option:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.qr-option > svg { width: 18px; height: 18px; margin-left: auto; color: var(--muted); flex: none; }
.qr-option-muted .qr-name { color: var(--muted); font-weight: 400; }
.qr-option .pill { margin-left: 6px; font-weight: 500; }
.qr-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.qr-name { display: grid; gap: 2px; font-weight: 500; }
.qr-name small { color: var(--muted); font-weight: 400; }
.qr-step-header { gap: 14px; }
.qr-step-header .btn svg { width: 16px; height: 16px; }
.qr-chosen { margin: -4px 0 12px; font-size: 15px; }
.qr-cameras { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
@media (max-width: 560px) { .qr-cameras { grid-template-columns: 1fr; } }
.qr-camera {
  all: unset;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
}
.qr-camera:hover { background: #243047; }
.qr-camera[aria-checked="true"] { background: var(--blue); border-color: var(--blue); color: white; }
.qr-camera[aria-checked="true"] svg { color: #dbeafe; }
.qr-camera:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.qr-camera svg { width: 20px; height: 20px; color: var(--link); flex: none; }
.qr-camera strong { font-size: 15px; color: var(--text); }
.qr-camera[aria-checked="true"] strong { color: white; }

.qr-panel { padding: 16px; display: grid; gap: 14px; max-width: 720px; }
.qr-display { text-align: center; padding: 8px; }
.qr-display .qr { background: white; padding: 12px; border-radius: 8px; display: inline-block; }
.qr-display .qr img { width: min(320px, 70vw); height: auto; aspect-ratio: 1; display: block; }
.qr-display h3 { margin: 12px 0 2px; font-size: 22px; }
.qr-display p { margin: 2px 0; color: var(--muted); }
.qr-hint { margin: 0; color: var(--muted); }
.qr-actions { display: flex; gap: 8px; }

/* Shown full screen on a tablet or phone held up to the camera. */
.qr-display:fullscreen {
  display: grid;
  place-content: center;
  background: white;
  color: black;
  cursor: pointer;
}
.qr-display:fullscreen .qr img { width: min(80vh, 90vw); }
.qr-display:fullscreen p { color: #374151; font-size: 20px; }
.qr-display:fullscreen h3 { font-size: 34px; }

/* Burble */
.sync .btn { margin-left: 8px; }
.sync:has(.btn)::before { flex: none; }
.pill-removed { background: var(--amber-bg); color: var(--amber-text); }
tr.removed td:not(.col-actions) { color: var(--muted); }
tr.removed td.name { text-decoration: line-through; }
.source-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; text-decoration: none; display: inline-block; }
.burble-form { padding: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.burble-form .full { grid-column: 1 / -1; }
.field-label { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.video-map { width: auto; min-width: 0; }
.video-map td { padding: 4px 12px 4px 0; border: 0; }
.video-map .input { min-width: 180px; }
.burble-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.burble-actions .spacer { margin-left: auto; }
@media (max-width: 640px) { .burble-form { grid-template-columns: 1fr; } }
.input:disabled, .check input:disabled { opacity: .55; cursor: not-allowed; }
.role-yes { display: inline-flex; align-items: center; gap: 5px; }
.role-yes svg { width: 16px; height: 16px; color: var(--green); }
tr.editing td { background: var(--row-alt); box-shadow: inset 0 1px 0 var(--link), inset 0 -1px 0 var(--link); }
tr.editing td.col-actions .btn { margin-left: 4px; }

.icon-btn-warn { color: var(--amber-text); background: var(--amber-bg); }

.logo-preview { display: flex; align-items: center; min-height: 72px; padding: 10px 14px; border-radius: 8px; margin: 6px 0 8px; }
.logo-preview img { height: 52px; width: auto; max-width: 280px; object-fit: contain; }
.colour-input { display: flex; align-items: center; gap: 10px; }
.colour-input input[type="color"] { width: 44px; height: 32px; padding: 0; border: 1px solid var(--input-border); border-radius: 6px; background: none; cursor: pointer; }

.link-btn { padding: 0; border: 0; background: none; color: var(--link); font: inherit; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--blue-hover); }

/* Reception */

.day-nav { display: flex; gap: 4px; }
.btn-square { width: 32px; justify-content: center; padding: 0; font-size: 18px; line-height: 1; }
.page-header .btn-ghost { height: 34px; }

.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 0 10px; }
.filter-bar .search { width: 240px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--link); border-color: var(--link); color: white; }
.chip-heart svg { color: var(--red); }
.chip-heart[aria-pressed="true"] { background: var(--red); border-color: var(--red); }
.chip-heart[aria-pressed="true"] svg { color: white; fill: currentColor; }
.chip:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.filter-bar .link-btn { margin-left: 4px; font-size: 13px; color: var(--muted); }

table.bookings tbody td { height: 44px; }
td.time { font-weight: 600; font-variant-numeric: tabular-nums; }
td.time small { color: var(--faint); font-weight: 400; }
td.name { font-weight: 500; }
.faint { color: var(--faint); }

/* A heading per day, and a divider where each jump time starts. */
tr.day-row td {
  height: auto;
  padding: 14px 12px 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
tr.day-row td span { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 8px; }
tbody tr.day-row:hover { background: var(--bg); }
tr.slot-start td { border-top: 2px solid var(--border); }

/* Tags: soft colours that read well on the dark table. */
.pill { padding: 2px 9px; font-weight: 600; letter-spacing: .01em; }
.pill-paid { background: rgb(34 197 94 / .15); color: #4ade80; }
.pill-due { background: rgb(245 158 11 / .16); color: #fbbf24; }
.pill-photosOnly { background: rgb(45 212 191 / .15); color: #5eead4; }
.pill-videoAndPhotos { background: rgb(59 130 246 / .18); color: #93c5fd; }
.pill-ultimate { background: rgb(236 72 153 / .18); color: #f9a8d4; }
.pill-handcam { background: rgb(249 115 22 / .18); color: #fdba74; }
.pill-pending { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--input-border); }
table.bookings .pill-checkedIn { background: rgb(56 189 248 / .16); color: #7dd3fc; }
table.bookings .pill-editing { background: rgb(168 85 247 / .18); color: #d8b4fe; }
table.bookings .pill-delivered { background: rgb(34 197 94 / .15); color: #4ade80; }
table.bookings .pill-removed { background: transparent; color: #fbbf24; box-shadow: inset 0 0 0 1px rgb(251 191 36 / .5); }
tr.removed td:not(.col-actions) { opacity: .55; }

/* The product's name on the sign-in page, until there's a logo. */
.brand-word { margin: 0 0 14px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

/* Paid (has a video package) and Prospect (could be offered one). */
.pill-prospect { background: rgb(245 158 11 / .16); color: #fbbf24; }
.qr-option small .pill { margin: 0 4px 0 0; }
.qr-offer { display: flex; align-items: center; gap: 6px; margin: -4px 0 12px; color: #fbbf24; font-size: 14px; }
.qr-offer strong { color: var(--text); }
.video-badge {
  display: inline-block;
  margin: 10px 0 4px !important;
  padding: 6px 22px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.video-badge.paid { background: #16a34a; color: white !important; }
.video-badge.prospect { background: #f59e0b; color: #111827 !important; }
.qr-display .qr-offer { justify-content: center; margin: 6px 0 0; color: #fbbf24; }
.qr-display:fullscreen .qr-offer { color: #b45309; }
.qr-display:fullscreen .qr-offer strong { color: black; }
@media print {
  .video-badge.paid { border: 2px solid #16a34a; }
  .video-badge.prospect { border: 2px solid #f59e0b; }
  #qr-display .qr-offer, #qr-display .qr-offer strong { color: black; }
}

/* Settings → Payments */
.payments-status { padding: 12px 14px 4px; }
.payments-status p { margin: 0 0 10px; }
.money { display: flex; align-items: center; gap: 6px; }
.money .input { width: 120px; }
.pill-online { background: rgb(34 197 94 / .15); color: #4ade80; margin-left: 4px; }
.stripe-help { color: var(--muted); font-size: 13px; }
.stripe-help p { margin: 0 0 6px; }
.stripe-help code { color: var(--text); }
.webhook-url { word-break: break-all; margin-right: 6px; }
