/* ============================================================
   VIPT Theme — Bespoke single look
   Deep navy & champagne gold. Loaded after vip.css as the only look.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --v-gold:        #C9A84C;
  --v-gold-light:  #D4C08A;
  --v-gold-dim:    #8A7030;

  --v-dark:        #0a0d14;
  --v-dark-2:      #0f131c;
  --v-surface:     #111827;
  --v-surface-2:   #151d2e;
  --v-surface-3:   #1f2937;

  --v-border:      rgba(255,255,255,0.05);
  --v-border-hover:rgba(255,255,255,0.10);

  --v-text:        #f8fafc;
  --v-text-2:      #94a3b8;
  --v-text-3:      #7186a3;

  --v-success:     #10b981;
  --v-danger:      #f43f5e;
  --v-warning:     #f59e0b;
  --v-info:        #3b82f6;

  --v-glass:       rgba(17,24,39,0.85);
  --v-glass-border:rgba(255,255,255,0.06);

  --v-shadow:      0 20px 40px rgba(0,0,0,0.35);
  --v-shadow-sm:   0 4px 12px rgba(0,0,0,0.15);

  --v-radius:      14px;
  --v-radius-sm:   10px;
  --v-radius-xs:   8px;

  /* Remap derived tokens for consistency */
  --primary-light: rgba(201,168,76,0.12);
  --success-bg:    rgba(16,185,129,0.12);
  --success-text:  #34d399;
  --warning-bg:    rgba(245,158,11,0.12);
  --warning-text:  #fbbf24;
  --danger-bg:     rgba(244,63,94,0.12);
  --danger-text:   #fb7185;
  --info-bg:       rgba(59,130,246,0.12);
  --info-text:     #60a5fa;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--v-dark);
  color: var(--v-text);
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-family: 'Inter', sans-serif; letter-spacing: -0.01em; }
.page-title { font-weight: 600; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  background: var(--v-dark-2);
  border-right: 1px solid var(--v-border);
}

.logo {
  color: var(--v-text);
  border-bottom: none;
}

.logo-icon {
  background: linear-gradient(135deg, var(--v-gold) 0%, var(--v-gold-dim) 100%);
  border-radius: var(--v-radius-xs);
  color: #000;
}

.nav-label {
  color: var(--v-text-3);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.nav-link {
  color: var(--v-text-2);
  border-radius: var(--v-radius-xs);
}

.nav-link:hover {
  background: var(--v-surface-3);
  color: var(--v-text);
}

.nav-link.active {
  background: var(--v-gold);
  color: #0C0A09;
  box-shadow: none;
}

.nav-link.active .nav-icon { opacity: 1; }

.sidebar-footer { border-top-color: var(--v-border); }

/* ── Header ──────────────────────────────────────────────── */
.top-header {
  background: var(--v-surface);
  border-bottom-color: var(--v-border);
}

.search-box input {
  background: var(--v-dark-2);
  border-color: var(--v-border);
}

.search-box input:focus {
  border-color: var(--v-gold);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.icon-btn:hover { background: var(--v-surface-2); color: var(--v-text); }

.avatar {
  background: linear-gradient(135deg, var(--v-gold) 0%, var(--v-gold-dim) 100%);
  color: #000;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--v-surface);
  border-color: var(--v-border);
  border-radius: var(--v-radius);
  box-shadow: var(--v-shadow-sm);
}

.card-header { border-bottom-color: var(--v-border); }
.card-footer { background: var(--v-surface-2); border-top-color: var(--v-border); }

/* ── Stats ───────────────────────────────────────────────── */
.stat-card { border-radius: var(--v-radius); }
.stat-icon {
  background: var(--primary-light);
  color: var(--v-gold);
  border-radius: var(--v-radius-xs);
}
.stat-icon.success { background: var(--success-bg); color: var(--success-text); }
.stat-icon.warning { background: var(--warning-bg); color: var(--warning-text); }
.stat-icon.danger  { background: var(--danger-bg);  color: var(--danger-text); }
.stat-icon.info    { background: var(--info-bg);    color: var(--info-text); }

.stat-value { color: var(--v-text); }
.stat-label { color: var(--v-text-2); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  border-radius: var(--v-radius-xs);
  font-weight: 500;
}

.btn-primary {
  background: linear-gradient(135deg, var(--v-gold) 0%, var(--v-gold-dim) 100%);
  color: #000;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(200,162,58,0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--v-gold-light) 0%, var(--v-gold) 100%);
  box-shadow: 0 6px 18px rgba(200,162,58,0.35);
}

.btn-secondary {
  background: var(--v-surface-2);
  color: var(--v-text);
  border-color: var(--v-border);
}

.btn-secondary:hover { background: var(--v-surface-3); }

.btn-success { background: var(--v-success); color: #000; }
.btn-danger  { background: var(--v-danger);  color: #fff; }
.btn-warning { background: var(--v-warning); color: #000; }
.btn-info    { background: var(--v-info);    color: #fff; }

.btn-vip {
  background: linear-gradient(135deg, var(--v-gold) 0%, var(--v-gold-dim) 100%);
  color: #000;
}
.btn-vip:hover { background: linear-gradient(135deg, var(--v-gold-light) 0%, var(--v-gold) 100%); }

.btn-outline-vip {
  background: transparent;
  border-color: var(--v-gold-dim);
  color: var(--v-gold);
}
.btn-outline-vip:hover { background: var(--primary-light); }

.btn-ghost-secondary {
  background: transparent;
  border-color: var(--v-border);
  color: var(--v-text-2);
}
.btn-ghost-secondary:hover { background: transparent; border-color: var(--v-border-hover); color: var(--v-text); }

/* ── Tables ──────────────────────────────────────────────── */
.data-table th {
  background: var(--v-surface-2);
  color: var(--v-text-2);
  border-bottom-color: var(--v-border);
}

.data-table td { border-bottom-color: var(--v-border); }
/* ── Badges ──────────────────────────────────────────────── */
.badge-pill.active  { background: var(--success-bg); color: var(--success-text); }
.badge-pill.pending { background: var(--warning-bg); color: var(--warning-text); }
.badge-pill.inactive {
  background: var(--v-surface-2);
  color: var(--v-text-2);
  border-color: var(--v-border);
}

.badge-nav { background: var(--v-danger); color: #fff; }

/* ── Forms ───────────────────────────────────────────────── */
.form-input,
.form-select,
.form-textarea,
.form-control {
  background: var(--v-surface);
  border-color: var(--v-border);
  color: var(--v-text);
  border-radius: var(--v-radius-xs);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-control:focus {
  outline: none;
  border-color: var(--v-gold);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Activity feed ───────────────────────────────────────── */
.activity-item { border-bottom-color: var(--v-border); }

/* ── Dropdown / toast ────────────────────────────────────── */
.dropdown-menu {
  background: var(--v-surface);
  border-color: var(--v-border);
  box-shadow: var(--v-shadow);
}

.toast {
  background: var(--v-surface);
  border-color: var(--v-border);
  box-shadow: var(--v-shadow);
}

/* ── Misc ────────────────────────────────────────────────── */
.text-secondary { color: var(--v-text-2) !important; }
.text-muted     { color: var(--v-text-3) !important; }

::selection { background: rgba(200,162,58,0.25); color: var(--v-text); }


/* ============================================================
   VIPT Layout — Bespoke dashboard layout helpers
   Originally the modern layout; now the single layout for all pages.
   ============================================================ */

/* ── Desktop: floating sidebar + header ──────────────────── */
@media (min-width: 992px) {
  .layout-wrapper { gap: 0; }

  .sidebar {
    width: 270px;
    padding: 14px;
    background: transparent;
    border-right: none;
    overflow: visible;
  }

  .sidebar .logo,
  .sidebar .nav-section,
  .sidebar .sidebar-footer {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
  }

  .sidebar .logo {
    margin-bottom: 12px;
    border-bottom: none;
  }

  .sidebar .nav-section {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
  }

  .sidebar .sidebar-footer {
    margin-top: 0;
  }

  .main {
    margin-left: 270px;
    padding: 14px 14px 14px 0;
  }

  .top-header {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 14px;
    padding: 0 24px;
  }

  .content {
    padding: 0;
  }
}

/* ── Grid utilities ──────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.dashboard-main,
.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

/* ── Welcome hero ────────────────────────────────────────── */
.welcome-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.welcome-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 20%, rgba(201,168,76,0.10) 0%, transparent 40%);
  pointer-events: none;
}

.welcome-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 28px;
}

.welcome-greeting {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.welcome-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.welcome-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

/* ── Section titles ──────────────────────────────────────── */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

/* ── Job cards (driver dashboard) ────────────────────────── */
.job-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.job-card {
  border-left: 4px solid var(--primary) !important;

}

.job-card.urgent { border-left-color: var(--danger) !important; }
.job-card.overdue { border-left-color: var(--warning) !important; }

.job-card .job-time {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
}

.job-card .job-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.job-card .job-route-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}

.job-card .job-route-icon.drop {
  background: var(--success-bg);
  color: var(--success-text);
}

/* ── Driver status toggle polish ─────────────────────────── */
#driver-status-toggle .btn {
  border-radius: 0;
}

#driver-status-toggle .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
#driver-status-toggle .btn:last-child  { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* ── Compact tables in side cards ────────────────────────── */
.side-card .data-table td,
.side-card .data-table th {
  padding: 12px 16px;
}

/* ── Quick action buttons ────────────────────────────────── */
.quick-actions .btn {
  justify-content: flex-start;
  padding: 12px 16px;
}

/* ── Status dot helper ───────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

/* ── Mobile adjustments ──────────────────────────────────── */
@media (max-width: 991.98px) {
  .welcome-inner { padding: 20px; }
  .welcome-title { font-size: 1.3rem; }
  .btn-lg { width: 100%; }
}

@media (max-width: 767px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 479px) {
  .kpi-grid { grid-template-columns: 1fr; }
}


/* ============================================================
   High-end dashboard refinements
   ============================================================ */

/* ── KPI cards ───────────────────────────────────────────── */
.kpi-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--v-surface) 0%, rgba(21,29,46,0.6) 100%);
  border: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;

}



.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--v-gold), var(--v-gold-dim));
}

.kpi-card.gold::after   { background: linear-gradient(90deg, var(--v-gold), var(--v-gold-dim)); }
.kpi-card.success::after { background: linear-gradient(90deg, var(--v-success), #059669); }
.kpi-card.warning::after { background: linear-gradient(90deg, var(--v-warning), #b45309); }
.kpi-card.danger::after  { background: linear-gradient(90deg, var(--v-danger), #be123c); }

.kpi-card .kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--v-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-card.success .kpi-icon { background: var(--success-bg); color: var(--success-text); }
.kpi-card.warning .kpi-icon { background: var(--warning-bg); color: var(--warning-text); }
.kpi-card.danger  .kpi-icon { background: var(--danger-bg);  color: var(--danger-text); }

.kpi-card .kpi-icon svg {
  width: 22px;
  height: 22px;
}

.kpi-card .kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -0.02em;
}

.kpi-card .kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi-card .kpi-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Section cards ───────────────────────────────────────── */
.section-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(17,24,39,0.4) 100%);
  border: 1px solid var(--border-color);
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--v-gold-dim), transparent);
  opacity: 0.4;
}

/* ── Dashboard tables ────────────────────────────────────── */
.dash-row {
  transition: background .15s ease;
}

/* ── Driver status dots ──────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  box-shadow: 0 0 8px currentColor;
}

/* ── Mini bar chart ──────────────────────────────────────── */
.mini-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  height: 140px;
  padding: 24px 4px 28px 4px;
}

.mini-bar {
  flex: 1;
  min-width: 28px;
  max-width: 64px;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  background: linear-gradient(180deg, var(--v-gold) 0%, var(--v-gold-dim) 100%);
  opacity: 0.85;

  position: relative;
  margin: 0 auto;
}



.mini-bar-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mini-bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ── Empty state polish ──────────────────────────────────── */
.empty-state-icon {
  color: var(--text-muted);
  opacity: 0.6;
}


/* ============================================================
   Mobile responsiveness
   ============================================================ */

@media (max-width: 991.98px) {
  .main {
    padding: 0;
  }

  .content {
    padding: 16px;
  }

  .welcome-inner {
    padding: 20px;
  }

  .welcome-title {
    font-size: 1.35rem;
  }

  .kpi-grid {
    gap: 12px;
  }

  .kpi-card {
    padding: 18px;
  }

  .dashboard-grid,
  .dashboard-main,
  .dashboard-side {
    gap: 16px;
  }

  .mini-bar-chart {
    height: 120px;
    gap: 6px;
    padding: 16px 4px 24px 4px;
  }

  .mini-bar {
    min-width: 22px;
  }

  .quick-actions .btn {
    padding: 10px 14px;
  }
}

@media (max-width: 767px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-value {
    font-size: 1.6rem;
  }

  .kpi-label {
    font-size: 0.7rem;
  }

  .hide-sm {
    display: none !important;
  }

  .card-header {
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 479px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    padding: 16px;
  }

  .mini-bar-label {
    display: none;
  }

  .welcome-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-lg {
    width: 100%;
  }

  .job-actions {
    flex-direction: column;
  }

  .job-actions > .btn,
  .job-actions > a.btn {
    width: 100%;
    flex: none;
  }

  #driver-status-toggle {
    flex-wrap: wrap;
    width: 100%;
  }

  #driver-status-toggle .btn {
    flex: 1 1 45%;
  }
}


/* ============================================================
   Mobile responsiveness — list pages
   ============================================================ */

/* Keep sidebar + overlay above map panes */
.sidebar { z-index: 1000; }
.sidebar-overlay { z-index: 999; }

/* Stack filter-form columns on mobile */
@media (max-width: 767px) {
  .row.g-2 > .col-auto,
  .row.g-2 > .col {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }

  form.d-flex.gap-2 {
    flex-direction: column;
    align-items: stretch;
  }

  form.d-flex.gap-2 > * {
    width: 100% !important;
    margin-left: 0 !important;
  }

  .card-header .d-flex.gap-2 {
    flex-wrap: wrap;
    width: 100%;
  }

  .card-header .d-flex.gap-2 > .btn,
  .card-header .d-flex.gap-2 > a.btn {
    flex: 1 1 45%;
  }

  .table-responsive {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
}

/* Map height on mobile */
@media (max-width: 991.98px) {
  #dispatch-map,
  .map-card {
    height: calc(100vh - 180px) !important;
    min-height: 350px !important;
  }
}


/* Action cells: allow wrapping on mobile */
@media (max-width: 767px) {
  td.text-nowrap,
  .job-actions,
  .action-cell {
    white-space: normal !important;
  }
  .job-actions .btn,
  .action-cell .btn {
    margin-bottom: 0.25rem;
  }
}

/* Reports range selector */
.range-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.range-bar .ms-auto {
  margin-left: auto;
}
@media (max-width: 767px) {
  .range-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .range-bar > * {
    width: 100% !important;
    margin-left: 0 !important;
  }
}


/* Keep toasts above sidebar */
.toast-container { z-index: 1100; }

/* ── Skip link ───────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2000;
  padding: 0.7rem 1.1rem;
  background: var(--v-gold);
  color: #0C0A09;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

.app-shell :focus-visible {
  outline: 2px solid var(--v-gold);
  outline-offset: 3px;
}

/* ── Glass cards ─────────────────────────────────────────── */
.card,
.kpi-card,
.welcome-card {
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.top-header {
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}

/* ── Driver mobile ───────────────────────────────────────── */
.vip-bottom-nav {
  background: rgba(10, 13, 20, 0.82);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-top: 1px solid rgba(201, 168, 76, 0.28);
}
.vip-bottom-nav .nav-item {
  min-height: 48px;
  justify-content: center;
}

@media (max-width: 767px) {
  body.app-driver {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  #driver-status-toggle {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 0;
  }

  #driver-status-toggle .btn {
    flex: 1 1 45%;
    min-height: 44px;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-title {
    font-size: 1.05rem;
  }

  .hide-mobile { display: none !important; }
}

/* ── Client portal ───────────────────────────────────────── */
.client-app {
  min-height: 100vh;
  background: var(--v-dark);
  color: var(--v-text);
}

.client-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0.75rem 1.25rem;
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid rgba(201, 168, 76, 0.28);
}

.client-brand {
  color: var(--v-gold);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  font-size: 1.05rem;
}

.client-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.client-nav a {
  color: var(--v-text-2);
  text-decoration: none;
  padding: 0.55rem 0.85rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

.client-nav a:hover,
.client-nav a.active {
  color: var(--v-gold);
  background: rgba(201, 168, 76, 0.1);
}

.client-topbar-end {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--v-gold);
  color: #0C0A09;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.client-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--v-text);
  font-size: 1.5rem;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}

.client-main {
  width: min(1120px, 92%);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.client-page-head h1 {
  font-size: 1.45rem;
  margin: 0 0 1.25rem;
}

.client-footer {
  text-align: center;
  color: var(--v-text-3);
  font-size: 0.85rem;
  padding: 1.5rem 1rem 2rem;
}

@media (max-width: 767px) {
  .client-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .client-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0.75rem 1rem;
    background: rgba(10, 13, 20, 0.96);
    border-bottom: 1px solid rgba(201, 168, 76, 0.25);
  }

  .client-nav.is-open { display: flex; }

  .client-nav a {
    width: 100%;
    padding: 0.85rem 1rem;
  }

  .client-topbar { position: sticky; }
}

/* ── Dispatch board ──────────────────────────────────────── */
.dispatch-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.dispatch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.dispatch-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--v-text-2);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(17,24,39,0.6);
}
.dispatch-chip span {
  background: rgba(201,168,76,0.15);
  color: var(--v-gold);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.75rem;
}
.dispatch-chip.is-on {
  border-color: var(--v-gold);
  color: var(--v-gold);
}
.dispatch-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.dispatch-avail {
  font-size: 0.8rem;
  color: var(--v-text-3);
}
.dispatch-result {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(201,168,76,0.35);
  background: rgba(201,168,76,0.1);
  color: var(--v-text);
  font-weight: 600;
}
.dispatch-live {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--v-text-3);
}
#poll-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fb344;
  display: inline-block;
}
.dispatch-dock-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.driver-drop-zone {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 120px;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,0.14);
  background: rgba(17,24,39,0.5);
  cursor: copy;
}
.driver-drop-zone small { color: var(--v-text-3); font-size: 0.7rem; text-transform: capitalize; }
.ds-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #888;
}
.ds-available .ds-dot { background: #2fb344; }
.ds-on_trip .ds-dot { background: var(--v-gold); }
.ds-on_break .ds-dot { background: #8b5cf6; }
.dispatch-dock.is-target { outline: 2px solid var(--v-gold); }
.dispatch-list { display: none; padding: 0.75rem; }
.dispatch-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(17,24,39,0.72);
}
.dispatch-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.dispatch-when { margin: 0; color: var(--v-gold); font-weight: 600; }
.dispatch-route { margin: 0; color: var(--v-text-2); font-size: 0.9rem; }
.dispatch-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.dispatch-card-actions .btn { min-height: 44px; flex: 1 1 40%; }
.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 280px;
}
.dispatch-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.dispatch-sheet[hidden] { display: none; }
.dispatch-sheet-inner {
  width: min(480px, 100%);
  padding: 1.25rem;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.08);
}
@media (min-width: 768px) {
  .dispatch-sheet { align-items: center; }
  .dispatch-sheet-inner {
    border-radius: 16px;
    padding-bottom: 1.25rem;
  }
}
.dispatch-dup {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(245,158,11,0.45);
  background: rgba(245,158,11,0.12);
}
.dispatch-dup-title { font-weight: 700; margin-bottom: 0.35rem; color: #fbbf24; }
.dispatch-dup-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.dispatch-dup-actions .btn { min-height: 44px; }

@media (max-width: 767px) {
  .dispatch-table-wrap, .dispatch-dock { display: none; }
  .dispatch-list { display: block; }
  .dispatch-toolbar-actions { width: 100%; }
  .dispatch-toolbar-actions .btn { flex: 1; min-height: 44px; }
  .job-actions { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .kpi-card, .welcome-card, .top-header, .client-topbar, .vip-bottom-nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ── Client trip cards ───────────────────────────────────── */
.trip-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.trip-hero h2 { margin: 0; font-size: 1.5rem; }
.trip-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--v-gold);
}
.trip-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.trip-stat {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(17,24,39,0.72);
}
.trip-stat span { display: block; font-size: 0.75rem; color: var(--v-text-3); }
.trip-stat strong { font-size: 1.25rem; color: var(--v-gold); }
.trip-pay-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(201,168,76,0.35);
  background: rgba(201,168,76,0.1);
}
.trip-pay-banner span, .trip-pay-banner p { color: var(--v-text-2); display: block; }
.trip-section { margin-top: 1.5rem; }
.trip-section h3 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.trip-card {
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(17,24,39,0.72);
}
.trip-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.trip-copy { margin: 0 0 0.5rem; color: var(--v-text-2); font-size: 0.92rem; }
.trip-route { margin: 0 0 0.35rem; }
.trip-meta, .trip-waiting { margin: 0; font-size: 0.85rem; color: var(--v-text-3); }
.trip-fare { margin: 0.35rem 0; color: var(--v-gold); font-weight: 700; }
.trip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.trip-actions .btn { min-height: 44px; }
.trip-panel {
  max-width: 560px;
  padding: 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(17,24,39,0.8);
}
.trip-timeline {
  list-style: none;
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0 1rem;
  margin: 1rem 0;
  position: relative;
}
.trip-timeline::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: rgba(255,255,255,0.1);
}
.trip-timeline li {
  position: relative;
  z-index: 1;
  flex: 1;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--v-text-3);
}
.trip-dot {
  display: block;
  width: 12px;
  height: 12px;
  margin: 0 auto 0.4rem;
  border-radius: 50%;
  background: #334155;
}
.trip-timeline li.is-done .trip-dot { background: #2fb344; }
.trip-timeline li.is-now .trip-dot { background: var(--v-gold); box-shadow: 0 0 0 4px rgba(201,168,76,0.2); }
.trip-timeline li.is-now { color: var(--v-gold); font-weight: 700; }
.trip-timeline li.is-done { color: var(--v-text-2); }
.trip-route-block {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1rem 0;
}
.trip-route-block span { display: block; font-size: 0.72rem; color: var(--v-text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.trip-route-block a { color: var(--v-gold); font-size: 0.8rem; }
.trip-driver {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}
.trip-driver .btn { margin-left: auto; }
.trip-share { margin-top: 1.25rem; }
.trip-share label { display: block; font-size: 0.75rem; color: var(--v-text-3); margin-bottom: 0.35rem; }
.addr-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.star-rating { display: flex; flex-direction: row-reverse; justify-content: center; gap: 0.35rem; margin: 1rem 0 1.25rem; }
.star-rating input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-rating label { font-size: 2rem; color: #334155; cursor: pointer; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label { color: var(--v-gold); }

@media (max-width: 767px) {
  .trip-stats { grid-template-columns: 1fr; }
  .trip-hero .btn { width: 100%; }
  .trip-pay-banner .btn { width: 100%; }
}

/* ── Driver street UI ────────────────────────────────────── */
.street-status {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.1);
  text-align: center;
}
.street-status-now {
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  margin-bottom: 0.75rem;
}
.street-status--available { border-color: #2fb344; }
.street-status--available .street-status-now { color: #2fb344; }
.street-status--on_trip { border-color: var(--v-gold); }
.street-status--on_trip .street-status-now { color: var(--v-gold); }
.street-status--on_break { border-color: #fbbf24; }
.street-status--on_break .street-status-now { color: #fbbf24; }
.street-status--offline .street-status-now { color: var(--v-text-3); }
.street-status-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.street-status-btns .btn {
  flex: 1 1 40%;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 700;
}
.street-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.street-kpis div {
  padding: 0.55rem 0.4rem;
  border-radius: 10px;
  background: rgba(17,24,39,0.7);
  text-align: center;
}
.street-kpis span { display: block; font-size: 0.65rem; color: var(--v-text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.street-kpis strong { font-size: 0.95rem; }
.street-empty { padding: 2rem 1rem; text-align: center; color: var(--v-text-2); }
.street-card {
  padding: 1.1rem;
  margin-bottom: 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(17,24,39,0.82);
}
.street-card.urgent { border-color: #f43f5e; }
.street-card.overdue { border-color: #fbbf24; }
.street-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.street-card time { color: var(--v-gold); font-weight: 700; font-size: 1.15rem; }
.street-flag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f43f5e;
}
.street-flag.is-late { color: #fbbf24; }
.street-card h3 { margin: 0.35rem 0; font-size: 1.35rem; }
.street-route { margin: 0 0 0.75rem; color: var(--v-text-2); }
.street-notes {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
  font-size: 0.9rem;
}
.street-quick, .street-actions, .street-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}
.street-cta { flex: 1 1 100%; min-height: 52px; font-size: 1.1rem; font-weight: 800; }
.street-cta:active,
.street-status-btns .btn:active,
.street-actions .btn:active { opacity: 0.85; }
.street-actions .btn, .street-quick .btn { min-height: 44px; }
.street-photo-btn { position: relative; overflow: hidden; }
.street-photo-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.street-meta { align-self: center; color: var(--v-text-3); font-size: 0.8rem; }
.street-card[aria-busy="true"] { opacity: 0.65; pointer-events: none; }
.street-empty .btn { margin-top: 0.75rem; min-height: 44px; }
body.app-driver { overscroll-behavior-y: contain; }
.street-section { margin-top: 1.5rem; }
.street-section h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.street-next { list-style: none; padding: 0; margin: 0; }
.street-next li {
  display: flex;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.9rem;
}
.street-next span { margin-left: auto; color: var(--v-text-3); }

@media (max-width: 767px) {
  .street-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ── Settings hub ────────────────────────────────────────── */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.settings-tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  color: var(--v-text-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid transparent;
}
.settings-tab:hover { color: var(--v-text); border-color: rgba(255,255,255,0.12); }
.settings-tab.is-active {
  color: #111;
  background: var(--v-gold);
  border-color: var(--v-gold);
}

/* ── App chrome: buttons, header, tables ─────────────────── */
.top-header {
  height: auto;
  min-height: var(--header-height);
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.header-left {
  flex: 1 1 220px;
  min-width: 0;
  align-items: center;
  gap: 12px;
}
.page-heading { min-width: 0; }
.page-title {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.25;
}
.page-lead {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--v-text-3);
  line-height: 1.35;
}
.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.header-actions .btn { min-height: 40px; }

.app-shell .btn,
.client-app .btn {
  min-height: 44px;
  padding: 0.55rem 1.05rem;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  gap: 0.45rem;
  border-width: 1px;
  border-style: solid;
  line-height: 1.2;
}
.app-shell .btn-sm,
.client-app .btn-sm {
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
}
.app-shell .btn-lg,
.client-app .btn-lg {
  min-height: 48px;
  padding: 0.7rem 1.25rem;
  font-size: 1.05rem;
}
.app-shell .btn-vip,
.app-shell .btn-primary,
.client-app .btn-vip,
.client-app .btn-primary {
  background: var(--v-gold);
  border-color: var(--v-gold);
  color: #111;
  font-weight: 750;
}
.app-shell .btn-vip:hover,
.app-shell .btn-primary:hover,
.client-app .btn-vip:hover,
.client-app .btn-primary:hover {
  background: var(--v-gold-light);
  border-color: var(--v-gold-light);
  color: #111;
  opacity: 1;
}
.app-shell .btn-outline-vip,
.client-app .btn-outline-vip {
  background: transparent;
  border-color: rgba(201, 168, 76, 0.55);
  color: var(--v-gold);
}
.app-shell .btn-ghost-secondary,
.app-shell .btn-secondary,
.client-app .btn-ghost-secondary {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.14);
  color: var(--v-text);
}
.app-shell .btn:focus-visible,
.client-app .btn:focus-visible,
.settings-tab:focus-visible {
  outline: 2px solid var(--v-gold);
  outline-offset: 2px;
}
.app-shell .btn i,
.app-shell .btn svg {
  flex-shrink: 0;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
}
.card-header {
  align-items: center;
  gap: 0.75rem;
}
.table th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--v-text-3);
  font-weight: 700;
}
.table td { vertical-align: middle; }
.table .btn { min-height: 40px; }

.form-label {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--v-text-2);
  margin-bottom: 0.35rem;
}
.app-shell .form-control,
.app-shell .form-select,
.client-app .form-control,
.client-app .form-select {
  min-height: 44px;
  font-size: 1rem;
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.page-toolbar .btn { min-height: 40px; }

.client-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.client-page-head h1 { margin: 0; }

@media (max-width: 767px) {
  .header-left { width: 100%; }
  .header-actions { width: 100%; }
  .header-actions .btn { flex: 1 1 auto; }
  .app-shell .content .d-flex.gap-2 .btn,
  .app-shell .dispatch-card-actions .btn {
    min-height: 44px;
  }
}
