/* ==========================================================================
   ZAPZOVA — MULTI-ROLE SYSTEM DESIGN ENGINE & ROLE STYLES
   ========================================================================== */

:root {
  --primary: #FF4724;
  --primary-hover: #E03616;
  --primary-light: #FFF0ED;
  --primary-glow: rgba(255, 71, 36, 0.25);
  
  --secondary: #0F172A;
  --secondary-light: #1E293B;
  --secondary-muted: #334155;
  
  --accent-green: #10B981;
  --accent-green-bg: #ECFDF5;
  --accent-red: #EF4444;
  --accent-red-bg: #FEF2F2;
  --accent-orange: #F59E0B;
  --accent-orange-bg: #FFFBEB;
  --accent-blue: #3B82F6;
  --accent-blue-bg: #EFF6FF;
  --accent-purple: #8B5CF6;
  --accent-purple-bg: #F5F3FF;
  
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-subtle: #F1F5F9;
  
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --text-inverse: #FFFFFF;
  
  --border-color: #E2E8F0;
  --border-focus: #FF4724;
  
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 8px 24px rgba(255, 71, 36, 0.28);
  
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --portal-bar-height: 42px;
  --header-height: 70px;
  --bottom-nav-height: 64px;
  --sidebar-width: 250px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bottom-nav-height) + 20px);
}

body.portal-merchant,
body.portal-delivery,
body.portal-admin {
  padding-bottom: 0;
  background-color: #F1F5F9;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
}

button {
  cursor: pointer;
  user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
  object-fit: cover;
}

/* ==========================================================================
   TOP GLOBAL SYSTEM RIBBON
   ========================================================================== */
.global-portal-bar {
  height: var(--portal-bar-height);
  background: #090D16;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 200;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.portal-logo {
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.75rem;
  color: white;
}
.portal-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #94A3B8;
}
.portal-title strong {
  color: white;
}

.portal-switcher-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}
.portal-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #CBD5E1;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  white-space: nowrap;
}
.portal-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: white;
}
.portal-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* ==========================================================================
   CUSTOMER APP NAVBAR & LAYOUT
   ========================================================================== */
.navbar {
  position: sticky;
  top: var(--portal-bar-height);
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 768px) {
  .container { padding: 0 24px; }
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), #FF7A00);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--secondary);
}
.brand-title span {
  color: var(--primary);
}

.location-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: var(--transition);
  max-width: 240px;
}
.location-picker:hover { background: #E2E8F0; }
.location-info { display: flex; flex-direction: column; overflow: hidden; }
.location-label { font-size: 0.65rem; text-transform: uppercase; color: var(--primary); font-weight: 800; }
.location-value { font-size: 0.82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-search {
  flex: 1;
  max-width: 360px;
  position: relative;
  display: none;
}
@media (min-width: 768px) { .nav-search { display: block; } }
.nav-search input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: var(--transition);
}
.nav-search input:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.nav-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}
.nav-item:hover, .nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
}

.cart-btn-nav { position: relative; }
.cart-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: white;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 90;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.05);
}
@media (min-width: 1024px) { .mobile-bottom-nav { display: none; } }
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
}
.mobile-nav-item.active { color: var(--primary); font-weight: 800; }
.mobile-nav-item svg { width: 20px; height: 20px; }

.mobile-cart-bar {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 12px);
  left: 16px;
  right: 16px;
  background: var(--secondary);
  color: white;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 85;
  box-shadow: var(--shadow-lg);
  transform: translateY(150%);
  transition: transform 0.3s ease;
}
.mobile-cart-bar.active { transform: translateY(0); }
@media (min-width: 1024px) { .mobile-cart-bar { display: none; } }
.mobile-cart-info { display: flex; flex-direction: column; }
.mobile-cart-count { font-size: 0.75rem; color: var(--text-light); }
.mobile-cart-total { font-size: 1rem; font-weight: 800; }
.mobile-cart-action { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--primary); }

/* BUTTONS & BADGES */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  cursor: pointer;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-subtle); color: var(--text-main); }
.btn-secondary:hover { background: #E2E8F0; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-dark { background: var(--secondary); color: white; }
.btn-dark:hover { background: var(--secondary-light); }
.btn-success { background: var(--accent-green); color: white; }
.btn-danger { background: var(--accent-red); color: white; }
.btn-warning { background: var(--accent-orange); color: white; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: var(--radius-xs); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-green { background: var(--accent-green-bg); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-orange { background: var(--accent-orange-bg); color: var(--accent-orange); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-red { background: var(--accent-red-bg); color: var(--accent-red); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-blue { background: var(--accent-blue-bg); color: var(--accent-blue); border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-purple { background: var(--accent-purple-bg); color: var(--accent-purple); border: 1px solid rgba(139, 92, 246, 0.2); }

.veg-icon, .nonveg-icon {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--accent-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 4px;
  flex-shrink: 0;
}
.veg-icon::after { content: ''; width: 8px; height: 8px; background: var(--accent-green); border-radius: 50%; }
.nonveg-icon { border-color: var(--accent-red); }
.nonveg-icon::after {
  content: ''; width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 8px solid var(--accent-red);
}

/* ==========================================================================
   AUTHENTICATION SCREENS, FORMS & MULTI-ROLE TAB SYSTEM
   ========================================================================== */
.auth-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  max-width: 540px;
  margin: 30px auto;
}
.auth-header { text-align: center; margin-bottom: 20px; }
.auth-title { font-size: 1.5rem; font-weight: 800; color: var(--secondary); }
.auth-subtitle { font-size: 0.88rem; color: var(--text-muted); margin-top: 4px; }

/* Role Switcher Pills inside Auth Container */
.auth-role-pills {
  display: flex;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}
.auth-role-pill {
  flex: 1;
  text-align: center;
  padding: 8px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.auth-role-pill:hover { color: var(--secondary); }
.auth-role-pill.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Auth Tabs (Sign In / Sign Up) */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.auth-tab:hover {
  color: var(--secondary);
}
.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.security-hint {
  background: var(--accent-blue-bg);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: #1E40AF;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.security-hint code {
  background: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 540px) {
  .form-row { grid-template-columns: 1fr; }
}
.form-group { margin-bottom: 16px; position: relative; }
.form-label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--secondary); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  background: white;
  transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-error {
  font-size: 0.82rem;
  color: var(--accent-red);
  background: var(--accent-red-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
}
.form-error.active { display: block; }

.auth-footer-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 0.85rem;
}
.auth-link {
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}
.auth-link:hover { text-decoration: underline; }

/* ADDRESS & PAYMENT SELECTOR CARDS */
.address-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.address-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.address-radio { margin-top: 3px; accent-color: var(--primary); }
.address-details { flex: 1; }
.address-title { font-weight: 800; font-size: 0.9rem; margin-bottom: 2px; color: var(--secondary); }
.address-text { font-size: 0.85rem; color: var(--text-muted); }

.payment-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}
.payment-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.payment-icon { font-size: 1.4rem; }
.payment-title { font-weight: 800; font-size: 0.9rem; color: var(--secondary); }
.payment-badge { margin-left: auto; font-size: 0.7rem; font-weight: 800; color: var(--accent-green); background: var(--accent-green-bg); padding: 2px 8px; border-radius: 4px; }

/* UPI PAYMENT ENHANCEMENT STYLES */
.upi-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.upi-qr-frame {
  display: inline-block;
  padding: 16px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
  margin: 16px 0;
}
.upi-qr-img {
  width: 220px;
  height: 220px;
  display: block;
  margin: 0 auto;
}
.upi-vpa-box {
  background: var(--bg-subtle);
  border: 1px dashed var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.upi-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-orange-bg);
  color: var(--accent-orange);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.payment-status-card {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 16px 0;
  border: 1px solid var(--border-color);
  text-align: left;
}

/* DELIVERY COD COLLECTION STYLES */
.cod-collection-box {
  background: #FFFBEB;
  border: 2px solid #F59E0B;
  border-radius: var(--radius-md);
  padding: 18px;
  margin: 16px 0;
}
.cod-amount-tag {
  font-size: 1.8rem;
  font-weight: 900;
  color: #B45309;
  font-family: var(--font-mono);
}
.prepaid-order-box {
  background: #ECFDF5;
  border: 2px solid #10B981;
  border-radius: var(--radius-md);
  padding: 18px;
  margin: 16px 0;
  color: #065F46;
}

/* ==========================================================================
   CUSTOMER APP CARDS & COMPONENTS
   ========================================================================== */
.home-hero {
  padding: 24px 0;
  background: linear-gradient(180deg, #FFF0ED 0%, var(--bg-main) 100%);
}
.search-box-hero { margin-top: 16px; position: relative; }
.search-box-hero input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  background: white;
  border: 2px solid transparent;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.search-box-hero input:focus { border-color: var(--primary); }
.search-box-hero-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--primary);
}

.category-pills {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
}
.category-pill {
  background: white;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}
.category-pill.active, .category-pill:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.section-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 1.3rem; font-weight: 800; color: var(--secondary); }

.restaurant-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
@media (min-width: 640px) { .restaurant-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .restaurant-grid { grid-template-columns: repeat(3, 1fr); } }

.restaurant-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}
.restaurant-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 71, 36, 0.3);
}
.restaurant-img-wrap { position: relative; height: 170px; width: 100%; background: var(--bg-subtle); }
.restaurant-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.offer-badge-card {
  position: absolute; bottom: 12px; left: 12px; background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px); color: white; padding: 4px 10px; border-radius: var(--radius-xs);
  font-size: 0.75rem; font-weight: 700;
}
.closed-overlay {
  position: absolute; inset: 0; background: rgba(15, 23, 42, 0.65);
  display: flex; align-items: center; justify-content: center; color: white;
  font-weight: 800; font-size: 1.1rem; text-transform: uppercase; z-index: 5;
}
.restaurant-info { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.restaurant-name { font-size: 1.1rem; font-weight: 700; color: var(--secondary); display: flex; justify-content: space-between; align-items: center; }
.restaurant-cuisine { font-size: 0.85rem; color: var(--text-muted); }
.restaurant-meta { display: flex; align-items: center; gap: 12px; font-size: 0.82rem; font-weight: 600; }
.rating-badge { background: var(--accent-green); color: white; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: 800; }

.food-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.food-details { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.food-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.food-title { font-size: 1.05rem; font-weight: 700; color: var(--secondary); }
.food-price { font-size: 0.95rem; font-weight: 800; color: var(--secondary); }
.food-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.food-media { position: relative; width: 110px; height: 100px; flex-shrink: 0; }
.food-media img { width: 100%; height: 100%; border-radius: var(--radius-sm); object-fit: cover; }
.add-btn {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  background: white; color: var(--accent-green); border: 1.5px solid var(--accent-green);
  padding: 4px 14px; border-radius: var(--radius-xs); font-weight: 800; font-size: 0.8rem;
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.add-btn:hover { background: var(--accent-green); color: white; }

/* ==========================================================================
   CART DRAWER & CHECKOUT
   ========================================================================== */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(4px);
  z-index: 120; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.drawer-backdrop.active { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 420px;
  background: white; z-index: 130; box-shadow: var(--shadow-lg); transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column;
}
.cart-drawer.active { transform: translateX(0); }
.cart-header { padding: 16px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.cart-title { font-size: 1.1rem; font-weight: 800; }
.close-btn { background: var(--bg-subtle); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.cart-body { flex: 1; overflow-y: auto; padding: 20px; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px dashed var(--border-color); }
.qty-control { display: flex; align-items: center; border: 1px solid var(--border-color); border-radius: var(--radius-xs); background: white; }
.qty-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--bg-subtle); font-weight: 700; }
.qty-val { padding: 0 10px; font-size: 0.85rem; font-weight: 800; }
.bill-details { background: var(--bg-subtle); padding: 16px; border-radius: var(--radius-sm); margin-top: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; }
.bill-row { display: flex; justify-content: space-between; color: var(--text-muted); }
.bill-row.total { font-size: 1rem; font-weight: 800; color: var(--secondary); border-top: 1px solid var(--border-color); padding-top: 8px; }
.cart-footer { padding: 16px 20px; border-top: 1px solid var(--border-color); background: white; }

/* LIVE TRACKING TIMELINE & LEAFLET MAPS */
.timeline { display: flex; flex-direction: column; gap: 16px; position: relative; margin: 20px 0; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--border-color); }
.timeline-step { position: relative; font-size: 0.9rem; color: var(--text-muted); }
.timeline-step::before { content: ''; position: absolute; left: -24px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--border-color); border: 2px solid white; }
.timeline-step.completed { color: var(--secondary); font-weight: 700; }
.timeline-step.completed::before { background: var(--accent-green); }
.timeline-step.active { color: var(--primary); font-weight: 800; }
.timeline-step.active::before { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }

.map-container {
  width: 100%;
  height: 280px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  margin-bottom: 16px;
}

/* ==========================================================================
   MERCHANT, DELIVERY & ADMIN PORTAL LAYOUTS
   ========================================================================== */
.portal-wrapper { display: flex; min-height: calc(100vh - var(--portal-bar-height)); background: #F8FAFC; }

.portal-sidebar {
  width: var(--sidebar-width); background: var(--secondary); color: white;
  display: flex; flex-direction: column; position: fixed; top: var(--portal-bar-height);
  bottom: 0; left: 0; z-index: 100; box-shadow: 4px 0 20px rgba(0,0,0,0.08);
}
.portal-sidebar-header {
  padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: space-between;
}
.portal-sidebar-title { font-size: 0.95rem; font-weight: 800; color: white; display: flex; align-items: center; gap: 8px; }
.portal-sidebar-title span { color: var(--primary); }

.portal-nav { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; }
.portal-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 0.83rem; font-weight: 600; color: #94A3B8; cursor: pointer; transition: var(--transition);
}
.portal-nav-item:hover { color: white; background: rgba(255,255,255,0.06); }
.portal-nav-item.active {
  color: white; background: var(--primary); font-weight: 700; box-shadow: 0 4px 12px var(--primary-glow);
}
.portal-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.portal-main {
  flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-width: 0;
}
.portal-topbar {
  height: var(--header-height); background: white; border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: var(--portal-bar-height); z-index: 90;
}
.portal-body { padding: 24px; flex: 1; }

/* STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: white; border-radius: var(--radius-md); padding: 16px; border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px;
}
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.stat-value { font-size: 1.35rem; font-weight: 800; color: var(--secondary); line-height: 1.2; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

/* DATA TABLES */
.table-container { background: white; border-radius: var(--radius-md); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); overflow-x: auto; margin-bottom: 24px; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.85rem; }
.data-table th { background: var(--bg-subtle); padding: 12px 14px; font-weight: 700; color: var(--secondary); border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.data-table tr:hover td { background: rgba(248, 250, 252, 0.8); }

/* KITCHEN DISPLAY SYSTEM (KDS) */
.kds-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; min-height: 480px; }
@media (max-width: 900px) { .kds-grid { grid-template-columns: 1fr; } }
.kds-column { background: #1E293B; border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; color: white; }
.kds-column-header { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 1.05rem; padding-bottom: 12px; border-bottom: 2px solid rgba(255,255,255,0.1); margin-bottom: 14px; }
.kds-cards-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.kds-card { background: #0F172A; border-radius: var(--radius-sm); padding: 14px; border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.kds-card-header { display: flex; justify-content: space-between; align-items: center; font-weight: 800; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 8px; margin-bottom: 8px; }
.kds-item { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 4px; }

/* PRINT KOT RECEIPT STYLES */
.kot-ticket {
  font-family: var(--font-mono);
  width: 280px;
  margin: 0 auto;
  padding: 16px;
  background: #FFF;
  color: #000;
  border: 1px dashed #333;
  font-size: 0.85rem;
  line-height: 1.4;
}
.kot-header { text-align: center; border-bottom: 2px dashed #000; padding-bottom: 10px; margin-bottom: 10px; }
.kot-title { font-size: 1.2rem; font-weight: 900; letter-spacing: 1px; }
.kot-items { border-bottom: 2px dashed #000; padding-bottom: 10px; margin-bottom: 10px; }
.kot-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.kot-notes { font-style: italic; font-size: 0.8rem; background: #EEE; padding: 6px; margin-top: 6px; text-align: center; }

/* MODALS & TOASTS */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px);
  z-index: 220; display: none;
}
.modal-overlay.active { display: block; }
.modal-container {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95);
  width: 92%; max-width: 640px; max-height: 90vh; overflow-y: auto;
  background: white; border-radius: var(--radius-md); z-index: 230;
  box-shadow: var(--shadow-lg); display: none;
}
.modal-container.active { display: block; transform: translate(-50%, -50%) scale(1); }
.modal-padding { padding: 24px; }

.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--secondary); color: white; padding: 12px 20px;
  border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600;
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.empty-state {
  text-align: center; padding: 44px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; color: var(--text-light); }
.empty-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 4px; }
.empty-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }