@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Mulish:wght@400;500;600;700&display=swap');

:root {
  --bg: #f2ead9;
  --bg-panel: #fffdf8;
  --bg-panel-light: #faf5ea;
  --bg-header: #f7f0e0;
  --border: #e6dcc6;
  --border-input: #ddd0b4;
  --divider: #ece2cf;
  --text: #33291c;
  --text-dim: #8a7c64;
  --text-faint: #a99a7e;
  --accent: #9c7a33;
  --accent-text: #fffdf6;
  --green: #6f8a52;
  --green-bg: #dde7d2;
  --green-text: #4e6436;
  --amber: #a6852f;
  --amber-bg: #f0e3c4;
  --amber-text: #7a5f1d;
  --red: #8a2230;
  --red-bg: #f6e7e3;
  --red-border: #e6c6bf;
  --shadow: 0 2px 10px rgba(80, 60, 20, 0.06);
  --shadow-lg: 0 16px 50px rgba(50, 38, 18, 0.3);
  --font-display: 'Cormorant Garamond', serif;
  --footer-strip-height: 34px;
  --dev-credit-height: 26px;
  font-size: 18px;
}

* {
  box-sizing: border-box;
}

html {
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Mulish', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overscroll-behavior-y: none;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px;
  flex: 1;
  width: 100%;
}

/* Admin gets the full window width instead of the narrow article-style
   measure other pages use — it's tables/grids, not reading copy. Plain
   stacked forms (not .inline-form, which self-constrains via flex) still
   need their own cap so a single text input doesn't stretch edge-to-edge. */
.page--admin {
  max-width: none;
  padding: 28px 40px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
}

h1 {
  font-size: 2.1rem;
  margin: 0 0 8px;
}

.subtitle {
  color: var(--text-dim);
  margin: 0 0 32px;
}

label {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-dim);
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="email"],
select {
  width: 100%;
  font-size: 1.4rem;
  padding: 16px;
  border-radius: 7px;
  border: 1px solid var(--border-input);
  background: var(--bg-panel);
  color: var(--text);
  margin-bottom: 20px;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(156, 122, 51, 0.15);
}

/* Date/time pickers get the same base chrome as every other input, plus a
   bit more: color-scheme so the native popup (day grid, AM/PM wheel) stays
   light even on a dark-mode OS instead of clashing, and a recolored picker
   icon (WebKit only — Firefox has no equivalent pseudo-element, so it just
   falls back to its own default icon there) so the one bit of native chrome
   we can reach doesn't look like a plain gray afterthought. */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  width: 100%;
  font-size: 1.4rem;
  padding: 16px;
  border-radius: 7px;
  border: 1px solid var(--border-input);
  background: var(--bg-panel);
  color: var(--text);
  margin-bottom: 20px;
  color-scheme: light;
}

input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(156, 122, 51, 0.15);
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 5px;
  margin-right: -4px;
  border-radius: 6px;
  filter: sepia(45%) saturate(420%) hue-rotate(-8deg) brightness(88%) contrast(92%);
  transition: background-color 0.15s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  background-color: var(--amber-bg);
}

/* Custom time-select — a native <select> styled to replace the native
   type="time" picker (clock dial in Chrome, three-segment spinner
   elsewhere) with something that reads as deliberately designed. The
   dropdown's own option list is still OS-rendered chrome either way (no
   browser exposes that for styling), but the closed control itself now
   matches the rest of the form instead of looking like an afterthought. */
.time-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  font-size: 1.4rem;
  padding: 16px 38px 16px 16px;
  border-radius: 7px;
  border: 1px solid var(--border-input);
  background-color: var(--bg-panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a99a7e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 11px 8px;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 20px;
}

.time-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(156, 122, 51, 0.15);
}

/* Pairs a date input with a .time-select on one line (Schedule tab's
   Start/End fields) — children opt out of the standalone 20px
   margin-bottom so the pair lines up as a single field-height row. */
.datetime-split {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.datetime-split input[type="date"] {
  flex: 1.2;
  margin-bottom: 0;
}

.datetime-split .time-select {
  flex: 1;
  margin-bottom: 0;
}

button {
  font-size: 1.3rem;
  font-weight: 700;
  padding: 18px 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  color: var(--accent-text);
  background: var(--accent);
  width: 100%;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: var(--bg-panel-light);
  color: var(--text-dim);
  border: 1px solid var(--border-input);
}

button.success {
  background: var(--green);
}

button.danger {
  background: var(--red);
}

.btn-row {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.btn-row button {
  flex: 1;
}

.banner {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 1.2rem;
}

.banner.success {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green-text);
}

.banner.error {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
}

.muted {
  color: var(--text-dim);
}

/* Display board */
.display-page {
  overflow: hidden;
}

.board {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  padding: 24px;
  height: calc(100vh - var(--footer-strip-height) - var(--dev-credit-height));
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 20px;
}

.station-tile {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.station-tile.awaiting {
  border-color: var(--amber);
  background: var(--amber-bg);
}

.station-tile.processing {
  border-color: var(--green);
  background: var(--green-bg);
}

.station-tile.on-break {
  border-color: var(--amber);
  background: var(--amber-bg);
}

.station-tile .station-label {
  font-size: 1.1rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.station-tile .station-name {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  margin-top: 12px;
  word-break: break-word;
}

.station-tile .station-status {
  margin-top: 12px;
  font-size: 1.2rem;
  color: var(--text-dim);
}

.sidebar {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 24px;
  overflow-y: auto;
}

.sidebar h2 {
  margin-top: 0;
}

.sidebar ul {
  list-style: none;
  padding-left: 0;
  font-size: 1.3rem;
  line-height: 2.1;
}

.sidebar ul li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-appointment-marker {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.queue-type-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
  margin-top: -2px;
  flex: none;
  color: var(--text-dim);
}

/* Validator station */
.station-header {
  text-align: center;
  margin-bottom: 24px;
}

.station-header .station-big-number {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent);
}

.call-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  margin-bottom: 24px;
}

.call-card .call-name {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  margin: 8px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider);
}

th {
  color: var(--text-dim);
  font-weight: 600;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Navbar (logged-in pages) */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-brand .nav-emblem {
  width: 38px;
  height: 38px;
  flex: none;
}

.nav-brand .nav-wordmark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  white-space: nowrap;
}

.navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 28px;
}

.navbar .nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
}

.navbar .nav-links a:hover {
  color: var(--text);
  background: var(--bg-panel-light);
}

.navbar .nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-user-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}

.nav-user-text .nav-user-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.nav-user-text .nav-user-role {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: capitalize;
}

.nav-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.nav-divider {
  width: 1px;
  height: 24px;
  background: var(--border-input);
  flex: none;
}

.nav-logout-btn {
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-input);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-logout-btn svg {
  width: 16px;
  height: 16px;
}

.nav-logout-btn:hover {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
}

/* Event branding: footer banner (His Highness the Aga Khan — Canada Visit).
   The hero image itself is only used as login.html's full-bleed background. */
.dev-credit {
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: stretch;
  width: 100%;
  font-family: 'Mulish', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  color: var(--text-faint);
  padding: 6px 16px 4px;
  letter-spacing: 0.04em;
  box-sizing: border-box;
  text-align: center;
}

.login-page .dev-credit {
  position: fixed;
  bottom: var(--footer-strip-height);
  left: 0;
  z-index: 1;
  color: var(--text-faint);
}

.display-page .dev-credit,
.precheck-page .dev-credit {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: var(--dev-credit-height);
  color: var(--text-faint);
  font-family: 'Mulish', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: center;
  box-sizing: border-box;
}

.brand-footer-strip {
  width: 100%;
  height: var(--footer-strip-height);
  background-color: var(--bg-header);
  border-top: 1px solid var(--border);
}

/* On the login page the footer strip overlays the centered card rather than
   pushing it around, matching the existing fixed corner-emblem treatment.
   (The hero image is the page's own full-bleed background — see .login-page.) */
.login-page .brand-footer-strip {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 0;
}

/* Section cards (admin tabs, precheck rows) */
.section-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.section-card h2 {
  margin-top: 0;
}

.inline-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form > div {
  flex: 1;
  min-width: 160px;
}

.inline-form input,
.inline-form select {
  margin-bottom: 0;
}

.inline-form button {
  width: auto;
  white-space: nowrap;
}

.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  background: var(--bg-panel-light);
  border: 1px solid var(--border);
}

.pill.green { background: var(--green-bg); border-color: var(--green); color: var(--green-text); }
.pill.amber { background: var(--amber-bg); border-color: var(--amber); color: var(--amber-text); }
.pill.red { background: var(--red-bg); border-color: var(--red-border); color: var(--red); }

.row-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--bg-panel-light);
  border: 1px solid var(--divider);
  border-radius: 10px;
  gap: 12px;
  flex-wrap: wrap;
}

.row-item .row-actions {
  display: flex;
  gap: 8px;
}

.row-item button {
  width: auto;
  padding: 8px 14px;
  font-size: 0.95rem;
}

/* Appointments tab — 15-minute slot rows */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.stats-card {
  background: var(--bg-panel-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 18px;
  text-align: center;
}

.stats-card--green { border-color: var(--green); background: var(--green-bg); }
.stats-card--red   { border-color: var(--red-border); background: var(--red-bg); }
.stats-card--amber { border-color: var(--amber); background: var(--amber-bg); }

.stats-value {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.stats-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.stats-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.appt-slot {
  background: var(--bg-panel-light);
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
}

.appt-slot-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.appt-slot-head .appt-time {
  font-weight: 700;
  min-width: 90px;
}

.appt-capacity-input {
  width: 56px;
  margin: 0;
  padding: 4px 6px;
  font-size: 0.95rem;
}

.appt-slot-head button {
  margin-left: auto;
  width: auto;
  padding: 6px 12px;
  font-size: 0.9rem;
}

.appt-booking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px dashed var(--divider);
}

.appt-booking-cancelled {
  opacity: 0.55;
}

.appt-booking-row .row-actions {
  display: flex;
  gap: 8px;
}

.appt-booking-row button {
  width: auto;
  padding: 6px 12px;
  font-size: 0.9rem;
}

/* Admin tabs */
.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--divider);
}

.tab-btn {
  width: auto;
  padding: 10px 4px;
  margin: 0 22px 0 0;
  font-size: 1rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab-btn:last-child {
  margin-right: 0;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  background: transparent;
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---- Shift planner timeline (Schedule tab) ---- */
.planner-light {
  padding: 20px;
}

.planner-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 24px;
}

.planner-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.planner-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text);
}

.planner-subtitle {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: 0.9rem;
}

.planner-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.planner-toggle {
  display: flex;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  overflow: hidden;
}

.planner-toggle-btn {
  width: auto;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--bg-panel);
  color: var(--text-dim);
  border: none;
  border-radius: 0;
}

.planner-toggle-btn.active {
  background: var(--accent);
  color: var(--accent-text);
}

.planner-nav-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-input);
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1;
}

.planner-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Public booking page (/book) */
.book-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.book-slot-btn {
  border-radius: 16px;
  border: 1px solid var(--border-input);
  background: var(--bg-panel);
  color: var(--text);
  padding: 14px 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
}

.book-slot-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-panel-light);
}

.book-slot-availability {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 4px;
}

.book-slot-btn:disabled {
  background: var(--bg-panel-light);
  color: var(--text-faint);
  cursor: not-allowed;
  border-style: dashed;
}

.book-slot-btn:disabled .book-slot-availability {
  color: var(--text-faint);
}

.book-confirmation {
  text-align: center;
  padding: 12px 0;
}

.book-confirmation .book-code {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.planner-date {
  text-align: center;
  min-width: 90px;
}

.planner-date #plannerDateLabel {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.planner-today-label {
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.planner-add-btn {
  width: auto;
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--accent);
  border-radius: 8px;
}

.planner-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--divider);
}

.planner-legend label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  margin-bottom: 0;
  background: var(--bg-panel-light);
}

.planner-legend input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.planner-legend .legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
  border-width: 1px;
  border-style: solid;
}

.planner-grid-wrap {
  overflow-x: auto;
}

.planner-grid {
  min-width: 900px;
}

.planner-grid-header {
  display: flex;
  border-bottom: 1px solid var(--divider);
}

.planner-grid-rowlabel-header {
  flex: 0 0 150px;
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 12px;
  font-weight: 700;
}

.planner-hour-col {
  flex: 1;
  font-size: 0.7rem;
  color: var(--text-faint);
  padding: 6px 4px;
}

.planner-row {
  display: flex;
  position: relative;
  border-bottom: 1px solid var(--divider);
  min-height: 56px;
}

.planner-row-label {
  flex: 0 0 150px;
  padding: 12px;
  font-weight: 700;
  color: var(--text);
  font-size: 0.9rem;
}

.planner-row-track {
  flex: 1;
  position: relative;
  cursor: pointer;
  background-image: linear-gradient(to right, var(--divider) 1px, transparent 1px);
  user-select: none;
}

.planner-drag-preview {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-radius: 7px;
  border: 1.5px dashed var(--accent);
  background: rgba(156, 122, 51, 0.15);
  z-index: 4;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
}

.planner-block {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-radius: 7px;
  border-width: 1px;
  border-left-width: 4px;
  border-style: solid;
  padding: 4px 9px;
  font-size: 0.78rem;
  overflow: hidden;
  cursor: pointer;
  z-index: 2;
  text-align: left;
  box-shadow: 0 1px 2px rgba(50, 38, 18, 0.12);
}

.planner-block strong {
  display: block;
  font-size: 0.82rem;
}

.planner-appointment-marker {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
}

.planner-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--red);
  z-index: 3;
  pointer-events: none;
}

.planner-now-dot {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
}

.planner-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
  font-size: 0.85rem;
  color: var(--text-faint);
}

.planner-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(50, 38, 18, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.planner-modal {
  background: var(--bg-panel);
  color: var(--text);
  border-radius: 12px;
  padding: 28px;
  width: 420px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.planner-modal h3 {
  font-size: 1.25rem;
  margin: 0 0 14px;
}

/* The page-level label/input/select/button sizing (large, touch-friendly
   for full-page forms) reads as oversized crammed into a 420px modal —
   everything here scales down a notch, consistently across all three
   modals that share .planner-modal (Schedule's Add/Edit Shift, the
   Appointments tab's + Add, and /book's booking modal). */
.planner-modal label {
  font-size: 0.85rem;
  margin-bottom: 5px;
}

.planner-modal input[type="text"],
.planner-modal input[type="tel"],
.planner-modal input[type="number"],
.planner-modal input[type="password"],
.planner-modal input[type="email"],
.planner-modal input[type="date"],
.planner-modal select,
.planner-modal .time-select {
  font-size: 0.95rem;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 6px;
}

.planner-modal .time-select {
  padding: 10px 28px 10px 12px;
  background-position: right 12px center;
  background-size: 9px 7px;
}

.planner-modal .datetime-split {
  gap: 8px;
  margin-bottom: 12px;
}

.planner-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.planner-modal-actions button {
  width: auto;
  font-size: 0.95rem;
  padding: 10px 18px;
}

.planner-modal .banner {
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 0.88rem;
}

.planner-manage-details {
  background: var(--bg-panel-light);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Login page */
.login-page {
  min-height: 100vh;
  background-image: radial-gradient(120% 80% at 50% -10%, #fbf6ec 0%, #f1e7d3 60%, #ece0c8 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.login-card {
  grid-column: 1;
  justify-self: right;
  position: relative;
  z-index: 1;
  width: 430px;
  max-width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 40px 40px 32px;
}

@media (max-width: 700px) {
  .login-page {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .login-card {
    grid-column: 1;
    justify-self: center;
    width: 100%;
  }
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--divider);
}

.login-brand .login-emblem {
  width: 58px;
  height: 58px;
}

.login-brand .login-wordmark {
  font-family: var(--font-display);
  font-size: 2.1rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-top: 10px;
  font-weight: 600;
}

.login-brand .login-tagline {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-top: 10px;
}

/* Welcome / Check In (precheck.html) — imported from claude.ai/design's
   "Check In.dc.html" in the same project as the rest of the theme; see
   CLAUDE.md. The card's own padding is replaced by per-step padding so the
   step rail can have its own background/border-bottom flush with the card. */
.checkin-card {
  padding: 0;
}

.checkin-steps {
  display: flex;
  align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--divider);
  background: var(--bg-panel-light);
  border-radius: 12px 12px 0 0;
}

.checkin-step-item {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkin-step-item:not(:last-child) {
  flex: 1;
}

.checkin-step-dot {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--border-input);
  color: var(--text-faint);
}

.checkin-step-dot.active,
.checkin-step-dot.done {
  background: var(--accent);
  color: var(--accent-text);
}

.checkin-step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-faint);
  white-space: nowrap;
}

.checkin-step-label.active {
  color: var(--text);
  font-weight: 700;
}

.checkin-step-label.done {
  color: var(--text-dim);
}

.checkin-step {
  padding: 30px 36px 34px;
}

.checkin-step-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
}

.checkin-step-subtitle {
  font-size: 0.86rem;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.5;
}

.checkin-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 26px;
}

.checkin-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  background: var(--bg-panel);
  color: var(--text);
  border: 1.5px solid var(--border-input);
  border-radius: 12px;
  padding: 26px 20px 24px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.checkin-choice-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(156, 122, 51, 0.14);
  transform: translateY(-2px);
}

.checkin-choice-icon {
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: 50%;
  background: var(--amber-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkin-choice-label {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.checkin-choice-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.checkin-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  color: var(--text-faint);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.checkin-divider::before,
.checkin-divider::after {
  content: '';
  height: 1px;
  background: var(--divider);
  flex: 1;
}

.checkin-found-card {
  margin-top: 18px;
  border: 1.5px solid var(--border-input);
  background: var(--bg-panel-light);
  border-radius: 10px;
  padding: 18px 18px 16px;
}

.checkin-found-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--green-text);
  text-transform: uppercase;
}

.checkin-found-badge .dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.checkin-found-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 8px;
}

.checkin-found-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--text);
}

.checkin-found-meta b {
  color: var(--text-dim);
  font-weight: 700;
}

.checkin-party-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--bg-panel-light);
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 14px 18px;
}

.checkin-party-row-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.checkin-party-row-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.checkin-party-adjuster {
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkin-party-btn {
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px solid var(--border-input);
  background: var(--bg-panel);
  color: var(--accent);
  border-radius: 9px;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.checkin-party-count {
  min-width: 42px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.checkin-review-table {
  margin-top: 20px;
  border: 1px solid var(--divider);
  border-radius: 10px;
  overflow: hidden;
}

.checkin-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--divider);
  background: var(--bg-panel);
}

.checkin-review-row:last-child {
  border-bottom: none;
}

.checkin-review-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
  flex: none;
  width: 130px;
}

.checkin-review-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  flex: 1;
}

.checkin-consent-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  margin-top: 18px;
  background: var(--bg-panel);
  color: var(--text-dim);
  border: 1px solid var(--border-input);
  border-radius: 10px;
  padding: 15px 16px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.5;
}

.checkin-consent-box {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--bg-panel);
  color: var(--accent-text);
  border: 1.5px solid var(--border-input);
  margin-top: 1px;
}

.checkin-consent-box.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.checkin-actions button {
  width: auto;
}

.checkin-done {
  text-align: center;
  padding: 44px 40px 46px;
}

.checkin-done-icon {
  width: 92px;
  height: 92px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--green-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: checkinPop 0.45s ease-out both;
}

.checkin-done-check {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkinDraw 0.5s 0.25s ease-out forwards;
}

@keyframes checkinPop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes checkinDraw {
  to { stroke-dashoffset: 0; }
}

.checkin-done-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  margin-top: 20px;
}

.checkin-done-subtitle {
  font-size: 0.92rem;
  color: var(--text-dim);
  margin-top: 8px;
  line-height: 1.5;
}

.checkin-code-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 24px;
  background: var(--bg-panel-light);
  border: 1.5px solid var(--border-input);
  border-radius: 12px;
  padding: 18px 38px;
}

.checkin-code-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.checkin-code-value {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  line-height: 1;
}

.checkin-code-note {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.checkin-done-party {
  font-size: 0.84rem;
  color: var(--text);
  margin-top: 22px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .checkin-choice-grid {
    grid-template-columns: 1fr;
  }
}

/* Phone-friendly improvements (primarily /book but benefits any page using
   these components on a small screen). */
@media (max-width: 480px) {
  /* Scale down the base rem unit so every rem-sized element shrinks
     proportionally — the single most impactful mobile tweak. */
  :root {
    font-size: 15px;
  }

  .page {
    padding: 16px 12px;
  }

  .section-card {
    padding: 14px;
  }

  /* Compact the brand header so the slot grid gets more screen real-estate */
  .login-brand .login-emblem {
    width: 40px;
    height: 40px;
  }

  .login-brand .login-wordmark {
    font-size: 1.5rem;
    margin-top: 6px;
  }

  .login-brand .login-tagline {
    font-size: 0.7rem;
    margin-top: 5px;
  }

  /* Stack the title + day-nav on small screens */
  .planner-header {
    flex-direction: column;
    align-items: stretch;
  }

  .planner-controls {
    justify-content: space-between;
  }

  /* Fixed 3-column grid — more predictable than auto-fill on narrow screens */
  .book-slot-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }

  .book-slot-btn {
    padding: 10px 4px;
    font-size: 0.82rem;
    border-radius: 12px;
  }

  /* Bottom-sheet modal: anchors to the bottom of the screen so the phone
     keyboard doesn't cover the form unexpectedly — a far better pattern
     than a centred overlay on a small screen. */
  .planner-modal-backdrop {
    align-items: flex-end;
  }

  .planner-modal {
    width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px 30px;
    max-height: 88vh;
    overscroll-behavior: contain;
  }

  /* Stack Close / Confirm vertically for easier tapping */
  .planner-modal-actions {
    flex-direction: column;
    gap: 8px;
  }

  .planner-modal-actions button {
    width: 100%;
  }

  .book-confirmation .book-code {
    font-size: 1.3rem;
    padding: 8px 18px;
  }
}

@media (max-width: 900px) {
  .board {
    grid-template-columns: 1fr;
    height: auto;
  }
  .station-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
}
