/* ============================
   COMPLETE REWRITE - FOOD RESTAURANT DB
   Brighter colors, dark theme, all sections included
   ============================ */

:root {
  /* Primary Colors - Brighter Orange Theme */
  --primary: #FF6B35;        /* Bright orange */
  --primary-dark: #E85A21;   /* Darker orange */
  --secondary: #FF9A3D;      /* Lighter orange */
  --accent: #FFD166;         /* Bright yellow */
  --danger: #FF4757;         /* Bright red */
  --warning: #FFA502;        /* Bright orange-yellow */
  --success: #2ED573;        /* Bright green */
  --info: #1E90FF;          /* Bright blue */
  
  /* Background Colors - Dark Theme */
  --bg-primary: #121826;     /* Dark background */
  --bg-secondary: #1E293B;   /* Secondary dark */
  --bg-card: #2D3748;       /* Card background */
  --bg-hover: #3A4556;      /* Hover state */
  
  /* Text Colors */
  --text-primary: #FFFFFF;   /* Pure white */
  --text-secondary: #E2E8F0; /* Light gray */
  --text-muted: #A0AEC0;    /* Muted gray */
  
  /* Borders */
  --border: #4A5568;        /* Border color */
  --border-light: #718096;  /* Lighter border */
  
  /* Shadows */
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  
  /* Border Radius */
  --radius: 12px;
  --radius-sm: 8px;
  
  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================
   EMERGENCY OVERRIDE - TOP OF CSS
   ============================ */
#appWrapper {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}

#mainContent {
    display: block !important;
    flex: 1 !important;
}

#dashboardSection {
    display: block !important;
}

#loginScreen.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
}

/* Remove any conflicting display: none rules */
.content-section:not(.active) {
    opacity: 0 !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
}

.content-section.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    position: relative !important;
}

/* ============================
   BASE STYLES
   ============================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================
   LOGIN SCREEN
   ============================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0F172A 100%);
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-header h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.login-header p {
  color: var(--text-muted);
}

/* ============================
   FORM ELEMENTS
   ============================ */
.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-group input,
.input-group textarea,
.input-group select {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  transition: var(--transition);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* ============================
   BUTTONS
   ============================ */
.btn {
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #FF8C2A);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #25CC63;
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #FF3742;
  transform: translateY(-2px);
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-warning:hover {
  background: #E59400;
  transform: translateY(-2px);
}

.btn-info {
  background: var(--info);
  color: white;
}

.btn-info:hover {
  background: #1C86EE;
  transform: translateY(-2px);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 14px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
}

.btn-link:hover {
  color: var(--secondary);
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ============================
   DASHBOARD LAYOUT
   ============================ */
.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  height: 70px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-info {
  font-weight: 600;
  color: var(--text-secondary);
}

.layout {
  display: flex;
  flex: 1;
}

/* ============================
   SIDEBAR
   ============================ */
.sidebar {
  width: 280px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.nav-section {
  padding: 24px 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  text-decoration: none;
  margin: 4px 12px;
  border-radius: var(--radius-sm);
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.nav-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.nav-text {
  font-weight: 600;
  font-size: 15px;
}

.nav-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  font-weight: 600;
}

.user-details {
  flex: 1;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.user-role {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================
   MAIN CONTENT
   ============================ */
.main-content {
  flex: 1;
  padding: 30px;
  background: var(--bg-primary);
  overflow-y: auto;
}

.section-header {
  margin-bottom: 40px;
}

.section-title h1 {
  font-size: 32px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title p {
  color: var(--text-muted);
  font-size: 16px;
}

.section-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
}

.filter-select {
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  min-width: 180px;
  font-size: 15px;
}

/* ============================
   STATS GRID
   ============================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary), var(--secondary));
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.stat-icon {
  font-size: 36px;
  width: 70px;
  height: 70px;
  background: rgba(255, 107, 53, 0.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.stat-info h3 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.stat-info p {
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================
   MEALS SECTION
   ============================ */
.meals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
  margin-top: 30px;
}

.meal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  min-height: 160px;
  position: relative;
}

.meal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.meal-image {
  width: 150px;
  min-width: 150px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.meal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meal-details {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.meal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.meal-name {
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meal-price {
  color: var(--primary);
  font-weight: 800;
  font-size: 18px;
  white-space: nowrap;
  margin-left: 12px;
}

.meal-description {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.meal-category {
  display: inline-block;
  background: rgba(255, 154, 61, 0.1);
  color: var(--secondary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.meal-actions {
  display: flex;
  gap: 8px;
}

.meal-actions button {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: 0.2s ease;
}

.edit-meal-btn {
  background: var(--info);
  color: white;
}

.edit-meal-btn:hover {
  background: #1C86EE;
  transform: translateY(-1px);
}

.delete-meal-btn {
  background: var(--danger);
  color: white;
}

.delete-meal-btn:hover {
  background: #FF3742;
  transform: translateY(-1px);
}

.meal-card.unavailable {
  opacity: 0.7;
  background: rgba(255, 71, 87, 0.05);
}

.meal-status {
  display: inline-block;
  background: rgba(255, 71, 87, 0.2);
  color: var(--danger);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}

.meal-card:not(.unavailable) .meal-status {
  display: none;
}

.meals-search-container {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 250px;
}

/* ============================
   ORDERS SECTION
   ============================ */
.orders-table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.table-header {
  display: grid;
  grid-template-columns: 120px 1fr 100px 120px 120px 120px 140px 160px;
  gap: 20px;
  padding: 20px;
  background: rgba(255, 107, 53, 0.1);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
}

.table-row {
  display: grid;
  grid-template-columns: 120px 1fr 100px 120px 120px 120px 140px 160px;
  gap: 20px;
  padding: 20px;
  align-items: center;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.table-row:hover {
  background: rgba(255, 107, 53, 0.05);
}

.table-row:last-child {
  border-bottom: none;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.order-finalized {
  background: rgba(46, 213, 115, 0.05) !important;
  border-left: 3px solid var(--success);
}

.status-finalized {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(46, 213, 115, 0.2);
  color: var(--success);
  text-align: center;
}

/* Order Details Modal Styles */
.modal-lg {
  max-width: 600px;
}

.order-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.detail-group h4 {
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 16px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.detail-item label {
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-item span {
  color: var(--text-primary);
}

.order-items {
  border-top: 2px solid var(--border);
  padding-top: 20px;
}

.order-items h4 {
  margin-bottom: 15px;
  color: var(--primary);
}

.items-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--bg-secondary);
}

.item-info {
  flex: 1;
}

.item-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.item-quantity {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.item-notes {
  font-size: 12px;
  color: var(--warning);
  font-style: italic;
}

.item-price {
  font-weight: 600;
  color: var(--primary);
  text-align: right;
}

.order-summary {
  border-top: 2px solid var(--border);
  padding-top: 15px;
  text-align: right;
}

.summary-total {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
}

.status-finalized-text {
  color: var(--text-muted);
  font-style: italic;
}

.no-items {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 20px;
}

/* ============================
   STATUS BADGES
   ============================ */
.status-badge {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending {
  background: rgba(255, 165, 2, 0.2);
  color: var(--warning);
  border: 1px solid rgba(255, 165, 2, 0.3);
}

.status-completed {
  background: rgba(46, 213, 115, 0.2);
  color: var(--success);
  border: 1px solid rgba(46, 213, 115, 0.3);
}

.status-cancelled {
  background: rgba(255, 71, 87, 0.2);
  color: var(--danger);
  border: 1px solid rgba(255, 71, 87, 0.3);
}

/* ============================
   SETTINGS SECTION
   ============================ */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 30px;
}

.setting-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  transition: var(--transition);
}

.setting-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.setting-card h3 {
  margin-bottom: 16px;
  font-size: 20px;
  color: var(--text-primary);
}

.setting-content {
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Info Grid for Settings */
.info-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item label {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 120px;
}

.info-item span {
  color: var(--text-muted);
  text-align: right;
  flex: 1;
  margin-left: 16px;
}

/* WhatsApp Notification Settings */
.notification-settings {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 20px;
}

.whatsapp-option {
  margin: 15px 0;
  padding: 15px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 8px;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
}

/* ============================
   MODALS
   ============================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 22px;
  color: var(--text-primary);
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.btn-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ============================
   QR CODE STYLES
   ============================ */
.qr-content {
  text-align: center;
  padding: 20px;
}

.qr-code {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
}

.qr-code-container {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  background: var(--bg-secondary);
  margin: 16px 0;
  transition: all 0.3s ease;
}

.qr-code-container:hover {
  border-color: var(--primary);
}

#qrCodeImage {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qr-url {
  background: var(--bg-secondary);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 14px;
  margin-bottom: 20px;
  word-break: break-all;
  color: var(--text-primary);
}

.qr-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ============================
   EXPORT MODAL STYLES
   ============================ */
.export-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quick-filters {
  margin: 15px 0;
  padding: 15px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.quick-filters label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.export-preview {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.export-preview h4 {
  margin-bottom: 15px;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 8px;
}

.export-stats {
  min-height: 80px;
}

.stats-grid-export {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card-export {
  background: var(--bg-card);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-value {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.stat-value.total { color: var(--primary); }
.stat-value.completed { color: var(--success); }
.stat-value.pending { color: var(--warning); }
.stat-value.cancelled { color: var(--danger); }
.stat-value.revenue { color: var(--primary); font-size: 16px; }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ============================
   RECENT ACTIVITY
   ============================ */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.activity-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.activity-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 107, 53, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--primary);
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
}

.activity-meta {
  text-align: right;
}

.activity-amount {
  font-weight: bold;
  color: var(--primary);
  font-size: 16px;
}

/* ============================
   TOGGLE SWITCHES
   ============================ */
.meal-availability {
  display: flex;
  align-items: center;
  gap: 8px;
}

.availability-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-secondary);
  transition: .4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--success);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* ============================
   IMAGE PREVIEW
   ============================ */
.image-preview {
  margin-top: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.current-image p {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.image-note {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  margin-top: 8px !important;
}

.btn-remove-img {
  margin-top: 8px;
  background: var(--danger);
  padding: 8px 16px;
  border-radius: 6px;
  color: white;
  font-size: 13px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-remove-img:hover {
  background: #FF3742;
}

/* ============================
   LOADING STATES
   ============================ */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

.loading-text {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  padding: 8px 12px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn.loading,
.btn-loading {
  position: relative;
  color: transparent !important;
  opacity: 0.7;
  pointer-events: none;
}

.btn.loading::after,
.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================
   TOAST NOTIFICATIONS
   ============================ */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 16px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  z-index: 1001;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  max-width: 350px;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.info {
  border-left-color: var(--info);
}

/* ============================
   ALERTS & NOTICES
   ============================ */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  margin: 16px 0;
}

.alert-banner.warning {
  background: rgba(255, 165, 2, 0.1);
  border: 1px solid rgba(255, 165, 2, 0.3);
}

.alert-banner.info {
  background: rgba(30, 144, 255, 0.1);
  border: 1px solid rgba(30, 144, 255, 0.3);
}

.alert-icon {
  font-size: 20px;
  margin-top: 2px;
}

.alert-content {
  flex: 1;
}

.alert-content strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.alert-content p {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.auto-debit-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(46, 213, 115, 0.1);
  border: 1px solid rgba(46, 213, 115, 0.3);
  border-radius: var(--radius);
  margin: 16px 0;
}

.notice-icon {
  font-size: 20px;
  margin-top: 2px;
  color: var(--success);
}

.notice-content strong {
  color: var(--success);
  display: block;
  margin-bottom: 4px;
}

.notice-content p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.security-notice {
  text-align: center;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin-top: 20px;
}

.secure-badge {
  color: var(--success);
  font-weight: 600;
  margin-bottom: 8px;
}

.security-notice p {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0;
}

/* ============================
   WATSAPP FLOATING BUTTON
   ============================ */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: var(--transition);
  animation: pulse 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.whatsapp-notification-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: var(--radius);
  margin: 12px 0;
}

.whatsapp-notification-banner.success {
  background: rgba(37, 211, 102, 0.1);
  border-color: rgba(37, 211, 102, 0.3);
}

.whatsapp-notification-banner.info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

/* ============================
   FORM STEPS & PROGRESS
   ============================ */
.step-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}

.step.active {
  background: var(--primary);
  color: white;
}

.form-section {
  display: none;
}

.form-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================
   ERROR STATES
   ============================ */
.input-group input.error,
.input-group textarea.error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.1) !important;
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.error-message {
  color: var(--danger);
  font-size: 14px;
  margin-top: 8px;
  display: none;
}

.error-message.show {
  display: block;
}

.error-state {
  text-align: center;
  padding: 40px;
  color: var(--danger);
}

.error-state h3 {
  margin: 0 0 8px 0;
  color: var(--danger);
}

.error-state p {
  margin: 0;
  color: var(--text-muted);
}

/* ============================
   EMPTY STATES
   ============================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 18px;
}

.empty-state p {
  margin-bottom: 20px;
  font-size: 14px;
}

/* ============================
   CONFIRMATION MODAL
   ============================ */
.confirmation-content {
  text-align: center;
  padding: 20px 0;
}

.confirmation-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--warning);
}

.confirmation-content h4 {
  margin: 0 0 12px 0;
  color: var(--text-primary);
  font-size: 20px;
}

.confirmation-content p {
  margin: 0 0 20px 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.feature-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
}

.feature-item:last-child {
  margin-bottom: 0;
}

.feature-icon {
  color: var(--success);
  font-weight: bold;
  margin-right: 10px;
  font-size: 16px;
}

/* ============================
   SUBSCRIPTION STYLES
   ============================ */
.subscription-modal {
  max-width: 500px;
}

.subscription-modal .modal-body {
  padding: 20px;
}

#paystackCardFrame {
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  color: var(--text-muted);
}

.subscription-badge {
  background: rgba(255, 209, 102, 0.1);
  border: 1px solid rgba(255, 209, 102, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.subscription-badge.hidden {
  display: none;
}

.btn-upgrade {
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  border: none;
  font-weight: 600;
  transition: var(--transition);
}

.btn-upgrade:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.plan-banner {
  background: rgba(255, 209, 102, 0.1);
  padding: 12px 16px;
  border: 1px solid rgba(255, 209, 102, 0.3);
  border-radius: 6px;
  margin-bottom: 15px;
  color: var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================
   CARD INPUT MODAL
   ============================ */
.card-input-modal {
  max-width: 400px;
}

.card-preview {
  margin: 20px 0;
  perspective: 1000px;
}

.card-front {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 12px;
  padding: 20px;
  color: white;
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.card-chip {
  width: 40px;
  height: 30px;
  background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
  border-radius: 4px;
  margin-bottom: 20px;
}

.card-number-preview {
  font-size: 18px;
  letter-spacing: 2px;
  margin-bottom: 20px;
  font-family: monospace;
}

.card-details {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  text-transform: uppercase;
}

.card-name-preview,
.card-expiry-preview {
  opacity: 0.8;
}

/* ============================
   EXPORT MODAL SPECIFIC
   ============================ */
.date-presets {
  margin-bottom: 1.5rem;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-preset {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.btn-preset:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--primary);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.export-summary.simple {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--border);
}

.summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.summary-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-value#exportRevenue {
  color: var(--primary);
}

.export-format.simple {
  margin: 24px 0;
}

.export-format.simple label {
  display: block;
  margin-bottom: 12px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 15px;
}

.format-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 0.5rem;
}

.format-btn {
  text-align: center;
  padding: 16px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-secondary);
  position: relative;
}

.format-btn:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.format-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.format-btn input[type="radio"]:checked + span {
  color: var(--primary);
  font-weight: 600;
}

.format-btn input[type="radio"]:checked ~ .format-btn {
  border-color: var(--primary);
  background: rgba(255, 107, 53, 0.1);
}

.format-btn span {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

#exportBtn {
  position: relative;
  padding-right: 3rem;
  min-width: 160px;
}

#exportCountBadge {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* ============================
   ANIMATIONS
   ============================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(255, 107, 53, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
  }
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); box-shadow: 0 0 0 4px rgba(46, 213, 115, 0.3); }
  100% { transform: scale(1); }
}

@keyframes highlight {
  0% { background-color: rgba(255, 107, 53, 0.1); }
  50% { background-color: rgba(255, 107, 53, 0.2); }
  100% { background-color: transparent; }
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================
   NOTIFICATION BADGES
   ============================ */
.notification-badge {
  background: var(--danger);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  margin-left: 8px;
}

.order-badge, .badge {
  background: var(--danger);
  color: white;
  padding: 4px 8px;
  border-radius: 50%;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.badge-pulse {
  animation: pulse 0.35s ease-out;
}

.new-row {
  animation: highlight 2s ease-out;
}

/* ============================
   MOBILE RESPONSIVE
   ============================ */
@media (max-width: 1200px) {
  .meals-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .table-header,
  .table-row {
    grid-template-columns: 100px 1fr 90px 100px 100px 100px 120px 150px;
    gap: 12px;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: 240px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Mobile Navigation */
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
  }
  
  .mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
  }
  
  /* Main Content */
  .main-content {
    padding: 20px;
  }
  
  .top-bar {
    padding: 0 20px;
    height: 60px;
  }
  
  .top-bar-left .logo {
    font-size: 20px;
  }
  
  .user-info {
    display: none;
  }
  
  /* Stats Grid */
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  /* Meals Grid */
  .meals-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .meal-card {
    flex-direction: column;
    min-height: auto;
  }
  
  .meal-image {
    width: 100%;
    height: 200px;
    min-width: auto;
  }
  
  .meal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .meal-price {
    margin-left: 0;
  }
  
  .meal-footer {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .meal-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  /* Orders Table */
  .table-header {
    display: none;
  }
  
  .table-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
  }
  
  .table-row > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
  }
  
  .table-row > div::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 12px;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .action-buttons .btn {
    width: 100%;
  }
  
  /* Settings */
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  /* Modal */
  .modal-overlay {
    padding: 10px;
    align-items: flex-start;
    padding-top: 40px;
  }
  
  .modal {
    max-width: none;
    margin: 0;
    max-height: 80vh;
  }
  
  /* QR Code */
  .qr-code-container {
    min-height: 200px;
  }
  
  .qr-actions {
    flex-direction: column;
  }
  
  .qr-actions .btn {
    width: 100%;
  }
  
  /* Form Elements */
  .meals-search-container {
    flex-direction: column;
  }
  
  .search-box,
  .filter-select {
    min-width: 100%;
  }
  
  /* Export Modal */
  .filter-grid {
    grid-template-columns: 1fr;
  }
  
  .export-summary.simple {
    flex-direction: column;
    gap: 20px;
  }
  
  .format-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Card Input */
  .card-front {
    height: 180px;
    padding: 16px;
  }
  
  .card-number-preview {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 16px;
  }
  
  .section-header h1 {
    font-size: 24px;
  }
  
  .stat-card {
    padding: 20px;
    flex-direction: column;
    text-align: center;
  }
  
  .stat-icon {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }
  
  .meal-actions {
    flex-direction: column;
  }
  
  .meal-actions button {
    width: 100%;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
  
  .format-buttons {
    grid-template-columns: 1fr;
  }
  
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  
  .table-row {
    padding: 12px;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* ============================
   SPECIAL MOBILE ENHANCEMENTS
   ============================ */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
  }
  
  .mobile-nav-overlay.active {
    display: block;
  }
  
  .mobile-nav {
    width: 280px;
    height: 100%;
    background: var(--bg-card);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
  }
  
  .mobile-nav-overlay.active .mobile-nav {
    transform: translateX(0);
  }
  
  .mobile-nav-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .mobile-nav-items {
    flex: 1;
    padding: 20px 0;
  }
  
  .mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
  }
  
  .mobile-nav-item.active {
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary);
    border-right: 3px solid var(--primary);
  }
  
  .mobile-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
  }
}

/* ============================
   TOUCH-FRIENDLY ELEMENTS
   ============================ */
@media (max-width: 768px) {
  .btn {
    min-height: 44px;
  }
  
  .btn-sm {
    min-height: 36px;
  }
  
  .nav-item,
  .mobile-nav-item {
    min-height: 48px;
  }
  
  .toggle-switch {
    min-width: 44px;
    min-height: 24px;
  }
  
  .toggle-slider:before {
    width: 20px;
    height: 20px;
  }
  
  .input-group input,
  .input-group textarea,
  .input-group select {
    font-size: 16px;
    padding: 16px;
  }
}

/* ============================
   CUSTOM SCROLLBAR
   ============================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ============================
   UTILITY CLASSES
   ============================ */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mb-4 {
  margin-bottom: 16px;
}

.mt-4 {
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

/* ============================
   FINAL EMERGENCY OVERRIDES
   ============================ */
#dashboard:not(.hidden) {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.main-content:not(.hidden) {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  flex: 1 !important;
}

.content-section.active {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

#loginScreen.hidden {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  pointer-events: none !important;
}

#dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#dashboard.hidden {
  display: none !important;
}

#dashboardSection.active {
  display: block !important;
}

.dashboard {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
}

/* ============================
   FOOD-SPECIFIC STYLES
   ============================ */
.food-category {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.drink-category {
  background: linear-gradient(135deg, var(--info), #4FC3F7);
  color: white;
}

.dessert-category {
  background: linear-gradient(135deg, var(--accent), #FFB74D);
  color: white;
}

/* Popular badge */
.popular-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--danger);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Special offer glow */
.special-offer {
  position: relative;
  overflow: hidden;
}

.special-offer::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
  z-index: 0;
  animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* ============================
   INLINE EDIT STYLES
   ============================ */
.edit-form {
  display: none;
}

.edit-form.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.info-grid.editing {
  display: none;
}

.edit-buttons {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ============================
   FORM LOADING OVERLAY
   ============================ */
.form-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 24, 38, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.form-loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.form-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.form-loading-text {
  color: white;
  font-size: 16px;
  font-weight: 600;
}

/* ============================
   UPLOAD PROGRESS
   ============================ */
.upload-progress {
  width: 100%;
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 2px;
  margin: 10px 0;
  overflow: hidden;
  display: none;
}

.upload-progress.active {
  display: block;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ============================
   MEAL ADDING/DELETING ANIMATIONS
   ============================ */
.meal-card.adding {
  position: relative;
  overflow: hidden;
}

.meal-card.adding::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.2), transparent);
  animation: shimmer 1.5s infinite;
  z-index: 1;
}

.meal-card.success {
  animation: successPulse 0.6s ease;
}

.meal-card.deleting {
  opacity: 0.6;
  pointer-events: none;
}

.meal-card.deleting::after {
  content: 'Deleting...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--danger);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 10;
}

/* ============================
   NOTIFICATION SOUND INDICATOR
   ============================ */
.sound-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 2s infinite;
  margin-left: 8px;
}

/* ============================
   PLAN SUMMARY
   ============================ */
.plan-summary {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
  border: 1px solid var(--border);
}

.plan-summary h4 {
  margin-bottom: 16px;
  color: var(--text-primary);
  font-size: 18px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.summary-item.important {
  font-weight: 600;
  color: var(--primary);
}

.summary-total {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
  border-top: 2px solid var(--border);
  margin-top: 8px;
}

/* ============================
   MULTI-MEAL FORM
   ============================ */
.meal-entry {
  margin-bottom: 1rem;
  padding: 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 120px;
  align-items: center;
}

.meal-entry .remove-meal-row-btn {
  grid-column: 2 / 3;
  justify-self: end;
  margin-left: 8px;
}

.multi-meal-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ============================
   LOCATION BADGES
   ============================ */
.location-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
}

.location-table {
  background-color: rgba(30, 144, 255, 0.1);
  color: var(--info);
  border: 1px solid rgba(30, 144, 255, 0.3);
}

.location-room {
  background-color: rgba(255, 165, 2, 0.1);
  color: var(--warning);
  border: 1px solid rgba(255, 165, 2, 0.3);
}

/* ============================
   TEMPLATE STYLES
   ============================ */
.template-textarea {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.4;
}

.preview-content {
  margin-top: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

.template-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.test-section {
  margin-top: 24px;
  padding: 20px;
  background: rgba(30, 144, 255, 0.05);
  border-radius: var(--radius);
  border: 1px solid rgba(30, 144, 255, 0.2);
}

.test-section h4 {
  margin-bottom: 8px;
  color: var(--info);
}

.test-section p {
  color: var(--text-muted);
  margin-bottom: 12px;
  font-size: 14px;
}

/* ============================
   INPUT WITH PREFIX
   ============================ */
.input-with-prefix {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.input-prefix {
  padding: 12px 16px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 500;
  border-right: 1px solid var(--border);
}

.input-with-prefix input {
  border: none !important;
  background: transparent !important;
  flex: 1;
  padding: 12px 16px;
}

/* ============================
   CHECKBOX WITH CUSTOM CHECKMARK
   ============================ */
.checkbox-label .checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* ============================
   STEP INDICATOR WITH CONNECTOR
   ============================ */
.step-indicator {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  position: relative;
  margin: 0 40px 2rem;
}

.step-indicator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--bg-secondary);
  transform: translateY(-50%);
  z-index: 1;
}

.step {
  position: relative;
  z-index: 2;
}

/* Add to your CSS */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.loading::before {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.qr-code-container .loading {
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Add to your CSS file */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 10;
    border-radius: var(--radius);
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.success-flash {
    animation: successFlash 0.6s ease;
}

@keyframes successFlash {
    0% { background-color: rgba(34, 197, 94, 0.1); }
    50% { background-color: rgba(34, 197, 94, 0.3); }
    100% { background-color: transparent; }
}

/* Smooth modal close animation */
.modal-overlay {
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================
   MOBILE NAVIGATION FIXES
   ============================ */

/* Hide mobile elements on desktop */
@media (min-width: 769px) {
    .mobile-menu-toggle,
    .mobile-nav-overlay,
    .mobile-close {
        display: none !important;
    }
    
    .top-bar-left .menu-toggle {
        display: none !important;
    }
}

/* Show mobile elements only on mobile */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
        padding: 8px;
        z-index: 101;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
        background: var(--text-primary);
        transition: var(--transition);
    }
    
    .mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.9);
        z-index: 1000;
        display: none;
    }
    
    .mobile-nav-overlay.active {
        display: block;
    }
    
    .mobile-nav {
        width: 280px;
        height: 100%;
        background: var(--bg-card);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
    }
    
    .mobile-nav-overlay.active .mobile-nav {
        transform: translateX(0);
    }
    
    .mobile-nav-header {
        padding: 20px;
        border-bottom: 1px solid var(--border);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-nav-items {
        flex: 1;
        padding: 20px 0;
    }
    
    .mobile-nav-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 20px;
        color: var(--text-muted);
        cursor: pointer;
        transition: var(--transition);
        position: relative;
    }
    
    .mobile-nav-item.active {
        background: rgba(255, 107, 53, 0.1);
        color: var(--primary);
        border-right: 3px solid var(--primary);
    }
    
    .mobile-nav-item:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }
    
    .mobile-nav-icon {
        font-size: 18px;
        width: 24px;
        text-align: center;
    }
    
    .mobile-nav-text {
        font-weight: 600;
        font-size: 15px;
    }
    
    .mobile-close {
        background: none;
        border: none;
        font-size: 28px;
        color: var(--text-muted);
        cursor: pointer;
        padding: 4px;
        line-height: 1;
    }
    
    .mobile-close:hover {
        color: var(--text-primary);
    }
    
    .mobile-logo {
        font-size: 20px;
        font-weight: 800;
        color: var(--primary);
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    /* Show hamburger menu on mobile */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Hide desktop sidebar toggle on mobile */
    .top-bar-left .menu-toggle {
        display: none !important;
    }
}

/* For desktop, hide the mobile elements */
@media (min-width: 769px) {
    /* Make sure these are hidden on desktop */
    .mobile-menu-toggle,
    .mobile-nav-overlay,
    .mobile-nav,
    .mobile-close {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Show desktop sidebar toggle */
    .top-bar-left .menu-toggle {
        display: flex !important;
    }
}

/* ============================
   SIDEBAR TOGGLE STYLES
   ============================ */
.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--bg-hover);
}

/* Add to your CSS */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ============================
   FINAL END OF FILE
   ============================ */