:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --orange: #ea580c;
  --orange-soft: #fff7ed;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --green: #16a34a;
  --green-soft: #ecfdf5;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --warning: #f59e0b;
  --shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
  --shadow-soft: 0 4px 14px rgba(17, 24, 39, 0.06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
}
body {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; }
button { touch-action: manipulation; }
a { color: inherit; }

.app-shell { min-height: 100dvh; position: relative; }
.screen { display: none; min-height: 100dvh; }
.screen.active { display: block; }
body.driver-booting .screen { display: none !important; }
body.driver-login-mode #dashboard-screen { display: none !important; }
body.driver-dashboard-mode #login-screen { display: none !important; }

.boot-splash {
  display: none;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: linear-gradient(180deg, #fff7ed 0%, #f6f7fb 58%, #ffffff 100%);
  color: var(--text);
  font-weight: 800;
}
body.driver-booting .boot-splash { display: flex; }
.boot-splash img {
  width: 84px;
  height: 84px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

#login-screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 82% 10%, rgba(234, 88, 12, 0.16), transparent 30%),
    linear-gradient(180deg, #fff7ed 0%, #f6f7fb 54%, #ffffff 100%);
}
.login-panel {
  width: min(100% - 32px, 420px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 8px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow);
}
.login-logo {
  display: block;
  width: 106px;
  height: 106px;
  margin-inline: auto;
  object-fit: cover;
  border-radius: 8px;
}
.login-kicker {
  margin-top: 16px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.login-panel h1 {
  margin: 6px 0 8px;
  font-size: 24px;
  line-height: 1.25;
  text-align: center;
}
.login-copy {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}
.login-form { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px 0 48px;
  background: #fff;
  color: var(--text);
  outline: 0;
  font-weight: 600;
}
.input-wrap input:focus {
  border-color: rgba(234, 88, 12, 0.68);
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.10);
}
.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
}
.input-wrap .icon-btn {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
}
.icon-btn:hover { background: var(--surface-soft); }
.primary-btn,
.action-btn,
.push-enable-btn,
.hero-cta,
.order-primary-action,
.logout-action {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.primary-btn {
  width: 100%;
  min-height: 52px;
  background: var(--orange);
  color: #fff;
  box-shadow: 0 8px 18px rgba(234, 88, 12, 0.22);
}
.primary-btn:active,
.hero-cta:active,
.order-primary-action:active { transform: translateY(1px); }
.alert-box {
  display: none;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #fecaca;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  line-height: 1.7;
}

.dashboard-shell {
  min-height: 100dvh;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
  background: var(--bg);
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
  padding: 10px 16px;
  background: rgba(246, 247, 251, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.82);
}
.driver-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}
.driver-copy { min-width: 0; }
.driver-greeting {
  max-width: 58vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
}
.driver-status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}
.status-chip.busy { background: var(--orange-soft); color: var(--warning); }
.status-chip.offline { background: var(--red-soft); color: var(--red); }
.header-icon-btn {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  color: var(--text);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.header-icon-btn:hover,
.header-icon-btn:focus-visible {
  background: var(--surface-soft);
  border-color: #fed7aa;
}
.header-icon-btn:active { transform: scale(0.96); }
.icon-bell {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.notif-badge {
  position: absolute;
  top: -3px;
  left: -3px;
  display: inline-flex;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  border: 2px solid #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.app-main {
  display: grid;
  gap: 14px;
  padding: 12px 16px 18px;
}
.push-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  box-shadow: var(--shadow-soft);
}
.push-banner div { min-width: 0; display: grid; gap: 2px; }
.push-banner strong { font-size: 13px; line-height: 1.4; }
.push-banner span { color: #c2410c; font-size: 11px; line-height: 1.6; }
.push-enable-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 17px;
  border-radius: 8px;
  background: linear-gradient(135deg, #111827 0%, #1f2937 58%, #7c2d12 130%);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-card::after {
  content: '';
  position: absolute;
  left: -42px;
  bottom: -54px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(234, 88, 12, 0.20);
}
.hero-copy,
.hero-metric,
.hero-cta { position: relative; z-index: 1; }
.hero-copy { min-width: 0; }
.hero-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #fed7aa;
  font-size: 11px;
  font-weight: 700;
}
.hero-card h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
  font-weight: 900;
}
.hero-card p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.7;
}
.hero-metric {
  min-width: 74px;
  text-align: center;
  align-self: start;
  padding: 9px 10px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.hero-metric strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.hero-metric span {
  display: block;
  margin-top: 5px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.78);
}
.hero-cta {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 46px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.mini-stat {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}
.mini-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 27px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.view-panels { margin-top: 2px; }
.view-panel { display: none; }
.view-panel.active { display: block; }
.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.panel-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 900;
}
.panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.bucket,
.profile-stack {
  display: grid;
  gap: 12px;
}
.legacy-sink { display: none; }
.placeholder,
.empty-state,
.orders-error {
  position: relative;
  min-height: 144px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 20px 18px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  box-shadow: var(--shadow-soft);
}
.placeholder::before,
.empty-state::before {
  content: '';
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background:
    linear-gradient(var(--orange), var(--orange)) center 12px / 20px 3px no-repeat,
    linear-gradient(var(--orange), var(--orange)) center 21px / 26px 3px no-repeat,
    linear-gradient(var(--orange), var(--orange)) center 30px / 16px 3px no-repeat,
    var(--orange-soft);
}
.orders-error { color: var(--red); background: var(--red-soft); }

.order-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.order-card:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.order-number {
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 900;
}
.status-badge {
  flex: 0 0 auto;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.status-badge.status-pending,
.status-badge.status-preparing,
.status-badge.status-ready { background: var(--orange-soft); color: #c2410c; }
.status-badge.status-delivering { background: var(--green-soft); color: var(--green); }
.status-badge.status-completed { background: var(--surface-soft); color: var(--muted); }
.status-badge.status-cancelled { background: var(--red-soft); color: var(--red); }
.order-field,
.order-address {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  font-weight: 700;
}
.order-address {
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.order-card > .call-btn { display: none; }
.driver-card-meta {
  display: grid;
  gap: 4px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
}
.driver-card-meta span:last-child {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-primary-action {
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  background: var(--orange);
  color: #fff;
  font-size: 13px;
}
.order-primary-action:disabled {
  background: var(--surface-soft);
  color: var(--muted);
  cursor: default;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: 0 -8px 20px rgba(17, 24, 39, 0.06);
}
.bottom-nav .tab-btn {
  position: relative;
  min-width: 0;
  min-height: 59px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding: 4px 2px;
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 700;
}
.bottom-nav .tab-btn.active {
  background: var(--orange-soft);
  color: var(--orange);
}
.nav-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
}
.nav-home::before {
  content: '';
  position: absolute;
  inset: 6px 4px 3px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 3px;
}
.nav-home::after {
  content: '';
  position: absolute;
  right: 4px;
  top: 3px;
  width: 13px;
  height: 13px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(-45deg);
}
.nav-orders::before,
.nav-history::before,
.nav-profile::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 2px solid currentColor;
  border-radius: 5px;
}
.nav-orders::after {
  content: '';
  position: absolute;
  right: 8px;
  left: 8px;
  top: 10px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}
.nav-history::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 7px;
  width: 6px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}
.nav-profile::before {
  inset: 3px 7px 11px;
  border-radius: 50%;
}
.nav-profile::after {
  content: '';
  position: absolute;
  right: 4px;
  left: 4px;
  bottom: 3px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 10px 10px 5px 5px;
}
.bottom-nav .tab-count {
  position: absolute;
  top: 5px;
  left: 10px;
  display: inline-flex;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff;
  color: var(--orange);
  border: 1px solid rgba(234, 88, 12, 0.20);
  font-size: 9px;
  line-height: 1;
}

.profile-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.profile-row:last-child { border-bottom: 0; padding-bottom: 0; }
.profile-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.profile-value { color: var(--text); font-size: 14px; font-weight: 800; text-align: left; overflow-wrap: anywhere; }

.profile-stack { display: grid; gap: 14px; }
.notif-status-card { padding: 14px; }
.notif-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.notif-status-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}
.notif-status-hint {
  margin-top: 8px;
  padding: 10px;
  border-radius: 6px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  line-height: 1.6;
}
.notif-status-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 600;
}
.notif-status-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.logout-action {
  width: 100%;
  min-height: 48px;
  margin-top: 2px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #fecaca;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(17, 24, 39, 0.44);
}
body.notification-sheet-open {
  overflow: hidden;
}
.sheet {
  width: min(100%, 760px);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.details-sheet {
  width: min(100%, 860px);
  min-height: min(82dvh, 760px);
}
.sheet-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.sheet-title { font-size: 18px; line-height: 1.35; font-weight: 900; }
.sheet-subtitle { margin-top: 4px; color: var(--muted); font-size: 12px; }
.sheet-actions { display: flex; align-items: center; gap: 8px; }
.text-btn {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
}
.notification-overlay {
  z-index: 160;
  align-items: flex-end;
  padding: 0;
  background: rgba(17, 24, 39, 0.46);
  backdrop-filter: blur(2px);
}
.notification-overlay .notification-sheet {
  width: min(100%, 430px);
  max-width: 100%;
  max-height: min(78dvh, 680px);
  min-height: 320px;
  border-radius: 20px 20px 0 0;
  background: #fff;
  box-shadow: 0 -18px 44px rgba(17, 24, 39, 0.20);
}
.notification-sheet-head {
  align-items: center;
  padding: 14px 16px 12px;
}
.notification-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notification-heading .sheet-title {
  font-size: 17px;
}
.notification-sheet-badge {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}
.notification-actions {
  flex: 0 0 auto;
  gap: 6px;
}
.notification-read-all {
  min-height: 34px;
  padding-inline: 9px;
  font-size: 11px;
  white-space: nowrap;
}
.notification-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--surface-soft);
}
.notification-list,
.details-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px 16px;
}
.notification-overlay .notification-list {
  padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
}
.notification-item {
  position: relative;
  width: 100%;
  margin: 0 0 10px;
  padding: 12px 13px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: right;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.notification-item.unread {
  background: #fff7ed;
  border-color: #fed7aa;
}
.notification-item:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.notification-item-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 900;
}
.notification-item-body {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  font-weight: 700;
}
.notification-item-time {
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.4;
}
.notification-unread-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--red);
}
.notification-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 800;
}
.details-row {
  display: grid;
  grid-template-columns: minmax(88px, 32%) minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.details-label { color: var(--muted); font-size: 11px; font-weight: 800; }
.details-value { color: var(--text); font-size: 13px; font-weight: 700; line-height: 1.7; overflow-wrap: anywhere; }
.details-items {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.details-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.details-item:last-child { border-bottom: 0; padding-bottom: 0; }
.details-item-name { color: var(--text); font-size: 13px; font-weight: 800; line-height: 1.6; }
.details-item-meta { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.details-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}
.action-btn {
  min-height: 46px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
}
.action-call { background: var(--blue-soft); color: var(--blue); border-color: #bfdbfe; }
.action-whatsapp { background: var(--green-soft); color: var(--green); border-color: #bbf7d0; }
.action-map { background: var(--orange-soft); color: var(--orange); border-color: #fed7aa; }
.action-start,
.action-complete {
  grid-column: 1 / -1;
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.gps-panel,
.nav-panel {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.gps-panel { padding: 12px; }
.gps-panel.gps-active { background: var(--green-soft); border-color: #bbf7d0; }
.gps-status-text { color: var(--text); font-size: 13px; font-weight: 800; }
.gps-last-update { margin-top: 4px; color: var(--muted); font-size: 11px; }
.gps-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--orange-soft);
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 11px;
  line-height: 1.7;
}
.gps-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
}
.gps-start-btn { background: var(--green); }
.gps-stop-btn { background: var(--red); }
.nav-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 8px; }
.nav-header-title { font-size: 13px; font-weight: 800; }
.nav-status-text { color: var(--muted); font-size: 11px; }
.nav-mute-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.06);
}
.nav-instruction-banner { display: flex; gap: 10px; padding: 12px; background: var(--orange); color: #fff; }
.nav-maneuver-icon { font-size: 24px; line-height: 1; }
.nav-instruction-text { font-size: 14px; font-weight: 800; line-height: 1.5; }
.nav-maneuver-distance { margin-top: 3px; font-size: 11px; opacity: .9; }
.nav-map { width: 100%; height: 240px; background: var(--surface-soft); }
.nav-stats { display: flex; border-top: 1px solid var(--line); background: var(--surface); }
.nav-stat { flex: 1; padding: 10px 8px; text-align: center; }
.nav-stat + .nav-stat { border-right: 1px solid var(--line); }
.nav-stat-value { font-size: 16px; font-weight: 900; }
.nav-stat-label { margin-top: 2px; color: var(--muted); font-size: 10px; }

.toast-stack {
  position: fixed;
  right: 16px;
  left: 16px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 140;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.7;
}
.toast.success { border-color: #bbf7d0; background: var(--green-soft); color: var(--green); }
.toast.error { border-color: #fecaca; background: var(--red-soft); color: var(--red); }

@media (max-width: 380px) {
  .app-header { padding-inline: 12px; }
  .app-main { padding-inline: 12px; }
  .quick-stats { gap: 8px; }
  .mini-stat { padding: 10px; }
  .mini-stat strong { font-size: 21px; }
  .bottom-nav { padding-inline: 6px; }
  .bottom-nav .tab-btn { font-size: 9px; }
  .driver-greeting { max-width: 52vw; }
  .details-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (min-width: 768px) {
  .app-main { max-width: 720px; margin-inline: auto; }
  .bottom-nav {
    right: 50%;
    left: auto;
    width: min(720px, 100%);
    transform: translateX(50%);
    border-inline: 1px solid var(--line);
  }
  .sheet { border-radius: 8px; margin-bottom: 16px; }
  .details-actions { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .action-start,
  .action-complete { grid-column: auto / span 2; }
}
