/* SL Delivery Courier - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Nunito:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #0D1B45;
  --primary-light: #1a2d6e;
  --navy: #0D1B45;
  --accent: #F47B00;
  --accent-light: #ff9533;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --secondary: #6b7280;
  --white: #ffffff;
  --black: #000000;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  /* Semantic aliases */
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-light: #f8fafc;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: all .2s ease;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── TYPOGRAPHY ─────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); letter-spacing: 1px; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }

/* ── LAYOUT ──────────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.page-wrapper { display: flex; min-height: 100vh; }
.main-content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-x: hidden;
  margin-left: 260px;
  max-width: calc(100vw - 260px);
  box-sizing: border-box;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--primary);
  line-height: 1;
  letter-spacing: 1px;
}
.page-subtitle { font-size: .875rem; color: var(--text-muted); margin-top: .25rem; }
.header-actions { display: flex; align-items: center; gap: .75rem; }

/* ── SIDEBAR ─────────────────────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  background: var(--primary);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s ease;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sidebar-logo img { width: 44px; height: 44px; object-fit: contain; }
.sidebar-logo-text { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.2; }
.sidebar-logo-text span { display: block; font-family: var(--font-body); font-size: .65rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 2px; }

.sidebar-nav { padding: 1rem 0; flex: 1; }
.nav-section { padding: .5rem 1rem .25rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,.4); }
.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1.25rem;
  color: rgba(255,255,255,.75);
  font-weight: 600;
  font-size: .9rem;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item.active { background: var(--accent); color: var(--white); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: rgba(255,255,255,.5);
  border-radius: 0 4px 4px 0;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--white);
  font-size: .65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.3); }
.sidebar-bottom { padding: 1rem; border-top: 1px solid rgba(255,255,255,.1); }

/* ── TOPBAR ──────────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-family: var(--font-display); font-size: 1.4rem; color: var(--primary); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.btn-icon {
  width: 38px; height: 38px;
  border: none;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
  position: relative;
  transition: var(--transition);
}
.btn-icon:hover { background: var(--gray-200); color: var(--primary); }
.btn-icon .badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: var(--white);
  font-size: .6rem;
  font-weight: 800;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  font-weight: 800;
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.hamburger { display: none; background: none; border: none; cursor: pointer; color: var(--primary); font-size: 1.25rem; padding: 0.5rem; line-height: 1; }
/* Hamburger inside .mobile-topbar (navy background) should be white */
.mobile-topbar .hamburger { color: var(--white); }
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--primary);
  z-index: 200;
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.mobile-title { color: var(--white); font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 1px; }
.sidebar-close { display: none; background: none; border: none; cursor: pointer; color: rgba(255,255,255,0.7); font-size: 1.25rem; padding: 0.5rem; margin-left: auto; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ── CARDS ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-family: var(--font-display); font-size: 1.1rem; color: var(--primary); letter-spacing: .5px; }
.card-body { padding: 1.5rem; }

/* ── STAT CARDS ──────────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 1rem;
  align-items: center;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-info { flex: 1; }
.stat-value { font-family: var(--font-display); font-size: 1.6rem; color: var(--primary); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--gray-500); font-weight: 600; margin-top: .25rem; }
.stat-change { font-size: .75rem; font-weight: 700; margin-top: .25rem; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── BUTTONS ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .875rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-light); color: var(--white); }
.btn-dark { background: var(--primary); color: var(--white); }
.btn-dark:hover { background: var(--primary-light); color: var(--white); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-sm { padding: .4rem .9rem; font-size: .8rem; }
.btn-lg { padding: .9rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── FORMS ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 700; font-size: .875rem; color: var(--gray-700); margin-bottom: .4rem; }
.form-control {
  width: 100%;
  padding: .65rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(244,123,0,.15); }
.form-control.is-invalid { border-color: var(--danger); }
.form-error { font-size: .78rem; color: var(--danger); font-weight: 600; margin-top: .3rem; }
.input-group { position: relative; }
.input-group .form-control { padding-left: 2.75rem; }
.input-group-icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── TABLES ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--gray-50); }
th { padding: .75rem 1rem; text-align: left; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500); border-bottom: 2px solid var(--gray-200); white-space: nowrap; }
td { padding: .85rem 1rem; border-bottom: 1px solid var(--gray-100); font-size: .875rem; color: var(--gray-700); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ── BADGES ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #e0e7ff; color: var(--primary); }
.badge-accent { background: #fff3e0; color: #b45309; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ── ALERTS ──────────────────────────────────────────────────────────────────── */
.alert {
  padding: .9rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 1rem;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-danger { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--warning); }
.alert-info { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--info); }

/* ── MODAL ───────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.95) translateY(10px);
  transition: var(--transition);
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-family: var(--font-display); font-size: 1.2rem; color: var(--primary); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-100); display: flex; gap: .75rem; justify-content: flex-end; }
.btn-close { background: none; border: none; cursor: pointer; color: var(--gray-400); font-size: 1.2rem; line-height: 1; }

/* ── ORDER CARDS ─────────────────────────────────────────────────────────────── */
.order-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: var(--transition);
}
.order-card:hover { box-shadow: var(--shadow); }
.order-card-header {
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.order-card-body { padding: 1.25rem; }
.order-number { font-weight: 800; color: var(--primary); font-size: .875rem; }
.order-time { font-size: .75rem; color: var(--gray-400); }
.order-items { margin-bottom: .75rem; }
.order-item { display: flex; justify-content: space-between; font-size: .875rem; padding: .3rem 0; }
.order-item-name { color: var(--gray-700); }
.order-item-price { font-weight: 700; color: var(--gray-800); }
.order-total { border-top: 2px dashed var(--gray-200); padding-top: .75rem; display: flex; justify-content: space-between; font-weight: 800; color: var(--primary); }
.order-card-footer {
  padding: .75rem 1.25rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* ── STATUS TRACKER ──────────────────────────────────────────────────────────── */
.status-track { display: flex; gap: 0; margin: 1rem 0; }
.track-step {
  flex: 1;
  text-align: center;
  position: relative;
}
.track-step::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--gray-200);
}
.track-step:last-child::before { display: none; }
.track-step.done::before { background: var(--accent); }
.track-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-400);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .4rem;
  font-size: .7rem;
  position: relative;
  z-index: 1;
  transition: var(--transition);
}
.track-step.done .track-dot { background: var(--accent); color: var(--white); }
.track-step.active .track-dot { background: var(--primary); color: var(--white); box-shadow: 0 0 0 4px rgba(13,27,69,.2); }
.track-label { font-size: .65rem; font-weight: 700; color: var(--gray-400); }
.track-step.done .track-label, .track-step.active .track-label { color: var(--primary); }

/* ── MERCHANT GRID ───────────────────────────────────────────────────────────── */
.merchant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.merchant-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.merchant-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.merchant-banner { height: 120px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); position: relative; overflow: hidden; }
.merchant-banner img { width: 100%; height: 100%; object-fit: cover; }
.merchant-banner-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.4), transparent); }
.merchant-logo {
  position: absolute;
  bottom: -20px; left: 1rem;
  width: 52px; height: 52px;
  border-radius: 10px;
  background: var(--white);
  border: 3px solid var(--white);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.merchant-logo img { width: 100%; height: 100%; object-fit: cover; }
.merchant-info { padding: 1.5rem 1rem 1rem; }
.merchant-name { font-weight: 800; font-size: 1rem; color: var(--primary); }
.merchant-type { font-size: .75rem; color: var(--gray-500); font-weight: 600; }
.merchant-meta { display: flex; gap: 1rem; margin-top: .5rem; font-size: .78rem; color: var(--gray-500); }
.merchant-meta span { display: flex; align-items: center; gap: .25rem; }
.merchant-open { background: #d1fae5; color: #065f46; padding: .2rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 800; }
.merchant-closed { background: var(--gray-100); color: var(--gray-500); padding: .2rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 800; }

/* ── PRODUCT GRID ────────────────────────────────────────────────────────────── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product-img { height: 130px; background: var(--gray-100); overflow: hidden; position: relative; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-featured { position: absolute; top: .5rem; left: .5rem; background: var(--accent); color: var(--white); font-size: .65rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.product-info { padding: .85rem; }
.product-name { font-weight: 700; font-size: .875rem; color: var(--gray-800); margin-bottom: .25rem; }
.product-price { font-family: var(--font-display); font-size: 1.1rem; color: var(--accent); }
.product-price .original { font-size: .8rem; color: var(--gray-400); text-decoration: line-through; font-family: var(--font-body); }

/* ── CART SIDEBAR ────────────────────────────────────────────────────────────── */
.cart-sidebar {
  width: 340px;
  background: var(--white);
  border-left: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0; top: 0; bottom: 0;
  z-index: 200;
  transform: translateX(100%);
  transition: transform .3s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,.1);
}
.cart-sidebar.open { transform: translateX(0); }
.cart-header { padding: 1.25rem; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.cart-body { flex: 1; overflow-y: auto; padding: 1rem; }
.cart-footer { padding: 1.25rem; border-top: 1px solid var(--gray-100); }
.cart-item { display: flex; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--gray-100); }
.cart-item-img { width: 56px; height: 56px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; background: var(--gray-100); }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 700; font-size: .875rem; color: var(--gray-800); }
.cart-item-price { color: var(--accent); font-weight: 800; font-size: .875rem; }
.qty-control { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; }
.qty-btn { width: 24px; height: 24px; border: 2px solid var(--gray-300); border-radius: 50%; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 800; transition: var(--transition); }
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.qty-num { font-weight: 800; font-size: .875rem; min-width: 24px; text-align: center; }
.cart-summary { font-size: .875rem; }
.cart-summary-row { display: flex; justify-content: space-between; padding: .35rem 0; }
.cart-summary-row.total { font-weight: 800; font-size: 1rem; border-top: 2px solid var(--gray-200); padding-top: .75rem; margin-top: .25rem; color: var(--primary); }

/* ── LOGIN/REGISTER ──────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: var(--primary);
}
.auth-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(244,123,0,.1);
  top: -100px; right: -100px;
}
.auth-left::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(244,123,0,.08);
  bottom: -50px; left: -50px;
}
.auth-brand { text-align: center; position: relative; z-index: 1; }
.auth-brand img { width: 120px; margin-bottom: 1.5rem; }
.auth-brand h1 { font-family: var(--font-display); color: var(--white); font-size: 2.5rem; letter-spacing: 2px; }
.auth-brand p { color: rgba(255,255,255,.6); font-size: .9rem; margin-top: .5rem; }
.auth-right {
  width: 480px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-form-wrap { width: 100%; max-width: 400px; }
.auth-title { font-family: var(--font-display); font-size: 1.8rem; color: var(--primary); margin-bottom: .25rem; }
.auth-subtitle { color: var(--gray-500); font-size: .875rem; margin-bottom: 2rem; }
.auth-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-200); margin-bottom: 1.5rem; }
.auth-tab { padding: .65rem 1.25rem; font-weight: 700; color: var(--gray-400); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: var(--transition); }
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.role-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1.25rem; }
.role-btn {
  padding: .6rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: .78rem;
  font-weight: 700;
  color: var(--gray-500);
}
.role-btn.active { border-color: var(--accent); background: #fff3e0; color: var(--accent); }
.role-btn div:first-child { font-size: 1.4rem; margin-bottom: .2rem; }

/* ── RIDER ONLINE TOGGLE ─────────────────────────────────────────────────────── */
.toggle-online {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 2px solid var(--gray-200);
  cursor: pointer;
  transition: var(--transition);
}
.toggle-online.online { border-color: var(--success); background: #f0fdf4; }
.toggle-switch {
  width: 48px; height: 26px;
  background: var(--gray-300);
  border-radius: 999px;
  position: relative;
  transition: var(--transition);
}
.toggle-switch::after {
  content: '';
  width: 20px; height: 20px;
  background: var(--white);
  border-radius: 50%;
  position: absolute;
  top: 3px; left: 3px;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-online.online .toggle-switch { background: var(--success); }
.toggle-online.online .toggle-switch::after { left: 25px; }

/* ── MAP PLACEHOLDER ─────────────────────────────────────────────────────────── */
.map-box {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  border-radius: var(--radius);
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}
.map-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23cbd5e1' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── MISC ────────────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 1.25rem 0; }
.text-muted { color: var(--gray-500); }
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }
.fw-bold { font-weight: 800; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--gray-400); }
.empty-state svg { width: 64px; height: 64px; margin: 0 auto 1rem; opacity: .4; }
.empty-state p { font-size: .9rem; }
.rating { display: flex; gap: 2px; }
.star { color: #fbbf24; font-size: .9rem; }
.star.empty { color: var(--gray-300); }
.loading { display: flex; align-items: center; justify-content: center; padding: 3rem; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.slide-in { animation: slideIn .3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.with-sidebar { flex: 1; margin-left: 260px; max-width: calc(100vw - 260px); box-sizing: border-box; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .mobile-topbar { display: flex; }
  .sidebar { transform: translateX(-100%); top: 0; z-index: 200; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .with-sidebar { margin-left: 0 !important; max-width: 100vw !important; }
  .main-content { margin-left: 0 !important; max-width: 100vw !important; padding: 1rem; }
  /* Show hamburger everywhere on mobile */
  .hamburger { display: flex !important; align-items: center; justify-content: center; }
  .top-header .hamburger { display: flex !important; color: var(--primary); }
  /* Dashboard pages using .topbar inside .with-sidebar */
  .topbar .hamburger { display: flex !important; }
  /* Push content below topbar on pages using sidebar_*.php (mobile-topbar) */
  /* Pages with mobile-topbar (fixed): push content below it */
  body { padding-top: 0; }
  .main-content { padding-top: 1rem; }
  /* Pages with mobile-topbar need extra top padding */
  .mobile-topbar ~ * .main-content,
  .mobile-topbar + aside ~ * .main-content { margin-top: 56px; }
  .app-layout .main-content { margin-top: 56px; }
  .auth-left { display: none; }
  .auth-right { width: 100%; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .merchant-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .cart-sidebar { width: 100%; }
  .main-content { padding: 1rem; }
  .modal { max-width: 100%; margin: 0 0 0 0; border-radius: var(--radius) var(--radius) 0 0; position: fixed; bottom: 0; }
  .modal-overlay { align-items: flex-end; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .role-selector { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-right { padding: 1.5rem; }
}

/* ── ADMIN SPECIFICS ─────────────────────────────────────────────────────────── */
.admin-topbar-brand { display: flex; align-items: center; gap: .5rem; }
.revenue-big { font-family: var(--font-display); font-size: 2.5rem; color: var(--primary); }
.chart-wrap { height: 240px; }
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media(max-width:768px) { .data-grid { grid-template-columns: 1fr; } }

/* Print */
@media print {
  .sidebar, .topbar, .btn, .cart-sidebar { display: none !important; }
  .with-sidebar { margin-left: 0; }
}

/* ── ADMIN LAYOUT COMPATIBILITY ──────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.app-layout .main-content { margin-left: 260px; flex: 1; padding: 1.5rem 2rem; max-width: calc(100vw - 260px); box-sizing: border-box; }
.content-body { padding: 0; }
.top-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.top-header .hamburger { display: none; }
.top-header .page-title { margin-bottom: 0; }

/* When main-content is inside with-sidebar, don't double-add margin */
.with-sidebar .main-content { margin-left: 0; max-width: 100%; }

/* ── HAMBURGER VISIBILITY FIX ─────────────────────────────────────────────── */
/* Topbar hamburger (white bg) */
.topbar .hamburger {
  color: var(--primary);
  width: 40px; height: 40px;
  display: none; /* shown via media query */
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.topbar .hamburger:hover { background: var(--gray-100); }
.topbar .hamburger svg { stroke: currentColor; }

/* Mobile topbar hamburger (navy bg) */
.mobile-topbar .hamburger {
  color: var(--white);
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
}
