/* =============================================================
   Buuktime Reservierungssystem V5.2
   style.css — Design tokens + all component styles
   ============================================================= */

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

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }
ul[role="list"], ol[role="list"] { list-style: none; }
[hidden] { display: none !important; }

/* ---- DESIGN TOKENS ---- */
:root {
  /* Type Scale */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.375rem;   /* 22px */
  --text-2xl:  1.75rem;    /* 28px */

  /* Spacing (4px base) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Buuktime Custom Color Palette — Light Theme */
  --color-bg:            #FFFFFF;
  --color-surface:       #F8F9FA;
  --color-surface-2:     #F2F4F6;
  --color-surface-offset: #EAECEF;
  --color-border:        #E0E0E0;
  --color-border-strong: #C8C8C8;
  --color-divider:       #E8E8E8;

  /* Text */
  --color-text:          #1A1A1A;
  --color-text-muted:    #6B7280;
  --color-text-secondary:#4B5563;
  --color-text-faint:    #A0A7B0;
  --color-text-inverse:  #FFFFFF;

  /* Brand Orange */
  --color-brand:         #FF8C00;
  --color-brand-hover:   #E57B00;
  --color-brand-light:   #FFF3E0;

  /* Primary Blue */
  --color-primary:       #2563EB;
  --color-primary-hover: #1D4ED8;
  --color-primary-light: #EFF6FF;

  /* Semantic Colors */
  --color-success:       #10B981;
  --color-success-light: #ECFDF5;
  --color-success-text:  #065F46;
  --color-warning:       #F59E0B;
  --color-warning-light: #FFFBEB;
  --color-warning-text:  #92400E;
  --color-error:         #EF4444;
  --color-error-light:   #FEF2F2;
  --color-error-text:    #7F1D1D;

  /* Current time line */
  --color-time-line:     #E63946;

  /* Package colors */
  --color-solo:          #4A90D9;
  --color-duo:           #27AE60;
  --color-gruppe:        #F39C12;
  --color-party:         #8E44AD;
  --color-telefon:       #E74C3C;

  /* Layout */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  --transition: 140ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Grid dimensions */
  --time-col-w: 56px;
  --lane-min-w: 70px;
  --row-height: 40px;  /* per 30-min slot */
  --lane-header-h: 38px;

  /* Sidebar */
  --sidebar-w: 280px;

  /* Topbar / nav heights */
  --topbar-h: 56px;
  --tabnav-h: 44px;
  --footer-h: 32px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Mobile/Tablet Breakpoint Tokens */
  --bt-breakpoint-mobile:  640px;
  --bt-breakpoint-tablet:  1024px;
  --bt-breakpoint-desktop: 1280px;

  /* Minimum Touch-Target (WCAG / Apple HIG) */
  --bt-touch-target: 44px;

  /* iOS Safe-Area (notch/home indicator) — graceful fallback to 0 */
  --bt-safe-area-top:    env(safe-area-inset-top,    0px);
  --bt-safe-area-right:  env(safe-area-inset-right,  0px);
  --bt-safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --bt-safe-area-left:   env(safe-area-inset-left,   0px);
}

/* ---- SKIP LINK ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  background: var(--color-primary);
  color: white;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: var(--space-2); }

/* =============================================================
   TOP BAR
   ============================================================= */
.topbar {
  height: var(--topbar-h);
  background: var(--location-color, #FFFFFF);
  border-bottom: 1px solid rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-4);
  position: relative;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  transition: background 0.3s ease;
}

.topbar-left { display: flex; align-items: center; flex: 0 0 auto; min-width: 0; }
.topbar-locations { display: flex; align-items: center; gap: var(--space-2); flex: 0 0 auto; margin-left: var(--space-2); min-width: 0; }
.topbar-resources { display: flex; align-items: center; gap: var(--space-2); flex: 0 0 auto; min-width: 0; overflow: hidden; }
.topbar-resources-compact { display: none; align-items: center; gap: var(--space-2); flex: 0 0 auto; min-width: 0; }
.topbar-center { flex: 1; display: flex; justify-content: center; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: var(--space-3); flex: 0 0 auto; position: relative; margin-left: auto; }
.topbar-actions-group,
.topbar-user-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.topbar-user-group {
  position: relative;
}
.date-nav-group { display: flex; align-items: center; gap: var(--space-2); min-width: 0; position: relative; }

/* Topbar themed text colors — white on colored header */
.topbar .logo-name { color: #fff; }
.topbar .logo-sub  { color: rgba(255,255,255,0.85); }
.topbar .date-nav { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.25); }
.topbar .date-nav-btn { color: rgba(255,255,255,0.8); }
.topbar .date-nav-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.topbar .date-display { color: #fff; }
.topbar .current-user-label { color: #fff; background: rgba(255,255,255,0.2); }
.topbar .btn-secondary { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.25); }
.topbar .btn-secondary:hover { background: rgba(255,255,255,0.25); }
.topbar .btn-icon { color: #fff; background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.25); }
.topbar .btn-icon:hover { color: #fff; background: rgba(255,255,255,0.3); }
.topbar .btn-primary { background: rgba(255,255,255,0.2); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.topbar .btn-primary:hover { background: rgba(255,255,255,0.3); }
.topbar .day-note-indicator { filter: brightness(2); }
.topbar-mini-calendar-anchor { position: relative; display: flex; align-items: center; flex: 1 1 auto; min-width: 0; }
.topbar-mini-calendar-anchor[hidden] { display: none !important; }
.topbar-day-note-anchor { position: relative; display: flex; align-items: center; flex: 0 0 auto; }
.topbar-day-note-anchor[hidden] { display: none !important; }
.topbar-mini-calendar-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 320px;
  max-width: min(92vw, 360px);
  z-index: 190;
}
.topbar-mini-calendar-popover[hidden] { display: none !important; }
.topbar-mini-calendar-popover .sidebar-calendar {
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0,0,0,0.18);
}
.topbar-day-note-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 420px;
  max-width: min(92vw, 560px);
  z-index: 190;
}
.topbar-day-note-popover[hidden] { display: none !important; }
.topbar-day-note-popover .day-note-section {
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0,0,0,0.18);
  border-bottom: none;
  padding: var(--space-3);
}
.topbar-day-note-popover .day-note-textarea {
  min-height: 188px;
  resize: vertical;
  background: rgba(255,255,255,0.22);
}
.mini-cal-popover-toggle {
  min-width: 40px;
  padding: 8px 10px;
}
.topbar-today-btn {
  min-width: 58px;
  padding: 8px 12px;
  font-weight: 700;
}
.day-note-popover-toggle {
  min-width: 40px;
  padding: 8px 10px;
  position: relative;
}
.day-note-popover-toggle.day-note-popover-toggle--has-note {
  color: #533f00;
  background: linear-gradient(180deg, rgba(255,236,153,0.98), rgba(255,216,77,0.92));
  border-color: rgba(120,88,0,0.45);
  box-shadow: 0 0 0 1px rgba(255,250,208,0.35) inset;
}
.day-note-popover-toggle.day-note-popover-toggle--has-note:hover {
  background: linear-gradient(180deg, rgba(255,240,170,1), rgba(255,221,94,0.96));
}
.day-note-alert-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff4a8, #ffd84d);
  color: #6b2200;
  border: 2px solid rgba(120, 88, 0, 0.58);
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.24);
}
.day-note-alert-badge.day-note-alert-badge--pulse {
  animation: day-note-soft-pulse 1.65s ease-in-out infinite;
}
@keyframes day-note-soft-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 3px 10px rgba(0,0,0,0.24); }
  50% { transform: scale(1.14); box-shadow: 0 5px 16px rgba(255,216,77,0.48); }
}
.topbar-more-toggle {
  display: none !important;
}
.topbar-overflow-menu {
  display: none;
}
.topbar-more-toggle[hidden],
.topbar-resources-compact[hidden],
.topbar-overflow-menu[hidden] {
  display: none !important;
}

/* Location Switcher Dropdown */
.loc-dropdown {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: block;
  width: 100%;
  min-width: 240px;
  max-width: 320px;
  padding: 8px 36px 8px 14px;
  border: 2px solid;
  border-radius: var(--radius-lg, 10px);
  font-size: var(--text-base, 15px);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  background: rgba(255,255,255,0.9);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23666' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: #1A1A1A !important;
  border-color: rgba(255,255,255,0.5) !important;
  overflow: hidden;
  text-overflow: ellipsis;
}
.loc-dropdown:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.95);
}
.loc-dropdown:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
  background: #fff;
}

/* Logo */
.logo { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.logo-img-wrap { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-svg-default { color: var(--location-color, var(--color-brand)); }
.logo-uploaded-img { max-height: 36px; max-width: 120px; object-fit: contain; }
.logo-uploaded-img[hidden] { display: none !important; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-size: var(--text-base); font-weight: 700; color: var(--color-text); letter-spacing: -0.02em; }
.logo-sub  { font-size: var(--text-xs); font-weight: 500; color: var(--color-brand); letter-spacing: 0.04em; text-transform: uppercase; }

/* Date Nav */
.date-nav {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
}
.date-nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: background var(--transition), color var(--transition);
}
.date-nav-btn:hover { background: var(--color-surface-offset); color: var(--color-text); }
.date-display {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  min-width: 140px;
  max-width: 100%;
  text-align: center;
  padding: 0 var(--space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.date-display-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 32px;
  border: 0;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.date-display-toggle:hover {
  background: var(--color-surface-offset);
}
.date-display-toggle:focus-visible {
  outline: 2px solid var(--color-focus, rgba(59,130,246,0.75));
  outline-offset: -2px;
}
.topbar .date-display-toggle:hover {
  background: rgba(255,255,255,0.15);
}
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.btn-primary  { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { background: var(--color-surface-offset); }

.btn-warning-soft {
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.98) 0%, rgba(254, 226, 226, 0.94) 100%);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.24);
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.08);
}
.btn-warning-soft:hover {
  background: linear-gradient(180deg, rgba(254, 235, 235, 1) 0%, rgba(254, 215, 215, 0.96) 100%);
  color: #7f1d1d;
  border-color: rgba(220, 38, 38, 0.34);
}

.btn-text {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-weight: 600;
}
.btn-text:hover {
  background: transparent;
  color: var(--color-text);
}
.btn-text-active {
  color: var(--color-primary);
}

.btn-quiet-outline {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  color: var(--color-text-muted);
}

.btn-quiet-outline:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--color-primary);
  color: var(--color-text);
}

.btn-success { background: var(--color-success); color: white; border-color: var(--color-success); }
.btn-success:hover { background: #0DA271; }

.btn-danger { background: var(--color-error); color: white; border-color: var(--color-error); }
.btn-danger:hover { background: #DC2626; }

.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}
.btn-icon:hover { background: var(--color-surface-offset); color: var(--color-text); }

.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
.btn-sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }

/* =============================================================
   RESOURCE SELECTOR
   ============================================================= */
/* Resource selector is now inside the topbar via .topbar-resources */
.resource-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid rgba(255,255,255,0.5);
  color: #fff;
  background: rgba(255,255,255,0.15);
  white-space: nowrap;
}
.resource-pill:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.6);
}
.resource-pill--active {
  background: rgba(255,255,255,0.95);
  color: var(--res-color, #FF8C00);
  border-color: rgba(255,255,255,0.95);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.resource-pill--active:hover {
  background: #fff;
  color: var(--res-color, #FF8C00);
}
.resource-pill-icon {
  font-size: 1em;
}
.resource-pill-name {
  white-space: nowrap;
}

.resource-combo-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.32);
  background: rgba(0,0,0,0.12);
  color: rgba(255,255,255,0.92);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.resource-combo-toggle:hover {
  background: rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.44);
}
.resource-combo-toggle--active {
  background: rgba(255,255,255,0.95);
  color: var(--location-color, #b91c1c);
  border-color: rgba(255,255,255,0.95);
}
.resource-combo-toggle-icon {
  flex: 0 0 auto;
}
.topbar-resources--combo {
  padding: 4px 8px;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.42);
  background: linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.08));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.14),
    0 0 0 1px rgba(127, 29, 29, 0.16),
    0 6px 16px rgba(127, 29, 29, 0.12);
}
.resource-pill--selected {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.26) inset, 0 2px 8px rgba(0,0,0,0.15);
}

.resource-compact-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 180px;
  max-width: 240px;
  width: 100%;
  padding: 8px 34px 8px 12px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23FFFFFF' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
.resource-compact-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.18);
}
.resource-compact-select option {
  color: #1A1A1A;
}
.resource-compact-picker {
  position: relative;
  min-width: 180px;
}
.resource-compact-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 180px;
  max-width: 240px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 500;
}
.resource-compact-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  max-width: min(320px, 92vw);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(73, 10, 10, 0.96);
  box-shadow: 0 16px 36px rgba(0,0,0,0.28);
  z-index: 16;
}
.resource-compact-menu[hidden] {
  display: none !important;
}
.resource-compact-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: var(--text-sm);
  text-align: left;
}
.resource-compact-option:hover {
  background: rgba(255,255,255,0.1);
}
.resource-compact-option input {
  accent-color: #ffffff;
}
.resource-compact-option--button {
  border: 1px solid transparent;
}
.resource-compact-option--active {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.16);
}

.topbar-overflow-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: 8px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(28,28,28,0.88);
  background: color-mix(in srgb, var(--location-color, #D32F2F) 88%, #111 12%);
  box-shadow: 0 14px 30px rgba(0,0,0,0.22);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 180;
}
.topbar-overflow-menu[data-open="true"] {
  display: block;
}
.topbar-overflow-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: #fff;
  text-align: left;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background var(--transition);
}
.topbar-overflow-item:hover {
  background: rgba(255,255,255,0.12);
}
.topbar-overflow-user {
  padding: 8px 12px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.topbar-overflow-user-label {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  color: rgba(255,255,255,0.72);
  margin-bottom: 4px;
}
.topbar-overflow-user-name {
  display: block;
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}
.topbar-overflow-icon {
  width: 16px;
  text-align: center;
  flex: 0 0 16px;
}
.topbar-overflow-label {
  min-width: 0;
}

.help-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: flex;
  justify-content: flex-end;
  padding: 16px;
  background: rgba(15, 23, 42, 0.38);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.help-panel-overlay[hidden] {
  display: none !important;
}
.help-panel-drawer {
  width: min(980px, calc(100vw - 24px));
  height: min(100%, calc(100dvh - 24px));
  margin-left: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface, #fff);
  color: var(--color-text, #1f2937);
  border: 1px solid var(--color-border);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}
.help-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--color-border);
}
.help-panel-heading {
  min-width: 0;
}
.help-panel-kicker {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}
.help-panel-title {
  margin: 0;
  font-size: clamp(1.25rem, 1.2rem + 0.4vw, 1.55rem);
  line-height: 1.15;
}
.help-panel-close {
  flex-shrink: 0;
}
.help-panel-search-wrap {
  padding: 16px 24px 0;
}
.help-panel-search {
  width: 100%;
}
.help-panel-quick-links {
  padding: 14px 24px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.help-panel-quick-links[hidden] {
  display: none !important;
}
.help-panel-quick-link {
  border: 1px solid color-mix(in srgb, var(--color-primary) 20%, var(--color-border));
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface));
  color: var(--color-text);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.25;
}
.help-panel-quick-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.help-panel-status {
  margin: 16px 24px 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.08);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}
.help-panel-status--error {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}
.help-panel-toolbar {
  padding: 16px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.help-panel-view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.help-panel-view-btn {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}
.help-panel-view-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.help-panel-view-btn--active {
  background: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
  color: var(--color-text);
}
.help-panel-context {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--color-border));
  background: color-mix(in srgb, var(--color-primary) 7%, var(--color-surface));
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.help-panel-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
}
.help-panel-nav {
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--color-border);
}
.help-panel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}
.help-panel-list-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.help-panel-list-item:hover {
  background: var(--color-surface-muted, #f8fafc);
  border-color: var(--color-border);
}
.help-panel-list-item--active {
  background: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
}
.help-panel-list-item-section {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.help-panel-list-item-title {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
}
.help-panel-list-item-meta {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.help-panel-article {
  min-height: 0;
  overflow: auto;
  padding: 20px 24px 24px;
}
.help-panel-article-section {
  margin-bottom: 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.help-panel-article-title {
  margin: 0 0 18px;
  font-size: clamp(1.2rem, 1.1rem + 0.4vw, 1.55rem);
  line-height: 1.15;
}
.help-panel-article-meta {
  margin: -8px 0 18px;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.help-panel-article-summary {
  margin: 0 0 18px;
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  line-height: 1.6;
}
.help-panel-article-body {
  color: var(--color-text);
  font-size: var(--text-base);
  line-height: 1.6;
}
.help-panel-article-body h1,
.help-panel-article-body h2,
.help-panel-article-body h3 {
  margin: 20px 0 10px;
  line-height: 1.2;
}
.help-panel-article-body h1:first-child,
.help-panel-article-body h2:first-child,
.help-panel-article-body h3:first-child {
  margin-top: 0;
}
.help-panel-article-body p {
  margin: 0 0 12px;
}
.help-panel-article-body ul,
.help-panel-article-body ol {
  margin: 0 0 14px 22px;
  padding: 0;
}
.help-panel-article-body li + li {
  margin-top: 6px;
}
.help-panel-article-body code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.16);
  font-size: 0.92em;
}
.help-panel-article-body a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}
.help-panel-article-body a:hover {
  text-decoration: underline;
}
.help-panel-empty {
  padding: 18px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-muted, #f8fafc);
  color: var(--color-text-secondary);
}
.help-panel-empty h3 {
  margin: 0 0 8px;
  color: var(--color-text);
}
.help-panel-support {
  border-top: 1px solid var(--color-border);
  padding: 16px 24px 20px;
  background: var(--color-surface-muted, #f8fafc);
}
.help-panel-support-title {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 6px;
}
.help-panel-support p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.help-panel-support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.help-panel-support a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}
.help-panel-support a:hover {
  text-decoration: underline;
}

/* =============================================================
   TAB NAVIGATION
   ============================================================= */
.tab-nav {
  height: var(--tabnav-h);
  background: white;
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: stretch;
  padding: 0 var(--space-4);
  gap: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

.tab-btn {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 0 var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--color-text); background: var(--color-surface); }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }

.status-bar {
  margin-left: auto;
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding-right: var(--space-2);
  justify-content: flex-end;
  flex-wrap: nowrap;
}
.status-bar.status-bar--compact .status-optional-metric {
  display: none !important;
}
.status-open-badge,
.status-waitlist-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 16px 0 12px;
  border: 1px solid rgba(217, 119, 6, 0.34);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(253, 224, 71, 0.28), rgba(245, 158, 11, 0.22));
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.08), 0 4px 12px rgba(245, 158, 11, 0.12);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.status-open-badge:hover,
.status-waitlist-badge:hover {
  background: linear-gradient(180deg, rgba(253, 224, 71, 0.34), rgba(245, 158, 11, 0.28));
  border-color: rgba(217, 119, 6, 0.42);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12), 0 6px 14px rgba(245, 158, 11, 0.18);
  transform: translateY(-1px);
}
.status-waitlist-badge {
  border: 1px solid rgba(217, 119, 6, 0.32);
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.9), rgba(251, 191, 36, 0.3));
  color: #78350f;
}
.status-open-badge.is-empty,
.status-waitlist-badge.is-empty {
  opacity: 0.52;
  background: rgba(255,255,255,0.55);
  color: var(--color-text-muted);
  box-shadow: none;
}
.status-open-badge__count {
  position: absolute;
  top: -7px;
  right: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid var(--color-surface);
  border-radius: 999px;
  background: rgba(255,255,255,0.98);
  color: #92400e;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(120, 53, 15, 0.18);
  pointer-events: none;
}
.status-open-badge__label {
  white-space: nowrap;
}
.status-time { font-weight: 700; color: var(--color-text); font-variant-numeric: tabular-nums; }
.status-divider { color: var(--color-border-strong); }
.status-bar-view-modes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding-left: 6px;
  border-left: 1px solid var(--color-border);
}
.status-bar-view-modes[hidden] {
  display: none !important;
}
.status-view-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform 120ms ease;
}
.status-view-btn:hover {
  border-color: rgba(248, 113, 113, 0.28);
  color: var(--color-text);
  transform: translateY(-1px);
}
.status-view-btn[aria-pressed="true"] {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.42);
  color: var(--color-primary);
}
.status-view-btn svg {
  pointer-events: none;
}

/* =============================================================
   MAIN CONTENT
   ============================================================= */
.main-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.app-fullscreen-fallback .main-content {
  min-height: calc(100dvh - var(--topbar-h));
}

.tab-panel { display: none; flex: 1; overflow: hidden; }
.tab-panel.active { display: flex; flex-direction: column; }

/* =============================================================
   DAY VIEW
   ============================================================= */
.day-view-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.day-view-layout.day-view-layout--full .sidebar-divider,
.day-view-layout.day-view-layout--full .sidebar {
  display: none !important;
}
.day-view-layout.day-view-layout--full .grid-wrapper {
  border-right: none;
}
.sidebar-calendar-host,
.sidebar-note-host {
  display: contents;
}
/* GRID WRAPPER */
.grid-wrapper {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--color-surface);
  position: relative;
  min-width: 0;
}

.grid-container {
  position: relative;
  display: grid;
  grid-template-columns: var(--time-col-w) 1fr;
  grid-template-rows: var(--lane-header-h) 1fr;
  min-height: fit-content;
  width: 100%;
}

/* Grid Corner */
.grid-corner {
  grid-column: 1;
  grid-row: 1;
  background: var(--resource-color, var(--color-brand));
  border-right: 1px solid rgba(255,255,255,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: white;
  position: sticky;
  top: 0; left: 0;
  z-index: 30;
}

/* Lane Headers */
.lane-headers {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(10, minmax(var(--lane-min-w), 1fr));
  height: var(--lane-header-h);
  background: var(--resource-color, var(--color-brand));
  position: sticky;
  top: 0;
  z-index: 25;
  border-bottom: 2px solid rgba(0,0,0,0.15);
}
.lane-header-cell {
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: white;
  border-right: 1px solid rgba(255,255,255,0.2);
  cursor: default;
  user-select: none;
  letter-spacing: 0.02em;
  background: var(--resource-color, var(--color-brand));
}
.lane-header-cell--grouped {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 4px 6px;
}
.lane-header-cell--group-start {
  box-shadow: inset 2px 0 0 rgba(255,255,255,0.72), inset 6px 0 0 rgba(0,0,0,0.18);
}
.lane-header-resource {
  font-size: 10px;
  line-height: 1.1;
  font-weight: 700;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.lane-header-unit {
  font-size: var(--text-sm);
  line-height: 1.1;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.day-view-layout--overview .lane-header-cell--grouped {
  padding: 3px 4px;
}
.day-view-layout--overview .lane-header-resource {
  font-size: 9px;
}
.day-view-layout--overview .lane-header-unit {
  font-size: 12px;
}
.lane-header-cell:last-child { border-right: none; }

/* Inactive lane header */
.lane-header-cell--inactive {
  background: rgba(220, 53, 69, 0.7);
  flex-direction: column;
  gap: 1px;
  line-height: 1.1;
}
.lane-inactive-label {
  font-size: 8px;
  font-weight: 500;
  opacity: 0.9;
  letter-spacing: 0;
}

/* Inactive lane grid cells */
.grid-cell--inactive {
  background: repeating-linear-gradient(
    -45deg,
    rgba(220, 53, 69, 0.06),
    rgba(220, 53, 69, 0.06) 4px,
    rgba(220, 53, 69, 0.12) 4px,
    rgba(220, 53, 69, 0.12) 8px
  ) !important;
  cursor: not-allowed !important;
}

/* Inactive lane in day view */
.lh-lane--inactive {
  background: rgba(220, 53, 69, 0.5) !important;
}
.day-time-cell--inactive {
  background: repeating-linear-gradient(
    -45deg,
    rgba(220, 53, 69, 0.06),
    rgba(220, 53, 69, 0.06) 4px,
    rgba(220, 53, 69, 0.12) 4px,
    rgba(220, 53, 69, 0.12) 8px
  ) !important;
}

/* Time Labels */
.time-labels {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  left: 0;
  z-index: 20;
  background: white;
  border-right: 2px solid var(--color-border-strong);
  border-bottom: 1.5px solid var(--color-border-strong);
}
.time-label {
  height: var(--row-height);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: var(--space-2);
  padding-top: 3px;
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.time-label.full-hour {
  font-weight: 700;
  color: var(--color-text);
  font-size: var(--text-xs);
}
.time-label.half-hour { color: var(--color-text-faint); }
.time-label--end {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: auto;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  align-items: flex-end;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--color-surface) 45%);
  pointer-events: none;
}

/* Grid Cells */
.grid-cells {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  position: relative;
  border-bottom: 1.5px solid var(--color-border-strong);
}

.calendar-hover-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--location-color, var(--color-primary));
  opacity: 0.42;
  z-index: 4;
  pointer-events: none;
  transform: translateY(-50%);
}
.calendar-hover-line[hidden] {
  display: none !important;
}

.grid-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(var(--lane-min-w), 1fr));
  height: var(--row-height);
  flex-shrink: 0;
}
.grid-row.full-hour { border-top: 1.5px solid var(--color-border-strong); background: rgba(0,0,0,0.008); }
.grid-row.half-hour { border-top: 1px solid var(--color-border); }

.grid-cell {
  border-right: 1px solid var(--color-border);
  height: var(--row-height);
  transition: background var(--transition);
  cursor: crosshair;
  position: relative;
  background: var(--col-tint, transparent);
}
.grid-cell--group-start {
  box-shadow: inset 2px 0 0 rgba(255,255,255,0.42), inset 6px 0 0 rgba(15,23,42,0.12);
}
.grid-cell:last-child { border-right: none; }
.grid-cell:hover { background: var(--col-tint-hover, var(--color-primary-light)); }

/* Reservations Layer */
.reservations-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
}

/* Reservation Block */
.res-block {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-2);
  cursor: pointer;
  pointer-events: all;
  overflow: hidden;
  transition: filter 100ms ease, box-shadow 100ms ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1px;
}
.res-block:hover {
  filter: brightness(0.92);
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
  z-index: 5;
}
.res-block.selected {
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color-primary);
  z-index: 6;
}
.res-block--linked-selected-peer {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.92), 0 0 0 4px #ef4444;
  z-index: 6;
}
.res-block.dragging {
  opacity: 0.5;
  z-index: 20;
  pointer-events: none;
}
.combo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  color: #1a1a1a;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.res-block--combo-highlight {
  filter: brightness(1.15);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 4px 16px rgba(0,0,0,0.35);
  z-index: 5;
}

/* Resize handles built into block */
.res-block .resize-handle-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 8px;
  cursor: ns-resize;
  z-index: 2;
}
.res-block .resize-handle-right {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 2;
}

.res-block-name {
  font-size: 12px;
  font-weight: 700;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.res-block-link-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.32);
  background: rgba(17, 24, 39, 0.18);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}
.res-block-link-indicator--child {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(224, 242, 254, 0.7);
}
.res-block-link-indicator--parent {
  background: rgba(250, 204, 21, 0.2);
  border-color: rgba(254, 240, 138, 0.72);
}
.res-block-series-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 999px;
  border: 1px solid rgba(161, 98, 7, 0.28);
  background: rgba(254, 243, 199, 0.96);
  color: #92400e;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}
.res-block--linked {
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.34), 0 0 0 1px rgba(15, 23, 42, 0.14);
}
.res-block--linked.res-block--linked-selected-peer {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.34), 0 0 0 2px rgba(255,255,255,0.92), 0 0 0 4px #ef4444;
}
.res-block-link-corner {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 2;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.36));
}
.res-block-link-corner--child {
  top: 0;
  left: 0;
  border-top: 24px solid #38bdf8;
  border-right: 24px solid transparent;
}
.res-block-link-corner--parent {
  right: 0;
  bottom: 0;
  border-bottom: 24px solid #facc15;
  border-left: 24px solid transparent;
}
.res-block-time {
  font-size: 10px;
  color: inherit;
  opacity: 0.85;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.res-block-persons {
  font-size: 10px;
  color: inherit;
  opacity: 0.85;
  line-height: 1.2;
}
.res-block-badge {
  font-size: 9px;
  background: rgba(128,128,128,0.2);
  color: inherit;
  padding: 1px 4px;
  border-radius: 3px;
  display: inline-block;
  line-height: 1.4;
  margin-top: auto;
  align-self: flex-start;
}
.res-block-occasion {
  font-size: 10px;
  color: inherit;
  opacity: 0.92;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.res-block-comment {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Drag Preview Ghost */
.drag-preview {
  position: absolute;
  border-radius: var(--radius-md);
  border: 2px dashed var(--color-primary);
  background: rgba(37, 99, 235, 0.12);
  z-index: 18;
  pointer-events: none;
  transition: top 60ms ease, left 60ms ease, width 60ms ease, height 60ms ease;
}
.drag-preview--valid {
  border-color: var(--color-success);
  background: rgba(34, 197, 94, 0.14);
}
.drag-preview--followup {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.16);
}
.drag-preview--blocked {
  border-color: var(--color-error);
  background: rgba(220, 38, 38, 0.16);
}

/* Current Time Line */
.current-time-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-time-line);
  z-index: 15;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(230, 57, 70, 0.5);
}
.current-time-dot {
  position: absolute;
  left: -6px;
  top: -5px;
  width: 12px;
  height: 12px;
  background: var(--color-time-line);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(230, 57, 70, 0.6);
}

/* =============================================================
   SIDEBAR DIVIDER
   ============================================================= */
.sidebar-divider {
  width: 4px;
  background: var(--color-border);
  cursor: col-resize;
  flex-shrink: 0;
  transition: background 120ms ease;
  position: relative;
  z-index: 35;
}
.sidebar-divider:hover,
.sidebar-divider.active {
  background: var(--color-primary);
}

/* =============================================================
   SIDEBAR
   ============================================================= */
.sidebar {
  width: var(--sidebar-w);
  min-width: 200px;
  max-width: 440px;
  background: white;
  border-left: 1px solid var(--color-border);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* Sidebar Calendar (always at top) */
.sidebar-calendar {
  border-bottom: 1px solid var(--color-border);
  background: white;
  flex-shrink: 0;
}
.sidebar-calendar .mini-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-1) var(--space-3);
  background: var(--resource-color, var(--color-brand));
  color: white;
}
.sidebar-calendar .mini-cal-title { font-size: var(--text-sm); font-weight: 600; color: white; }
.sidebar-calendar .mini-cal-nav {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: white;
  transition: background var(--transition);
}
.sidebar-calendar .mini-cal-nav:hover { background: rgba(255,255,255,0.2); }

.mini-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  padding: var(--space-2) var(--space-3) var(--space-1);
}
.mini-cal-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  padding: var(--space-1) var(--space-3) var(--space-2);
}
.cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--color-text);
  font-weight: 400;
}
.cal-day:hover { background: var(--color-primary-light); color: var(--color-primary); }
.cal-day.today { font-weight: 700; color: var(--color-brand); }
.cal-day.selected { background: var(--color-primary); color: white; font-weight: 600; }
.cal-day.other-month { color: var(--color-text-faint); }
.cal-day.rest-day { color: var(--color-text-faint); }
.cal-day { position: relative; }
.mini-cal-dot {
  width: 4px; height: 4px; border-radius: 50%;
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  pointer-events: none;
}
.mini-cal-dot-closed { background: #ef4444; }
.mini-cal-dot-special { background: #f59e0b; }
.mini-cal-dot-rest { background: #9ca3af; }

/* Mini calendar tooltip */
.mini-cal-tooltip {
  position: fixed;
  z-index: 9999;
  background: var(--color-surface, #fff);
  color: var(--color-text, #1a1a1a);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-md, 6px);
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.mini-cal-tooltip.visible { opacity: 1; }
.mini-cal-footer {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}
.mini-cal-today-btn {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 500;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--transition);
}
.mini-cal-today-btn:hover { background: var(--color-primary-light); }

.mini-cal-capacity-btn {
  margin-left: auto;
}

.capcal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 32px);
}
.capcal-overlay[hidden],
.capcal-status[hidden],
.capcal-detail[hidden] {
  display: none !important;
}
.capcal-modal {
  width: min(1180px, 100%);
  max-height: min(96vh, 1040px);
  overflow: auto;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  padding: clamp(18px, 2.2vw, 28px);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.capcal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 1.05fr) auto;
  gap: var(--space-3);
  align-items: start;
}
.capcal-header-copy {
  min-width: 0;
}
.capcal-header-tools {
  min-width: 0;
  align-self: start;
  justify-self: end;
  width: min(100%, 560px);
}
.capcal-title {
  margin: 0;
  font-size: clamp(1.35rem, 1.9vw, 1.8rem);
}
.capcal-subtitle {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}
.capcal-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-text);
  font-size: 1.7rem;
  line-height: 1;
}
.capcal-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: end;
}
.capcal-header-tools.capcal-toolbar {
  align-items: start;
}
.capcal-toolbar-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.capcal-toolbar-group--month {
  min-width: 0;
}
.capcal-toolbar-group .form-label {
  margin-bottom: 0;
}
.capcal-month-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.capcal-month-label {
  min-width: 150px;
  padding: 0 var(--space-1);
  font-weight: 700;
  font-size: var(--text-base);
}
.capcal-resource-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.capcal-filter-chip {
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-text);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
}
.capcal-filter-chip.is-active {
  background: rgba(14, 138, 168, 0.12);
  border-color: rgba(14, 138, 168, 0.42);
  color: #0e7490;
}
.capcal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
}
.capcal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.capcal-legend-swatch {
  width: 22px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}
.capcal-legend-swatch--low {
  background: rgba(14, 138, 168, 0.18);
}
.capcal-legend-swatch--high {
  background: rgba(14, 138, 168, 0.48);
}
.capcal-legend-bar {
  width: 24px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.5), rgba(125, 211, 252, 0.8));
}
.capcal-status {
  border-radius: 14px;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}
.capcal-status--loading {
  background: rgba(14, 138, 168, 0.08);
  color: #0f766e;
}
.capcal-status--error {
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
}
.capcal-status--empty {
  background: rgba(148, 163, 184, 0.12);
  color: var(--color-text-secondary);
}
.capcal-grid-wrap {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: var(--space-3);
}
.capcal-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.capcal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.capcal-weekdays span {
  text-align: left;
  padding: 0 4px;
}
.capcal-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-2);
}
.capcal-day {
  position: relative;
  min-height: 138px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--color-surface);
  overflow: hidden;
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  gap: var(--space-2);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.capcal-day-fill {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.capcal-day-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
  z-index: 1;
}
.capcal-day-bar-confirmed,
.capcal-day-bar-provisional {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 0 999px 999px 0;
}
.capcal-day-date,
.capcal-day-topline,
.capcal-day-stats,
.capcal-day-markers {
  position: relative;
  z-index: 2;
}
.capcal-day-topline {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.capcal-day-date {
  font-weight: 700;
  font-size: var(--text-sm);
}
.capcal-day-hours {
  font-size: 10px;
  line-height: 1.25;
  color: var(--color-text-secondary);
  text-align: right;
}
.capcal-day-stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
}
.capcal-day-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--color-text-secondary);
}
.capcal-day-stat strong {
  font-size: 11px;
  color: var(--color-text);
}
.capcal-day-stat-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.capcal-day-markers {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 18px;
}
.capcal-day-markers-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 7px;
}
.capcal-day--other-month {
  opacity: 0.54;
}
.capcal-day--selected {
  box-shadow: 0 0 0 2px rgba(14, 138, 168, 0.92);
}
.capcal-day--today {
  border-color: rgba(14, 138, 168, 0.36);
}
.capcal-day--closed {
  background-image: linear-gradient(180deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.02));
}
.capcal-marker {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
}
.capcal-marker--closed {
  background: #ef4444;
}
.capcal-marker--special {
  background: #f59e0b;
}
.capcal-marker--rest {
  background: #94a3b8;
}
.capcal-day-alert {
  margin-left: auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.capcal-legend-item .capcal-day-alert {
  margin-left: 0;
}
.capcal-day-alert-icon {
  width: 10px;
  height: 10px;
}
.capcal-day-alert--outside {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(217, 119, 6, 0.5);
  color: #b45309;
}
.capcal-detail {
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: var(--color-surface-soft);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.capcal-summary-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.capcal-summary-date {
  font-size: var(--text-lg);
  font-weight: 700;
}
.capcal-summary-hours {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}
.capcal-summary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}
.capcal-summary-stat {
  border-radius: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.capcal-summary-label {
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
}
.capcal-hourly {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.capcal-hourly-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.capcal-hourly-title {
  font-weight: 700;
}
.capcal-hourly-subtitle {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}
.capcal-hourly-row--labels {
  margin-top: 2px;
}
.capcal-hourly-cells--labels {
  align-items: end;
}
.capcal-hourly-slot-label {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 18px;
  font-size: 10px;
  color: var(--color-text-muted);
}
.capcal-hourly-scale {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: 10px;
}
.capcal-hourly-scale::before {
  content: '';
}
.capcal-hourly-scale span {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(24px, 1fr));
}
.capcal-hourly-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: var(--space-2);
  align-items: center;
}
.capcal-hourly-label {
  font-size: var(--text-xs);
  font-weight: 600;
}
.capcal-hourly-cells {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(16px, 1fr);
  gap: 4px;
}
.capcal-hourly-cell {
  height: 20px;
  border-radius: 6px;
  background: rgba(14, 138, 168, 0.08);
}
.capcal-hourly-empty {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

@media (max-width: 1024px) {
  .capcal-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .capcal-header-tools {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }
  .capcal-toolbar {
    grid-template-columns: 1fr;
  }
  .capcal-summary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .capcal-overlay {
    padding: 10px;
  }
  .capcal-modal {
    max-height: 96vh;
    border-radius: 16px;
    padding: 16px;
  }
  .capcal-header {
    grid-template-columns: 1fr auto;
  }
  .capcal-header-tools {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }
  .capcal-days {
    gap: 6px;
  }
  .capcal-day {
    min-height: 126px;
    padding: 10px;
  }
  .capcal-day-stats {
    gap: 4px;
  }
  .capcal-summary-stats {
    grid-template-columns: 1fr;
  }
  .capcal-hourly-row {
    grid-template-columns: 1fr;
  }
  .capcal-hourly-label--empty {
    display: none;
  }
}

/* Day Note Section */
.day-note-section {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  background: #FFFDE7;
  flex-shrink: 0;
}
.day-note-textarea {
  width: 100%;
  border: 1px solid #E8E0B0;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-family: inherit;
  color: var(--color-text);
  background: transparent;
  resize: vertical;
  min-height: 48px;
  line-height: 1.5;
  transition: border-color var(--transition);
}
.day-note-textarea:focus {
  outline: none;
  border-color: var(--color-brand);
}
.day-note-textarea::placeholder {
  color: #B0A870;
}

.sidebar-panel { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; }

.sidebar-title { font-size: var(--text-base); font-weight: 700; color: var(--color-text); }
.sidebar-section-title { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--space-2); }
.sidebar-section { display: flex; flex-direction: column; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  text-align: center;
}
.stat-card--green { border-color: var(--color-success); background: var(--color-success-light); }
.stat-card--orange { border-color: var(--color-brand); background: var(--color-brand-light); }
.stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* Status breakdown */
.status-breakdown { display: flex; flex-direction: column; gap: var(--space-2); }
.status-row { display: flex; align-items: center; justify-content: space-between; }
.status-count { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); font-variant-numeric: tabular-nums; }

/* Package breakdown */
.package-breakdown { display: flex; flex-direction: column; gap: var(--space-2); }
.package-row { display: flex; align-items: center; gap: var(--space-2); }
.package-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.package-name { font-size: var(--text-xs); color: var(--color-text-muted); flex: 1; }
.package-count { font-size: var(--text-xs); font-weight: 600; color: var(--color-text); font-variant-numeric: tabular-nums; }

/* Upcoming list */
.upcoming-list { display: flex; flex-direction: column; gap: var(--space-2); }
.upcoming-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}
.upcoming-item:hover { background: var(--color-surface-2); }
.upcoming-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.upcoming-info { flex: 1; min-width: 0; }
.upcoming-name { font-size: var(--text-xs); font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-meta { font-size: 10px; color: var(--color-text-muted); }
.upcoming-lane { font-size: 10px; color: var(--color-text-faint); white-space: nowrap; }

/* Detail Panel */
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; }
.detail-close { width: 28px; height: 28px; flex-shrink: 0; }
.detail-package-badge {
  display: inline-flex; align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: white;
  align-self: flex-start;
}

.detail-edit-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.detail-actions { display: flex; flex-direction: column; gap: var(--space-2); }

/* =============================================================
   BADGES
   ============================================================= */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.6;
}
.badge--confirmed { background: var(--color-success-light); color: var(--color-success-text); }
.badge--pending   { background: var(--color-warning-light); color: var(--color-warning-text); }
.badge--offer-open { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.badge--pre-reserved { background: rgba(217, 119, 6, 0.12); color: #b45309; }
.badge--cancelled { background: var(--color-error-light); color: var(--color-error-text); }
.badge--checkedin { background: var(--color-primary-light); color: var(--color-primary); }
.badge--settled   { background: #e8e8e8; color: #6b7280; }
.badge--removed   { background: rgba(107, 114, 128, 0.16); color: #6b7280; }

/* =============================================================
   FORMS
   ============================================================= */
.form-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.form-label { font-size: 0.7rem; font-weight: 600; color: var(--color-text-muted); letter-spacing: 0.02em; }
.form-input, .form-select, .form-textarea {
  padding: 6px var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-textarea { resize: vertical; min-height: 56px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.form-row--single { grid-template-columns: minmax(0, 1fr); }
.form-row-3 { display: grid; grid-template-columns: auto auto 1fr; gap: var(--space-2); }
.form-row-4 { display: grid; grid-template-columns: 1fr auto auto auto; gap: var(--space-2); }
.form-row-5 { display: grid; grid-template-columns: minmax(0, 92px) minmax(0, 1fr) minmax(0, 92px) minmax(0, 92px) auto; gap: var(--space-2); align-items: end; }
.form-row-4 .form-select,
.form-row-4 .form-input[type="date"],
.form-row-5 .form-select,
.form-row-5 .form-input { min-width: 0; }

/* Phone input group */
.phone-input-group {
  display: flex;
  gap: 0;
}
.phone-input-group .phone-country-code {
  flex: 0 0 auto;
  width: 110px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: none;
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-2);
}
.phone-input-group .phone-number-input {
  flex: 1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  min-width: 0;
}

/* Form error message */
.form-error {
  font-size: 11px;
  color: #d32f2f;
  margin-top: 2px;
}
.form-error[hidden] { display: none; }
.input-error {
  border-color: #d32f2f !important;
  box-shadow: 0 0 0 2px rgba(211,47,47,0.15);
}

/* Color input */
input[type="color"] {
  width: 36px; height: 36px;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: white;
}

/* Modal duration display */
.modal-duration-display {
  font-size: var(--text-sm) !important;
  font-weight: 600 !important;
  color: var(--color-primary) !important;
  padding: var(--space-2) 0;
}

/* =============================================================
   LIST VIEW
   ============================================================= */
.list-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.list-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: white;
  flex-shrink: 0;
}

.search-wrapper {
  position: relative;
  flex: 0 0 280px;
}
.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-faint);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: var(--space-2) var(--space-3) var(--space-2) 2.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--color-surface);
  transition: border-color var(--transition);
}
.search-input:focus { outline: none; border-color: var(--color-primary); background: white; }

.list-resource-filter {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.list-range-filter,
.list-status-detail {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.list-resource-filter-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.list-range-filter-select {
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.list-range-filter-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.list-resource-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.list-resource-filter-toggle:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface);
}
.list-resource-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  max-width: min(360px, 92vw);
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-lg);
  z-index: 12;
}
.list-resource-filter-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  text-align: left;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.list-resource-filter-option:hover {
  background: var(--color-surface);
}
.list-resource-filter-option input {
  accent-color: var(--color-primary);
}
.list-resource-filter-option--all {
  font-weight: 600;
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--space-1);
  padding-bottom: calc(var(--space-2) + 1px);
}

.filter-group { display: flex; gap: var(--space-1); }
.filter-btn {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: white;
  transition: all var(--transition);
}
.filter-btn:hover { background: var(--color-surface); color: var(--color-text); }
.filter-btn.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

.table-wrapper {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.reservation-table {
  border-collapse: separate;
  border-spacing: 0;
}

.reservation-table th, .reservation-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
  vertical-align: middle;
  background-clip: padding-box;
}
.reservation-table th {
  background: var(--res-table-header-bg, var(--color-surface));
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--res-table-header-color, var(--color-text-muted));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
  border-bottom: 2px solid var(--res-table-header-border, var(--color-border));
  user-select: none;
  overflow: hidden;
}
.reservation-table tbody tr { cursor: pointer; }
.reservation-table tbody td {
  background: transparent;
  transition: none;
}
.reservation-table tbody tr:hover {
  background: var(--reservation-row-hover, color-mix(in srgb, var(--color-surface) 78%, #f4f7fb 22%));
}
.reservation-table tbody tr:hover td { background: transparent; }
.list-mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-secondary);
}
.list-mode-toggle .list-mode-btn {
  border-color: transparent;
  font-weight: 700;
  min-width: 112px;
  justify-content: center;
}
.list-mode-toggle .list-mode-btn:not(.active) {
  background: #fff;
  color: var(--color-text-muted);
  border-color: var(--color-border);
  box-shadow: none;
}
.list-mode-toggle .list-mode-btn:not(.active):hover {
  background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
  color: var(--color-primary);
  border-color: color-mix(in srgb, var(--color-primary) 32%, var(--color-border));
}
.list-mode-toggle .list-mode-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.28);
}
.waitlist-row {
  --reservation-row-hover: rgba(251, 191, 36, 0.16);
  cursor: pointer;
}
.waitlist-row td:first-child {
  border-left: 3px solid #f59e0b;
}
.badge.status-waitlist-badge {
  display: inline-flex;
  width: auto;
  min-height: 0;
  padding: 3px 8px;
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(251, 191, 36, 0.18);
  color: #92400e;
  box-shadow: none;
  cursor: default;
}
.waitlist-entry-detail-dialog {
  width: min(720px, calc(100vw - 32px));
  max-width: 720px;
}
.confirm-dialog.waitlist-entry-detail-dialog {
  width: min(720px, calc(100vw - 32px));
  max-width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.waitlist-entry-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.waitlist-entry-detail-kicker {
  margin-bottom: 3px;
  color: #b45309;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.waitlist-entry-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-2);
  margin: var(--space-3) 0;
}
.waitlist-entry-detail-item {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
}
.waitlist-entry-detail-item span {
  display: block;
  margin-bottom: 2px;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}
.waitlist-entry-detail-item strong {
  color: var(--color-text);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.waitlist-entry-detail-note,
.waitlist-entry-detail-target {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(251, 191, 36, 0.14);
  color: #78350f;
  font-size: var(--text-sm);
}
.waitlist-entry-detail-target {
  background: rgba(14, 138, 168, 0.1);
  color: var(--color-text-secondary);
}
.waitlist-entry-detail-actions {
  flex-wrap: wrap;
  width: 100%;
  margin-top: var(--space-4);
}
.waitlist-entry-detail-actions .btn {
  min-width: 0;
}
@media (max-width: 520px) {
  .waitlist-entry-detail-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .waitlist-entry-detail-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Column resize handle */
.col-resize-handle {
  position: absolute;
  right: 0;
  top: 4px;
  bottom: 4px;
  width: 5px;
  cursor: col-resize;
  background: #d0d0d0;
  border-radius: 2px;
  transition: background 120ms;
  z-index: 2;
}
.col-resize-handle:hover,
.col-resize-handle.active {
  background: var(--color-primary);
}
.reservation-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  border-right: 1px solid #e0e0e0;
}
.reservation-table th:last-child {
  border-right: none;
}
.reservation-table td {
  border-right: 1px solid #f0f0f0;
}
.reservation-table td:last-child {
  border-right: none;
}

.col-id       { width: 60px; font-variant-numeric: tabular-nums; position: relative; }
.col-name     { min-width: 140px; position: relative; }
.col-resource { min-width: 140px; position: relative; }
.col-lane     { width: 64px; text-align: center; position: relative; }
.col-datum    { width: 100px; white-space: nowrap; position: relative; }
.col-datetime { min-width: 110px; white-space: nowrap; position: relative; }
.col-package  { width: 100px; position: relative; }
.col-occasion { width: 130px; position: relative; }
.col-persons  { width: 60px; text-align: center; position: relative; }
.col-status   { width: 110px; position: relative; }
.col-comment  { max-width: 180px; position: relative; }
.col-action   { width: 80px; white-space: nowrap; }

.table-id-cell { font-weight: 600; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.table-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  font-weight: 600;
  color: var(--color-text);
}
.table-name-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-linked-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(161, 98, 7, 0.22);
  background: rgba(250, 204, 21, 0.18);
  color: #a16207;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  margin-left: auto;
}
.table-series-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 38%, var(--color-border) 62%);
  background: color-mix(in srgb, var(--color-primary-light) 92%, white 8%);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  margin-left: auto;
}
.table-resource-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.table-resource-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--resource-dot-color, var(--color-border-strong));
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.table-resource-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-lane-cell {
  font-weight: 600;
  font-size: var(--text-sm);
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table-package-dot {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-xs); font-weight: 600;
}
.table-package-dot::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--dot-color, var(--color-text-muted));
}
.table-comment-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 180px;
}
.table-comment { font-size: var(--text-xs); color: var(--color-text-muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-comment--internal {
  color: var(--color-primary);
  font-weight: 600;
}
.table-action-btn {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface);
  transition: all var(--transition);
}
.table-action-btn:hover { background: var(--color-primary); color: white; border-color: var(--color-primary); }

.table-footer {
  padding: var(--space-3) var(--space-6);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: white;
  flex-shrink: 0;
}

/* =============================================================
   CUSTOMER DATABASE VIEW
   ============================================================= */
.customer-toolbar-actions {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}
.customer-toolbar-actions .btn[hidden] {
  display: none !important;
}

.customer-table .sortable-col {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.customer-table .sortable-col:hover {
  background: var(--color-surface);
}
.sort-indicator {
  display: inline-block;
  width: 14px;
  font-size: 10px;
  color: var(--color-text-muted);
  vertical-align: middle;
}
.sort-indicator.asc::after { content: '\25B2'; }
.sort-indicator.desc::after { content: '\25BC'; }

.customer-table .col-cust-name { min-width: 140px; }
.customer-table .col-cust-email { min-width: 180px; }
.customer-table .col-cust-phone { min-width: 120px; }
.customer-table .col-cust-visits { min-width: 70px; text-align: center; }
.customer-table .col-cust-persons { min-width: 80px; text-align: center; }
.customer-table .col-cust-first { min-width: 100px; }
.customer-table .col-cust-last { min-width: 100px; }
.customer-table .col-cust-packages { min-width: 120px; }
.customer-table .col-cust-occasions { min-width: 110px; }
.customer-table .col-cust-status { min-width: 80px; }

.customer-table {
  --reservation-row-hover: rgba(255, 140, 0, 0.08);
}
.customer-email-text {
  color: var(--color-text-secondary);
}

.cust-visits-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}
.cust-visits-badge--low { background: #e8f5e9; color: #2e7d32; }
.cust-visits-badge--mid { background: #fff3e0; color: #e65100; }
.cust-visits-badge--high { background: #e3f2fd; color: #1565c0; }
.cust-visits-badge--vip { background: #f3e5f5; color: #7b1fa2; }
.cust-visits-badge--empty { background: rgba(245, 158, 11, 0.14); color: #92400e; }

.cust-package-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.cust-package-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  color: white;
}

.cust-occasion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.cust-occasion-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  background: var(--color-surface);
  white-space: nowrap;
}

.cust-status-label {
  font-size: 11px;
  font-weight: 500;
}
.cust-status-label--stammgast { color: #7b1fa2; }
.cust-status-label--wiederkehrend { color: #1565c0; }
.cust-status-label--neukunde { color: var(--color-text-muted); }
.cust-status-label--noch-kein-besuch { color: #b45309; }

.customer-table tbody td {
  vertical-align: middle;
}
.customer-table-filter-control {
  height: 26px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 4px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 11px;
}
.customer-table-filter-control::placeholder {
  color: var(--color-text-faint);
}
.customer-table-filter-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.customer-table-filter-select {
  padding-right: 20px;
}

/* =============================================================
   BOOKING VIEW
   ============================================================= */
.booking-layout {
  display: flex;
  gap: var(--space-6);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.booking-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-4) var(--space-3) var(--space-6);
}

.booking-hero {
  text-align: center;
  margin-bottom: var(--space-3);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-1);
}
.booking-hero-icon { margin: 0 auto; width: 32px; height: 32px; }
.booking-hero-icon svg { width: 32px; height: 32px; }
.booking-title { font-size: var(--text-lg); font-weight: 700; color: var(--color-text); }
.booking-subtitle { font-size: var(--text-xs); color: var(--color-text-muted); max-width: 480px; }

.booking-steps {
  display: flex; align-items: center;
  margin-bottom: var(--space-3);
  gap: 0;
}
.step-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 56px;
}
.step-circle {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  border: 2px solid var(--color-border);
  transition: all var(--transition);
}
.step-item.active .step-circle {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.step-item.completed .step-circle {
  background: var(--color-success);
  color: white;
  border-color: var(--color-success);
}
.step-label { font-size: 0.6rem; font-weight: 500; color: var(--color-text-muted); white-space: nowrap; }
.step-item.active .step-label { color: var(--color-primary); font-weight: 600; }
.step-connector {
  height: 2px; flex: 1;
  background: var(--color-border);
  min-width: 24px;
  margin-bottom: 14px;
}
.step-connector.completed { background: var(--color-success); }

.booking-content { width: 100%; max-width: 560px; }
.booking-step-panel { display: none; }
.booking-step-panel.active { display: block; }

.booking-step-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  text-align: center;
}
.booking-step-body { margin-bottom: var(--space-3); }
.booking-step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}
.booking-step-nav .btn {
  padding: 6px var(--space-3);
  font-size: var(--text-xs);
}

.booking-date-picker { margin-bottom: var(--space-3); }
.booking-date-picker .form-input { max-width: 240px; }

.booking-closed-msg {
  padding: var(--space-2) var(--space-3);
  background: var(--color-warning-light);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-md);
  color: var(--color-warning-text);
  font-weight: 600;
  font-size: var(--text-xs);
  text-align: center;
}
.booking-closed-msg--lead-time {
  text-align: left;
}
.booking-lead-time-notice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.45;
}
.booking-lead-time-notice strong {
  color: #92400e;
}
.booking-lead-time-notice span {
  color: var(--color-text);
}
.booking-lead-time-notice small {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.time-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 4px;
}
.time-slot {
  padding: 4px 6px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease, font-weight 180ms ease;
  background: white;
  font-variant-numeric: tabular-nums;
}
.time-slot:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }
.time-slot.selected {
  border: 3px solid #FF8C00;
  background: #FF8C00;
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(255, 140, 0, 0.35);
  z-index: 1;
  position: relative;
}
@keyframes slotPop {
  0%   { box-shadow: 0 0 0 rgba(255, 140, 0, 0); }
  50%  { box-shadow: 0 6px 24px rgba(255, 140, 0, 0.5); }
  100% { box-shadow: 0 4px 16px rgba(255, 140, 0, 0.35); }
}
.time-slot.slot-pop {
  animation: slotPop 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.time-slot.unavailable {
  background: var(--color-surface);
  color: var(--color-text-faint);
  border-color: var(--color-border);
  cursor: not-allowed;
  text-decoration: line-through;
}
.time-slot.unavailable:hover {
  border-color: var(--color-border);
  color: var(--color-text-faint);
  background: var(--color-surface);
}
.online-waitlist-cta {
  grid-column: 1 / -1;
  margin-top: var(--space-3);
  padding: var(--space-4);
  border: 1px solid rgba(217, 119, 6, 0.26);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(254, 243, 199, 0.72));
  color: #78350f;
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.12);
}
.online-waitlist-cta__intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-3);
}
.online-waitlist-cta__reason {
  font-size: var(--text-xs);
  color: #92400e;
}
.online-waitlist-cta__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.online-waitlist-cta__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.waitlist-online-phone-hint {
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(217, 119, 6, 0.18);
  font-size: var(--text-sm);
}

/* Stepper Control (Persons & Lanes) */
.stepper-control {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 200px;
}
.stepper-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.stepper-btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); border-right: none; }
.stepper-btn:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; border-left: none; }
.stepper-btn:hover { background: var(--color-primary-light); color: var(--color-primary); border-color: var(--color-primary); }
.stepper-btn:active { transform: scale(0.95); }
.stepper-input {
  width: 48px;
  height: 36px;
  text-align: center;
  font-size: var(--text-base);
  font-weight: 700;
  border-radius: 0;
  border: 2px solid var(--color-border);
  -moz-appearance: textfield;
}
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.form-hint {
  margin-top: 2px;
  font-size: 0.65rem;
  color: var(--color-text-secondary);
}

.booking-option-list {
  display: grid;
  gap: var(--space-2);
}

.booking-option-list--modal {
  margin-top: 2px;
}

.booking-option-choice {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
}

.booking-option-choice__text {
  color: var(--color-text);
  font-weight: 500;
}

.booking-option-list__empty {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.validation-msg {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: #FEF2F2;
  border: 1px solid var(--color-error);
  border-radius: var(--radius-md);
  color: var(--color-error);
  font-size: var(--text-sm);
  font-weight: 500;
}
.persons-lanes-form {
  max-width: 280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.persons-lanes-form .form-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.persons-lanes-form .stepper-control {
  justify-content: center;
}
.persons-lanes-form .form-hint {
  text-align: center;
}
.persons-lanes-form .validation-msg {
  text-align: center;
  width: 100%;
}
/* Squeeze hint (persons exceed standard per unit, but within squeeze limit) */
.squeeze-hint {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: #FFF7ED;
  border: 1px solid #F59E0B;
  border-radius: var(--radius-md);
  color: #92400E;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
}

.availability-warning {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  border-radius: var(--radius-md);
  color: #92400E;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
}

/* Package Duration Info (shown instead of duration picker when fixed/calculated) */
.package-duration-info {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: #EFF6FF;
  border: 1px solid #3B82F6;
  border-radius: var(--radius-md);
  color: #1E40AF;
  font-size: var(--text-base);
  font-weight: 600;
  text-align: center;
}

/* Duration Picker */
.duration-picker { margin-top: var(--space-3); }
.duration-btn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}
.duration-btn {
  padding: 4px var(--space-2);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  background: white;
  transform: scale(1);
}
.duration-btn:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }
.duration-btn.selected {
  border: 3px solid #FF8C00;
  background: #FF8C00;
  color: white;
  font-weight: 700;
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(255, 140, 0, 0.35);
}
.duration-btn.slot-pop {
  animation: slotPop 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Occasion Cards */
.occasion-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-2);
}
.occasion-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: white;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}
.occasion-card:hover { border-color: var(--color-brand); background: var(--color-brand-light); }
.occasion-card.selected {
  border: 3px solid #FF8C00;
  background: #FF8C00;
  color: white;
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(255, 140, 0, 0.3);
}
.occasion-card.slot-pop {
  animation: slotPop 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
.occasion-emoji { font-size: 1.25rem; line-height: 1; }
.occasion-card.selected .occasion-emoji { filter: brightness(1.1); }
.occasion-name { font-size: var(--text-sm); font-weight: 600; }
.occasion-desc { font-size: var(--text-xs); color: var(--color-text-muted); }
.occasion-card.selected .occasion-desc { color: rgba(255,255,255,0.8); }

/* Embed Code Section */
.embed-code-section {
  width: 320px;
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: var(--space-8);
  margin-top: var(--space-8);
  margin-right: var(--space-4);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}
.embed-code-section h3 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.embed-code-section p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.embed-code-textarea {
  width: 100%;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: var(--text-xs);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  color: var(--color-text);
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}
.embed-code-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}
.embed-copy-btn {
  margin-top: var(--space-3);
}
body.embed-mode .embed-code-section { display: none !important; }

/* Package Cards */
.package-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.package-card {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  cursor: pointer;
  transition: all var(--transition);
  background: white;
  position: relative;
  overflow: hidden;
}
.package-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--pkg-color);
}
.package-card:hover { border-color: var(--pkg-color); box-shadow: var(--shadow-md); }
.package-card.selected {
  border-color: var(--pkg-color);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--pkg-color) 20%, transparent);
}
.package-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-1); }
.package-card-name { font-size: var(--text-sm); font-weight: 700; color: var(--color-text); }
.package-card-price { font-size: var(--text-base); font-weight: 700; color: var(--pkg-color); font-variant-numeric: tabular-nums; }
.package-card-features { display: flex; flex-direction: column; gap: var(--space-1); }
.package-feature {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); color: var(--color-text-muted);
}
/* Package card info badges */
.package-card-badges {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; padding-top: 6px;
  border-top: 1px solid var(--color-border);
}
.pkg-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; line-height: 1; color: #555;
  background: #f0f0f0; border: 1px solid #ddd; border-radius: 999px;
  padding: 3px 10px; white-space: nowrap;
}

/* ===== Admin Package Accordion Cards ===== */
.pkg-accordion-card {
  --pkg-surface-1: #edf1f5;
  --pkg-surface-1-hover: #e7ecf1;
  --pkg-surface-2: #dbe3ec;
  --pkg-surface-3: #e3e9f0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--pkg-surface-1);
}
.pkg-accordion-card.mgr-card {
  background: var(--pkg-surface-1);
}
.pkg-accordion-header {
  background: var(--pkg-surface-1);
  transition: background 0.15s;
}
.pkg-accordion-header:hover { background: var(--pkg-surface-1-hover); }
.pkg-accordion-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
  margin-left: auto;
  padding-left: var(--space-3);
}
.pkg-delete-btn {
  appearance: none;
  background: none;
  border: none;
  color: var(--color-error);
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: var(--space-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.pkg-delete-btn:hover { background: var(--color-error-light); }
.pkg-delete-btn:focus-visible {
  outline: 2px solid rgba(239, 68, 68, 0.35);
  outline-offset: 2px;
}
.pkg-accordion-chevron { display: inline-block; }
.pkg-accordion-body {
  border-top: 1px solid var(--color-border);
  background: var(--pkg-surface-1);
}
.pkg-accordion-section { padding: 0; }
.pkg-time-rule-row { flex-wrap: wrap; }
.pkg-resource-context-note {
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  box-shadow: inset 3px 0 0 var(--pkg-resource-accent, var(--color-primary));
}
.pkg-resource-context-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.pkg-resource-context-copy {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text-secondary);
}
.pkg-assignment-context-note {
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border: 1px dashed var(--color-border-strong, var(--color-border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-bg-secondary) 74%, transparent);
}
.pkg-assignment-context-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.pkg-assignment-context-copy {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text-secondary);
}
.pkg-editor-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: transparent;
  margin-bottom: var(--space-3);
  overflow: hidden;
}
.pkg-editor-section-header {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px) 44px;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--pkg-surface-2);
  border: none;
  text-align: left;
  cursor: pointer;
}
.pkg-editor-section-header::after {
  content: '▾';
  align-self: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
}
.pkg-editor-section.is-open .pkg-editor-section-header::after {
  transform: rotate(180deg);
}
.pkg-editor-section-headings {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pkg-editor-section-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.pkg-editor-section-description,
.pkg-editor-section-summary {
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  line-height: 1.45;
}
.pkg-editor-section-summary {
  min-width: 0;
  max-width: 280px;
  justify-self: end;
}
.pkg-editor-section-header::after {
  content: none;
}
.pkg-editor-section-toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  align-self: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.pkg-editor-section-header:hover .pkg-editor-section-toggle,
.pkg-editor-section-header:focus-visible .pkg-editor-section-toggle {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}
.pkg-editor-section.is-open .pkg-editor-section-toggle {
  transform: rotate(180deg);
}
.pkg-editor-section-summary-empty {
  color: var(--color-text-muted);
}
.pkg-editor-section-body {
  display: none;
  padding: 0 var(--space-4) var(--space-4);
  border-top: 1px solid var(--color-border);
  background: var(--pkg-surface-3);
}
.pkg-editor-section.is-open .pkg-editor-section-body {
  display: block;
}
.pkg-editor-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-3);
}
.pkg-pricing-preview {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-4);
}
.pkg-pricing-preview__header {
  margin-bottom: var(--space-3);
}
.pkg-pricing-preview__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}
.pkg-pricing-preview__subtitle,
.pkg-pricing-preview__hint,
.pkg-pricing-preview__empty {
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--color-text-secondary);
}
.pkg-pricing-preview__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.pkg-pricing-preview__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
}
.pkg-pricing-preview__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pkg-pricing-preview__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.pkg-pricing-preview__value {
  flex-shrink: 0;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  text-align: right;
}
.pkg-editor-inline-note {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  line-height: 1.5;
}
.pkg-time-rule-card {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
}
.pkg-time-rule-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.pkg-time-rule-card__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.pkg-time-rule-card__weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}
.pkg-time-rule-card__grid {
  gap: var(--space-3);
}
.pkg-units-mode {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.pkg-units-list {
  margin-top: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-secondary);
}
.pkg-followup-help {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  line-height: 1.5;
}
@media (max-width: 720px) {
  .pkg-editor-section-header {
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: start;
  }
  .pkg-editor-section-summary {
    max-width: none;
    justify-self: start;
    grid-column: 1;
  }
  .pkg-editor-section-toggle {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
  }
  .pkg-pricing-preview__row {
    flex-direction: column;
  }
  .pkg-pricing-preview__value {
    text-align: left;
  }
}

/* ===== Modal Accordion ===== */
.modal-accordion { border-top: 1px solid var(--color-border); margin-top: var(--space-2); }
.modal-accordion-header:hover { color: var(--color-primary); }
.modal-accordion-chevron { display: inline-block; font-size: 10px; transition: transform 0.2s; }
.package-feature::before { content: '\2713'; color: var(--pkg-color); font-weight: 700; }

/* Contact Form */
.contact-form { display: flex; flex-direction: column; gap: var(--space-2); }

/* Booking Summary */
.booking-summary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.summary-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.summary-label { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.summary-value { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); overflow-wrap: break-word; word-break: break-word; }
.summary-total {
  grid-column: 1 / -1;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
  display: flex; justify-content: space-between; align-items: center;
}
.summary-total-label { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); }
.summary-total-value { font-size: var(--text-lg); font-weight: 700; color: var(--color-primary); font-variant-numeric: tabular-nums; }

.booking-terms { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.checkbox-label { display: flex; align-items: flex-start; gap: var(--space-1); cursor: pointer; font-size: var(--text-xs); color: var(--color-text-muted); }
.checkbox-input { margin-top: 2px; accent-color: var(--color-primary); width: 14px; height: 14px; }
.checkbox-label a { color: var(--color-primary); }

/* Terms Link */
.terms-link {
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}
.terms-link:hover {
  color: var(--color-primary-hover, #357ABD);
}

/* Terms Popup Overlay */
.terms-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.terms-overlay[hidden] { display: none; }
.terms-popup {
  background: var(--color-surface, #fff);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: termsPopIn 0.2s ease-out;
}
@keyframes termsPopIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.terms-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.terms-popup-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}
.terms-popup-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.terms-popup-close:hover { color: var(--color-text); }
.terms-popup-body {
  padding: var(--space-6);
  overflow-y: auto;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text);
}
.terms-popup-body p { margin: 0 0 var(--space-3) 0; }
.terms-popup-body a {
  color: var(--color-primary);
  text-decoration: underline;
}
.terms-popup-body a:hover { text-decoration: none; }
.terms-popup-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border, #e5e7eb);
  display: flex;
  justify-content: flex-end;
}

/* Booking Success */
.booking-success { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-4) 0; }
.success-icon { margin: 0 auto; width: 40px; height: 40px; }
.success-icon svg { width: 40px; height: 40px; }
.success-title { font-size: var(--text-lg); font-weight: 700; color: var(--color-text); }
.success-text { font-size: var(--text-sm); color: var(--color-text-muted); max-width: 440px; }
.success-details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: var(--space-2);
  text-align: left;
}
.success-detail-row { display: flex; justify-content: space-between; font-size: var(--text-sm); }
.success-detail-row span:first-child { color: var(--color-text-muted); }
.success-detail-row span:last-child { font-weight: 600; }

/* =============================================================
   MANAGER VIEW
   ============================================================= */
.manager-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}

.manager-nav {
  width: 220px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow-y: auto;
}

.manager-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-align: left;
  transition: all var(--transition);
  border: 1px solid transparent;
  width: 100%;
}
.manager-nav-item:hover {
  background: white;
  color: var(--color-text);
  border-color: var(--color-border);
}
.manager-nav-item.active {
  background: #eef4f0;
  color: #1f2937;
  font-weight: 600;
  border-color: #8fb99a;
  box-shadow: var(--shadow-sm);
}
.manager-nav-item svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.manager-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6) var(--space-8);
  background: white;
}

/* Manager section cards */
/* Sticky section header: title + save button side by side */
.mgr-section-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-surface);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.mgr-section-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  padding: 0;
  border: none;
}
.email-settings-header-copy {
  margin: 0 0 var(--space-5) 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.email-settings-scope-card {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}
.email-settings-scope-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.email-settings-scope-block--location {
  background: rgba(239, 68, 68, 0.05);
}
.email-settings-scope-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}
.email-settings-scope-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
}
.email-settings-scope-copy {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-text-secondary);
}
.opening-hours-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.opening-hours-resource-select {
  flex: 0 1 300px;
}
.opening-hours-resource-select .form-select {
  max-width: 300px;
}
.opening-hours-copy-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 320px;
  min-width: 260px;
}
.opening-hours-copy-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.opening-hours-copy-select {
  max-width: 220px;
}
.mgr-section-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}
.mgr-section-header .mgr-save-bar {
  margin-left: auto;
}
.mgr-section-header .mgr-section-actions + .mgr-save-bar {
  margin-left: 0;
}
#bookingPauseAlertRegion:empty {
  display: none;
}
.booking-pause-alert {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(220, 38, 38, 0.28);
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.98) 0%, rgba(254, 226, 226, 0.94) 100%);
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.08);
}
.booking-pause-alert__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #991b1b;
}
.booking-pause-alert__copy {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: #7f1d1d;
}
.booking-pause-alert__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.booking-pause-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 var(--space-3);
  border-radius: 999px;
  border: 1px solid rgba(220, 38, 38, 0.2);
  background: rgba(255, 255, 255, 0.72);
  color: #7f1d1d;
  font-size: var(--text-xs);
  font-weight: 700;
}
.booking-pause-alert__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.booking-pause-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}
.booking-pause-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(86vh, 860px);
  overflow: auto;
  padding: var(--space-6);
  border-radius: var(--radius-2xl);
  background: white;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}
.booking-pause-dialog__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.booking-pause-dialog__copy {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.booking-pause-dialog__hint {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.14);
  color: #991b1b;
  font-size: var(--text-sm);
  line-height: 1.5;
}
.booking-pause-dialog__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.booking-pause-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 54px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
}
.booking-pause-option .checkbox-input {
  flex-shrink: 0;
}
.booking-pause-option span:last-child {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
}
.booking-pause-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.mgr-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-5);
}
.mgr-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.mgr-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.mgr-form-full { grid-column: 1 / -1; }

.booking-link-configurator__intro {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.booking-link-configurator__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.booking-link-configurator__group,
.booking-link-configurator__output,
.booking-link-configurator__field {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
  padding: var(--space-4);
}

.booking-link-configurator__choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.booking-link-configurator__copy-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.booking-link-configurator__mono-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: var(--text-xs);
}

.booking-link-configurator__embed {
  margin-top: var(--space-4);
}

.booking-link-configurator__embed > .btn {
  min-width: 220px;
}

#bookingLinkEmbedPanel[hidden],
#bookingLinkLocationSelectField[hidden],
#bookingLinkResourceSelectField[hidden],
#bookingLinkPackageSelectField[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .booking-link-configurator__grid {
    grid-template-columns: 1fr;
  }

  .booking-link-configurator__copy-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Manager table */
.mgr-table {
  width: 100%;
  border-collapse: collapse;
}
.mgr-table th,
.mgr-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
  vertical-align: middle;
}
.mgr-table th {
  background: var(--color-surface-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mgr-table tbody tr:hover { background: rgba(37,99,235,0.03); }
.mgr-table input,
.mgr-table select {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  background: white;
  width: 100%;
}
.mgr-table input:focus,
.mgr-table select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.mgr-location-help-text {
  margin: 0 0 var(--space-3);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.mgr-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mgr-locations-table {
  min-width: 1180px;
}

.mgr-location-address-fields,
.mgr-location-contact-fields {
  min-width: 210px;
}

.mgr-location-address-fields input,
.mgr-location-contact-fields input {
  margin-bottom: var(--space-2);
}

.mgr-location-address-fields input:last-child,
.mgr-location-contact-fields input:last-child {
  margin-bottom: 0;
}

.mgr-location-address-row {
  display: grid;
  grid-template-columns: minmax(70px, 0.45fr) minmax(120px, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.resource-color-cell {
  min-width: 220px;
}

.resource-color-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.resource-color-inline input[type="color"] {
  width: 52px;
  min-width: 52px;
  padding: 2px;
}

.resource-color-advanced-toggle {
  min-height: 30px;
  padding: 6px 10px;
}

.resource-color-panel {
  margin-top: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
}

.resource-color-panel[hidden] {
  display: none !important;
}

.resource-color-panel-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.resource-color-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.resource-color-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
}

.resource-color-field input[type="color"] {
  width: 44px;
  min-width: 44px;
  padding: 2px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  display: inline-block;
}
.toggle-switch input {
  opacity: 0; width: 0; height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border-strong);
  border-radius: 11px;
  cursor: pointer;
  transition: background 200ms ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 200ms ease;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--color-success);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* Hours grid */
.hours-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.hours-row {
  display: grid;
  grid-template-columns: 100px 1fr 1fr 80px;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-divider);
}
.hours-row:last-child { border-bottom: none; }
.hours-day {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

/* Manager save bar */
/* Save bar — now positioned inside sticky header */
.mgr-save-bar {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: 0;
  margin: 0;
  border: none;
  flex-shrink: 0;
}

.mgr-sync-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.58);
  backdrop-filter: blur(2px);
}
.mgr-sync-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-xl);
}
.mgr-sync-dialog-backdrop--secondary {
  z-index: 1410;
}
.mgr-sync-dialog--followup {
  width: min(760px, calc(100vw - 32px));
}
.mgr-sync-dialog-header,
.mgr-sync-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
}
.mgr-sync-dialog-header {
  border-bottom: 1px solid var(--color-border);
}
.mgr-sync-dialog-footer {
  border-top: 1px solid var(--color-border);
  justify-content: flex-end;
}
.mgr-sync-dialog-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
}
.mgr-sync-dialog-subtitle,
.mgr-sync-source-copy,
.mgr-sync-select-meta,
.mgr-sync-preview-loading,
.mgr-sync-empty {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.mgr-sync-source-box,
.mgr-sync-preview-box {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
}
.mgr-sync-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.mgr-sync-source-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}
.mgr-sync-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
.mgr-sync-column {
  min-width: 0;
}
.mgr-sync-select-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  padding-right: var(--space-1);
}
.mgr-sync-select-row {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.mgr-sync-select-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mgr-sync-select-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.mgr-sync-target-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mgr-sync-target-group-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.mgr-sync-target-group-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mgr-sync-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.mgr-sync-preview-target-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.mgr-sync-preview-target {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.mgr-sync-preview-target-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.mgr-sync-preview-target-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.mgr-sync-preview-target-counts {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.mgr-sync-preview-target-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mgr-sync-preview-target-item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.mgr-sync-preview-target-item-name {
  color: var(--color-text);
  font-weight: 600;
}
.mgr-sync-preview-target-item-action {
  white-space: nowrap;
}
.mgr-sync-preview-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 var(--space-3);
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: var(--text-xs);
  font-weight: 700;
}
.mgr-sync-preview-chip--new {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.2);
  color: #047857;
}
.mgr-sync-preview-chip--overwrite {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.22);
  color: #b45309;
}
.mgr-sync-preview-chip--skip {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.18);
  color: #4338ca;
}
.mgr-sync-preview-chip--switch {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.22);
  color: #1d4ed8;
}
.mgr-sync-warning-check {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
}
.mgr-sync-preview-error {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-error);
}
.mgr-sync-followup-intro {
  font-size: var(--text-sm);
  color: var(--color-text);
}
.mgr-sync-followup-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.mgr-sync-followup-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.mgr-sync-followup-row-head {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.mgr-sync-followup-row-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  flex-shrink: 0;
}
.mgr-sync-followup-row-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.mgr-sync-followup-row-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.mgr-sync-followup-row-meta {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.mgr-sync-followup-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mgr-sync-followup-select {
  width: 100%;
}

@media (max-width: 900px) {
  .mgr-sync-grid {
    grid-template-columns: 1fr;
  }
}

/* Holiday/special rows */
.holiday-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.holiday-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.holiday-row input { flex: 1; }
.holiday-remove {
  color: var(--color-error);
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.holiday-remove:hover { background: var(--color-error-light); }

/* Statistics section styles */
.stats-period-selector {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.stats-period-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: white;
  cursor: pointer;
  transition: all var(--transition);
}
.stats-period-btn:hover { background: var(--color-surface); color: var(--color-text); }
.stats-period-btn.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

/* New stats date selector */
.stats-toolbar-card {
  margin-bottom: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 18;
  background: var(--color-surface);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.stats-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.stats-toolbar-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.stats-toolbar-group .mgr-card-title {
  margin-bottom: 0;
}
.stats-toolbar-group--resource {
  flex: 0 1 300px;
}
.stats-toolbar-group--period {
  flex: 1 1 720px;
}
.stats-date-selector {
  margin-bottom: var(--space-4);
}
.stats-date-selector--toolbar {
  margin-bottom: 0;
}
.stats-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.stats-presets--toolbar {
  margin-bottom: 0;
}
.stats-preset-btn {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: white;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.stats-preset-btn:hover { background: var(--color-surface); color: var(--color-text); }
.stats-preset-btn.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.stats-custom-range {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.stats-custom-range label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.stats-custom-range input[type="date"] {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

/* Stats tab layout — FULL WIDTH */
#tab-stats {
  padding: 0;
  width: 100% !important;
  max-width: 100vw;
}
#tab-stats .manager-content {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: var(--space-4) var(--space-6);
  box-sizing: border-box;
}

.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
.stats-cards-grid .mgr-card {
  margin-bottom: 0;
}
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.stats-kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  text-align: center;
}
.stats-kpi-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stats-kpi-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* =============================================================
   CONTEXT MENU
   ============================================================= */
.context-menu {
  position: fixed;
  z-index: 3000;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2) 0;
  min-width: 180px;
  animation: fadeIn 0.1s ease;
}
.context-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: background 80ms;
  border: none;
  background: none;
}
.context-menu-item:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.context-menu-item.danger:hover {
  background: var(--color-error-light);
  color: var(--color-error);
}
.context-menu-sep {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-1) 0;
}

/* =============================================================
   MODAL
   ============================================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}
.modal-overlay[hidden] {
  display: none !important;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90dvh;
  overflow-y: auto;
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.modal--linked-open {
  max-width: 1640px;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.modal-header-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "main main close"
    "resource status status";
  align-items: flex-start;
  column-gap: var(--space-4);
  row-gap: var(--space-3);
}
.modal-header-main {
  grid-area: main;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
}
.modal-title {
  flex: 0 1 auto;
  min-width: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}
.modal-body { padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.modal.modal--linked-open .modal-body {
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}
.modal-header-mode-toggles {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  flex: 0 0 auto;
  min-width: 0;
}
.modal-header-walkin-toggle,
.modal-header-waitlist-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: end;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  flex: 0 0 auto;
}
.modal-header-walkin-toggle[hidden],
.modal-header-waitlist-toggle[hidden] {
  display: none !important;
}
.modal-header-walkin-toggle-copy,
.modal-header-waitlist-toggle-copy {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}
.modal.modal--waitlist {
  border-top: 4px solid color-mix(in srgb, var(--color-warning) 72%, var(--color-primary) 28%);
}
.modal-header-resource-field {
  grid-area: resource;
  flex: 0 1 220px;
  width: min(100%, 220px);
  min-width: 180px;
}
.modal-header-inline-field,
.linked-reservation-inline-field {
  gap: 0;
}
.modal-header-notes {
  display: flex;
  align-items: flex-start;
}
.modal-inline-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.modal-resource-reset-hint {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid color-mix(in srgb, var(--color-warning) 52%, var(--color-border) 48%);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-warning-light) 88%, var(--color-surface) 12%);
  color: var(--color-warning-text);
  font-size: var(--text-xs);
  line-height: 1.45;
}
.modal-resource-reset-hint[hidden] { display: none !important; }
.modal-series-hint {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid color-mix(in srgb, var(--color-primary) 24%, var(--color-border) 76%);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-primary-light) 82%, var(--color-surface) 18%);
  color: color-mix(in srgb, var(--color-primary) 72%, var(--color-text) 28%);
  font-size: var(--text-xs);
  line-height: 1.45;
}
.modal-series-hint[hidden] { display: none !important; }
.modal.modal--walk-in #modalIdentityRow {
  grid-template-columns: minmax(0, 1fr);
}
.modal.modal--walk-in #modalCompanyField,
.modal.modal--walk-in #modalContactRow,
.modal.modal--walk-in #modalFooterLeft {
  display: none !important;
}
.modal.modal--walk-in .modal-header-status-help {
  display: none !important;
}
.modal-split-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}
.modal-split-divider {
  display: none;
}
.modal.modal--linked-open .modal-split-layout {
  grid-template-columns: minmax(0, calc((100% - 1px) / 2)) 1px minmax(0, calc((100% - 1px) / 2));
  align-items: stretch;
  width: 100%;
  gap: 0;
}
.modal.modal--linked-open .modal-split-divider {
  display: block;
  grid-column: 2;
  justify-self: center;
  align-self: stretch;
  width: 1px;
  margin: var(--space-2) 0;
  background: var(--color-border);
  pointer-events: none;
}
.modal-main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.modal.modal--linked-open .modal-main-column {
  grid-column: 1;
  max-width: none;
  padding-right: var(--space-3);
}
.modal.modal--linked-open .linked-reservation-pane {
  grid-column: 3;
  max-width: none;
}
.linked-reservation-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-left: var(--space-5);
}
.modal.modal--linked-open .linked-reservation-pane {
  padding-left: var(--space-3);
}
.linked-reservation-pane[hidden] {
  display: none !important;
}
.linked-reservation-pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.linked-reservation-pane-header-main {
  flex: 1 1 auto;
  min-width: 0;
}
.linked-reservation-pane-eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.linked-reservation-pane-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.linked-reservation-pane-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}
.linked-reservation-header-resource-field {
  flex: 1 1 240px;
  max-width: 320px;
  min-width: 220px;
}
.linked-reservation-pane-close {
  flex-shrink: 0;
}
.linked-reservation-status {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #92400e;
  font-size: var(--text-sm);
  line-height: 1.4;
}
.linked-reservation-contact-summary {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.linked-reservation-main-comment-row {
  align-items: start;
}
.linked-reservation-main-comment {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.linked-reservation-main-comment-row.form-row--single .linked-reservation-main-comment {
  grid-column: 1 / -1;
}
.linked-reservation-main-comment[hidden] {
  display: none !important;
}
.linked-reservation-main-comment-text {
  min-height: 56px;
  height: auto;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  resize: vertical;
}
.linked-reservation-contact-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.linked-reservation-contact-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.linked-reservation-note {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.modal-unit-multi-field[hidden],
.linked-reservation-unit-multi-field[hidden] {
  display: none !important;
}
.modal-unit-multi-field,
.linked-reservation-unit-multi-field {
  margin-top: 0;
  width: 100%;
  min-width: 0;
}
.modal-schedule-persons-field,
.linked-reservation-persons-field,
.modal-units-field--narrow,
.linked-reservation-field--narrow {
  max-width: 96px;
}
.modal-schedule-time-field,
.linked-reservation-time-field {
  max-width: 96px;
}
.modal-schedule-duration-field,
.linked-reservation-duration-field {
  align-self: end;
}
.modal-units-row,
.linked-reservation-units-row {
  grid-template-columns: minmax(0, 96px) minmax(0, 1fr);
}
.modal-units-row[hidden],
.linked-reservation-units-row[hidden] {
  display: none !important;
}
#modalUnitMultiMount,
#linkedReservationUnitMultiMount {
  width: 100%;
  min-width: 0;
}
.modal-unit-grid,
.linked-reservation-unit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
  margin-top: 6px;
  width: 100%;
  min-width: 0;
}
.modal-unit-option,
.linked-reservation-unit-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--color-surface);
  transition: all 0.15s ease;
  box-sizing: border-box;
  overflow: hidden;
}
.modal-unit-option.selected,
.linked-reservation-unit-option.selected {
  background: var(--color-primary-light, #e0e7ff);
  border-color: var(--color-primary);
}
.modal-unit-option.is-unavailable,
.linked-reservation-unit-option.is-unavailable {
  opacity: 0.5;
  cursor: not-allowed;
  border-style: dashed;
}
.modal-unit-option input,
.linked-reservation-unit-option input {
  flex-shrink: 0;
  margin-top: 0;
}
.modal-unit-option-copy,
.linked-reservation-unit-option-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
}
.modal-unit-option-title,
.linked-reservation-unit-option-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-unit-option-meta,
.linked-reservation-unit-option-meta {
  flex: 0 0 auto;
  font-size: var(--text-xs);
  line-height: 1.25;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
html.dark .linked-reservation-status {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.34);
  color: #fcd34d;
}
html.dark .linked-reservation-contact-summary {
  background: rgba(255,255,255,0.04);
}
html.dark .checkbox-label {
  color: #e5e7eb;
}
html.dark .btn-text {
  color: #cbd5e1;
}
html.dark .btn-text:hover,
html.dark .btn-text-active {
  color: #f8fafc;
}
html.dark .btn-quiet-outline {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.16);
  color: #cbd5e1;
}
html.dark .btn-quiet-outline:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.28);
  color: #f8fafc;
}
html.dark .res-block-link-indicator {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.2);
}
html.dark .res-block-series-indicator {
  background: rgba(120, 53, 15, 0.92);
  border-color: rgba(251, 191, 36, 0.38);
  color: #fde68a;
}
html.dark .table-series-badge {
  background: rgba(96, 165, 250, 0.24);
  border-color: rgba(147, 197, 253, 0.42);
  color: #dbeafe;
}
html.dark .modal-series-hint {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.26);
  color: #dbeafe;
}
html.dark .linked-reservation-pane-eyebrow,
html.dark .linked-reservation-contact-title,
html.dark .form-hint,
html.dark .booking-step-hint {
  color: #d7dce4;
}
html.dark .linked-reservation-contact-lines,
html.dark .linked-reservation-note,
html.dark .modal-lane-info {
  color: #eceff4;
}
html.dark .series-conflict-item {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}
html.dark .series-dialog-summary {
  color: #cbd5e1;
}
html.dark .series-conflict-item-date {
  color: #f8fafc;
}
html.dark .series-conflict-item-reason {
  color: #cbd5e1;
}
html.dark .modal-unit-option,
html.dark .linked-reservation-unit-option {
  background: rgba(255,255,255,0.03);
  border-color: #4b5563;
}
html.dark .modal-unit-option.selected,
html.dark .linked-reservation-unit-option.selected {
  background: rgba(59, 130, 246, 0.18);
  border-color: #60a5fa;
}
html.dark .linked-reservation-unit-option.is-unavailable,
html.dark .modal-unit-option.is-unavailable {
  background: rgba(255,255,255,0.02);
  border-color: #4b5563;
}
html.dark .modal-unit-option-title,
html.dark .linked-reservation-unit-option-title {
  color: #f3f4f6;
}
html.dark .modal-unit-option-meta,
html.dark .linked-reservation-unit-option-meta {
  color: #d7dce4;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.modal-footer-left {
  flex: 1 0 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.modal-footer-left .checkbox-label {
  white-space: nowrap;
}

.modal-series-footer-btn {
  margin-right: auto;
}

.checkbox-label--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.modal-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  width: 100%;
  margin-left: 0;
}
.modal-footer-secondary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: nowrap;
}
.modal-footer-primary {
  display: flex;
  justify-content: flex-end;
  align-self: center;
}
.modal-footer-secondary .btn,
.modal-footer-primary .btn {
  padding-inline: var(--space-4);
  white-space: nowrap;
}
.modal-footer-primary .btn {
  min-width: 190px;
}
.customer-detail-footer-left,
.customer-detail-footer-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.customer-detail-footer-left {
  margin-right: auto;
}
.customer-detail-body {
  color: var(--color-text);
}
.customer-detail-readonly-input {
  background: #f5f5f5;
  cursor: not-allowed;
}
.customer-detail-newsletter-box {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.form-label-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-2);
}
.form-label-row .form-label {
  min-width: 0;
  margin-bottom: 0;
}
.billing-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 42px;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-surface-offset) 70%, white 30%);
}
.billing-inline-row[hidden],
.billing-fields-card[hidden] {
  display: none !important;
}
.billing-inline-row--modal {
  margin-top: 0;
  margin-bottom: var(--space-2);
}
#modalCompanyField {
  position: relative;
}
#modalBillingInlineRow.billing-inline-row--compact.billing-inline-row--modal {
  position: absolute;
  top: 0;
  right: 0;
  max-width: calc(100% - 148px);
  justify-content: flex-end;
  align-items: center;
}
.billing-inline-row--compact {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  gap: var(--space-2);
}
.billing-inline-row--compact .billing-inline-checkbox {
  flex: 0 1 auto;
  font-size: var(--text-xs);
  font-weight: 600;
}
.billing-inline-row--compact .billing-inline-summary {
  max-width: 96px;
  font-size: 11px;
}
.billing-inline-checkbox {
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.billing-inline-checkbox .checkbox-input {
  margin-top: 0;
  flex: 0 0 auto;
}
.billing-inline-checkbox span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.billing-inline-summary {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.billing-inline-summary:empty {
  display: none;
}
.billing-inline-expand {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 999px;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.billing-inline-expand:hover {
  background: color-mix(in srgb, var(--color-surface-offset) 80%, white 20%);
  color: var(--color-text);
}
.billing-inline-expand[aria-expanded="true"] {
  transform: rotate(180deg);
}
.billing-fields-card {
  margin-top: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-surface) 70%, white 30%);
}
.billing-fields-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.billing-fields-card__intro {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.billing-copy-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.customer-detail-billing {
  margin-top: var(--space-3);
}
.customer-detail-billing-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-surface-offset) 70%, white 30%);
  color: var(--color-text);
  text-align: left;
}
.customer-detail-billing-toggle:hover {
  border-color: var(--color-border-strong);
}
.customer-detail-billing-title {
  flex: 0 0 auto;
  font-weight: 700;
}
.customer-detail-billing-summary {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.customer-detail-billing-chevron {
  flex: 0 0 auto;
  color: var(--color-text-muted);
  transition: transform var(--transition);
}
.customer-detail-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  font-size: var(--text-sm);
}
.customer-detail-section {
  margin-top: var(--space-3);
}
.customer-detail-section--compact {
  margin-top: var(--space-2);
}
.customer-detail-package-tags {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
}
.customer-detail-reservations-list {
  margin-top: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.customer-detail-reservation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: var(--color-surface-offset);
  border: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent 28%);
  color: var(--color-text);
  font-size: var(--text-xs);
}
.customer-detail-reservation-meta {
  color: var(--color-text-secondary);
  min-width: 0;
}
.customer-detail-reservation-meta strong {
  color: var(--color-text);
}
.customer-detail-reservation-status {
  flex: 0 0 auto;
  font-weight: 600;
  font-size: 11px;
}
.customer-detail-reservation-empty {
  color: var(--color-text-faint);
}
.customer-import-modal {
  width: min(1080px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}
.customer-import-subtitle {
  margin: 6px 0 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.customer-import-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  overflow-y: auto;
}
.customer-import-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.customer-import-step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}
.customer-import-step--active {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-primary);
}
.customer-import-step--done {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}
.customer-import-step-index {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  font-size: 11px;
}
.customer-import-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.customer-import-info-card,
.customer-import-upload-card,
.customer-import-legal-box,
.customer-import-preview-table-wrap,
.customer-import-result-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-card, #fff);
  padding: var(--space-4);
}
.customer-import-info-card h3,
.customer-import-result-box h3 {
  margin: 0 0 var(--space-2) 0;
}
.customer-import-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.customer-import-note-grid,
.customer-import-rules-grid,
.customer-import-preview-summary,
.customer-import-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.customer-import-note-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface);
}
.customer-import-note-card p,
.customer-import-legal-box p,
.customer-import-info-card p,
.customer-import-empty,
.customer-import-file-meta,
.customer-import-footer-hint {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.customer-import-bullet-list {
  margin: 0;
  padding-left: 18px;
  color: var(--color-text-secondary);
}
.customer-import-file-meta {
  margin-top: var(--space-3);
}
.customer-import-mapping-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.customer-import-mapping-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.9fr) 120px;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.customer-import-mapping-source {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.customer-import-mapping-source small {
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.customer-import-mapping-status {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.customer-import-mapping-status--erkannt {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}
.customer-import-mapping-status--unklar {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}
.customer-import-mapping-status--ignorieren {
  background: rgba(107, 114, 128, 0.14);
  color: #4b5563;
}
.customer-import-mapping-status--doppelt {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}
.customer-import-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}
.customer-import-choice small {
  display: block;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.customer-import-inline-warning {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px solid rgba(239, 68, 68, 0.24);
  border-radius: var(--radius-md);
  background: rgba(254, 242, 242, 0.8);
}
.customer-import-preview-status {
  color: var(--color-text-secondary);
  font-weight: 600;
}
.customer-import-summary-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.customer-import-summary-card strong {
  font-size: 20px;
  line-height: 1;
}
.customer-import-summary-card span {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.customer-import-preview-table {
  min-width: 100%;
}
.customer-import-action {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.customer-import-action--create {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}
.customer-import-action--merge,
.customer-import-action--update {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}
.customer-import-action--skip {
  background: rgba(107, 114, 128, 0.14);
  color: #4b5563;
}
.customer-import-action--error {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}
.customer-import-result-grid {
  margin-top: var(--space-3);
}
.customer-import-result-meta {
  margin: var(--space-3) 0 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.customer-delete-dialog {
  max-width: 480px;
}
.customer-delete-block-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space-4);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning-text);
  font-size: var(--text-sm);
  font-weight: 600;
}
.customer-delete-dialog-actions {
  justify-content: space-between;
}
.linked-reservation-units-row.linked-reservation-units-row--heterogeneous {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 980px) {
  .modal.modal--linked-open {
    max-width: 760px;
  }
  .modal.modal--linked-open .modal-split-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .modal.modal--linked-open .modal-split-divider {
    display: none;
  }
  .linked-reservation-pane {
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding-left: 0;
    padding-top: var(--space-4);
  }
  .modal-footer {
    align-items: stretch;
  }
  .modal-footer-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
  .modal-series-footer-btn {
    margin-right: 0;
  }
  .modal-footer-secondary,
  .modal-footer-primary {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .modal-footer-primary .btn { min-width: 0; }
  .form-row-5 {
    grid-template-columns: minmax(0, 92px) minmax(0, 1fr) minmax(0, 92px) minmax(0, 92px);
  }
  .modal-schedule-duration-field,
  .linked-reservation-duration-field {
    grid-column: 1 / -1;
  }
  .series-dialog-grid,
  .series-conflict-item {
    grid-template-columns: minmax(0, 1fr);
  }
  .series-conflict-item-copy {
    grid-template-columns: minmax(0, 1fr);
  }
  .series-conflict-item-action {
    width: 100%;
  }
}
@media (max-width: 1080px) {
  .modal-unit-grid,
  .linked-reservation-unit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .form-row-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal-schedule-persons-field,
  .linked-reservation-persons-field,
  .modal-schedule-time-field,
  .linked-reservation-time-field,
  .modal-units-field--narrow,
  .linked-reservation-field--narrow {
    max-width: none;
  }
  .modal-unit-grid,
  .linked-reservation-unit-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .series-dialog-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .series-dialog-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* =============================================================
   TOAST
   ============================================================= */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  background: var(--color-text);
  color: white;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 340px;
}
.toast.toast--success { background: var(--color-success); }
.toast.toast--error   { background: var(--color-error); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.waitlist-post-cancel-hint {
  position: sticky;
  bottom: var(--space-4);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  max-width: 720px;
  margin: var(--space-3) auto 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fffbeb, #fef3c7);
  color: #78350f;
  box-shadow: 0 14px 34px rgba(146, 64, 14, 0.18);
}
.waitlist-post-cancel-hint div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.waitlist-post-cancel-hint span {
  font-size: var(--text-xs);
  color: #92400e;
}

.waitlist-offer-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-8) var(--space-4);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.22), transparent 34rem),
    linear-gradient(180deg, #fffaf0, #f8fafc);
}
.waitlist-offer-card {
  width: min(720px, 100%);
  padding: var(--space-6);
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.94);
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.12);
}
.waitlist-offer-kicker {
  margin: 0 0 var(--space-2);
  color: #b45309;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.waitlist-offer-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}
.waitlist-offer-urgency {
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.95), rgba(254, 243, 199, 0.92));
  color: #78350f;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.45;
}
.waitlist-offer-status {
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.45;
}
.waitlist-offer-status--success {
  border: 1px solid rgba(34, 197, 94, 0.32);
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.96), rgba(220, 252, 231, 0.92));
  color: #14532d;
}
.waitlist-offer-status--muted {
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.92));
  color: #334155;
}
.waitlist-offer-details div {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
}
.waitlist-offer-details span {
  display: block;
  margin-bottom: 3px;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.waitlist-offer-error {
  color: var(--color-error);
  font-weight: 700;
}

/* =============================================================
   FOOTER
   ============================================================= */
.app-footer {
  height: var(--footer-h);
  display: flex; align-items: center; gap: var(--space-2);
  padding: 0 var(--space-6);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.footer-divider { color: var(--color-border-strong); }
.footer-credit { color: var(--color-text-faint); text-decoration: none; transition: color var(--transition); }
.footer-credit:hover { color: var(--color-primary); }

body.app-fullscreen-fallback .tab-nav,
body.app-fullscreen-fallback .app-footer {
  display: none !important;
}

/* =============================================================
   FOCUS VISIBLE
   ============================================================= */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* =============================================================
   UTILITY: no-select during drag
   ============================================================= */
body.is-dragging {
  user-select: none;
  -webkit-user-select: none;
}
body.is-dragging .grid-cell { pointer-events: none; }
body.is-col-resize * { cursor: col-resize !important; }

/* =============================================================
   REDUCED MOTION
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================================
   PRINT
   ============================================================= */
@media print {
  .topbar-right, .tab-nav, .sidebar, .sidebar-divider, .app-footer,
  .modal-overlay, .help-panel-overlay, .toast, .context-menu { display: none !important; }
  .topbar { box-shadow: none !important; border-bottom: 2px solid #333 !important; }
  .day-view-layout { display: block !important; }
  .grid-wrapper { overflow: visible !important; flex: 1 !important; }
  body { overflow: visible !important; height: auto !important; }
  .main-content { overflow: visible !important; }
  .tab-panel.active { overflow: visible !important; }
  .res-block { box-shadow: 0 0 0 1px rgba(0,0,0,0.3) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .grid-corner, .lane-headers, .lane-header-cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =============================================================
   EMBED MODE (?embed=1)
   ============================================================= */
body.embed-mode .topbar,
body.embed-mode .tab-nav,
body.embed-mode .app-footer,
body.embed-mode .skip-link,
body.embed-mode .lock-overlay,
body.embed-mode .sidebar,
body.embed-mode .sidebar-divider { display: none !important; }
body.embed-mode .main-content { margin-top: 0; }
body.embed-mode .tab-panel { display: none !important; }
body.embed-mode #tab-booking { display: flex !important; flex-direction: column; }

/* Embed light mode (default) */
body.embed-mode {
  background: #ffffff !important;
  color: #1a1a1a;
  overflow-x: hidden;
  max-width: 100vw;
}
body.embed-mode .main-content {
  background: #ffffff !important;
  min-height: 100dvh;
  height: auto;
  overflow: visible;
}
body.embed-mode #tab-booking {
  background: #ffffff !important;
  min-height: 100dvh;
  height: auto;
  overflow: visible;
}
body.embed-mode .booking-step-panel {
  overflow-x: hidden;
  word-break: break-word;
}
body.embed-mode .booking-summary {
  overflow: hidden;
  max-width: 100%;
}

/* =============================================================
   DARK MODE — class-based (html.dark)
   ============================================================= */

/* Dark mode design tokens */
html.dark {
  --color-bg:            #1a1a1a;
  --color-surface:       #262626;
  --color-surface-2:     #2a2a2a;
  --color-surface-offset: #333333;
  --color-border:        #404040;
  --color-border-strong: #555555;
  --color-divider:       #3a3a3a;
  --color-text:          #e5e5e5;
  --color-text-muted:    #a0a0a0;
  --color-text-secondary:#d1d5db;
  --color-text-faint:    #777777;
  --color-text-inverse:  #1a1a1a;
  --color-primary-light: #1e3a5f;
  --color-success-light: #0d3325;
  --color-success-text:  #6ee7b7;
  --color-warning-light: #3b2f0a;
  --color-warning-text:  #fcd34d;
  --color-error-light:   #3b1111;
  --color-error-text:    #fca5a5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

html.dark body {
  background: #1a1a1a;
  color: #e5e5e5;
}

/* Topbar */
html.dark .topbar {
  background: var(--location-color-dark, #262626) !important;
  border-bottom-color: #404040;
}

/* Tab navigation */
html.dark .tab-nav {
  background: #262626;
  border-bottom-color: #404040;
}
html.dark .tab-btn {
  color: #d4d4d4;
}
html.dark .tab-btn:hover {
  color: #ffffff;
  background: #333333;
}
html.dark .tab-btn.active {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

/* Main content */
html.dark .main-content {
  background: #1a1a1a;
}

/* Sidebar */
html.dark .sidebar {
  background: #262626;
  border-left-color: #404040;
}

/* Cards & panels */
html.dark .card,
html.dark .stats-card,
html.dark .booking-card {
  background: #262626;
  border-color: #404040;
}

/* Tables */
html.dark table th {
  background: #262626;
  color: #e5e5e5;
  border-color: #404040;
}
html.dark table td {
  border-color: #404040;
  color: #d4d4d4;
}
html.dark table:not(.reservation-table):not(.mgr-table) tr:hover td {
  background: #2a2a2a;
}

/* Form elements */
html.dark .form-input,
html.dark .form-select,
html.dark .form-textarea,
html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="tel"],
html.dark input[type="number"],
html.dark input[type="date"],
html.dark input[type="time"],
html.dark select,
html.dark textarea {
  background: #333333;
  color: #e5e5e5;
  border-color: #555555;
}
html.dark .form-input::placeholder,
html.dark .form-textarea::placeholder,
html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #888888;
}

/* Buttons */
html.dark .btn-secondary {
  background: #333333;
  color: #e5e5e5;
  border-color: #555555;
}
html.dark .btn-secondary:hover {
  background: #404040;
}
html.dark .btn-warning-soft {
  background: linear-gradient(180deg, rgba(69, 10, 10, 0.9) 0%, rgba(88, 28, 28, 0.86) 100%);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
}
html.dark .btn-warning-soft:hover {
  background: linear-gradient(180deg, rgba(88, 28, 28, 0.92) 0%, rgba(127, 29, 29, 0.88) 100%);
  color: #fee2e2;
  border-color: rgba(252, 165, 165, 0.4);
}

/* Modal / overlay */
html.dark .modal-content,
html.dark .dialog-content {
  background: #262626;
  border-color: #404040;
  color: #e5e5e5;
}

/* Lane grid */
html.dark .lane-header {
  background: #262626;
  color: #e5e5e5;
  border-color: #404040;
}
html.dark .grid-cell {
  border-color: #333333;
}
html.dark .time-label {
  color: #a0a0a0;
  background: #1a1a1a;
}

/* Scrollbars */
html.dark ::-webkit-scrollbar-track {
  background: #1a1a1a;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #404040;
}

/* Sidebar mini calendar */
html.dark .sidebar-calendar {
  background: #262626;
  border-bottom-color: #404040;
}
html.dark .sidebar-calendar .mini-cal-header {
  background: var(--resource-color-dark, var(--color-brand));
}
html.dark .topbar-mini-calendar-popover .sidebar-calendar {
  border-color: #404040;
  box-shadow: 0 16px 36px rgba(0,0,0,0.42);
}
html.dark .topbar-day-note-popover .day-note-section {
  border-color: #404040;
  box-shadow: 0 16px 36px rgba(0,0,0,0.42);
}
html.dark .topbar-day-note-popover .day-note-textarea {
  background: #333333;
}
html.dark .day-note-popover-toggle.day-note-popover-toggle--has-note {
  color: #2b2200;
  background: linear-gradient(180deg, rgba(255,233,122,0.98), rgba(255,204,51,0.96));
  border-color: rgba(255,245,190,0.48);
  box-shadow: 0 0 0 1px rgba(84,61,0,0.35) inset;
}
html.dark .day-note-alert-badge {
  color: #452300;
  border-color: rgba(255,244,188,0.62);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
html.dark .grid-corner {
  background: var(--resource-color-dark, #333) !important;
}
html.dark .mini-cal-weekdays span {
  color: #a0a0a0;
}
html.dark .cal-day {
  color: #e5e5e5;
}
html.dark .cal-day:hover {
  background: #333333;
  color: var(--color-primary);
}
html.dark .cal-day.today {
  color: color-mix(in srgb, var(--color-primary) 34%, white 66%);
}
html.dark .cal-day.selected {
  background: var(--color-primary);
  color: white;
}
html.dark .cal-day.today.selected {
  background: color-mix(in srgb, var(--color-primary) 64%, white 36%);
  color: #ffffff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 44%, white 30%);
}
html.dark .cal-day.other-month {
  color: #555555;
}
html.dark .cal-day.rest-day { color: #555555; }
html.dark .mini-cal-dot-closed { background: #f87171; }
html.dark .mini-cal-dot-special { background: #fbbf24; }
html.dark .mini-cal-dot-rest { background: #6b7280; }
html.dark .mini-cal-tooltip {
  background: #333333;
  color: #e5e5e5;
  border-color: #555555;
}
html.dark .mini-cal-footer {
  border-top-color: #404040;
}
html.dark .mini-cal-today-btn {
  color: color-mix(in srgb, var(--color-primary) 32%, white 68%);
  font-weight: 600;
  background: color-mix(in srgb, var(--color-primary) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-primary) 46%, white 28%);
}
html.dark .mini-cal-today-btn:hover {
  color: color-mix(in srgb, var(--color-primary) 22%, white 78%);
  background: color-mix(in srgb, var(--color-primary) 24%, transparent);
}
html.dark .capcal-overlay {
  background: rgba(2, 6, 23, 0.74);
}
html.dark .capcal-modal {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.72);
}
html.dark .capcal-close,
html.dark .capcal-grid-wrap,
html.dark .capcal-detail,
html.dark .capcal-summary-stat {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.18);
}
html.dark .capcal-filter-chip {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.18);
  color: #e5eef7;
}
html.dark .capcal-filter-chip.is-active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(125, 211, 252, 0.42);
  color: #bae6fd;
}
html.dark .capcal-status--loading {
  background: rgba(45, 212, 191, 0.14);
  color: #99f6e4;
}
html.dark .capcal-status--error {
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
}
html.dark .capcal-status--empty {
  background: rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
}
html.dark .capcal-day {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow: none;
}
html.dark .capcal-day-hours,
html.dark .capcal-day-stat {
  color: #cbd5e1;
}
html.dark .capcal-day-stat strong {
  color: #f8fafc;
}
html.dark .capcal-day--selected {
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.7);
}
html.dark .capcal-day--today {
  border-color: rgba(125, 211, 252, 0.34);
}
html.dark .capcal-day--closed {
  background-image: linear-gradient(180deg, rgba(71, 85, 105, 0.18), rgba(15, 23, 42, 0.12));
}
html.dark .capcal-hourly-cell {
  background: rgba(56, 189, 248, 0.12);
}
html.dark .capcal-hourly-subtitle,
html.dark .capcal-hourly-slot-label {
  color: #94a3b8;
}
html.dark .capcal-day-alert--outside {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fbbf24;
}

/* Day note section */
html.dark .day-note-section {
  background: #2a2a1e;
  border-bottom-color: #404040;
}
html.dark .day-note-textarea {
  background: #333333;
  color: #e5e5e5;
  border-color: #555555;
}
html.dark .day-note-textarea::placeholder {
  color: #888888;
}
/* Lock screen — always light, no dark override needed (class removed on logout) */

/* Toast */
html.dark .toast {
  background: #333333;
  color: #e5e5e5;
  border-color: #555555;
}

/* Dark mode toggle button */
.dark-mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background var(--transition), border-color var(--transition);
}
.dark-mode-toggle:hover {
  background: var(--color-surface-offset);
  border-color: var(--color-border-strong);
}

/* Embed dark mode (class-based) */
html.dark body.embed-mode {
  background: #1a1a1a !important;
  color: #e5e5e5;
}
html.dark body.embed-mode .main-content,
html.dark body.embed-mode #tab-booking {
  background: #1a1a1a !important;
}
html.dark body.embed-mode .booking-card,
html.dark body.embed-mode .booking-step-content,
html.dark body.embed-mode .resource-selection,
html.dark body.embed-mode .booking-steps {
  background: #262626 !important;
  border-color: #404040 !important;
}
html.dark body.embed-mode .resource-card {
  background: #262626 !important;
  border-color: #404040 !important;
  color: #e5e5e5;
}
html.dark body.embed-mode .resource-card h3 {
  color: #f5f5f5 !important;
}
html.dark body.embed-mode .booking-step-content h3,
html.dark body.embed-mode .form-label {
  color: #e5e5e5 !important;
}
html.dark body.embed-mode .form-input,
html.dark body.embed-mode .form-select,
html.dark body.embed-mode .form-textarea {
  background: #333333 !important;
  color: #e5e5e5 !important;
  border-color: #555555 !important;
}
html.dark body.embed-mode .form-input::placeholder,
html.dark body.embed-mode .form-textarea::placeholder {
  color: #888888 !important;
}
html.dark body.embed-mode .booking-step {
  color: #999999;
  border-color: #555555;
}
html.dark body.embed-mode .booking-step.active {
  color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}
html.dark body.embed-mode .booking-step.completed {
  color: #10b981;
  border-color: #10b981;
}
html.dark body.embed-mode .step-item.active .step-circle,
html.dark .step-item.active .step-circle {
  background: var(--color-primary) !important;
  color: white !important;
  border-color: var(--color-primary) !important;
  filter: saturate(1.2) brightness(1.8);
}
html.dark body.embed-mode .step-item.completed .step-circle,
html.dark .step-item.completed .step-circle {
  background: #10b981 !important;
  color: white !important;
  border-color: #10b981 !important;
}
html.dark body.embed-mode .step-circle,
html.dark .step-circle {
  background: #3a3a3a !important;
  border-color: #555 !important;
  color: #999 !important;
}
html.dark body.embed-mode .step-item.active .step-label,
html.dark .step-item.active .step-label {
  color: var(--color-primary) !important;
  filter: saturate(1.2) brightness(1.8);
}
html.dark body.embed-mode .step-connector,
html.dark .step-connector {
  background: #444 !important;
}
html.dark body.embed-mode p,
html.dark body.embed-mode span,
html.dark body.embed-mode label,
html.dark body.embed-mode td,
html.dark body.embed-mode th {
  color: #d4d4d4;
}
html.dark body.embed-mode .btn-secondary {
  background: #333333 !important;
  color: #e5e5e5 !important;
  border-color: #555555 !important;
}
html.dark body.embed-mode .btn-secondary:hover {
  background: #404040 !important;
}
html.dark body.embed-mode .time-slot-btn {
  background: #333333 !important;
  color: #e5e5e5 !important;
  border-color: #555555 !important;
}
html.dark body.embed-mode .time-slot-btn:hover,
html.dark body.embed-mode .time-slot-btn.selected {
  background: var(--color-primary) !important;
  color: #ffffff !important;
  border-color: var(--color-primary) !important;
}
html.dark body.embed-mode .time-slot-btn.unavailable {
  background: #2a2020 !important;
  color: #7a5555 !important;
  border-color: #4a3030 !important;
}
html.dark body.embed-mode .duration-btn {
  background: #333333 !important;
  color: #e5e5e5 !important;
  border-color: #555555 !important;
}
html.dark body.embed-mode .duration-btn:hover,
html.dark body.embed-mode .duration-btn.selected {
  background: var(--color-primary) !important;
  color: #ffffff !important;
  border-color: var(--color-primary) !important;
}
html.dark body.embed-mode .checkbox-label,
html.dark body.embed-mode .form-hint {
  color: #b0b0b0 !important;
}
html.dark body.embed-mode .package-duration-info {
  background: #1E3A5F;
  border-color: #3B82F6;
  color: #93C5FD;
}
html.dark body.embed-mode .squeeze-hint {
  background: #422006;
  border-color: #D97706;
  color: #FCD34D;
}
html.dark body.embed-mode .summary-table td,
html.dark body.embed-mode .summary-table th {
  border-color: #404040;
  color: #e5e5e5;
}
html.dark body.embed-mode .summary-table {
  background: #262626;
}

/* ===== Direct Link Page Layout ===== */
body.dl-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.dl-page .main-content {
  flex: 1;
}

/* Direct Link Header — full-width colored bar */
.dl-header {
  width: 100%;
  color: #fff;
  padding: 0;
  position: relative;
  z-index: 10;
}
.dl-header-inner {
  max-width: 700px;
  margin: 0 auto;
  padding: 28px 24px;
  text-align: center;
}
body.dl-page .main-content,
body.dl-page #tab-booking {
  padding-top: 32px;
}
/* Brand: logo + name side by side */
.dl-header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.dl-header-logo {
  max-height: 48px;
  max-width: 180px;
  display: block;
  flex-shrink: 0;
}
.dl-header-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.dl-header-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.92;
}
.dl-header-details a { color: #fff; text-decoration: none; }
.dl-header-details a:hover { text-decoration: underline; }

/* Direct Link Footer — full-width colored bar */
.dl-footer {
  width: 100%;
  color: rgba(255,255,255,0.9);
  padding: 0;
  margin-top: auto;
}
.dl-footer-inner {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px 24px;
  text-align: center;
  font-size: 13px;
}
.dl-footer-links {
  margin-top: 6px;
}
.dl-footer-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  margin: 0 6px;
}
.dl-footer-links a:hover { text-decoration: underline; color: #fff; }

/* Mobile: stack header details vertically */
@media (max-width: 500px) {
  .dl-header-inner { padding: 16px; }
  .dl-header-brand { flex-direction: column; gap: 8px; }
  .dl-header-logo { max-height: 40px; }
  .dl-header-name { font-size: 18px; }
  .dl-header-details { flex-direction: column; gap: 2px; font-size: 12px; }
  .dl-footer-inner { padding: 12px 16px; font-size: 12px; }
}

/* Direct Link dark mode adjustments */
html.dark .dl-header { box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
html.dark .dl-footer { box-shadow: 0 -1px 4px rgba(0,0,0,0.3); }

/* Force-light overrides for embed: undo dark styles */
html.dark body.embed-forcelight,
html.dark body.embed-forcelight .main-content,
html.dark body.embed-forcelight #tab-booking {
  background: #ffffff !important;
  color: #1a1a1a !important;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-text-secondary: #4b5563;
  --color-text-faint: #9ca3af;
  --color-surface: #f9fafb;
  --color-surface-offset: #f3f4f6;
  --color-border: #e5e7eb;
  --color-bg: #ffffff;
}
html.dark body.embed-forcelight .booking-card,
html.dark body.embed-forcelight .booking-step-content,
html.dark body.embed-forcelight .resource-selection,
html.dark body.embed-forcelight .booking-steps {
  background: #f9fafb !important;
  border-color: #e5e7eb !important;
}
html.dark body.embed-forcelight .resource-card {
  background: #f9fafb !important;
  border-color: #e5e7eb !important;
  color: #1a1a1a;
}
html.dark body.embed-forcelight .resource-card h3 {
  color: #1a1a1a !important;
}
html.dark body.embed-forcelight .booking-step-content h3,
html.dark body.embed-forcelight .form-label {
  color: #1a1a1a !important;
}
html.dark body.embed-forcelight .form-input,
html.dark body.embed-forcelight .form-select,
html.dark body.embed-forcelight .form-textarea {
  background: #ffffff !important;
  color: #1a1a1a !important;
  border-color: #d1d5db !important;
}
html.dark body.embed-forcelight .form-input::placeholder,
html.dark body.embed-forcelight .form-textarea::placeholder {
  color: #9ca3af !important;
}
html.dark body.embed-forcelight .booking-step {
  color: #9ca3af;
  border-color: #d1d5db;
}
html.dark body.embed-forcelight p,
html.dark body.embed-forcelight span,
html.dark body.embed-forcelight label,
html.dark body.embed-forcelight td,
html.dark body.embed-forcelight th {
  color: #374151;
}
html.dark body.embed-forcelight .btn-secondary {
  background: #f3f4f6 !important;
  color: #374151 !important;
  border-color: #d1d5db !important;
}
html.dark body.embed-forcelight .btn-secondary:hover {
  background: #e5e7eb !important;
}
html.dark body.embed-forcelight .time-slot-btn {
  background: #ffffff !important;
  color: #374151 !important;
  border-color: #d1d5db !important;
}
html.dark body.embed-forcelight .time-slot-btn.unavailable {
  background: #f3f4f6 !important;
  color: #9ca3af !important;
  border-color: #e5e7eb !important;
}
html.dark body.embed-forcelight .duration-btn {
  background: #ffffff !important;
  color: #374151 !important;
  border-color: #d1d5db !important;
}
html.dark body.embed-forcelight .checkbox-label,
html.dark body.embed-forcelight .form-hint {
  color: #6b7280 !important;
}
html.dark body.embed-forcelight .summary-table td,
html.dark body.embed-forcelight .summary-table th {
  border-color: #e5e7eb;
  color: #374151;
}
html.dark body.embed-forcelight .summary-table {
  background: #ffffff;
}

/* =============================================================
   LOGO UPLOAD PREVIEW
   ============================================================= */
.logo-upload-preview {
  display: flex; align-items: center; gap: var(--space-3);
  margin-top: var(--space-2);
}
.logo-upload-preview img {
  max-height: 80px; max-width: 200px; object-fit: contain;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: var(--space-1);
}

/* =============================================================
   RESERVATION TOOLTIP (mouseover)
   ============================================================= */
.res-tooltip {
  position: fixed;
  z-index: 9999;
  min-width: 260px;
  max-width: 340px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
  font-size: var(--text-sm);
  pointer-events: none;
  overflow: hidden;
}
.res-tooltip-header {
  padding: var(--space-2) var(--space-3);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}
.res-tooltip-header strong {
  font-weight: 600;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.res-tooltip-header-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}
.res-tooltip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(15, 23, 42, 0.16);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14);
}
.res-tooltip-badge.badge {
  border-color: transparent;
  box-shadow: none;
}
.res-tooltip-badge--series {
  background: rgba(254, 243, 199, 0.96);
  color: #92400e;
  border-color: rgba(161, 98, 7, 0.28);
}
.res-tooltip-badge--walkin {
  background: rgba(191, 219, 254, 0.95);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.26);
}
.res-tooltip-badge--linked {
  background: rgba(224, 242, 254, 0.96);
  color: #075985;
  border-color: rgba(8, 145, 178, 0.26);
}
.res-tooltip-body { padding: var(--space-2) var(--space-3) var(--space-3); }
.res-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 2px 0;
  border-bottom: 1px solid #f3f4f6;
}
.res-tooltip-row:last-child { border-bottom: none; }
.res-tooltip-label {
  color: var(--color-text-muted);
  white-space: nowrap;
}
.res-tooltip-link-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.res-tooltip-link-role--child {
  background: rgba(56, 189, 248, 0.14);
  color: #0369a1;
}
.res-tooltip-link-role--parent {
  background: rgba(250, 204, 21, 0.18);
  color: #a16207;
}
.res-tooltip-link-summary {
  text-align: right;
  max-width: 190px;
}
.res-tooltip-section {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid #f3f4f6;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

/* =============================================================
   CONFIRM DIALOG
   ============================================================= */
.confirm-dialog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.series-dialog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-dialog-overlay[hidden] {
  display: none !important;
}
.series-dialog-overlay[hidden] {
  display: none !important;
}
.confirm-dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 420px;
  width: 90%;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.confirm-dialog-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.series-dialog-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.confirm-dialog-msg {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
  line-height: 1.5;
}
.series-dialog-msg {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
  line-height: 1.5;
}
.confirm-dialog-checkbox {
  margin-bottom: var(--space-4);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.08);
  color: var(--color-text);
}
.confirm-dialog-btns {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
.confirm-dialog--series-scope {
  max-width: min(680px, calc(100vw - 32px));
  width: min(680px, calc(100vw - 32px));
}
.confirm-dialog--series-scope .confirm-dialog-btns {
  flex-direction: column;
  align-items: stretch;
}
.confirm-dialog--series-scope .confirm-dialog-btns .btn {
  width: 100%;
  justify-content: center;
  white-space: normal;
  line-height: 1.35;
  text-align: center;
}
.series-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.series-dialog-actions .btn {
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}
.series-dialog,
.series-conflict-dialog {
  position: relative;
  max-width: 520px;
  width: min(520px, calc(100vw - 32px));
}
.series-dialog-summary {
  margin: calc(var(--space-4) * -0.15) 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.series-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.series-dialog-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}
.series-conflict-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 280px;
  overflow: auto;
  margin-bottom: var(--space-5);
}
.series-conflict-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-offset);
  align-items: center;
}
.series-conflict-item-copy {
  display: grid;
  grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
  gap: var(--space-3);
  min-width: 0;
}
.series-conflict-item-date {
  font-weight: 700;
  color: var(--color-text);
}
.series-conflict-item-reason {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}
.series-conflict-item-action {
  white-space: nowrap;
}
.btn-danger {
  background: #EF4444;
  color: #fff;
  border: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  font-size: var(--text-sm);
}
.btn-danger:hover { background: #DC2626; }

/* =============================================================
   DRAG ORIGIN LINE
   ============================================================= */
.drag-origin-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #EF4444;
  z-index: 50;
  pointer-events: none;
}
.drag-origin-label {
  position: absolute;
  right: 4px;
  top: -18px;
  font-size: 11px;
  font-weight: 700;
  color: #EF4444;
  background: rgba(255,255,255,0.9);
  padding: 0 4px;
  border-radius: 3px;
}

/* =============================================================
   CHECKEDIN PATTERN (checkered/karo)
   ============================================================= */
.res-block--checkedin {
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.15) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.15) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.15) 75%) !important;
  background-size: 12px 12px !important;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0 !important;
}
.res-block--settled {
  opacity: 0.35 !important;
  filter: grayscale(0.6);
}
.res-block--offer-open {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18), 0 2px 8px rgba(0,0,0,0.2);
}
.res-block--pre-reserved {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.14), 0 2px 8px rgba(0,0,0,0.2);
}

/* =============================================================
   STATISTICS BARS
   ============================================================= */
.stats-bar {
  height: 22px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
}
.stats-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
  min-width: 2px;
}

/* ---- Cell Selection Overlay (drag-to-create) ---- */
.cell-selection-overlay {
  position: absolute;
  background: rgba(74, 144, 217, 0.18);
  border: 2px solid var(--color-brand);
  border-radius: 4px;
  pointer-events: none;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-brand);
  letter-spacing: 0.02em;
}
.cell-selection-overlay[hidden] {
  display: none !important;
}

.modal-lane-info {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-weight: 500;
  margin-top: 2px;
  min-height: 1.2em;
}

/* ---- Player Names (Step 4) ---- */
.booking-step-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-4) 0;
  line-height: 1.5;
}
.player-names-container {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.player-lane-group {
  flex: 1 1 200px;
  min-width: 180px;
}
.player-lane-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-2) 0;
  padding-bottom: var(--space-1);
  border-bottom: 2px solid var(--color-border);
}
.player-name-field {
  margin-bottom: var(--space-2);
}
.player-name-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: var(--text-sm);
  transition: border-color 0.15s;
}
.player-name-input:focus {
  border-color: var(--color-brand);
  outline: none;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.15);
}

/* ---- Modal Player Names ---- */
.modal-player-names {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.modal-player-lane-group {
  flex: 1 1 160px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.modal-player-lane-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--color-border);
}
.modal-player-input {
  padding: var(--space-1) var(--space-2) !important;
  font-size: var(--text-xs) !important;
  height: 30px;
}

/* ============================================================
   PIN LOCK SCREEN
   ============================================================ */
.lock-overlay {
  position: fixed;
  inset: 0;
  background: #f0f2f5;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lock-overlay[hidden] { display: none; }

.lock-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px 48px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  text-align: center;
  width: 360px;
  max-width: 90vw;
}

.lock-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.lock-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 4px;
}

.lock-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 24px;
}

.pin-display {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}
.pin-display[hidden] { display: none !important; }

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}

.pin-dot.filled {
  background: #1a1a2e;
  border-color: #1a1a2e;
}

.pin-dot.error {
  background: #ef4444;
  border-color: #ef4444;
}

.pin-error {
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
  margin: 8px 0 0;
  min-height: 20px;
}
.pin-error[hidden] { display: none; }

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
  max-width: 240px;
  margin-left: auto;
  margin-right: auto;
}
.pin-pad[hidden] { display: none !important; }

.pin-key {
  width: 72px;
  height: 56px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  touch-action: manipulation;
  background: #f9fafb;
  font-size: 22px;
  font-weight: 600;
  color: #1a1a2e;
  cursor: pointer;
  transition: background 0.1s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.pin-key:hover { background: #e5e7eb; }
.pin-key:active { background: #d1d5db; transform: scale(0.95); }
.pin-key-empty { visibility: hidden; border: none; background: transparent; cursor: default; }
.pin-key-del { font-size: 20px; }

.lock-user-info {
  margin-top: 16px;
  padding: 10px;
  background: #ecfdf5;
  border-radius: 8px;
  color: #065f46;
  font-size: 13px;
  font-weight: 500;
}
.lock-user-info[hidden] { display: none; }

/* ============================================================
   CURRENT USER LABEL & LOGOUT
   ============================================================ */
.current-user-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  padding: 4px 10px;
  background: #e8f5e9;
  border-radius: 6px;
  white-space: nowrap;
}
.current-user-label[hidden] { display: none; }

.topbar.topbar-collapse-actions .topbar-user-group > #currentUserLabel {
  display: none !important;
}
.topbar.topbar-collapse-actions .topbar-actions-group > #darkModeToggle,
.topbar.topbar-collapse-actions .topbar-user-group > #helpPanelBtn,
.topbar.topbar-collapse-actions .topbar-user-group > #logoutBtn,
.topbar.topbar-collapse-actions .topbar-actions-group > #newReservationBtn,
.topbar.topbar-collapse-actions .topbar-actions-group > #printBtn,
.topbar.topbar-collapse-actions .topbar-actions-group > #fullscreenBtn {
  display: none !important;
}
.topbar.topbar-collapse-actions .topbar-user-group > #topbarMoreBtn:not([hidden]) {
  display: inline-flex !important;
}
.topbar.topbar-collapse-actions .topbar-overflow-menu[hidden] {
  display: none !important;
}

.topbar.topbar-collapse-resources {
  gap: var(--space-2);
  padding: 0 var(--space-2);
}
.topbar.topbar-collapse-resources .topbar-resources {
  display: none;
}
.topbar.topbar-collapse-resources .topbar-resources-compact:not([hidden]) {
  display: flex;
}
.topbar.topbar-collapse-resources .resource-compact-select {
  min-width: 150px;
  max-width: 190px;
}
.topbar.topbar-collapse-resources .resource-compact-trigger {
  min-width: 144px;
  max-width: 188px;
}
.topbar.topbar-collapse-resources .date-display {
  min-width: 138px;
  font-size: var(--text-xs);
}
.topbar.topbar-collapse-resources .mini-cal-popover-toggle {
  padding-left: 8px;
  padding-right: 8px;
}
.topbar.topbar-collapse-resources .loc-dropdown {
  min-width: 168px;
  max-width: 208px;
}

@media (max-width: 980px) {
  .help-panel-overlay {
    padding: 12px;
  }
  .help-panel-drawer {
    width: min(100%, calc(100vw - 12px));
    height: min(100%, calc(100dvh - 12px));
  }
  .help-panel-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .help-panel-nav {
    max-height: 220px;
  }
}

@media (max-width: 640px) {
  .help-panel-overlay {
    padding: 0;
    align-items: stretch;
  }
  .help-panel-drawer {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .help-panel-header,
  .help-panel-body,
  .help-panel-support {
    padding-left: 16px;
    padding-right: 16px;
  }
  .help-panel-search-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
  .help-panel-quick-links {
    padding-left: 16px;
    padding-right: 16px;
  }
  .help-panel-toolbar {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 1380px) {
  .topbar {
    gap: var(--space-3);
    padding: 0 var(--space-3);
  }
  .date-display {
    min-width: 170px;
  }
  .loc-dropdown {
    min-width: 210px;
    max-width: 260px;
  }
}

@media (max-width: 920px) {
  .current-user-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .btn-primary {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }
  .topbar .btn-primary svg + * {
    display: none;
  }
  .date-display {
    min-width: 120px;
  }
}

/* ============================================================
   ACTIVITY LOG
   ============================================================ */
.detail-log-section {
  margin-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
}
.detail-log-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-2);
}
.detail-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log-entry {
  font-size: 12px;
  padding: 6px 8px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  line-height: 1.4;
}
.log-entry-time {
  color: #6b7280;
  font-weight: 500;
}
.log-entry-user {
  color: #1a1a2e;
  font-weight: 600;
}
.log-entry-action {
  color: #374151;
}

/* Modal Activity Log */
.modal-log-section {
  margin-top: 0;
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-6) var(--space-4);
  background: var(--color-surface);
  width: 100%;
  display: block;
}
.modal-log-section[hidden] { display: none; }
.modal-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.modal-log-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}
.modal-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}


/* ---- Resource Selection Cards (Booking Pre-Step) ---- */
.booking-resource-selection {
  text-align: center;
  padding: var(--space-4) var(--space-3);
}
.resource-cards {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-3);
}
.resource-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg, 12px);
  border: 2px solid var(--color-border, #e0e0e0);
  background: var(--color-surface, #fff);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  min-width: 140px;
}
.resource-card:hover {
  border-color: var(--res-color, var(--color-primary));
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.resource-card-icon {
  font-size: 1.75rem;
}
.resource-card-name {
  font-weight: 600;
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text, #222);
}

/* =============================================================
   DARK MODE — Manual toggle (html.dark)
   ============================================================= */
html.dark {
  --color-bg:            #1a1a1a;
  --color-surface:       #262626;
  --color-surface-2:     #2a2a2a;
  --color-surface-offset: #333333;
  --color-border:        #404040;
  --color-border-strong: #555555;
  --color-divider:       #383838;
  --color-text:          #e5e5e5;
  --color-text-muted:    #a0a0a0;
  --color-text-secondary:#d1d5db;
  --color-text-faint:    #777777;
  --color-text-inverse:  #1a1a1a;
  /* Muted primary/brand for dark mode */
  --color-primary:       #3b7ddb;
  --color-primary-hover: #2d6bc4;
  --color-primary-light: #1e3a5f;
}
/* Topbar in dark mode: dark background with white text */
html.dark .topbar {
  background: var(--location-color-dark, #1f2937) !important;
  border-bottom-color: #374151;
}
/* Dropdown readable in dark mode */
html.dark .loc-dropdown {
  background: rgba(0,0,0,0.5) !important;
  color: #FFFFFF !important;
  border-color: rgba(255,255,255,0.25) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23FFFFFF' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px !important;
}
html.dark .loc-dropdown option {
  background: #1f2937;
  color: #FFFFFF;
}
html.dark .loc-dropdown:hover {
  background: rgba(0,0,0,0.6) !important;
}
html.dark .loc-dropdown:focus {
  background: rgba(0,0,0,0.65) !important;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}
/* Username label in dark mode */
html.dark .current-user-label {
  color: #FFFFFF;
  background: rgba(255,255,255,0.1);
}
/* Topbar buttons in dark mode */
html.dark .topbar .btn-secondary {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #FFFFFF;
}
html.dark .topbar .btn-secondary:hover {
  background: rgba(255,255,255,0.2);
}
html.dark .topbar .btn-primary {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
  color: #FFFFFF;
}
html.dark .topbar .btn-primary:hover {
  background: rgba(255,255,255,0.25);
}
html.dark .topbar .btn-icon {
  color: #FFFFFF;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}
html.dark .topbar .btn-icon:hover {
  background: rgba(255,255,255,0.2);
  color: #FFFFFF;
}
/* Resource pills in dark mode */
html.dark .resource-pill {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
}
html.dark .resource-pill:hover {
  background: rgba(255,255,255,0.15);
}
html.dark .resource-pill--active {
  background: var(--res-color-dark, rgba(255,255,255,0.15));
  color: #fff;
  border-color: var(--res-color-dark, rgba(255,255,255,0.4));
}
html.dark .resource-combo-toggle {
  background: rgba(15, 23, 42, 0.3);
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.88);
}
html.dark .resource-combo-toggle--active {
  background: rgba(255,255,255,0.92);
  color: #1f2937;
}
html.dark .topbar-resources--combo {
  border-color: rgba(255,255,255,0.34);
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.1),
    0 0 0 1px rgba(255,255,255,0.06),
    0 8px 18px rgba(0,0,0,0.26);
}
html.dark .resource-compact-trigger {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}
html.dark .resource-compact-menu {
  background: rgba(31, 41, 55, 0.98);
  border-color: rgba(255,255,255,0.14);
}
/* Lane headers in dark mode: slightly muted */
html.dark .lane-header-cell {
  background: var(--resource-color-dark, #333) !important;
}
html.dark .lane-header-cell--group-start {
  box-shadow: inset 2px 0 0 rgba(255,255,255,0.46), inset 6px 0 0 rgba(0,0,0,0.42);
}
html.dark .lane-headers {
  background: var(--resource-color-dark, #333) !important;
}
/* Resource tabs in dark mode */
html.dark .res-tab {
  background: var(--res-color-dark, #333);
  border-color: rgba(255,255,255,0.2);
}
html.dark .res-tab.active {
  background: var(--res-color-dark, #444);
  border-color: rgba(255,255,255,0.4);
}
/* Buttons in dark mode — muted */
html.dark .btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
html.dark .btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}
/* Active tab in dark mode */
html.dark .tab-btn.active {
  color: #ffffff;
  border-bottom-color: #ffffff;
}
/* Mini calendar in dark mode */
html.dark .cal-day.selected {
  background: var(--color-primary);
}
html.dark .cal-day:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
/* Grid cells in dark mode */
html.dark .grid-cell {
  background: var(--col-tint-dark, transparent);
}
html.dark .grid-cell--group-start {
  box-shadow: inset 2px 0 0 rgba(255,255,255,0.18), inset 6px 0 0 rgba(0,0,0,0.28);
}
html.dark .grid-cell:hover {
  background: var(--col-tint-hover-dark, rgba(255,255,255,0.05));
}
html.dark .calendar-hover-line {
  background: var(--location-color, var(--color-primary));
  opacity: 0.56;
}
/* Reservation table header in dark mode */
html.dark .reservation-table {
  --reservation-row-hover: #2a2a2a;
}
html.dark .reservation-table th {
  background: var(--res-table-header-bg-dark, var(--color-surface));
  color: var(--res-table-header-color-dark, var(--color-text-muted));
}
html.dark .customer-table {
  --reservation-row-hover: rgba(251, 146, 60, 0.16);
}
html.dark .reservation-table tbody tr:hover {
  background: var(--reservation-row-hover);
}
html.dark .reservation-table tbody tr:hover td {
  background: transparent;
}
html.dark .status-open-badge {
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.26), rgba(217, 119, 6, 0.28));
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12), 0 6px 16px rgba(217, 119, 6, 0.2);
}
html.dark .status-open-badge__count {
  background: rgba(15, 23, 42, 0.7);
  border-color: #262626;
  color: #fde68a;
}
html.dark .status-waitlist-badge {
  background: linear-gradient(180deg, rgba(146, 64, 14, 0.34), rgba(120, 53, 15, 0.28));
  border-color: rgba(251, 191, 36, 0.34);
  color: #fde68a;
}
html.dark .status-open-badge.is-empty,
html.dark .status-waitlist-badge.is-empty {
  background: rgba(38, 38, 38, 0.72);
  color: #a3a3a3;
}
html.dark .waitlist-entry-detail-item {
  background: #1f2937;
  border-color: #404040;
}
html.dark .waitlist-entry-detail-note {
  background: rgba(146, 64, 14, 0.24);
  color: #fde68a;
}
html.dark .waitlist-entry-detail-target {
  background: rgba(14, 138, 168, 0.18);
  color: #cbd5e1;
}

/* =============================================================
   DARK MODE — OS preference fallback (prefers-color-scheme)
   ============================================================= */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not(.dark) {
    --color-bg:            #1a1a1a;
    --color-surface:       #262626;
    --color-surface-2:     #2a2a2a;
    --color-surface-offset: #333333;
    --color-border:        #404040;
    --color-border-strong: #555555;
    --color-divider:       #383838;
    --color-text:          #e5e5e5;
    --color-text-muted:    #a0a0a0;
    --color-text-secondary:#d1d5db;
    --color-text-faint:    #777777;
    --color-text-inverse:  #1a1a1a;
  }
  /* Topbar in dark mode */
  html:not([data-theme="light"]):not(.dark) .topbar {
    background: #1f2937;
    border-bottom-color: #374151;
  }
  /* Dropdown readable in dark mode */
  html:not([data-theme="light"]):not(.dark) .loc-dropdown {
    background: rgba(0,0,0,0.5) !important;
    color: #FFFFFF !important;
    border-color: rgba(255,255,255,0.25) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23FFFFFF' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
  }
  html:not([data-theme="light"]):not(.dark) .loc-dropdown:hover {
    background: rgba(0,0,0,0.6) !important;
  }
  html:not([data-theme="light"]):not(.dark) .loc-dropdown:focus {
    background: rgba(0,0,0,0.65) !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
  }
  /* Username label */
  html:not([data-theme="light"]):not(.dark) .current-user-label {
    color: #FFFFFF;
    background: rgba(255,255,255,0.1);
  }
  /* Topbar buttons */
  html:not([data-theme="light"]):not(.dark) .topbar .btn-icon {
    color: #FFFFFF;
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
  }
  html:not([data-theme="light"]):not(.dark) .topbar .btn-icon:hover {
    background: rgba(255,255,255,0.2);
    color: #FFFFFF;
  }
  /* Resource pills in dark mode */
  html:not([data-theme="light"]):not(.dark) .resource-pill {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.85);
  }
  html:not([data-theme="light"]):not(.dark) .resource-pill:hover {
    background: rgba(255,255,255,0.15);
  }
  html:not([data-theme="light"]):not(.dark) .resource-pill--active {
    background: rgba(255,255,255,0.85);
    color: var(--res-color, #FF8C00);
    border-color: rgba(255,255,255,0.85);
  }
  /* Lane headers in dark mode: slightly muted */
  html:not([data-theme="light"]):not(.dark) .lane-header-cell {
    background: color-mix(in srgb, var(--resource-color, var(--color-brand)) 70%, #1a1a1a);
  }
  html:not([data-theme="light"]):not(.dark) .lane-headers {
    background: color-mix(in srgb, var(--resource-color, var(--color-brand)) 70%, #1a1a1a);
  }
  /* Grid cells: even lower tint opacity in dark mode */
  html:not([data-theme="light"]):not(.dark) .grid-cell {
    background: var(--col-tint-dark, transparent);
  }
  html:not([data-theme="light"]):not(.dark) .grid-cell:hover {
    background: var(--col-tint-hover-dark, rgba(255,255,255,0.05));
  }
  /* Reservation table header in dark mode */
  html:not([data-theme="light"]):not(.dark) .reservation-table th {
    background: var(--res-table-header-bg-dark, var(--color-surface));
    color: var(--res-table-header-color-dark, var(--color-text-muted));
  }
}

/* Spinner animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

/* =============================================================
   FEIERTAGE & SONDERTAGE
   ============================================================= */

.feiertage-info-banner {
  background: var(--color-surface-alt, #f0f4ff);
  border: 1px solid var(--color-border, #dde);
  border-radius: 8px;
  padding: var(--space-3, 12px);
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-secondary, #555);
  line-height: 1.5;
}
.feiertage-hierarchy-info {
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-alt, #f0f4ff);
  border-radius: 8px;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  border-left: 3px solid var(--color-primary);
}

.country-toggle-group {
  display: flex;
  gap: var(--space-2, 8px);
  flex-wrap: wrap;
  margin-top: var(--space-3, 12px);
}

.country-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--color-border, #dde);
  border-radius: 8px;
  background: var(--color-surface, #fff);
  font-size: var(--text-sm, 0.875rem);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--color-text, #222);
}

.country-toggle-btn:hover {
  border-color: var(--color-primary, #4361ee);
  background: var(--color-surface-alt, #f0f4ff);
}

.country-toggle-btn.active {
  border-color: var(--color-primary, #4361ee);
  background: var(--color-primary, #4361ee);
  color: #fff;
}

.feiertage-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 8px);
}

.feiertage-section-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
    flex-wrap: wrap;
    margin-bottom: var(--space-3, 12px);
}

.feiertage-empty {
    padding: var(--space-3, 12px);
    color: var(--color-text-muted, #999);
  font-size: var(--text-sm, 0.875rem);
  text-align: center;
}

.feiertag-row {
  border: 1px solid var(--color-border, #dde);
  border-radius: 8px;
  padding: var(--space-3, 12px);
  background: var(--color-surface, #fff);
}

.feiertag-header {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  margin-bottom: var(--space-2, 8px);
}

.feiertag-date {
  font-weight: 600;
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text, #222);
  min-width: 180px;
}

.feiertag-label {
  flex: 1;
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-secondary, #555);
}

.feiertag-remove {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--color-text-muted, #999);
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.feiertag-remove:hover {
  background: #fee;
  color: var(--color-danger, #e74c3c);
}

.feiertag-options {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  flex-wrap: wrap;
}

.feiertag-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm, 0.875rem);
  cursor: pointer;
}

.feiertag-times {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
}

.feiertag-times label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm, 0.875rem);
}

.feiertag-times input[type="time"] {
  width: 110px;
}

.feiertag-hint {
  margin-top: var(--space-2, 8px);
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted, #999);
  font-style: italic;
}

/* Ignored holiday row — muted appearance */
.feiertag-row--ignored {
  opacity: 0.55;
  border-style: dashed;
}
.feiertag-row--ignored:hover {
  opacity: 0.85;
}

/* Active option highlight styles */
.feiertag-option--active-ignore {
  color: var(--color-text-muted, #999);
  font-weight: 600;
}
.feiertag-option--active-closed {
  color: var(--color-danger, #e74c3c);
  font-weight: 600;
}
.feiertag-option--active-special {
  color: var(--color-primary, #2563eb);
  font-weight: 600;
}

/* Add form */
.feiertag-add-form {
  margin-top: var(--space-3, 12px);
  padding: var(--space-3, 12px);
  border: 1px dashed var(--color-border, #dde);
  border-radius: 8px;
  background: var(--color-surface-alt, #f8f9fa);
}

.feiertag-add-row {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  flex-wrap: wrap;
  margin-bottom: var(--space-2, 8px);
}

.feiertag-add-row:last-child {
  margin-bottom: 0;
}

.feiertag-add-row input[type="date"],
.feiertag-add-row input[type="text"] {
    flex: 1;
    min-width: 140px;
}

.holiday-history-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 4200;
}

.holiday-history-dialog {
    width: min(760px, 100%);
    max-height: min(78vh, 720px);
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #dde);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
}

.holiday-history-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3, 12px);
    padding: var(--space-4, 16px) var(--space-4, 16px) var(--space-3, 12px);
    border-bottom: 1px solid var(--color-border, #dde);
}

.holiday-history-dialog__title {
    font-size: var(--text-lg, 1.125rem);
    font-weight: 600;
    color: var(--color-text, #222);
}

.holiday-history-dialog__body {
    padding: var(--space-4, 16px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 8px);
}

.holiday-history-row {
    border: 1px solid var(--color-border, #dde);
    border-radius: 10px;
    padding: var(--space-3, 12px);
    background: var(--color-surface-alt, #f8fafc);
}

.holiday-history-row__header {
    display: flex;
    gap: var(--space-3, 12px);
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
}

.holiday-history-row__date {
    font-size: var(--text-sm, 0.875rem);
    font-weight: 600;
    color: var(--color-text, #222);
    white-space: nowrap;
}

.holiday-history-row__label {
    flex: 1;
    font-size: var(--text-sm, 0.875rem);
    color: var(--color-text-secondary, #555);
}

.holiday-history-row__meta {
    font-size: var(--text-xs, 0.75rem);
    color: var(--color-text-muted, #64748b);
}

/* Closed Day Warning Dialog */
.closed-day-warning-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.closed-day-warning-dialog {
  background: #fff;
  border-radius: 12px;
  padding: var(--space-4, 24px);
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.closed-day-warning-title {
  font-size: var(--text-lg, 1.125rem);
  font-weight: 700;
  margin-bottom: var(--space-2, 8px);
}

.closed-day-warning-text {
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-secondary, #555);
  line-height: 1.5;
  margin-bottom: var(--space-3, 16px);
}

.closed-day-warning-actions {
  display: flex;
  gap: var(--space-2, 8px);
  justify-content: flex-end;
}

/* =============================================================
   RESPONSIVE — Mobile & Tablet (Kundenformular / Embed)
   ============================================================= */

/* Tablet (max 768px) */
@media (max-width: 768px) {
  /* Booking view padding */
  .booking-view {
    padding: var(--space-3) var(--space-2) var(--space-6);
  }

  /* Step progress: smaller */
  .step-item {
    min-width: 44px;
  }
  .step-circle {
    width: 24px;
    height: 24px;
    font-size: 0.6rem;
  }
  .step-label {
    font-size: 0.55rem;
  }
  .step-connector {
    min-width: 12px;
    margin-bottom: 12px;
  }

  /* Booking title */
  .booking-title {
    font-size: var(--text-base);
  }
  .booking-subtitle {
    font-size: var(--text-xs);
  }

  /* Content max width */
  .booking-content {
    max-width: 100%;
  }

  /* Step titles */
  .booking-step-title {
    font-size: var(--text-sm);
  }

  /* Resource cards */
  .resource-cards {
    gap: var(--space-2);
  }
  .resource-card {
    min-width: 120px;
    padding: var(--space-3) var(--space-4);
  }
  .resource-card-icon {
    font-size: 1.5rem;
  }
  .resource-card-name {
    font-size: var(--text-sm);
  }

  /* Time slot grid */
  .time-slot-grid {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 3px;
  }
  .time-slot {
    padding: 3px 4px;
    font-size: 0.7rem;
  }

  /* Duration buttons */
  .duration-btn-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  /* Booking step navigation */
  .booking-step-nav {
    gap: var(--space-2);
  }
  .booking-step-nav .btn {
    font-size: var(--text-xs);
    padding: 6px var(--space-3);
  }
}

/* Mobile (max 480px) */
@media (max-width: 480px) {
  /* Booking view minimal padding */
  .booking-view {
    padding: var(--space-2) var(--space-2) var(--space-4);
  }

  /* Hero section compact */
  .booking-hero {
    margin-bottom: var(--space-2);
    gap: 2px;
  }
  .booking-hero-icon {
    width: 24px;
    height: 24px;
  }
  .booking-hero-icon svg {
    width: 24px;
    height: 24px;
  }
  .booking-title {
    font-size: var(--text-sm);
  }
  .booking-subtitle {
    font-size: 0.65rem;
  }

  /* Step indicators: hide labels, only show circles */
  .booking-steps {
    margin-bottom: var(--space-2);
    justify-content: center;
  }
  .step-item {
    min-width: 28px;
  }
  .step-circle {
    width: 22px;
    height: 22px;
    font-size: 0.6rem;
  }
  .step-label {
    display: none;
  }
  .step-connector {
    min-width: 10px;
    margin-bottom: 0;
  }

  /* Step titles smaller */
  .booking-step-title {
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
  }

  /* Resource cards stack vertically */
  .resource-cards {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
  }
  .resource-card {
    flex-direction: row;
    min-width: 0;
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }
  .resource-card-icon {
    font-size: 1.25rem;
  }
  .resource-card-name {
    font-size: var(--text-sm);
  }

  /* Time slots tighter */
  .time-slot-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 3px;
  }
  .time-slot {
    padding: 3px 2px;
    font-size: 0.65rem;
    border-width: 1.5px;
  }
  .time-slot.selected {
    border-width: 2px;
  }

  /* Date picker full width */
  .booking-date-picker .form-input {
    max-width: 100%;
    width: 100%;
  }

  /* CRITICAL: Form rows stack vertically on mobile */
  .form-row {
    grid-template-columns: 1fr;
  }
  .billing-inline-row:not(.billing-inline-row--compact),
  .customer-detail-billing-toggle {
    align-items: flex-start;
  }
  .billing-fields-card__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .billing-inline-row:not(.billing-inline-row--compact) {
    flex-direction: column;
  }
  .billing-inline-summary,
  .customer-detail-billing-summary {
    width: 100%;
    text-align: left;
  }
  .form-label-row {
    flex-direction: column;
    align-items: flex-start;
  }
  #modalBillingInlineRow.billing-inline-row--compact.billing-inline-row--modal {
    position: static;
    top: auto;
    right: auto;
    max-width: none;
    justify-content: flex-start;
  }
  .billing-inline-row--compact {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .billing-inline-row--compact .billing-inline-summary {
    max-width: none;
  }

  /* Form fields full width */
  .booking-content .form-input,
  .booking-content .form-select,
  .booking-content .form-textarea {
    width: 100%;
    max-width: 100%;
  }

  /* Phone input: shrink country code dropdown */
  .phone-input-group .phone-country-code {
    width: 100px;
    font-size: 0.65rem;
    padding: 4px 2px;
  }

  /* Step navigation */
  .booking-step-nav {
    flex-wrap: wrap;
    gap: var(--space-1);
    padding-top: var(--space-2);
  }
  .booking-step-nav .btn {
    flex: 1;
    min-width: 100px;
    font-size: var(--text-xs);
    padding: 6px var(--space-2);
    text-align: center;
  }

  /* Persons/lanes stepper */
  .stepper-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .stepper-input {
    width: 40px;
    height: 32px;
    font-size: var(--text-sm);
  }

  /* Package cards: single column on very small screens */
  .package-cards {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
  .package-card {
    padding: var(--space-2);
  }
  .package-card-name {
    font-size: var(--text-xs);
  }
  .package-card-price {
    font-size: var(--text-sm);
  }

  /* Package badges compact on mobile */
  .package-card-badges { gap: 2px; }
  .pkg-badge { font-size: 9px; padding: 0 4px; }

  /* Admin accordion: time rules stack on mobile */
  .pkg-time-rule-row { flex-direction: column; align-items: flex-start; }

  /* Duration buttons: 2 columns on mobile */
  .duration-btn-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
  }
  .duration-btn {
    font-size: 0.65rem;
    padding: 3px var(--space-1);
  }

  /* Booking summary compact — single column on very small screens */
  .booking-summary {
    grid-template-columns: 1fr;
    gap: var(--space-1);
    padding: var(--space-2);
  }

  /* Success details compact */
  .success-details {
    padding: var(--space-2);
  }
  .success-title {
    font-size: var(--text-base);
  }
  .success-text {
    font-size: var(--text-xs);
  }

  /* Player name inputs */
  .player-name-inputs .form-input {
    font-size: var(--text-xs);
    padding: 4px;
  }

  /* Checkboxes (terms, newsletter) */
  .checkbox-label {
    font-size: 0.65rem;
  }

  /* Closed message */
  .booking-closed-msg {
    padding: var(--space-2) var(--space-3);
    font-size: 0.65rem;
  }

  /* Location cards */
  .location-card-btn {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-3);
  }

  /* Occasion cards compact */
  .occasion-cards {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 3px;
  }
  .occasion-card {
    padding: var(--space-1) var(--space-2);
  }
  .occasion-emoji {
    font-size: 1rem;
  }
  .occasion-name {
    font-size: var(--text-xs);
  }
}

/* Embed-specific mobile overrides */
@media (max-width: 480px) {
  body.embed-mode .booking-view {
    padding: var(--space-1) var(--space-1) var(--space-3);
  }
  body.embed-mode .booking-hero {
    margin-bottom: var(--space-1);
  }
}


/* Info Tooltip Icon */
.tooltip-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--color-text-faint);
  cursor: help;
  vertical-align: middle;
  margin-left: 4px;
  position: relative;
}
.tooltip-icon:hover {
  color: var(--color-primary);
}

/* =============================================================
   DARK MODE — Additional overrides for all pages
   (Reservierungen, Kundendatenbank, Statistiken, Verwaltung)
   ============================================================= */

/* ---- Body / page background ---- */
html.dark .tab-panel {
  background: #1a1a1a;
}

/* ---- Date navigation ---- */
html.dark .date-nav {
  background: #333;
  border-color: #404040;
}
html.dark .date-display { color: #e5e5e5; }
html.dark .logo-name { color: #e5e5e5; }
html.dark .status-time { color: #e5e5e5; }

/* ---- List View toolbar (Reservierungen + Kundendatenbank) ---- */
html.dark .list-view {
  background: #1a1a1a;
}
html.dark .list-toolbar {
  background: #262626;
  border-bottom-color: #404040;
}
html.dark .search-input {
  background: #333;
  color: #e5e5e5;
  border-color: #555;
}
html.dark .search-input::placeholder { color: #777; }
html.dark .search-input:focus {
  background: #3a3a3a;
  border-color: var(--color-primary);
}
html.dark .search-icon { color: #777; }
html.dark .list-resource-filter-label {
  color: #b3b3b3;
}
html.dark .list-resource-filter-toggle {
  background: #333;
  color: #e5e5e5;
  border-color: #555;
}
html.dark .list-range-filter-select {
  background: #333;
  color: #e5e5e5;
  border-color: #555;
}
html.dark .list-resource-filter-toggle:hover {
  background: #3a3a3a;
  border-color: #686868;
}
html.dark .list-resource-filter-menu {
  background: #262626;
  border-color: #404040;
  box-shadow: 0 16px 36px rgba(0,0,0,0.42);
}
html.dark .list-resource-filter-option {
  color: #e5e5e5;
}
html.dark .list-resource-filter-option:hover {
  background: #333333;
}
html.dark .list-resource-filter-option--all {
  border-bottom-color: #404040;
}

/* ---- Filter pills ---- */
html.dark .filter-btn {
  background: #333;
  color: #a0a0a0;
  border-color: #555;
}
html.dark .filter-btn:hover {
  background: #404040;
  color: #e5e5e5;
}
html.dark .filter-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
html.dark .list-mode-toggle {
  background: #1f1f1f;
  border-color: #404040;
}
html.dark .list-mode-toggle .list-mode-btn:not(.active) {
  background: #2f2f2f;
  color: #b8b8b8;
  border-color: #555;
}
html.dark .list-mode-toggle .list-mode-btn:not(.active):hover {
  background: color-mix(in srgb, var(--color-primary) 20%, #2f2f2f);
  color: color-mix(in srgb, var(--color-primary) 32%, white 68%);
  border-color: color-mix(in srgb, var(--color-primary) 42%, #666);
}
html.dark .list-mode-toggle .list-mode-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
html.dark .modal-header-status-help {
  color: #c4c4c4;
}

/* ---- Table footer ---- */
html.dark .table-footer {
  background: #262626;
  border-top-color: #404040;
  color: #a0a0a0;
}

/* ---- Table action buttons ---- */
html.dark .table-action-btn {
  background: rgba(255,255,255,0.04);
  color: #f3f4f6;
  border-color: #6b7280;
}

/* ---- Stat cards (sidebar) ---- */
html.dark .stat-card {
  background: #333;
  border-color: #404040;
}
html.dark .stat-value { color: #e5e5e5; }
html.dark .stat-label { color: #a0a0a0; }
html.dark .sidebar-title { color: #e5e5e5; }
html.dark .sidebar-section-title { color: #a0a0a0; }

/* ---- Statistics page ---- */
html.dark .stats-kpi-card {
  background: #262626;
  border-color: #404040;
}
html.dark .stats-kpi-value { color: #e5e5e5; }
html.dark .stats-kpi-label { color: #a0a0a0; }
html.dark .stats-bar { background: #404040; }
html.dark .stats-period-btn,
html.dark .stats-preset-btn {
  background: #333;
  color: #a0a0a0;
  border-color: #555;
}
html.dark .stats-period-btn:hover,
html.dark .stats-preset-btn:hover {
  background: #404040;
  color: #e5e5e5;
}
html.dark .stats-period-btn.active,
html.dark .stats-preset-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* ---- Verwaltung (Manager) sidebar ---- */
html.dark .manager-nav {
  background: #262626;
  border-right-color: #404040;
}
html.dark .manager-nav-item {
  color: #a0a0a0;
}
html.dark .manager-nav-item:hover {
  background: #333;
  color: #e5e5e5;
  border-color: #404040;
}
html.dark .manager-nav-item.active {
  background: #1f2937 !important;
  color: #ffffff !important;
  border-color: #4b5563 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
html.dark #tab-manager .manager-nav .manager-nav-item.active {
  color: #ffffff !important;
}
html.dark .manager-nav-item.active svg {
  color: inherit !important;
}

/* ---- Verwaltung content area ---- */
html.dark .manager-content {
  background: #1a1a1a;
  color: #e5e5e5;
}
html.dark .mgr-section-header {
  background: #262626;
  border-color: #404040;
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}
html.dark .mgr-section-title {
  color: #e5e5e5;
}
html.dark .mgr-card {
  background: #262626;
  border-color: #404040;
}
html.dark .stats-toolbar-card {
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}
html.dark .mgr-card-title { color: #e5e5e5; }
html.dark .email-settings-header-copy,
html.dark .email-settings-scope-copy {
  color: #c7c7c7;
}
html.dark .email-settings-scope-block {
  border-color: #404040;
}
html.dark .email-settings-scope-block--location {
  background: rgba(239, 68, 68, 0.12);
}
html.dark .email-settings-scope-label {
  color: #a0a0a0;
}
html.dark .email-settings-scope-title {
  color: #e5e5e5;
}
html.dark .booking-link-configurator__group,
html.dark .booking-link-configurator__output,
html.dark .booking-link-configurator__field {
  background: #2f3135;
  border-color: #404040;
}
html.dark .booking-link-configurator__intro {
  color: #c7c7c7;
}
html.dark .customer-table-filter-control {
  background: #2f3135;
  color: #e5e5e5;
  border-color: #555555;
}
html.dark .customer-table-filter-control::placeholder {
  color: #9ca3af;
}
html.dark .customer-table-filter-select {
  color-scheme: dark;
}

/* ---- Manager tables ---- */
html.dark .mgr-table th {
  background: #333;
  color: #a0a0a0;
}
html.dark .mgr-table td {
  color: #e5e5e5;
  border-bottom-color: #333;
}
html.dark .mgr-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}
html.dark .mgr-table input,
html.dark .mgr-table select {
  background: #333;
  color: #e5e5e5;
  border-color: #555;
}
html.dark .resource-color-panel {
  background: #2c2c2c;
  border-color: #404040;
}
html.dark .resource-color-panel-header {
  color: #d1d5db;
}
html.dark .resource-color-field {
  background: #333333;
  border-color: #555555;
  color: #e5e5e5;
}
html.dark .mgr-save-bar {
  border-top-color: #404040;
}

/* ---- Hours grid (Öffnungszeiten) ---- */
html.dark .hours-row {
  border-bottom-color: #404040;
}
html.dark .hours-day { color: #e5e5e5; }

/* ---- Holiday rows ---- */
html.dark .holiday-row {
  background: #333;
  border-color: #555;
}
html.dark .feiertage-info-banner,
html.dark .feiertage-hierarchy-info {
  background: #2c3442;
  border-color: #475569;
  color: #e5e7eb;
}
html.dark .feiertag-hint {
  color: #cbd5e1;
}
html.dark .feiertag-option--active-special {
  color: #93c5fd;
}
html.dark .feiertag-option--active-ignore {
  color: #cbd5e1;
}
html.dark .feiertag-add-form {
    background: #303744;
    border-color: #475569;
}

html.dark .holiday-history-dialog {
    background: #1f2937;
    border-color: #475569;
}

html.dark .holiday-history-dialog__header {
    border-color: #475569;
}

html.dark .holiday-history-dialog__title,
html.dark .holiday-history-row__date {
    color: #e5e7eb;
}

html.dark .holiday-history-row {
    background: #273142;
    border-color: #475569;
}

html.dark .holiday-history-row__label {
    color: #d1d5db;
}

html.dark .holiday-history-row__meta {
    color: #cbd5e1;
}

/* ---- Embed code textarea ---- */
html.dark .embed-code-textarea {
  background: #333;
  color: #e5e5e5;
  border-color: #555;
}

/* ---- Modal ---- */
html.dark .modal {
  background: #262626;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
html.dark .modal-header {
  background: #333;
  border-bottom-color: #404040;
}
html.dark .modal-title { color: #e5e5e5; }
html.dark .modal-body { color: #e5e5e5; }
html.dark .modal-footer {
  background: #333;
  border-top-color: #404040;
}
html.dark .customer-detail-readonly-input {
  background: #2f3135;
  color: #e5e5e5;
  border-color: #555555;
  -webkit-text-fill-color: #e5e5e5;
  opacity: 1;
}
html.dark .customer-detail-newsletter-box {
  background: #2f3135;
  border-color: #4b5563;
}
html.dark .billing-inline-row,
html.dark .billing-fields-card,
html.dark .customer-detail-billing-toggle {
  background: #2f3135;
  border-color: #4b5563;
}
html.dark .billing-inline-row--compact {
  background: transparent;
  border-color: transparent;
}
html.dark .billing-inline-checkbox,
html.dark .customer-detail-billing-title {
  color: #f3f4f6;
}
html.dark .billing-inline-summary,
html.dark .billing-fields-card__intro,
html.dark .customer-detail-billing-summary,
html.dark .customer-detail-billing-chevron,
html.dark .billing-inline-expand {
  color: #cbd5e1;
}
html.dark .customer-detail-reservation-row {
  background: #2f3135;
  border-color: #4b5563;
}
html.dark .customer-detail-reservation-meta {
  color: #e5e5e5;
}

/* ---- Modal activity log ---- */
html.dark .modal-log-section {
  background: #333;
  border-top-color: #404040;
}
html.dark .modal-log-title { color: #e5e5e5; }

/* ---- Activity log entries ---- */
html.dark .log-entry {
  background: #333;
  border-color: #555;
}
html.dark .log-entry-time { color: #a0a0a0; }
html.dark .log-entry-user { color: #e5e5e5; }
html.dark .log-entry-action { color: #d4d4d4; }

/* ---- Context menu ---- */
html.dark .context-menu {
  background: #262626;
  border-color: #404040;
}
html.dark .context-menu-item {
  color: #e5e5e5;
}
html.dark .context-menu-item:hover {
  background: #333;
}
html.dark .context-menu-item.danger:hover {
  background: rgba(127, 29, 29, 0.38);
  color: #fecaca;
}
html.dark .context-menu-sep {
  background: #404040;
}

/* ---- Confirm dialog ---- */
html.dark .confirm-dialog {
  background: #262626;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
html.dark .confirm-dialog-title { color: #e5e5e5; }
html.dark .confirm-dialog-msg { color: #cbd5e1; }
html.dark .series-dialog-title { color: #e5e5e5; }
html.dark .series-dialog-msg { color: #cbd5e1; }
html.dark .confirm-dialog-checkbox {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.24);
  color: #f3f4f6;
}
html.dark .customer-delete-block-count {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.28);
  color: #fde68a;
}
html.dark .booking-pause-alert {
  border-color: rgba(248, 113, 113, 0.35);
  background: linear-gradient(180deg, rgba(69, 10, 10, 0.9) 0%, rgba(88, 28, 28, 0.86) 100%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}
html.dark .booking-pause-alert__title {
  color: #fecaca;
}
html.dark .booking-pause-alert__copy {
  color: #fee2e2;
}
html.dark .booking-pause-chip {
  background: rgba(17, 24, 39, 0.38);
  border-color: rgba(254, 202, 202, 0.18);
  color: #fee2e2;
}
html.dark .booking-pause-dialog {
  background: #1f2937;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
}
html.dark .booking-pause-dialog__title {
  color: #f9fafb;
}
html.dark .booking-pause-dialog__copy {
  color: #e5e7eb;
}
html.dark .booking-pause-dialog__hint {
  background: rgba(127, 29, 29, 0.4);
  border-color: rgba(248, 113, 113, 0.32);
  color: #fecaca;
}
html.dark .booking-pause-option {
  background: #111827;
  border-color: #374151;
  color: #f3f4f6;
}

/* ---- Package cards (booking) ---- */
html.dark .package-card {
  background: #262626;
  border-color: #404040;
  color: #e5e5e5;
}
html.dark .package-card:hover {
  border-color: var(--color-brand);
}

/* ---- Package badges (booking) dark ---- */
html.dark .pkg-badge {
  background: #2a2a2a; border-color: #444;
  color: #a0a0a0;
}
/* ---- Admin package accordion dark ---- */
html.dark .pkg-accordion-card {
  --pkg-surface-1: #242932;
  --pkg-surface-1-hover: #20252d;
  --pkg-surface-2: #171c25;
  --pkg-surface-3: #1d232c;
  border-color: #404040;
  background: var(--pkg-surface-1);
}
html.dark .pkg-accordion-card.mgr-card {
  background: var(--pkg-surface-1);
}
html.dark .pkg-accordion-header:hover {
  background: var(--pkg-surface-1-hover);
}
.dark .pkg-delete-btn,
html.dark .pkg-delete-btn {
  background: transparent;
  border: none;
  color: #fca5a5;
}
.dark .pkg-delete-btn:hover,
html.dark .pkg-delete-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}
html.dark .pkg-accordion-body {
  border-top-color: #404040;
  background: var(--pkg-surface-1);
}
html.dark .pkg-resource-context-note {
  background: rgba(255,255,255,0.03);
  border-color: #404040;
}
html.dark .pkg-resource-context-title {
  color: #d7dce4;
}
html.dark .pkg-resource-context-copy,
html.dark .pkg-assignment-context-copy,
html.dark .pkg-editor-section-description,
html.dark .pkg-editor-section-summary {
  color: #d7dce4;
}
html.dark .pkg-assignment-context-note {
  background: rgba(255,255,255,0.02);
  border-color: #555;
}
html.dark .pkg-assignment-context-title {
  color: #d7dce4;
}
html.dark .pkg-editor-section {
  border-color: #404040;
}
html.dark .pkg-editor-section-header {
  background: var(--pkg-surface-2);
}
html.dark .pkg-editor-section-title {
  color: #f3f4f6;
}
html.dark .pkg-editor-section-toggle {
  color: #d7dce4;
}
html.dark .pkg-editor-section-header:hover .pkg-editor-section-toggle,
html.dark .pkg-editor-section-header:focus-visible .pkg-editor-section-toggle {
  background: rgba(255,255,255,0.06);
  color: #f3f4f6;
}
html.dark .pkg-editor-section-body {
  border-top-color: #404040;
  background: var(--pkg-surface-3);
}
html.dark .pkg-editor-inline-note {
  background: rgba(255,255,255,0.04);
  color: #d7dce4;
}
html.dark .pkg-units-list {
  background: rgba(255,255,255,0.03);
  border-color: #404040;
}
html.dark .pkg-followup-help {
  background: rgba(255,255,255,0.04);
  color: #d7dce4;
}
/* ---- Modal accordion dark ---- */
html.dark .modal-accordion {
  border-top-color: #404040;
}

/* ---- Occasion cards (booking) ---- */
html.dark .occasion-card {
  background: #262626;
  border-color: #404040;
  color: #e5e5e5;
}
html.dark .occasion-card:hover {
  background: var(--color-brand-light, #3d2800);
}

/* ---- Player name inputs ---- */
html.dark .player-name-input {
  background: #333;
  color: #e5e5e5;
  border-color: #555;
}
html.dark .player-name-input:focus {
  border-color: var(--color-brand);
}
html.dark .player-lane-title { color: #a0a0a0; }
html.dark .modal-player-lane-title { color: #a0a0a0; border-bottom-color: #404040; }

/* ---- Booking step hint ---- */
html.dark .booking-step-hint { color: #a0a0a0; }

/* ---- Lock/Login Screen ---- */
html.dark .lock-overlay { background: #1a1a1a; }
html.dark .lock-box {
  background: #262626;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
html.dark .lock-title { color: #e5e5e5; }
html.dark .lock-subtitle { color: #a0a0a0; }
html.dark .pin-key {
  background: #333;
  border-color: #555;
  color: #e5e5e5;
}
html.dark .pin-key:hover { background: #404040; }
html.dark .pin-key:active { background: #4a4a4a; }
html.dark .pin-dot { border-color: #555; }
html.dark .pin-dot.filled { background: #e5e5e5; border-color: #e5e5e5; }
html.dark .lock-user-info {
  background: #0d3325;
  color: #6ee7b7;
}
html.dark #loginEmail,
html.dark #loginPassword {
  background: #333 !important;
  color: #e5e5e5 !important;
  border-color: #555 !important;
}
html.dark #loginEmail::placeholder,
html.dark #loginPassword::placeholder {
  color: #777 !important;
}
html.dark #showPinLoginBtn,
html.dark #showEmailLoginBtn {
  color: #a0a0a0 !important;
}

/* ---- Tooltip ---- */
html.dark .res-tooltip {
  background: #262626;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
html.dark .res-tooltip-badge {
  background: rgba(15, 23, 42, 0.42);
  border-color: rgba(255,255,255,0.18);
  color: #f8fafc;
}
html.dark .res-tooltip-badge.badge--confirmed { background: var(--color-success-light); color: var(--color-success-text); }
html.dark .res-tooltip-badge.badge--pending { background: var(--color-warning-light); color: var(--color-warning-text); }
html.dark .res-tooltip-badge.badge--offer-open { background: rgba(217, 119, 6, 0.24); color: #fcd34d; }
html.dark .res-tooltip-badge.badge--pre-reserved { background: rgba(180, 83, 9, 0.22); color: #fdba74; }
html.dark .res-tooltip-badge.badge--cancelled { background: var(--color-error-light); color: var(--color-error-text); }
html.dark .res-tooltip-badge.badge--checkedin { background: var(--color-primary-light); color: var(--color-primary); }
html.dark .res-tooltip-badge.badge--settled { background: #404040; color: #a0a0a0; }
html.dark .res-tooltip-badge.badge--removed { background: rgba(71, 85, 105, 0.35); color: #cbd5e1; }
html.dark .res-tooltip-badge--series {
  background: rgba(146, 64, 14, 0.34);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.26);
}
html.dark .res-tooltip-badge--walkin {
  background: rgba(29, 78, 216, 0.28);
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.24);
}
html.dark .res-tooltip-badge--linked {
  background: rgba(8, 145, 178, 0.26);
  color: #bae6fd;
  border-color: rgba(34, 211, 238, 0.22);
}
html.dark .res-tooltip-body { color: #e5e5e5; }
html.dark .res-tooltip-row { border-bottom-color: #404040; }
html.dark .res-tooltip-label { color: #cbd5e1; }
html.dark .res-tooltip-section { border-top-color: #404040; color: #d1d5db; }
html.dark .res-tooltip-link-role--child {
  background: rgba(56, 189, 248, 0.2);
  color: #bae6fd;
}
html.dark .res-tooltip-link-role--parent {
  background: rgba(250, 204, 21, 0.18);
  color: #fde68a;
}

/* ---- Toggle switch ---- */
html.dark .toggle-slider { background: #555; }
html.dark .toggle-slider::before { background: #d4d4d4; }

/* ---- Footer ---- */
html.dark .app-footer {
  background: #262626;
  border-top-color: #404040;
}

/* ---- Booking view elements ---- */
html.dark .booking-view { color: #e5e5e5; }
html.dark .booking-title { color: #e5e5e5; }
html.dark .booking-subtitle { color: #a0a0a0; }
html.dark .booking-step-title { color: #e5e5e5; }
html.dark .resource-card-name { color: #e5e5e5; }

/* ---- Drag origin label ---- */
html.dark .drag-origin-label {
  background: rgba(26,26,26,0.9);
}

/* ---- Col resize handle ---- */
html.dark .col-resize-handle { background: #555; }
html.dark .col-resize-handle:hover { background: #777; }

/* ---- Badge overrides ---- */
html.dark .badge--settled { background: #404040; color: #a0a0a0; }
html.dark .badge--offer-open { background: rgba(217, 119, 6, 0.24); color: #fcd34d; }
html.dark .badge--pre-reserved { background: rgba(180, 83, 9, 0.22); color: #fdba74; }
html.dark .badge--removed { background: rgba(71, 85, 105, 0.35); color: #cbd5e1; }

/* ---- Customer toolbar ---- */
html.dark .customer-toolbar-actions .btn-secondary {
  background: #333;
  color: #e5e5e5;
  border-color: #555;
}
html.dark .customer-import-info-card,
html.dark .customer-import-upload-card,
html.dark .customer-import-legal-box,
html.dark .customer-import-preview-table-wrap,
html.dark .customer-import-result-box,
html.dark .customer-import-note-card,
html.dark .customer-import-summary-card,
html.dark .customer-import-mapping-row {
  background: #2f3135;
  border-color: #4b5563;
}
html.dark .customer-import-step {
  background: #2f3135;
}
html.dark .customer-import-inline-warning {
  background: rgba(127, 29, 29, 0.3);
  border-color: rgba(248, 113, 113, 0.3);
}
html.dark .customer-import-file-meta,
html.dark .customer-import-empty,
html.dark .customer-import-step,
html.dark .customer-import-note-card p,
html.dark .customer-import-result-meta,
html.dark .customer-import-summary-card span {
  color: #cbd5e1;
}
html.dark .customer-import-step--active {
  color: #fecaca;
}
html.dark .customer-import-step--done {
  color: #bbf7d0;
}
html.dark .cust-status-label--noch-kein-besuch {
  color: #fbbf24;
}
html.dark .cust-visits-badge--empty {
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
}

/* ---- Sidebar divider ---- */
html.dark .sidebar-divider { background: #404040; }

/* ---- Input color picker ---- */
html.dark input[type="color"] {
  background: #333;
  border-color: #555;
}

/* Dark mode: time slots and duration buttons */
html.dark .time-slot {
  background: var(--color-surface, #262626);
  border-color: var(--color-border, #404040);
  color: var(--color-text, #e5e5e5);
}
html.dark .time-slot:hover {
  background: var(--color-primary-light, #1e3a5f);
  border-color: var(--color-primary, #3b7ddb);
  color: var(--color-primary, #3b7ddb);
}
html.dark .time-slot.selected {
  background: var(--color-primary, #3b7ddb);
  border-color: var(--color-primary, #3b7ddb);
  color: #fff;
}
html.dark .time-slot.unavailable {
  background: #2a2020;
  border-color: #4a3030;
  color: #7a5555;
}
html.dark .duration-btn {
  background: var(--color-surface, #262626);
  border-color: var(--color-border, #404040);
  color: var(--color-text, #e5e5e5);
}
html.dark .duration-btn:hover {
  background: var(--color-primary-light, #1e3a5f);
  border-color: var(--color-primary, #3b7ddb);
}
html.dark .duration-btn.selected {
  background: var(--color-primary, #3b7ddb);
  border-color: var(--color-primary, #3b7ddb);
  color: #fff;
}

/* Mobile overflow fixes for booking view */
.booking-view { max-width: 100%; overflow-x: hidden; word-wrap: break-word; overflow-wrap: break-word; }
.booking-step-panel { max-width: 100%; overflow-x: hidden; }
.summary-card { max-width: 100%; overflow-wrap: break-word; word-break: break-word; }
.success-details { max-width: 100%; overflow-wrap: break-word; }

/* Embed mode: ensure no horizontal overflow */
body.embed-mode { overflow-x: hidden; max-width: 100vw; }
body.embed-mode .booking-view { padding: 0 var(--space-3); }

/* =============================================================
   EMOJI PICKER
   ============================================================= */
.emoji-picker-popup {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  width: 270px;
  max-height: 340px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.emoji-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.emoji-picker-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--color-text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.emoji-picker-close:hover { background: var(--color-surface-alt); }
.emoji-picker-body {
  overflow-y: auto;
  padding: 8px;
  flex: 1;
}
.emoji-picker-cat {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 6px 0 4px;
  padding: 0 2px;
}
.emoji-picker-cat:first-child { margin-top: 0; }
.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.emoji-picker-btn {
  background: none;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.3em;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, border-color 0.1s;
}
.emoji-picker-btn:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
}
.emoji-picker-btn.selected {
  background: var(--color-primary-light, #e0f2fe);
  border-color: var(--color-primary);
}

/* Dark mode emoji picker */
html.dark .emoji-picker-popup {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
html.dark .emoji-picker-btn:hover {
  background: rgba(255,255,255,0.08);
}
html.dark .emoji-picker-btn.selected {
  background: rgba(59,130,246,0.15);
}

/* =============================================================
   STATISTIKEN — TIME SERIES CHART
   ============================================================= */
.stats-chart-container {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  overflow: hidden;
}
.stats-chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}
.stats-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.stats-chart-legend-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.stats-chart-legend-btn:hover {
  border-color: var(--legend-color);
  color: var(--color-text);
}
.stats-chart-legend-btn.active {
  background: var(--legend-color);
  border-color: var(--legend-color);
  color: #fff;
}
.stats-chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--legend-color);
  flex-shrink: 0;
}
.stats-chart-legend-btn.active .stats-chart-legend-dot {
  background: rgba(255,255,255,0.8);
}
.stats-chart-options {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.stats-chart-interval {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}
.stats-chart-interval-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  border-right: 1px solid var(--color-border);
}
.stats-chart-interval-btn:last-child { border-right: none; }
.stats-chart-interval-btn:hover { background: var(--color-surface-2); color: var(--color-text); }
.stats-chart-interval-btn.active {
  background: var(--color-primary);
  color: white;
}
.stats-chart-comparison-select {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  max-width: 160px;
}
.stats-chart-canvas-wrap {
  position: relative;
  padding: var(--space-4) var(--space-4) var(--space-3);
}
.stats-chart-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 400px;
}
.stats-chart-tooltip {
  display: none;
  position: absolute;
  z-index: 100;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  box-shadow: var(--shadow-md);
  font-size: 12px;
  line-height: 1.6;
  pointer-events: none;
  min-width: 160px;
  white-space: nowrap;
}
.stats-chart-tooltip-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--color-text);
}
.stats-chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
}
.stats-chart-tooltip-row strong {
  color: var(--color-text);
  margin-left: auto;
  padding-left: 12px;
}
.stats-chart-tooltip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.stats-chart-tooltip-divider {
  height: 1px;
  background: var(--color-border);
  margin: 6px 0;
}

/* --- Dark mode chart --- */
html.dark .stats-chart-container {
  background: #1a1a1a;
  border-color: #404040;
}
html.dark .stats-chart-controls {
  border-bottom-color: #404040;
}
html.dark .stats-chart-legend-btn {
  background: #262626;
  border-color: #404040;
  color: #a0a0a0;
}
html.dark .stats-chart-legend-btn:hover {
  color: #e5e5e5;
}
html.dark .stats-chart-legend-btn.active {
  color: #fff;
}
html.dark .stats-chart-interval-btn {
  background: #262626;
  color: #a0a0a0;
  border-color: #404040;
}
html.dark .stats-chart-interval-btn:hover {
  background: #333;
  color: #e5e5e5;
}
html.dark .stats-chart-interval-btn.active {
  background: var(--color-primary);
  color: white;
}
html.dark .stats-chart-comparison-select {
  background: #262626;
  color: #a0a0a0;
  border-color: #404040;
}
html.dark .stats-chart-tooltip {
  background: #262626;
  border-color: #404040;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
html.dark .stats-chart-tooltip-title { color: #e5e5e5; }
html.dark .stats-chart-tooltip-row { color: #a0a0a0; }
html.dark .stats-chart-tooltip-row strong { color: #e5e5e5; }
html.dark .stats-chart-tooltip-divider { background: #404040; }

/* Responsive chart */
@media (max-width: 768px) {
  .stats-chart-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .stats-chart-options {
    flex-wrap: wrap;
  }
  .stats-chart-canvas-wrap canvas {
    height: 280px;
  }
  #tab-stats .manager-content {
    padding: var(--space-4) var(--space-3);
  }
  .stats-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
  }
  .stats-toolbar-group--resource,
  .stats-toolbar-group--period {
    flex: 1 1 auto;
    width: 100%;
  }
  .stats-custom-range {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .stats-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================
   CUSTOMER AUTOCOMPLETE — Modal Name Field
   ============================================================= */
.customer-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  max-height: 220px;
  overflow-y: auto;
}
.customer-autocomplete-item {
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.1s;
}
.customer-autocomplete-item:last-child {
  border-bottom: none;
}
.customer-autocomplete-item:hover,
.customer-autocomplete-item.active {
  background: var(--color-primary-light, rgba(37,99,235,0.08));
}
.customer-autocomplete-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.customer-autocomplete-detail {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 1px;
}

/* =============================================================
   PLAYER NAMES ACCORDION — Modal
   ============================================================= */
.player-names-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  width: 100%;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.player-names-toggle:hover {
  background: var(--color-bg-hover, rgba(0,0,0,0.03));
  border-color: var(--color-border-dark, #ccc);
}
.player-names-toggle-icon {
  font-size: 10px;
  transition: transform 0.2s;
  display: inline-block;
}
.player-names-toggle.open .player-names-toggle-icon {
  transform: rotate(90deg);
}

/* =============================================================
   MODAL HEADER — Status Dropdown + Layout
   ============================================================= */
.modal-header-right {
  grid-area: close;
  display: flex;
  align-items: flex-start;
  justify-self: end;
  align-self: start;
  flex: 0 0 auto;
  margin-right: 0;
}
.modal-header-status {
  grid-area: status;
  display: flex;
  align-items: center;
  justify-self: end;
  min-width: 0;
}
.modal-header-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
}
.modal-header-status .form-select-sm {
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  padding-right: var(--space-6);
  height: 36px;
  width: 176px;
  max-width: 100%;
  min-width: 140px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  background-color: var(--color-bg-subtle, #f5f5f5);
  cursor: pointer;
}
.modal-header-status-help {
  max-width: 220px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--color-text-muted);
  text-align: right;
}
.modal-duration-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-subtle, rgba(0,0,0,0.04));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  margin-bottom: var(--space-1);
}
@media (max-width: 900px) {
  .modal-header-top {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main close"
      "resource close"
      "status status";
  }
  .modal-header-main {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .modal-header-status {
    justify-self: start;
  }
  .modal-header-status-stack {
    align-items: flex-start;
  }
  .modal-header-status-help {
    text-align: left;
  }
}

/* =============================================================
   MOBILE FOUNDATION (Phase 0b)
   ============================================================= */

/* Neutralise sticky-hover on touch devices */
@media (hover: none) {
  .btn:hover,
  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-danger:hover,
  .icon-btn:hover,
  .nav-tab:hover,
  .sidebar-nav-item:hover,
  .dropdown-item:hover,
  .list-item:hover {
    background-color: unset;
    color: unset;
    opacity: unset;
  }
}

/* Prevent iOS auto-zoom on form controls (font-size < 16px triggers zoom) */
@media (max-width: 1024px) {
  input,
  select,
  textarea {
    font-size: max(16px, 1em);
  }
}

/* Allow-List Utility Classes (Phase 1) */
html[data-bt-viewport="mobile"]  .bt-mobile-hidden  { display: none !important; }
html[data-bt-viewport="tablet"]  .bt-tablet-hidden  { display: none !important; }
html[data-bt-viewport="mobile"]  .bt-tablet-hidden  { display: none !important; }

/* Gated-Access Modal */
.bt-gated-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9900;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  padding-bottom: calc(var(--space-4) + var(--bt-safe-area-bottom));
}
.bt-gated-modal-overlay[hidden] { display: none !important; }

.bt-gated-modal {
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 340px;
  width: 100%;
  padding: var(--space-8) var(--space-6) var(--space-6);
  text-align: center;
  position: relative;
}

.bt-gated-modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 32px;
  height: 32px;
  border: none;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}
.bt-gated-modal-close:hover { background: var(--color-surface-offset); }

.bt-gated-modal-icon {
  width: 56px;
  height: 56px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  color: var(--color-text-muted);
}

.bt-gated-modal h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-2);
}

.bt-gated-modal p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0 0 var(--space-6);
}

.bt-gated-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--bt-touch-target);
  padding: 0 var(--space-6);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  width: 100%;
}
.bt-gated-modal-btn:hover { background: var(--color-primary-hover); }

/* Off-Canvas Navigation (Phase 2) */

/* Mobile-only utility (inverse of bt-mobile-hidden) */
.bt-mobile-only { display: none !important; }
html[data-bt-viewport="mobile"] .bt-mobile-only { display: flex !important; }

/* Mobile top-bar strip (sits between topbar and main content on mobile) */
.bt-mobile-bar {
  display: none;
  align-items: center;
  gap: var(--space-3);
  height: 48px;
  padding: 0 var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 200;
}
html[data-bt-viewport="mobile"] .bt-mobile-bar { display: flex; }

.bt-mobile-hamburger {
  width: var(--bt-touch-target);
  height: var(--bt-touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text);
  flex-shrink: 0;
}
.bt-mobile-hamburger:hover { background: var(--color-surface-2); }

.bt-mobile-bar-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* Off-Canvas Panel */
.bt-mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background var(--transition);
}
.bt-nav-open .bt-mobile-nav-backdrop {
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.bt-mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  z-index: 1010;
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition);
  padding-top: var(--bt-safe-area-top);
  padding-bottom: var(--bt-safe-area-bottom);
  will-change: transform;
  overscroll-behavior: contain;
}
.bt-nav-open .bt-mobile-nav { transform: translateX(0); }

.bt-mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.bt-mobile-nav-brand {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
}

.bt-mobile-nav-close {
  width: var(--bt-touch-target);
  height: var(--bt-touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text-muted);
}
.bt-mobile-nav-close:hover { background: var(--color-surface-2); }

.bt-mobile-nav-links {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) 0;
}

.bt-mobile-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--bt-touch-target);
  padding: 0 var(--space-4);
  border: none;
  background: transparent;
  text-align: left;
  font-size: var(--text-base);
  color: var(--color-text);
  cursor: pointer;
  border-radius: 0;
}
.bt-mobile-nav-link:hover { background: var(--color-surface-2); }
.bt-mobile-nav-link.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 500;
}

.bt-mobile-nav-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) 0;
  flex-shrink: 0;
}

.bt-mobile-nav-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-2) var(--space-4);
}

/* =============================================================
   MOBILE PIN-SCREEN OPTIMIERUNG
   ============================================================= */
@media (max-width: 640px) {
  .lock-overlay {
    align-items: flex-start;
    overflow-y: auto;
    padding: 0 16px;
  }
  .lock-box {
    width: 100%;
    max-width: 340px;
    padding: 28px 20px;
    border-radius: 12px;
    margin-top: max(20px, calc(50dvh - 290px));
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
  }
  .pin-key {
    width: 100%;
    height: 60px;
    font-size: 22px;
  }
  .pin-pad {
    max-width: 280px;
    gap: 12px;
  }
}

/* =============================================================
   MOBILE TOPBAR KOMPRIMIERUNG
   ============================================================= */

/* Kompaktere Topbar auf Mobile: weniger Hoehe, Padding und Gap */
html[data-bt-viewport="mobile"] .topbar {
  height: 48px;
  padding: 0 var(--space-3);
  gap: var(--space-2);
}

/* Neue-Reservierung-Button: Nur Icon auf Mobile — verhindert Overflow auf kleinen Screens */
html[data-bt-viewport="mobile"] #newReservationBtn .btn-text-label,
.topbar.topbar-collapse-actions #newReservationBtn .btn-text-label {
  display: none;
}

/* Neue Reservierung bleibt auf Mobile im Menue, nicht als platzfressender Topbar-Button. */
html[data-bt-viewport="mobile"] #newReservationBtn {
  align-self: stretch;
  display: none !important;
  align-items: center;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
  min-width: 0;
}

/* Date-Nav: Padding reduzieren damit die Buttons groesser sein koennen */
html[data-bt-viewport="mobile"] .date-nav {
  padding: 2px;
}
/* Date-Nav-Buttons auf Mobile groesser fuer bessere Treffsicherheit */
html[data-bt-viewport="mobile"] .date-nav-btn {
  width: 40px;
  height: 40px;
}

/* Heute-Button und Tagesnotiz-Toggle: volle Topbar-Hoehe als Touch-Flaeche */
html[data-bt-viewport="mobile"] .topbar-today-btn,
html[data-bt-viewport="mobile"] .day-note-popover-toggle {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  font-size: var(--text-xs);
}

/* Location-Switcher und Ressourcen-Selector auf Mobile ausblenden —
   Location ist im Mobile-Bar sichtbar, Ressource wechseln via Hamburger-Menu */
html[data-bt-viewport="mobile"] .topbar-locations,
html[data-bt-viewport="mobile"] .topbar-resources,
html[data-bt-viewport="mobile"] .topbar-resources-compact {
  display: none !important;
}

/* MOBILE LIST-TOOLBAR */
@media (max-width: 640px) {
  .list-toolbar {
    flex-wrap: wrap;
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }
  .list-toolbar .search-wrapper {
    flex: 1 1 100%;
    min-width: 0;
  }
  /* Drei Dropdown-Filter auf eine Zeile bringen, Chips darunter */
  .list-toolbar .list-resource-filter { order: 1; flex: 1 1 0; min-width: 0; }
  .list-toolbar .list-range-filter    { order: 2; flex: 1 1 0; min-width: 0; }
  .list-toolbar .list-status-detail   { order: 3; flex: 1 1 0; min-width: 0; }
  .list-toolbar .filter-group         { order: 4; flex: 1 1 100%; }
  .list-toolbar .list-resource-filter-toggle,
  .list-toolbar .list-range-filter-select,
  .list-toolbar .list-status-detail .list-range-filter-select {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  .list-toolbar #listResourceFilterLabel {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .list-toolbar .list-resource-filter-label {
    display: none;
  }
  .list-toolbar .filter-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .list-toolbar .filter-group .filter-btn {
    flex-shrink: 0;
  }
  .customer-toolbar-actions {
    flex-wrap: wrap;
  }
  .customer-toolbar-actions .btn-text-label {
    display: none;
  }
  #customerExportCsv .btn-text-label,
  #customerExportXlsx .btn-text-label {
    display: inline;
  }
}

/* MOBILE TABELLEN */
@media (max-width: 640px) {
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .reservation-table th, .reservation-table td {
    padding: var(--space-2) var(--space-3);
    white-space: nowrap;
  }

  /* Tabellenzeilen: mind. 44px hoch fuer sichere Treffsicherheit */
  .reservation-table tbody td {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  /* Reservierungsliste: Ressource(2), Bahn(3), Leistung(6), Anlass(7), Kommentar(10), Aktion(11) ausblenden */
  /* Aktion-Spalte ist redundant: Tipp auf die Zeile oeffnet bereits die Tagesansicht */
  .reservation-table:not(.customer-table) tr > *:nth-child(2),
  .reservation-table:not(.customer-table) tr > *:nth-child(3),
  .reservation-table:not(.customer-table) tr > *:nth-child(6),
  .reservation-table:not(.customer-table) tr > *:nth-child(7),
  .reservation-table:not(.customer-table) tr > *:nth-child(10),
  .reservation-table:not(.customer-table) tr > *:nth-child(11) {
    display: none;
  }

  /* Kundentabelle: Firma(2), Pers.ges.(6), Erst(7), Letzt(8), Leitstg(9), Anlässe(10), Ressource(11), NL(12) */
  .customer-table tr > *:nth-child(2),
  .customer-table tr > *:nth-child(6),
  .customer-table tr > *:nth-child(7),
  .customer-table tr > *:nth-child(8),
  .customer-table tr > *:nth-child(9),
  .customer-table tr > *:nth-child(10),
  .customer-table tr > *:nth-child(11),
  .customer-table tr > *:nth-child(12) {
    display: none;
  }

  /* Spalten-Resize-Griffe auf Mobile ausblenden */
  .col-resize-handle {
    display: none;
  }

  /* Inputs mind. 16px damit iOS nicht hineinzoomt */
  .form-input, .form-select, .form-textarea,
  .search-input, .list-range-filter-select, .cust-col-filter {
    font-size: 1rem;
  }
  /* Spezifitaet von .phone-input-group .phone-country-code (0,2,0) ueberschreiben */
  .phone-input-group .phone-country-code {
    font-size: 1rem;
  }

  /* Eingabefelder und Toolbar-Selects mind. 44px hoch fuer bessere Treffsicherheit */
  .form-input, .form-select, .search-input {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .list-range-filter-select,
  .list-resource-filter-toggle {
    min-height: 44px;
  }

  /* Status-Chips: 44px fuer HIG-konforme Treffsicherheit */
  .filter-btn {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: var(--text-sm);
  }

  /* Icon-Buttons: 44px × 44px fuer HIG-konforme Treffsicherheit */
  .btn-icon {
    width: 44px;
    height: 44px;
  }

  /* Modal-Footer-Buttons: mind. 44px hoch fuer sichere Bedienung */
  .modal-footer .btn {
    min-height: 44px;
  }

  /* Topbar-Overflow-Menuepunkte: groesser fuer Mobile */
  .topbar-overflow-item {
    min-height: 44px;
  }

  /* Resize-Griffe auf Reservierungsblöcken: auf Mobile deaktivieren */
  .res-block .resize-handle-bottom,
  .res-block .resize-handle-right {
    pointer-events: none;
  }

  /* Checkboxen groesser und besser lesbar */
  .checkbox-input {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  .checkbox-label {
    font-size: var(--text-sm);
    gap: var(--space-2);
  }

  /* Kundentabelle Filterzeile: groesser als der Desktop-Standard (26px) */
  .customer-table-filter-control {
    height: 44px;
    font-size: 1rem;
    padding: 0 var(--space-2);
  }

  /* Kunden-Export-Buttons: mind. 44px fuer sichere Bedienung */
  .customer-toolbar-actions .btn {
    min-height: 44px;
  }
}

/* MOBILE: Footer ausblenden, Zeitachse kompakter */
html[data-bt-viewport="mobile"] .app-footer {
  display: none;
}
html[data-bt-viewport="mobile"] {
  --time-col-w: 48px;
  --lane-min-w: 80px;
  --row-height: 44px;
}

/* MOBILE: Modal vollbild mit fixem Header + Footer */
html[data-bt-viewport="mobile"] .modal-overlay {
  align-items: stretch;
  justify-content: stretch;
}
html[data-bt-viewport="mobile"] .modal {
  max-width: 100%;
  max-height: 100dvh;
  height: 100dvh;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
}
html[data-bt-viewport="mobile"] .modal-header {
  flex-shrink: 0;
}
html[data-bt-viewport="mobile"] .modal-body {
  flex: 1 1 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
html[data-bt-viewport="mobile"] .modal-footer {
  flex-shrink: 0;
  padding: var(--space-3) var(--space-4);
}

/* MOBILE: Drucken-Button verstecken (steht im Overflow-Menu zur Verfuegung) */
html[data-bt-viewport="mobile"] #printBtn {
  display: none;
}

/* MOBILE: Modal-Header und -Body kompakter */
html[data-bt-viewport="mobile"] .modal-header {
  padding: var(--space-3) var(--space-4);
  gap: var(--space-2);
}
html[data-bt-viewport="mobile"] .modal-body {
  padding: var(--space-4);
}

/* Sehr schmale Bildschirme (≤340px): Heute-Button ausblenden */
/* Spezifitaet muss die mobile-viewport-Regel (0,2,1) ueberbieten */
@media (max-width: 340px) {
  html[data-bt-viewport="mobile"] .topbar-today-btn {
    display: none;
  }
}

/* MOBILE: Tagesnotiz-Popover darf nicht breiter als Viewport sein */
html[data-bt-viewport="mobile"] .topbar-day-note-popover {
  min-width: min(92vw, 340px);
}

/* MOBILE: Mini-Kalender-Footer-Links groesser fuer bessere Treffsicherheit */
html[data-bt-viewport="mobile"] .mini-cal-today-btn {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

/* MOBILE: Toast nicht breiter als Viewport */
@media (max-width: 640px) {
  .toast {
    right: var(--space-4);
    left: var(--space-4);
    max-width: none;
  }
}
