/* One Express — dark (default) and light app themes */
[data-theme="dark"],
html:not([data-theme="light"]) {
  color-scheme: dark;
  --bg-page: #16181c;
  --bg-surface: #1f2226;
  --bg-sidebar: #191b1f;
  --bg-elevated: #1f2226;
  --bg-glass: rgba(31, 34, 38, 0.72);
  --bg-inset: #15171a;
  --border: #2c3036;
  --border-soft: #24272c;
  --text-primary: #f2f4f6;
  --text-secondary: #b2b8bf;
  --text-muted: #828891;
  --accent: #46b46a;
  --accent-hover: #3c9e5b;
  --accent-soft: rgba(70, 180, 106, 0.16);
  --accent-text: #ffffff;
  --badge-text: #ffffff;
  --badge-bg: #46b46a;
  --success: #46b46a;
  --success-bg: rgba(70, 180, 106, 0.14);
  --danger: #ef4d5a;
  --danger-bg: rgba(239, 77, 90, 0.14);
  --warning: #f0b13c;
  --info: #5b9bd5;
  --whatsapp: #25D366;
  --radius-lg: 10px;
  --radius-md: 7px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.48);
  --glow-accent: 0 1px 2px rgba(0, 0, 0, 0.25);
  --sidebar-width: 200px;
  --topbar-height: 56px; /* shared: sidebar brand + main topbar */
  --bottom-nav-height: 60px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  /*
   * shadcn slate + Minimals grey (Stripe / Linear / Vercel pattern):
   * — Page canvas: slate-50 (#F8FAFC) — cool, low-glare
   * — Cards / chrome: white (#FFFFFF) — ~3% lift from page
   * — Inset / headers: slate-100 (#F1F5F9)
   * — Borders: slate-200 (#E2E8F0) — soft dividers, not heavy lines
   * — Text: slate-800/600/500 hierarchy
   */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #fafbfc;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --bg-inset: #f1f5f9;
  --border: #e2e8f0;
  --border-soft: #eef2f6;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-soft: rgba(22, 163, 74, 0.08);
  --accent-text: #ffffff;
  --badge-text: #166534;
  --badge-bg: rgba(22, 163, 74, 0.1);
  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.08);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.06);
  --warning: #d97706;
  --info: #2563eb;
  --whatsapp: #25D366;
  --radius-lg: 10px;
  --radius-md: 7px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04);
  --shadow-md: 0 1px 3px 0 rgb(15 23 42 / 0.06), 0 1px 2px -1px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 4px 6px -1px rgb(15 23 42 / 0.06), 0 2px 4px -2px rgb(15 23 42 / 0.04);
  --glow-accent: none;
  --sidebar-width: 200px;
  --topbar-height: 56px;
  --bottom-nav-height: 60px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[hidden] {
  display: none !important;
}

html:has(body.view-auth) {
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html:has(body.view-auth)::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Login pages always use dark theme */
body.view-auth {
  color-scheme: dark;
  --bg-page: #16181c;
  --bg-surface: #1f2226;
  --bg-sidebar: #191b1f;
  --bg-elevated: #1f2226;
  --bg-glass: rgba(31, 34, 38, 0.72);
  --bg-inset: #15171a;
  --border: #2c3036;
  --border-soft: #24272c;
  --text-primary: #f2f4f6;
  --text-secondary: #b2b8bf;
  --text-muted: #828891;
  --accent: #46b46a;
  --accent-hover: #3c9e5b;
  --accent-soft: rgba(70, 180, 106, 0.16);
  --accent-text: #ffffff;
  --badge-text: #ffffff;
  --badge-bg: #46b46a;
  --success: #46b46a;
  --success-bg: rgba(70, 180, 106, 0.14);
  --danger: #ef4d5a;
  --danger-bg: rgba(239, 77, 90, 0.14);
  --warning: #f0b13c;
  --info: #5b9bd5;
  --whatsapp: #25D366;
  --radius-lg: 10px;
  --radius-md: 7px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.48);
  --glow-accent: 0 1px 2px rgba(0, 0, 0, 0.25);
  padding: 0 !important;
  margin: 0;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg-page);
}

.auth-view {
  min-height: 100dvh;
  max-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-page);
}

.app-view {
  min-height: 100dvh;
  background: var(--bg-page);
}

/* Login vs dashboard: only the [hidden] attribute controls which screen is shown. */
#authView[hidden],
#appView[hidden] {
  display: none !important;
}

body.app-body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100dvh;
  padding: 0;
}

[data-theme="light"] body.app-body {
  background: var(--bg-page);
}

/* styles.css sets font-family on * — restore Font Awesome glyphs */
body.app-body .fas,
body.app-body .far {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 900;
  -webkit-font-smoothing: antialiased;
}

body.app-body .far {
  font-weight: 400;
}

body.app-body .fab {
  font-family: "Font Awesome 6 Brands";
  font-style: normal;
  font-weight: 400;
}

.app-shell {
  display: flex;
  min-height: 100dvh;
  background: var(--bg-page);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 120;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}

.sidebar { box-shadow: var(--shadow-sm); }

.sidebar.open { transform: translateX(0); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: var(--topbar-height);
  height: var(--topbar-height);
  max-height: var(--topbar-height);
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand .brand-logo { width: 28px; height: 28px; }

.sidebar-brand-text {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  color: var(--text-primary);
}

.sidebar-brand-title {
  display: block;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
}

#driverApp .sidebar-driver-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 3px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  flex: none;
  flex-grow: 0;
  flex-shrink: 0;
  align-self: stretch;
  min-height: 0;
  height: auto;
  box-sizing: border-box;
  transition: color 0.15s;
}

#driverApp .sidebar-driver-menu-item:hover,
#driverApp .sidebar-driver-menu-item.is-active {
  color: var(--accent);
}

#driverApp .sidebar-driver-menu-item:hover i,
#driverApp .sidebar-driver-menu-item.is-active i {
  color: var(--accent);
}

#driverApp .sidebar-driver-menu-item.is-active .sidebar-driver-name {
  color: var(--accent);
  font-weight: 600;
}

#driverApp .sidebar-driver-menu-item i {
  width: 14px;
  flex-shrink: 0;
  text-align: center;
  font-size: 12px;
  color: var(--accent);
}

#driverApp .sidebar-driver-name {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}

[data-theme="dark"] #driverApp .sidebar-driver-name {
  color: #f5f5f5;
}

.sidebar-brand-sub,
.sidebar-brand-text small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
  line-height: 1.2;
}

.topbar-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.topbar-driver-name {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

#driverApp .topbar-driver-name:hover {
  text-decoration: underline;
}

[data-theme="dark"] .topbar-driver-name {
  color: #86efac;
}

@media (min-width: 1024px) {
  .topbar-driver-name {
    display: none !important;
  }
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

/* Override global button styles from styles.css.
   Nav items copy the Google Photos sidebar: rounded-right pill, 4px left
   accent bar, accent-tinted background + accent text/icon when active. */
body.app-body .sidebar .sidebar-link,
body.app-body .sidebar-nav .sidebar-link {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: auto;
  min-height: 0;
  height: auto;
  margin: 1px 8px 1px 0;
  padding: 8px 16px;
  border: none;
  border-left: 4px solid transparent;
  border-radius: 0 999px 999px 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

body.app-body .sidebar .sidebar-link i,
body.app-body .sidebar-nav .sidebar-link i {
  width: 22px;
  height: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  text-align: center;
  font-size: 17px;
  transition: color 0.15s;
}

body.app-body .sidebar .sidebar-link:hover,
body.app-body .sidebar-nav .sidebar-link:hover {
  background: var(--bg-inset, var(--accent-soft));
  color: var(--text-primary);
}

body.app-body .sidebar .sidebar-link.active,
body.app-body .sidebar-nav .sidebar-link.active {
  background: var(--bg-inset, var(--accent-soft));
  border-left-color: var(--accent);
  color: var(--text-primary);
  font-weight: 600;
}

body.app-body .sidebar .sidebar-link.active i,
body.app-body .sidebar-nav .sidebar-link.active i {
  background: transparent;
  color: var(--accent);
}

.sidebar-footer {
  padding: 6px 12px 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

#dashboard .sidebar-logo-footer {
  display: none;
}

.sidebar-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
}

.sidebar-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-meta { min-width: 0; flex: 1; }

.sidebar-user-meta strong {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-meta span { font-size: 10px; line-height: 1.2; color: var(--text-muted); }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.sidebar-overlay.visible { opacity: 1; pointer-events: auto; }

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  min-height: var(--topbar-height);
  height: var(--topbar-height);
  max-height: var(--topbar-height);
  padding: 0 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-soft);
}

/* ===== Dashboard: single full-width topbar ===== */
#dashboard > .topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 130;
  padding: 0 20px;
  gap: 14px;
}

/* Brand: logo always visible on dashboard; text/divider from tablet up */
#dashboard .topbar-brand { display: flex; }

@media (max-width: 1023px) {
  #dashboard .topbar-brand-text,
  #dashboard .topbar-divider { display: none; }
}

/* Sidebar starts below the full-width topbar */
#dashboard .sidebar {
  top: var(--topbar-height);
  bottom: 0;
}

/* Push app-shell content below the fixed topbar */
#dashboard.app-shell {
  padding-top: var(--topbar-height);
}

/* Brand section inside the topbar */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.topbar-brand .brand-logo {
  display: block;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  object-fit: contain;
}

.topbar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.topbar-brand-text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-brand-text small {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Thin vertical divider between brand and workspace */
.topbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border-soft);
  flex-shrink: 0;
  display: none;
}

.icon-btn:not(.topbar-icon-btn) {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  min-width: 40px;
  max-width: 40px;
  padding: 0;
  margin: 0;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

body.app-body #driverApp .topbar .topbar-icon-btn,
body.app-body #driverApp .topbar button.topbar-icon-btn,
body.app-body #driverApp .topbar a.topbar-icon-btn,
body.app-body .topbar .icon-btn,
body.app-body .topbar button.icon-btn,
body.app-body .topbar button.topbar-profile-btn {
  flex: 0 0 40px !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
  border-radius: 50% !important;
  -webkit-border-radius: 50% !important;
  aspect-ratio: 1 / 1 !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  -webkit-text-decoration: none !important;
  border-bottom: none !important;
  line-height: 1 !important;
  font-size: 16px !important;
  overflow: hidden;
}

body.app-body #driverApp .topbar .topbar-icon-btn.topbar-icon-btn--chrome {
  background: var(--glass-fill) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  backdrop-filter: var(--glass-blur) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}

body.app-body #driverApp .topbar a.topbar-icon-btn.topbar-icon-btn--accent,
body.app-body #driverApp .topbar .topbar-icon-btn.topbar-icon-btn--accent {
  background: var(--accent-soft) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  backdrop-filter: var(--glass-blur) !important;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent) !important;
  color: var(--accent) !important;
}

body.app-body #driverApp .topbar .topbar-icon-btn i,
body.app-body #driverApp .topbar a.topbar-icon-btn i {
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
}

.icon-btn:hover { background: var(--bg-inset); color: var(--text-primary); }

.page-title {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* ===== Orbitly-style shell: brand chip, section labels, footer, topbar, page head ===== */
.sidebar-brand .brand-logo-wrap {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
}

.sidebar-brand .brand-logo { width: 30px; height: 30px; }

.sidebar-section-label {
  margin: 14px 16px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-nav .sidebar-section-label:first-child { margin-top: 6px; }

/* Bottom links group inside the nav (Theme + Logout) */
.sidebar-bottom-links {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
}

body.app-body .sidebar-link-logout:hover {
  color: var(--danger);
}
body.app-body .sidebar-link-logout:hover i {
  color: var(--danger);
}

/* Workspace + user cluster — right column of dashboard header */
.topbar-body-row {
  display: contents;
}

#dashboard .topbar-body-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

/* Workspace label — single topbar row on dashboard */
.topbar-workspace {
  display: none;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-workspace-badge {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--bg-inset);
  color: var(--accent);
  font-size: 8px;
}

.topbar-workspace-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.topbar-workspace-text strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-workspace-text small {
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-flex-spacer { flex: 1; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-user-text {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.topbar-user-text strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-user-text small {
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-user-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-inset);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-soft);
}

/* Big page title in content (ref puts the page title in the body) */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.page-head .page-title {
  flex: 0 1 auto;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Universal action buttons — neutral default; green border + tinted fill on hover/selected only. */
body.app-body .submit-btn,
body.app-body .btn-dark,
body.app-body .btn-ghost,
body.app-body .reset-btn,
body.app-body .filter-chip,
body.app-body .journey-confirm-no,
body.app-body .driver-earnings-view-all,
body.app-body .auth-view .login-card .submit-btn,
body.app-body .messages-send-btn,
body.app-body .messages-back-btn,
body.app-body .messages-clear-chat-btn,
body.app-body .route-passenger-outcome-btn:not(.is-selected):not(.route-passenger-outcome-npu) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

body.app-body .btn-sm,
body.app-body .submit-btn.btn-sm,
body.app-body .btn-dark.btn-sm,
body.app-body .btn-ghost.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}

body.app-body .submit-btn:hover:not(:disabled),
body.app-body .btn-dark:hover:not(:disabled),
body.app-body .btn-ghost:hover:not(:disabled),
body.app-body .reset-btn:hover:not(:disabled),
body.app-body .filter-chip:hover,
body.app-body .journey-confirm-no:hover,
body.app-body .driver-earnings-view-all:hover,
body.app-body .auth-view .login-card .submit-btn:hover:not(:disabled),
body.app-body .messages-send-btn:hover:not(:disabled),
body.app-body .messages-back-btn:hover,
body.app-body .messages-clear-chat-btn:hover,
body.app-body .route-passenger-outcome-btn:not(.is-selected):not(.route-passenger-outcome-npu):hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

body.app-body .submit-btn:active:not(:disabled),
body.app-body .btn-dark:active:not(:disabled),
body.app-body .btn-ghost:active:not(:disabled),
body.app-body .reset-btn:active:not(:disabled),
body.app-body .filter-chip:active,
body.app-body .journey-confirm-no:active,
body.app-body .driver-earnings-view-all:active,
body.app-body .auth-view .login-card .submit-btn:active:not(:disabled),
body.app-body .messages-send-btn:active:not(:disabled) {
  transform: translateY(1px);
}

body.app-body .filter-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

body.app-body .submit-btn:disabled,
body.app-body .btn-dark:disabled,
body.app-body .btn-ghost:disabled,
body.app-body .messages-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body.app-body .buttons .submit-btn,
body.app-body .buttons .reset-btn,
body.app-body .buttons .btn-ghost {
  flex: 1;
}

body.app-body .auth-view .login-card .submit-btn {
  flex: none;
  width: 100%;
}

.content-area {
  flex: 1;
  padding: 18px 16px;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
}

/* Driver portal: scroll only the main column (smooth, no document scrollbar) */
html:has(body.view-app #driverApp),
html.cap-native-edge {
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--bg-page);
}

body.view-app:has(#driverApp) {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg-page);
}

body.view-app:has(#driverApp) #appView {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-page);
}

body.view-app:has(#driverApp) #driverApp.app-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  align-self: stretch;
}

body.view-app:has(#driverApp) #driverApp .main-content {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.view-app:not(.driver-messages-view):has(#driverApp) #driverApp .topbar {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  padding-top: max(12px, var(--driver-safe-top, 0px));
  padding-bottom: 4px;
}

body.view-app:not(.driver-messages-view):has(#driverApp) #driverApp .driver-content-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.view-app:not(.driver-messages-view):has(#driverApp) #driverApp .driver-content-area::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

@media (max-width: 1023px) {
  body.view-app:has(#driverApp) #appView {
    padding-bottom: 0;
  }

  body.view-app:not(.driver-messages-view):has(#driverApp) #driverApp .driver-content-area {
    padding-bottom: var(--driver-bottom-reserve, calc(var(--bottom-nav-height) + var(--driver-safe-bottom, 0px)));
  }
}

.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.stat-rings {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 640px) {
  .stat-rings { grid-template-columns: repeat(4, 1fr); }
}

.stat-ring {
  position: relative;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-ring:hover {
  transform: translateY(-2px);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

.stat-ring-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.stat-ring-label {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Total £ ring uses a flat accent tint as the focal card. */
.stat-rings .stat-ring:last-child {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}

.stat-rings .stat-ring:last-child .stat-ring-value {
  color: var(--accent);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-chip {
  padding: 7px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.price-badge {
  display: inline;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
}

.submission-card .price-badge-highlight,
.submission-card .task-meta-row .price-badge-highlight {
  color: inherit;
  background: transparent;
}

[data-theme="dark"] .submission-card .price-badge-highlight,
[data-theme="dark"] .submission-card .task-meta-row .price-badge-highlight {
  color: inherit;
}

[data-theme="light"] .submission-card .price-badge-highlight {
  color: inherit;
}

.submission-card .submission-date-badge {
  font-size: 13px;
  font-weight: inherit;
  color: inherit;
  background: transparent;
}

[data-theme="dark"] .submission-card .submission-date-badge {
  color: inherit;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.login-screen-wrap {
  height: 100%;
  min-height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  justify-items: center;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  background: var(--bg-page);
  box-sizing: border-box;
  overflow: hidden;
}

.login-screen-copyright {
  grid-row: 2;
  margin: 0;
  width: 100%;
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
  text-align: center;
  padding-top: 12px;
}

.login-screen-inner {
  grid-row: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vh, 24px);
  align-self: center;
  justify-self: center;
  min-height: 0;
  overflow: hidden;
}

.login-screen-brand {
  --login-brand-height: 32px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  width: 100%;
  min-height: var(--login-brand-height);
}

.login-screen-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex: 0 0 auto;
  width: var(--login-brand-height);
  height: var(--login-brand-height);
}

.login-screen-logo {
  width: var(--login-brand-height);
  height: var(--login-brand-height);
  display: block;
  object-fit: contain;
}

.login-screen-title {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  height: var(--login-brand-height);
  display: flex;
  align-items: center;
  font-size: var(--login-brand-height);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  color: var(--text-primary);
  text-transform: uppercase;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card-heading {
  text-align: center;
  margin-top: 0;
}

.login-card-status {
  text-align: center;
}

.login-card-status .loading {
  margin: 0;
}

.login-card-footer {
  margin-top: 16px;
  text-align: center;
}

@media (max-width: 768px) {
  .login-screen-wrap {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }

  .login-screen-inner {
    max-width: none;
    width: 100%;
    gap: 12px;
    padding: 4px 0;
  }

  .login-screen-brand {
    --login-brand-height: 28px;
    gap: 8px;
  }

  .login-card {
    width: 100%;
    max-width: none;
  }

  .auth-view .login-card.login-card-banking,
  .auth-view .login-card.login-card-status {
    padding: 0;
  }

  .login-banking-header {
    margin-bottom: 12px;
  }

  .login-greeting-user {
    font-size: clamp(19px, 5vw, 24px);
  }

  .login-banking-form {
    gap: 10px;
  }

  .login-keypad {
    gap: 8px;
  }

  .login-key {
    min-height: 48px;
    font-size: 20px;
    border-radius: var(--radius-md);
  }

}

@media (max-width: 768px) and (max-height: 740px) {
  .login-screen-brand {
    --login-brand-height: 24px;
  }

  .login-banking-header {
    margin-bottom: 8px;
  }

  .login-key {
    min-height: 42px;
    font-size: 18px;
  }

  .login-keypad {
    gap: 6px;
  }
}

.auth-view .login-card .submit-btn {
  flex: none;
  width: 100%;
  justify-content: center;
}

.auth-view .login-card.login-card-banking,
.auth-view .login-card.login-card-status {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.login-banking-header {
  text-align: center;
  margin-bottom: 20px;
}

.login-greeting {
  margin: 0 0 6px;
  font-size: clamp(15px, 3.8vw, 17px);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.login-greeting-user {
  margin: 0;
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  word-break: break-word;
}

.login-banking-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: center;
}

.login-card-banking {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0;
}

.login-name-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 300px;
}

.login-name-field.is-hidden {
  display: none;
}

.login-name-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  width: 100%;
}

.login-name-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 16px;
  box-sizing: border-box;
}

.login-name-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.login-switch-user {
  align-self: center;
  margin: 8px 0 0;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.login-switch-user:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Welcome back screen (returning drivers — no PIN) */
.login-screen-wrap-welcome {
  grid-template-rows: minmax(0, 1fr) auto auto;
}

.login-screen-wrap-welcome .welcome-switch-user {
  grid-row: 2;
  align-self: end;
  justify-self: center;
  margin: 0;
  padding: 6px 10px 2px;
}

.login-screen-wrap-welcome .login-screen-copyright {
  grid-row: 3;
  padding-top: 6px;
}

.login-welcome-inner {
  gap: clamp(20px, 4vh, 32px);
}

.login-welcome-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.login-welcome-logo {
  width: clamp(64px, 18vw, 88px);
  height: clamp(64px, 18vw, 88px);
  display: block;
  object-fit: contain;
}

.login-welcome-title {
  --login-brand-height: clamp(28px, 7vw, 36px);
  margin-top: -4px;
}

.login-welcome-text {
  text-align: center;
  width: 100%;
}

.login-welcome-sub {
  margin: 10px 0 0;
  font-size: clamp(14px, 3.5vw, 16px);
  color: var(--text-muted);
  font-weight: 500;
}

.welcome-go-ring {
  flex: 0 0 auto;
  align-self: center;
  position: relative;
  width: 136px;
  height: 136px;
  margin-top: clamp(8px, 2vh, 16px);
}

.welcome-go-ring::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.2;
  pointer-events: none;
}

.welcome-go-ring::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--accent-soft);
  opacity: 0.5;
  pointer-events: none;
}

.welcome-go-btn {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  box-shadow: none;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.welcome-go-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 12px 26px rgba(0, 0, 0, 0.28);
}

.welcome-go-btn:active:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-text);
  transform: scale(0.96) translateZ(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 18px rgba(0, 0, 0, 0.22);
}

.welcome-go-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.welcome-go-btn-label {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  padding-left: 0.12em;
  user-select: none;
}

@media (max-width: 768px) and (max-height: 740px) {
  .login-welcome-inner {
    gap: 14px;
  }

  .welcome-go-ring {
    width: 120px;
    height: 120px;
    margin-top: 4px;
  }

  .welcome-go-btn-label {
    font-size: 26px;
  }
}

.login-pin-label {
  margin: 4px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.login-pin-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 20px;
  margin: 2px 0 4px;
}

.login-pin-display.is-error {
  animation: login-pin-shake 0.45s ease;
}

@keyframes login-pin-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.login-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.login-pin-dot.is-filled {
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.05);
}

.login-pin-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.login-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
  width: 100%;
  max-width: 300px;
}

.login-key {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.login-key:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.login-key:active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.login-key-back {
  font-size: 22px;
  color: var(--text-secondary);
}

.login-key-clear {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.login-checking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #44b669);
}

.login-keypad.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.login-card-banking #loginError {
  width: 100%;
  max-width: 300px;
  text-align: center;
}

.mobile-bottom-nav {
  display: none;
}

.topbar-chrome {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

body.app-body .icon-btn-logout {
  color: var(--danger);
}

body.app-body .icon-btn-logout:hover {
  color: #f87171;
  background: var(--danger-bg);
  border-color: var(--danger);
}

@media (max-width: 1023px) {
  .sidebar,
  .sidebar-overlay,
  .menu-btn,
  .sidebar-chrome {
    display: none !important;
  }

  body.view-app #appView {
    min-height: 100dvh;
    padding-bottom: calc(var(--bottom-nav-height) + var(--driver-safe-bottom, env(safe-area-inset-bottom, 0px)));
  }

  body.view-app #appView:has(.app-mobile-footer) {
    padding-bottom: calc(var(--bottom-nav-height) + 32px + var(--driver-safe-bottom, env(safe-area-inset-bottom, 0px)));
  }

  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    min-height: var(--bottom-nav-height);
    padding: 4px 6px calc(4px + var(--driver-safe-bottom, env(safe-area-inset-bottom, 0px)));
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    box-sizing: border-box;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  body.view-app .app-mobile-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--bottom-nav-height) + var(--driver-safe-bottom, env(safe-area-inset-bottom, 0px)));
    z-index: 999;
    margin: 0;
    padding: 6px 12px;
    font-size: 11px;
    background: var(--bg-page);
    border-top: 1px solid var(--border);
    border-bottom: none;
  }

  body.view-app .app-shell {
    padding-bottom: 28px;
  }

  body.app-body .mobile-bottom-nav .bottom-nav-link {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin: 0;
    padding: 4px 2px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
  }

  body.app-body .mobile-bottom-nav .bottom-nav-link i {
    font-size: 18px;
    width: auto;
    flex-shrink: 0;
  }

  body.app-body .mobile-bottom-nav .bottom-nav-link span:not(.nav-unread-badge):not(.bottom-nav-icon-wrap) {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.app-body .mobile-bottom-nav .bottom-nav-link:hover,
  body.app-body .mobile-bottom-nav .bottom-nav-link.active {
    background: transparent;
    color: var(--accent);
    font-weight: 600;
  }

  .topbar-chrome {
    display: flex;
  }

  .app-shell {
    padding-left: 0;
    padding-bottom: 0;
  }

  .main-content {
    padding-bottom: 8px;
  }

  .main-content .footer {
    margin-bottom: 0;
  }
}

@media (min-width: 1024px) {
  :root,
  [data-theme="dark"],
  [data-theme="light"],
  html:not([data-theme="light"]) {
    --sidebar-width: 224px;
  }

  .sidebar { position: fixed; transform: none; }
  .sidebar-overlay, .menu-btn, .mobile-bottom-nav { display: none !important; }
  .sidebar-chrome { display: none !important; }
  .topbar-chrome {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }
  .app-shell { padding-left: var(--sidebar-width); padding-bottom: 0; }
  .content-area { padding: 20px 24px; }

  /* Sidebar brand row aligns with main topbar on desktop */
  .sidebar-brand,
  .main-content > .topbar {
    box-sizing: border-box;
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    max-height: var(--topbar-height);
    padding-top: 0;
    padding-bottom: 0;
  }

  .sidebar-brand {
    padding-left: 16px;
    padding-right: 16px;
  }

  #driverApp .sidebar-driver-menu-item {
    padding: 8px 16px;
    gap: 10px;
  }

  #driverApp .sidebar-driver-menu-item i {
    width: 18px;
    font-size: 15px;
  }

  #driverApp .sidebar-driver-name {
    font-size: 14px;
  }

  /* Larger sidebar menu items on desktop */
  body.app-body .sidebar .sidebar-link,
  body.app-body .sidebar-nav .sidebar-link {
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.4;
    gap: 14px;
  }

  body.app-body .sidebar .sidebar-link i,
  body.app-body .sidebar-nav .sidebar-link i {
    width: 22px;
    font-size: 17px;
  }

  .sidebar-nav {
    padding: 10px 0;
  }

  /* Admin dashboard: use full width beside the sidebar */
  #dashboard .content-area {
    max-width: none;
    margin: 0;
    padding: 16px 24px 24px;
  }

  /* Header grid: logo above sidebar | live dashboard + user above body */
  #dashboard > .topbar {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    align-items: center;
    padding: 0;
    gap: 0;
  }

  #dashboard .topbar-brand {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: var(--sidebar-width);
    padding-left: 24px;
    box-sizing: border-box;
  }

  #dashboard .topbar-body-row {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 0 24px;
    box-sizing: border-box;
  }

  #dashboard .topbar-workspace {
    display: flex;
    flex: 0 0 auto;
    padding-left: 0;
  }

  #dashboard .topbar-flex-spacer {
    flex: 1;
    min-width: 0;
  }

  #dashboard .topbar-user-text { display: flex; }
  #dashboard .topbar .page-title { display: none; }
}

@media (min-width: 1280px) {
  #dashboard .content-area {
    padding: 18px 32px 28px;
  }

  #dashboard > .topbar {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  #dashboard .topbar-brand {
    padding-left: 32px;
  }

  #dashboard .topbar-body-row {
    padding: 0 32px;
  }
}

@media (min-width: 1024px) {
  #driverApp .content-area {
    max-width: none;
    margin: 0;
    padding: 24px 28px 32px;
  }

  #driverApp .topbar {
    padding: 0 28px;
  }
}

@media (min-width: 1280px) {
  #driverApp .content-area {
    padding: 28px 40px 40px;
  }

  #driverApp .topbar {
    padding: 0 40px;
  }
}

/* Forms & buttons */
body.app-body label {
  color: var(--text-secondary);
  font-size: 14px;
}

body.app-body select,
body.app-body input[type="date"],
body.app-body input[type="month"],
body.app-body input[type="text"],
body.app-body input[type="password"],
body.app-body input[type="number"] {
  background: var(--bg-inset, var(--bg-page));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

[data-theme="light"] body.app-body select,
[data-theme="light"] body.app-body input,
[data-theme="light"] body.app-body textarea {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
}

[data-theme="light"] body.app-body .glass-card,
[data-theme="light"] body.app-body .submission-card,
[data-theme="light"] body.app-body .stat-ring,
[data-theme="light"] body.app-body .summary-stat {
  background: var(--bg-surface);
  border-color: var(--border-soft);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] body.app-body .topbar,
[data-theme="light"] body.app-body .sidebar {
  background: var(--bg-sidebar);
  border-color: var(--border-soft);
}

[data-theme="light"] body.app-body .mobile-bottom-nav {
  background: var(--bg-sidebar);
  border-top-color: var(--border-soft);
  box-shadow: 0 -1px 3px rgb(15 23 42 / 0.06);
}

[data-theme="light"] body.app-body .submission-card {
  border-color: var(--border-soft);
}

[data-theme="light"] body.app-body .assigned-job-card {
  background: var(--bg-surface);
  border-color: var(--border-soft);
}

[data-theme="light"] body.app-body .assigned-job-submitted-tag {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}

[data-theme="light"] body.app-body .assigned-job-addr-time {
  color: var(--text-primary);
}

[data-theme="light"] body.app-body #datePills .date-pill {
  background: var(--bg-surface);
  border-color: var(--border-soft);
}

body.app-body select:focus,
body.app-body input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

body.app-body .hint { color: var(--text-muted); }

body.app-body .alert-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: #fca5a5;
}

body.app-body .alert-success {
  background: var(--success-bg);
  border: 1px solid var(--accent);
  color: #86efac;
}

body.app-body .job-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

body.app-body .job-section.filled { border-left-color: var(--whatsapp); }

body.app-body .job-head-title { color: var(--accent); }
body.app-body .job-head-left .fa-car { color: var(--accent); }

body.app-body .checkbox-option label {
  background: var(--bg-page);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

body.app-body .checkbox-option input:checked + label {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

body.app-body .footer {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 16px;
}

.submissions-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.submission-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  height: 100%;
}

.submission-card .job-line + .job-line {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

#tab-submissions .submission-card .job-line + .job-line {
  margin-top: 4px;
  padding-top: 4px;
}

.submission-card header.submission-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

#tab-submissions .submission-card header.submission-card-header {
  margin-bottom: 6px;
  padding-bottom: 6px;
}

.submission-card-head-left {
  flex: 1;
  min-width: 0;
}

.submission-card header.submission-card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: inherit;
  color: inherit;
}

.submission-card header .task-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 6px 0 0;
}

.submission-card-head-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.submission-card header .submission-card-time {
  font-size: 12px;
  color: inherit;
  text-align: right;
  white-space: nowrap;
}

.submission-card header .submission-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: none;
}

.submission-card .job-line {
  display: block;
  padding: 0;
  margin: 8px 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-primary);
}

.submission-card .job-line-main {
  flex: 1;
  min-width: 0;
}

.submission-card .job-line-title {
  color: var(--text-primary);
}

.submission-card .job-line-title .job-line-name,
.submission-card .job-line-title strong.job-line-name {
  color: inherit;
  font-weight: inherit;
}

.submission-card .job-sub.job-line-address,
.submission-card .job-line-address,
#tab-submissions .submission-card .job-sub.job-line-address,
#tab-submissions .submission-card .job-line-address {
  display: none !important;
}

.submission-card .job-line-stats {
  flex: 0 0 auto;
  text-align: right;
  font-size: 14px;
  font-weight: inherit;
  line-height: 1.35;
  color: inherit;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .submission-card .job-line {
    flex-direction: column;
    gap: 4px;
  }

  .submission-card .job-line-stats {
    max-width: none;
    text-align: left;
  }
}

.submission-card .job-sub {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-primary);
}

.submission-card .job-meta,
.submission-card .job-meta-total {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
  color: var(--text-primary);
}


/* Icon-only edit / delete — same on submissions, drivers, jobs */
body.app-body .icon-action-btn,
body.app-body .editable-list .icon-action-btn,
body.app-body .editable-list button.icon-action-btn,
body.app-body .list-actions .icon-action-btn,
body.app-body .submission-card .icon-action-btn,
body.app-body .submission-actions .icon-action-btn,
body.app-body #tab-submissions .submission-card .icon-action-btn {
  flex: 0 0 auto !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  background: var(--bg-surface) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  cursor: pointer;
  font-size: 14px !important;
  line-height: 1 !important;
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

body.app-body .icon-action-edit:hover,
body.app-body .editable-list .icon-action-edit:hover,
body.app-body .submission-card .edit-btn.icon-action-btn:hover,
body.app-body #tab-submissions .submission-card .edit-btn.icon-action-btn:hover,
body.app-body #dashboard .submission-card .edit-btn.icon-action-btn:hover {
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
}

body.app-body .icon-action-edit.editing,
body.app-body .editable-list .icon-action-edit.editing,
body.app-body #tab-submissions .submission-card .edit-btn.icon-action-btn.editing,
body.app-body #dashboard .submission-card .edit-btn.icon-action-btn.editing {
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
}

body.app-body .icon-action-remove,
body.app-body .editable-list .icon-action-remove,
body.app-body .editable-list button.delete-btn.icon-action-btn,
body.app-body .submission-card .delete-btn.icon-action-btn,
body.app-body #tab-submissions .submission-card .delete-btn.icon-action-btn,
body.app-body #dashboard .submission-card .delete-btn.icon-action-btn {
  color: var(--text-secondary) !important;
  background: var(--bg-surface) !important;
  border-color: var(--border) !important;
}

body.app-body .icon-action-remove:hover,
body.app-body .editable-list .icon-action-remove:hover,
body.app-body .submission-card .delete-btn.icon-action-btn:hover,
body.app-body #tab-submissions .submission-card .delete-btn.icon-action-btn:hover,
body.app-body #dashboard .submission-card .delete-btn.icon-action-btn:hover {
  color: var(--danger) !important;
  background: var(--danger-bg) !important;
  border-color: var(--danger) !important;
}

body.app-body .submission-card .job-line-stats,
body.app-body #tab-submissions .submission-card .job-line-stats {
  color: inherit !important;
  font-weight: inherit;
}

body.app-body .submission-card .job-line-title .journey-tag-trip,
body.app-body .submission-card .job-line-title .journey-tag-npu,
body.app-body .submission-card .journey-tag {
  color: inherit !important;
}

[data-theme="dark"] body.app-body .submission-card,
[data-theme="dark"] body.app-body #tab-submissions .submission-card,
[data-theme="dark"] body.app-body #dashboard .submission-card,
[data-theme="dark"] body.app-body .submission-card h3,
[data-theme="dark"] body.app-body .submission-card time,
[data-theme="dark"] body.app-body .submission-card .job-line,
[data-theme="dark"] body.app-body .submission-card .job-line-title,
[data-theme="dark"] body.app-body .submission-card .job-line-title strong,
[data-theme="dark"] body.app-body .submission-card .job-sub,
[data-theme="dark"] body.app-body .submission-card .job-meta,
[data-theme="dark"] body.app-body .submission-card .price-badge,
[data-theme="dark"] body.app-body .submission-card .price-badge-highlight,
[data-theme="dark"] body.app-body .submission-card .journey-tag,
[data-theme="dark"] body.app-body .submission-card .job-line-stats,
[data-theme="dark"] body.app-body .submission-card .icon-action-btn,
[data-theme="dark"] body.app-body .submission-card .icon-action-btn i,
[data-theme="dark"] body.app-body .submission-card .submission-card-time,
[data-theme="dark"] body.app-body .submission-card .submission-card-time i {
  color: #fff !important;
}

.submissions-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.filter-badge {
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
}

[data-theme="dark"] .filter-badge {
  color: #86efac;
}

.summary-chip,
#tab-submissions .summary-chip,
.submissions-summary .summary-chip {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft) !important;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 13px;
}

[data-theme="dark"] .summary-chip,
[data-theme="dark"] #tab-submissions .summary-chip,
[data-theme="dark"] .submissions-summary .summary-chip {
  background: var(--accent-soft) !important;
  border-color: var(--border);
  color: #f5f5f5 !important;
}

[data-theme="dark"] .summary-chip strong {
  color: #f5f5f5 !important;
}

body.app-body .editable-list li {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

body.app-body .tab-panel h2,
body.app-body .portal-title { color: var(--text-primary); }

body.app-body .chip {
  background: var(--accent-soft);
  color: #86efac;
  border: 1px solid var(--border);
}

body.app-body .chip-ok { color: #86efac; border-color: var(--accent); }
body.app-body .chip-warn { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }
body.app-body .chip-expired { background: var(--danger-bg); color: #fca5a5; }

body.app-body .profile-office-display {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

body.app-body .profile-dl dt { color: var(--text-muted); }
body.app-body .profile-dl dd { color: var(--text-primary); }

body.app-body .earnings-summary {
  background: transparent;
  border: none;
}

body.app-body .earnings-summary .summary-stat,
body.app-body .driver-earnings-rail-summary .summary-stat {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

body.app-body .earnings-list .earn-card,
body.app-body .driver-earnings-rail-list .earn-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--whatsapp);
  border-radius: var(--radius-md);
}

body.app-body #driverApp .driver-earnings-report .job-stats-driver-grid {
  background: var(--bg-surface);
  border-color: var(--border);
}

body.app-body #driverApp .driver-earnings-report .job-stats-driver-row-head .job-stats-driver-cell {
  background: var(--bg-page);
  color: var(--text-muted);
}

body.app-body #driverApp .driver-earnings-report .job-stats-driver-cell {
  border-color: var(--border);
  color: var(--text-primary);
}

body.app-body #driverApp .driver-earnings-report .job-stats-driver-day-band {
  background: var(--bg-page);
  border-color: var(--border);
  color: var(--text-primary);
}

body.app-body #panel-earnings .earnings-toolbar.glass-card,
body.app-body .driver-earnings-aside-inner.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

body.app-body .summary-num {
  color: var(--accent);
}

[data-theme="dark"] body.app-body .summary-num {
  color: #86efac;
}

body.app-body .earn-total,
body.app-body .earn-total strong {
  color: var(--accent);
}

[data-theme="dark"] body.app-body .earn-total,
[data-theme="dark"] body.app-body .earn-total strong {
  color: #86efac;
}

body.app-body .earn-job strong {
  color: var(--text-primary);
}

[data-theme="dark"] body.app-body .earn-date,
[data-theme="dark"] body.app-body .earn-job strong {
  color: #f5f5f5;
}

body.app-body code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

[data-theme="dark"] body.app-body code { color: #86efac; }

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

body.app-body .sidebar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 6px 0 2px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s;
}

body.app-body .sidebar-logout-btn i {
  width: 14px;
  flex-shrink: 0;
  font-size: 12px;
}

body.app-body .sidebar-logout-btn:hover {
  color: var(--danger);
  background: transparent;
}

body.app-body .sidebar-footer .icon-btn.sidebar-theme-btn,
body.app-body .sidebar-footer #themeToggle {
  flex: 0 0 auto !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.app-body .footer-link a { color: var(--accent); }

body.app-body .portal-panel,
body.app-body .tab-panel { display: none; }

body.app-body .portal-panel.active,
body.app-body .tab-panel.active { display: block; }

body.app-body .driver-profile-summary { margin-bottom: 12px; }

/* Dark theme: override legacy light styles from styles.css / admin.css */
body.app-body .job-section,
body.app-body .profile-fieldset,
body.app-body .profile-load-hint {
  background: var(--bg-page);
  border-color: var(--border);
  color: var(--text-secondary);
}

body.app-body .earn-card,
body.app-body .earn-other-card {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

body.app-body .summary-stat {
  background: var(--bg-surface);
  border-color: var(--border);
}

body.app-body .job-head-title,
body.app-body .job-head-left .fa-car,
body.app-body .job-head-summary.ok,
body.app-body .earn-date,
body.app-body .earn-total,
body.app-body .profile-section-title,
body.app-body .profile-dl dd,
body.app-body .filter-group label {
  color: var(--text-primary);
}

body.app-body .job-head-summary,
body.app-body .job-chevron,
body.app-body .job-head-summary.warn,
body.app-body .summary-label,
body.app-body .profile-fieldset legend,
body.app-body .profile-dl dt,
body.app-body .profile-dl dd.profile-empty {
  color: var(--text-muted);
}

body.app-body .checkbox-option label {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

body.app-body .checkbox-option input:checked + label {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

body.app-body .driver-profile-summary .chip {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

body.app-body .driver-profile-summary .chip-ok {
  background: var(--accent-soft);
  color: #86efac;
  border-color: var(--accent);
}

body.app-body .driver-profile-summary .chip-warn {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
  border-color: var(--border);
}

body.app-body .driver-profile-summary .chip-expired {
  background: var(--danger-bg);
  color: #fca5a5;
  border-color: var(--danger);
}

body.app-body .profile-load-hint {
  background: rgba(251, 191, 36, 0.12);
  border-color: var(--warning);
  color: #fcd34d;
}

body.app-body .earn-job {
  border-top-color: var(--border);
  color: var(--text-secondary);
}

body.app-body .earn-job .job-meta {
  background: var(--accent-soft);
  color: #86efac;
}

body.app-body .hint,
body.app-body label,
body.app-body .form-group label {
  color: var(--text-muted);
}

body.app-body .editable-list li,
body.app-body .editable-list li.driver-card,
body.app-body .jobs-list li.job-card,
body.app-body .submission-card,
body.app-body .mode-option,
body.app-body .assignment-checklist,
body.app-body .job-address-group,
body.app-body .job-details-edit,
body.app-body .edit-job-row,
body.app-body .driver-dropdown-toggle,
body.app-body .driver-dropdown-panel {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-primary);
}

body.app-body .editable-list li span,
body.app-body .driver-card .driver-name,
body.app-body .job-card .job-name,
body.app-body .job-summary-line,
body.app-body .submission-card h3,
body.app-body .sub-edit-row label,
body.app-body .edit-job-row .ej-journeys label {
  color: var(--text-primary);
}

body.app-body .sub-edit-modal-title {
  color: var(--accent, #44b669);
}

body.app-body .job-field label,
body.app-body .job-driver-label,
body.app-body .submission-card time,
body.app-body .job-summary-line.muted,
body.app-body .driver-dropdown-toggle .placeholder,
body.app-body .driver-dropdown-toggle i {
  color: var(--text-muted);
}

body.app-body .job-card-expand-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
}

body.app-body .job-card-expand-toggle:hover,
body.app-body .job-card-expand-toggle.is-active,
body.app-body .job-card-selected .job-card-expand-toggle {
  background: transparent;
  border: none;
  color: var(--accent, #44b669);
}

body.app-body .job-card-selected {
  background: var(--bg-elevated);
}

body.app-body #tab-drivers #driversList .driver-card-selected {
  background: var(--bg-elevated);
}

body.app-body #tab-drivers #driversList .driver-card-collapsed {
  background: var(--bg-surface);
  color: var(--text-primary);
}

body.app-body #tab-drivers #driversList .driver-card-collapsed .driver-name,
body.app-body #tab-drivers #driversList .driver-card-collapsed .job-card-open-trigger {
  color: var(--text-primary);
}

body.app-body .job-field input,
body.app-body .job-drag-handle,
body.app-body .sub-edit-row select,
body.app-body .sub-edit-row input,
body.app-body .edit-job-row .ej-name,
body.app-body .submissions-toolbar select,
body.app-body .submissions-toolbar input[type="month"],
body.app-body .submissions-toolbar input[type="date"],
body.app-body .submissions-toolbar input[type="search"],
body.app-body .jobs-toolbar select,
body.app-body .jobs-toolbar input[type="search"],
body.app-body .drivers-toolbar input[type="search"] {
  background: var(--bg-page);
  border-color: var(--border);
  color: var(--text-primary);
  font-size: 13px;
}

body.app-body .job-drag-handle:hover,
body.app-body .driver-dropdown-option:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

body.app-body .driver-dropdown-actions {
  border-bottom-color: var(--border);
}

body.app-body .driver-dropdown-actions .link-btn,
body.app-body .tab-panel h2 {
  color: var(--accent);
}

body.app-body .chip,
body.app-body .driver-summary-chip {
  background: var(--accent-soft);
  color: #86efac;
  border-color: var(--border);
}

body.app-body .chip-warn,
body.app-body .driver-summary-chip.chip-warn {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
}

body.app-body .chip-expired,
body.app-body .driver-summary-chip.chip-expired {
  background: var(--danger-bg);
  color: #fca5a5;
}

body.app-body .submission-card .job-line,
body.app-body #tab-submissions .submission-card .job-line {
  display: flex !important;
  align-items: flex-start;
  justify-content: space-between;
}

body.app-body .submission-card .job-line,
body.app-body .submission-card .job-line-title,
body.app-body .submission-card .job-line-title strong,
body.app-body .submission-card .job-sub,
body.app-body .submission-card .job-line-stats,
body.app-body #tab-submissions .submission-card .job-line,
body.app-body #tab-submissions .submission-card .job-line-title,
body.app-body #tab-submissions .submission-card .job-sub,
body.app-body #tab-submissions .submission-card .job-line-stats {
  color: var(--text-primary) !important;
}

body.app-body .submission-card .job-line-stats,
body.app-body #tab-submissions .submission-card .job-line-stats {
  text-align: right;
  color: inherit !important;
  font-weight: inherit;
}

body.app-body .submission-card .job-sub,
body.app-body .submission-card .job-line-address {
  display: block;
  margin-top: 4px;
  color: var(--text-primary) !important;
}

[data-theme="dark"] body.app-body .submission-card .job-line-title,
[data-theme="dark"] body.app-body .submission-card .job-line-title .job-line-name,
[data-theme="dark"] body.app-body .submission-card .job-sub.job-line-address,
[data-theme="dark"] body.app-body .submission-card .job-line-address,
[data-theme="dark"] body.app-body #tab-submissions .submission-card .job-sub.job-line-address,
[data-theme="dark"] body.app-body #tab-submissions .submission-card .job-line-address {
  color: #f5f5f5 !important;
}

body.app-body .submission-card .job-line-title strong {
  font-weight: inherit;
}

body.app-body .submission-card .job-line-title .journey-tag-trip {
  color: inherit !important;
}

body.app-body .submission-card .job-line-title .journey-tag-npu {
  color: inherit !important;
}

body.app-body .submission-card.editing {
  background: var(--bg-page);
  border-left-color: var(--border);
}

body.app-body .edit-job-row .remove-edit-job.icon-action-btn,
body.app-body .edit-job-row .remove-edit-job {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
}

body.app-body .assignment-check {
  border-bottom-color: var(--border);
}

body.app-body .driver-details-grid input,
body.app-body .driver-details-grid select {
  background: var(--bg-page);
  border-color: var(--border);
  color: var(--text-primary);
}

body.app-body .list-editor .add-row input {
  background: var(--bg-page);
  border-color: var(--border);
  color: var(--text-primary);
}

body.app-body .submissions-toolbar,
body.app-body #tab-submissions .submissions-toolbar,
body.app-body #tab-jobs .jobs-toolbar,
body.app-body #tab-drivers .drivers-toolbar {
  background: var(--bg-surface) !important;
  border-color: var(--border) !important;
}

body.app-body .submissions-toolbar .filter-group label {
  color: var(--text-muted);
}

body.app-body .submissions-toolbar .toolbar-export-actions {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  align-self: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

body.app-body #tab-submissions .submissions-toolbar #addSubmissionBtn.btn-dark.btn-sm {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  line-height: 1;
  box-sizing: border-box;
}

@media (max-width: 1023px) {
  body.app-body #tab-submissions .submissions-toolbar #addSubmissionBtn.btn-dark.btn-sm {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 0 8px !important;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

body.app-body .submissions-toolbar .filter-chips {
  margin-bottom: 0;
}

body.app-body .submissions-toolbar .toolbar-export-actions .submit-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  white-space: nowrap;
}

/* Light theme: dark text on light surfaces (override legacy white/green-only rules) */
[data-theme="light"] body.app-body,
[data-theme="light"] body.app-body .main-content,
[data-theme="light"] body.app-body .topbar,
[data-theme="light"] body.app-body .content-area {
  color: var(--text-primary);
}

[data-theme="light"] body.app-body .tab-panel h2,
[data-theme="light"] body.app-body .portal-title {
  color: var(--text-primary);
}

[data-theme="light"] .price-badge-highlight,
[data-theme="light"] .submission-card .price-badge-highlight {
  color: #15803d;
}

[data-theme="light"] .filter-badge {
  color: #15803d;
}

[data-theme="light"] body.app-body .chip,
[data-theme="light"] body.app-body .chip-ok,
[data-theme="light"] body.app-body .driver-profile-summary .chip,
[data-theme="light"] body.app-body .driver-profile-summary .chip-ok {
  color: #166534;
}

/* Driver: Assigned Jobs journey pills */
body.app-body .assigned-jobs-title {
  color: var(--text-primary);
}

body.app-body .assigned-job-card {
  background: var(--bg-page);
  border-color: var(--border);
}

body.app-body .assigned-job-card-submitted {
  background: rgba(68, 182, 105, 0.08);
  border-color: rgba(68, 182, 105, 0.28);
}

body.app-body .assigned-jobs-section-label {
  color: var(--text-muted);
}

body.app-body #datePills .date-pill {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

body.app-body #datePills .date-pill:hover,
body.app-body #datePills .date-pill.is-active,
body.app-body #datePills .date-pill:active,
body.app-body #datePills .date-pill:focus-visible {
  border-color: var(--accent, #44b669);
  background: var(--accent-soft, rgba(68, 182, 105, 0.15));
  color: var(--accent, #44b669);
}

body.app-body .route-stop-addr {
  color: var(--text-secondary);
}

body.app-body .assigned-job-submitted-tag {
  background: rgba(68, 182, 105, 0.15);
  color: #4ade80;
  border-color: rgba(68, 182, 105, 0.35);
}

body.app-body .assigned-job-leg-title-block {
  color: var(--text-secondary);
}

body.app-body .assigned-job-leg-block + .assigned-job-leg-block {
  border-top-color: var(--border-soft);
}

body.app-body .route-stop-label {
  color: var(--text-primary);
}

body.app-body .earnings-hero-amount.is-zero {
  color: var(--text-primary);
}

body.app-body .assigned-job-name {
  color: var(--text-primary);
}

body.app-body .assigned-job-times {
  color: var(--text-primary);
}

body.app-body .assigned-job-leg-label {
  color: var(--accent);
}

body.app-body .assigned-job-address {
  color: var(--text-secondary);
}

body.app-body .assigned-job-addr-key {
  color: var(--text-primary);
}

body.app-body .assigned-job-addr-time {
  color: #fff;
  font-weight: 600;
}

body.app-body .assigned-job-journeys .checkbox-option label {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

body.app-body .assigned-job-journeys .journey-pill-trip input:checked + label {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

body.app-body .assigned-job-journeys .journey-pill-npu input:checked + label {
  background: rgba(220, 38, 38, 0.12);
  border-color: #dc2626;
  color: #f87171;
  font-weight: 700;
}

body.app-body .checkbox-option.journey-locked label {
  opacity: 0.4;
  color: var(--text-muted);
}

body.app-body .driver-earnings-unified-pill {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

body.app-body .driver-earnings-unified-pill.is-revealed,
body.app-body .driver-earnings-unified-pill:hover {
  background: var(--bg-surface);
}

body.app-body .driver-earnings-pill-amount {
  color: inherit;
}

body.app-body .driver-earnings-unified-pill:not(.is-revealed) {
  color: var(--text-secondary);
}

/* Admin submissions: journey labels */
.journey-tag {
  font-weight: 600;
}

.journey-tag-trip {
  color: #25d366;
}

.journey-tag-npu {
  color: #dc2626;
}

body.app-body .journey-tag-trip {
  color: #25d366;
}

body.app-body .journey-tag-npu {
  color: #dc2626;
}

[data-theme="light"] .journey-tag-trip {
  color: #25d366;
}

[data-theme="light"] .journey-tag-npu {
  color: #dc2626;
}

/* Section headings act as page titles on the other tabs */
body.app-body #dashboard .section-head h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* ===== Orbitly-style shell: desktop refinements ===== */
@media (min-width: 1024px) {
  #dashboard .topbar-user-text { display: flex; }
  #dashboard .page-head .page-title { font-size: 19px; }
  body.app-body #dashboard .section-head h2 { font-size: 19px; }
  /* Title lives in the content header on desktop; keep the topbar slim */
  #dashboard .topbar .page-title { display: none; }
}

/* ===== Theme-toggle icon colours ===== */
/* Dark mode shows a sun → warm amber (pops against navy) */
[data-theme="dark"] .js-theme-toggle i {
  color: #ffd166;
  transition: color 0.2s;
}
/* Light mode shows a moon → deep navy */
[data-theme="light"] .js-theme-toggle i {
  color: #475569;
  transition: color 0.2s;
}

/* ===== Hide clear-filter buttons ===== */
#clearDriverFiltersBtn,
#clearJobFiltersBtn {
  display: none !important;
}

.submission-edited-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-left: 10px;
  border-radius: 50%;
  background: var(--accent);
  align-self: center;
}

/* Unified font stack — overrides styles.css universal Segoe UI on app pages */
body.app-body,
body.view-auth,
body.app-body *:not(.fas):not(.far):not(.fab):not(.fa),
body.view-auth *:not(.fas):not(.far):not(.fab):not(.fa) {
  font-family: var(--font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}
