/* ==========================================================================
   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;
}

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,
.lang-dropdown-menu,
.top-bar,
.user-add-box,
.ai-dropzone,
.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: 0.95rem;
  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);
}

.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 Dropdown */
.lang-dropdown {
  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);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  min-width: 150px;
  z-index: 200;
  overflow: hidden;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  border-radius: 0;
}

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

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

/* 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);
}

.panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.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 h3 {
  font-size: 1.1rem;
}

/* 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);
}

.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[data-toggle="accordion"]:hover {
  background: var(--surface);
  margin: -0.5rem -0.5rem 0;
  padding: 0.5rem;
}

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

.accordion-chevron {
  color: var(--text-muted);
  font-size: 1rem;
  display: inline-block;
  transition: transform 0.2s;
  margin-right: 0.25rem;
}

.accordion-card.expanded .accordion-chevron {
  transform: rotate(180deg);
}

.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;
}

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

.modal-lg {
  max-width: 780px;
}

.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 {
  font-size: 1.2rem;
  font-family: var(--font-heading);
}

.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;
}

.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-dropzone {
  border: 2px dashed var(--border);
  padding: 2.5rem;
  text-align: center;
  background: var(--bg);
  margin: 1.5rem 0;
}

.ai-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.file-selected-text {
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}

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

.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;
  margin-bottom: 1rem;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  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.7rem;
  font-weight: 700;
}

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

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

/* 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;
}

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

.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: 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;
  }

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

/* Week bar mobile */
@media (max-width: 480px) {
  .week-bar { padding: 0.75rem 0.5rem; }
  .week-arrow-btn { width: 32px; height: 32px; font-size: 0.85rem; }
  .week-range { font-size: 0.85rem; }
  .week-label { font-size: 0.65rem; }
  .week-stats { font-size: 0.75rem; gap: 0.25rem; }
}

/* 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-toggle:hover {
  background: var(--surface-hover);
}

.accordion-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.accordion-section.open .accordion-arrow {
  transform: rotate(180deg);
}

.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: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.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: 1;
}

.list-type-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.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; }
.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; 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 { font-weight: 600; font-size: 0.9rem; color: var(--text); white-space: nowrap; }

.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); }

/* === 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-actions { display: flex; gap: 0.5rem; }
  .list-filters .form-row.list-filter-actions .btn { flex: 1; }
  .list-filters .list-pdf-row { margin-top: 0.5rem; }
  .list-filters .list-pdf-row .btn { width: 100%; background: var(--primary); color: white; 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; }
  /* Desktop: hide accordion cards */
  .list-mobile-card .card-actions { flex-direction: column; gap: 0.15rem; }
  .list-mobile-card .card-edit-btn, .list-mobile-card .card-delete-btn { font-size: 1.1rem; padding: 0.35rem 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; }
}

/* ==========================================================================
   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: 1rem;
  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-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}
.week-range {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
}
.week-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.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);
}

/* === MOBILE CARD ACTIONS === */
@media (max-width: 768px) {
  .card-actions {
    flex-direction: column;
    gap: 0.15rem;
  }
  .card-edit-btn, .card-delete-btn {
    font-size: 1.1rem;
    padding: 0.35rem 0.5rem;
  }
  .res-card-title-row {
    font-size: 1rem;
  }
  .accordion-chevron {
    font-size: 1.1rem;
  }
}

/* === 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;
  }
}
