/* لوحة المندوب — نفس هوية زائر المنصة */
body.driver-page {
  margin: 0;
  font-family: var(--font, "Cairo", system-ui, sans-serif);
  background: var(--bg, #f8f4ee);
  color: var(--brown, #3d2213);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.driver-page .dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

body.driver-page .dash-site-header__link.is-active {
  background: linear-gradient(180deg, #3d2213 0%, #2b170d 100%);
  color: #f8f4ee;
  border-color: rgba(185, 135, 47, 0.35);
}

/* «شريك التوصيل» — أكبر 30%، متجاوب مع الشاشة */
.driver-hero-eyebrow--lg {
  font-size: clamp(0.85rem, 3.2vw, 0.936rem);
}

body.driver-page .dash-main .layout {
  width: 100%;
  max-width: min(1120px, 100%);
  box-sizing: border-box;
}

.drv-tool-balance {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(185, 135, 47, 0.45);
  background: linear-gradient(145deg, #3d2213, #2b170d);
  text-decoration: none;
  color: #f8f4ee;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(45, 26, 14, 0.15);
  transition: transform 0.15s, box-shadow 0.15s;
}
.drv-tool-balance:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(185, 135, 47, 0.25);
}
.drv-tool-balance__val {
  font-variant-numeric: tabular-nums;
  color: #f5d78e;
}
.driver-balance-link {
  display: inline-flex;
  margin-top: 10px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--gold, #b9872f);
  text-decoration: none;
}
.driver-balance-link:hover {
  text-decoration: underline;
}

/* توافق: رابط قديم إن وُجد خارج البطاقة المميزة */
.driver-profile-card--premium .driver-balance-link {
  display: none;
}

/* بطاقة طلب — الرقم بارز */
.drv-order-card {
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid rgba(185, 135, 47, 0.28);
  background: linear-gradient(165deg, #fffefb 0%, #faf4ea 100%);
  box-shadow: 0 8px 22px rgba(45, 26, 14, 0.07);
  overflow: hidden;
}
.drv-order-card:last-child {
  margin-bottom: 0;
}
.drv-order-card__ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(90deg, #3d2213 0%, #5a3820 55%, #b9872f 100%);
  color: #fffdf8;
}
.drv-order-card__num {
  font-size: clamp(1.05rem, 3.2vw, 1.28rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}
.drv-order-card__status {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.drv-order-card__body {
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--brown-mid, #5c4a3d);
}
.drv-order-card__body strong,
.drv-order-card__meta-line {
  color: var(--brown, #3d2213);
  font-weight: 700;
}
.drv-order-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}
.drv-order-card__actions .btn,
.drv-order-card__actions .drv-btn {
  flex: 1 1 auto;
  min-height: 40px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: none;
}
.drv-btn--gold {
  background: linear-gradient(180deg, #c99a3f, #b9872f);
  color: #fffdf8;
}
.drv-btn--ghost {
  background: #fff;
  border: 1px solid rgba(61, 34, 19, 0.15) !important;
  color: var(--brown, #3d2213);
}

#orders .order-row {
  padding: 0;
  margin-bottom: 12px;
  border: none;
  background: transparent;
  border-radius: 0;
}

.drv-section-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brown, #3d2213);
}
.drv-section-hint {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: var(--muted, #5c4a3d);
  font-weight: 600;
}
.drv-empty-state {
  padding: 20px 16px;
  text-align: center;
  border-radius: 14px;
  border: 1px dashed rgba(185, 135, 47, 0.35);
  background: rgba(255, 254, 251, 0.8);
  color: var(--muted, #5c4a3d);
  font-weight: 600;
}

/* ——— صفحة التتبع الحي (driver-app) ——— */
.driver-app-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: min(720px, 100%);
  margin-inline: auto;
  box-sizing: border-box;
}

.driver-app-segments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(61, 34, 19, 0.1);
  box-shadow: 0 6px 20px rgba(45, 26, 14, 0.05);
}

.driver-app-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: clamp(0.82rem, 2.8vw, 0.9rem);
  font-weight: 800;
  color: var(--muted, #5c4a3d);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.driver-app-segment__ic {
  font-size: 1.1rem;
  line-height: 1;
}

.driver-app-segment.is-active {
  background: linear-gradient(180deg, #3d2213 0%, #2b170d 100%);
  color: #f8f4ee;
  box-shadow: 0 4px 14px rgba(45, 26, 14, 0.2);
}

.driver-app-alert {
  margin: 0;
  border-radius: 12px;
  padding: 12px 14px;
}

.driver-app-panel.da-panel {
  display: none;
}

.driver-app-panel.da-panel.is-visible {
  display: block;
}

.driver-app-card {
  margin-bottom: 0;
  overflow: hidden;
}

.driver-app-card__head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(61, 34, 19, 0.08);
  background: linear-gradient(90deg, rgba(61, 34, 19, 0.04), rgba(185, 135, 47, 0.1));
}

.driver-app-card__head--compact {
  padding-bottom: 12px;
}

.driver-app-card__title {
  margin: 0;
  font-size: clamp(1rem, 3vw, 1.08rem);
  font-weight: 900;
  color: var(--brown, #3d2213);
}

.driver-app-card__hint {
  margin: 6px 0 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted, #5c4a3d);
  line-height: 1.5;
}

.driver-app-card__body {
  padding: 14px 16px 16px;
}

.driver-app-card > .badge {
  display: none;
}

.driver-app-orders {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.driver-app-order-item .drv-order-card {
  margin-bottom: 0;
}

.driver-app-loading {
  margin: 0;
  text-align: center;
  font-weight: 700;
  color: var(--muted, #5c4a3d);
  padding: 16px;
}

.driver-app-order-addr {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brown-mid, #5c4a3d);
  line-height: 1.5;
}

.driver-app-track-empty {
  margin: 0;
}

.driver-app-track-active {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.driver-app-status {
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fffefb, #f5ede2);
  border: 1px solid rgba(185, 135, 47, 0.22);
}

.driver-app-status__order {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--brown, #3d2213);
  margin-bottom: 6px;
}

.driver-app-status__line {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted, #5c4a3d);
  line-height: 1.45;
}

.driver-app-status__line--gps {
  margin-top: 4px;
  color: #0f766e;
}

.driver-app-map,
#daMap {
  min-height: min(46vh, 380px);
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(185, 135, 47, 0.28);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.driver-app-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.driver-app-actions .drv-btn {
  min-height: 48px;
  width: 100%;
  font-size: 0.9rem;
}

.driver-app-footnote {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #5c4a3d);
  line-height: 1.5;
  text-align: center;
  opacity: 0.9;
}

.driver-auth-gate {
  text-align: center;
  margin: 48px 20px;
  font-family: inherit;
  padding: 24px;
  border-radius: 16px;
  background: #fffdf8;
  border: 1px solid rgba(185, 135, 47, 0.25);
}

.driver-auth-gate h2 {
  margin: 0 0 16px;
  color: var(--brown, #3d2213);
}

body.driver-app-page .guest-section-hero__title {
  margin-top: 2px;
}

@media (min-width: 480px) {
  .driver-app-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .driver-app-layout {
    max-width: min(640px, 100%);
  }

  .driver-app-map,
  #daMap {
    min-height: min(52vh, 440px);
  }
}

@media (min-width: 768px) {
  .driver-app-layout {
    max-width: min(800px, 100%);
  }

  .driver-app-map,
  #daMap {
    min-height: 420px;
  }
}

@media (max-width: 767px) {
  body.driver-app-page .dash-main .layout.driver-app-layout {
    padding-inline: max(12px, env(safe-area-inset-left, 12px)) max(12px, env(safe-area-inset-right, 12px));
  }

  .driver-app-segment__label {
    font-size: 0.8rem;
  }
}

/* محفظة فاخرة */
body.driver-wallet-page {
  background: linear-gradient(165deg, #f8f4ee 0%, #ebe3d6 40%, #f8f4ee 100%);
}
.drv-wallet-hero {
  position: relative;
  margin-bottom: 18px;
  padding: clamp(24px, 5vw, 36px) 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, #2b170d 0%, #3d2213 40%, #6b4528 75%, #b9872f 100%);
  color: #fffdf8;
  box-shadow: 0 20px 48px rgba(45, 26, 14, 0.22);
  overflow: hidden;
}
.drv-wallet-hero::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 60%;
  height: 120%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.drv-wallet-hero__label {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.85;
  letter-spacing: 0.06em;
}
.drv-wallet-hero__amount {
  margin: 0;
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}
.drv-wallet-hero__amount span {
  font-size: 0.45em;
  font-weight: 700;
  opacity: 0.9;
  margin-inline-start: 6px;
}
.drv-wallet-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.drv-wallet-stat {
  flex: 1 1 120px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  font-weight: 700;
}
.drv-wallet-stat strong {
  display: block;
  font-size: 1.05rem;
  margin-top: 4px;
  color: #f5d78e;
}
.drv-wallet-panel {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(185, 135, 47, 0.2);
  background: #fffdf8;
  box-shadow: 0 8px 24px rgba(45, 26, 14, 0.06);
}
.drv-wallet-panel h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--brown, #3d2213);
}
.drv-wallet-panel .muted {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: var(--muted, #5c4a3d);
  line-height: 1.5;
}
.drv-wallet-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.drv-wallet-inputs input {
  flex: 1 1 160px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(61, 34, 19, 0.15);
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
}
.drv-wallet-btn {
  font-family: inherit;
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  min-height: 44px;
}
.drv-wallet-btn--primary {
  background: linear-gradient(180deg, #c99a3f, #8f6020);
  color: #fffdf8;
}
.drv-wallet-btn--ghost {
  background: #fff;
  border: 1px solid rgba(61, 34, 19, 0.18) !important;
  color: var(--brown, #3d2213);
}
.drv-wallet-tx {
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid rgba(61, 34, 19, 0.08);
  background: linear-gradient(180deg, #fffefb, #faf6ef);
  font-size: 0.88rem;
}
.drv-wallet-tx:last-child {
  margin-bottom: 0;
}
.drv-wallet-panel--tx {
  padding: 0;
  overflow: hidden;
}
.drv-wallet-tx-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  color: var(--brown, #3d2213);
  cursor: pointer;
  text-align: inherit;
}
.drv-wallet-tx-toggle__main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.drv-wallet-tx-toggle__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(185, 135, 47, 0.14);
  color: var(--brown, #3d2213);
  font-size: 0.78rem;
  font-weight: 900;
}
.drv-wallet-tx-toggle__chev {
  flex-shrink: 0;
  font-size: 0.72rem;
  opacity: 0.7;
  transition: transform 0.22s ease;
}
.drv-wallet-tx-toggle.is-open .drv-wallet-tx-toggle__chev {
  transform: rotate(180deg);
}
.drv-wallet-tx-panel {
  padding: 0 18px 16px;
}
.drv-wallet-tx-panel[hidden] {
  display: none !important;
}
.drv-toast {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  right: 16px;
  max-width: 400px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 800;
  z-index: 99999;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}
.drv-toast--ok {
  background: linear-gradient(180deg, #166534, #14532d);
  color: #fff;
}
.drv-toast--err {
  background: linear-gradient(180deg, #b91c1c, #7f1d1d);
  color: #fff;
}

/* ——— بطاقة المندوب المميزة (متجاوبة: جوال + تابلت) ——— */
.driver-profile-card--premium {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin-bottom: clamp(12px, 3vw, 16px);
  padding: 0;
  border: none;
  border-radius: clamp(16px, 4vw, 20px);
  overflow: hidden;
  box-sizing: border-box;
  background: linear-gradient(155deg, #fffefb 0%, #faf3e8 42%, #f0e4d4 100%);
  box-shadow:
    0 3px 0 rgba(185, 135, 47, 0.32),
    0 10px 28px rgba(45, 26, 14, 0.1);
  outline: 1px solid rgba(185, 135, 47, 0.28);
}

.driver-profile-card--premium::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, #f5e6b8, #d4a84b 40%, #8f6420 100%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.driver-profile-card__accent {
  height: 6px;
  background: linear-gradient(90deg, #8f6420, #d4a84b 35%, #f5e6b8 50%, #d4a84b 65%, #8f6420);
}

.driver-profile-card__head {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 16px);
  padding: clamp(14px, 3.5vw, 18px) clamp(14px, 4vw, 18px) clamp(12px, 3vw, 14px);
}

.driver-profile-card__avatar-wrap {
  flex-shrink: 0;
  padding: 4px;
  border-radius: 18px;
  background: linear-gradient(145deg, #f5e6b8, #b9872f);
  box-shadow: 0 6px 16px rgba(139, 100, 32, 0.28);
}

.driver-profile-card__avatar {
  width: clamp(56px, 16vw, 64px);
  height: clamp(56px, 16vw, 64px);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.65rem, 5vw, 2rem);
  background: linear-gradient(160deg, #fffefb, #f5ede2);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.driver-profile-card__identity {
  min-width: 0;
  flex: 1;
}

.driver-profile-card__row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.driver-profile-card__meta {
  min-width: 0;
  flex: 1;
}

.driver-profile-card__role {
  display: inline-block;
  margin: 0 0 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(185, 135, 47, 0.15);
  color: var(--brown, #3d2213);
}

/* شارة اعتماد ذهبية — بدل نص «مندوب توصيل معتمد» */
.driver-cert-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  color: #3d2213;
  background: linear-gradient(135deg, #f5e6b8 0%, #d4a84b 38%, #b9872f 72%, #8f6420 100%);
  border: 1px solid rgba(255, 235, 180, 0.85);
  box-shadow:
    0 2px 8px rgba(139, 100, 32, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}

.driver-cert-badge__seal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff8e8, #e8c56a);
  border: 1px solid rgba(61, 34, 19, 0.12);
  color: #5a3d0f;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.7);
}

.driver-cert-badge__seal svg {
  display: block;
}

.driver-cert-badge__label {
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.driver-profile-card__phone {
  margin: 8px 0 0;
  padding: clamp(8px, 2vw, 10px) clamp(10px, 3vw, 12px);
  font-size: clamp(0.9rem, 4vw, 1rem);
  font-weight: 800;
  color: var(--brown, #3d2213);
  direction: ltr;
  text-align: right;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 10px;
  border: 1px solid rgba(61, 34, 19, 0.08);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8);
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}

.driver-profile-card__rating-block {
  margin: 0 clamp(10px, 3vw, 14px);
  padding: clamp(10px, 2.5vw, 12px) clamp(12px, 3vw, 14px);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(185, 135, 47, 0.18);
}

.driver-profile-card__rating {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brown-mid, #5c4a3d);
  line-height: 1.4;
  text-align: center;
}

.driver-profile-card__stars {
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  line-height: 1;
}

.driver-profile-card__rating-val {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--brown, #3d2213);
}

.driver-profile-card__rating-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted, #5c4a3d);
}

.driver-profile-card__rating-muted {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted, #5c4a3d);
}

.driver-profile-card__wallet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: clamp(10px, 3vw, 14px);
  margin-bottom: max(clamp(10px, 3vw, 14px), env(safe-area-inset-bottom, 0px));
  padding: clamp(14px, 3.5vw, 16px) clamp(16px, 4vw, 18px);
  min-height: 48px;
  border-radius: 14px;
  font-size: clamp(0.9rem, 2.8vw, 0.95rem);
  font-weight: 900;
  color: #fff8e8;
  text-decoration: none;
  background: linear-gradient(135deg, #3d2213 0%, #5a3820 45%, #3d2213 100%);
  border: 1px solid rgba(245, 230, 184, 0.25);
  box-shadow:
    0 4px 14px rgba(45, 26, 14, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.15s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.driver-profile-card__wallet:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}

.driver-profile-card__wallet-ic {
  font-size: 1.2rem;
  line-height: 1;
}

.driver-profile-card__wallet-arrow {
  margin-inline-start: auto;
  font-size: 1.1rem;
  opacity: 0.9;
}

.driver-panel-card {
  margin-bottom: 14px;
  border-radius: 16px;
  border: 1px solid rgba(61, 34, 19, 0.1);
  background: #fffdf8;
  box-shadow: 0 6px 20px rgba(45, 26, 14, 0.05);
  overflow: hidden;
}

.driver-panel-card > .badge {
  display: block;
  margin: 0;
  padding: 12px 16px;
  border-radius: 0;
  background: linear-gradient(90deg, rgba(61, 34, 19, 0.06), rgba(185, 135, 47, 0.12));
  border-bottom: 1px solid rgba(61, 34, 19, 0.08);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brown, #3d2213);
}

.driver-panel-card__body {
  padding: 14px 16px 16px;
}

.driver-loc-status {
  margin: 0 0 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted, #5c4a3d);
  line-height: 1.5;
}

#driverLiveMap {
  min-height: min(52vh, 420px);
  border-radius: 14px;
  border: 1px solid rgba(185, 135, 47, 0.28);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

#orders .order-row {
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid rgba(61, 34, 19, 0.1);
  background: linear-gradient(180deg, #fffefb, #faf6ef);
}

#orders .order-row:last-child {
  margin-bottom: 0;
}

#orders .order-row strong {
  color: var(--brown, #3d2213);
}

#orders .order-row .badge {
  background: rgba(185, 135, 47, 0.18);
  color: var(--brown, #3d2213);
  font-size: 0.75rem;
}

.driver-refresh-btn {
  margin-top: 12px;
  width: 100%;
  min-height: 44px;
  font-family: inherit;
  font-weight: 800;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: linear-gradient(180deg, #c99a3f, #b9872f);
  color: #fffdf8;
  box-shadow: 0 4px 14px rgba(185, 135, 47, 0.35);
}

.driver-refresh-btn:hover {
  filter: brightness(1.05);
}

body.driver-page .msg.err {
  margin-top: 12px;
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.2);
  color: #7f1d1d;
  font-weight: 600;
}

/* شريط الإجراء السفلي — ألوان المنصة */
.driver-nav-dock {
  display: none;
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 10050;
  padding: 12px 14px var(--erw-safe-bottom, max(12px, env(safe-area-inset-bottom, 12px)));
  background: linear-gradient(180deg, transparent, rgba(43, 23, 13, 0.94));
}

.driver-nav-dock.is-visible {
  display: block;
}

.driver-nav-dock-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(520px, 100%);
  margin: 0 auto;
}

.driver-order-chip {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255, 253, 248, 0.95);
}

.driver-main-action {
  font-family: inherit;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.2;
  padding: 20px 16px;
  min-height: 58px;
  width: 100%;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(45, 26, 14, 0.25);
}

.driver-main-action:active:not(:disabled) {
  transform: scale(0.99);
}

.driver-main-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.driver-main-action.mode-pending {
  background: linear-gradient(180deg, #22a06b, #15803d);
  color: #fff;
}

.driver-main-action.mode-nav {
  background: linear-gradient(180deg, #c99a3f, #8f6020);
  color: #fffdf8;
}

.driver-main-action.mode-finish {
  background: linear-gradient(180deg, #f5d78e, #b9872f);
  color: #2b170d;
}

body.driver-nav-dock-active .dash-main .layout {
  padding-bottom: calc(130px + var(--erw-safe-bottom, max(12px, env(safe-area-inset-bottom, 12px))));
}

body.driver-ultra-mode #driverRatingLine {
  display: none !important;
}

body.driver-ultra-mode .driver-profile-card {
  display: none;
}

body.driver-ultra-mode #ordersCard .driver-panel-card__body #orders {
  max-height: 110px;
  overflow: auto;
}

body.driver-ultra-mode #driverMapCard #driverLiveMap {
  min-height: min(58vh, 480px) !important;
}

/* ——— جوال (حتى 767px) ——— */
@media (max-width: 767px) {
  body.driver-page .dash-main .layout {
    padding-inline: max(12px, env(safe-area-inset-left, 12px)) max(12px, env(safe-area-inset-right, 12px));
    padding-block: clamp(12px, 3vw, 18px) clamp(16px, 4vw, 24px);
  }

  body.driver-page .guest-section-hero {
    padding-block: clamp(12px, 3vw, 18px);
  }

  body.driver-page .driver-profile-card--premium {
    box-shadow:
      0 2px 0 rgba(185, 135, 47, 0.28),
      0 8px 22px rgba(45, 26, 14, 0.08);
  }

  .driver-profile-card__rating {
    flex-direction: column;
    gap: 4px 8px;
  }

  .driver-profile-card__stars {
    font-size: clamp(1rem, 5vw, 1.15rem);
  }

  .driver-profile-card__rating-val {
    font-size: clamp(0.95rem, 4vw, 1.05rem);
  }

  .driver-panel-card__body {
    padding: 12px 14px 14px;
  }

  .driver-refresh-btn {
    min-height: 48px;
  }

  #driverLiveMap {
    min-height: min(46vh, 360px);
  }

  body.driver-nav-dock-active .dash-main .layout {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  }
}

/* جوال ضيق جداً */
@media (max-width: 380px) {
  .driver-profile-card__head {
    flex-direction: column;
    text-align: center;
  }

  .driver-profile-card__identity {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .driver-profile-card__phone {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  .driver-cert-badge {
    margin-inline: auto;
  }
}

/* ——— تابلت (641px – 1024px) ——— */
@media (min-width: 641px) and (max-width: 1024px) {
  body.driver-page .dash-main .layout {
    padding-inline: max(20px, env(safe-area-inset-left, 20px)) max(20px, env(safe-area-inset-right, 20px));
  }

  .driver-profile-card--premium {
    max-width: min(520px, 100%);
    margin-inline: auto;
  }

  .driver-profile-card__head {
    padding: 20px 22px 16px;
  }

  .driver-profile-card__avatar {
    width: 68px;
    height: 68px;
    font-size: 2.1rem;
  }

  .driver-profile-card__phone {
    font-size: 1.05rem;
  }

  .driver-profile-card__wallet {
    min-height: 52px;
    font-size: 1rem;
  }

  #driverLiveMap {
    min-height: min(50vh, 440px);
  }

  .driver-panel-card {
    max-width: min(720px, 100%);
    margin-inline: auto;
  }
}

/* ——— شاشات أوسع (لوحة + خريطة) ——— */
@media (min-width: 768px) {
  body.driver-page .dash-main .layout {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 16px 20px;
    align-items: start;
  }

  .driver-profile-card--premium {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
  }

  #ordersCard {
    grid-column: 1;
    grid-row: 2;
  }

  #driverMapCard {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-bottom: 0;
  }

  #driverMapCard #driverLiveMap {
    min-height: min(58vh, 520px);
  }

  body.driver-page .msg.err {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  #driverLiveMap {
    min-height: 46vh;
  }
}
