/* ==========================================================================
   Eiger Restaurant Wengen - CSS Stylesheet
   Governed by CSS Variables with unified border-radius: var(--radius)
   ========================================================================== */

:root {
  --radius: 12px;
  
  --primary: #80022d;
  --primary-hover: #6b0024;
  --primary-light: #fdf0f3;
  
  --accent: #b86b35;
  --accent-hover: #9c5828;
  --accent-light: #fdf8f4;
  
  --bg: #f8f6f2;
  --surface: #ffffff;
  --surface-hover: #f1ede6;
  
  --text: #2d3748;
  --text-muted: #718096;
  --text-light: #a0aec0;
  
  --border: #e2e8f0;
  --border-focus: #80022d;
  
  --danger: #80022d;
  --danger-hover: #6b0024;
  --danger-light: #fdf0f3;
  
  --success: #38a169;
  --success-light: #f0fff4;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Cinzel', Georgia, serif;
}

/* Reset & Base Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Mobile viewport fit: disable browser text auto-inflation.
   Android (Samsung) font scaling enlarges text INSIDE the layout, which
   pushes content wider than the screen; iOS zooms the whole page instead,
   which is why the layout fits on iPhone but overflows on Android.
   text-size-adjust: 100% tells the browser our sizes are final. */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Safety net: nothing may ever create a horizontal side-scroll.
   overflow-x: clip (not hidden) — clip does not create a scroll
   container, so position:sticky headers keep working. */
html, body {
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Enforce var(--radius) on ALL interactive & container elements */
button,
input,
select,
textarea,
.btn,
.form-control,
.card,
.modal-card,
.rich-editor-container,
.badge,
.toast,
.overview-panel,
.calendar-day,
.tab-btn,
.mobile-bottom-nav,
.mobile-nav-item,
.auth-card,
.top-bar,
.user-add-box,
.ai-input-panel,
.ai-composer,
.ai-file-chip,
.data-table,
.res-card,
.meta-chip,
.rich-btn,
.accordion-section,
.date-bar {
  border-radius: var(--radius);
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

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

.btn-accent {
  background-color: var(--accent);
  color: #ffffff;
}

.btn-accent:hover {
  background-color: var(--accent-hover);
}

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

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

.btn-outline {
  background-color: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background-color: var(--surface-hover);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: var(--danger-hover);
}

.btn-outline-danger {
  background-color: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-outline-danger:hover {
  background-color: var(--danger-light);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* Form Controls */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 1rem;  /* >=16px prevents iOS Safari auto-zoom on focus */
  font-family: inherit;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(158, 42, 43, 0.15);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row > .form-group {
  flex: 1;
}

.align-end {
  align-items: flex-end;
}

.flex-1 {
  flex: 1;
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

/* Auth View */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(158, 42, 43, 0.05) 0%, rgba(184, 107, 53, 0.08) 100%), var(--bg);
}

/* Password input wrapper with eye toggle */
.pw-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-input-wrap .form-control {
  padding-right: 2.5rem;
}

.pw-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: color 0.15s;
}

.pw-toggle:hover {
  color: var(--text);
}

.pw-toggle:active {
  color: var(--primary);
}

.pw-mismatch {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.login-error {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-img {
  height: 4rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  color: var(--primary);
  text-align: center;
}

.auth-form h2 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.auth-toggle-text {
  text-align: center;
  font-size: 0.875rem;
  margin-top: 1.25rem;
  color: var(--text-muted);
}

.auth-toggle-text a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-toggle-text a:hover {
  text-decoration: underline;
}

/* App Layout & Top Bar */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  padding: 0.8rem 1.5rem;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-img {
  height: 2.4rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Language Selection Popup */
.lang-switcher {
  position: relative;
}

.lang-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  transition: background 0.2s;
}

.lang-dropdown-toggle:hover {
  background: var(--surface-hover);
}

.lang-flag {
  font-size: 1.1rem;
  line-height: 1;
}

.lang-caret {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Language modal — 3-column grid, fits every screen */
.language-modal-card {
  max-width: 560px;
}

.language-modal-body {
  padding: 0.9rem;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.language-option:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

.language-option.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.language-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Code chip for regional languages without a universally
   rendering flag emoji (renders reliably on older Samsung devices) */
.lang-code-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 1.5rem;
  height: 1rem;
  padding: 0 0.25rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--accent-light);
  color: var(--text);
  border-radius: var(--radius);
}

/* Icon-only Buttons */
.btn-icon {
  padding: 0.5rem;
  width: 2.4rem;
  height: 2.4rem;
  flex-shrink: 0;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.date-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--surface);
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 100%;
  box-sizing: border-box;
}

.date-picker-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.date-picker-group label {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.date-input-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.date-picker-group input[type="date"] {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.date-input-row .btn {
  flex-shrink: 0;
}

.day-stats-summary {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.day-stats-summary strong {
  color: var(--primary);
}

/* Day Overview Grid */
.day-overview-container {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  font-family: var(--font-heading);
}

/* Day overview: 3 equal columns — table reservations / group reservations / table timeline */
.panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.overview-panel,
.table-timeline-panel {
  min-width: 0;
}

.overview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.panel-header h3 {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.panel-header h3 .wd-icon {
  width: 1.1em;
  height: 1.1em;
}

/* ===== Table timeline (occupancy by table, current date) ===== */
.tt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.tt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tt-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: var(--radius);
}

.tt-dot-free { background: #2d7a46; }
.tt-dot-one {
  background: #e8821e;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.55) 0 2px, transparent 2px 6px);
}
.tt-dot-two-plus {
  background: var(--primary);
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.5) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.5) 0 2px, transparent 2px 6px);
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tt-block.is-clickable {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tt-block.is-clickable:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.tt-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
  background: var(--surface);
}

.tt-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.tt-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.tt-block.tt-free .tt-num { background: #2d7a46; }
.tt-block.tt-one .tt-num {
  background: #e8821e;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.55) 0 2px, transparent 2px 5px);
}
.tt-block.tt-two-plus .tt-num {
  background: var(--primary);
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.5) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.5) 0 2px, transparent 2px 5px);
}

.tt-block.tt-free { border-left: 4px solid #2d7a46; }
.tt-block.tt-one { border-left: 4px solid #e8821e; }
.tt-block.tt-two-plus { border-left: 4px solid var(--primary); }

.tt-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.88rem;
  padding: 0.12rem 0;
  flex-wrap: wrap;
}

.tt-row-free {
  color: var(--text-muted);
  font-style: italic;
}

.tt-time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tt-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tt-people {
  color: var(--text-muted);
  white-space: nowrap;
  font-size: 0.82rem;
}

.tt-type-chip {
  display: inline-flex;
  align-items: center;
  padding: 0 0.35rem;
  border-radius: var(--radius);
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--border);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-accent {
  background: var(--accent-light);
  color: var(--accent);
}

/* Cards List */
.cards-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.95rem;
}

.res-card {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1rem;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.res-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* === ARRIVAL (check-in) buttons & arrived card state === */
.arrival-btn {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: var(--radius);
  background: var(--success);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

.arrival-btn:hover {
  filter: brightness(1.07);
}

.arrival-btn:active {
  transform: scale(0.99);
}

/* Red "not arrived" (revert) button — replaces the green one after check-in */
.arrival-btn-revert {
  background: var(--danger);
}

/* Small "Angekommen" switcher in the panel header */
.arrival-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.arrival-toggle:hover {
  border-color: var(--success);
  color: var(--success);
}

.arrival-toggle.active {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

.arrival-toggle-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.35;
  flex-shrink: 0;
}

.arrival-toggle.active .arrival-toggle-indicator {
  opacity: 1;
}

/* Divider label above arrived cards when the switcher is ON */
.arrived-section-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--success);
}

.arrived-section-label .wd-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Arrived state: the whole card turns green */
.res-card.res-card-arrived {
  background: var(--success-light);
  border-color: var(--success);
}

.res-card.res-card-arrived .res-card-title {
  color: var(--success);
}

/* Keep meta chips readable on the green card */
.res-card.res-card-arrived .meta-chip {
  border-color: rgba(56, 161, 105, 0.35);
}

.res-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.res-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.res-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

/* Accordion card */
.res-card-preview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}



.res-card-preview-info {
  flex: 1;
  min-width: 0;
}



.res-card-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
  border-top: 1px dashed var(--border);
}

.accordion-card.expanded .res-card-details {
  max-height: 500px;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.card-detail-row {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.res-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.meta-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  font-weight: 600;
}

.res-card-body {
  font-size: 0.9rem;
  color: var(--text);
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.card-field {
  margin-bottom: 0.35rem;
}

.card-field-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  display: block;
}

.card-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  transition: color 0.2s;
}

.card-delete-btn:hover {
  color: var(--danger);
}

/* Rich Text Editor */
.rich-editor-container {
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.rich-text-wrapper {
  display: flex;
  flex-direction: column;
}

.rich-text-toolbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 0.5rem;
  display: flex;
  gap: 0.35rem;
}

.rich-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
}

.rich-btn:hover {
  background: var(--surface-hover);
}

.rich-text-content {
  min-height: 70px;
  max-height: 150px;
  overflow-y: auto;
  padding: 0.65rem 0.9rem;
  outline: none;
  font-size: 0.95rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

/* List view modal sits below edit modals so popups appear on top */
#list-view-modal {
  z-index: 999;
}

/* Table picker modal must sit above reservation/group modals */
#table-picker-modal {
  z-index: 1100;
}

.modal-card {
  background: var(--surface);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  max-height: 90dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: modalFadeIn 0.2s ease-out;
}

/* Direct form/tab-content children must also be flex columns so the
   max-height cap on .modal-card is respected and only .modal-body
   scrolls internally — without this, long modals (e.g. Gruppe with
   tabs + many accordion sections) overflow past the card boundary
   instead of scrolling, visually stretching to the bottom of the screen. */
.modal-card > form,
.modal-card > .tab-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-lg {
  max-width: 780px; /* default for normal modals (reservation/group forms) */
}

.modal-sm {
  max-width: 400px;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.2rem;
  font-family: var(--font-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

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

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Tabs */
.tab-bar {
  display: flex;
  background: var(--bg);
  padding: 0.35rem 1.25rem 0 1.25rem;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
}

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

/* AI Dropzone & Section */
.ai-input-panel {
  background: var(--bg);
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-panel-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.ai-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.ai-panel-header p {
  margin: 0;
  max-width: 420px;
  color: var(--text-muted);
}

/* Single composer field: textarea + attach icon + optional file chip */
.ai-composer {
  position: relative;
  border: 2px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s;
}
.ai-composer:focus-within {
  border-color: var(--accent);
}

.ai-composer-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 0.9rem 1rem 3rem;
  border: none;
  background: transparent;
  color: var(--text);
  display: block;
}
.ai-composer-textarea:focus {
  outline: none;
}

.ai-composer-toolbar {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ai-attach-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ai-attach-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.ai-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem 0.4rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  max-width: 100%;
  overflow: hidden;
}
.ai-file-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-file-remove {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  flex-shrink: 0;
}
.ai-file-remove:hover {
  color: var(--danger);
}

.ai-analyze-btn {
  width: 100%;
}

/* Drag & drop visual feedback */
.ai-composer.drag-active {
  border-color: var(--primary);
  background: var(--bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem;
  margin: 1rem 0 1.5rem;
}

/* AI text input section */


.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Calendar Grid */
.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  margin-bottom: 1rem;
}

/* Month title must shrink + ellipsize instead of pushing the nav buttons
   off-screen (fix for narrow Samsung tablet/phone viewports) */
#cal-month-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

.calendar-day {
  background: var(--surface);
  border: 1px solid var(--border);
  min-height: 65px;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-day:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

.calendar-day.other-month {
  opacity: 0.4;
  background: var(--bg);
}

.calendar-day.selected {
  border: 2px solid var(--primary);
  background: var(--primary-light);
}

.calendar-day.is-today {
  font-weight: bold;
}

.day-number {
  font-size: 0.85rem;
  font-weight: 600;
}

.day-counts {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.count-res,
.count-grp {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.count-res {
  color: var(--primary);
}

.count-grp {
  color: var(--accent);
}

@media (max-width: 480px) {
  .day-counts { font-size: 0.58rem; gap: 0.05rem; }
  .calendar-day { min-height: 58px; padding: 0.25rem; }
  /* Arrow-only month navigation on narrow screens (title/aria-label kept) */
  .calendar-controls .cal-nav-label { display: none; }
  /* Language popup: 3 columns must fit ~320-400px viewports */
  .language-grid { gap: 0.35rem; }
  .language-option { padding: 0.45rem; font-size: 0.74rem; gap: 0.35rem; }
  .language-modal-body { padding: 0.7rem; }
}

/* User Admin Table */
.user-add-box {
  background: var(--bg);
  padding: 1rem;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.user-add-box h4 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

/* Fixed column widths (px, via <colgroup> in the HTML) for the
   reservations list table. table-layout:fixed + an explicit (not 100%)
   table width means every column gets EXACTLY the width it needs for
   Datum/Zeit/Typ/Anzahl to stay on one line — no wrapping, no truncation.
   Name + Kontaktinformationen (the variable-length columns) get the
   most room and may wrap onto a 2nd line if a name/email is very long.
   .list-table-wrap keeps overflow-x:auto as a safety net on narrow
   viewports (the table is hidden below 768px anyway, replaced by cards). */
.list-table {
  table-layout: fixed;
  width: auto;
  min-width: 905px;
}
/* Data cells (td) never wrap — Datum/Zeit/Typ/Anzahl always fit on
   one line. Headers (th) are allowed to wrap onto 2 lines (e.g. "Anzahl
   Personen") since that costs only header height, never data legibility. */
.list-table td:nth-child(1),
.list-table td:nth-child(2),
.list-table td:nth-child(4),
.list-table td:nth-child(5) {
  white-space: nowrap;
}
.list-table td:nth-child(3), .list-table td:nth-child(6) {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.list-type-badge { white-space: nowrap; }

.data-table th,
.data-table td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table th {
  background: var(--bg);
  font-weight: 600;
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 320px;
}

.toast {
  padding: 0.8rem 1.2rem;
  background: var(--text);
  color: #ffffff;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease-out;
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--danger);
}

.toast-info {
  background: var(--primary);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Bottom Navigation Bar (Hidden on Desktop) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  z-index: 500;
  align-items: stretch;
  padding: 0;
  margin: 0;
  border-radius: 0;
}

.mobile-nav-item {
  display: flex;
  flex: 1 1 25%;
  max-width: 25%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.4rem 0.25rem;
  cursor: pointer;
  min-width: 0;
}

.mobile-nav-item:last-child {
  border-right: none;
}

.mobile-nav-item .nav-icon {
  font-size: 1.25rem;
  margin-bottom: 0.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.25rem;
}

.mobile-nav-item .nav-icon-plus {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.25rem;
}

.mobile-nav-item .nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
  display: flex;
  align-items: center;
  height: 1.2rem;
}

.mobile-nav-item:active {
  color: var(--primary);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .main-content {
    padding-bottom: 80px;
  }
}

@media (max-width: 992px) {
  .panels-grid {
    grid-template-columns: 1fr 1fr;
  }

  .table-timeline-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .panels-grid {
    grid-template-columns: 1fr;
  }

  .top-bar {
    padding: 0.6rem 0.8rem;
    margin: 0;
  }

  .logo-img {
    height: 2rem;
    max-width: 100%;
    object-fit: contain;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .form-row > .form-group { width: 100%; }

  .toast-container {
    bottom: 75px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* Stack stats vertically on mobile, side-by-side on desktop */
@media (max-width: 768px) {
  .week-stats {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }
}

/* ==========================================================================
   NEW: ACCORDION STYLES
   ========================================================================== */
.accordion-section {
  margin-top: 1rem;
  border: 1px solid var(--border);
  overflow: hidden;
}

.accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.2s;
}





.accordion-content {
  display: none;
  padding: 1rem;
  background: var(--surface);
}

.accordion-section.open .accordion-content {
  display: block;
}

/* ==========================================================================
   NEW: MODAL BODY SCROLL FIX
   ========================================================================== */
.modal-body-scroll {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-body-scroll::-webkit-scrollbar {
  width: 6px;
}

.modal-body-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* ==========================================================================
   NEW: DATE NAV ARROWS
   ========================================================================== */
.date-nav-btn {
  padding: 0.45rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

/* ==========================================================================
   NEW: LIST VIEW STYLES
   ========================================================================== */
.list-filters {
  background: var(--bg);
  padding: 1rem;
  margin-bottom: 1rem;
}

.list-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.list-pdf-btn {
  margin-left: auto;
  color: var(--primary);
  border-color: var(--primary);
}

.list-pdf-btn:hover {
  background: var(--primary);
  color: #fff;
}

.list-results .data-table {
  width: 100%;
  font-size: 0.85rem;
  table-layout: fixed;
}

.list-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.list-results .data-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}

/* Belt-and-suspenders: pin the Aktionen (edit/delete) column to the
   right edge so it's ALWAYS visible even if the table needs horizontal
   scroll on a narrower browser window — it can never "disappear" again. */
.list-table th:last-child,
.list-table td:last-child {
  position: sticky;
  right: 0;
  background: var(--surface);
  box-shadow: -6px 0 6px -6px rgba(0, 0, 0, 0.15);
}
.list-table th:last-child { z-index: 3; }
.list-table td:last-child { z-index: 1; }

.list-type-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-contact-cell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.list-actions-col .card-actions {
  padding-top: 0.1rem;
}

.list-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
}

.list-contact-link:hover {
  color: var(--primary);
}

.list-contact-link .contact-icon {
  width: 0.95em;
  height: 0.95em;
  flex-shrink: 0;
  opacity: 0.75;
}

.list-type-badge.reservation {
  background: var(--primary-light);
  color: var(--primary);
}

.list-type-badge.group {
  background: var(--accent-light);
  color: var(--accent);
}

.list-action-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

/* ==========================================================================
   NEW: PERMISSIONS BOX
   ========================================================================== */
.permissions-box {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
}

.permissions-box h4 {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.user-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.perm-chip {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

/* ==========================================================================
   NEW: CARD EDIT BUTTON
   ========================================================================== */
.card-edit-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.card-edit-btn:hover {
  color: var(--primary);
}

.card-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

/* ==========================================================================
   NEW: MOBILE NAV 4 ITEMS
   ========================================================================== */
.mobile-nav-item {
  flex: 1 1 25%;
  max-width: 25%;
}

/* ==========================================================================
   NEW: ADDITIONAL TRANSLATION KEYS
   ========================================================================== */

/* === CUSTOM DATE-PICKER (week-strip style) === */
.custom-date-field { position: relative; display: flex; align-items: center; width: 100%; }
.custom-date-field .date-picker-display { padding-right: 2.25rem; cursor: pointer; background: var(--surface); }
.custom-date-field .date-picker-icon { position: absolute; right: 0.6rem; pointer-events: none; color: var(--text-muted); flex-shrink: 0; }
.date-picker-dropdown { position: absolute; z-index: 1100; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.15); padding: 0.75rem; width: min(400px, 94vw); }
.date-picker-dropdown.hidden { display: none; }
.date-picker-header { display: flex; align-items: center; justify-content: space-between; gap: 0.35rem; min-width: 0; margin-bottom: 0.6rem; }
.date-picker-nav-btn { background: transparent; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.25rem 0.6rem; cursor: pointer; color: var(--text); font-size: 0.9rem; flex-shrink: 0; }
.date-picker-nav-btn:hover { background: var(--accent); border-color: var(--accent); color: white; }
.date-picker-title { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 0.9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }

.date-picker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  text-align: center;
  padding: 0.5rem 0.15rem;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s;
  min-width: 0;
}
.dp-day:hover { background: var(--accent-light); border-color: var(--accent); }
.dp-day-name { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); text-transform: capitalize; }
.dp-day-num { font-size: 1.1rem; font-weight: 700; color: var(--text); line-height: 1; }
.dp-day-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border); }

.dp-day.is-today .dp-day-num { color: var(--accent); }
.dp-day.is-today .dp-day-dot { background: var(--accent); }

.dp-day.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}
.dp-day.selected .dp-day-num,
.dp-day.selected .dp-day-name {
  color: var(--accent);
  font-weight: 700;
}
.dp-day.selected .dp-day-dot { background: var(--accent); }

.date-picker-footer { display: flex; gap: 0.5rem; margin-top: 0.6rem; justify-content: flex-end; }
.date-picker-footer-btn { background: transparent; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.3rem 0.8rem; cursor: pointer; font-size: 0.8rem; color: var(--text); }
.date-picker-footer-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.date-picker-footer-btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.date-picker-footer-btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

@media (max-width: 480px) {
  .dp-day-num { font-size: 1rem; }
  .dp-day-name { font-size: 0.62rem; }
  .date-picker-grid { gap: 3px; }
}

/* === MOBILE NAV DYNAMIC WIDTH OVERRIDE === */
.mobile-nav-item { flex: 1 1 0; max-width: none; width: 100%; }
.mobile-bottom-nav { justify-content: stretch; }
.mobile-bottom-nav[data-count="1"] .mobile-nav-item { flex: 1 1 100%; max-width: 60%; margin: 0 auto; }
.mobile-bottom-nav[data-count="2"] .mobile-nav-item { flex: 1 1 50%; max-width: 50%; }
.mobile-bottom-nav[data-count="3"] .mobile-nav-item { flex: 1 1 33.33%; max-width: 33.33%; }
.mobile-bottom-nav[data-count="4"] .mobile-nav-item { flex: 1 1 25%; max-width: 25%; }
.mobile-bottom-nav[data-count="5"] .mobile-nav-item { flex: 1 1 20%; max-width: 20%; }
.mobile-bottom-nav[data-count="6"] .mobile-nav-item { flex: 1 1 16.66%; max-width: 16.66%; }

/* === WIDER MODALS ON PC === */
.modal-card { width: min(690px, 95vw); }
.modal-card.modal-lg { width: min(1035px, 95vw); }

/* #list-view-modal needs to be wider than the generic .modal-lg cap
   (780px, from the rule above) to fit the full list table (905px
   min-width incl. the Aktionen column) without horizontal scrolling.
   ID selector (0,1,1,0 specificity) overrides the class-only max-width
   cap. Other modal-lg modals (calendar/group/users) keep the 780px cap. */
#list-view-modal .modal-card.modal-lg { max-width: 1035px; }

/* === MOBILE LIST VIEW RESPONSIVE === */
@media (max-width: 768px) {
  .list-filters .form-row { flex-direction: row; gap: 0.5rem; }
  .list-filters .form-row > .form-group { flex: 1; min-width: 0; }
  .list-filters .form-row.list-filter-dates { flex-direction: column; gap: 0; }
  .list-filters .form-row.list-filter-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .list-filters .form-row.list-filter-actions .btn { flex: 1 1 calc(50% - 0.25rem); margin-left: 0; }
  .list-filters .form-row.list-filter-actions .list-pdf-btn { flex: 1 1 100%; background: var(--primary); color: #fff; border-color: var(--primary); }

  /* Mobile: hide table, show accordion cards */
  .list-table-wrapper { display: none; }
  .list-cards-mobile { display: flex; flex-direction: column; gap: 0.5rem; }
}
@media (min-width: 769px) {
  .list-cards-mobile { display: none; }
}
/* Print: always show table, hide cards */
@media print {
  .list-cards-mobile { display: none !important; }
  .list-table-wrapper { display: block !important; }
}
/* Print: always table layout */
@media print {
  .list-table thead { display: table-header-group !important; }
  .list-table tbody tr { display: table-row !important; }
  .list-table tbody td { display: table-cell !important; width: auto !important; }
  .list-table tbody td:before { display: none !important; }
  .list-table tbody td.list-actions-col { flex-direction: row; }
  .list-table tbody td.list-actions-col:before { display: none; }
}

@media (max-width: 992px) {
  .top-bar-actions { display: none !important; }
}

/* === USERS TABLE MOBILE === */
.users-cards-mobile { display: none !important; }

.user-card-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

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

.user-card-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.4rem;
}

.user-card-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.user-card-actions .list-action-btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.55rem;
}

@media (max-width: 768px) {
  /* users-table-desktop kept visible — responsive table handles mobile */
  /* users-cards-mobile disabled — using responsive table */
}

/* ==========================================================================
   WEEK BAR (replaces date-bar)
   ========================================================================== */
.week-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  gap: 0.5rem;
}

.week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
}

.week-arrow-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.week-arrow-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* Week-bar day-strip: 7 individual day cells (Mo-So), same visual
   language as the date-picker dropdown, always showing the full week */
.week-days-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
}
.week-day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.5rem 0.2rem;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: background 0.15s, border-color 0.15s;
  min-width: 0;
  height: 78px;
}
.week-day-cell:hover { background: var(--accent-light); border-color: var(--accent); }
.week-day-name { font-size: 0.72rem; font-weight: 500; color: var(--text-muted); text-transform: capitalize; }
.week-day-num { font-size: 1.15rem; font-weight: 700; color: var(--text); line-height: 1; }
.week-day-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border); }
.week-day-dot.active { background: var(--primary); }

/* Stats inside each day cell: reservations first, groups below */
/* Stats in a row with gap */
.week-day-stats {
  display: flex;
  flex-direction: row;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  margin-top: 0.15rem;
  min-height: 1.1rem;
}
.week-day-stats.is-empty {
  visibility: hidden;
}
.wd-stat {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.wd-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: middle;
  display: inline-block;
}
.wd-res { color: var(--text-muted); }
.wd-grp { color: var(--text-muted); }
.week-day-cell.selected .wd-stat { color: var(--primary); }
.week-day-cell.is-today .wd-stat { color: var(--accent); }

.week-day-cell.is-today .week-day-num { color: var(--accent); }
.week-day-cell.is-today .week-day-dot { background: var(--accent); }
.week-day-cell.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}
.week-day-cell.selected .week-day-num,
.week-day-cell.selected .week-day-name { color: var(--accent); font-weight: 700; }
.week-day-cell.selected .week-day-dot { background: var(--accent); }

.week-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  justify-content: center;
}
.week-stats strong {
  color: var(--primary);
}

.week-today-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem 0.8rem;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}
.week-today-btn:hover {
  background: var(--accent);
  color: var(--text);
}

/* Week bar mobile: single-day view (JS renders only 1 cell — see
   isMobileWeekView/renderWeekBar). Arrows shift by 1 day, not 1 week.
   The strip goes from a 7-col grid to 1 column so that single cell can
   be nicely sized instead of collapsing to the old 1/7-width slot. */
@media (max-width: 768px) {
  .week-nav { flex-wrap: nowrap; gap: 0.5rem; }
  .week-arrow-btn { width: 40px; height: 40px; flex-shrink: 0; font-size: 1rem; }
  .week-days-strip { grid-template-columns: 1fr; flex: 1 1 auto; width: auto; min-width: 0; }
  .week-day-cell { width: 100%; padding: 1rem 0.75rem; gap: 0.4rem; height: 90px; }
  .week-day-name { font-size: 0.9rem; }
  .week-day-num { font-size: 1.7rem; }
  .wd-stat { font-size: 1.05rem; }
}

@media (max-width: 480px) {
  .week-bar { padding: 0.75rem 0.4rem; }
  .week-arrow-btn { width: 36px; height: 36px; font-size: 0.85rem; flex-shrink: 0; }
  .week-days-strip { gap: 0.2rem; }
  .week-day-num { font-size: 1.5rem; }
  .week-day-name { font-size: 0.8rem; }
  .wd-stat { font-size: 0.95rem; gap: 0.2rem; }
  .week-day-stats { gap: 0.45rem; }
  .week-day-cell { padding: 0.75rem 0.6rem; gap: 0.3rem; height: 80px; }
  .week-stats { font-size: 0.75rem; gap: 0.25rem; }
}


/* Contact links (tel:/mailto:) inside card detail rows */
.card-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
}
.card-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}


/* Full-width 50/50 edit/delete buttons — shown only on mobile, always
   visible at the bottom of the card regardless of accordion state */
.card-actions-mobile {
  display: none;
}

/* === MOBILE CARD ACTIONS === */
@media (max-width: 768px) {
  /* Hide the small pencil/x icon buttons on mobile — replaced by full-width footer buttons */
  .card-actions {
    display: none;
  }
  .res-card-title-row {
    font-size: 1rem;
  }

  .card-actions-mobile {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
  }
  .card-mobile-btn {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }
  .card-mobile-btn.edit-btn:hover,
  .card-mobile-btn.edit-btn:active {
    border-color: var(--primary);
    color: var(--primary);
  }
  .card-mobile-btn.delete-btn {
    color: var(--danger);
    border-color: var(--danger-light);
  }
  .card-mobile-btn.delete-btn:hover,
  .card-mobile-btn.delete-btn:active {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
  }
}

/* === MOBILE LOGIN: fixed full height, no scroll === */
@media (max-width: 768px) {
  body:has(#auth-view:not(.hidden)) { overflow: hidden; height: 100dvh; }
  .auth-wrapper {
    height: 100dvh;
    min-height: 100dvh;
    padding: 0.5rem;
    overflow: hidden;
  }
  .auth-card {
    padding: 1.5rem 1.25rem;
    max-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .auth-logo-img { height: 3rem; margin-bottom: 0.5rem; }
  .brand-title { font-size: 1.3rem; }
  .auth-form h2 { font-size: 1.1rem; margin-bottom: 1rem; }
  .auth-header { margin-bottom: 1.25rem; }
  .auth-toggle-text { margin-top: 1rem; font-size: 0.8rem; }
}

/* === MOBILE MODAL: centered, capped at 90% height, scrollable body === */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 5vh 0.75rem;
    align-items: center;
  }
  .modal-card {
    max-height: 90vh;
    max-height: 90dvh;
    width: 100%;
    margin: 0 auto;
  }
  .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}


/* === GCP Setup Card === */
.gcp-setup-card {
  padding: 24px;
  text-align: center;
  border: 2px dashed var(--border, #ddd);
  border-radius: 12px;
  margin-top: 16px;
  background: var(--card, #fff);
}
.gcp-setup-card .gcp-setup-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.gcp-setup-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--foreground, #333);
}
.gcp-setup-card p {
  font-size: 0.9rem;
  color: var(--muted, #666);
  margin-bottom: 16px;
}
.gcp-setup-steps {
  text-align: left;
  max-width: 500px;
  margin: 0 auto 20px;
}
.gcp-setup-steps ol {
  padding-left: 20px;
  font-size: 0.85rem;
  color: var(--muted, #666);
  line-height: 1.8;
}
.gcp-setup-status {
  margin-top: 12px;
  font-size: 0.85rem;
}

/* === USERS TABLE — RESPONSIVE === */

/* Desktop: show only icon, hide label */
.user-action-edit .action-label,
.user-action-delete .action-label {
  display: none;
}

@media (max-width: 768px) {
  .users-table-container .data-table thead {
    display: none;
  }
  .users-table-container .data-table,
  .users-table-container .data-table tbody,
  .users-table-container .data-table tr,
  .users-table-container .data-table td {
    display: block;
    width: 100%;
  }
  .users-table-container .data-table tr {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
  }
  .users-table-container .data-table td {
    padding: 0.35rem 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .users-table-container .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    min-width: 70px;
    flex-shrink: 0;
  }
  /* Actions: full-width buttons below info */
  .users-table-container .data-table td.list-actions-cell {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
  }
  .users-table-container .data-table td.list-actions-cell::before {
    display: none;
  }
  .users-table-container .card-actions {
    display: flex;
    gap: 0.5rem;
  }
  /* Mobile: show icon + text label */
  .user-action-edit .action-label,
  .user-action-delete .action-label {
    display: inline;
  }
  .user-action-edit,
  .user-action-delete {
    flex: 1 1 0;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  .user-action-edit .action-icon,
  .user-action-delete .action-icon {
    margin-right: 0.25rem;
  }
  .users-table-container .user-permissions {
    flex-wrap: wrap;
  }
}

/* === MOBILE MODAL SCROLL FIX === */
@media (max-width: 768px) {
  .modal-body-scroll {
    max-height: none;
  }
}

/* === TABLE PICKER (visual floor plan) === */

.table-picker-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.table-picker-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.table-picker-btn .placeholder {
  color: var(--text-muted, #999);
}

/* Legend */
.table-picker-legend {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text);
}

.legend-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.legend-free {
  background-color: #2d7a46;
}

.legend-occupied {
  background-color: var(--primary);
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.5) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.5) 0 2px, transparent 2px 5px);
}

.legend-upcoming {
  background: #e8821e;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.55) 0 2px, transparent 2px 5px);
}

.legend-selected {
  background-color: var(--accent);
  border: 2px solid var(--accent-hover);
}

/* Room tabs */
.room-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.room-tab {
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.room-tab:hover {
  border-color: var(--accent);
}

.room-tab.active {
  background-color: var(--primary);
  color: var(--primary-foreground, #fff);
  border-color: var(--primary);
}

/* Floor plan SVG */
.floor-plan-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--background, #faf8f5);
  padding: 0.5rem;
  max-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floor-plan-svg {
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* Table shapes inside SVG */
.table-shape {
  cursor: pointer;
  transition: opacity 0.15s;
}

.table-shape.is-occupied {
  cursor: not-allowed;
}

.table-shape-fill {
  fill: #2d7a46;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1;
  transition: fill 0.15s, stroke 0.15s;
}

.table-shape.is-occupied .table-shape-fill {
  fill: url(#tt-stripe-occupied);
  stroke: rgba(0, 0, 0, 0.12);
}

.table-shape.is-upcoming .table-shape-fill {
  fill: url(#tt-stripe-upcoming);
  stroke: rgba(0, 0, 0, 0.12);
}

.table-shape.is-upcoming:hover {
  filter: brightness(0.93);
}

.table-shape.is-selected .table-shape-fill {
  fill: var(--accent);
  stroke: var(--accent-hover);
  stroke-width: 2;
}

.table-shape.is-free:hover .table-shape-fill {
  fill: #3a9456;
  stroke: #2d7a46;
  stroke-width: 2;
}

.table-shape-label {
  fill: #fff;
  font-size: 18px;
  font-weight: 700;
  pointer-events: none;
  user-select: none;
  font-family: inherit;
  /* Dark halo keeps the number readable on bold stripes */
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.table-shape.is-upcoming .table-shape-label {
  fill: #fff;
}

/* Tooltip for occupied tables */
.table-shape[data-tooltip]:hover::after {
  content: attr(data-tooltip);
}

/* Mobile: compact floor plan */
@media (max-width: 768px) {
  .table-picker-legend {
    gap: 0.75rem;
  }

  .legend-item {
    font-size: 0.8rem;
  }

  .room-tab {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
  }

  .floor-plan-wrap {
    max-height: 50vh;
    padding: 0.35rem;
  }

  .table-shape-label {
    font-size: 14px;
  }
}

/* Tablet: slightly larger */
@media (min-width: 769px) and (max-width: 1024px) {
  .floor-plan-wrap {
    max-height: 60vh;
  }
}


/* ===== Plan Modal ===== */
#plan-modal {
  z-index: 1100;
}

.plan-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.plan-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.plan-control-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.plan-input {
  padding: 0.5rem 0.7rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.plan-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Plan floor plan: occupied tables clickable, free tables clickable */
#plan-floor-plan .table-shape.is-occupied {
  cursor: pointer;
}

#plan-floor-plan .table-shape.is-upcoming {
  cursor: pointer;
}

#plan-floor-plan .table-shape.is-free {
  cursor: pointer;
}

#plan-floor-plan .table-shape.is-free:hover {
  filter: brightness(1.1);
}

/* ===== Plan Detail Popup ===== */
.plan-detail-popup {
  position: fixed;
  z-index: 1200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  padding: 0;
  min-width: 280px;
  max-width: 360px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: planPopupIn 0.15s ease-out;
}

@keyframes planPopupIn {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.plan-detail-popup.hidden {
  display: none;
}

.plan-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.plan-detail-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.plan-detail-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.plan-detail-close:hover {
  background: var(--bg-hover, rgba(0,0,0,0.06));
  color: var(--text);
}

#plan-detail-body {
  padding: 0.75rem 1rem;
}

.plan-detail-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  align-items: baseline;
}

.plan-detail-row .plan-detail-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 70px;
  flex-shrink: 0;
}

.plan-detail-row .plan-detail-value {
  color: var(--text);
  word-break: break-word;
}

.plan-detail-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.plan-detail-actions .btn {
  flex: 1;
}

.plan-empty-state {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .plan-controls {
    flex-direction: row;
    gap: 0.5rem;
  }
  
  .plan-control-group {
    flex: 1;
  }
  
  .plan-detail-popup {
    min-width: 90vw;
    max-width: 90vw;
  }
}
/* === GROUP DUPLICATE DETECTION === */
.dup-match-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
}
.dup-match-card .dup-match-header {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.dup-match-card .dup-match-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.dup-diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.dup-diff-table th,
.dup-diff-table td {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  text-align: left;
}
.dup-diff-table th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text-muted);
}
.dup-diff-table .dup-old {
  color: var(--text-muted);
  text-decoration: line-through;
}
.dup-diff-table .dup-new {
  color: var(--accent);
  font-weight: 600;
}
.dup-warning-text {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text);
}
.dup-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dup-actions button {
  min-width: 120px;
}

/* =========================================================================
   SETUP WIZARD (initial onboarding)
   ========================================================================= */
.setup-wrapper {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg);
}

.setup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  max-height: 94dvh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.setup-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.setup-title {
  font-size: 1.4rem;
  font-family: var(--font-heading);
  margin: 0;
}

.setup-progress {
  height: 5px;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.setup-progress-bar {
  height: 100%;
  width: 20%;
  background: var(--primary);
  border-radius: var(--radius);
  transition: width 0.25s ease;
}

.setup-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-bottom: 1.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.setup-step-ind.active {
  color: var(--primary);
}

.setup-step {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.setup-step h2 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.setup-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.setup-hint-small {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

.setup-logo-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.setup-logo-preview {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 0.25rem;
  flex-shrink: 0;
}

/* Languages grid in the wizard (3 columns like the language popup) */
.setup-lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.setup-lang-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.setup-lang-option.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.setup-lang-option input {
  accent-color: var(--primary);
}

.setup-main-language .setup-main-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0.9rem 0.4rem 0;
  padding: 0.35rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  cursor: pointer;
}

.setup-main-language .setup-main-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Plan editor */
.setup-gcp-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
  margin-bottom: 1rem;
}

.setup-gcp-panel h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.setup-gcp-key {
  font-family: monospace;
  font-size: 0.72rem;
  margin: 0.5rem 0;
}

.setup-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.setup-plan-editor {
  margin-top: 0.75rem;
}

.setup-plan-preview {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 0.6rem;
  max-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.setup-editor-svg {
  max-height: 300px;
  width: 100%;
}

.setup-table {
  cursor: pointer;
}

.setup-plan-bg {
  cursor: crosshair;
}

.room-tab-del {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  border-radius: 50%;
  padding: 0 0.2rem;
}

.room-tab-del:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.setup-room-name-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.setup-room-name-row label {
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
}

.setup-auth-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0.9rem 0.4rem 0;
  padding: 0.35rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  cursor: pointer;
}

.setup-auth-option input {
  accent-color: var(--primary);
}

/* Wizard nav */
.setup-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Auth view extras */
.auth-top-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.auth-alt-methods {
  margin-top: 1rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 0.75rem 0;
}

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

.auth-method-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-method-btn {
  width: 100%;
}

@media (max-width: 480px) {
  .setup-card { padding: 1rem; max-height: 100dvh; }
  .setup-lang-grid { gap: 0.35rem; }
  .setup-lang-option { padding: 0.45rem; font-size: 0.74rem; gap: 0.35rem; }
  .setup-steps { font-size: 0.65rem; gap: 0.25rem 0.6rem; }
  .setup-plan-preview { max-height: 240px; }
}

.hidden-file-input {
  display: none;
}
