/* ===================================================================
   THE ULTIMATE CHAUFFEUR — design tokens
   Deep midnight navy + brushed brass gold. Serif wordmark, sans UI.
   =================================================================== */
:root {
  --navy-950: #0a1628;
  --navy-900: #0F1F3D;
  --navy-800: #17294d;
  --navy-700: #223a63;
  --navy-600: #33507f;
  --gold-500: #C9A961;
  --gold-400: #D9BE84;
  --gold-600: #A88940;
  --ivory-050: #F5F2EA;
  --ivory-100: #EFEADC;
  --ink-900: #14181f;
  --ink-600: #4a5262;
  --ink-400: #8891a3;
  --line: rgba(201, 169, 97, 0.22);
  --danger: #C4544A;
  --success: #4E8B6E;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --shadow-panel: 0 24px 60px -20px rgba(10, 22, 40, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--ivory-050);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

button { font-family: inherit; cursor: pointer; }

::selection { background: var(--gold-400); color: var(--navy-900); }

:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

/* ---------- Auth screen layout ---------- */
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
}

/* Only top padding lives on the panel itself - the photo needs to bleed
   flush to the left/right/bottom edges, so every other child (logo,
   headline, footer) carries its own horizontal padding instead. */
.auth-brand-panel {
  background: radial-gradient(circle at 20% 15%, var(--navy-800) 0%, var(--navy-900) 45%, var(--navy-950) 100%);
  color: var(--ivory-050);
  display: flex;
  flex-direction: column;
  padding-top: 40px;
  position: relative;
  overflow: hidden;
  overflow-y: auto;
}

.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(201,169,97,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.6;
  pointer-events: none;
}

/* Approved hero photo (chauffeur + car + city skyline), cropped to just
   that ground scene - no headline/footer text baked in, real HTML renders
   those on top instead. A fixed-size flex item (flex:0 0 <height>, so it
   never grows/shrinks) with no insets of its own, so it bleeds flush to
   the panel's left/right/bottom edges - full width, touching the bottom. */
.brand-scene-photo {
  position: relative;
  flex: 0 0 520px;
  width: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-image: url('/static/marketing/remaops-login-hero-ground-v3.png');
  background-size: cover;
  background-position: center top;
}
/* Darkens the image's own lower edge a touch further so the footer text
   sitting on top of it stays legible regardless of what's behind it there. */
.brand-scene-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, rgba(6, 14, 28, 0.75) 100%);
}

/* Absorbs all the leftover vertical space between the logo and the
   (fixed-height) photo, centering the headline within it - the actual
   empty part of the background, not on top of the image. */
.brand-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 56px;
  position: relative;
  z-index: 1;
}
.brand-mark { display: flex; align-items: center; gap: 14px; padding: 0 56px; position: relative; z-index: 1; }
.brand-mark img { width: 46px; height: 46px; flex-shrink: 0; }
/* The approved RemaOps mark isn't square (700x575) - fix the height and let
   width follow its own aspect ratio instead of the generic square icon rule
   above, so it doesn't get squashed. */
.brand-mark img.brand-mark-logo { width: auto; height: 46px; }
.brand-mark-text { display: flex; flex-direction: column; gap: 2px; }
.brand-mark-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.02em;
}
.brand-mark-sub {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold-400);
  text-transform: uppercase;
}

.brand-hero {
  position: relative;
  z-index: 1;
  max-width: 520px;
  text-align: center;
}
.brand-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.15;
  margin-bottom: 16px;
}
.brand-hero p {
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(245, 242, 234, 0.72);
}
.hl-gold { color: var(--gold-400); }

/* Overlaid on the photo's own bottom edge (absolutely positioned within
   it, not a flow sibling), so the photo can be a plain fixed-height block
   that always reaches the panel's true edges regardless of footer height. */
.brand-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 0 56px 26px;
}
.brand-copyright {
  font-size: 12px;
  color: rgba(245, 242, 234, 0.45);
  letter-spacing: 0.03em;
}

/* ---------- Form panel ---------- */
.auth-form-panel {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.auth-form-wrap { width: 100%; max-width: 360px; }

.auth-tab {
  border: none;
  background: transparent;
  font-family: inherit;
}

/* New-vs-returning switch row ("New to RemaOps? Create Account" /
   "Already have an account? Log In") - visually distinct from the primary
   Log In button so Create Account stays discoverable without competing
   with it (spec section 11). */
.auth-switch {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 26px;
  font-size: 12.5px;
  color: var(--ink-600);
}
.auth-switch-btn.auth-switch-btn {
  padding: 7px 16px;
  border: 1.5px solid var(--navy-900);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--navy-900);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-switch-btn.auth-switch-btn:hover {
  background: var(--navy-900);
  color: var(--ivory-050);
}

.auth-form-wrap h2 {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--navy-900);
  margin-bottom: 6px;
}
.auth-form-wrap .subtitle {
  font-size: 13.5px;
  color: var(--ink-600);
  margin-bottom: 28px;
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-600);
  margin-bottom: 7px;
  text-transform: uppercase;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid #E3DFD3;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.field input:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.15);
  outline: none;
}
.field .hint { font-size: 11.5px; color: var(--ink-400); margin-top: 5px; }

.password-field-wrap { position: relative; }
.password-field-wrap input { padding-right: 44px; }
.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: none;
  background: none;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-500, var(--ink-600));
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}
.password-toggle-btn:hover { color: var(--navy-900); }
.password-toggle-btn .eye-icon { width: 19px; height: 19px; }

/* Icon inside email/password inputs (envelope, lock) */
.icon-field-wrap { position: relative; }
.icon-field-wrap .field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-400);
  pointer-events: none;
}
.icon-field-wrap input { padding-left: 42px; }

/* "Keep me signed in" + "Forgot password?" row */
.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -6px 0 18px;
  flex-wrap: wrap;
}
.login-options-row .link-btn { display: inline; }
.keep-signed-in-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-600);
  cursor: pointer;
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
}
.keep-signed-in-label input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--navy-900); }

/* Log In button with trailing arrow */
.btn-with-icon { display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-with-icon svg { width: 17px; height: 17px; transition: transform 0.15s ease; }
.btn-with-icon:hover svg { transform: translateX(3px); }

/* OR divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--ink-400);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #E3DFD3;
}

/* Continue with Google */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 0;
  background: #fff;
  border: 1.5px solid #E3DFD3;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-google:hover { border-color: var(--navy-700); background: var(--ivory-050); }
.btn-google svg { width: 18px; height: 18px; }

/* Security reassurance note */
.security-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--ivory-050);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-600);
}
.security-note svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--gold-600); margin-top: 1px; }

/* Footer legal links */
.auth-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  font-size: 12px;
}
.footer-link-btn {
  background: none; border: none; padding: 0; color: var(--ink-500, var(--ink-600));
  text-transform: none; font-weight: 400; letter-spacing: normal; text-decoration: none;
}
.footer-link-btn:hover { color: var(--navy-900); text-decoration: underline; }
.footer-link-sep { color: var(--ink-400); font-size: 11px; }

.btn-primary {
  width: 100%;
  padding: 13px 0;
  background: var(--navy-900);
  color: var(--ivory-050);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 8px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover { background: var(--navy-800); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.form-error {
  background: rgba(196, 84, 74, 0.08);
  border: 1px solid rgba(196, 84, 74, 0.25);
  color: var(--danger);
  font-size: 13px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  display: none;
}
.form-error.visible { display: block; }

.form-success {
  background: rgba(78, 139, 110, 0.08);
  border: 1px solid rgba(78, 139, 110, 0.25);
  color: var(--success);
  font-size: 13px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--navy-700); font-size: 13px; text-decoration: underline;
  text-transform: none; letter-spacing: normal; font-weight: 400; display: block;
}
.link-btn:hover { color: var(--navy-900); }

.terms-checkbox-field { margin-bottom: 8px; }
.terms-checkbox-label {
  display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--ink-600);
  cursor: pointer; text-transform: none; font-weight: 400; letter-spacing: normal;
}
.terms-checkbox-label input[type="checkbox"] { width: 16px; height: 16px; margin-top: 1px; flex-shrink: 0; }
.terms-link {
  background: none; border: none; padding: 0; color: var(--gold-600); font-weight: 600;
  text-decoration: underline; cursor: pointer; font-size: inherit; font-family: inherit;
}
.terms-link:hover { color: var(--navy-900); }

.terms-scroll-body { max-height: 420px; overflow-y: auto; padding-right: 8px; font-size: 13px; color: var(--ink-900); line-height: 1.6; }
.terms-scroll-body h3 { font-family: var(--font-display); font-size: 14.5px; color: var(--navy-900); margin: 16px 0 6px; }
.terms-scroll-body h3:first-child { margin-top: 0; }
.terms-scroll-body p { margin-bottom: 4px; }
.terms-updated { color: var(--ink-400); font-size: 11.5px; margin-bottom: 14px; }

/* ---------- Auth screen responsive overrides ----------
   Must come AFTER every base auth-screen/brand/form rule above (equal
   specificity throughout - source order decides which wins). An earlier
   position here was silently overridden by those base rules despite its
   media query correctly matching - a real bug caught during this page's
   visual QA before landing on "put every override after all the rules it
   overrides." */
@media (max-width: 860px) {
  /* Mobile: stacked single column. brand-mark, brand-main and the footer
     are already in the right DOM order, so no flex `order` hacks are
     needed here - just tighter spacing. */
  .auth-screen { grid-template-columns: 1fr; }
  .auth-brand-panel {
    min-height: 0;
    padding-top: 24px;
    overflow-y: visible;
  }
  .brand-mark { padding: 0 24px; }
  /* A guaranteed minimum gap under the logo: flex-centering alone can push
     the (now larger) headline right up against it on short mobile heights. */
  .brand-main { padding: 0 24px; margin-top: 14px; }
  .brand-hero h1 { font-size: clamp(24px, 7vw, 32px); }
  .brand-scene-photo { flex-basis: 220px; }
  .brand-footer { padding: 0 24px 20px; }
  .brand-hero { max-width: none; }

  /* A few extra px saved here closes the gap at the narrowest required
     width (360px), where the headline's own line-wrapping otherwise pushes
     "Forgot password?" just below the fold. */
  .auth-form-panel { padding: 28px 24px; }
  .auth-switch { margin-bottom: 18px; }
  .auth-form-wrap .subtitle { margin-bottom: 20px; }
}

/* Narrowest required phones (390/360px): the login form itself grew a full
   Google button + security note + footer taller than the reference this
   pass, which the 860px tier's tightening alone doesn't fully offset at this
   width - trims further so the Log In button (the actual required action)
   stays on-screen without scrolling, not just visible after one. */
@media (max-width: 400px) {
  .field { margin-bottom: 14px; }
  .login-options-row { margin: -6px 0 14px; }
  .auth-divider { margin: 14px 0; }
  .security-note { margin-top: 14px; }
  .auth-footer-links { margin-top: 18px; }
  .auth-form-wrap h2 { margin-bottom: 3px; }
  .auth-form-wrap .subtitle { margin-bottom: 16px; }
}

/* ---------- Dashboard shell ---------- */
.app-shell { min-height: 100vh; display: flex; }
.app-sidebar {
  width: 240px;
  background: var(--navy-900);
  color: var(--ivory-050);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex-shrink: 0;
}
.sidebar-menu-toggle {
  display: none; background: none; border: 1.5px solid rgba(255,255,255,0.35); color: var(--ivory-050);
  border-radius: var(--radius-sm); padding: 6px 12px; font-size: 18px; line-height: 1; cursor: pointer;
}
@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .app-sidebar {
    width: 100%; flex-direction: row; align-items: center; justify-content: space-between; padding: 14px 18px;
    flex-wrap: nowrap; position: relative;
  }
  .sidebar-menu-toggle { display: block; }
  /* Collapsed by default on narrow screens - only the brand row and the
     toggle button show. Everything else (search, the full nav list, the
     user chip, security/logout) was previously left to `flex-direction:row`
     alone, which just wrapped ~30 nav links down the whole screen with no
     way to collapse them - there was no toggle at all before this fix. */
  .app-sidebar .sidebar-search-wrap,
  .app-sidebar .sidebar-nav,
  .app-sidebar .user-chip,
  .app-sidebar > .logout-link {
    display: none;
  }
  .app-sidebar.sidebar-open {
    flex-direction: column; align-items: stretch; position: fixed; inset: 0; z-index: 200;
    overflow-y: auto; height: 100vh; padding-bottom: 24px;
  }
  .app-sidebar.sidebar-open .sidebar-search-wrap { display: block; }
  .app-sidebar.sidebar-open .sidebar-nav { display: flex; flex-direction: column; }
  .app-sidebar.sidebar-open .user-chip { display: flex; }
  .app-sidebar.sidebar-open > .logout-link { display: block; }
}
.app-sidebar .brand-mark img { width: 32px; height: 32px; }
.app-sidebar .brand-mark-name { font-size: 15px; }

.app-main { flex: 1; min-width: 0; padding: 40px 44px; background: var(--ivory-050); }
.app-main h1 { font-family: var(--font-display); font-size: 28px; color: var(--navy-900); margin-bottom: 6px; }
.app-main .welcome-sub { color: var(--ink-600); font-size: 14px; margin-bottom: 32px; }

.card {
  background: #fff;
  border: 1px solid #ECE7D9;
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-panel);
}

/* Many table-rendering call sites already add overflow-x:auto inline on the
   .card wrapping a .data-table; this catches the ones that don't, so a wide
   table always scrolls within its own card instead of breaking page width. */
.card:has(table.data-table) { overflow-x: auto; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  background: rgba(245,242,234,0.06);
  font-size: 13px;
}
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold-500); color: var(--navy-900);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.logout-link {
  font-size: 12px; color: rgba(245,242,234,0.55);
  text-decoration: underline; text-underline-offset: 2px;
  background: none; border: none; padding: 0; margin-top: auto;
}
.logout-link:hover { color: var(--gold-400); }

.sidebar-search-wrap { position: relative; }
.sidebar-search-input {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid rgba(245,242,234,0.18);
  background: rgba(245,242,234,0.08); color: var(--ivory-050); font-size: 13px; font-family: var(--font-body);
}
.sidebar-search-input::placeholder { color: rgba(245,242,234,0.45); }
.sidebar-search-input:focus { outline: none; border-color: var(--gold-500); background: rgba(245,242,234,0.12); }
.sidebar-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: #fff; border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  max-height: 420px; overflow-y: auto; padding: 6px 0;
}
.sidebar-search-group-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--ink-400); padding: 8px 14px 4px;
}
.sidebar-search-result {
  display: block; width: 100%; text-align: left; padding: 8px 14px; background: none; border: none;
  cursor: pointer; font-size: 13px; color: var(--ink-900);
}
.sidebar-search-result:hover { background: rgba(201,169,97,0.12); }
.sidebar-search-result .sr-subtitle { color: var(--ink-400); font-size: 11.5px; margin-left: 6px; }
.sidebar-search-empty { padding: 10px 14px; font-size: 12.5px; color: var(--ink-400); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: block; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: rgba(245,242,234,0.7); text-decoration: none;
}
.sidebar-nav a.nav-disabled { opacity: 0.35; cursor: not-allowed; }
.sidebar-nav a.active, .sidebar-nav a:hover { background: rgba(201,169,97,0.14); color: var(--gold-400); }
.nav-badge {
  display: inline-block; min-width: 17px; padding: 1px 5px; margin-left: 4px;
  border-radius: 999px; background: var(--gold-500); color: var(--navy-900);
  font-size: 10.5px; font-weight: 700; text-align: center; line-height: 1.4;
}

/* ---------- View switching ---------- */
.view-panel { max-width: 1000px; }
/* Trip Management's table (Quote#, date, route, driver, vehicle, flags, status, closeout)
   genuinely needs more room than the 1000px reading-width cap every other view uses -
   that cap was the real reason the table forced a horizontal scrollbar even after
   trimming its columns down (removing the redundant Pickup column, making Flags
   icon-only). Widening just this one view, rather than raising the shared cap, keeps
   every text-heavy page (forms, dashboards) at its comfortable reading width. */
#view-trip-management.view-panel { max-width: 1500px; }
/* Mobile/responsive pass (2026-10-01): no flex-wrap meant any page whose
   right-side controls add up to more than ~half the row (e.g. a select PLUS
   a button, not just one button) squeezed into a narrow column at phone
   width, crowding the heading next to it instead of dropping to its own line
   - found live on Important Dates at 375px. Shared by every view's own
   header row, so this is a repo-wide fix, not a one-page patch. Unaffected
   at any width where everything already fits on one line.
*/
.view-header-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.view-header-row h1 { margin-bottom: 0; }

.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 780px) { .dash-grid { grid-template-columns: 1fr; } }
/* Two .dash-grid uses in index.html (the Reports builder's 260px sidebar + results,
   and a 1fr 1fr pair) set grid-template-columns inline, which beats the plain
   rule above - at 375px the Reports results column was ~7px wide. */
@media (max-width: 780px) { .dash-grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; } }

.alert-center-card { margin-top: 20px; }
.alert-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 4px;
  border-bottom: 1px solid #F2EEE2; font-size: 13px; cursor: default;
}
.alert-row:last-child { border-bottom: none; }
.alert-row[data-alert-view] { cursor: pointer; }
.alert-row[data-alert-view]:hover { background: var(--ivory-050); }
.alert-sev-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.alert-row-critical .alert-sev-dot { background: var(--danger); }
.alert-row-high .alert-sev-dot { background: #C97A2B; }
.alert-row-medium .alert-sev-dot { background: var(--gold-500, #C9A961); }
.alert-row-low .alert-sev-dot, .alert-row-info .alert-sev-dot { background: var(--ink-300); }
.alert-source {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--ink-400); flex-shrink: 0; width: 78px;
}
.alert-msg { flex: 1; color: var(--ink-900); }
.alert-sev-label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; color: var(--ink-400); flex-shrink: 0;
}

.stats-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 24px 0 28px;
}
@media (max-width: 1100px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: #fff; border: 1px solid #ECE7D9; border-radius: var(--radius-lg);
  padding: 20px 18px; position: relative; overflow: hidden;
}
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--navy-800);
}
.stat-card-gold::before { background: var(--gold-500); }
.stat-value {
  font-family: var(--font-display); font-size: 30px; font-weight: 600; color: var(--navy-900); line-height: 1.1;
  overflow-wrap: break-word;
}
.stat-card-gold .stat-value { color: var(--gold-600); }
.stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-400);
  margin-top: 6px; font-weight: 600;
}

/* ---------- Pricing Calculator - rate card grid ---------- */
.ratecards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 20px; }
.ratecard {
  background: #fff; border: 1px solid #ECE7D9; border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow-panel);
}
.ratecard-title {
  font-family: var(--font-display); font-size: 17px; color: var(--navy-900); font-weight: 600; margin-bottom: 16px;
}
.ratecard-primary-rates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.ratecard-price-box {
  background: var(--ivory-050); border-radius: var(--radius-md); padding: 12px 14px;
}
.ratecard-price-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-400); font-weight: 600; margin-bottom: 6px; }
.ratecard-price-input-wrap { display: flex; align-items: baseline; gap: 2px; }
.ratecard-price-input-wrap .currency-prefix { font-family: var(--font-display); font-size: 20px; color: var(--gold-600); font-weight: 600; }
.ratecard-price-input-wrap input {
  border: none; background: none; font-family: var(--font-display); font-size: 22px;
  color: var(--navy-900); font-weight: 600; width: 100%; padding: 0;
}
.ratecard-price-input-wrap input:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; border-radius: 3px; }
.ratecard-price-input-wrap .price-suffix { font-size: 11px; color: var(--ink-400); }

.ratecard-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; border-top: 1px solid #F2EEE2; padding-top: 14px; }
.ratecard-detail-field { display: flex; justify-content: space-between; align-items: center; }
.ratecard-detail-label { font-size: 12px; color: var(--ink-600); }
.ratecard-detail-field input {
  width: 56px; padding: 4px 6px; border: 1.5px solid #E3DFD3; border-radius: 4px;
  font-size: 12.5px; text-align: right; font-family: var(--font-body);
}

.search-box-wrap { margin: 18px 0 16px; }
.search-box {
  width: 100%; max-width: 420px; padding: 10px 14px; border: 1.5px solid #E3DFD3;
  border-radius: var(--radius-md); font-size: 14px; font-family: var(--font-body);
  background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%238891a3" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>') no-repeat 12px center;
  background-size: 15px; padding-left: 36px;
}
.search-box:focus { border-color: var(--gold-500); outline: none; box-shadow: 0 0 0 3px rgba(201,169,97,0.15); }

.card-title { font-weight: 700; font-size: 14.5px; color: var(--navy-900); margin-bottom: 4px; }
.card-sub { font-weight: 400; font-size: 12px; color: var(--ink-400); margin-left: 8px; }

.empty-hint { color: var(--ink-400); font-size: 13.5px; padding: 18px 4px; text-align: center; }

.back-link {
  background: none; border: none; color: var(--ink-600); font-size: 13px;
  margin-bottom: 18px; padding: 0; text-decoration: underline; text-underline-offset: 2px;
}
.back-link:hover { color: var(--navy-900); }

/* ---------- Data table ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-400); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid #ECE7D9;
}
.data-table td { padding: 13px 16px; border-bottom: 1px solid #F2EEE2; color: var(--ink-900); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr.clickable-row { cursor: pointer; transition: background 0.1s ease; }
.data-table tbody tr.clickable-row:hover { background: var(--ivory-050); }

/* Trip Management's table mixes free-flowing text (dates, addresses) with fixed-width
   controls (assignment dropdowns). Without a floor on the text columns, the browser's
   table layout squeezes them down to near-nothing to make room for the dropdowns,
   wrapping a date or address across several cramped lines. Columns: 1 Quote#, 2 Service
   Date, 3 Route, 4 Driver, 5 Vehicle, 6 Flags, 7 Trip Status, 8 Closeout, 9 Incident.
   The standalone Pickup column that used to sit at position 3 was removed - it only
   ever repeated the same address already shown at the start of Route, and cutting it
   was the biggest single win toward fitting the whole table without a horizontal
   scrollbar. Flags also switched from full-text badges to icon-only ones (see
   tripFlagBadgesCompactHtml in app.js) for the same reason - see .trip-flags-compact
   below for its width. */
#trip-table td:nth-child(2) { white-space: nowrap; min-width: 130px; }
#trip-table td:nth-child(3) { min-width: 190px; }

.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.status-New-Quote, .status-Quote-Sent { background: #DDEBFA; color: #2A5C8A; }
.status-Follow-Up, .status-Negotiating { background: #F0E2C8; color: #8A6423; }
.status-Won { background: #D9EFDE; color: #2E7D46; }
.status-Lost, .status-Cancelled, .status-No-Show, .status-Expired { background: #F5D9D6; color: #A13B30; }
.status-Partially-Won { background: #E4EEDD; color: #4F7942; }
.status-Mixed { background: #E9E4D8; color: var(--ink-600); }
.status-New-Quote-Request { background: #A13B30; color: #fff; animation: pulse-urgent 2s ease-in-out infinite; }

/* Phase 6.42: subtle realtime connection indicator - Dispatch/Alert Center only, per
   spec ("do not clutter every page"). Deliberately quiet for CONNECTED (a small dot,
   no text) and only becomes a visible, worded pill when there's actually something
   the user should know (reconnecting, or degraded to polling fallback). */
.realtime-status-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px;
  border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
  vertical-align: middle; margin-left: 8px;
}
.realtime-status-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.realtime-status-badge.rt-connected { background: #D9EFDE; color: #2E7D46; }
.realtime-status-badge.rt-connected::before { background: #2E7D46; }
.realtime-status-badge.rt-connecting, .realtime-status-badge.rt-reconnecting { background: #F0E2C8; color: #8A6423; }
.realtime-status-badge.rt-connecting::before, .realtime-status-badge.rt-reconnecting::before {
  background: #8A6423; animation: pulse-urgent 1.4s ease-in-out infinite;
}
.realtime-status-badge.rt-fallback, .realtime-status-badge.rt-disconnected { background: #F5D9D6; color: #A13B30; }
.realtime-status-badge.rt-fallback::before, .realtime-status-badge.rt-disconnected::before { background: #A13B30; }

/* Phase 6.22: professional toast for a newly-created CRITICAL alert - never browser
   alert(), never repeats for a redelivered event_id (RealtimeClient already dedupes
   before this is ever called). */
#realtime-toast-stack {
  position: fixed; bottom: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.realtime-toast {
  background: var(--navy-900); color: #fff; border-radius: var(--radius-md);
  padding: 14px 16px; box-shadow: var(--shadow-panel); cursor: pointer;
  border-left: 4px solid #A13B30; animation: toast-in 0.25s ease-out;
}
.realtime-toast-title { font-weight: 700; font-size: 12.5px; letter-spacing: 0.02em; margin-bottom: 4px; color: #F5D9D6; }
.realtime-toast-body { font-size: 13px; line-height: 1.4; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Employment status (HR roster / employee profile) - its own namespace, doesn't
   overlap with quote status labels above. */
.status-Active { background: #D9EFDE; color: #2E7D46; }
.status-Onboarding { background: #DDEBFA; color: #2A5C8A; }
.status-Probationary { background: #F0E2C8; color: #8A6423; }
.status-Leave { background: #E9E4D8; color: var(--ink-600); }
.status-Separated { background: #F5D9D6; color: #A13B30; }
.status-Inactive { background: #E9E4D8; color: var(--ink-600); }

/* Trip status colors - separate palette/namespace from quote status (tripstat- prefix),
   since "Garage"/"Delayed"/etc. don't overlap with "Won"/"Lost"/etc. Applied directly to
   the trip-status <select> itself (not just a read-only pill) so it's colored wherever
   it's editable - Quote Detail's per-service row and Trip Management alike. Compound
   selector (element + 2 classes) so this reliably outranks .trip-status-mini-select's
   own background rule regardless of stylesheet order. */
select.trip-status-mini-select.tripstat-Garage { background: #EDEAE0; color: var(--ink-600); }
select.trip-status-mini-select.tripstat-On-The-Way,
select.trip-status-mini-select.tripstat-On-Location,
select.trip-status-mini-select.tripstat-Passenger-On-Board,
select.trip-status-mini-select.tripstat-Circling { background: #DDEBFA; color: #2A5C8A; }
select.trip-status-mini-select.tripstat-Delayed { background: #F0E2C8; color: #8A6423; }
select.trip-status-mini-select.tripstat-Done { background: #D9EFDE; color: #2E7D46; }
select.trip-status-mini-select.tripstat-No-Show { background: #F5D9D6; color: #A13B30; }

/* Same compound-selector treatment for the per-service QUOTE status dropdown, reusing
   the existing .status-* color values above rather than redefining them. */
select.trip-status-mini-select.status-New-Quote, select.trip-status-mini-select.status-Quote-Sent { background: #DDEBFA; color: #2A5C8A; }
select.trip-status-mini-select.status-Follow-Up, select.trip-status-mini-select.status-Negotiating { background: #F0E2C8; color: #8A6423; }
select.trip-status-mini-select.status-Won { background: #D9EFDE; color: #2E7D46; }
select.trip-status-mini-select.status-Lost, select.trip-status-mini-select.status-Cancelled,
select.trip-status-mini-select.status-No-Show, select.trip-status-mini-select.status-Expired { background: #F5D9D6; color: #A13B30; }
select.trip-status-mini-select.status-New-Quote-Request { background: #A13B30; color: #fff; }
@keyframes pulse-urgent { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.new-quote-request-banner {
  background: rgba(161,59,48,0.1); border: 1px solid rgba(161,59,48,0.35); border-radius: var(--radius-md);
  padding: 12px 16px; color: #A13B30; font-size: 13px; font-weight: 600; margin-bottom: 16px;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,22,40,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-panel {
  background: #fff; border-radius: var(--radius-lg); padding: 28px 30px;
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 30px 80px -20px rgba(10,22,40,0.5);
}
/* Wide variant for content with its own two-column layout (fin-two-col) that would
   cramp inside the default 560px modal width - e.g. the Employee HR profile modal. */
.modal-panel-wide { max-width: 900px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-header h2 { font-family: var(--font-display); font-size: 21px; color: var(--navy-900); }
.modal-close { background: none; border: none; font-size: 24px; line-height: 1; color: var(--ink-400); padding: 0; }
.modal-close:hover { color: var(--ink-900); }
.modal-sub { color: var(--ink-600); font-size: 12.5px; line-height: 1.5; margin: -10px 0 16px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.field-row .field select {
  width: 100%; padding: 11px 13px; border: 1.5px solid #E3DFD3; border-radius: var(--radius-sm);
  font-size: 14.5px; font-family: var(--font-body); color: var(--ink-900); background: #fff;
}
.field-divider { border: none; border-top: 1px solid #ECE7D9; margin: 6px 0 18px; }

/* ---------- Quote detail ---------- */
.quote-detail-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.quote-detail-header h1 { margin-bottom: 0; }
.quote-meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.quote-meta-item .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-400); margin-bottom: 3px; }
.quote-meta-item .value { font-size: 14px; color: var(--ink-900); font-weight: 500; }
.quote-meta-item select {
  padding: 7px 10px; border: 1.5px solid #E3DFD3; border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: var(--font-body); background: #fff;
}

.service-node { border: 1px solid #ECE7D9; border-radius: var(--radius-md); margin-bottom: 10px; overflow: hidden; }
.service-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: #fff; gap: 12px; flex-wrap: wrap;
}
.service-id { font-family: var(--font-body); font-weight: 700; color: var(--navy-900); font-size: 13px; margin-right: 10px; }
.service-summary { font-size: 13.5px; color: var(--ink-600); }
.service-amount { font-weight: 700; color: var(--navy-900); }
.trip-status-mini-select {
  padding: 5px 9px; border: 1.5px solid #E3DFD3; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; font-family: var(--font-body); background: var(--ivory-050);
  color: var(--navy-900); cursor: pointer;
}
.affiliate-badge {
  padding: 5px 10px; border: 1.5px dashed #E3DFD3; border-radius: 999px;
  font-size: 11px; font-weight: 600; font-family: var(--font-body); background: none;
  color: var(--ink-400); cursor: pointer;
}
.affiliate-badge-linked { border-style: solid; border-color: var(--gold-500); color: var(--gold-600); background: rgba(201,169,97,0.08); }
.edit-service-btn {
  background: none; border: 1.5px solid #E3DFD3; border-radius: 999px; padding: 5px 12px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-600); cursor: pointer;
}
.edit-service-btn:hover { border-color: var(--navy-900); color: var(--navy-900); }

.acceptance-status-pill {
  font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 999px;
}
.acceptance-status-pill.accepted { background: rgba(90,140,90,0.12); color: #3F6B3F; }
.acceptance-status-pill.pending { background: rgba(201,169,97,0.14); color: var(--gold-600); }

/* ---------- Trip flags (luggage, special request, car seat, pet, stops) ---------- */
.trip-flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.trip-flag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--ivory-100); color: var(--ink-600); border: 1px solid #ECE7D9;
}
.trip-flag.trip-flag-alert { background: rgba(201,169,97,0.14); color: var(--gold-600); border-color: var(--gold-500); }
.trip-notes-section .trip-flag-note { font-size: 12.5px; color: var(--ink-600); margin: 4px 0; }

/* Icon-only flags for the Trip Management list table - see tripFlagBadgesCompactHtml.
   Full text lives in each icon's title tooltip instead of on the row, since printing it
   inline is what forced the table to scroll horizontally. */
.trip-flags-compact { display: flex; flex-wrap: wrap; gap: 5px; }
.trip-flag-icon {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 3px 6px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--ivory-100); color: var(--ink-600); border: 1px solid #ECE7D9;
  cursor: default;
}
.trip-flag-icon.trip-flag-alert { background: rgba(201,169,97,0.14); color: var(--gold-600); border-color: var(--gold-500); }
.route-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 1.5px solid #E3DFD3; border-radius: 999px; padding: 5px 12px;
  font-size: 11.5px; font-weight: 600; color: var(--navy-900); cursor: pointer; text-decoration: none;
}
.route-btn:hover { border-color: var(--gold-500); color: var(--gold-600); }
.stop-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.stop-row input { flex: 1; }
.stop-row .remove-stop-btn {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #E3DFD3;
  background: #fff; color: var(--ink-600); cursor: pointer; font-size: 14px; line-height: 1;
}
.stop-row .remove-stop-btn:hover { border-color: var(--danger); color: var(--danger); }
.location-link { color: inherit; text-decoration: underline; text-decoration-color: #D8D2C0; text-underline-offset: 2px; }
.location-link:hover { color: var(--gold-600); text-decoration-color: var(--gold-500); }

/* ---------- Driver photo ---------- */
.driver-photo-thumb {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover; vertical-align: middle;
  margin-right: 6px; border: 1px solid #ECE7D9;
}
.driver-photo-large {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 2px solid #ECE7D9;
  display: block; margin-bottom: 12px;
}
.driver-photo-placeholder {
  width: 96px; height: 96px; border-radius: 50%; background: var(--ivory-100); border: 2px dashed #E3DFD3;
  display: flex; align-items: center; justify-content: center; color: var(--ink-400); font-size: 11px;
  margin-bottom: 12px; text-align: center;
}

/* ---------- Help & Guide ---------- */
.help-layout { display: grid; grid-template-columns: 220px 1fr; gap: 36px; margin-top: 20px; align-items: start; }
@media (max-width: 900px) { .help-layout { grid-template-columns: 1fr; } }
.help-subnav {
  position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px;
  border-left: 2px solid #ECE7D9; padding-left: 14px;
}
.help-subnav a {
  font-size: 12.5px; color: var(--ink-600); text-decoration: none; padding: 6px 0; line-height: 1.4;
}
.help-subnav a:hover { color: var(--gold-600); }
.help-subnav-cat {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-400); margin: 14px 0 2px;
}
.help-subnav-cat:first-child { margin-top: 0; }
.help-search-result {
  padding: 12px 16px; border: 1px solid #ECE7D9; border-radius: var(--radius-md); margin-bottom: 8px;
  cursor: pointer; background: #fff;
}
.help-search-result:hover { border-color: var(--gold-500); }
.help-search-result .card-title { margin-bottom: 3px; }

.help-content { max-width: 640px; }
.help-section { margin-bottom: 40px; scroll-margin-top: 20px; }
.help-section h2 {
  font-family: var(--font-display); font-size: 20px; color: var(--navy-900);
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--gold-500);
}
.help-section p { font-size: 14px; line-height: 1.7; color: var(--ink-900); margin-bottom: 12px; }
.help-section strong { color: var(--navy-900); }
.help-section code {
  background: var(--ivory-100); color: var(--gold-600); padding: 1px 6px; border-radius: 4px;
  font-size: 12.5px; font-family: 'Courier New', monospace;
}
.help-steps, .help-bullets { padding-left: 22px; margin-bottom: 12px; }
.help-steps li, .help-bullets li { font-size: 14px; line-height: 1.7; color: var(--ink-900); margin-bottom: 10px; }
.help-example {
  background: var(--ivory-050); border-left: 3px solid var(--gold-500); border-radius: var(--radius-sm);
  padding: 14px 18px; font-size: 13.5px; line-height: 1.7; color: var(--ink-900); margin-top: 14px;
}
.help-example-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gold-600);
  font-weight: 700; margin-bottom: 6px;
}
.service-children { padding: 4px 18px 14px 34px; background: var(--ivory-050); border-top: 1px dashed #E3DFD3; }
.service-children .service-node { background: #fff; }

/* Whole-row status tint - a service that's Won or Lost/Cancelled/No Show/Expired should
   read as such at a glance, not just via the small status dropdown's own color. */
.service-node.service-node-won { border-color: #B7DFC0; }
.service-node.service-node-won .service-row { background: #EFF8F1; }
.service-node.service-node-lost { border-color: #E8BEB8; }
.service-node.service-node-lost .service-row { background: #FBF0EF; }
.add-sub-btn {
  background: none; border: 1.5px dashed var(--gold-500); color: var(--gold-600);
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: var(--radius-sm); margin-top: 6px;
}
.add-sub-btn:hover { background: rgba(201,169,97,0.08); }

.quote-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; background: var(--navy-900); color: var(--ivory-050);
  border-radius: var(--radius-md); margin-top: 16px; font-size: 15px;
}
.quote-total-row strong { font-family: var(--font-display); font-size: 20px; color: var(--gold-400); }

/* ---------- Driver shell (offline-capable, mobile-first) ---------- */
#driver-shell { min-height: 100vh; background: var(--ivory-050); }
.driver-topbar {
  background: var(--navy-900); color: var(--ivory-050);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  gap: 10px;
}
.driver-topbar .brand-mark img { width: 30px; height: 30px; }
.driver-main { padding: 16px; padding-bottom: 84px; max-width: 560px; margin: 0 auto; }

.driver-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex;
  background: #fff; border-top: 1px solid #ECE7D9; box-shadow: 0 -2px 10px rgba(15,31,61,0.06);
  z-index: 20;
}
.driver-nav-btn {
  flex: 1; border: none; background: none; padding: 12px 4px 10px; font-size: 11.5px;
  font-weight: 600; color: var(--ink-400); cursor: pointer;
}
.driver-nav-btn.active { color: var(--navy-900); box-shadow: inset 0 2px 0 var(--gold-500, #C9A961); }

.driver-home-hero {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800)); color: var(--ivory-050);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px;
}
.driver-home-hero .dh-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.7; margin-bottom: 6px; }
.driver-home-hero .dh-time { font-family: var(--font-display); font-size: 28px; color: var(--gold-400); }
.driver-home-hero .dh-route { font-size: 14px; margin-top: 6px; line-height: 1.5; }
.driver-home-hero .dh-empty { font-size: 14px; opacity: 0.85; }

.driver-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.driver-stat-box {
  background: #fff; border-radius: var(--radius-md); padding: 14px 10px; text-align: center;
  box-shadow: var(--shadow-panel);
}
.driver-stat-box .ds-num { font-family: var(--font-display); font-size: 22px; color: var(--navy-900); }
.driver-stat-box .ds-label { font-size: 10.5px; color: var(--ink-400); margin-top: 2px; }

.driver-alert-item {
  background: #FBF3E3; border: 1px solid rgba(201,169,97,0.35); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 12.5px; color: #8A6423; margin-bottom: 8px;
}

.trip-status-btn-primary {
  width: 100%; padding: 16px; margin-bottom: 8px; border: none; border-radius: var(--radius-sm);
  background: var(--navy-900); color: var(--ivory-050); font-size: 16px; font-weight: 700;
  font-family: var(--font-body); cursor: pointer;
}
.trip-status-btn-primary:active { filter: brightness(1.2); }
.trip-status-link { display: block; text-align: center; font-size: 12px; color: var(--ink-400); margin-bottom: 12px; background: none; border: none; text-decoration: underline; cursor: pointer; width: 100%; }

.trip-quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.trip-quick-btn {
  padding: 10px 4px; border: 1.5px solid #E3DFD3; border-radius: var(--radius-sm); background: #fff;
  color: var(--navy-900); font-size: 11.5px; font-weight: 600; cursor: pointer; text-align: center;
}
.trip-quick-btn.warn { border-color: #E8A48A; color: #A13B30; }
.inspection-gate {
  background: #FBF3E3; border: 1px solid rgba(201,169,97,0.4); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 12px; font-size: 12.5px; color: #8A6423;
}
.inspection-gate button {
  margin-top: 8px; padding: 8px 14px; background: var(--navy-900); color: #fff; border: none;
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; cursor: pointer;
}

.assignment-response-banner {
  background: #DDEBFA; border: 1px solid #A9C9E8; border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 12px; font-size: 12.5px; color: #2A5C8A;
}
.assignment-response-text { font-weight: 600; margin-bottom: 8px; }
.assignment-response-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trip-assignment-accept-btn, .trip-assignment-decline-btn {
  padding: 10px 4px; border: none; border-radius: var(--radius-sm); font-size: 13px;
  font-weight: 700; cursor: pointer;
}
.trip-assignment-accept-btn { background: var(--navy-900); color: #fff; }
.trip-assignment-decline-btn { background: #fff; color: #A13B30; border: 1.5px solid #E8A48A; }
.assignment-response-declined {
  background: #F5D9D6; border-color: #E8A48A; color: #A13B30; font-weight: 600;
}

.assignment-status-mini {
  font-size: 10.5px; font-weight: 700; margin-top: 4px; letter-spacing: 0.01em;
}
.assignment-status-accepted { color: #2E7D46; }
.assignment-status-declined { color: #A13B30; }
.assignment-status-pending { color: #8A6423; }

.earnings-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.earnings-stat-card {
  background: #fff; border-radius: var(--radius-md); padding: 16px 10px; text-align: center;
  box-shadow: var(--shadow-panel);
}
.earnings-stat-card .es-num { font-family: var(--font-display); font-size: 19px; color: var(--navy-900); }
.earnings-stat-card .es-label { font-size: 10px; color: var(--ink-400); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.02em; }

.driver-doc-row {
  background: #fff; border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow-panel); display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.driver-doc-row .dd-type { font-size: 13.5px; font-weight: 600; color: var(--ink-900); }
.driver-doc-row .dd-exp { font-size: 11.5px; color: var(--ink-400); margin-top: 2px; }

.offline-banner {
  background: #4A3B1F; color: #F5E4B8; font-size: 13px; text-align: center;
  padding: 10px 16px; line-height: 1.5;
}
.sync-pending-banner {
  background: #1F3D4A; color: #B8E4F5; font-size: 12.5px; text-align: center; padding: 7px 16px;
}

.trip-card {
  background: #fff; border-radius: var(--radius-lg); padding: 18px;
  margin-bottom: 14px; box-shadow: var(--shadow-panel); position: relative;
}
.trip-card.pending-sync::before {
  content: "Pending sync"; position: absolute; top: 10px; right: 14px;
  font-size: 10px; font-weight: 700; color: var(--gold-600);
  background: rgba(201,169,97,0.15); padding: 2px 8px; border-radius: 999px;
}
.trip-card-time { font-family: var(--font-display); font-size: 22px; color: var(--navy-900); margin-bottom: 2px; }
.trip-card-date { font-size: 12px; color: var(--ink-400); margin-bottom: 12px; }
.trip-card-route { font-size: 14.5px; color: var(--ink-900); margin-bottom: 4px; line-height: 1.5; }
.trip-card-meta { font-size: 12.5px; color: var(--ink-600); margin-bottom: 14px; }
.trip-status-select {
  width: 100%; padding: 12px 14px; border: 1.5px solid #E3DFD3; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; font-family: var(--font-body); background: #fff; color: var(--navy-900);
}

/* ---------- Driver mobile: trip notes ---------- */
.trip-notes-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid #F2EEE2; }
.trip-notes-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-400); margin-bottom: 8px; }
.trip-notes-history { background: rgba(201,169,97,0.08); border: 1px solid rgba(201,169,97,0.3); border-radius: var(--radius-md); padding: 12px 14px; margin-top: 14px; border-top: none; }
.trip-notes-history .trip-notes-title { color: var(--gold-600); }
.trip-note-item { margin-bottom: 8px; }
.trip-note-item:last-child { margin-bottom: 0; }
.trip-note-text { font-size: 13px; color: var(--ink-900); line-height: 1.5; }
.trip-note-date { font-size: 10.5px; color: var(--ink-400); margin-top: 2px; }
.note-pending-tag {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; color: var(--gold-600);
  background: rgba(201,169,97,0.15); padding: 1px 6px; border-radius: 999px; margin-left: 4px;
}
.trip-note-hint { font-size: 11.5px; color: var(--ink-400); line-height: 1.4; margin-bottom: 8px; }
.trip-note-category {
  width: 100%; padding: 8px 10px; border: 1.5px solid #E3DFD3; border-radius: var(--radius-sm);
  font-size: 12.5px; font-family: var(--font-body); margin-bottom: 6px; background: #fff;
}
.trip-note-input {
  width: 100%; padding: 10px 12px; border: 1.5px solid #E3DFD3; border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: var(--font-body); resize: vertical; margin-bottom: 8px;
}
.trip-note-important-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-600); margin-bottom: 8px; }
.trip-note-important-label input { width: auto; }
.trip-note-save-btn {
  padding: 8px 16px; background: var(--navy-900); color: var(--ivory-050); border: none;
  border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600;
}
.note-category-tag {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; color: var(--navy-900);
  background: rgba(20,30,60,0.08); padding: 1px 6px; border-radius: 999px; margin-right: 3px;
}

/* ---------- Trip Management: list/calendar toggle + day calendar ---------- */
.tm-view-toggle { display: flex; gap: 2px; background: var(--ivory-050); border-radius: var(--radius-sm); padding: 3px; }
.tm-toggle-btn {
  padding: 7px 16px; background: none; border: none; border-radius: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-600); cursor: pointer;
}
.tm-toggle-btn.active { background: #fff; color: var(--navy-900); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.cal-date-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.cal-date-nav input[type="date"] { padding: 8px 12px; border: 1.5px solid #E3DFD3; border-radius: var(--radius-sm); font-size: 13.5px; }

.cal-grid { background: #fff; border: 1px solid #ECE7D9; border-radius: var(--radius-lg); overflow-x: auto; }
.cal-header-row, .cal-driver-row { display: grid; grid-template-columns: 140px 1fr; min-width: 900px; }
.cal-header-row { border-bottom: 2px solid var(--navy-900); }
.cal-driver-row { border-bottom: 1px solid #F2EEE2; }
.cal-driver-row:last-child { border-bottom: none; }
.cal-corner { padding: 10px 14px; }
.cal-time-labels { position: relative; height: 34px; }
.cal-time-label {
  position: absolute; top: 8px; font-size: 10.5px; color: var(--ink-400); font-weight: 600;
  transform: translateX(-50%);
}
.cal-driver-label {
  padding: 16px 14px; font-size: 13px; font-weight: 600; color: var(--navy-900);
  border-right: 1px solid #F2EEE2; display: flex; align-items: center;
}
.cal-driver-track { position: relative; min-height: 64px; padding: 8px 0; }
.cal-hour-gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: #F5F2E8; }
.cal-trip-block {
  position: absolute; top: 8px; bottom: 8px; min-width: 26px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  border-radius: 5px; padding: 5px 8px; color: #fff; overflow: hidden;
  cursor: pointer; box-shadow: 0 1px 4px rgba(15,31,61,0.25);
}
.cal-trip-block:hover { filter: brightness(1.15); }
.cal-trip-block .cal-trip-time { font-size: 9.5px; font-weight: 700; opacity: 0.85; white-space: nowrap; }
.cal-trip-block .cal-trip-label { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-trip-block.status-Done { background: linear-gradient(135deg, #4a7a4a, #3d653d); }
.cal-trip-block.status-No-Show { background: linear-gradient(135deg, #8a5050, #703d3d); }

/* ---------- Trip Management: month calendar grid ---------- */
.cal-month-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: #fff; border: 1px solid #ECE7D9; border-radius: var(--radius-lg); overflow: hidden;
}
.cal-month-dayname {
  padding: 10px 0; text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-400);
  letter-spacing: 0.04em; border-bottom: 2px solid var(--navy-900); background: var(--ivory-050);
}
.cal-month-cell {
  min-height: 96px; padding: 6px 6px 8px; border-right: 1px solid #F2EEE2; border-bottom: 1px solid #F2EEE2;
  cursor: pointer; display: flex; flex-direction: column; gap: 4px;
}
.cal-month-cell:nth-child(7n) { border-right: none; }
.cal-month-cell:hover { background: var(--ivory-050); }
.cal-month-cell-blank { background: #FAF8F2; cursor: default; }
.cal-month-cell-today { background: rgba(201,169,97,0.08); }
.cal-month-daynum { font-size: 12px; font-weight: 700; color: var(--navy-900); }
.cal-month-cell-today .cal-month-daynum { color: var(--gold-600); }
.cal-month-trips { display: flex; flex-direction: column; gap: 2px; }
.cal-month-trip-chip {
  font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-month-trip-more { font-size: 10px; color: var(--ink-400); padding: 1px 6px; }
@media (max-width: 900px) {
  .cal-month-cell { min-height: 64px; }
  .cal-month-trip-chip:nth-child(n+2) { display: none; }
}

/* ---------- Secondary button ---------- */
.btn-secondary {
  padding: 9px 16px; background: #fff; border: 1.5px solid var(--navy-900); color: var(--navy-900);
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
}
.btn-secondary:hover { background: var(--ivory-050); }

/* ---------- Quote Confirmation (printable) ---------- */
.confirmation-toolbar { margin-bottom: 18px; }
.confirmation-sheet {
  background: #fff; border: 1px solid #ECE7D9; border-radius: var(--radius-lg);
  padding: 48px; max-width: 720px; box-shadow: var(--shadow-panel);
}
.conf-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.conf-logo { width: 52px; height: 52px; }
.conf-company-name { font-family: var(--font-display); font-size: 19px; color: var(--navy-900); font-weight: 600; }
.conf-company-sub { font-size: 12px; color: var(--ink-400); }
.conf-quote-number { margin-left: auto; font-family: var(--font-display); font-size: 20px; color: var(--gold-600); }
.conf-title {
  font-family: var(--font-display); font-size: 22px; color: var(--navy-900);
  border-bottom: 2px solid var(--gold-500); padding-bottom: 10px; margin-bottom: 22px;
}
.conf-meta-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px;
  font-size: 13.5px; color: var(--ink-900);
}
.conf-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-400); }
.conf-itinerary { width: 100%; border-collapse: collapse; margin-bottom: 4px; font-size: 13px; }
.conf-itinerary th {
  text-align: left; padding: 9px 10px; background: var(--navy-900); color: var(--ivory-050);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em;
}
.conf-itinerary td { padding: 10px; border-bottom: 1px solid #F2EEE2; }
.conf-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 4px 0; margin-top: 8px; border-top: 2px solid var(--navy-900);
  font-size: 14px; color: var(--ink-900);
}
.conf-total-row strong { font-family: var(--font-display); font-size: 22px; color: var(--navy-900); }
.conf-footer { margin-top: 32px; font-size: 12px; color: var(--ink-400); text-align: center; }

@media print {
  body * { visibility: hidden; }
  .confirmation-sheet, .confirmation-sheet * { visibility: visible; }
  .confirmation-sheet {
    position: absolute; top: 0; left: 0; width: 100%; box-shadow: none; border: none;
    padding: 20px; max-width: 100%;
  }
  .no-print { display: none !important; }
  .app-sidebar { display: none !important; }
}

/* ---------- Contract generation & settings ---------- */
.clause-checklist { max-height: 340px; overflow-y: auto; border: 1px solid #ECE7D9; border-radius: var(--radius-md); padding: 6px; }
.clause-check-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid #F2EEE2;
}
.clause-check-item:last-child { border-bottom: none; }
.clause-check-item input[type="checkbox"] { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }
.clause-check-item .clause-title { font-weight: 600; font-size: 13.5px; color: var(--navy-900); }
.clause-check-item .clause-body { font-size: 12.5px; color: var(--ink-600); margin-top: 2px; line-height: 1.5; }
.clause-check-item .clause-scope { font-size: 10.5px; color: var(--gold-600); text-transform: uppercase; letter-spacing: 0.02em; margin-top: 3px; }

.contract-sheet { font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; }
.contract-sheet .conf-header { margin-bottom: 24px; }

.settings-list-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding: 14px 4px; border-bottom: 1px solid #F2EEE2;
}
.settings-list-item:last-child { border-bottom: none; }
.settings-list-item .item-title { font-weight: 600; font-size: 13.5px; color: var(--navy-900); }
.settings-list-item .item-meta { font-size: 11.5px; color: var(--ink-400); margin-top: 2px; }
.settings-list-item .item-body { font-size: 12.5px; color: var(--ink-600); margin-top: 6px; line-height: 1.5; }
.badge-custom {
  display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: 0.03em;
  color: var(--gold-600); background: rgba(201,169,97,0.14); padding: 2px 7px; border-radius: 999px; margin-left: 8px;
}
.remove-clause-btn {
  background: none; border: none; color: var(--danger); font-size: 12px; padding: 4px 8px; flex-shrink: 0;
}
.remove-clause-btn:hover { text-decoration: underline; }

.clause-category-group { margin-bottom: 6px; }
.clause-category-heading {
  font-family: var(--font-display); font-size: 13.5px; color: var(--gold-600); font-weight: 600;
  padding: 18px 4px 8px; border-bottom: 1.5px solid var(--gold-500); margin-bottom: 4px;
}
.clause-category-group:first-child .clause-category-heading { padding-top: 4px; }

/* ---------- Vehicle Detail / Fleet Maintenance ---------- */
.vehicle-detail-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.vehicle-detail-header h1 { margin-bottom: 0; }
.maintenance-alert-banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 600; margin-bottom: 20px;
}
.maintenance-alert-banner.overdue { background: rgba(196,84,74,0.12); color: var(--danger); border: 1px solid rgba(196,84,74,0.3); }
.maintenance-alert-banner.due_soon { background: rgba(201,169,97,0.14); color: var(--gold-600); border: 1px solid rgba(201,169,97,0.35); }
.fleet-vehicle-alert-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px;
}
.fleet-vehicle-alert-dot.overdue { background: var(--danger); }
.fleet-vehicle-alert-dot.due_soon { background: var(--gold-500); }

.fuel-summary-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.fuel-stat-box { background: var(--ivory-050); border-radius: var(--radius-md); padding: 14px 16px; min-width: 0; }
.fuel-stat-value { font-family: var(--font-display); font-size: 20px; color: var(--navy-900); font-weight: 600; }
.fuel-stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-400); margin-top: 4px; font-weight: 600; }
/* Mobile/accessibility QA finding (2026-09-30): every one of this class's ~36 call
   sites sets its own inline grid-template-columns (2 to 7, picked for desktop), so a
   narrow phone screen squeezed stat values/labels into columns too thin to hold them
   - $ amounts and labels clipped mid-word (found on the Driver Detail scorecard).
   auto-fit/minmax overrides every inline column count below this width without
   editing any of the 36 call sites individually, and leaves a single-stat row
   (e.g. a bill's own "Total Owed" box) at full width instead of squeezed into a
   half-empty 2-column grid. */
@media (max-width: 480px) {
  .fuel-summary-row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important; }
  /* Same fix for .fin-stats-row: 13 call sites in app.js (Trip Management's
     dashboard tiles among them) set an inline repeat(4|5, 1fr) that beat the
     plain 900px rule above, squeezing 4 tiles into ~60px each at 375px so
     numbers wrapped one digit per line and labels were clipped. */
  .fin-stats-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; }
  /* Money figures (e.g. $92,987.00) split mid-number in a ~136px tile at the
     30px display size because .stat-value uses overflow-wrap: break-word.
     Smaller figure + tighter padding gives ~125px of room, enough for a
     six-figure amount on one line; anywhere-wrapping stays only as a last
     resort for a figure that genuinely cannot fit. */
  .stat-card { padding: 16px 14px; }
  .stat-value { font-size: 21px; }
  /* Inline-styled "label on the left, actions/values on the right" rows
     (display:flex; justify-content:space-between, no wrap) are used across the
     SPA's list cards; at 375px the right-hand group squeezed e.g. an expense's
     date to ~27px. Let those rows wrap onto a second line instead. Attribute
     selectors sit below inline style in specificity, so any row that sets its
     own flex-wrap/gap inline keeps its own value; rows that already fit are
     unaffected. */
  .view-panel [style*="justify-content:space-between"],
  .view-panel [style*="justify-content: space-between"] { flex-wrap: wrap; row-gap: 6px; column-gap: 10px; }
  /* Rate card detail fields are label + input pairs in 2 columns inside a ~254px
     card at 375px, leaving each label ~63px (e.g. "Hourly Rate - Medium D..."
     wrapped to 3 lines). One column on phones. */
  .ratecard-details { grid-template-columns: 1fr; }
  /* Alert rows: dot + source + message + severity in one flex line left the
     message a ~70px column that wrapped 4-5 lines at 375px. Wrap the row so
     the message gets its own full-width line under dot/source/severity. */
  .alert-row { flex-wrap: wrap; row-gap: 2px; }
  .alert-source { flex: 1; width: auto; }
  .alert-msg { flex: 1 1 100%; order: 5; padding-left: 18px; }
}

/* ---------- Welcome modal ---------- */
.welcome-modal-panel { max-width: 460px; text-align: center; padding: 40px 36px; }
.welcome-modal-icon { width: 56px; height: 56px; margin: 0 auto 18px; }
.welcome-modal-eyebrow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-600); font-weight: 700; }
.welcome-modal-title { font-family: var(--font-display); font-size: 26px; color: var(--navy-900); margin: 4px 0 18px; }
.welcome-modal-greeting { font-size: 14px; color: var(--ink-900); line-height: 1.6; margin-bottom: 18px; }
.welcome-modal-list { text-align: left; list-style: none; padding: 0; margin-bottom: 26px; }
.welcome-modal-list li {
  font-size: 13px; color: var(--ink-600); line-height: 1.6; padding: 10px 0 10px 22px;
  border-top: 1px solid #F2EEE2; position: relative;
}
.welcome-modal-list li:first-child { border-top: none; }
.welcome-modal-list li::before { content: "•"; position: absolute; left: 4px; color: var(--gold-500); font-weight: 700; }
.welcome-modal-list strong { color: var(--navy-900); }

/* ---------- Profile modal ---------- */
.profile-field-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #F2EEE2; font-size: 13.5px; }
.profile-field-row .label { color: var(--ink-400); }
.profile-field-row .value { color: var(--ink-900); font-weight: 600; }
.profile-role-badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px; background: var(--navy-900); color: var(--ivory-050);
}

/* ---------- Financial Dashboard ---------- */
.fin-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 900px) { .fin-stats-row { grid-template-columns: repeat(2, 1fr); } }
.fin-two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; margin-bottom: 20px; }
.fin-two-col > .card { min-width: 0; overflow-x: auto; }
@media (max-width: 900px) { .fin-two-col { grid-template-columns: 1fr; } }

.revenue-chart { display: flex; align-items: flex-end; gap: 14px; height: 160px; padding: 10px 4px 0; }
.revenue-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.revenue-chart-bar {
  width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--gold-400), var(--gold-600));
  border-radius: 4px 4px 0 0; min-height: 3px; transition: height 0.3s ease;
}
.revenue-chart-value { font-size: 10.5px; color: var(--ink-600); font-weight: 600; margin-bottom: 4px; }
.revenue-chart-label { font-size: 10.5px; color: var(--ink-400); margin-top: 8px; }

.breakdown-row { margin-bottom: 12px; }
.breakdown-row-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.breakdown-row-top .name { color: var(--ink-900); font-weight: 600; }
.breakdown-row-top .amount { color: var(--ink-600); }
.breakdown-bar-track { background: var(--ivory-050); border-radius: 999px; height: 7px; overflow: hidden; }
.breakdown-bar-fill { background: var(--navy-800); height: 100%; border-radius: 999px; }

.followup-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 4px; border-bottom: 1px solid #F2EEE2; font-size: 13px;
}
.followup-item:last-child { border-bottom: none; }
.followup-item .name { font-weight: 600; color: var(--ink-900); }
.followup-item .date { font-size: 12px; }
.followup-item .date.overdue { color: var(--danger); font-weight: 700; }
.followup-item .date.upcoming { color: var(--ink-600); }

/* ---------- Notifications ---------- */
.notification-sim-note {
  background: var(--ivory-050); border-left: 3px solid var(--gold-500); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 12px; color: var(--ink-600); line-height: 1.5; margin-bottom: 18px;
}
.sn-recipient {
  padding: 11px 13px; background: var(--ivory-050); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--ink-900); font-weight: 600;
}
.sn-recipient.sn-recipient-missing { color: var(--danger); font-weight: 600; }

.notification-history-item {
  padding: 12px 4px; border-bottom: 1px solid #F2EEE2; font-size: 12.5px;
}
.notification-history-item:last-child { border-bottom: none; }
.notification-history-top { display: flex; justify-content: space-between; margin-bottom: 3px; }
.notification-history-top .channel-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 1px 8px; border-radius: 999px; background: var(--navy-900); color: var(--ivory-050); margin-right: 6px;
}
.notification-history-date { color: var(--ink-400); }
.notification-history-body { color: var(--ink-600); line-height: 1.5; white-space: pre-wrap; }

.birthday-widget {
  background: linear-gradient(135deg, rgba(201,169,97,0.10), rgba(201,169,97,0.03));
  border: 1px solid rgba(201,169,97,0.3); border-radius: var(--radius-lg);
  padding: 14px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.birthday-widget-title { font-weight: 700; color: var(--gold-600); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.02em; }
.birthday-chip {
  background: #fff; border: 1px solid rgba(201,169,97,0.4); border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; color: var(--ink-900); cursor: pointer;
}
.birthday-chip:hover { background: var(--ivory-050); }

/* ---------- Messages (internal dispatch/HR/GM chat) ---------- */
.msg-layout { display: flex; gap: 20px; align-items: flex-start; height: calc(100vh - 220px); min-height: 420px; }
.msg-channel-list {
  width: 300px; flex-shrink: 0; background: #fff; border: 1px solid #ECE7D9; border-radius: var(--radius-md);
  overflow-y: auto; height: 100%;
}
.msg-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-400); padding: 12px 14px 6px;
}
.msg-thread-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 14px; cursor: pointer; border-left: 3px solid transparent;
}
.msg-thread-row:hover { background: var(--ivory-050); }
.msg-thread-row.active { background: rgba(201,169,97,0.10); border-left-color: var(--gold-500); }
.msg-thread-name { font-size: 13px; font-weight: 600; color: var(--navy-900); }
.msg-thread-preview { font-size: 11.5px; color: var(--ink-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.msg-thread-empty { padding: 10px 14px; font-size: 12px; color: var(--ink-400); }
.msg-conversation {
  flex: 1; display: flex; flex-direction: column; background: #fff;
  border: 1px solid #ECE7D9; border-radius: var(--radius-md); height: 100%; overflow: hidden;
}
.msg-conversation-header { padding: 14px 18px; border-bottom: 1px solid #ECE7D9; font-weight: 700; color: var(--navy-900); font-size: 14px; }
.msg-bubbles { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.msg-bubble { max-width: 68%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.4; }
.msg-bubble-mine { align-self: flex-end; background: var(--navy-900); color: var(--ivory-050); border-bottom-right-radius: 3px; }
.msg-bubble-theirs { align-self: flex-start; background: var(--ivory-100); color: var(--ink-900); border-bottom-left-radius: 3px; }
.msg-bubble-meta { font-size: 10px; opacity: 0.65; margin-top: 3px; }
.msg-compose { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid #ECE7D9; }
.msg-compose textarea {
  flex: 1; resize: none; border: 1.5px solid #E3DFD3; border-radius: var(--radius-sm);
  padding: 9px 12px; font-family: inherit; font-size: 13.5px; min-height: 40px; max-height: 100px;
}
.msg-compose button { width: auto; padding: 0 18px; }

/* The two-pane layout (300px channel list + conversation) has no narrow-screen
   rule: at 375px the conversation pane was squeezed to ~2px, so a thread could
   not be read or answered on a phone. Stack the panes instead - channel list on
   top, conversation below at a usable height. */
@media (max-width: 720px) {
  .msg-layout { flex-direction: column; align-items: stretch; height: auto; min-height: 0; }
  .msg-channel-list { width: 100%; height: auto; max-height: 38vh; }
  .msg-conversation { flex: none; width: 100%; height: 62vh; min-height: 340px; }
  .msg-bubble { max-width: 86%; }
  .msg-thread-preview { max-width: 55vw; }
}

.driver-msg-tabs {
  display: flex; gap: 4px; background: var(--ivory-100); padding: 3px; border-radius: 8px; margin-bottom: 14px;
}
.driver-msg-tab-btn {
  flex: 1; padding: 8px 10px; background: none; border: none; border-radius: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-600); cursor: pointer;
}
.driver-msg-tab-btn.active { background: #fff; color: var(--navy-900); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* ---------- RemaOps Pay: Settings -> Payments ---------- */
.pay-section { margin-bottom: 20px; }
.pay-section .card-title { margin-bottom: 6px; }
.pay-muted { color: var(--ink-600); font-size: 13px; line-height: 1.5; margin: 4px 0 10px; }
.pay-hint { font-weight: 400; color: var(--ink-600); font-size: 12px; }
.pay-footnote { margin-top: 4px; }
.pay-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pay-subhead { font-size: 14px; font-weight: 700; color: var(--navy-900); margin: 18px 0 6px; }
.pay-status { min-height: 0; margin: 0 0 14px; font-size: 13.5px; }
.pay-status-ok, .pay-status-error { padding: 10px 14px; border-radius: var(--radius-md); font-weight: 600; }
.pay-status-ok { background: #D9EFDE; color: #1F5A33; }
.pay-status-error { background: #F5D9D6; color: #8E2D24; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-top: 8px; }
.pay-card { border: 1.5px solid #E3DFD3; border-radius: var(--radius-md); padding: 14px 16px; background: #fff; min-width: 0; }
.pay-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 2px; }
.pay-card-head h3, .pay-card-head h4 { font-size: 15px; font-weight: 700; color: var(--navy-900); margin: 0 4px 0 0; }
.pay-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; }
.pay-pill-ok { background: #D9EFDE; color: #1F5A33; }
.pay-pill-warn { background: #F0E2C8; color: #6B4E12; }
.pay-pill-idle { background: #E9E4D8; color: #3d4452; }
.pay-pill-mode { background: #DDEBFA; color: #1F4D78; }
.pay-note { font-size: 12.5px; line-height: 1.5; padding: 8px 10px; border-radius: var(--radius-sm); margin: 6px 0 10px; }
.pay-note-warn { background: #FBEFD6; color: #5C4310; }
.pay-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pay-btn { width: auto; min-height: 40px; padding: 8px 14px; font-size: 13px; }
.pay-row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 8px 0 4px; }
.pay-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; min-height: 32px; }
.pay-check input { width: 18px; height: 18px; flex: none; accent-color: var(--navy-900); }
.pay-field { margin: 10px 0; }
.pay-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--navy-900); margin-bottom: 4px; }
.pay-input, .pay-select { width: 100%; padding: 9px 11px; border: 1.5px solid #D8CDA8; border-radius: var(--radius-sm); font-family: inherit; font-size: 13.5px; background: #fff; }
.pay-qr { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pay-qr img { height: 64px; width: auto; border-radius: var(--radius-sm); }
.pay-choices { border: 0; padding: 0; margin: 10px 0 0; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pay-choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid #E3DFD3; border-radius: var(--radius-md); cursor: pointer; background: #fff; min-height: 48px; }
.pay-choice:hover { background: var(--ivory-050); }
.pay-choice input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--navy-900); }
.pay-choice:has(input:checked) { border-color: var(--navy-900); background: var(--ivory-050); }
#view-payments button:focus-visible, #view-payments input:focus-visible, #view-payments select:focus-visible,
#view-payments textarea:focus-visible { outline: 3px solid var(--gold-600); outline-offset: 2px; }
#view-payments button:disabled { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 640px) {
  .pay-grid, .pay-choices { grid-template-columns: 1fr; }
  .pay-actions .pay-btn { flex: 1 1 100%; }
}
#view-payments input[type="file"] { max-width: 100%; font-size: 12.5px; }
.pay-card { overflow-wrap: anywhere; }
.pay-attention { border-left: 4px solid var(--gold-600); }
.pay-attn-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 16px; padding: 12px 0; border-top: 1px solid #F2EEE2; }
.pay-attn-text { flex: 1 1 260px; min-width: 0; }
.pay-attn-row .pay-actions { margin-top: 0; }
