/* ═══════════════════════════════════════════
   hall.css — Hall Reservation System
   Dark mode default · Matches attendance design system
   ═══════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS  —  single source of truth for every colour
   Dark-mode values live on :root; light overrides on body.light-mode.
   All tokens follow the pattern  --clr-<role>[-<variant>]

   PALETTE REFERENCE
   ─────────────────────────────────────────────────────────────
   Backgrounds (dark → light)
     --clr-bg-base      #0f172a  ←→  #e8edf4   page canvas
     --clr-bg-surface   #1e293b  ←→  #ffffff   cards, modals, sheets
     --clr-bg-raised    #162032  ←→  #ffffff   header
     --clr-bg-sunken    #0f172a  ←→  #f8fafc   inputs, dropdowns
     --clr-bg-overlay   rgba(0,0,0,0.65)        modal scrim

   Borders
     --clr-border       #334155  ←→  #e2e8f0   default stroke
     --clr-border-mid   #475569  ←→  #cbd5e1   stronger divider
     --clr-border-sub   rgba(51,65,85,0.6) ←→ #f1f5f9  subtle row sep

   Text
     --clr-text         #e2e8f0  ←→  #0f172a   primary
     --clr-text-muted   #94a3b8  ←→  #475569   secondary
     --clr-text-dim     #64748b  ←→  #64748b   tertiary / labels
     --clr-text-xdim    #475569  ←→  #94a3b8   very quiet

   Status — Free / Available (green)
     --clr-free         #22c55e                 solid
     --clr-free-text    #86efac  ←→  #15803d   label text
     --clr-free-bg      rgba(34,197,94,0.12) ←→ rgba(34,197,94,0.08)
     --clr-free-border  rgba(34,197,94,0.3)

   Status — Reserved (blue)
     --clr-res          #3b82f6                 solid
     --clr-res-text     #93c5fd  ←→  #1d4ed8   label text
     --clr-res-bg       rgba(59,130,246,0.15) ←→ rgba(59,130,246,0.1)
     --clr-res-border   rgba(59,130,246,0.45) ←→ rgba(59,130,246,0.4)
     --clr-res-tint     rgba(59,130,246,0.04)  row tint

   Status — Occupied (red)
     --clr-occ          #ef4444                 solid
     --clr-occ-text     #fca5a5  ←→  #b91c1c   label text
     --clr-occ-bg       rgba(239,68,68,0.12) ←→ rgba(239,68,68,0.08)
     --clr-occ-border   rgba(239,68,68,0.3)  ←→ rgba(239,68,68,0.35)
     --clr-occ-tint     rgba(239,68,68,0.05)  row tint

   Status — Cancelled (slate)
     --clr-cancel-text  #94a3b8  ←→  #94a3b8
     --clr-cancel-bg    rgba(100,116,139,0.15) ←→ rgba(100,116,139,0.1)
     --clr-cancel-border rgba(100,116,139,0.25)

   Accent — Blue (primary action / active)
     --clr-blue         #3b82f6                 solid mid
     --clr-blue-bright  #60a5fa  ←→  #2563eb   text on dark
     --clr-blue-deep    #2563eb  ←→  #1d4ed8   buttons
     --clr-blue-darker  #1e40af                 pressed state
     --clr-blue-bg      rgba(59,130,246,0.12) ←→ rgba(37,99,235,0.08)
     --clr-blue-border  rgba(59,130,246,0.25) ←→ rgba(37,99,235,0.2)
     --clr-blue-subtle  rgba(37,99,235,0.06)    search row hover

   Accent — Sky (highlights, date chip today)
     --clr-sky          #38bdf8  ←→  #0284c7
     --clr-sky-bg       rgba(56,189,248,0.12) ←→ rgba(2,132,199,0.08)
     --clr-sky-border   rgba(56,189,248,0.35) ←→ rgba(2,132,199,0.3)

   Accent — Violet (upcoming / restore / edit)
     --clr-violet       #a78bfa  ←→  #7c3aed
     --clr-violet-deep  #7c3aed
     --clr-violet-bg    rgba(124,58,237,0.15) ←→ rgba(124,58,237,0.08)
     --clr-violet-border rgba(124,58,237,0.35) ←→ rgba(124,58,237,0.2)

   Accent — Indigo (joins, layout accents)
     --clr-indigo       #6366f1  ←→  #4f46e5
     --clr-indigo-text  #818cf8  ←→  #4f46e5
     --clr-indigo-bg    rgba(99,102,241,0.15) ←→ rgba(99,102,241,0.08)

   Accent — Amber (shift sun / warning)
     --clr-amber        #f59e0b  ←→  #d97706
     --clr-amber-bg     rgba(245,158,11,0.15) ←→ rgba(217,119,6,0.1)

   Accent — Danger (destructive actions)
     --clr-danger       #ef4444
     --clr-danger-text  #f87171  ←→  #dc2626
     --clr-danger-bg    rgba(239,68,68,0.1)  ←→ rgba(220,38,38,0.06)
     --clr-danger-border rgba(239,68,68,0.3) ←→ rgba(220,38,38,0.2)

   Accent — Pink (today icon button)
     --clr-pink         #f472b6  ←→  #ec4899

   Accent — Teal (arrived action)
     --clr-teal         #2dd4bf
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Backgrounds ── */
  --clr-bg-base:       #0f172a;
  --clr-bg-surface:    #1e293b;
  --clr-bg-raised:     #162032;
  --clr-bg-sunken:     #0f172a;
  --clr-bg-overlay:    rgba(0,0,0,0.65);

  /* ── Borders ── */
  --clr-border:        #334155;
  --clr-border-mid:    #475569;
  --clr-border-sub:    rgba(51,65,85,0.6);

  /* ── Text ── */
  --clr-text:          #e2e8f0;
  --clr-text-muted:    #94a3b8;
  --clr-text-dim:      #64748b;
  --clr-text-xdim:     #475569;

  /* ── Status: Free ── */
  --clr-free:          #22c55e;
  --clr-free-text:     #86efac;
  --clr-free-bg:       rgba(34,197,94,0.12);
  --clr-free-border:   rgba(34,197,94,0.3);

  /* ── Status: Reserved (blue) ── */
  --clr-res:           #3b82f6;
  --clr-res-text:      #93c5fd;
  --clr-res-bg:        rgba(59,130,246,0.15);
  --clr-res-border:    rgba(59,130,246,0.45);
  --clr-res-tint:      rgba(59,130,246,0.04);

  /* ── Status: Walk-in (amber) ── */
  --clr-walkin:        #d97706;
  --clr-walkin-text:   #fcd34d;
  --clr-walkin-bg:     rgba(180,83,9,0.18);
  --clr-walkin-border: rgba(217,119,6,0.5);
  --clr-walkin-tint:   rgba(217,119,6,0.04);

  /* ── Status: Occupied (red) ── */
  --clr-occ:           #ef4444;
  --clr-occ-text:      #fca5a5;
  --clr-occ-bg:        rgba(127,29,29,0.22);
  --clr-occ-border:    rgba(239,68,68,0.5);
  --clr-occ-tint:      rgba(239,68,68,0.05);

  /* ── Status: Cancelled (slate) ── */
  --clr-cancel-text:   #94a3b8;
  --clr-cancel-bg:     rgba(100,116,139,0.15);
  --clr-cancel-border: rgba(100,116,139,0.25);

  /* ── Accent: Blue ── */
  --clr-blue:          #3b82f6;
  --clr-blue-bright:   #60a5fa;
  --clr-blue-deep:     #2563eb;
  --clr-blue-darker:   #1e40af;
  --clr-blue-bg:       rgba(59,130,246,0.12);
  --clr-blue-border:   rgba(59,130,246,0.25);
  --clr-blue-subtle:   rgba(37,99,235,0.06);

  /* ── Accent: Sky ── */
  --clr-sky:           #38bdf8;
  --clr-sky-bg:        rgba(56,189,248,0.12);
  --clr-sky-border:    rgba(56,189,248,0.35);

  /* ── Accent: Violet ── */
  --clr-violet:        #a78bfa;
  --clr-violet-deep:   #7c3aed;
  --clr-violet-bg:     rgba(124,58,237,0.15);
  --clr-violet-border: rgba(124,58,237,0.35);

  /* ── Accent: Indigo ── */
  --clr-indigo:        #6366f1;
  --clr-indigo-text:   #818cf8;
  --clr-indigo-bg:     rgba(99,102,241,0.15);

  /* ── Accent: Amber ── */
  --clr-amber:         #f59e0b;
  --clr-amber-bg:      rgba(245,158,11,0.15);

  /* ── Accent: Danger ── */
  --clr-danger:        #ef4444;
  --clr-danger-text:   #f87171;
  --clr-danger-bg:     rgba(239,68,68,0.1);
  --clr-danger-border: rgba(239,68,68,0.3);

  /* ── Accent: Pink ── */
  --clr-pink:          #f472b6;

  /* ── Accent: Teal ── */
  --clr-teal:          #2dd4bf;
}

body.light-mode {
  /* ── Backgrounds ── */
  --clr-bg-base:       #e8edf4;
  --clr-bg-surface:    #ffffff;
  --clr-bg-raised:     #ffffff;
  --clr-bg-sunken:     #f8fafc;
  --clr-bg-overlay:    rgba(0,0,0,0.45);

  /* ── Borders ── */
  --clr-border:        #e2e8f0;
  --clr-border-mid:    #cbd5e1;
  --clr-border-sub:    #f1f5f9;

  /* ── Text ── */
  --clr-text:          #0f172a;
  --clr-text-muted:    #475569;
  --clr-text-dim:      #64748b;
  --clr-text-xdim:     #94a3b8;

  /* ── Status: Free ── */
  --clr-free-text:     #15803d;
  --clr-free-bg:       rgba(34,197,94,0.08);

  /* ── Status: Reserved ── */
  --clr-res-text:      #1d4ed8;
  --clr-res-bg:        rgba(59,130,246,0.1);
  --clr-res-border:    rgba(59,130,246,0.4);

  /* ── Status: Walk-in ── */
  --clr-walkin-text:   #92400e;
  --clr-walkin-bg:     rgba(217,119,6,0.1);
  --clr-walkin-border: rgba(217,119,6,0.45);

  /* ── Status: Occupied ── */
  --clr-occ-text:      #b91c1c;
  --clr-occ-bg:        rgba(239,68,68,0.08);
  --clr-occ-border:    rgba(239,68,68,0.35);
  --clr-occ-tint:      rgba(239,68,68,0.04);

  /* ── Status: Cancelled ── */
  --clr-cancel-bg:     rgba(100,116,139,0.1);

  /* ── Accent: Blue ── */
  --clr-blue-bright:   #2563eb;
  --clr-blue-deep:     #1d4ed8;
  --clr-blue-bg:       rgba(37,99,235,0.08);
  --clr-blue-border:   rgba(37,99,235,0.2);

  /* ── Accent: Sky ── */
  --clr-sky:           #0284c7;
  --clr-sky-bg:        rgba(2,132,199,0.08);
  --clr-sky-border:    rgba(2,132,199,0.3);

  /* ── Accent: Violet ── */
  --clr-violet:        #7c3aed;
  --clr-violet-bg:     rgba(124,58,237,0.08);
  --clr-violet-border: rgba(124,58,237,0.2);

  /* ── Accent: Indigo ── */
  --clr-indigo:        #4f46e5;
  --clr-indigo-text:   #4f46e5;
  --clr-indigo-bg:     rgba(99,102,241,0.08);

  /* ── Accent: Amber ── */
  --clr-amber:         #d97706;
  --clr-amber-bg:      rgba(217,119,6,0.1);

  /* ── Accent: Danger ── */
  --clr-danger-text:   #dc2626;
  --clr-danger-bg:     rgba(220,38,38,0.06);
  --clr-danger-border: rgba(220,38,38,0.2);

  /* ── Accent: Pink ── */
  --clr-pink:          #ec4899;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-x: clip; }

body {
  font-size: 16px;
  touch-action: pan-x pan-y;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  padding: 0;
  margin: 0;
  transition: background 0.3s, color 0.3s;
  overflow-x: clip;
}

/* ── Light mode ── */
body.light-mode {
  background: #e8edf4;
  color: #0f172a;
}

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

/* ═══════════════════════
   HEADER
═══════════════════════ */
.container { max-width: 100%; margin: 0; min-height: 100vh; padding-bottom: calc(var(--qr-bar-h, 100px) + env(safe-area-inset-bottom)); }

.header {
  background: #162032;
  border-bottom: 2.5px solid #3b82f6;
  padding: 8px;
  padding-top: calc(8px + env(safe-area-inset-top));
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

body.light-mode .header {
  background: #ffffff;
  border-bottom-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px;
}

.header-side { display: flex; gap: 6px; align-items: center; }
.header-side-left  { justify-content: flex-start; }
.header-side-right { justify-content: flex-end; }

.header h1 {
  font-size: 18px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0;
  text-align: center;
  flex: 1;
  letter-spacing: -0.01em;
}

/* ── Title → Date morph ─────────────────────── */
/* .title-slot — overridden by inline strip rules below */
/* .title-hall rule moved to inline strip section below */
.title-hall.gone { opacity: 0; transform: translateY(-8px); pointer-events: none; }
/* .title-date-nav — overridden by inline strip rules below */
/* .title-date-nav.visible — overridden below */
.tdn-arrow { background: none; border: none; color: #64748b; cursor: pointer; padding: 3px; border-radius: 6px; display: flex; align-items: center; -webkit-tap-highlight-color: transparent; transition: color .15s, background .15s; }
.tdn-arrow:hover, .tdn-arrow:active { color: #e2e8f0; background: rgba(255,255,255,.08); }
.tdn-arrow .material-symbols-outlined { font-size: 20px; }
.tdn-label { background: none; border: none; font-family: inherit; font-size: 17px; font-weight: 700; color: #e2e8f0; cursor: pointer; padding: 3px 6px; border-radius: 6px; white-space: nowrap; letter-spacing: -.01em; transition: background .15s; -webkit-tap-highlight-color: transparent; }
.tdn-label:hover { background: rgba(255,255,255,.06); }
.tdn-label.today { color: #38bdf8; }
.tdn-label.tomorrow { color: #a78bfa; }
body.light-mode .tdn-arrow { color: #94a3b8; }
body.light-mode .tdn-arrow:hover { color: #0f172a; background: rgba(0,0,0,.06); }
body.light-mode .tdn-label { color: #0f172a; }
body.light-mode .tdn-label.today { color: #0284c7; }
body.light-mode .tdn-label.tomorrow { color: #7c3aed; }
body.light-mode .header h1 { color: #0f172a; }

.header-btn {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(248,251,255,0.06);
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.header-btn:active { background: rgba(51,65,85,0.55); transform: scale(0.95); }
body.light-mode .header-btn {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
}
body.light-mode .header-btn:active { background: #e2e8f0; }
.header-btn .material-symbols-outlined { font-size: 22px; }
.header-btn:first-child .material-symbols-outlined { margin-left: 3px; }

/* Org pill */
.org-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #9ec5ff;
  color: rgba(15,23,42,0.95);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  white-space: nowrap;
  min-width: 36px;
  text-align: center;
}

/* ═══════════════════════
   STICKY SEARCH
═══════════════════════ */
.search-wrap {
  background: #1e293b;
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid #334155;
  border-bottom: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
  overflow: visible;
}
body.light-mode .search-wrap {
  background: #fff;
  border-top-color: #e2e8f0;
  border-bottom: none;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}

.search-icon { color: #475569; font-size: 20px; flex-shrink: 0; }

/* Ghost-text wrapper */
.search-input-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: stretch;
}

.search-input {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
  position: relative;
  z-index: 1;
  caret-color: #60a5fa;
}
.search-input::placeholder { color: #475569; }
.search-input:focus { border-color: #3b82f6; }
.search-input.has-locked-contact { border-color: #2563eb88; }

/* X clear button inside vtSearchInput (view toggle search pill) */
.search-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: #334155;
  border: none;
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #94a3b8;
  padding: 0;
  flex-shrink: 0;
}
.search-clear-btn .material-symbols-outlined { font-size: 14px; }
.search-clear-btn:active { background: #475569; }
.search-clear-btn[hidden] { display: none !important; }
body.light-mode .search-clear-btn { background: #e2e8f0; color: #64748b; }

/* Ghost text layer — sits underneath, same geometry */
.search-ghost {
  position: absolute;
  inset: 0;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  pointer-events: none;
  white-space: pre;
  overflow: hidden;
  border-radius: 10px;
  z-index: 0;
  display: flex;
  align-items: center;
  background: #0f172a;
  border: 1px solid transparent;
  box-sizing: border-box;
}
.search-ghost-real   { color: transparent; }
.search-ghost-suffix { color: #2d4a6b; font-style: italic; }

body.light-mode .search-input         { border-color: #e2e8f0; color: #0f172a; }
body.light-mode .search-input::placeholder { color: #94a3b8; }
body.light-mode .search-input:focus   { border-color: #3b82f6; }
body.light-mode .search-ghost         { background: #f8fafc; }
body.light-mode .search-ghost-suffix  { color: #b0c4d8; }

/* Live search results dropdown */
.search-results {
  position: absolute;
  bottom: 100%;
  top: auto;
  left: 0;
  right: 0;
  background: #1e293b;
  border-top: 1px solid #334155;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  z-index: 3500;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
}
body.light-mode .search-results {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.search-result-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #334155;
  transition: background 0.1s;
}
body.light-mode .search-result-item { border-color: #f1f5f9; }
.search-result-item:hover, .search-result-item:active { background: #0f172a; }
body.light-mode .search-result-item:hover { background: #f8fafc; }

.search-result-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
  background: #1e40af;
  color: #bfdbfe;
}

.search-result-name { font-size: 14px; font-weight: 500; }
.search-result-sub  { font-size: 12px; color: #64748b; margin-top: 1px; }

/* ── Contact row with inline reserve button ── */
.sr-contact-row { cursor: pointer; }
.sr-contact-info { flex: 1; min-width: 0; }
.sr-contact-info .search-result-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sr-reserve-btn {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 4px;
  background: #1e3a5f;
  color: #60a5fa;
  border: 1px solid #2563eb44;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.sr-reserve-btn:hover, .sr-reserve-btn:active { background: #2563eb; color: #fff; border-color: #2563eb; }
body.light-mode .sr-reserve-btn { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
body.light-mode .sr-reserve-btn:hover { background: #2563eb; color: #fff; }

/* ── "Reserve for [name]" new-guest CTA row ── */
.sr-reserve-new {
  background: #0f2040;
  border-bottom-color: #1e3a5f !important;
  cursor: pointer;
}
.sr-reserve-new:hover, .sr-reserve-new:active { background: #1a3060 !important; }
body.light-mode .sr-reserve-new { background: #eff6ff; border-bottom-color: #bfdbfe !important; }
body.light-mode .sr-reserve-new:hover { background: #dbeafe !important; }

.sr-avatar-reserve { background: #1d4ed8 !important; color: #93c5fd !important; }
.sr-reserve-text { flex: 1; }
.sr-reserve-label { font-size: 14px; font-weight: 500; color: #93c5fd; }
body.light-mode .sr-reserve-label { color: #1d4ed8; }
.sr-reserve-label strong { color: #fff; }
body.light-mode .sr-reserve-label strong { color: #1e3a8a; }
.sr-reserve-arrow { color: #3b82f6; font-size: 20px; flex-shrink: 0; }
/* ── Search input ghost-text wrapper ── */

/* ── Meta pills in parsed CTA row ── */
/* ── Meta pills in parsed CTA row ── */
.meta-pill {
  display: flex; align-items: center; gap: 3px;
  background: #1e3a5f; color: #60a5fa;
  border-radius: 6px; padding: 2px 7px;
  font-size: 11px; font-weight: 600;
  border: 1px solid transparent;
}
.meta-pill .material-symbols-outlined { font-size: 12px; }
.meta-pill.pending { background: #1a2a3a; color: #334155; font-style: italic; }
.meta-pill.bare    { background: #1a2f48; color: #4a7fa5; border-color: #2a5070; border-style: dashed; }
body.light-mode .meta-pill { background: #eff6ff; color: #2563eb; }
body.light-mode .meta-pill.pending { background: #f1f5f9; color: #94a3b8; }

/* ── Live-parsed reservation CTA (blue row at top) ── */
.sr-parsed-row {
  background: #0c1f3f;
  border-bottom: 2px solid #2563eb44 !important;
  cursor: pointer;
  padding: 12px 16px;
}
.sr-parsed-row:hover, .sr-parsed-row:active { background: #1a3060 !important; }
body.light-mode .sr-parsed-row { background: #eff6ff; border-bottom-color: #bfdbfe !important; }
body.light-mode .sr-parsed-row:hover { background: #dbeafe !important; }

.sr-parsed-main {
  display: flex; align-items: center; gap: 10px; flex: 1;
}
.sr-parsed-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  background: #1d4ed8; color: #bfdbfe;
}
.sr-parsed-details { flex: 1; }
.sr-parsed-name { font-size: 14px; font-weight: 600; color: #e2e8f0; }
body.light-mode .sr-parsed-name { color: #0f172a; }
.sr-parsed-meta {
  font-size: 12px; color: #60a5fa; margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
}
body.light-mode .sr-parsed-meta { color: #2563eb; }
.sr-parsed-meta-sep { color: #334155; }
.sr-parsed-incomplete { color: #64748b !important; font-style: italic; }
.sr-parsed-go {
  display: flex; align-items: center; gap: 4px;
  background: #2563eb; color: #fff;
  border: none; border-radius: 8px;
  padding: 6px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; flex-shrink: 0;
  white-space: nowrap;
}
.sr-parsed-go:hover { background: #1d4ed8; }

/* ═══════════════════════
   KPI BAR
═══════════════════════ */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin: 10px;
  padding-bottom: 5px;
  transition: margin .25s ease, padding .25s ease;
}
.stat-card {
  background: #1e293b;
  border: 1px solid #334155;
  padding: 8px 4px;
  border-radius: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  user-select: none;
  transition: padding .25s ease;
}
.stat-value {
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 3px;
  color: #e2e8f0;
  transition: font-size .25s ease, margin-bottom .25s ease;
}
.stat-label {
  font-size: 8px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  opacity: 1;
  transition: opacity .2s ease;
}

/* ── Shrunk state — labels collapse, cards tighten ── */
.stats.kpi-shrunk {
  margin: 4px 10px;
  padding-bottom: 4px;
}
.stats.kpi-shrunk .stat-card {
  padding: 5px 4px;
}
.stats.kpi-shrunk .stat-value {
  font-size: 13px;
  margin-bottom: 0;
}
.stats.kpi-shrunk .stat-label {
  font-size: 0;
  opacity: 0;
  letter-spacing: 0;
}
.stat-card.s-reserved .stat-value { color: #059669; }
.stat-card.s-occupied .stat-value { color: #d97706; }
.stat-card.s-occupied { position: relative; }
.stat-card.s-free     .stat-value { color: #38bdf8; }
.stat-card.s-total    .stat-value { color: #7c3aed; }
.stat-card.s-next     .stat-value { color: #94a3b8; }
body.light-mode .stat-card { background: #fff; border-color: #cbd5e1; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
body.light-mode .stat-value { color: #0f172a; }
body.light-mode .stat-label { color: #475569; }
body.light-mode .stat-card.s-reserved .stat-value { color: #059669; }
body.light-mode .stat-card.s-occupied .stat-value { color: #d97706; }
.kpi-soon-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid rgba(56,189,248,.4);
  background: rgba(56,189,248,.12);
  color: #38bdf8;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 3;
}
body.light-mode .kpi-soon-badge {
  border-color: rgba(2,132,199,.3);
  background: rgba(2,132,199,.08);
  color: #0284c7;
}
.stats.kpi-shrunk .kpi-soon-badge { top: -5px; right: -5px; width: 16px; height: 16px; font-size: 6px; }
body.light-mode .stat-card.s-free     .stat-value { color: #0284c7; }
body.light-mode .stat-card.s-total    .stat-value { color: #7c3aed; }

/* ── KPI filter — tappable pills ── */
.stat-card.s-reserved,
.stat-card.s-occupied,
.stat-card.s-free {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .2s ease, border-color .15s ease, background .15s ease, padding .25s ease;
  position: relative;
}
.stat-card.s-reserved:active,
.stat-card.s-occupied:active,
.stat-card.s-free:active { transform: scale(.96); }

.stats .stat-card:not(.s-reserved) {
  opacity: .32;
  transition: opacity .2s ease;
}
.stats.has-filter .stat-card:not(.s-reserved) {
  opacity: .32;
}
.stats .stat-card.kpi-filter-active,
.stats.has-filter .stat-card.kpi-filter-active {
  opacity: 1;
  border-color: #3b82f6 !important;
  background: rgba(59,130,246,.12) !important;
}
.stats.has-filter .stat-card.s-reserved:not(.kpi-filter-active) {
  opacity: .32 !important;
}
.stats .stat-card.s-reserved,
.stats.has-filter .stat-card.s-reserved.kpi-filter-active {
  opacity: 1;
}
.stats.has-filter .stat-card.s-total,
.stats.has-filter .stat-card.s-next { cursor: default; }

/* ── Shift cycle button — top-right corner of Reserved pill ── */
.kpi-shift-btn {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #334155;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  gap: 0;
  transition: border-color .15s, background .15s, opacity .15s;
  z-index: 3;
  /* hidden by default — only shown when shifts are configured */
  opacity: 0;
  pointer-events: none;
}
/* Expand tap target to 44×44px (WCAG 2.5.5) without altering the visible 20×20 circle.
   The pseudo-element is invisible but receives pointer/touch events. */
.kpi-shift-btn::before {
  content: '';
  position: absolute;
  inset: -12px;
}
.kpi-shift-btn.has-shifts {
  opacity: 1;
  pointer-events: auto;
}
.kpi-shift-btn:active { transform: scale(.85); }

.kpi-shift-ms {
  font-size: 11px !important;
  line-height: 1;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  color: #f59e0b; /* golden — sun always this colour */
}
/* Moon overrides to indigo when night active */
.kpi-shift-btn.shift-night .kpi-shift-ms { color: #818cf8; }

/* Neutral state — sun dimmed slightly */
.kpi-shift-btn:not(.shift-active) .kpi-shift-ms { opacity: .55; }

.kpi-shift-btn.shift-active { border-color: #f59e0b; background: rgba(245,158,11,.15); }
.kpi-shift-btn.shift-night  { border-color: #818cf8; background: rgba(129,140,248,.15); }
body.light-mode .kpi-shift-btn                { background: #f1f5f9 !important; border-color: #cbd5e1 !important; }
body.light-mode .kpi-shift-btn.shift-active   { border-color: #d97706; background: rgba(217,119,6,.1); }
body.light-mode .kpi-shift-btn.shift-night    { border-color: #6366f1; background: rgba(99,102,241,.1); }

.kpi-shift-num {
  font-size: 7px;
  font-weight: 800;
  color: #f59e0b;
  line-height: 1;
  display: none;
}
.kpi-shift-btn.shift-active .kpi-shift-num { display: inline; }
.kpi-shift-btn.shift-night  .kpi-shift-num { color: #818cf8; }
body.light-mode .kpi-shift-num { color: #d97706; }
body.light-mode .kpi-shift-btn.shift-night .kpi-shift-num { color: #6366f1; }

/* hide label text in shift button when shrunk (kpi-shrunk already hides labels) */
.stats.kpi-shrunk .kpi-shift-btn { top: -5px; right: -5px; width: 16px; height: 16px; }
.stats.kpi-shrunk .kpi-shift-ms  { font-size: 9px !important; }



/* ═══════════════════════
   VIEW TOGGLE
═══════════════════════ */
.view-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  gap: 8px;
}
body.light-mode .view-toggle-wrap {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

.view-toggle { display: flex; gap: 4px; align-items: center; width: 100%; }
.view-toggle #btnSetupView { margin-left: auto; }

.vt-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #334155;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.vt-btn .material-symbols-outlined { font-size: 16px; }
.vt-btn.vt-btn-icon { padding: 6px 10px; }
.vt-btn:hover { background: rgba(148,163,184,0.08); }
.vt-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

/* ── View-toggle search pill ──────────────────────────────────── */
.vt-search-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1.5px solid #334155;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 32px;
  max-width: 180px;
  -webkit-tap-highlight-color: transparent;
}
.vt-search-pill.active {
  border-color: #3b82f6;
  background: rgba(59,130,246,0.1);
  color: #93c5fd;
}
.vt-search-icon { font-size: 15px !important; flex-shrink: 0; }
.vt-search-label { white-space: nowrap; }
.vt-search-pill.active .vt-search-label { display: none; }
.vt-search-input {
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  width: 100px;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}
.vt-search-input::-webkit-search-cancel-button,
.vt-search-input::-webkit-search-decoration { display: none; }
.vt-search-input::placeholder { color: #475569; }
.vt-search-clear {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #64748b;
  flex-shrink: 0;
}
.vt-search-clear .material-symbols-outlined { font-size: 14px !important; }
body.light-mode .vt-search-pill { border-color: #e2e8f0; color: #94a3b8; }
body.light-mode .vt-search-pill.active { border-color: #3b82f6; background: rgba(59,130,246,0.08); color: #1d4ed8; }
body.light-mode .vt-search-input { color: #0f172a; }

/* Jump-to-date arrow in search results */
.upcoming-date-jump {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #475569;
  border-radius: 6px;
  margin-left: auto;
}
.upcoming-date-jump:active { background: rgba(148,163,184,0.12); }
.upcoming-date-jump .material-symbols-outlined { font-size: 16px !important; }

/* Dim non-matching map chips */
.map-table.search-dim   { opacity: 0.18; }
.map-table.search-match { opacity: 1; }

.date-display-bar {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
}
body.light-mode .date-display-bar { color: #475569; }

/* ═══════════════════════
   DAY VIEW — SECTIONS
═══════════════════════ */
.sections-wrap { padding: 10px; display: flex; flex-direction: column; gap: 10px; }

.section-block {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  overflow: hidden;
}
body.light-mode .section-block {
  background: #fff;
  border-color: #e2e8f0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #334155;
  cursor: pointer;
  user-select: none;
}
body.light-mode .section-header { border-bottom-color: #e2e8f0; }

.section-header-name {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-count {
  font-size: 11px;
  color: #475569;
  background: #0f172a;
  border-radius: 20px;
  padding: 2px 8px;
}
body.light-mode .section-count { background: #f1f5f9; }

.section-covers-pill {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 6px;
}

.dc-late-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 7px;
  margin-left: 5px;
  vertical-align: middle;
  line-height: 1.6;
  white-space: nowrap;
}
.dc-late-pill.late-blue   { background: rgba(59,130,246,0.15);  color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.dc-late-pill.late-orange { background: rgba(245,158,11,0.15);  color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.dc-late-pill.late-red    { background: rgba(239,68,68,0.15);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
body.light-mode .dc-late-pill.late-blue   { color: #1d4ed8; }
body.light-mode .dc-late-pill.late-orange { color: #b45309; }
body.light-mode .dc-late-pill.late-red    { color: #b91c1c; }

/* ── Day view cards ───────────────────────────────────────────── */
.day-cards { display: flex; flex-direction: column; }

.day-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 16px;
  border-bottom: 1px solid rgba(51,65,85,0.6);
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.day-card[hidden] { display: none !important; }
.day-card:last-child { border-bottom: none; }
.day-card:active { background: rgba(51,65,85,0.4); }
.day-card.dc-selected { background: rgba(59,130,246,0.08); outline: 1px solid rgba(59,130,246,0.3); }
body.light-mode .day-card { border-bottom-color: #f1f5f9; }
body.light-mode .day-card:active { background: #f8fafc; }
body.light-mode .day-card.dc-selected { background: rgba(59,130,246,0.06); outline-color: rgba(59,130,246,0.25); }

/* Left colour stripe */
.day-card::before { content: none; }

/* Progress bar injected by JS — replaces static ::before */
.dc-bar {
  position: absolute;
  left: 0;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  pointer-events: none;
  transition: height 0.4s ease;
}
/* Full-height solid bar for free/cancelled — no progress needed */
.dc-bar.dc-bar-full {
  top: 8px;
  bottom: 8px;
  height: auto;
}
/* ── Semantic bar colours ─────────────────────────────────────── */
.dc-bar.dc-bar-free     { background: var(--clr-free); }
.dc-bar.dc-bar-reserved { background: var(--clr-res); }        /* blue  — not arrived yet   */
.dc-bar.dc-bar-walkin   { background: var(--clr-walkin); }     /* amber — walk-in           */
.dc-bar.dc-bar-occupied { background: #22c55e; }               /* green — seated, in svc    */
.dc-bar.dc-bar-overdue  { background: #ef4444; }               /* red   — past turn time    */
/* Legacy aliases kept for map chip */
.dc-bar.dc-bar-green    { background: #22c55e; }
.dc-bar.dc-bar-red      { background: #ef4444; }

/* Cap colours — small top pip that signals next-booking urgency */
.dc-bar::after {
  content: '';
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 6px;
  border-radius: 2px 2px 0 0;
}
.dc-bar.dc-bar-cap-violet::after { display: block; background: #a855f7; }
.dc-bar.dc-bar-cap-red::after    { display: block; background: #ef4444; }

/* Pulse on overdue bar */
.dc-bar.dc-bar-overdue {
  animation: none;
}

/* Subtle row tint for busy tables */
.day-card.status-reserved { background: var(--clr-res-tint); }
.day-card.status-walkin   { background: var(--clr-walkin-tint); }
.day-card.status-occupied { background: var(--clr-occ-tint); }
body.light-mode .day-card.status-reserved { background: var(--clr-res-tint); }
body.light-mode .day-card.status-walkin   { background: var(--clr-walkin-tint); }
body.light-mode .day-card.status-occupied { background: var(--clr-occ-tint); }

/* ── Icon block: table number + seat count ── */
.dc-icon {
  flex-shrink: 0;
  position: relative;
  overflow: visible;
  width: 46px; height: 38px;
  border-radius: 9px;
  border: 1.5px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.dc-icon.status-free     { background: var(--clr-free-bg);    border-color: var(--clr-free-border); }
.dc-icon.status-reserved { background: var(--clr-res-bg);     border-color: var(--clr-res-border); }
.dc-icon.status-walkin   { background: var(--clr-walkin-bg);  border-color: var(--clr-walkin-border); }
.dc-icon.status-occupied { background: var(--clr-occ-bg);     border-color: var(--clr-occ-border); }
body.light-mode .dc-icon.status-free     { background: var(--clr-free-bg);    border-color: var(--clr-free-border); }
body.light-mode .dc-icon.status-reserved { background: var(--clr-res-bg);     border-color: var(--clr-res-border); }
body.light-mode .dc-icon.status-walkin   { background: var(--clr-walkin-bg);  border-color: var(--clr-walkin-border); }
body.light-mode .dc-icon.status-occupied { background: var(--clr-occ-bg);     border-color: var(--clr-occ-border); }

.dc-icon-num {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #94a3b8;
}
.dc-icon.status-reserved .dc-icon-num { color: var(--clr-res-text); }
.dc-icon.status-walkin   .dc-icon-num { color: var(--clr-walkin-text); }
.dc-icon.status-occupied .dc-icon-num { color: var(--clr-occ-text); }
body.light-mode .dc-icon-num { color: #64748b; }
body.light-mode .dc-icon.status-reserved .dc-icon-num { color: var(--clr-res-text); }
body.light-mode .dc-icon.status-walkin   .dc-icon-num { color: var(--clr-walkin-text); }
body.light-mode .dc-icon.status-occupied .dc-icon-num { color: var(--clr-occ-text); }

.dc-icon-seats {
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  line-height: 1;
}

/* ── Main info ── */
.dc-main { flex: 1; min-width: 0; }

.dc-name {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
body.light-mode .dc-name { color: #0f172a; }

.dc-name.dc-empty {
  font-size: 12px;
  font-weight: 500;
  color: #475569;
}
body.light-mode .dc-name.dc-empty { color: #94a3b8; }

.dc-name.dc-walkin { color: #94a3b8; font-style: italic; }

.dc-time {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  line-height: 1;
}
body.light-mode .dc-time { color: #64748b; }

.dc-party {
  font-size: 10px;
  color: #475569;
  margin-top: 2px;
  line-height: 1;
}

/* ── Right side ── */
.dc-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.dc-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}
.dc-badge-free     { background: rgba(34,197,94,0.12);  color: #86efac; }
.dc-badge-reserved { background: var(--clr-res-bg); color: var(--clr-res-text); }
.dc-badge-occupied { background: rgba(239,68,68,0.12);  color: #fca5a5; }
.dc-badge-overdue  { background: rgba(245,158,11,0.15); color: #fcd34d; }
.dc-badge-walkin   { background: var(--clr-walkin-bg);   color: var(--clr-walkin-text); border: 1px solid var(--clr-walkin-border); }
body.light-mode .dc-badge-free     { background: rgba(34,197,94,0.1);  color: #15803d; }
body.light-mode .dc-badge-reserved { background: var(--clr-res-bg); color: var(--clr-res-text); }
body.light-mode .dc-badge-occupied { background: rgba(239,68,68,0.1);  color: #b91c1c; }
body.light-mode .dc-badge-overdue  { background: rgba(245,158,11,0.12); color: #b45309; }

.dc-free-at {
  font-size: 9px;
  color: #38bdf8;
  white-space: nowrap;
}
body.light-mode .dc-free-at { color: #0284c7; }

.dc-turnover-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  transform: none;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--clr-res-bg);
  border: 1px solid var(--clr-res-border);
  color: var(--clr-res-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
}
body.light-mode .dc-turnover-badge { background: var(--clr-res-bg); color: var(--clr-res-text); border-color: var(--clr-res-border); }

.dc-join-badge {
  font-size: 9px;
  font-weight: 700;
  background: rgba(37,99,235,0.2);
  color: #93c5fd;
  border-radius: 4px;
  padding: 1px 5px;
}

/* Small dot indicator + notes preview row (inside dc-main for upcoming cards) */
.dc-notes-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #475569;
  display: inline-block;
  flex-shrink: 0;
}
.dc-notes-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.dc-notes-preview {
  font-size: 10px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
body.light-mode .dc-notes-preview { color: #94a3b8; }

/* ═══════════════════════
   FLOOR MAP VIEW
═══════════════════════ */
.map-toolbar[hidden] { display: none !important; }
.map-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
body.light-mode .map-toolbar {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

.map-tool-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1.5px solid #3b82f6;
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.map-tool-btn:active { background: rgba(59,130,246,0.25); }
.map-tool-btn .material-symbols-outlined { font-size: 18px; }

.map-tool-btn-secondary {
  border-color: #334155;
  background: transparent;
  color: #64748b;
}
.map-tool-btn-secondary:active { background: rgba(51,65,85,0.35); }

.map-size-select-wrap { display: flex; align-items: center; gap: 6px; }
.map-size-select {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #e2e8f0;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  color-scheme: dark;
}
body.light-mode .map-size-select {
  background: #fff;
  border-color: #e2e8f0;
  color: #0f172a;
  color-scheme: light;
}

/* Canvas with 4 sections */
.map-canvas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 3px;
  padding: 3px;
  /* Clear the fixed bottom dock */
  padding-bottom: calc(var(--qr-bar-h, 100px) + max(env(safe-area-inset-bottom, 0px), 8px));
  position: relative;
}

.map-section {
  position: relative;
  min-height: 385px;
  background: rgba(255,255,255,0.02);
  border: 1.5px dashed #334155;
  border-radius: 14px;
  overflow: visible;
  transition: border-color 0.15s, background 0.15s;
}
body.light-mode .map-section {
  background: rgba(0,0,0,0.02);
  border-color: #cbd5e1;
}

/* Pick-table mode — blue tint on canvas and sections */
.map-canvas.pick-table-mode {
  background: rgba(37,99,235,0.04);
}
.map-canvas.pick-table-mode .map-section {
  background: rgba(37,99,235,0.06);
  border-color: rgba(59,130,246,0.45);
  border-style: solid;
}
body.light-mode .map-canvas.pick-table-mode {
  background: rgba(37,99,235,0.03);
}
body.light-mode .map-canvas.pick-table-mode .map-section {
  background: rgba(59,130,246,0.06);
  border-color: rgba(59,130,246,0.35);
}

.map-section.drag-over {
  border-color: #3b82f6;
  background: rgba(59,130,246,0.07);
}

/* Active section — target for Add Table */
.map-section.sec-active {
  border-color: rgba(34,197,94,0.5);
  border-style: solid;
}
body.light-mode .map-section.sec-active {
  border-color: rgba(34,197,94,0.6);
}

/* Expanded section — fills the whole map-canvas */
.map-section.expanded {
  position: absolute;
  inset: 8px;
  z-index: 10;
  min-height: unset;
  background: #0f1823;
  border-color: #475569;
  border-style: solid;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transition: border-color 0.2s, background 0.2s;
}
body.light-mode .map-section.expanded {
  background: #f8fafc;
  border-color: #94a3b8;
}
/* Dim the other sections when one is expanded */
.map-canvas.has-expanded .map-section:not(.expanded) {
  opacity: 0;
  pointer-events: none;
}
/* Label gets a subtle collapse hint when expanded */
.map-section.expanded .map-section-label {
  color: #64748b;
}
.map-section.expanded .map-section-label::after {
  content: ' ↙';
  font-size: 9px;
  opacity: 0.5;
}

.map-section-label {
  font-size: 10px;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 9500; /* must exceed dragging chip z-index (9000) so label+arrows always sit on top */
  transition: color 0.15s;
}
.map-section-label:hover { color: #475569; }
body.light-mode .map-section-label { color: #94a3b8; }
body.light-mode .map-section-label:hover { color: #64748b; }

/* Reorder pills inline in label */
.map-section-label { display: flex; align-items: center; gap: 4px; }
.sec-reorder-pills { display: flex; gap: 2px; margin-left: 4px; }
.sec-reorder-pill {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0; border: none; border-radius: 5px;
  background: rgba(51,65,85,0.6); color: #64748b; cursor: pointer;
  transition: background 0.12s, color 0.12s; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.sec-reorder-pill:hover  { background: rgba(99,102,241,0.5); color: #c7d2fe; }
.sec-reorder-pill:active { background: #6366f1; color: #fff; }
.sec-reorder-pill .material-symbols-outlined { font-size: 14px; line-height: 1; }
body.light-mode .sec-reorder-pill { background: rgba(203,213,225,0.7); color: #64748b; }
body.light-mode .sec-reorder-pill:hover { background: rgba(99,102,241,0.25); color: #4f46e5; }


/* ── Preset pills ──────────────────────────── */
.preset-pills { display: flex; gap: 3px; align-items: center; }
.preset-pill {
  width: 26px; height: 26px; border-radius: 7px;
  border: 1.5px solid #334155; background: transparent;
  color: #64748b; font-size: 11px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s; user-select: none; -webkit-tap-highlight-color: transparent;
}
.preset-pill:hover { border-color: #475569; color: #94a3b8; }
.preset-pill.active { background: rgba(56,189,248,.15); border-color: #38bdf8; color: #38bdf8; }
body.light-mode .preset-pill { border-color: #cbd5e1; color: #94a3b8; }
body.light-mode .preset-pill.active { background: rgba(2,132,199,.1); border-color: #0284c7; color: #0284c7; }

/* Section preset badge (top-right corner, opposite section label) */
.sec-preset-badge {
  position: absolute; top: 5px; right: 7px;
  font-size: 9px; font-weight: 800; letter-spacing: .05em;
  color: #38bdf8; background: rgba(56,189,248,.1); border: 1px solid rgba(56,189,248,.2);
  border-radius: 5px; padding: 1px 5px; line-height: 1.6;
  pointer-events: auto; user-select: none; cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  z-index: 3; /* below sticky header and bottom dock */
}
.sec-preset-badge:hover  { background: rgba(56,189,248,.22); }
.sec-preset-badge:active { background: rgba(56,189,248,.35); }
.sec-preset-badge.sec-badge-dimmed { opacity: 0.35; }
body.light-mode .sec-preset-badge { color: #0284c7; background: rgba(2,132,199,.06); border-color: rgba(2,132,199,.15); }
/* Badge glows when section is on a non-default preset */
.sec-preset-badge.sec-badge-active {
  color: #fbbf24; background: rgba(251,191,36,.15); border-color: rgba(251,191,36,.4);
}
.sec-preset-badge.sec-badge-active:hover { background: rgba(251,191,36,.28); }
body.light-mode .sec-preset-badge:hover { background: rgba(2,132,199,.15); }

body:not(.is-map) .sec-preset-badge { display: none !important; }
body.is-setup #fastReserveWrap,
body.is-setup #kpiBar,
body.is-map:not(.is-setup) #kpiBar { display: none; }

/* Section label hidden state (toggled by badge tap) */
.map-section-label.sec-label-hidden {
  visibility: hidden;
  pointer-events: none;
}
/* ═══════════════════════
   MAP TABLE CHIP
═══════════════════════ */
.map-table {
  position: absolute;
  cursor: pointer;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  -webkit-touch-callout: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  border: 2px solid transparent;
  /* Only transition when NOT dragging — JS removes transition during drag */
  transition: box-shadow 0.15s;
  will-change: left, top;
  z-index: 1;
  /* Base font size — chip text scales with this; JS MAP_CHIP_SCALE controls chip dimensions */
  font-size: 12px;
}
/* Scale + shadow during drag are set inline by JS so :active can't fight them */
.map-table:active { cursor: grabbing; }
/* ── Reorder mode: grab cursor only when _setupReorderMode active ── */
body.is-reorder .mgc-reorder-draggable { cursor: grab; }
body.is-reorder .mgc-reorder-draggable:active { cursor: grabbing; }

/* Blank drop-slot — dashed placeholder shown in reorder mode */
.mgc.mgc-blank-slot {
  border-style: dashed;
  border-color: rgba(148,163,184,0.2);
  background: transparent;
  cursor: default;
  pointer-events: all;
}
.mgc.mgc-blank-slot.mgc-drag-over {
  border-style: dashed;
  border-color: var(--clr-blue);
  background: var(--clr-blue-bg);
  transform: scale(1.04);
  transition: transform 0.1s, border-color 0.1s, background 0.1s;
}

/* Reorder toggle button — distinct from the secondary icon buttons */
.map-tool-btn-reorder {
  border-color: #64748b;
  background: transparent;
  color: #94a3b8;
}
.map-tool-btn-reorder.active {
  border-color: #f59e0b;
  background: rgba(245,158,11,0.12);
  color: #fbbf24;
}
.map-tool-btn-reorder:active { background: rgba(245,158,11,0.22); }
body.light-mode .map-tool-btn-reorder { border-color: #cbd5e1; color: #64748b; }
body.light-mode .map-tool-btn-reorder.active { border-color: #d97706; background: rgba(217,119,6,0.1); color: #b45309; }

/* Shape-size pills in the size modal (Large / Small squares) */
.shape-sq {
  display: inline-block;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.6;
  vertical-align: middle;
  margin-right: 0;
}
.shape-sq-lg { width: 16px; height: 16px; border-radius: 4px; }
.shape-sq-sm { width: 9px;  height: 9px;  border-radius: 2px; }

/* Map view search highlighting */
.map-table.map-search-dim { opacity: 0.2; }
.map-table.map-search-match { box-shadow: 0 0 0 2px #3b82f6, 0 4px 16px rgba(59,130,246,0.4); }

/* Status colors for map tables */
.map-table.status-free     { background: rgba(15,23,42,0.6);           border-color: #1e293b; }
.map-table.status-reserved { background: var(--clr-res-bg);            border-color: var(--clr-res-border); }
.map-table.status-walkin   { background: var(--clr-walkin-bg);         border-color: var(--clr-walkin-border); }
.map-table.status-occupied { background: var(--clr-occ-bg);            border-color: var(--clr-occ-border); }
body.light-mode .map-table.status-free     { background: rgba(241,245,249,0.8); border-color: #cbd5e1; }
body.light-mode .map-table.status-reserved { background: var(--clr-res-bg);     border-color: var(--clr-res-border); }
body.light-mode .map-table.status-walkin   { background: var(--clr-walkin-bg);  border-color: var(--clr-walkin-border); }
body.light-mode .map-table.status-occupied { background: var(--clr-occ-bg);     border-color: var(--clr-occ-border); }

/* ── Chip progress bar ─────────────────────────────────────── */
.map-table-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 4px;
  border-radius: 0 2px 0 0;
  pointer-events: none;
  transition: height 0.4s ease;
}
/* Round chips — bar clipped by overflow:hidden on the circle, soften top corner */
.map-table.shape-round .map-table-bar {
  width: 5px;
  border-radius: 0 3px 0 0;
}
/* Square chips — match bottom-left corner radius */
.map-table.shape-square .map-table-bar {
  border-radius: 0 2px 0 2px;
}
.map-table-bar.bar-green { background: #16a34a; }
.map-table-bar.bar-red   { background: #dc2626; }

.map-table-num {
  font-size: 1.25em;
  font-weight: 700;
  line-height: 1;
  color: #f0e0c8;
}
body.light-mode .map-table-num { color: #8c6a45; }

.map-table-size {
  font-size: 0.83em;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  line-height: 1;
}
.map-table.status-free .map-table-size     { color: rgba(148,163,184,0.5); }
.map-table.status-reserved .map-table-size { color: var(--clr-res-text); opacity: 0.7; }
.map-table.status-walkin .map-table-size   { color: var(--clr-walkin-text); opacity: 0.7; }
.map-table.status-occupied .map-table-size { color: var(--clr-occ-text); opacity: 0.7; }
body.light-mode .map-table.status-free     .map-table-size { color: rgba(100,116,139,0.5); }
body.light-mode .map-table.status-reserved .map-table-size { color: var(--clr-res-text); opacity: 0.8; }
body.light-mode .map-table.status-walkin   .map-table-size { color: var(--clr-walkin-text); opacity: 0.8; }
body.light-mode .map-table.status-occupied .map-table-size { color: var(--clr-occ-text); opacity: 0.8; }

.map-table-init {
  font-size: 0.95em;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.02em;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  max-width: calc(100% - 6px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-table.status-reserved .map-table-init { color: var(--clr-res-text);    background: var(--clr-res-bg); }
.map-table.status-walkin   .map-table-init { color: var(--clr-walkin-text); background: var(--clr-walkin-bg); }
.map-table.status-occupied .map-table-init { color: var(--clr-occ-text);    background: var(--clr-occ-bg); }
body.light-mode .map-table.status-reserved .map-table-init { color: var(--clr-res-text);    background: var(--clr-res-bg); }
body.light-mode .map-table.status-walkin   .map-table-init { color: var(--clr-walkin-text); background: var(--clr-walkin-bg); }
body.light-mode .map-table.status-occupied .map-table-init { color: var(--clr-occ-text);    background: var(--clr-occ-bg); }

/* Joined outline */
.map-table.is-joined {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

/* ═══════════════════════════════════════════
   MAP GRID VIEW  —  card-based layout
   Active when body.is-map and NOT body.is-setup
═══════════════════════════════════════════ */

/* Section: flex column, shrinks to content */
body.is-map:not(.is-setup) .map-section {
  min-height: unset;
  overflow: visible;
  display: flex;
  flex-direction: column;
  padding: 0 0 12px;
}

/* Always show section label in grid map view */
body.is-map:not(.is-setup) .map-section-label {
  visibility: visible !important;
  pointer-events: auto;
  color: var(--clr-text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 12px 6px;
}

/* Exactly 2 cards per row, square aspect ratio */
.map-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 0 10px;
}

/* ── Card — matches .tbl from redesign ── */
.mgc {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  border: 1.5px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.18s, background 0.18s, opacity 0.15s;
  overflow: hidden;
}
.mgc:active { opacity: 0.72; }

/* Status colours — exact matches from redesign */
.mgc.status-free {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.25);
}
.mgc.status-reserved {
  background: var(--clr-res-bg);
  border-color: var(--clr-res-border);
}
.mgc.status-walkin {
  background: var(--clr-walkin-bg);
  border-color: var(--clr-walkin-border);
}
.mgc.status-occupied {
  background: var(--clr-occ-bg);
  border-color: var(--clr-occ-border);
}

body.light-mode .mgc.status-free     { background: rgba(34,197,94,0.06);  border-color: rgba(34,197,94,0.2); }
body.light-mode .mgc.status-reserved { background: var(--clr-res-bg);     border-color: var(--clr-res-border); }
body.light-mode .mgc.status-walkin   { background: var(--clr-walkin-bg);  border-color: var(--clr-walkin-border); }
body.light-mode .mgc.status-occupied { background: var(--clr-occ-bg);     border-color: var(--clr-occ-border); }

/* Interaction states */
.mgc.is-joined        { outline: 2px solid #2563eb; outline-offset: 1px; }
.mgc.map-search-dim   { opacity: 0.15; }
.mgc.map-search-match { box-shadow: 0 0 0 2px #3b82f6, 0 4px 16px rgba(59,130,246,0.35); }
.mgc.join-pick-master   { outline: 2px solid #3b82f6; outline-offset: 2px; }
.mgc.join-pick-selected { outline: 2px solid #22c55e; outline-offset: 2px; }
.mgc.join-pick-idle     { opacity: 0.45; }

/* Table number — large, bold, status-coloured */
.mgc-num {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}
.mgc.status-free     .mgc-num { color: var(--clr-free-text); }
.mgc.status-reserved .mgc-num { color: var(--clr-res-text); }
.mgc.status-walkin   .mgc-num { color: var(--clr-walkin-text); }
.mgc.status-occupied .mgc-num { color: var(--clr-occ-text); }
.mgc-num.mgc-num-dim    { opacity: 0.22; }
.mgc-num.mgc-num-master { text-shadow: 0 0 12px currentColor; }

/* "X seats" caption */
.mgc-cap {
  font-size: 12px;
  font-weight: 400;
  color: var(--clr-text-muted);
  line-height: 1;
}

/* Guest initials pill — "AF · 6/4" style, bottom of card */
.mgc-init {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  max-width: calc(100% - 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.6;
  margin-top: 2px;
}
.mgc.status-reserved .mgc-init { color: var(--clr-res-text);    background: rgba(59,130,246,0.15); }
.mgc.status-walkin   .mgc-init { color: var(--clr-walkin-text); background: var(--clr-walkin-bg); }
.mgc.status-occupied .mgc-init { color: var(--clr-occ-text);    background: rgba(239,68,68,0.18); }
.mgc-init.mgc-init-dim { opacity: 0.35; }

/* Elapsed time — top-right corner, matches .tbl-timer from redesign */
.mgc-elapsed {
  position: absolute;
  top: 7px;
  right: 8px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  color: var(--clr-text-muted);
  font-variant-numeric: tabular-nums;
}
.mgc-elapsed.elapsed-warn { color: #f87171; }

/* Progress bar — bottom edge */
.mgc-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 0 14px;
  pointer-events: none;
  transition: width 0.4s ease;
}
.mgc-bar.bar-green { background: #16a34a; }
.mgc-bar.bar-red   { background: #dc2626; }

/* Turnover badge — top-left */
.mgc > .dc-turnover-badge {
  position: absolute;
  top: 7px;
  left: 8px;
  font-size: 9px;
}

/* Setup mode card — neutral, dashed border */
.mgc.mgc-setup {
  border-style: dashed;
  border-color: var(--clr-border-mid);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
}
.mgc.mgc-setup:active { opacity: 0.72; }
body.light-mode .mgc.mgc-setup { background: rgba(0,0,0,0.02); border-color: #cbd5e1; }
.mgc.mgc-setup .mgc-num { color: var(--clr-text-muted); }
.mgc.mgc-setup .mgc-cap { color: var(--clr-text-dim); }

/* Drag states */
.mgc.mgc-dragging {
  opacity: 0.35;
  cursor: grabbing;
}
.mgc.mgc-drag-over {
  border-style: solid;
  border-color: var(--clr-blue);
  background: var(--clr-blue-bg);
  transform: scale(1.04);
  transition: transform 0.1s, border-color 0.1s, background 0.1s;
}



/* ═══════════════════════
   MODALS
═══════════════════════ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  padding-bottom: calc(var(--qr-bar-h, 60px) + env(safe-area-inset-bottom));
  z-index: 10000;
  background: rgba(0,0,0,0.65);
  align-items: flex-end;
  justify-content: center;
}
.modal.show { display: flex; }

.settings-popover {
  align-items: flex-start;
  justify-content: flex-start;
  background: transparent;
  pointer-events: none;
  padding-bottom: 0;
}
.settings-popover.show { pointer-events: auto; }
.settings-popover .modal-content { pointer-events: auto; }

.modal-content {
  background: #1e293b;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #e2e8f0;
  animation: slideUp 0.22s ease;
}
.settings-popover .modal-content {
  border-radius: 14px;
  max-width: 260px;
  animation: ctxPop 0.12s ease;
  position: fixed;
}

body.light-mode .modal-content {
  background: #fff;
  color: #0f172a;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #334155;
}
body.light-mode .modal-header { border-bottom-color: #f1f5f9; }

.modal-title { font-size: 16px; font-weight: 700; color: #e2e8f0; }
body.light-mode .modal-title { color: #0f172a; }

.close-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  border-radius: 8px; cursor: pointer;
  color: #64748b;
}
.close-btn:hover { background: rgba(148,163,184,0.12); }
.close-btn .material-symbols-outlined { font-size: 20px; }

.modal-body { padding: 14px 18px; overflow-y: auto; overflow-x: visible; flex: 1; }

/* ═══════════════════════
   SETTINGS
═══════════════════════ */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 6px;
  border-bottom: 1px solid rgba(51,65,85,0.5);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s;
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: rgba(51,65,85,0.35); }
body.light-mode .settings-item { border-bottom-color: rgba(226,232,240,0.8); }
body.light-mode .settings-item:hover { background: rgba(226,232,240,0.4); }

.settings-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: #e2e8f0;
}
body.light-mode .settings-label { color: #0f172a; }
.settings-label .material-symbols-outlined { color: #64748b; font-size: 20px; }

.settings-toggle .toggle-switch {
  width: 40px; height: 22px;
  border-radius: 11px;
  background: #334155;
  position: relative;
  transition: background 0.2s;
}
.settings-toggle.active .toggle-switch { background: #2563eb; }
.settings-toggle .toggle-switch::after {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.settings-toggle.active .toggle-switch::after { transform: translateX(18px); }

/* ═══════════════════════
   FORM ELEMENTS
═══════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-group label { font-size: 12px; font-weight: 700; color: #64748b; }

.form-row { flex-direction: row; gap: 10px; }
.form-row > div { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 12px; font-weight: 700; color: #64748b; }

.ee-input {
  padding: 11px 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  font-size: 14px;
  background: rgba(15,23,42,0.4);
  color: #e2e8f0;
  box-sizing: border-box;
  width: 100%;
  outline: none;
  font-family: inherit;
}
.ee-input:focus { border-color: #3b82f6; background: rgba(15,23,42,0.6); }
.ee-input::placeholder { color: #475569; }

body.light-mode .ee-input {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}
body.light-mode .ee-input:focus { border-color: #3b82f6; background: #fff; }
body.light-mode .ee-input::placeholder { color: #94a3b8; }

textarea.ee-input { resize: vertical; }

.form-actions {
  display: flex; gap: 10px; margin-top: 4px;
}

.btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.btn:hover { background: #1d4ed8; }
.btn:active { background: #1e40af; transform: scale(0.99); }
.btn.secondary {
  background: transparent;
  border: 1.5px solid #334155;
  color: #94a3b8;
}
.btn.secondary:hover { background: rgba(51,65,85,0.35); }
body.light-mode .btn.secondary {
  border-color: #e2e8f0;
  color: #64748b;
}

/* Contact search in modal */
/* Footer row under contact search: pill spans full width, table num sits to its right */
.reserve-contact-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
/* Pill stretches to fill the footer, matching the search input width exactly */
.reserve-contact-footer .selected-contact-pill {
  flex: 1;
  min-width: 0;
  margin-top: 0;
  width: 100%;
}
.reserve-contact-footer .reserve-table-display {
  flex-shrink: 0;
}

/* Reserve modal table display (read-only pill) */
.reserve-table-display {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #94a3b8;
  text-align: center;
  cursor: default;
  user-select: none;
  width: 52px;
  padding: 8px 6px;
}
body.light-mode .reserve-table-display { color: #475569; }


.contact-search-wrap { position: relative; }
.contact-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0 0 10px 10px;
  z-index: 11000;
  max-height: 260px;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
body.light-mode .contact-dropdown {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.contact-option {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #334155;
  font-size: 13px;
  display: flex; align-items: center; gap: 9px;
  transition: background 0.1s;
}
body.light-mode .contact-option { border-bottom-color: #f1f5f9; }
.contact-option:hover { background: rgba(59,130,246,0.12); }
.contact-option:last-child { border-bottom: none; }
.contact-option-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #1e40af;
  color: #bfdbfe;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.contact-option-name { font-weight: 500; color: #e2e8f0; }
.contact-option-sub  { font-size: 11px; color: #64748b; margin-top: 1px; }
body.light-mode .contact-option-name { color: #0f172a; }

/* Selected contact pill */
.selected-contact-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(37,99,235,0.12);
  border: 1px solid rgba(37,99,235,0.3);
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 6px;
}
.selected-contact-pill[hidden] { display: none; }
.selected-contact-pill-clear {
  background: transparent; border: none; cursor: pointer;
  color: #64748b; display: flex; align-items: center;
  padding: 0; flex-shrink: 0;
}
.selected-contact-pill-clear .material-symbols-outlined { font-size: 18px; }
.selected-contact-pill-clear:hover { color: #f87171; }

/* ═══════════════════════
   SIZE GRID
═══════════════════════ */

/* ── Shape toggle (size modal) ── */
.shape-toggle {
  display: flex; gap: 4px; align-items: center; margin-left: auto; margin-right: 8px;
}
.shape-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1.5px solid #334155; background: transparent;
  color: #64748b; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.shape-icon {
  font-size: 20px !important;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20 !important;
}
.shape-btn:hover { border-color: #475569; color: #94a3b8; }
.shape-btn.active { border-color: #3b82f6; background: rgba(59,130,246,0.18); color: #60a5fa; }
body.light-mode .shape-btn { border-color: #cbd5e1; color: #94a3b8; }
body.light-mode .shape-btn:hover { border-color: #94a3b8; color: #475569; }
body.light-mode .shape-btn.active { border-color: #2563eb; background: rgba(37,99,235,0.12); color: #2563eb; }

/* Map chip shapes */
.map-table.shape-round     { border-radius: 50% !important; }
.map-table.shape-square    { border-radius: 4px !important; }
.map-table.shape-rect-tall { border-radius: 9px !important; }

/* Size grid — 5 columns, compact */
.size-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.size-option {
  padding: 10px 0;
  border-radius: 8px;
  border: 1.5px solid #334155;
  background: transparent;
  color: #94a3b8;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.size-option:hover { border-color: #3b82f6; color: #60a5fa; background: rgba(59,130,246,0.10); }
.size-option.active { border-color: #3b82f6; background: rgba(59,130,246,0.2); color: #60a5fa; }

/* ═══════════════════════
   TOAST
═══════════════════════ */
/* ── Date change banner ───────────────────────────────────── */
#_dateBanner {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  pointer-events: none;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
  opacity: 0;
  transform: scale(0.88);
  transition: none;
}
#_dateBanner._db-in {
  animation: _dbIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards,
             _dbOut 0.4s ease-in 1.4s forwards;
}
#_dateBanner._db-out {
  opacity: 0;
}
@keyframes _dbIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes _dbOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.06); }
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════
   RESERVATION INFO CARD (in day view)
═══════════════════════ */
.res-info-card {
  background: var(--clr-res-bg);
  border: 1px solid var(--clr-res-border);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 4px 14px 10px;
}
.res-info-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--clr-res-text);
  margin-bottom: 3px;
}
.res-info-row:last-child { margin-bottom: 0; }
.res-info-row .material-symbols-outlined { font-size: 14px; }
.res-info-label { color: #94a3b8; }

/* ═══════════════════════
   EMPTY STATE
═══════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 10px;
  color: #475569;
  font-size: 15px;
  text-align: center;
}

/* Dark/light input[type=date] */
input[type="date"], input[type="time"] {
  color-scheme: dark;
}
body.light-mode input[type="date"],
body.light-mode input[type="time"] {
  color-scheme: light;
}

/* ═══════════════════════
   HOURS & SHIFTS EDITOR
═══════════════════════ */
.shifts-opening-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(56,189,248,0.06);
  border: 1px solid rgba(56,189,248,0.18);
  border-radius: 12px;
  margin-bottom: 16px;
}
.shifts-opening-label {
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: .06em;
  flex: 1;
}
body.light-mode .shifts-opening-label { color: #0284c7; }
.shifts-opening-row .ee-input {
  width: 108px;
  flex-shrink: 0;
  padding: 8px 10px;
  font-size: 13px;
  text-align: center;
}
.shifts-opening-row .ee-input:disabled {
  opacity: 0.45;
  cursor: default;
}

.shifts-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
  margin-top: 4px;
}

.shift-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  margin-bottom: 7px;
  transition: border-color .15s;
}
.shift-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
body.light-mode .shift-row { background: #f8fafc; border-color: #e2e8f0; }
.shift-row:focus-within { border-color: #3b82f6; }

.shift-duration-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  font-size: 11px;
}
body.light-mode .shift-duration-row { background: rgba(0,0,0,0.04); }
.shift-dur-label {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--clr-text-dim, #475569);
  flex-shrink: 0;
}
.shift-dur-stat {
  font-size: 11px; color: #64748b; min-width: 24px; text-align: center;
}
.shift-dur-sep { color: #334155; }
.shift-dur-input {
  width: 52px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
  text-align: center;
  border-radius: 6px !important;
}
.shift-dur-unit {
  font-size: 11px; color: #64748b;
}

.shift-row-type {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
  border: 1.5px solid transparent;
}
.shift-row-type.day  { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.3); }
.shift-row-type.night{ background: rgba(99,102,241,.12); border-color: rgba(99,102,241,.3); }
.shift-row-type:active { transform: scale(.92); }

.shift-name-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  font-family: inherit;
  min-width: 0;
}
body.light-mode .shift-name-input { color: #0f172a; }
.shift-name-input:disabled { opacity: .45; }
.shift-name-input::placeholder { color: #475569; }

.shift-time-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.shift-time-inputs .ee-input {
  width: 90px;
  padding: 7px 8px;
  font-size: 12px;
  text-align: center;
}
.shift-time-inputs .ee-input:disabled { opacity: .45; cursor: default; }
.shift-time-sep {
  font-size: 11px;
  color: #475569;
  flex-shrink: 0;
}

.shift-delete-btn {
  width: 28px; height: 28px;
  border: none; background: transparent;
  border-radius: 7px;
  color: #475569;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.shift-delete-btn:hover { color: #f87171; background: rgba(239,68,68,.1); }
.shift-delete-btn .material-symbols-outlined { font-size: 18px; }

.shifts-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px;
  border: 1.5px dashed #334155;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: border-color .15s, color .15s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.shifts-add-btn:hover { border-color: #3b82f6; color: #60a5fa; }
.shifts-add-btn .material-symbols-outlined { font-size: 18px; }

.shifts-readonly-note {
  font-size: 12px;
  color: #475569;
  text-align: center;
  padding: 8px 0 4px;
  font-style: italic;
}

/* ═══════════════════════
   SCROLLBAR (dark)
═══════════════════════ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }
body.light-mode ::-webkit-scrollbar-thumb { background: #cbd5e1; }


/* ═══════════════════════
   STATUS SHEET
═══════════════════════ */
.status-sheet-content {
  max-width: 480px;
  /* Top corners rounded, bottom corners SQUARE — snaps to bottom dock top */
  border-radius: 20px 20px 0 0 !important;
  width: 100%;
  /* max-height set dynamically in JS to fastReserveWrap.getBoundingClientRect().top */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #1e293b;
  box-shadow: -4px -4px 24px rgba(0,0,0,0.4), 4px 0 24px rgba(0,0,0,0.4);
}
body.light-mode .status-sheet-content { background: #fff; box-shadow: -2px -4px 16px rgba(0,0,0,0.1), 2px 0 16px rgba(0,0,0,0.1); }
.status-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.ss-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid #334155;
  background: #1e293b;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.ss-action:active { background: #0f172a; }
body.light-mode .ss-action { background: #f8fafc; border-color: #e2e8f0; }
body.light-mode .ss-action:active { background: #f1f5f9; }

.ss-action-icon {
  font-size: 22px;
  flex-shrink: 0;
  color: #64748b;
}
.ss-action-label {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.2;
}
body.light-mode .ss-action-label { color: #0f172a; }
.ss-action-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

/* Status sheet modal: no padding-bottom — sheet snaps to bottom dock via JS maxHeight */
#statusSheet {
  padding-bottom: 0;
}

/* Status sheet: no header — remove entirely */
#statusSheet .modal-header {
  display: none;
}

/* When status sheet is open, dock fuses seamlessly */
.search-wrap.sheet-open {
  border-top: 1px solid rgba(59,130,246,0.22);
  box-shadow: none;
}
body.light-mode .search-wrap.sheet-open {
  border-top: 1px solid rgba(59,130,246,0.18);
}
/* Hide the dock results row while sheet is open — identity footer shows context instead */
.search-wrap.sheet-open .search-results {
  display: none !important;
}

/* Per-action accent colours */
.ss-free   .ss-action-icon { color: #22c55e; }
.ss-free   { border-color: rgba(34,197,94,0.3); }
.ss-reserve .ss-action-icon { color: #38bdf8; }
.ss-reserve { border-color: rgba(56,189,248,0.25); }
.ss-occupy .ss-action-icon { color: var(--clr-res); }
.ss-walkin .ss-action-icon { color: #a78bfa; }
.ss-walkin { border-color: rgba(167,139,250,0.25); }
.ss-arrived .ss-action-icon { color: #ef4444; }
.ss-arrived { border-color: rgba(239,68,68,0.3); }
.ss-done .ss-action-icon { color: #22c55e; }
.ss-done { border-color: rgba(34,197,94,0.3); }
.ss-occupy { border-color: var(--clr-res-border); }
.ss-cancel .ss-action-icon { color: #ef4444; }
.ss-cancel { border-color: rgba(239,68,68,0.25); }
.ss-restore .ss-action-icon { color: #a78bfa; }
.ss-restore { border-color: rgba(167,139,250,0.3); }
.ss-noshow .ss-action-icon { color: #f59e0b; }
.ss-noshow { border-color: rgba(245,158,11,0.3); }
.ss-setup .ss-action-icon { color: #94a3b8; }
.ss-setup { border-color: rgba(148,163,184,0.2); }
.ss-setup-danger .ss-action-icon { color: #ef4444; }
.ss-setup-danger { border-color: rgba(239,68,68,0.3); }

/* ── Status group headers in day view ── */
.section-header-name.grp-occupied  { color: #fca5a5; }
.section-header-name.grp-reserved  { color: var(--clr-res-text); }
.section-header-name.grp-free      { color: #86efac; }
.section-header-name.grp-cancelled  { color: #94a3b8; }
.section-header-name.grp-unassigned { color: #c084fc; }
body.light-mode .section-header-name.grp-occupied  { color: #b91c1c; }
body.light-mode .section-header-name.grp-reserved  { color: var(--clr-res-text); }
body.light-mode .section-header-name.grp-free      { color: #15803d; }
body.light-mode .section-header-name.grp-cancelled  { color: #64748b; }
body.light-mode .section-header-name.grp-unassigned { color: #7c3aed; }

/* ── Cancelled reservation row ── */
.dc-cancelled-row { opacity: 0.45; }
.dc-cancelled-row:active { opacity: 0.6; }
.dc-cancelled-row .dc-bar { background: #475569 !important; }
.dc-name-cancelled  { text-decoration: line-through; color: #94a3b8; }
.dc-time-cancelled  { text-decoration: line-through; color: #64748b; }
.dc-party-cancelled { text-decoration: line-through; color: #64748b; }
.dc-badge-cancelled {
  background: rgba(100,116,139,0.15);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  cursor: pointer;
}
body.light-mode .dc-cancelled-row { opacity: 0.4; }
body.light-mode .dc-name-cancelled  { color: #94a3b8; }
body.light-mode .dc-badge-cancelled { background: rgba(100,116,139,0.1); color: #64748b; }
.ss-edit   .ss-action-icon { color: #a78bfa; }
.ss-edit   { border-color: rgba(167,139,250,0.25); }

/* Map table highlight pulse (when navigated from day view icon tap) */
@keyframes map-highlight-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(59,130,246,0.7), 0 2px 8px rgba(0,0,0,0.25); }
  50%  { box-shadow: 0 0 0 8px rgba(59,130,246,0),   0 2px 8px rgba(0,0,0,0.25); }
  100% { box-shadow: 0 0 0 0   rgba(59,130,246,0),   0 2px 8px rgba(0,0,0,0.25); }
}
.map-table-highlight {
  animation: map-highlight-pulse 0.6s ease-out 3;
  z-index: 50 !important;
}

/* ── Inline Header Date Strip ───────────────────────────── */
/* title-slot now stretches to fill center of header */
.title-slot {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.title-hall { position: absolute; margin: 0; transition: opacity .3s ease, transform .3s ease; }
.title-hall.gone { opacity: 0; transform: translateY(-8px); pointer-events: none; }
/* title-date-nav: full-width row. Uses opacity not display so hidden attr doesn't conflict */
.title-date-nav {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.title-date-nav.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
/* override hidden attribute so strip stays in layout */
#titleDateNav[hidden] { display: flex; }

.date-strip-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.date-strip-wrap::before,
.date-strip-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 18px;
  z-index: 2;
  pointer-events: none;
}
.date-strip-wrap::before { left: 0;  background: linear-gradient(to right, #0f172a, transparent); }
.date-strip-wrap::after  { right: 0; background: linear-gradient(to left,  #0f172a, transparent); }
body.light-mode .date-strip-wrap::before { background: linear-gradient(to right, #f8fafc, transparent); }
body.light-mode .date-strip-wrap::after  { background: linear-gradient(to left,  #f8fafc, transparent); }

.date-strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 2px 18px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  align-items: center;
}
.date-strip::-webkit-scrollbar { display: none; }

.ds-chip {
  flex: 0 0 auto;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 3px 7px;
  cursor: pointer;
  min-width: 38px;
  transition: background .12s, border-color .12s, transform .08s;
  -webkit-tap-highlight-color: transparent;
  color: #64748b;
  font-family: inherit;
}
.ds-chip:active { transform: scale(.88); }
.ds-chip:hover  { background: rgba(255,255,255,.07); color: #cbd5e1; }

.ds-dow {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1;
}
.ds-num {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
}
.ds-chip.ds-today { color: #38bdf8; }
.ds-chip.ds-active {
  background: #1e40af;
  border-color: #3b82f6;
  color: #fff;
}
.ds-chip.ds-active .ds-dow { color: rgba(255,255,255,.7); }
.ds-chip.ds-active.ds-today { background: #0c4a6e; border-color: #38bdf8; }

/* light mode */
body.light-mode .ds-chip { color: #94a3b8; }
body.light-mode .ds-chip:hover { background: rgba(0,0,0,.06); color: #475569; }
body.light-mode .ds-chip.ds-today { color: #0284c7; }
body.light-mode .ds-chip.ds-active { background: #2563eb; border-color: #3b82f6; color: #fff; }
body.light-mode .ds-chip.ds-active.ds-today { background: #0369a1; border-color: #0284c7; }

/* ── Today shortcut pill ─────────────────────────────────── */
.tdn-today-btn {
  flex: 0 0 auto;
  background: rgba(56,189,248,.12);
  border: 1.5px solid rgba(56,189,248,.35);
  color: #38bdf8;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  margin-left: 2px;
}
.tdn-today-btn:active { transform: scale(.9); }
.tdn-today-btn:hover  { background: rgba(56,189,248,.22); border-color: rgba(56,189,248,.6); }
body.light-mode .tdn-today-btn { background: rgba(2,132,199,.1); border-color: rgba(2,132,199,.3); color: #0284c7; }
body.light-mode .tdn-today-btn:hover { background: rgba(2,132,199,.18); border-color: rgba(2,132,199,.55); }

/* ── Today icon button (header right) ───────────────────── */
.today-icon-btn {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(248,251,255,0.06);
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #f472b6;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  flex-direction: column;
  gap: 0;
  line-height: 1;
  transition: background .15s, transform .1s;
}
.today-icon-btn[hidden] { display: none; }
.today-icon-btn:active { background: rgba(51,65,85,0.55); transform: scale(0.95); }
body.light-mode .today-icon-btn { border-color: #e2e8f0; background: #f8fafc; color: #ec4899; }
body.light-mode .today-icon-btn:active { background: #e2e8f0; }

/* ── Selected contact pill (with edit) ───────────────────── */
.selected-contact-pill-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.selected-contact-pill-name  { font-size: 13px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selected-contact-pill-phone { font-size: 11px; color: #64748b; white-space: nowrap; }
.selected-contact-pill-edit {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.selected-contact-pill-edit .material-symbols-outlined { font-size: 16px; }
.selected-contact-pill-edit:hover { color: #38bdf8; background: rgba(56,189,248,.1); }
body.light-mode .selected-contact-pill-name  { color: #0f172a; }
body.light-mode .selected-contact-pill-edit:hover { color: #0284c7; background: rgba(2,132,199,.1); }

/* ── Add new contact row in dropdown ─────────────────────── */
.contact-option-add {
  border-top: 1px solid rgba(255,255,255,.07);
  margin-top: 2px;
  padding-top: 8px;
  gap: 10px;
}
body.light-mode .contact-option-add { border-top-color: rgba(0,0,0,.07); }

/* ── Contact edit row: icon-only save/cancel ────────────────── */
.ctc-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 6px;
  flex-shrink: 0;
  color: #64748b;
  transition: color .15s, background .15s;
}
.ctc-icon-btn .material-symbols-outlined { font-size: 14px; }
.ctc-save-btn:hover   { color: #34d399; background: rgba(52,211,153,.1); }
.ctc-cancel-btn:hover { color: #f87171; background: rgba(248,113,113,.1); }

/* ── Time picker input (read-only, looks clickable) ─────────── */
.time-picker-input {
  cursor: pointer;
  caret-color: transparent;
  user-select: none;
}
.time-picker-input:focus { outline: none; border-color: #3b82f6; }

/* ── Time drum ──────────────────────────────────────────────── */
/*   #reserveStartDrum lives on <body> so position:fixed is      */
/*   never broken by an ancestor with overflow:auto (iOS/Safari) */
#reserveStartDrum {
  position: fixed;
  z-index: 10200;
  pointer-events: auto;
  touch-action: pan-y;
  /* sizing / scroll */
  width: 220px;
  max-width: calc(100vw - 16px);
  overflow-y: auto;
  overflow-x: hidden;
  /* appearance */
  background: #0d1525;
  border: 1px solid rgba(99,179,237,.22);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(99,179,237,.06),
    0 16px 48px rgba(0,0,0,.7),
    0 4px 12px rgba(0,0,0,.4);
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,179,237,.18) transparent;
  /* smooth open */
  animation: drumPop .15s cubic-bezier(.34,1.3,.64,1) both;
}
body.light-mode #reserveStartDrum {
  background: #fff;
  border-color: rgba(37,99,235,.18);
  box-shadow:
    0 0 0 1px rgba(37,99,235,.06),
    0 16px 48px rgba(0,0,0,.18),
    0 4px 12px rgba(0,0,0,.08);
}
@keyframes drumPop {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* ── Legacy .time-drum class (used by JS className assignment) ─ */
.time-drum { /* no extra styles needed — #reserveStartDrum carries everything */ }

.time-drum-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: .01em;
  transition: background .1s, color .1s;
  border-left: 2px solid transparent;
}
.time-drum-slot:hover {
  background: rgba(99,179,237,.08);
  color: #cbd5e1;
}
.time-drum-slot.active {
  background: rgba(59,130,246,.14);
  border-left-color: #3b82f6;
  color: #93c5fd;
  font-weight: 700;
}
body.light-mode .time-drum-slot       { color: #64748b; }
body.light-mode .time-drum-slot:hover { background: rgba(37,99,235,.07); color: #1e40af; }
body.light-mode .time-drum-slot.active{ background: rgba(37,99,235,.1); border-left-color: #2563eb; color: #1d4ed8; font-weight: 700; }
.time-drum-slot.td-past { opacity: 0.3; text-decoration: line-through; cursor: default; }

.tds-time {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
}
.tds-label {
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56,189,248,.1);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.form-row > div { position: relative; overflow: visible; }


/* ═══════════════════════════════════════════
   SORT PILLS — section header
═══════════════════════════════════════════ */
.section-header {
  flex-wrap: nowrap;
  gap: 8px;
}
.section-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.section-sort-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.sort-pill {
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #334155;
  background: transparent;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: .02em;
}
.sort-pill:hover { border-color: #475569; color: #94a3b8; background: rgba(255,255,255,.04); }
.sort-pill.active {
  background: rgba(56,189,248,.12);
  border-color: rgba(56,189,248,.4);
  color: #38bdf8;
}
body.light-mode .sort-pill { border-color: #e2e8f0; color: #94a3b8; }
body.light-mode .sort-pill:hover { border-color: #cbd5e1; color: #475569; }
body.light-mode .sort-pill.active { background: rgba(2,132,199,.08); border-color: rgba(2,132,199,.3); color: #0284c7; }

/* ═══════════════════════════════════════════
   KPI TOTAL PILL
═══════════════════════════════════════════ */
.stat-card.s-total { position: relative; }
.kpi-total-pill {
  position: absolute;
  top: -6px; right: -6px;
  font-size: 9px; font-weight: 800; letter-spacing: .04em;
  color: #a78bfa;
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.35);
  border-radius: 5px;
  padding: 1px 5px;
  line-height: 1.6;
  pointer-events: none;
  user-select: none;
  z-index: 3;
  display: none;
}
body.light-mode .kpi-total-pill {
  color: #7c3aed;
  background: rgba(124,58,237,.08);
  border-color: rgba(124,58,237,.2);
}

/* ═══════════════════════════════════════════
   RESERVATION MODAL — redesigned
═══════════════════════════════════════════ */
.reserve-modal-header {
  padding: 18px 18px 14px;
  background: linear-gradient(135deg, rgba(37,99,235,.08) 0%, transparent 60%);
  border-bottom: 1px solid #253348;
}
body.light-mode .reserve-modal-header {
  background: linear-gradient(135deg, rgba(37,99,235,.04) 0%, transparent 60%);
  border-bottom-color: #e2e8f0;
}
.reserve-modal-title-group { display: flex; flex-direction: column; gap: 2px; }
.reserve-modal-subtitle {
  font-size: 12px;
  color: #3b82f6;
  font-weight: 500;
  min-height: 16px;
}
.reserve-modal-body { padding: 16px 18px; }

/* Field labels with icon */
.reserve-field-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 0;
}
.reserve-label-icon {
  font-size: 14px !important;
  color: #475569;
}
.reserve-label-optional {
  font-size: 10px;
  font-weight: 500;
  color: #334155;
  text-transform: lowercase;
  letter-spacing: 0;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(51,65,85,.4);
  border-radius: 4px;
}
body.light-mode .reserve-label-optional { background: #f1f5f9; color: #94a3b8; }

.reserve-contact-group { margin-bottom: 10px; }
.reserve-contact-input { padding-left: 14px; }

/* Party size stepper */
.party-stepper-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.party-step-btn {
  width: 38px; height: 42px;
  border: 1.5px solid #334155;
  background: rgba(255,255,255,.03);
  border-radius: 10px;
  color: #64748b;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.party-step-btn:hover { border-color: #3b82f6; color: #60a5fa; background: rgba(59,130,246,.1); }
.party-step-btn:active { transform: scale(.9); }
.party-step-btn .material-symbols-outlined { font-size: 18px; }
.party-step-plus { border-color: rgba(59,130,246,.5); background: rgba(59,130,246,.08); color: #60a5fa; }
body.light-mode .party-step-btn { border-color: #e2e8f0; background: #f8fafc; color: #94a3b8; }
body.light-mode .party-step-btn:hover { border-color: #2563eb; color: #2563eb; background: rgba(37,99,235,.06); }
body.light-mode .party-step-plus { border-color: rgba(37,99,235,.4); background: rgba(37,99,235,.06); color: #2563eb; }

.party-size-input {
  width: 72px !important;
  text-align: center;
  font-size: 18px !important;
  font-weight: 700 !important;
  padding: 9px 8px !important;
}
.party-quick-pills {
  display: flex;
  gap: 3px;
  margin-left: 4px;
  overflow-x: auto;
  flex-shrink: 1;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.party-quick-pills::-webkit-scrollbar { display: none; }
.party-quick-pill {
  min-width: 28px; height: 34px;
  flex-shrink: 0;
  border: 1.5px solid #334155;
  background: transparent;
  color: #475569;
  border-radius: 8px;
  font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.party-quick-pill:hover { border-color: #3b82f6; color: #60a5fa; background: rgba(59,130,246,.1); }
.party-quick-pill.active { border-color: #3b82f6; background: rgba(59,130,246,.18); color: #93c5fd; }
body.light-mode .party-quick-pill { border-color: #e2e8f0; color: #94a3b8; }
body.light-mode .party-quick-pill:hover { border-color: #2563eb; color: #2563eb; background: rgba(37,99,235,.08); }
body.light-mode .party-quick-pill.active { border-color: #2563eb; background: rgba(37,99,235,.1); color: #2563eb; }

.reserve-datetime-row { gap: 8px; flex-wrap: nowrap; align-items: flex-start; }
.dt-col-date {
  width: 44%;
  flex: none;
  min-width: 0;
  overflow: hidden;
}
.dt-col-time {
  flex: 1;
  min-width: 0;
  position: relative;
}
/* Force iOS to respect our width — suppress native date chrome */
.reserve-date-input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.reserve-notes-input { font-size: 13px !important; color: #94a3b8 !important; }
.reserve-notes-input:focus { color: #e2e8f0 !important; }
body.light-mode .reserve-notes-input { color: #94a3b8 !important; }
body.light-mode .reserve-notes-input:focus { color: #0f172a !important; }

/* Save button with icon */
.reserve-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.reserve-waitlist-btn {
  background: rgba(168,85,247,0.15);
  color: #c084fc;
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.reserve-waitlist-btn:active { background: rgba(168,85,247,0.25); }
.reserve-save-btn .material-symbols-outlined { font-size: 18px; }

.reserve-form-actions { margin-top: 8px; }

/* ═══════════════════════════════════════════
   TABLE PICKER DROPDOWN
═══════════════════════════════════════════ */
/* Map-pick pill inside the table field */
.reserve-map-pill {
  position: absolute;
  right: 36px; /* sit left of the chevron */
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1.5px solid #334155;
  background: #1e293b;
  color: #38bdf8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, border-color 0.12s;
  z-index: 2;
}
.reserve-map-pill .material-symbols-outlined { font-size: 16px; }
.reserve-map-pill:active { background: #0f172a; }
body.light-mode .reserve-map-pill { background: #f1f5f9; border-color: #cbd5e1; color: #0284c7; }
body.light-mode .reserve-map-pill:active { background: #e2e8f0; }

.reserve-table-search-wrap {
  position: relative;
}
.reserve-table-search-input {
  cursor: pointer;
  padding-right: 36px !important;
}
.reserve-table-search-input:focus { cursor: text; }
.reserve-table-chevron {
  position: absolute;
  right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 20px !important;
  color: #475569;
  pointer-events: none;
  transition: transform .2s;
}
.reserve-table-search-input:focus ~ .reserve-table-chevron { transform: translateY(-50%) rotate(180deg); color: #3b82f6; }

.reserve-table-dropdown {
  display: none; /* replaced by bottom sheet */
}

/* ── Table Picker Sheet ───────────────────────────────── */
.tps-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #1e293b;
  background: #0f172a;
  position: sticky;
  top: 0;
  z-index: 1;
}
body.light-mode .tps-search-wrap { background: #f8fafc; border-bottom-color: #e2e8f0; }
.tps-search-icon { font-size: 18px !important; color: #64748b; flex-shrink: 0; }
.tps-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  color: #e2e8f0;
  font-family: inherit;
}
body.light-mode .tps-search-input { color: #0f172a; }
.tps-search-input::placeholder { color: #475569; }
.tps-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 6px;
  max-height: 60vh;
}
.tps-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(51,65,85,.3);
}
.tps-row:last-child { border-bottom: none; }
.tps-row:active { background: rgba(59,130,246,.15); }
.tps-row.active { background: rgba(59,130,246,.12); }
body.light-mode .tps-row:active { background: rgba(37,99,235,.08); }
body.light-mode .tps-row.active { background: rgba(37,99,235,.07); }
.tps-num {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  flex-shrink: 0;
}
.tps-num-free,
.tps-num-reserved,
.tps-num-occupied,
.tps-num-none     { color: #f0e0c8; background: rgba(240,224,200,.10); }
body.light-mode .tps-num-free,
body.light-mode .tps-num-reserved,
body.light-mode .tps-num-occupied,
body.light-mode .tps-num-none { color: #8c6a45; background: rgba(140,106,69,.10); }
.tps-info { flex: 1; min-width: 0; }
.tps-name { font-size: 14px; font-weight: 600; color: #e2e8f0; }
body.light-mode .tps-name { color: #0f172a; }
.tps-sub  { font-size: 12px; color: #64748b; margin-top: 1px; }
.tps-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
}
.tps-badge-free     { color: #86efac; background: rgba(34,197,94,.1); }
.tps-badge-reserved { color: var(--clr-res-text); background: var(--clr-res-bg); }
.tps-badge-occupied { color: #fca5a5; background: rgba(239,68,68,.1); }
body.light-mode .tps-badge-free     { color: #15803d; background: rgba(34,197,94,.08); }
body.light-mode .tps-badge-reserved { color: var(--clr-res-text); background: var(--clr-res-bg); }
body.light-mode .tps-badge-occupied { color: #b91c1c; background: rgba(239,68,68,.08); }

body.light-mode .reserve-table-dropdown {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}

.reserve-table-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid rgba(51,65,85,.35);
}
.reserve-table-option:last-child { border-bottom: none; }
.reserve-table-option:hover { background: rgba(59,130,246,.1); }
.reserve-table-option.active { background: rgba(59,130,246,.15); }
.rto-empty { color: #475569; font-size: 13px; font-style: italic; justify-content: center; }
body.light-mode .reserve-table-option:hover { background: rgba(37,99,235,.06); }
body.light-mode .reserve-table-option.active { background: rgba(37,99,235,.1); }

.rto-num {
  font-size: 13px; font-weight: 800;
  min-width: 34px; text-align: center;
  padding: 3px 6px;
  border-radius: 7px;
  flex-shrink: 0;
  background: rgba(255,255,255,.05);
  color: #94a3b8;
}
.rto-num-free     { color: #86efac; background: rgba(34,197,94,.12); }
.rto-num-reserved { color: var(--clr-res-text); background: var(--clr-res-bg); }
.rto-num-occupied { color: #fca5a5; background: rgba(239,68,68,.12); }
body.light-mode .rto-num-free     { color: #16a34a; background: rgba(34,197,94,.1); }
body.light-mode .rto-num-reserved { color: var(--clr-res-text); background: var(--clr-res-bg); }
body.light-mode .rto-num-occupied { color: #dc2626; background: rgba(239,68,68,.1); }

.rto-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.rto-seats {
  font-size: 12px; font-weight: 600; color: #e2e8f0;
  line-height: 1.2;
}
body.light-mode .rto-seats { color: #0f172a; }
.rto-sec {
  font-size: 10px; font-weight: 600; color: #475569;
  text-transform: uppercase; letter-spacing: .04em;
  line-height: 1;
}

.rto-status {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px;
  flex-shrink: 0; white-space: nowrap;
}
.rto-status-free     { color: #86efac; background: rgba(34,197,94,.1); }
.rto-status-reserved { color: var(--clr-res-text); background: var(--clr-res-bg); }
.rto-status-occupied { color: #fca5a5; background: rgba(239,68,68,.1); }
body.light-mode .rto-status-free     { color: #15803d; background: rgba(34,197,94,.08); }
body.light-mode .rto-status-reserved { color: var(--clr-res-text); background: var(--clr-res-bg); }
body.light-mode .rto-status-occupied { color: #b91c1c; background: rgba(239,68,68,.08); }

/* Fix "optional" label — make it more visible */
.reserve-label-optional {
  font-size: 10px;
  font-weight: 600;
  color: #64748b !important;
  text-transform: lowercase;
  letter-spacing: 0;
  margin-left: 4px;
  padding: 1px 7px;
  background: rgba(100,116,139,.15) !important;
  border: 1px solid rgba(100,116,139,.25);
  border-radius: 4px;
}
body.light-mode .reserve-label-optional {
  color: #64748b !important;
  background: rgba(100,116,139,.1) !important;
  border-color: rgba(100,116,139,.2);
}

/* ═══════════════════════════════════════════
   UPCOMING FILTER — KPI card + view
═══════════════════════════════════════════ */
.stat-card.s-upcoming-pill {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .2s ease, border-color .15s ease, background .15s ease, padding .25s ease;
  position: relative;
}
.stat-card.s-upcoming-pill:active { transform: scale(.96); }
.stat-card.s-upcoming-pill.kpi-filter-active {
  border-color: #7c3aed !important;
  background: rgba(124,58,237,.18) !important;
}
.stats.has-filter .stat-card.s-upcoming-pill:not(.kpi-filter-active) {
  opacity: .32;
}

.upcoming-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 24px;
  color: #475569;
  font-size: 14px;
  text-align: center;
}

.upcoming-date-header { cursor: default; }
.upcoming-date-header .section-header-name.upcoming-today { color: #38bdf8; }
body.light-mode .upcoming-date-header .section-header-name.upcoming-today { color: #0284c7; }

.upcoming-booking-card { cursor: pointer; }

/* ═══════════════════════════════════════════
   TIME DRUM — 2-column shift layout
═══════════════════════════════════════════ */
.time-drum-cols {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  max-height: none; /* maxHeight controlled by JS on #reserveStartDrum */
  overflow: visible;
  width: 280px;
}

.td-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px;
  flex: 1;
  min-width: 0;
}

/* Use a real 2-col grid for the column area */
.time-drum-cols > .td-col:first-child ~ .td-col:not(.td-manual-row) {
  border-left: 1px solid #1e293b;
}

/* Override: cols sit side by side */
.time-drum-cols {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
}
.time-drum-cols > .td-col {
  flex: 1;
  min-width: 100px;
}
body.light-mode .time-drum-cols > .td-col + .td-col { border-left-color: #e2e8f0; }

.td-col-hdr {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 6px 6px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.td-col-hdr-day   { color: #fbbf24; background: rgba(245,158,11,.12); }
.td-col-hdr-night { color: #a5b4fc; background: rgba(129,140,248,.12); }
body.light-mode .td-col-hdr-day   { color: #b45309; background: rgba(217,119,6,.08); }
body.light-mode .td-col-hdr-night { color: #4f46e5; background: rgba(99,102,241,.08); }

.td-col-icon {
  font-size: 12px !important;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

/* Slot buttons inside 2-col drum */
.time-drum-cols .time-drum-slot {
  width: 100%;
  padding: 11px 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: background .1s, color .1s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.time-drum-cols .time-drum-slot:hover  { background: rgba(56,189,248,.1); color: #e2e8f0; }
.time-drum-cols .time-drum-slot.active { background: rgba(59,130,246,.22); color: #60a5fa; font-weight: 700; }
body.light-mode .time-drum-cols .time-drum-slot       { color: #475569; }
body.light-mode .time-drum-cols .time-drum-slot:hover { background: rgba(37,99,235,.08); color: #0f172a; }
body.light-mode .time-drum-cols .time-drum-slot.active{ background: rgba(37,99,235,.12); color: #2563eb; }

/* Manual "Other" row — full width below columns */
.td-manual-row {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid #1e293b;
  width: 100%;
}
body.light-mode .td-manual-row { border-top-color: #e2e8f0; }
.td-manual-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
}
.td-manual-input {
  flex: 1;
  padding: 5px 8px !important;
  font-size: 12px !important;
  min-width: 0;
}

/* ═══════════════════════════════════════════
   DELETE BUTTON — reservation modal
═══════════════════════════════════════════ */
.reserve-delete-btn {
  flex: 0 0 auto;
  width: 44px;
  padding: 0;
  background: rgba(239,68,68,.1);
  border: 1.5px solid rgba(239,68,68,.3) !important;
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: background .15s, border-color .15s;
}
.reserve-delete-btn:hover  { background: rgba(239,68,68,.22); border-color: rgba(239,68,68,.55) !important; }
.reserve-delete-btn:active { transform: scale(.95); }
.reserve-delete-btn .material-symbols-outlined { font-size: 20px; }
body.light-mode .reserve-delete-btn            { background: rgba(220,38,38,.06);  border-color: rgba(220,38,38,.2) !important;  color: #dc2626; }
body.light-mode .reserve-delete-btn:hover      { background: rgba(220,38,38,.12);  border-color: rgba(220,38,38,.4) !important; }

/* ═══════════════════════════════════════════
   TABLE ASSIGN SHEET  (.tas-*)
═══════════════════════════════════════════ */
.tas-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px 20px;
}

/* Each booking row */
.tas-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1.5px solid #334155;
  background: #1e293b;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.tas-row:active { background: #0f172a; }

/* "New reservation" special row */
.tas-row-new {
  border-color: rgba(56,189,248,0.25);
  margin-top: 4px;
}
.tas-row-new .tas-name { color: #38bdf8; }

/* Avatar circle */
.tas-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.tas-avatar-new {
  background: rgba(56,189,248,0.15);
  color: #38bdf8;
  border: 1.5px solid rgba(56,189,248,0.3);
}

/* Info block */
.tas-info {
  flex: 1;
  min-width: 0;
}
.tas-name {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.tas-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 3px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
}
.tas-meta span::before {
  content: '';
}
.tas-meta span + span::before {
  content: '· ';
  color: #475569;
}

/* Table chip — shows currently-assigned table */
.tas-chip {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(99,102,241,0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.3);
  white-space: nowrap;
}
/* Chip for the table we're assigning to (already assigned here) */
.tas-chip-self {
  background: rgba(34,197,94,0.15);
  color: #86efac;
  border-color: rgba(34,197,94,0.35);
}

/* Assigned (read-only) rows in the assign sheet */
.tas-row-assigned {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.tas-chip-assigned {
  background: rgba(148,163,184,0.12);
  color: #64748b;
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  flex-shrink: 0;
}
body.light-mode .tas-chip-assigned { background: rgba(100,116,139,0.08); color: #94a3b8; }

/* "Assign" action accent in the choice sheet */
.ss-assign .ss-action-icon { color: #818cf8; }
.ss-assign { border-color: rgba(129,140,248,0.25); }

/* ── Light-mode overrides ── */
body.light-mode .tas-row { background: #f8fafc; border-color: #e2e8f0; }
body.light-mode .tas-row:active { background: #f1f5f9; }
body.light-mode .tas-row-new { border-color: rgba(2,132,199,0.3); }
body.light-mode .tas-row-new .tas-name { color: #0284c7; }
body.light-mode .tas-avatar-new { background: rgba(2,132,199,0.08); color: #0284c7; border-color: rgba(2,132,199,0.25); }
body.light-mode .tas-name { color: #0f172a; }
body.light-mode .tas-meta { color: #94a3b8; }
body.light-mode .tas-meta span + span::before { color: #cbd5e1; }
body.light-mode .tas-chip { background: rgba(99,102,241,0.08); color: #4f46e5; border-color: rgba(99,102,241,0.2); }
body.light-mode .tas-chip-self { background: rgba(22,163,74,0.08); color: #15803d; border-color: rgba(22,163,74,0.25); }
body.light-mode .ss-assign .ss-action-icon { color: #4f46e5; }
body.light-mode .ss-assign { border-color: rgba(99,102,241,0.2); }


/* ═══════════════════════════════════════════
   RESERVE MODAL — TABLE + SEATING ROW
═══════════════════════════════════════════ */
.reserve-table-row {
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}
/* Table col: takes ~60% */
.reserve-table-col {
  flex: 1.5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
/* Seating col: takes ~40% */
.reserve-seating-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

/* Pill row */
.seating-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.seating-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 7px 8px;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1.5px solid #334155;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
  line-height: 1;
}
.seating-pill-icon { font-size: 14px !important; }
.seating-pill:active { background: rgba(56,189,248,.1); }
.seating-pill.active {
  background: rgba(56,189,248,.15);
  border-color: #38bdf8;
  color: #38bdf8;
}
body.light-mode .seating-pill { border-color: #cbd5e1; color: #94a3b8; background: #f8fafc; }
body.light-mode .seating-pill:active { background: #e2e8f0; }
body.light-mode .seating-pill.active { background: rgba(2,132,199,.1); border-color: #0284c7; color: #0284c7; }

/* ═══════════════════════════════════════════
   SHIFTS MODAL — SECTION CONFIG ROWS
═══════════════════════════════════════════ */
.section-config-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(51,65,85,.5);
}
.section-config-row:last-of-type { border-bottom: none; }
.section-config-letter {
  flex-shrink: 0;
  width: 22px;
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
  text-align: center;
}
.section-config-name {
  flex: 1;
  padding: 7px 10px !important;
  font-size: 13px !important;
}
.section-config-cat {
  flex-shrink: 0;
  width: 96px;
  padding: 7px 8px !important;
  font-size: 12px !important;
}
body.light-mode .section-config-row { border-bottom-color: #f1f5f9; }
body.light-mode .section-config-letter { color: #0284c7; }

/* Map chip party/size ratio display */
/* Pax: bright white, full size — draws the eye */
.map-table-size .mts-party {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}
/* Separator + capacity: muted, smaller */
.map-table-size .mts-sep {
  font-size: 9px;
  font-weight: 400;
  opacity: 0.35;
  margin: 0 1px;
}
.map-table-size .mts-cap {
  font-size: 9px;
  font-weight: 600;
  opacity: 0.45;
}
body.light-mode .map-table-size .mts-party { color: #0f172a; }
body.light-mode .map-table-size .mts-cap   { opacity: 0.4; }

/* Booking-level join bridge */
.map-join-bridge {
  position: absolute;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(56,189,248,0.7), rgba(56,189,248,0.3));
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 0 6px rgba(56,189,248,0.4);
}

/* ══════════════════════════════════════
   BOOKING JOIN — chip states & overlay
══════════════════════════════════════ */

/* Master chip (booking owner) — accent ring */
.map-table.is-bjoin {
  outline: 2px solid rgba(56,189,248,0.7);
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(56,189,248,0.25);
}

/* Dimmed num for secondary joined chips */
.map-table-num-dim { opacity: 0.22; color: #f0e0c8; }

/* Dimmed initials pill for secondary */
.map-table-init-dim { opacity: 0.3; }

/* Bright master num when part of a join */
.map-table-num-master {
  color: #fff8ee;
  text-shadow: 0 0 8px rgba(240,224,200,0.6);
}

/* Join-pick mode chip states */
.map-table.join-pick-master {
  outline: 2.5px solid #38bdf8;
  outline-offset: 2px;
  opacity: 1;
}
.map-table.join-pick-selected {
  outline: 2.5px solid #34d399;
  outline-offset: 2px;
  box-shadow: 0 0 14px rgba(52,211,153,0.45);
  opacity: 1;
}
.map-table.join-pick-idle {
  opacity: 0.55;
  filter: saturate(0.5);
}

/* ── Join overlay banner ── */
#joinOverlay {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--qr-bar-h, 56px) + 10px);
  z-index: 10100;               /* above search bar (10001) */
  pointer-events: none;         /* taps fall through to map chips */
  display: flex;
  align-items: center;
  justify-content: center;
}
#joinOverlay:not([hidden]) { display: flex; }
#joinOverlay[hidden]       { display: none; }

#joinOverlayBanner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15,23,42,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56,189,248,0.35);
  border-radius: 20px;
  padding: 10px 12px 10px 14px;
  box-shadow: 0 -2px 24px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.4);
  max-width: calc(100vw - 32px);
}
.join-banner-icon {
  font-size: 20px !important;
  color: #38bdf8;
  flex-shrink: 0;
}
#joinOverlayLabel {
  flex: 1;
  font-size: 13px;
  color: #94a3b8;
  white-space: nowrap;
}
#joinOverlayLabel strong { color: #e2e8f0; font-weight: 700; }

.join-banner-confirm {
  display: flex; align-items: center; gap: 4px;
  padding: 7px 14px;
  border-radius: 12px;
  border: none;
  background: #38bdf8;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, opacity 0.12s;
}
.join-banner-confirm .material-symbols-outlined { font-size: 16px !important; }
.join-banner-confirm:active { background: #0ea5e9; }
.join-banner-confirm:disabled { opacity: 0.35; pointer-events: none; }

/* Divider between confirm and cancel */
#joinOverlayBanner::after {
  content: '';
  display: block;
  width: 1px;
  height: 20px;
  background: #334155;
  flex-shrink: 0;
}

.join-banner-cancel {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.join-banner-cancel .material-symbols-outlined { font-size: 18px !important; }
.join-banner-cancel:active { color: #94a3b8; }

/* ── Pick-table overlay banner ─────────────────────────────────── */
#pickTableOverlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
#pickTableOverlay:not([hidden]) { display: flex; }
#pickTableOverlay[hidden]       { display: none; }

#pickTableBanner {
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1e3a5f;
  border-bottom: 1.5px solid #2563eb;
  padding: 11px 16px;
  color: #93c5fd;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(37,99,235,0.25);
}
.pick-banner-icon { font-size: 20px !important; color: #60a5fa; flex-shrink: 0; }
#pickTableLabel { flex: 1; color: #bfdbfe; font-size: 13px; line-height: 1.35; }
#pickTableLabel strong { color: #fff; font-weight: 700; }
.pick-banner-cancel {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1.5px solid #2563eb;
  background: transparent;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.pick-banner-cancel .material-symbols-outlined { font-size: 15px !important; }
.pick-banner-cancel:active { background: #1e40af; }
body.light-mode #pickTableBanner {
  background: #eff6ff;
  border-bottom-color: #3b82f6;
  color: #1d4ed8;
  box-shadow: 0 4px 18px rgba(37,99,235,0.12);
}
body.light-mode #pickTableLabel { color: #1e40af; }
body.light-mode #pickTableLabel strong { color: #1e3a8a; }
body.light-mode .pick-banner-cancel { border-color: #3b82f6; color: #2563eb; }

body.light-mode #joinOverlayBanner {
  background: rgba(255,255,255,0.95);
  border-color: rgba(2,132,199,0.25);
  box-shadow: 0 -2px 24px rgba(0,0,0,0.10), 0 4px 16px rgba(0,0,0,0.08);
}
body.light-mode #joinOverlayLabel { color: #64748b; }
body.light-mode #joinOverlayLabel strong { color: #0f172a; }
body.light-mode #joinOverlayBanner::after { background: #e2e8f0; }
body.light-mode .join-banner-cancel { color: #94a3b8; }
body.light-mode .join-banner-cancel:active { color: #64748b; }

/* ss-bjoin action button accent */
.ss-bjoin   .ss-action-icon { color: #38bdf8; }
.ss-bunjoin .ss-action-icon { color: var(--clr-walkin); }

.map-join-bridge { animation: bridgeFade 0.25s ease; }
@keyframes bridgeFade { from { opacity: 0; } to { opacity: 1; } }

/* Free tables banner — shown when ≥10 tables are free */
.free-sec-header:hover { background: rgba(255,255,255,0.03); }
.free-sec-header .section-header-left { display: flex; align-items: center; gap: 6px; }

.free-tables-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 12px 16px;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(51, 65, 85, 0.4);
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}
.free-tables-banner .material-symbols-outlined {
  font-size: 16px;
  color: #22c55e;
}

/* ═══════════════════════════════════════
   PHONE / WHATSAPP SHEET
═══════════════════════════════════════ */

/* Name row — flex so pill sits inline with no extra height */
.dc-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}
.dc-name-row .dc-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}

/* Phone pill — circular, teal, sits inline with name */
.dc-phone-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: none;
  background: rgba(6,182,212,0.1);
  color: rgba(6,182,212,0.5);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  font-family: inherit;
  padding: 0;
}
.dc-phone-pill .material-symbols-outlined { font-size: 12px; }
.dc-phone-pill:active { background: rgba(6,182,212,0.3); }
body.light-mode .dc-phone-pill { background: rgba(6,182,212,0.12); color: #0891b2; }
body.light-mode .dc-phone-pill:active { background: rgba(6,182,212,0.25); }

/* Number picker pills */
.wa-number-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.wa-number-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid #334155;
  background: transparent;
  color: #e2e8f0;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s;
}
.wa-number-pill:active,
.wa-number-pill.selected { border-color: #22c55e; background: rgba(34,197,94,0.08); }
.wa-number-pill .material-symbols-outlined { font-size: 18px; color: #22c55e; flex-shrink: 0; }
.wa-number-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; margin-left: auto; }
body.light-mode .wa-number-pill { border-color: #e2e8f0; color: #0f172a; }
body.light-mode .wa-number-pill:active,
body.light-mode .wa-number-pill.selected { border-color: #16a34a; background: rgba(22,163,74,0.07); }

/* Message action buttons */
.wa-actions { display: flex; flex-direction: column; gap: 8px; }
.wa-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid #334155;
  background: transparent;
  color: #e2e8f0;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s;
}
.wa-action-btn:active { background: rgba(255,255,255,0.05); }
.wa-action-btn .material-symbols-outlined { font-size: 20px; flex-shrink: 0; }
.wa-action-btn.wa-confirm  { border-color: rgba(34,197,94,0.4);  color: #86efac; }
.wa-action-btn.wa-cancel   { border-color: rgba(239,68,68,0.4);  color: #fca5a5; }
.wa-action-btn.wa-reschedule { border-color: var(--clr-res-border); color: var(--clr-res-text); }
.wa-action-btn.wa-add-phone  { border-color: rgba(148,163,184,0.4); color: #94a3b8; }
.wa-action-btn.wa-call-wa    { border-color: rgba(100,116,139,0.4); color: #94a3b8; }
.wa-action-label { display: flex; flex-direction: column; gap: 2px; }
.wa-action-sub { font-size: 11px; opacity: 0.65; font-weight: 400; }
body.light-mode .wa-action-btn { color: #0f172a; border-color: #e2e8f0; }
body.light-mode .wa-action-btn.wa-confirm   { border-color: rgba(22,163,74,0.4);  color: #15803d; }
body.light-mode .wa-action-btn.wa-cancel    { border-color: rgba(220,38,38,0.4);  color: #b91c1c; }
body.light-mode .wa-action-btn.wa-reschedule { border-color: var(--clr-res-border); color: var(--clr-res-text); }

/* Add phone inline input */
.wa-add-phone-wrap { display: flex; gap: 8px; margin-bottom: 14px; }
.wa-add-phone-wrap .ee-input { flex: 1; }

/* Confirm send preview */
.wa-preview {
  background: rgba(30,41,59,0.7);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
body.light-mode .wa-preview { background: #f1f5f9; border-color: #e2e8f0; color: #334155; }
.wa-send-row { display: flex; gap: 8px; justify-content: flex-end; }


/* ═══════════════════════════════════════
   CONTACT PICKER SHEET
═══════════════════════════════════════ */

.cp-scrim {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 10050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.cp-scrim.show { opacity: 1; pointer-events: auto; }

.cp-sheet {
  position: fixed;
  bottom: 0; left: 50%;
  top: auto;
  transform: translateX(-50%) translateY(8px);
  width: calc(100% - 80px); max-width: 360px;
  background: var(--clr-bg-surface);
  border-radius: 14px 14px 0 0;
  z-index: 10060;
  display: flex; flex-direction: column;
  max-height: min(340px, 55vh);
  transition: transform 0.2s ease, opacity 0.2s ease;
  will-change: transform, opacity;
  overflow: hidden;
  border: 1px solid var(--clr-border);
  border-bottom: none;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
}
.cp-sheet.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.cp-handle-row { display: none; }

.cp-sheet[data-open-dir="down"] {
  border-radius: 0 0 14px 14px;
  border-bottom: 1px solid var(--clr-border);
  border-top: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.cp-search-row {
  padding: 8px 12px 4px;
  flex-shrink: 0;
}
.cp-search-input {
  width: 100%;
  box-sizing: border-box;
}
.cp-handle { display: none; }

.cp-header {
  display: none;
}

.cp-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1;
  padding: 0;
}

.cp-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--clr-text-dim);
  padding: 8px 8px 4px;
}

.cp-contact {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid #334155;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}
.cp-contact:active,
.cp-contact.cp-pressing { background: #0f172a; }
body.light-mode .cp-contact { border-bottom-color: #f1f5f9; }
body.light-mode .cp-contact:active,
body.light-mode .cp-contact.cp-pressing { background: #f8fafc; }

.cp-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
  color: #fff;
  letter-spacing: 0.5px;
}
.cp-contact-info { flex: 1; min-width: 0; }
.cp-contact-name {
  font-size: 14px; font-weight: 500;
  color: var(--clr-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-contact-sub {
  font-size: 12px; color: #64748b;
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-vip-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--clr-sky);
  background: rgba(56,189,248,0.1);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
}

.cp-reserve-btn {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 4px;
  background: #1e3a5f;
  color: #60a5fa;
  border: 1px solid #2563eb44;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cp-reserve-btn .material-symbols-outlined { font-size: 15px; }
.cp-reserve-btn:active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
body.light-mode .cp-reserve-btn { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
body.light-mode .cp-reserve-btn:active { background: #2563eb; color: #fff; }

.cp-add-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  margin-top: 4px;
}
.cp-add-row:active { background: rgba(56,189,248,0.08); }
.cp-add-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(30,64,175,0.25);
  color: var(--clr-sky);
  border: 1.5px dashed rgba(56,189,248,0.3);
}
.cp-add-avatar .material-symbols-outlined { font-size: 18px; }
.cp-add-name { font-size: 14px; font-weight: 600; color: var(--clr-sky); }
.cp-add-sub  { font-size: 12px; color: var(--clr-text-muted); margin-top: 1px; }

.cp-empty {
  display: flex; align-items: center; justify-content: center;
  padding: 12px 16px;
  color: var(--clr-text-dim);
}
.cp-empty .material-symbols-outlined { display: none; }
.cp-empty-text { font-size: 13px; opacity: 0.6; }

.cp-highlight {
  background: rgba(56,189,248,0.18);
  color: var(--clr-sky);
  border-radius: 3px;
  padding: 0 1px;
}

/* action rows inside contact picker sheet (reserve-new, add-contact, import) */
.cp-action-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.cp-action-row:active { background: rgba(56,189,248,0.07); }
body.light-mode .cp-action-row:active { background: rgba(37,99,235,0.06); }

/* ── Dock meta-pills: tappable ── */
.qr-meta-pill {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border: none;
  font-family: inherit;
  transition: opacity 0.12s;
  padding: 3px 10px;
  font-size: 14px;
  gap: 4px;
  border-radius: 7px;
}
.qr-meta-pill .material-symbols-outlined { font-size: 15px; }
.qr-meta-pill:active { opacity: 0.65; }

/* Locked fast-reserve: pills row sits below the input ── */
.search-wrap.is-locked {
  flex-wrap: wrap;
  row-gap: 0;
}
.search-wrap .search-icon { flex-shrink: 0; }

/* Hidden siblings inside search-wrap must be fully removed from flex layout */
#fastReserveResults[hidden],
#fastReserveFooter[hidden] { display: none !important; }
.qr-footer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 2px;
  border-top: 1px solid #2a3f5f;
}
body.light-mode .qr-footer { border-top-color: #bfdbfe; }
.qr-footer-pills {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

/* Party quick pills — allow wrapping in dock popover */
#_qrPop .party-quick-pills { flex-wrap: wrap; }

/* ── iOS keyboard: keep header + search pinned when keyboard is open ──────
   visualViewport shrinks when the SW keyboard opens; sticky becomes
   scrollable. Switch both bars to fixed and compensate with padding.    */
html.kb-open .header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 100 !important;
}
html.kb-open .search-wrap {
  position: fixed !important;
  bottom: 0 !important;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 98 !important;
}

/* ═══════════════════════
   CUSTOM CALENDAR PICKER
═══════════════════════ */
.cal-modal-content {
  border-radius: 16px 16px 0 0;
  padding: 0 0 max(6px, env(safe-area-inset-bottom));
  max-width: 300px;
  width: 100%;
}
.cal-header {
  display: flex;
  align-items: center;
  padding: 8px 6px 2px;
  gap: 4px;
}
.cal-nav-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: rgba(148,163,184,0.1);
  border-radius: 7px; cursor: pointer; color: #94a3b8;
  flex-shrink: 0;
}
.cal-nav-btn:active { background: rgba(148,163,184,0.2); }
.cal-nav-btn .material-symbols-outlined { font-size: 16px; }
.cal-month-label {
  font-size: 13px; font-weight: 700; color: #e2e8f0;
  background: none; border: none; cursor: default; padding: 0;
  flex: 1; text-align: center;
}
body.light-mode .cal-month-label { color: #0f172a; }
body.light-mode .cal-nav-btn { color: #475569; }
.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 6px 1px;
}
.cal-dow-row span {
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  padding: 2px 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 6px;
  gap: 1px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cal-day:active { background: rgba(148,163,184,0.15); }
.cal-day.cal-today { color: #60a5fa; font-weight: 700; }
.cal-day.cal-selected { background: #2563eb; color: #fff; font-weight: 700; }
.cal-day.cal-selected.cal-today { background: #2563eb; color: #fff; }
.cal-day.cal-other-month { color: #334155; }
.cal-day.cal-past { color: #475569; cursor: default; opacity: 0.45; }
.cal-day.cal-past:active { background: transparent; }
body.light-mode .cal-day { color: #1e293b; }
body.light-mode .cal-day.cal-today { color: #2563eb; }
body.light-mode .cal-day.cal-other-month { color: #cbd5e1; }
body.light-mode .cal-day.cal-past { color: #94a3b8; }
.cal-footer {
  display: flex;
  gap: 6px;
  padding: 6px 8px 2px;
}
.cal-today-btn {
  flex: 1; padding: 6px;
  border-radius: 9px;
  background: rgba(37,99,235,0.15);
  border: 1px solid rgba(37,99,235,0.3);
  color: #60a5fa; font-size: 12px; font-weight: 600; cursor: pointer;
}
.cal-today-btn:active { background: rgba(37,99,235,0.25); }
.cal-cancel-btn {
  flex: 1; padding: 6px;
  border-radius: 9px;
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.15);
  color: #64748b; font-size: 12px; font-weight: 600; cursor: pointer;
}
.cal-cancel-btn:active { background: rgba(148,163,184,0.15); }
body.light-mode .cal-today-btn { color: #2563eb; }
body.light-mode .cal-cancel-btn { color: #475569; }
