/* ==========================================================================
   Company Restaurant Menu Kiosk - Modern Premium Design System & PWA
   ========================================================================== */

:root {
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  /* Color System - Dark Theme (Default) */
  --bg-base: #0B0E14;
  --bg-surface: #131822;
  --bg-surface-elevated: #1B2232;
  --bg-pill: #242D40;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(245, 158, 11, 0.5);
  
  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;

  --accent-gold: #F59E0B;
  --accent-gold-hover: #D97706;
  --accent-emerald: #10B981;
  --accent-blue: #3B82F6;
  --accent-danger: #EF4444;

  --card-radius: 20px;
  --pill-radius: 100px;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg-base: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F1F5F9;
  --bg-pill: #E2E8F0;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-active: rgba(245, 158, 11, 0.6);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* Accessible focus ring */
:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* App Container */
.kiosk-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Safe area support for notch and home bars */
@supports (padding-top: env(safe-area-inset-top)) {
  .header {
    padding-top: calc(14px + env(safe-area-inset-top));
  }
  .footer {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-hover));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  flex-shrink: 0;
}

.restaurant-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.restaurant-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Live Clock Component */
.clock-card {
  background: var(--bg-surface-elevated);
  padding: 6px 18px;
  border-radius: var(--pill-radius);
  border: 1px solid var(--border-color);
  text-align: center;
  flex-shrink: 0;
}

.clock-time {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.clock-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Kiosk Signage Day Indicator Pill */
.kiosk-day-pill {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 22px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--pill-radius);
  color: var(--accent-gold);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.pure-kiosk-mode .kiosk-day-pill {
  display: inline-flex !important;
}

/* Kiosk Signage QR Code Card */
.kiosk-qr-card {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 6px 16px 6px 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--pill-radius);
  color: var(--text-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

body.pure-kiosk-mode .kiosk-qr-card {
  display: inline-flex !important;
}

.kiosk-qr-thumb-wrapper {
  background: #ffffff;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.kiosk-qr-thumb {
  width: 40px;
  height: 40px;
  display: block;
}

.kiosk-qr-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  line-height: 1.25;
}

.kiosk-qr-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kiosk-qr-title i {
  color: var(--accent-gold);
}

.kiosk-qr-url {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 0.2px;
}

.qr-modal-preview {
  background: #ffffff;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mode Selector Pill */
.mode-selector-pill {
  display: flex;
  background: var(--bg-pill);
  padding: 3px;
  border-radius: var(--pill-radius);
  border: 1px solid var(--border-color);
  gap: 3px;
  flex-shrink: 0;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--pill-radius);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.mode-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.mode-btn#btnModeFocused.active {
  color: var(--accent-emerald);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--pill-radius);
  color: var(--accent-emerald);
  font-size: 0.78rem;
  font-weight: 600;
}

.status-badge.status-standby {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--accent-gold);
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
}

.status-badge.status-standby .status-dot {
  background-color: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--transition-smooth);
  flex-shrink: 0;
  padding: 0;
}

.icon-btn:hover {
  background: var(--bg-pill);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.icon-btn.active {
  background: var(--accent-gold);
  color: #000;
}

.ui-icon {
  width: 17px;
  height: 17px;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  pointer-events: none;
}

.icon-btn .ui-icon {
  width: 17px;
  height: 17px;
}

.brand-icon .ui-icon {
  width: 20px;
  height: 20px;
  stroke: #000;
}

.mode-btn .ui-icon {
  width: 15px;
  height: 15px;
  margin-right: 5px;
}

.icon-carousel {
  fill: currentColor;
  stroke: none;
}

.icon-btn i,
.btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#pwaInstallBtn {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border-color: rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 20px 32px;
  max-width: 1700px;
  margin: 0 auto;
  width: 100%;
}

/* Weekend / Previous Week Standby Notice Banner */
.weekend-notice-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  animation: fadeInNotice 0.3s ease-out;
}

.weekend-notice-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.weekend-notice-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weekend-notice-content strong {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--accent-gold);
  font-weight: 700;
}

.weekend-notice-content span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@keyframes fadeInNotice {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Days Navigation Bar */
.days-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.day-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.day-tab:hover {
  background: var(--bg-surface-elevated);
  transform: translateY(-2px);
  border-color: var(--border-active);
}

.day-tab.active {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-gold);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

.day-tab.is-today {
  border-color: rgba(16, 185, 129, 0.4);
}

.day-tab.is-today.active {
  border-color: var(--accent-emerald);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

.tab-day-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
}

.tab-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.today-badge {
  margin-top: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border-radius: 8px;
}

.day-tab.is-today .today-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

/* ==========================================================================
   Hero Showcase Section
   ========================================================================== */
.hero-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-surface);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-showcase:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-active);
}

.hero-image-wrapper {
  position: relative;
  min-height: 340px;
  background: var(--bg-pill);
  overflow: hidden;
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.hero-showcase:hover .hero-image-wrapper img {
  transform: scale(1.03);
}

.hero-badge-group {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-badge {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: #FFF;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--pill-radius);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-ai-regen-btn {
  background: rgba(245, 158, 11, 0.9);
  color: #000;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--pill-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hero-ai-regen-btn:hover {
  background: var(--accent-gold);
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.1), rgba(19, 24, 34, 0.8));
}

.hero-details {
  padding: 30px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.hero-category-tag.veggie {
  color: var(--accent-emerald);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.55;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.meta-tag {
  font-size: 0.82rem;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.last-scraped-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Courses Section & Grid
   ========================================================================== */
.courses-section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.day-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* ==========================================================================
   Course Card - Top-Pinned Image Layout for Perfect Row Alignment
   ========================================================================== */
.course-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 16px;
  transition: all 0.25s var(--transition-smooth);
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-active);
}

.course-card.is-balanced-veggie {
  border-left: 4px solid var(--accent-emerald);
}

/* Top Image Container with Fixed Aspect Ratio */
.course-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-pill);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.course-image-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.course-card:hover .course-image-thumb {
  transform: scale(1.04);
}

/* Overlay Bar on Image */
.course-image-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}

.course-image-overlay > * {
  pointer-events: auto;
}

.course-category-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 9px;
  background: rgba(19, 24, 34, 0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--pill-radius);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.course-category-badge.veggie-badge {
  background: rgba(16, 185, 129, 0.85);
  color: #FFFFFF;
  border-color: rgba(16, 185, 129, 0.4);
}

.card-actions {
  display: flex;
  gap: 6px;
}

.card-ai-btn {
  background: rgba(19, 24, 34, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-size: 0.74rem;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.card-ai-btn:hover {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
  transform: scale(1.03);
}

/* Card Body */
.course-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.course-dish-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.35;
  color: var(--text-primary);
}

.course-details-list {
  list-style-type: disc;
  padding-left: 18px;
  margin-top: auto;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.course-details-list li {
  margin-bottom: 3px;
}

.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.loading-state i {
  margin-bottom: 14px;
  color: var(--accent-gold);
}

/* ==========================================================================
   Footer Component
   ========================================================================== */
.footer {
  padding: 14px 32px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mode-footer-tag {
  color: var(--accent-emerald);
  font-weight: 600;
}

/* ==========================================================================
   Pure 16:9 Kiosk / Signage Mode (URL: /kiosk, /signage, /tv, ?kiosk=true)
   ========================================================================== */
body.pure-kiosk-mode {
  overflow: hidden !important;
}

body.pure-kiosk-mode .header {
  padding: 16px 40px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

body.pure-kiosk-mode .mode-selector-pill,
body.pure-kiosk-mode #statusBadge,
body.pure-kiosk-mode #statsBtn,
body.pure-kiosk-mode #qrBtn,
body.pure-kiosk-mode #themeToggle,
body.pure-kiosk-mode #carouselToggle,
body.pure-kiosk-mode #refreshBtn,
body.pure-kiosk-mode #adminBtn,
body.pure-kiosk-mode #pwaInstallBtn,
body.pure-kiosk-mode .days-nav,
body.pure-kiosk-mode .hero-showcase,
body.pure-kiosk-mode .section-header,
body.pure-kiosk-mode .footer-left {
  display: none !important;
}

body.pure-kiosk-mode .kiosk-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

body.pure-kiosk-mode .main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 40px;
  overflow: hidden;
  max-width: 100%;
}

body.pure-kiosk-mode .courses-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

body.pure-kiosk-mode .courses-grid {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 32px;
  height: 100%;
  max-width: 1700px;
  margin: 0 auto;
  width: 100%;
}

body.pure-kiosk-mode .course-card {
  flex: 1;
  max-width: 520px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 24px;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--border-color);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
  padding: 22px;
  overflow: hidden;
  position: relative;
  cursor: default !important;
}

body.pure-kiosk-mode .course-image-container {
  aspect-ratio: 1 / 1;
  max-height: clamp(180px, 34vh, 380px);
  width: auto;
  max-width: 100%;
  margin: 0 auto 16px auto;
  border-radius: 18px;
}

body.pure-kiosk-mode .card-actions {
  display: none !important;
}

body.pure-kiosk-mode .course-dish-title {
  font-size: clamp(1.3rem, 1.6vw, 2.1rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
}

body.pure-kiosk-mode .course-details-list {
  padding-left: 20px;
  font-size: clamp(0.9rem, 1.1vw, 1.3rem);
  line-height: 1.5;
}

/* ==========================================================================
   Modals & Bottom Sheet Drawers
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  width: 100%;
  max-width: 520px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: transform 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-pill);
}

/* Form Controls */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.select-input, .input-with-icon input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.select-input:focus, .input-with-icon input:focus {
  border-color: var(--accent-gold);
  outline: none;
}

.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-with-icon input {
  padding-left: 36px;
}

.help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 5px;
  display: block;
}

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

.btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn.btn-primary {
  background: var(--accent-gold);
  color: #000;
}

.btn.btn-primary:hover {
  background: var(--accent-gold-hover);
  transform: translateY(-1px);
}

.btn.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn.btn-secondary:hover {
  background: var(--bg-pill);
}

.status-box {
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-section-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-gold);
}

.form-group .switch-label,
.switch-label {
  display: flex !important;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  user-select: none;
  margin-bottom: 0 !important;
}

.switch-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.switch-slider {
  display: inline-block;
  width: 44px;
  height: 24px;
  background: var(--bg-pill);
  border: 1px solid var(--border-color);
  border-radius: var(--pill-radius);
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.switch-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #FFF;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
}

.switch-label input:checked + .switch-slider {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
}

.switch-label input:checked + .switch-slider::before {
  transform: translateX(20px);
  background: #0B0E14;
}

.switch-text {
  line-height: 1.3;
}

.day-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.day-check-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--pill-radius);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  position: relative;
}

.day-check-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.day-check-label:hover {
  background: var(--bg-pill);
  color: var(--text-primary);
  border-color: var(--accent-gold);
}

.day-check-label:has(input:checked) {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

/* Interactive Dish Detail Popup Modal */
.dish-detail-card {
  max-width: 540px !important;
  padding: 0 !important;
  overflow: hidden;
  position: relative;
}

.dish-detail-card .close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: #FFF;
  width: 36px;
  height: 36px;
}

.dish-detail-img-wrapper {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-pill);
  overflow: hidden;
}

.dish-detail-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dish-detail-body {
  padding: 24px;
}

.dish-detail-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
}

/* Menu Statistics & History Modal */
.stats-modal-card {
  max-width: 840px !important;
  width: 94vw;
  padding: 0 !important;
  overflow: hidden;
}

.stats-modal-card .modal-header {
  padding: 18px 24px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-color);
}

.stats-nav-bar {
  display: flex;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 24px;
  gap: 8px;
}

.stats-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 7px 16px;
  border-radius: var(--pill-radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s var(--transition-smooth);
}

.stats-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.stats-tab-btn.active {
  background: var(--bg-pill);
  color: var(--accent-gold);
  border: 1px solid var(--border-color);
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stats-kpi-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.stats-kpi-card.highlight-card {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, var(--bg-surface-elevated), rgba(245, 158, 11, 0.08));
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.stats-section-block {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.stats-block-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-block-title i {
  color: var(--accent-gold);
}

.protein-bars-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.protein-bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.protein-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
}

.protein-bar-track {
  height: 8px;
  background: var(--bg-pill);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.protein-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease-out;
}

.stats-two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stats-card-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 18px;
}

.stats-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-pill);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.ranking-item-title {
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-item-count {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 2px 10px;
  border-radius: var(--pill-radius);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-gold);
  flex-shrink: 0;
}

.history-controls-bar {
  margin-bottom: 16px;
}

.history-search-input {
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--pill-radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.history-search-input:focus {
  border-color: var(--accent-gold);
}

.history-days-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-day-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}

.history-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.history-day-date {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-dishes-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-dish-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  padding: 4px 0;
}

.history-dish-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-dish-title {
  color: var(--text-primary);
  font-weight: 600;
}

.history-dish-details {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.history-dish-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.history-tag-chip {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
}

.tag-beef { background: rgba(239, 68, 68, 0.15); color: #EF4444; }
.tag-pork { background: rgba(244, 63, 94, 0.15); color: #F43F5E; }
.tag-poultry { background: rgba(249, 115, 22, 0.15); color: #F97316; }
.tag-fish { background: rgba(6, 182, 212, 0.15); color: #06B6D4; }
.tag-veggie { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.tag-fries { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); }
.tag-side { background: var(--bg-pill); color: var(--text-muted); }

/* ==========================================================================
   Responsive Breakpoints & Mobile-First Hardening
   ========================================================================== */

@media (max-width: 1080px) {
  .header {
    padding: 12px 20px;
    flex-wrap: wrap;
  }
  .main-content {
    padding: 16px 20px;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .header {
    padding: 10px 16px;
    gap: 8px;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .restaurant-name {
    font-size: 1.12rem;
  }

  .restaurant-subtitle {
    display: none;
  }

  .mode-selector-pill {
    padding: 2px;
  }

  .mode-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .header-actions {
    gap: 6px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .status-badge {
    padding: 3px 8px;
    font-size: 0.72rem;
  }

  .main-content {
    padding: 12px 14px;
  }

  /* Sticky Horizontal Day Navigation */
  .days-nav {
    position: sticky;
    top: 56px;
    z-index: 35;
    background: var(--bg-base);
    padding: 6px 0;
    margin-bottom: 16px;
    display: flex;
    overflow-x: auto;
    gap: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .days-nav::-webkit-scrollbar {
    display: none;
  }

  .day-tab {
    flex: 0 0 84px;
    scroll-snap-align: start;
    padding: 8px 6px;
    border-radius: 12px;
  }

  .tab-day-name {
    font-size: 0.9rem;
  }

  .tab-date {
    font-size: 0.72rem;
  }

  /* Compact Hero Showcase */
  .hero-showcase {
    grid-template-columns: 1fr;
    margin-bottom: 18px;
    border-radius: 16px;
  }

  .hero-image-wrapper {
    min-height: 180px;
    max-height: 220px;
  }

  .hero-details {
    padding: 16px 18px;
  }

  .hero-title {
    font-size: 1.35rem;
    margin-bottom: 6px;
  }

  .hero-description {
    font-size: 0.88rem;
    margin-bottom: 12px;
    line-height: 1.45;
  }

  .hero-meta {
    padding-top: 10px;
  }

  /* Single-Column Touch Course Cards */
  .courses-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .course-card {
    padding: 14px;
    border-radius: 16px;
  }

  .course-image-container {
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    margin-bottom: 10px;
  }

  .course-image-overlay .card-actions {
    display: none !important;
  }

  .course-dish-title {
    font-size: 1.08rem;
    line-height: 1.3;
  }

  .course-details-list {
    font-size: 0.84rem;
    padding-left: 16px;
  }

  .stats-two-col-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile Slide-Up Bottom Sheet Modals */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    border-radius: 24px 24px 0 0;
    max-height: 88vh;
    width: 100%;
    max-width: 100% !important;
    transform: translateY(100%);
    padding: 22px 18px;
    margin: 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  }

  .modal-backdrop.active .modal-card {
    transform: translateY(0);
  }

  .dish-detail-card {
    border-radius: 24px 24px 0 0 !important;
  }

  .dish-detail-img-wrapper {
    aspect-ratio: 16 / 9;
  }

  .dish-detail-body {
    padding: 18px;
  }

  .dish-detail-title {
    font-size: 1.35rem;
  }

  .stats-modal-card {
    border-radius: 24px 24px 0 0 !important;
    width: 100% !important;
  }

  .stats-modal-card .modal-header {
    padding: 14px 18px;
  }

  .stats-nav-bar {
    padding: 6px 14px;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 12px 16px;
  }

  .footer-left {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Mobile adaptation when accessing /kiosk on small screens */
  body.pure-kiosk-mode {
    overflow-y: auto !important;
  }
  body.pure-kiosk-mode .kiosk-container {
    height: auto;
    min-height: 100vh;
  }
  body.pure-kiosk-mode .main-content {
    overflow: visible;
    padding: 14px;
  }
  body.pure-kiosk-mode .courses-grid {
    flex-direction: column;
    gap: 16px;
    height: auto;
  }
  body.pure-kiosk-mode .course-card {
    max-width: 100%;
    min-width: 0;
    height: auto;
    padding: 16px;
  }
  body.pure-kiosk-mode .course-image-container {
    aspect-ratio: 16 / 10;
    max-height: 220px;
    width: 100%;
  }
}

@media (max-width: 380px) {
  .mode-btn-label {
    display: none;
  }
  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }
  .restaurant-name {
    font-size: 0.98rem;
  }
  .day-tab {
    flex: 0 0 74px;
    padding: 6px 4px;
  }
  .tab-day-name {
    font-size: 0.82rem;
  }
}
