/* ============================================================
   BSL Driver Hub — Theme (v1.1)
   Brand kit: Burger Specialist Ltd. · Macoya · 2026 Edition
   v1.1: bigger tap targets, FAB, decision-panel admin, dopamine
   ============================================================ */

:root {
  /* Primary palette */
  --c-black: #0A0A0A;
  --c-red: #C8102E;
  --c-bun: #F8A01F;
  --c-gold: #F0E63C;

  /* Secondary */
  --c-flame: #B4491D;
  --c-cheese: #FFC250;
  --c-lettuce: #57943B;
  --c-tomato: #AB2F2D;

  /* Neutrals */
  --c-charcoal: #221A0D;
  --c-espresso: #290600;
  --c-cream: #FCF0E2;
  --c-white: #FFFFFF;
  --c-line: #ECDFCC;
  --c-line-2: #DECBB1;
  --c-mute: #6B5A45;

  /* Semantic */
  --s-good: var(--c-lettuce);
  --s-warn: var(--c-bun);
  --s-bad: var(--c-red);

  /* Surface */
  --bg-app: var(--c-cream);
  --bg-card: var(--c-white);
  --bg-dark: var(--c-black);
  --tx-default: var(--c-charcoal);
  --tx-mute: var(--c-mute);

  /* Spacing + radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(34, 26, 13, 0.06), 0 1px 1px rgba(34, 26, 13, 0.04);
  --shadow-md: 0 4px 14px rgba(34, 26, 13, 0.08), 0 2px 4px rgba(34, 26, 13, 0.04);
  --shadow-lg: 0 10px 30px rgba(34, 26, 13, 0.12);
  --shadow-glow: 0 0 0 4px rgba(248, 160, 31, 0.18);

  --topbar-h: 64px;
  --sidenav-w: 240px;

  --t-fast: 120ms ease;
  --t-mid: 220ms cubic-bezier(.2,.8,.2,1);
}

/* Reset */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg-app);
  color: var(--tx-default);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body { min-height: 100vh; min-height: 100svh; }

h1, h2, h3, h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--c-black);
}
h1 { font-size: 24px; letter-spacing: -0.01em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-mute); }

a { color: var(--c-red); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit;
  font-size: 16px; /* 16+ prevents iOS zoom on focus */
  border: 1px solid var(--c-line-2);
  background: var(--c-white);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  width: 100%;
  color: var(--tx-default);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  min-height: 48px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--c-red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

label { font-size: 12px; font-weight: 600; color: var(--c-mute); text-transform: uppercase; letter-spacing: 0.04em; display: block; margin-bottom: 6px; }

.hidden { display: none !important; }
.muted { color: var(--c-mute); }
.muted-tiny { color: var(--c-mute); font-size: 11px; }

/* ============================================================
   Buttons — bigger, more confident
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--c-red);
  color: var(--c-white);
  font-weight: 700;
  font-family: 'Poppins';
  border: none;
  padding: 14px 22px;
  border-radius: var(--r-sm);
  font-size: 14px;
  min-height: 48px;
  transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { background: #B00B27; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-secondary { background: var(--c-black); }
.btn-secondary:hover { background: #1d1d1d; }
.btn-bun { background: var(--c-bun); color: var(--c-black); }
.btn-bun:hover { background: #E69417; }
.btn-good { background: var(--c-lettuce); }
.btn-good:hover { background: #4A8030; }
.btn-ghost { background: transparent; color: var(--c-charcoal); border: 1px solid var(--c-line-2); }
.btn-ghost:hover { background: var(--c-cream); }
.btn-sm { padding: 8px 14px; font-size: 12px; min-height: 36px; }
.btn-lg { padding: 18px 32px; font-size: 18px; min-height: 60px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Hero CTA: full-width, big, dominant — used on driver dashboard */
.btn-hero {
  width: 100%;
  padding: 22px;
  font-size: 19px;
  border-radius: var(--r-md);
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-md);
  min-height: 64px;
}

/* WhatsApp button */
.btn-wa {
  background: #25D366;
  color: white;
}
.btn-wa:hover { background: #1FB958; }

/* ============================================================
   Login screen — phone-OTP redesign
   ============================================================ */
.login-screen {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 0%, rgba(248,160,31,0.18), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(200,16,46,0.18), transparent 50%),
    var(--c-black);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--c-white);
  border-radius: var(--r-xl);
  padding: 36px 26px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo { width: 90px; height: auto; margin: 0 auto 14px; display: block; }
.login-title { font-size: 26px; margin-bottom: 4px; }
.login-sub { color: var(--c-mute); margin: 0 0 24px; font-size: 13px; }
.login-hint {
  font-size: 12px;
  color: var(--c-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
  font-weight: 600;
}
.phone-input-wrap {
  display: flex;
  align-items: center;
  background: var(--c-cream);
  border: 2px solid transparent;
  border-radius: var(--r-md);
  padding: 4px 4px 4px 16px;
  margin-bottom: 14px;
  transition: border-color var(--t-fast);
}
.phone-input-wrap:focus-within { border-color: var(--c-red); background: white; }
.phone-input-wrap .country { font-weight: 600; color: var(--c-mute); margin-right: 8px; font-size: 16px; }
.phone-input-wrap input {
  border: none;
  background: transparent;
  padding: 14px 8px;
  font-size: 18px;
  letter-spacing: 0.03em;
  font-weight: 600;
  min-height: 56px;
}
.phone-input-wrap input:focus { box-shadow: none; }

.otp-input {
  font-size: 28px !important;
  text-align: center;
  letter-spacing: 0.5em;
  font-family: 'Poppins';
  font-weight: 700;
  padding-left: 0.5em !important;
}

.demo-hint {
  margin-top: 14px;
  font-size: 11px;
  color: var(--c-mute);
  background: var(--c-cream);
  padding: 10px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--c-line-2);
  text-align: left;
}
.demo-hint strong { color: var(--c-flame); }

.login-foot { margin-top: 18px; font-size: 11px; color: var(--c-mute); }

/* ============================================================
   App shell
   ============================================================ */
.main-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: var(--sidenav-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidenav view";
}
.topbar {
  grid-area: topbar;
  background: var(--c-black);
  color: var(--c-white);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  box-shadow: 0 2px 0 var(--c-red);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 36px; height: 36px; object-fit: contain; }
.brand-text strong { font-family: 'Poppins'; font-weight: 700; display: block; line-height: 1; color: var(--c-bun); font-size: 15px; }
.brand-text span { font-size: 11px; color: rgba(252,240,226,0.75); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  background: rgba(255,255,255,0.06);
  color: var(--c-white);
  border: none;
  border-radius: var(--r-sm);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background var(--t-fast);
}
.icon-btn:hover { background: rgba(255,255,255,0.14); }
.badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--c-red);
  color: var(--c-white);
  font-size: 10px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-weight: 700;
}
.badge[data-count="0"] { display: none; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-bun);
  color: var(--c-black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Poppins';
  font-size: 13px;
}
.user-meta strong { display: block; line-height: 1; font-size: 13px; color: var(--c-white); }
.user-meta span { font-size: 11px; color: rgba(252,240,226,0.7); }

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  background: var(--c-lettuce);
}
.online-dot.offline { background: var(--c-red); }

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 4px;
}
.nav-toggle span { display: block; width: 100%; height: 2px; background: var(--c-white); border-radius: 1px; }

.sidenav {
  grid-area: sidenav;
  background: var(--c-charcoal);
  color: var(--c-cream);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  height: calc(100svh - var(--topbar-h));
  overflow-y: auto;
}
.sidenav nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  color: rgba(252,240,226,0.85);
  font-weight: 500;
  font-size: 14px;
  transition: background var(--t-fast), color var(--t-fast);
  min-height: 44px;
}
.nav-link:hover { background: rgba(252,240,226,0.06); color: var(--c-cream); }
.nav-link.active {
  background: var(--c-red);
  color: var(--c-white);
  font-weight: 700;
}
.nav-icon { font-size: 16px; width: 22px; text-align: center; }
.sidenav-foot { padding-top: 14px; border-top: 1px solid rgba(252,240,226,0.08); display: flex; flex-direction: column; gap: 8px; }
.nav-backdrop {
  display: none;
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(0,0,0,0.4);
  z-index: 40;
}

/* ============================================================
   View
   ============================================================ */
.view {
  grid-area: view;
  padding: 22px;
  max-width: 1400px;
  width: 100%;
  padding-bottom: 100px; /* room for FAB */
}
.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.view-head h1 { margin: 0; }
.view-sub { color: var(--c-mute); font-size: 13px; margin: 0; }
.view-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--bg-card);
  border-radius: var(--r-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-line);
}
.card.dark {
  background: var(--c-black);
  color: var(--c-cream);
  border-color: transparent;
}
.card.dark h2, .card.dark h3 { color: var(--c-bun); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}
.card-head h3 { margin: 0; }

.grid {
  display: grid;
  gap: 16px;
}
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* KPI tile */
.kpi {
  background: var(--c-white);
  border-radius: var(--r-md);
  padding: 16px;
  border: 1px solid var(--c-line);
  position: relative;
  overflow: hidden;
}
.kpi::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--c-bun); }
.kpi.kpi-red::before { background: var(--c-red); }
.kpi.kpi-good::before { background: var(--c-lettuce); }
.kpi.kpi-warn::before { background: var(--c-cheese); }
.kpi.kpi-bad::before { background: var(--c-red); }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-mute); font-weight: 600; margin: 0 0 4px; }
.kpi-value { font-family: 'Poppins'; font-weight: 700; font-size: 26px; color: var(--c-black); line-height: 1.1; }
.kpi-delta { font-size: 12px; color: var(--c-mute); margin-top: 4px; }
.kpi-delta.up { color: var(--c-lettuce); }
.kpi-delta.down { color: var(--c-red); }

/* ============================================================
   DRIVER DASHBOARD — money-front design
   ============================================================ */
.earnings-hero {
  background: linear-gradient(135deg, var(--c-black) 0%, #1a0d0a 50%, #2a1410 100%);
  color: var(--c-cream);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}
.earnings-hero::before {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248,160,31,0.25) 0%, transparent 70%);
  pointer-events: none;
}
.earnings-hero::after {
  content: '';
  position: absolute;
  left: -40px;
  bottom: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,16,46,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.earnings-hero .earnings-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(252,240,226,0.7);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  position: relative;
}
.earnings-hero .earnings-amount {
  font-family: 'Poppins';
  font-weight: 800;
  font-size: 56px;
  letter-spacing: -0.02em;
  color: var(--c-bun);
  line-height: 1;
  margin: 6px 0;
  position: relative;
}
.earnings-hero .earnings-amount.huge { font-size: 64px; }
.earnings-hero .earnings-meta {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  flex-wrap: wrap;
  position: relative;
}
.earnings-hero .stat strong { display: block; font-family: 'Poppins'; font-weight: 700; font-size: 18px; color: var(--c-cream); line-height: 1.1; }
.earnings-hero .stat span { color: rgba(252,240,226,0.65); font-size: 12px; }

.shift-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.shift-pill.on  { background: var(--c-lettuce); color: var(--c-white); }
.shift-pill.off { background: rgba(252,240,226,0.18); color: var(--c-cream); }

.live-clock {
  font-family: 'Poppins';
  font-weight: 800;
  font-size: 32px;
  color: var(--c-cream);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

/* Bonus progress — emotional, motivating */
.bonus-card {
  background: linear-gradient(135deg, var(--c-cream) 0%, #fff5e1 100%);
  border-radius: var(--r-md);
  padding: 18px;
  border: 1px solid var(--c-line-2);
  margin-bottom: 16px;
}
.bonus-card .head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.bonus-card .head strong {
  font-family: 'Poppins';
  font-weight: 700;
  font-size: 16px;
  color: var(--c-black);
}
.bonus-card .head .target {
  font-family: 'Poppins';
  font-weight: 800;
  color: var(--c-flame);
  font-size: 18px;
}
.bonus-card .bar {
  position: relative;
  height: 14px;
  background: var(--c-white);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--c-line);
}
.bonus-card .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-bun) 0%, var(--c-red) 100%);
  border-radius: 8px;
  transition: width 700ms cubic-bezier(.2,1.6,.5,1);
}
.bonus-card .hint {
  margin-top: 10px;
  font-size: 14px;
  color: var(--c-charcoal);
  font-weight: 500;
}
.bonus-card .hint .fire { font-size: 18px; }
.bonus-card .hint strong { color: var(--c-red); font-family: 'Poppins'; }
.bonus-card .projection {
  margin-top: 8px;
  font-size: 12px;
  color: var(--c-mute);
  font-style: italic;
}

/* Floating Action Button */
.fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--c-red);
  color: white;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-family: 'Poppins';
  font-weight: 700;
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(200, 16, 46, 0.18);
  z-index: 70;
  cursor: pointer;
  transition: transform var(--t-fast);
}
.fab:hover { transform: scale(1.05); }
.fab:active { transform: scale(0.95); }
.fab span.fab-label {
  position: absolute;
  right: 70px;
  background: var(--c-black);
  color: var(--c-white);
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
}
.fab:hover span.fab-label { opacity: 1; }

/* Recent feedback list */
.feedback-row {
  background: var(--c-cream);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  border-left: 3px solid var(--c-bun);
  margin-bottom: 8px;
}
.feedback-row.has-tip { border-left-color: var(--c-lettuce); }
.feedback-row .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.feedback-row .tip-pill {
  background: var(--c-lettuce);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}
.feedback-row .text { font-size: 13px; }
.feedback-row .meta { font-size: 11px; color: var(--c-mute); margin-top: 4px; }

/* ============================================================
   ADMIN COCKPIT — decision panel
   ============================================================ */
.cockpit-mood {
  background: linear-gradient(135deg, var(--c-black) 0%, #1a0d0a 100%);
  color: var(--c-cream);
  border-radius: var(--r-xl);
  padding: 24px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 6px solid var(--c-lettuce);
}
.cockpit-mood.mood-warn { border-left-color: var(--c-bun); }
.cockpit-mood.mood-bad { border-left-color: var(--c-red); }
.cockpit-mood .mood-icon { font-size: 36px; }
.cockpit-mood .mood-text strong { display: block; font-family: 'Poppins'; font-weight: 700; font-size: 18px; }
.cockpit-mood .mood-text span { color: rgba(252,240,226,0.7); font-size: 13px; }

.insights-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.insight {
  background: var(--c-white);
  border-radius: var(--r-md);
  padding: 16px;
  border: 1px solid var(--c-line);
  border-left: 4px solid var(--c-bun);
}
.insight.sev-bad { border-left-color: var(--c-red); }
.insight.sev-warn { border-left-color: var(--c-bun); }
.insight.sev-good { border-left-color: var(--c-lettuce); }
.insight .head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.insight .icon { font-size: 22px; flex-shrink: 0; }
.insight .head-text { flex: 1; }
.insight .head-text strong { font-family: 'Poppins'; font-weight: 700; font-size: 15px; color: var(--c-black); display: block; }
.insight .detail { font-size: 13px; color: var(--c-mute); margin-bottom: 10px; }
.insight .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--c-line); background: var(--c-white); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--c-line); }
th { background: var(--c-cream); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; color: var(--c-mute); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(252, 240, 226, 0.4); }
.t-right { text-align: right; }
.t-center { text-align: center; }

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--c-cream);
  color: var(--c-charcoal);
}
.pill-good { background: rgba(87,148,59,0.14); color: var(--c-lettuce); }
.pill-warn { background: rgba(248,160,31,0.18); color: var(--c-flame); }
.pill-bad { background: rgba(200,16,46,0.12); color: var(--c-red); }
.pill-neutral { background: var(--c-line); color: var(--c-charcoal); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-good { background: var(--c-lettuce); }
.dot-warn { background: var(--c-bun); }
.dot-bad { background: var(--c-red); }

/* Forms */
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.form-row.single { grid-template-columns: 1fr; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }
.field-help { font-size: 11px; color: var(--c-mute); margin: 4px 0 0; }

/* Modals + drawer */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 200ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--c-white);
  border-radius: var(--r-lg);
  padding: 24px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn 200ms cubic-bezier(.2,.8,.2,1);
}
@keyframes popIn { from { transform: translateY(20px) scale(0.96); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-card h2 { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.alerts-drawer {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  width: 380px;
  max-width: 100%;
  height: calc(100vh - var(--topbar-h));
  height: calc(100svh - var(--topbar-h));
  background: var(--c-white);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  transform: translateX(100%);
  transition: transform var(--t-mid);
  display: flex;
  flex-direction: column;
}
.alerts-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--c-line); }
.alerts-list { flex: 1; overflow-y: auto; padding: 10px; }
.alert-row {
  background: var(--c-cream);
  border-radius: var(--r-sm);
  padding: 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--c-bun);
}
.alert-row.sev-bad { border-left-color: var(--c-red); }
.alert-row.sev-good { border-left-color: var(--c-lettuce); }
.alert-row .alert-time { font-size: 11px; color: var(--c-mute); }
.alert-row .alert-msg { font-weight: 500; margin-top: 2px; font-size: 13px; }

/* Toasts */
.toasts { position: fixed; bottom: 100px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--c-charcoal);
  color: var(--c-cream);
  padding: 12px 18px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  border-left: 4px solid var(--c-bun);
  pointer-events: auto;
  font-weight: 500;
}
.toast.toast-good { border-left-color: var(--c-lettuce); }
.toast.toast-bad { border-left-color: var(--c-red); }

/* Filters */
.filters {
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}
.filters .field { display: flex; flex-direction: column; gap: 4px; }
.filters .field label { margin: 0; }
.filters .field select, .filters .field input { padding: 10px 12px; min-height: 42px; }

/* Profile + avatar */
.avatar-lg {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--c-bun);
  color: var(--c-black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Poppins';
  font-size: 22px;
  flex-shrink: 0;
}
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }

/* Stars */
.stars { display: inline-flex; gap: 2px; color: var(--c-bun); }
.star { font-size: 14px; line-height: 1; }
.star.empty { color: var(--c-line-2); }

/* Empty state */
.empty { text-align: center; padding: 40px 20px; color: var(--c-mute); }
.empty-icon { font-size: 36px; margin-bottom: 8px; }

/* ============================================================
   MARKETPLACE SHIFTS
   ============================================================ */
.marketplace-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.shift-card {
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 18px;
  position: relative;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.shift-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.shift-card.claimed { opacity: 0.6; }
.shift-card .day {
  font-family: 'Poppins';
  font-weight: 700;
  font-size: 14px;
  color: var(--c-flame);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.shift-card .time {
  font-family: 'Poppins';
  font-weight: 800;
  font-size: 22px;
  color: var(--c-black);
  margin-bottom: 6px;
}
.shift-card .zone { font-size: 13px; color: var(--c-mute); margin-bottom: 12px; }
.shift-card .forecast {
  background: var(--c-cream);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 12px;
  margin-bottom: 12px;
  border-left: 3px solid var(--c-lettuce);
}
.shift-card .forecast strong { color: var(--c-lettuce); font-family: 'Poppins'; }

/* ============================================================
   LEADERBOARD
   ============================================================ */
.leaderboard { display: flex; flex-direction: column; gap: 8px; }
.leader-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--c-white);
  border-radius: var(--r-md);
  border: 1px solid var(--c-line);
}
.leader-row.gold { border-color: var(--c-gold); background: linear-gradient(135deg, #fffaeb 0%, #fff 60%); }
.leader-row.silver { border-color: var(--c-line-2); }
.leader-row.bronze { border-color: var(--c-flame); }
.leader-rank {
  font-family: 'Poppins';
  font-weight: 800;
  font-size: 24px;
  color: var(--c-mute);
  width: 36px;
  text-align: center;
}
.leader-row.gold .leader-rank { color: var(--c-flame); font-size: 28px; }

/* ============================================================
   DISPATCH QUEUE — Kanban-style kitchen board
   ============================================================ */
.dispatch-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.dispatch-col {
  background: var(--c-cream);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: 70vh;
  overflow-y: auto;
}
.dispatch-col h4 {
  font-family: 'Poppins';
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-mute);
  margin: 0 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dispatch-col h4 .col-count {
  background: var(--c-charcoal);
  color: var(--c-cream);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
}
.dispatch-col.col-received h4 { color: var(--c-mute); }
.dispatch-col.col-preparing h4 { color: var(--c-flame); }
.dispatch-col.col-ready h4 { color: var(--c-red); }
.dispatch-col.col-delivery h4 { color: var(--c-lettuce); }

.order-card {
  background: var(--c-white);
  border-radius: var(--r-sm);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--c-line);
  transition: transform var(--t-fast);
}
.order-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.order-card.priority { border-left-color: var(--c-red); animation: order-flash 1.6s infinite; }
.order-card.fresh { border-left-color: var(--c-lettuce); }
.order-card .o-num {
  font-family: 'Poppins';
  font-weight: 700;
  font-size: 13px;
  color: var(--c-black);
}
.order-card .o-time { font-size: 11px; color: var(--c-mute); float: right; }
.order-card .o-cust { font-size: 13px; margin-top: 4px; font-weight: 600; }
.order-card .o-addr { font-size: 11px; color: var(--c-mute); margin-top: 2px; }
.order-card .o-items { font-size: 11px; color: var(--c-charcoal); margin-top: 6px; padding: 6px 8px; background: var(--c-cream); border-radius: 6px; }
.order-card .o-items li { list-style: none; }
.order-card .o-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.order-card .o-actions .btn { font-size: 11px; padding: 6px 10px; min-height: 32px; }
.order-card .o-driver { font-size: 11px; color: var(--c-lettuce); font-weight: 600; margin-top: 6px; }
.order-card .o-notes { font-size: 11px; color: var(--c-flame); margin-top: 4px; font-style: italic; }

@keyframes order-flash {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50% { box-shadow: 0 0 0 3px rgba(200,16,46,0.3), var(--shadow-md); }
}

@media (max-width: 1100px) {
  .dispatch-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .dispatch-board { grid-template-columns: 1fr; }
}

/* ============================================================
   ASSIGNED-ORDER CARD on driver dashboard — big and tappable
   ============================================================ */
.assigned-order-card {
  background: linear-gradient(135deg, var(--c-cream) 0%, #fff5e1 100%);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 12px;
  border: 2px solid var(--c-bun);
  box-shadow: var(--shadow-md);
}
.assigned-order-card.picked-up { border-color: var(--c-lettuce); }
.assigned-order-card .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}
.assigned-order-card .head strong {
  font-family: 'Poppins';
  font-weight: 800;
  font-size: 18px;
  color: var(--c-black);
}
.assigned-order-card .customer-name { font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.assigned-order-card .customer-addr { font-size: 13px; color: var(--c-charcoal); margin-bottom: 8px; }
.assigned-order-card .items-list {
  background: var(--c-white);
  border-radius: var(--r-sm);
  padding: 10px;
  font-size: 13px;
  margin: 8px 0;
}
.assigned-order-card .items-list .item {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}
.assigned-order-card .total {
  font-family: 'Poppins';
  font-weight: 700;
  font-size: 16px;
  color: var(--c-black);
}
.assigned-order-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ============================================================
   CUSTOMER TRACKING PAGE — public, no chrome
   ============================================================ */
.tracking-page {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--c-cream);
  padding: 20px;
}
.tracking-card {
  max-width: 480px;
  margin: 20px auto;
  background: var(--c-white);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
}
.tracking-head { text-align: center; margin-bottom: 24px; }
.tracking-head img { width: 64px; height: 64px; margin-bottom: 8px; }
.tracking-head .order-num {
  font-family: 'Poppins';
  font-weight: 700;
  font-size: 18px;
  color: var(--c-mute);
}
.tracking-head h1 { font-size: 22px; margin: 4px 0; }
.tracking-head .eta {
  background: var(--c-bun);
  color: var(--c-black);
  display: inline-block;
  font-family: 'Poppins';
  font-weight: 700;
  font-size: 16px;
  padding: 6px 14px;
  border-radius: 20px;
  margin-top: 8px;
}
.tracking-head .eta.delivered { background: var(--c-lettuce); color: white; }

.tracking-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 18px 0;
}
.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 8px 0;
  position: relative;
}
.timeline-step::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: -8px;
  width: 2px;
  background: var(--c-line-2);
}
.timeline-step:last-child::before { display: none; }
.timeline-step .marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-line-2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 14px;
  z-index: 2;
}
.timeline-step.done .marker { background: var(--c-lettuce); }
.timeline-step.current .marker { background: var(--c-bun); color: var(--c-black); animation: pulse-marker 1.5s infinite; }
.timeline-step .label {
  font-family: 'Poppins';
  font-weight: 700;
  font-size: 14px;
  color: var(--c-black);
}
.timeline-step.future .label { color: var(--c-mute); font-weight: 500; }
.timeline-step .ts { font-size: 12px; color: var(--c-mute); }

@keyframes pulse-marker { 0%, 100% { box-shadow: 0 0 0 0 rgba(248,160,31,0.6); } 50% { box-shadow: 0 0 0 8px rgba(248,160,31,0); } }

.tracking-driver {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--c-cream) 0%, #fff5e1 100%);
  border-radius: var(--r-md);
  padding: 14px;
  margin: 18px 0;
}
.tracking-driver .avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.tracking-driver strong { font-family: 'Poppins'; font-weight: 700; font-size: 15px; }
.tracking-driver .meta { font-size: 12px; color: var(--c-mute); }

.rating-form { text-align: center; padding: 14px 0; }
.rating-stars { display: inline-flex; gap: 8px; font-size: 36px; margin: 12px 0; }
.rating-star { cursor: pointer; color: var(--c-line-2); transition: transform var(--t-fast); user-select: none; }
.rating-star.active { color: var(--c-bun); }
.rating-star:hover { transform: scale(1.15); }

/* Mobile responsive */
@media (max-width: 900px) {
  .main-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "view";
  }
  .sidenav {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    height: calc(100vh - var(--topbar-h));
    height: calc(100svh - var(--topbar-h));
    width: 280px;
    z-index: 45;
    transform: translateX(-100%);
    transition: transform var(--t-mid);
  }
  .sidenav.open { transform: translateX(0); }
  .nav-toggle { display: flex; }
  .nav-backdrop.open { display: block; }
  .user-meta { display: none; }
  .view { padding: 14px; padding-bottom: 100px; }
  .earnings-hero { padding: 24px 20px; }
  .earnings-hero .earnings-amount { font-size: 48px; }
  .earnings-hero .earnings-amount.huge { font-size: 56px; }
}
@media (max-width: 540px) {
  .topbar { padding: 0 10px; gap: 8px; }
  .brand-text { display: none; }
  .icon-btn { width: 40px; height: 40px; }
  .user-chip { padding: 4px; }
  h1 { font-size: 20px; }
  .earnings-hero .earnings-amount { font-size: 44px; }
  .earnings-hero .earnings-amount.huge { font-size: 52px; }
}

/* Print */
@media print {
  .topbar, .sidenav, .nav-backdrop, .alerts-drawer, .toasts, #modal, .fab { display: none !important; }
  .view { padding: 0; max-width: 100%; }
}
