/* ============================================================================
   VIP Carry Ops — styles.css  v2.0  ("Refined Orange", mockup option 1a)
   ----------------------------------------------------------------------------
   DROP-IN REPLACEMENT for public/styles.css.

   Design goals (see design_handoff_ui_2_0/README.md for the full rationale):
     1. One brand orange (#F26B00) that actually reads as primary.
     2. Fix the leftover navy-era sidebar label colour (#cfe0ee on orange).
     3. Warm the neutral palette so nothing fights the orange.
     4. Real type scale + tabular figures for money/dates/plates.
     5. Identical rendering on macOS and Windows (see the FONTS block).

   COMPATIBILITY CONTRACT
     Every class name and CSS variable from v1 is preserved, including the
     historical --navy / --navy-dark names (their VALUES change, their call
     sites do not). This file can be swapped in with ZERO markup changes and
     the app will look like v2 immediately.

     A handful of NEW, purely additive classes are provided at the bottom
     (.grid-5, .stat-hero, .alert-strip, .chip, .segmented, .month-stepper,
     .doc-chip, .mono, .tnum, .sidebar-group). Markup that adopts them gets
     the full 1a design; markup that ignores them still looks correct.

   NOTE ON THE INVESTOR DASHBOARD
     /investor was explicitly out of scope for this pass, but it shares these
     tokens, so it inherits the new palette and typography automatically. Its
     own layout rules are carried over unchanged at the end of this file.
     Review it once after deploying.
   ========================================================================= */

/* ---------------------------------------------------------------- FONTS ----
   Self-hosted on purpose: this app is documented as running with no external
   dependencies and possibly no outbound internet (see README.md "How this was
   built"). A Google Fonts <link> would make first paint depend on the
   network. Download the woff2 files once and drop them in public/fonts/:

     Manrope        400 500 600 700 800   (SIL OFL)
     JetBrains Mono 400 500 700           (SIL OFL)

   If the host DOES have reliable internet and you'd rather not self-host,
   delete the 8 @font-face blocks below and add this to the <head> in
   lib/render.js instead:
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Manrope:wght@400..800&family=JetBrains+Mono:wght@400;500;700&display=swap">

   The fallback stacks are deliberately platform-matched so the app is legible
   and correctly-proportioned even before/without the webfonts:
     macOS   -> -apple-system / SF Mono / Menlo
     Windows -> Segoe UI Variable Text / Cascadia Mono / Consolas
------------------------------------------------------------------------- */
/* Self-hosted (2026-09-04): 8 static per-weight woff2 files in public/fonts/,
   served by server.js's existing generic /static/ handler — no new server
   code needed. Static per-weight files rather than one variable-font file
   (the build environment this shipped from couldn't fetch the true variable
   woff2 — see the CDN-fallback note this replaced), which is actually the
   more broadly-compatible choice anyway: "woff2-variations" needs a newer
   browser than plain "woff2" does. Five Manrope weights (400/500/600/700/800)
   cover every weight this file's type scale actually uses; JetBrains Mono
   stays at its original three (400/500/700). Both SIL OFL. */
@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* --- Type -------------------------------------------------------------
     Cross-platform note: "Segoe UI Variable Text" is Windows 11, "Segoe UI"
     covers Windows 10 and earlier. Keeping both means Windows never falls
     through to Arial, which is noticeably narrower than Manrope and used to
     make the old layout reflow differently on the two platforms. */
  --font-ui: "Manrope", system-ui, "Segoe UI Variable Text", "Segoe UI",
             -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono",
               "Segoe UI Mono", Consolas, Menlo, monospace;

  /* --- Brand ------------------------------------------------------------
     Pantone 3564 C / #F26B00 remains the single brand colour, per the
     2026-07-16 rebrand. What changes is the SUPPORTING shades:

     --navy       topbar. Unchanged: #F26B00.
     --navy-dark  sidebar. Was #C25600 — one notch off the topbar, so the two
                  read as "almost the same orange" rather than a deliberate
                  hierarchy. Deepened to #A84A00, which (a) separates the rail
                  from the bar, and (b) lets a WHITE active pill sit on it at
                  7.4:1 instead of the old orange-on-orange pill at 1.4:1.
     --accent-ink NEW. #F26B00 as *text* on a white card is only 2.9:1 — it
                  fails AA for the table links and .linklike buttons that use
                  it today. This is the same hue at AA-passing lightness
                  (4.9:1) and should be used for every orange TEXT/link.
                  Orange as a BACKGROUND with white text stays #F26B00. */
  --navy: #F26B00;
  --navy-dark: #A84A00;
  --accent: #F26B00;
  --accent-hover: #D35F00;
  --accent-ink: #C25600;
  --accent-wash: #FFF7F0;

  /* Sidebar/topbar label colours. --nav-label replaces the hard-coded
     #cfe0ee (a pale BLUE, left over from the navy chrome) that is currently
     used for every sidebar link and .navuser element. Warm white at 5.1:1
     on --navy-dark. */
  --nav-label: #FFF2E6;
  --nav-label-dim: rgba(255, 255, 255, 0.52);
  --nav-hover: rgba(255, 255, 255, 0.10);

  /* --- Warm neutrals ---------------------------------------------------
     v1's greys were cool (#f4f6f8 / #e1e6ea / #22303c — blue-leaning, also
     navy-era leftovers). Against orange, cool greys read slightly green.
     These are the same lightness values, rotated warm. */
  --bg: #F7F5F2;
  --card: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #F2EDE7;
  --surface-alt-hover: #E9E2DA;
  --row-hover: #FBF9F6;
  --border: #E6E0D8;
  --border-strong: #DDD5CC;
  --text: #1D1A17;
  --muted: #6B6156;
  --faint: #8A7F74;
  --ink: #1D1A17;          /* dark surfaces (hero stat tile) */

  /* --- Status ----------------------------------------------------------
     Unchanged from v1 — these already work and are referenced by exported
     Excel styling and the Telegram report copy. */
  --green: #1C8A4B;
  --green-hover: #156B39;
  --amber: #B9770E;
  --red: #C0392B;
  --red-hover: #A03226;
  --grey: #8A7F74;
  --cyan: #0E7C86;
  --export-btn: #0E7C86;
  --export-btn-hover: #0B626A;

  --badge-available-bg: #E3F5E9;
  --badge-rented-bg: #FCE7D6;
  --badge-maintenance-bg: #FDF1DE;
  --badge-out-bg: #FBE7E5;
  --badge-cancelled-bg: #F2EDE7;
  --badge-washing-bg: #DFF3F5;
  --badge-rented-text: #8A3D00;
  --tag-pill-bg: #FDF1DE;
  --flash-error-bg: #FBE7E5;
  --flash-ok-bg: #E3F5E9;

  /* --- Geometry --------------------------------------------------------- */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(29, 26, 23, 0.06);
  --shadow-md: 0 2px 8px rgba(29, 26, 23, 0.08);
  --shadow-pop: 0 10px 30px rgba(29, 26, 23, 0.18);
}

[data-theme="dark"] {
  /* v1's dark block was cool blue-grey (--bg #0f1720, --card #17212c) — the
     same navy leftover as the light greys, and it makes the brand orange read
     slightly acid at night. Same lightness, rotated warm, so light and dark
     share one temperature. The topbar stays #F26B00 in both themes as the
     rebrand intended; the SIDEBAR drops to ink here, because a full-height lit
     orange rail is the main source of glare in a dark room. */
  --navy: #F26B00;
  --navy-dark: #1C1713;
  --accent: #F26B00;
  --accent-hover: #FF8A33;
  --accent-ink: #FF8A33;
  --accent-wash: rgba(242, 107, 0, 0.14);

  --nav-label: #B3A79C;
  --nav-label-dim: #7D7167;
  --nav-hover: rgba(255, 255, 255, 0.07);

  --bg: #14100D;
  --card: #1C1713;
  --surface: #1C1713;
  --surface-alt: #262019;
  --surface-alt-hover: #302820;
  --row-hover: #201A15;
  --border: #2E2620;
  --border-strong: #38302A;
  --text: #EFE7DF;
  --muted: #A3968A;
  --faint: #8D8177;
  --ink: #221B16;

  /* Dark status values carried over from v1 unchanged. */
  --green: #3FBD77;
  --green-hover: #34A468;
  --amber: #E0A83E;
  --red: #E2564A;
  --red-hover: #C94538;
  --grey: #9AA7AD;
  --cyan: #4FD1DD;
  --export-btn: #1A99A3;
  --export-btn-hover: #157F88;

  --badge-available-bg: rgba(63, 189, 119, 0.16);
  --badge-rented-bg: rgba(242, 107, 0, 0.16);
  --badge-maintenance-bg: rgba(224, 168, 62, 0.16);
  --badge-out-bg: rgba(226, 86, 74, 0.16);
  --badge-cancelled-bg: rgba(154, 167, 173, 0.16);
  --badge-washing-bg: rgba(79, 209, 221, 0.16);
  --badge-rented-text: var(--accent-ink);
  --tag-pill-bg: rgba(224, 168, 62, 0.16);
  --flash-error-bg: rgba(226, 86, 74, 0.16);
  --flash-ok-bg: rgba(63, 189, 119, 0.16);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.55);
}

/* =============================================================== BASE ==== */
* { box-sizing: border-box; }
html, body { height: 100%; }
html, body { overflow-x: hidden; }
html { touch-action: manipulation; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  /* Cross-platform: -webkit-font-smoothing is a macOS-only property and makes
     text noticeably LIGHTER there. Applying it unconditionally is what makes
     a design look correct on a Mac and anaemic on Windows (which uses
     DirectWrite and ignores it). We deliberately do NOT set it, and instead
     use weight 500 for body text so both platforms land in the same place.
     Do not add -webkit-font-smoothing: antialiased to this file. */
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  -moz-osx-font-smoothing: auto;
}

/* Every figure, plate, timestamp and ID in this app is a number that gets
   compared down a column, so tabular figures are the default everywhere and
   proportional figures are never wanted. */
input, select, textarea, button, table { font-variant-numeric: tabular-nums; }

a { color: var(--accent-ink); }
a:hover { color: var(--accent); }

::selection { background: rgba(242, 107, 0, 0.22); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Cross-platform: macOS overlay scrollbars are invisible until scrolled;
   Windows/Chromium draws a permanent 16px light-grey bar that looked broken
   against the dark sidebar. Style it to match the surface it's on. */
* { scrollbar-color: var(--border-strong) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--faint); background-clip: content-box; }
.sidebar { scrollbar-color: rgba(255, 255, 255, 0.28) transparent; }

.container {
  flex: 1;
  min-width: 0;
  max-width: 1180px;   /* was 1080 — the wider tables (Trips, Car Wash) had no
                          room to breathe on a 1440 laptop, which is the
                          standard office machine on both platforms */
  margin: 0 auto;
  padding: 28px 32px 64px;
}

/* ============================================================= TOPBAR ==== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy);
  color: #fff;
  padding: 0 24px;
  height: 58px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14);
}
.brand {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
}
.brand:hover { opacity: 0.85; }
.brand-logo { height: 32px; width: auto; display: block; }

/* Global search / command bar (NEW — optional, see README markup step 5).
   Renders as a plain <a> or <form> in the topbar; harmless if omitted. */
.topsearch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
  padding: 7px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.topsearch:hover { background: rgba(255, 255, 255, 0.24); color: #fff; }
.topsearch .kbd {
  margin-left: auto;
  font: 600 10px/1 var(--font-mono);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  padding: 3px 5px;
  color: rgba(255, 255, 255, 0.75);
}

/* ============================================================ SIDEBAR ==== */
.app-body { display: flex; min-height: calc(100vh - 58px); }
.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--navy-dark);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
  z-index: 10;
}
[data-theme="dark"] .sidebar { border-right: 1px solid var(--border); }

/* NEW, optional: small caps section heading inside the rail
   ("Operations" / "Company"). See README markup step 2. */
.sidebar-group {
  font: 700 10px/1 var(--font-ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nav-label-dim);
  padding: 10px 14px 6px;
}
.sidebar-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  margin: 12px 14px 6px;
  border: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  color: var(--nav-label);          /* was #cfe0ee */
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.sidebar-link:hover { background: var(--nav-hover); color: #fff; }

/* Active state inverts to a white pill with orange text. The old active state
   (orange pill on the orange rail) was 1.4:1 against its own background —
   effectively invisible until you looked for it. */
.sidebar-link.active {
  background: #fff;
  color: var(--navy-dark);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .sidebar-link.active {
  background: var(--accent-wash);
  color: var(--accent-ink);
  box-shadow: inset 2px 0 0 var(--accent);
}
.sidebar-link.active .sidebar-icon svg [stroke] { stroke: currentColor; }

.sidebar-icon {
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Inline SVG icons inherit the link's colour, so light/dark/active all work
   with one icon definition. See design_handoff_ui_2_0/sidebar-icons.js. */
.sidebar-icon svg { width: 18px; height: 18px; display: block; }
.sidebar-icon svg [stroke] { stroke: currentColor; }
.sidebar-icon svg [fill]:not([fill="none"]) { fill: currentColor; }

/* Count / alert bubble at the end of a nav row (e.g. Trips "3") */
.sidebar-count {
  margin-left: auto;
  font: 700 10px/1 var(--font-mono);
  padding: 3px 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.sidebar-count.alert { background: var(--red); color: #fff; }
[data-theme="dark"] .sidebar-count.alert { color: var(--bg); }

@media (max-width: 900px) {
  .app-body { flex-direction: column; min-height: 0; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    gap: 2px;
    padding: 8px;
    overflow-x: auto;
    overflow-y: visible;
    position: static;
    height: auto;
  }
  .sidebar-group, .sidebar-sep { display: none; }
  .sidebar-link { flex-direction: column; gap: 4px; padding: 8px 12px; font-size: 11px; white-space: nowrap; }
  .sidebar-count { margin-left: 0; }
  .container { padding: 20px 16px 48px; }
}

/* ====================================================== USER MENU ======== */
.navuser { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--nav-label); }
.navuser em { font-style: normal; opacity: 0.7; }

.linklike {
  background: none;
  border: none;
  color: var(--accent-ink);        /* now AA-compliant on white cards */
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}
.linklike:hover { color: var(--accent); }

.lang-btn {
  color: var(--nav-label) !important;
  text-decoration: none !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 5px;
  padding: 3px 8px !important;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.lang-btn:hover { color: #fff !important; background: rgba(255, 255, 255, 0.12); }

.user-menu { position: relative; }
.avatar-btn {
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  padding: 0;
  line-height: 0;
  cursor: pointer;
  display: block;
}
.avatar-btn:hover { border-color: #fff; }
.avatar-img { border-radius: 50%; object-fit: cover; display: block; }
.avatar-initials {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  min-width: 220px;
  padding: 8px;
  display: none;
  z-index: 200;
}
.user-dropdown.open { display: block; }
.user-dropdown-head { padding: 8px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.who-name { font-weight: 800; font-size: 14px; }
.who-role { font-size: 12px; color: var(--muted); text-transform: capitalize; margin-top: 2px; }
.user-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  text-decoration: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.user-dropdown-item:hover { background: var(--surface-alt); }
.user-dropdown-form { margin: 0; }
.user-dropdown-lg { min-width: 250px; padding: 10px; }
.user-dropdown-lg .user-dropdown-head { padding: 10px 12px 14px; }
.user-dropdown-lg .who-name { font-size: 16px; }
.user-dropdown-lg .who-role { font-size: 13px; }
.user-dropdown-lg .user-dropdown-item { font-size: 16px; padding: 15px 12px; }

.avatar-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 13, 0.82);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.avatar-lightbox.open { display: flex; }
.avatar-lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--r-lg); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }

.docs-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 13, 0.62);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.docs-modal-overlay.open { display: flex; }
.docs-modal {
  background: var(--card);
  color: var(--text);
  border-radius: 14px;
  padding: 20px;
  max-width: 380px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
}
.docs-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.docs-modal-close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; }
.docs-modal-close:hover { color: var(--text); }
.docs-modal-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.docs-modal-row:last-child { border-bottom: none; }
.docs-modal-label { font-size: 13px; font-weight: 700; flex: 1; }
.badge-btn { border: none; cursor: pointer; font-family: inherit; }

/* ========================================================= TYPOGRAPHY ==== */
h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}
h2 {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 28px 0 10px;
}
h3 { font-size: 15px; font-weight: 800; margin: 20px 0 8px; }
.subtitle { color: var(--muted); margin: 0 0 20px; font-size: 14px; font-weight: 500; }
.muted { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; font-weight: 500; margin-top: 4px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 560px) {
  .page-head { flex-direction: column; align-items: flex-start; }
}

/* =============================================================== CARDS === */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 18px;
}
/* A card whose only child is a table shouldn't add padding around it — the
   table draws its own. This makes every list page tighter with no markup
   change. */
.card > table:only-child { margin: -20px; width: calc(100% + 40px); }
.card > table:only-child th:first-child,
.card > table:only-child td:first-child { padding-left: 20px; }
.card > table:only-child th:last-child,
.card > table:only-child td:last-child { padding-right: 20px; }

.grid { display: grid; gap: 14px; }
.grid-5 { grid-template-columns: repeat(5, 1fr); }   /* NEW */
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .grid-5, .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ============================================================== STATS ==== */
.stat { text-align: left; }
.stat .num {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--text);              /* was var(--navy): five orange numbers in
                                      a row is five things shouting at once.
                                      Colour now carries MEANING only. */
}
.stat .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 7px;
}
.stat.good .num { color: var(--green); }
.stat.warn { background: var(--badge-out-bg); border-color: rgba(192, 57, 43, 0.28); }
.stat.warn .num { color: var(--red); }
.stat.warn .label { color: var(--red); }

/* NEW, optional: the one operational number that deserves emphasis, as a
   dark tile with a fleet-mix bar underneath. See README markup step 3. */
.stat-hero {
  background: var(--ink);
  border: none;
  color: #fff;
  border-radius: var(--r-lg);
  padding: 18px 20px;
}
.stat-hero .label { color: rgba(255, 255, 255, 0.55); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; font-weight: 700; margin: 0 0 8px; }
.stat-hero .num { font-size: 40px; color: var(--accent-hover); }
.stat-hero .num-sub { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.6); }

/* Stacked proportional bar — Available / Rented / Wash / Service */
.mixbar { display: flex; height: 8px; border-radius: var(--r-pill); overflow: hidden; margin-top: 16px; background: rgba(255, 255, 255, 0.12); }
.mixbar > span { display: block; height: 8px; }
.mixbar-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.72); }
.mixbar-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

.amt-pos { color: var(--green); font-weight: 700; }
.amt-neg { color: var(--red); font-weight: 700; }

/* ============================================================= TABLES ==== */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { background: var(--row-hover); }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); }
th {
  color: var(--faint);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--row-hover); }
td a { color: var(--accent-ink); text-decoration: none; font-weight: 700; }
td a:hover { text-decoration: underline; }
/* Money/dates/ids read as columns of digits — right-align and monospace them.
   Add class="num" to the <td>/<th> (see README markup step 6); left-aligned
   text cells are unaffected. */
th.num, td.num { text-align: right; font-family: var(--font-mono); font-weight: 700; }
td.mono, th.mono { font-family: var(--font-mono); font-weight: 500; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* Totals row */
tr.totals td { background: var(--row-hover); font-weight: 800; border-top: 2px solid var(--border-strong); }

/* ============================================================= BADGES ==== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-available { background: var(--badge-available-bg); color: var(--green); }
.badge-rented { background: var(--badge-rented-bg); color: var(--badge-rented-text); }
.badge-maintenance { background: var(--badge-maintenance-bg); color: var(--amber); }
.badge-out_of_service { background: var(--badge-out-bg); color: var(--red); }
.badge-washing { background: var(--badge-washing-bg); color: var(--cyan); }
/* Pseudo car status, never stored in the DB — see carDisplayStatus() in
   lib/render.js (2026-09-07, owner's report). Deliberately neutral grey,
   not the orange "Rented" or green "Available" tones, so a Free/Comp Trip
   car reads as "off the market, not earning" at a glance. Reuses the same
   tokens as .badge-cancelled below, which is the same idea for a booking
   (no revenue happened here) — no new theme variables needed. */
.badge-owner_use { background: var(--badge-cancelled-bg); color: var(--grey); }
.badge-in_progress { background: var(--badge-rented-bg); color: var(--badge-rented-text); }
.badge-returned { background: var(--badge-available-bg); color: var(--green); }
.badge-cancelled { background: var(--badge-cancelled-bg); color: var(--grey); }
.badge-overdue { background: var(--badge-out-bg); color: var(--red); }
.badge-open-date { background: var(--surface-alt); color: var(--muted); border: 1px solid var(--border); cursor: help; }
.badge-id-photo { background: var(--surface-alt); color: var(--muted); border: 1px solid var(--border); }

/* NEW: uniform document chip, so front ID / back ID / agreement are tellable
   apart instead of three identical "ID" pills. Text comes from i18n. */
.doc-chip {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--muted);
  font: 700 9.5px/1.4 var(--font-mono);
  letter-spacing: 0.02em;
  text-decoration: none;
  vertical-align: middle;
}
.doc-chip:hover { border-color: var(--accent); color: var(--accent-ink); }

.tag-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  background: var(--tag-pill-bg);
  color: var(--amber);
  margin: 2px 4px 2px 0;
}

.id-photo-hover { position: relative; display: inline-block; cursor: zoom-in; }
.id-photo-hover .id-photo-preview {
  display: none;
  position: absolute;
  z-index: 60;
  bottom: 100%;
  right: 0;
  margin-bottom: 6px;
  width: 200px;
  max-width: 60vw;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-pop);
}
.id-photo-hover:hover .id-photo-preview { display: block; }

/* ======================================================= ALERT STRIP ===== */
/* NEW: replaces the "⚠ Overdue Returns" h2 + plain card on the dashboard with
   a bordered strip that states the problem in words and carries the action.
   See README markup step 4. */
.alert-strip {
  background: var(--card);
  border: 1px solid rgba(192, 57, 43, 0.3);
  border-left: 4px solid var(--red);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 22px;
}
.alert-strip-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--badge-out-bg);
  font-size: 15px;
  font-weight: 800;
  color: var(--red);
}
.alert-strip-head .dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.alert-strip-note { margin-left: auto; font-size: 12px; font-weight: 600; }
.alert-strip table { font-size: 14px; }
.alert-strip thead tr { background: transparent; }

/* ============================================================= FORMS ===== */
form.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
form.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 760px) { form.form-grid { grid-template-columns: 1fr; } }

/* NEW, optional: a single-row form (Log a payment). Falls back to form-grid
   behaviour on narrow screens. */
form.form-row { display: grid; grid-template-columns: 2.1fr 1.4fr 1fr 1fr auto; gap: 14px; align-items: end; }
@media (max-width: 1100px) { form.form-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { form.form-row { grid-template-columns: 1fr; } }

label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
  color: var(--text);
}
input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  /* Cross-platform: Windows Chromium/Edge draw native <select> arrows and
     <input> spinners with their own metrics, which made paired fields sit at
     different heights than on macOS. Normalising appearance + explicit
     padding makes the two platforms identical. */
  appearance: none;
  -webkit-appearance: none;
}
input[type="number"] { font-family: var(--font-mono); font-weight: 700; }
input[type="checkbox"], input[type="radio"] { width: auto; appearance: auto; -webkit-appearance: auto; accent-color: var(--accent); }
input[type="file"] { padding: 9px 11px; font-weight: 600; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%),
                    linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% + 1px), calc(100% - 12px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 107, 0, 0.16);
}
input::placeholder, textarea::placeholder { color: var(--faint); font-weight: 500; }
textarea { resize: vertical; min-height: 76px; font-family: inherit; }

.directory-phone { color: var(--muted); font-size: 12px; font-family: var(--font-mono); }
[data-theme="dark"] .directory-phone { color: #C8BCB1; }

/* Currency toggle (UZS/USD) — now a visible segmented control next to the
   label rather than a text link that hides a second field. */
.currency-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; vertical-align: middle; margin-left: 8px; }
.currency-seg button, .currency-seg span {
  padding: 3px 8px;
  font: 700 10.5px/1.3 var(--font-ui);
  border: none;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.currency-seg .is-active { background: var(--ink); color: #fff; }
[data-theme="dark"] .currency-seg .is-active { background: var(--accent); color: #14100D; }
.currency-usd-row { margin-top: 6px; }

/* ============================================================ BUTTONS ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border-radius: var(--r-md);
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.btn-secondary { background: var(--surface-alt); color: var(--text); box-shadow: none; }
.btn.btn-secondary:hover { background: var(--surface-alt-hover); color: var(--text); }
.btn.btn-outline { background: var(--card); color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
.btn.btn-outline:hover { background: var(--surface-alt); color: var(--text); }
.btn.btn-danger { background: var(--red); }
.btn.btn-danger:hover { background: var(--red-hover); }
.btn.btn-success { background: var(--green); }
.btn.btn-success:hover { background: var(--green-hover); }
.btn.btn-export { background: var(--export-btn); color: #fff; }
.btn.btn-export:hover { background: var(--export-btn-hover); }
.btn.btn-lg { padding: 14px 22px; font-size: 15px; }
.btn.btn-sm { padding: 7px 12px; font-size: 12px; box-shadow: none; }
.btn[disabled], .btn.is-disabled { opacity: 0.45; pointer-events: none; }

.btn-export-wrap { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.btn-export-label { font-size: 11px; font-weight: 700; color: var(--muted); }
.btn-export-group { display: inline-flex; border-radius: var(--r-pill); overflow: hidden; text-decoration: none; }
.btn-export-seg { padding: 8px 18px; background: var(--export-btn); color: #fff; font-weight: 700; font-size: 12.5px; text-decoration: none; }
.btn-export-seg:hover { background: var(--export-btn-hover); color: #fff; }
.btn-export-seg + .btn-export-seg { border-left: 1px solid rgba(255, 255, 255, 0.25); }
.btn-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }

.kbd {
  font: 700 11px/1 var(--font-mono);
  background: var(--surface-alt);
  border-radius: 5px;
  padding: 4px 7px;
  color: var(--muted);
}

/* ======================================== FILTERS / PILLS / SEGMENTED ==== */
.filters { display: flex; gap: 7px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filters a {
  padding: 7px 13px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border-strong);
  white-space: nowrap;
}
.filters a:hover { border-color: var(--faint); color: var(--text); }
/* Active filter is ink, not orange: orange is reserved for actions the user
   can take, and a filter pill is a statement of current state. */
.filters a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
[data-theme="dark"] .filters a.active { background: var(--accent); border-color: var(--accent); color: #14100D; }
/* Status dot inside a filter pill, matched to the badge colour of that status */
.filters a i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.filters a .n { font-family: var(--font-mono); font-weight: 600; color: var(--faint); margin-left: 4px; }
.filters a.active .n { color: rgba(255, 255, 255, 0.7); }

/* NEW, optional: segmented control — for a single mutually-exclusive choice
   (the Prestige / All / Vip Carry company switcher, the Finance sub-tabs).
   Use this instead of .filters when the options are not additive filters. */
.segmented { display: inline-flex; background: var(--surface-alt); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.segmented a, .segmented label {
  padding: 8px 15px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  margin: 0;
}
.segmented a:hover { color: var(--text); }
.segmented a.active, .segmented input:checked + label {
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.segmented .n { font-family: var(--font-mono); font-weight: 600; font-size: 12px; color: var(--faint); margin-left: 4px; }

/* NEW, optional: month stepper — replaces the three ‹ / label / › pills,
   which looked like filters rather than a control. */
.month-stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 3px; }
.month-stepper a { width: 32px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-size: 15px; font-weight: 700; }
.month-stepper a:hover { background: var(--surface-alt); color: var(--text); }
.month-stepper .month-label { padding: 0 12px; font-size: 13.5px; font-weight: 800; min-width: 112px; text-align: center; }

.trip-search-form { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.trip-search-form input[type="search"] { flex: 1; min-width: 220px; }

.tagtoggle { display: inline-block; margin: 4px 8px 4px 0; }
.tagtoggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tagtoggle span {
  display: inline-block;
  padding: 11px 16px;
  border-radius: var(--r-pill);
  border: 2px solid var(--border-strong);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
  user-select: none;
}
.tagtoggle span:hover { border-color: var(--faint); }
.tagtoggle input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.tagtoggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.loc-toggle { display: inline-flex; border-radius: var(--r-pill); overflow: hidden; background: var(--surface-alt); }
.loc-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.loc-toggle label { padding: 8px 15px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--muted); user-select: none; margin: 0; }
.loc-toggle input:checked + label { background: var(--accent); color: #fff; }
.loc-toggle input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: -2px; }
.loc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.loc-row:last-child { border-bottom: none; }
.loc-row .loc-car { font-weight: 700; }
.loc-row .loc-meta { color: var(--muted); font-size: 12px; }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-alt);
  font-size: 18px; font-weight: 800;
  cursor: pointer; color: var(--text);
  font-family: inherit;
}
.stepper button:hover { background: var(--surface-alt-hover); }
.stepper input { text-align: center; max-width: 140px; font-family: var(--font-mono); font-weight: 700; }

/* ============================================================= FLASH ===== */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 700;
}
.flash-error { background: var(--flash-error-bg); color: var(--red); }
.flash-ok { background: var(--flash-ok-bg); color: var(--green); }

/* ============================================================= LOGIN ===== */
.login-wrap { max-width: 400px; margin: 12vh auto 0; }
.login-wrap h1 { font-size: 26px; }
.login-wrap .card { padding: 24px; }

/* ====================================================== DETAIL / AUDIT === */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; font-size: 14px; }
.detail-grid dt { color: var(--faint); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; margin-top: 12px; }
.detail-grid dd { margin: 0; font-weight: 700; }
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }

/* Activity rows: a leading dot + stacked text instead of a floated timestamp.
   The float meant a long entry wrapped UNDER the time and looked broken. */
.audit-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.audit-item:last-child { border-bottom: none; }
.audit-item::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
  margin-top: 7px;
  flex-shrink: 0;
}
.audit-item:first-child::before { background: var(--accent); }
.audit-item .when { color: var(--faint); font-size: 11.5px; font-weight: 600; display: block; margin-top: 3px; float: none; }
.audit-item .who { font-weight: 800; }

.doc-list { display: flex; flex-direction: column; }
.doc-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.doc-row:last-child { border-bottom: none; }
.doc-row-thumbs { display: flex; gap: 6px; flex-shrink: 0; }
.doc-row-info { min-width: 0; }
.doc-row-title { font-weight: 700; font-size: 14px; }
.doc-row-title a { color: var(--accent-ink); text-decoration: none; font-weight: 800; }
.doc-row-title a:hover { text-decoration: underline; }
.doc-row-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.empty { color: var(--muted); font-size: 14px; font-weight: 500; padding: 28px 0; text-align: center; }

/* ======================================================= DATE PICKER ===== */
.date-picker { position: relative; }
.date-picker-display { cursor: pointer; background: var(--surface); font-family: var(--font-mono); font-weight: 500; }
.date-picker-display:read-only { background: var(--surface); }
.date-picker-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  padding: 16px;
  width: 300px;
  overflow: hidden;
}
.date-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.date-picker-head .date-picker-month { font-weight: 800; font-size: 16px; }
.date-picker-nav { background: none; border: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--text); padding: 8px 12px; border-radius: var(--r-md); font-family: inherit; }
.date-picker-nav:hover { background: var(--surface-alt); }
.date-picker-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; font-weight: 700; color: var(--faint); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.date-picker-weekdays span { min-width: 0; }
.date-picker-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.date-picker-day {
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  background: none;
  color: var(--text);
}
.date-picker-day:hover:not(:disabled) { background: var(--surface-alt); }
.date-picker-day.is-today { border-color: var(--accent); font-weight: 700; }
.date-picker-day.is-selected { background: var(--accent); color: #fff; font-weight: 700; }
.date-picker-day.is-outside { color: var(--border-strong); }
.date-picker-day:disabled { cursor: default; opacity: 0.35; }
.date-picker-foot { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.date-picker-foot button { background: none; border: none; color: var(--accent-ink); font-weight: 700; font-size: 13px; cursor: pointer; padding: 4px; font-family: inherit; }
.date-picker-foot button:hover { text-decoration: underline; }
@media (max-width: 480px) { .date-picker-panel { width: 264px; } }

.dt-fields { display: inline-flex; gap: 6px; align-items: center; }
.js-time-input { font-family: var(--font-mono); font-weight: 500; }

/* ============================================== CONFETTI / MONEY DROP ==== */
.vc-confetti-piece {
  position: fixed; top: -12px; width: 8px; height: 14px; border-radius: 2px;
  z-index: 9999; opacity: 0.9; pointer-events: none;
  animation-name: vcConfettiFall;
  animation-timing-function: cubic-bezier(0.35, 0, 0.65, 1);
  animation-fill-mode: forwards;
}
@keyframes vcConfettiFall { to { top: 105vh; transform: rotate(600deg); opacity: 0.5; } }
.vc-money-piece {
  position: fixed; top: -30px; z-index: 9999; pointer-events: none; line-height: 1;
  animation-name: vcMoneyFall;
  animation-timing-function: cubic-bezier(0.4, 0, 0.7, 1);
  animation-fill-mode: forwards;
}
@keyframes vcMoneyFall {
  to { top: 105vh; transform: translateX(var(--vc-sway, 0)) rotate(30deg); opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
  .vc-confetti-piece, .vc-money-piece { display: none; }
}

/* ==================================== INVESTOR DASHBOARD (out of scope) ==
   Carried over from v1 unchanged apart from inheriting the new tokens.
   Review /investor once after deploying — nothing here was redesigned in
   this pass.

   FONTS EXCLUDED (2026-09-04, owner's request): the color/spacing/radius
   tokens are still shared with staff pages (that inheritance was intentional
   from the start), but Manrope/JetBrains Mono are NOT — the owner asked for
   the investor view to keep its original system-font look rather than pick
   up the new typography along with everything else. lib/render.js's
   layout() adds class="investor-view" to <body> only for the investor role
   (every other role is untouched); these two custom-property overrides ride
   the cascade down to every element on the page that reads var(--font-ui)/
   var(--font-mono) — body, .mono, table headers, money figures, the payback
   ring number, etc. — with no per-element changes needed. Values are the
   same system-font stack v1 used everywhere before this pass. */
.investor-view {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-mono: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
.chart-card svg { display: block; width: 100%; height: auto; }
.chart-svg-tall { height: auto; min-height: 120px; }
.chart-legend { display: flex; gap: 16px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.investor-chart-grid { margin-top: 16px; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.55s ease-out, transform 0.55s ease-out; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.zoom-pop { transform-origin: center center; will-change: transform; position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .zoom-pop { transform: none !important; } }

.investor-car-list { display: flex; flex-direction: column; gap: 8px; }
.investor-car-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.investor-usd-line { color: var(--muted); font-size: 13px; margin: -8px 0 18px; }

.investor-greeting-banner {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-radius: 14px; font-size: 15px; font-weight: 700;
  margin-bottom: 18px; width: 100%; color: #fff;
}
.investor-greeting-banner .emoji, .investor-greeting-banner > span:last-child { position: relative; z-index: 2; }
.investor-greeting-banner .emoji { font-size: 18px; line-height: 1; }
.investor-greeting-banner.tod-morning { background: linear-gradient(135deg, #ffd89b 0%, #f7a35c 55%, #f26b00 100%); color: #3a2200; }
.investor-greeting-banner.tod-afternoon { background: linear-gradient(135deg, #8ecbff 0%, #4a90e2 60%, #2f6fd1 100%); }
.investor-greeting-banner.tod-evening { background: linear-gradient(135deg, #2a3454 0%, #161d33 60%, #0b0f1e 100%); }
.greeting-fx { position: absolute; inset: 0; overflow: hidden; z-index: 1; }
.greeting-sun { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: #fff3cf; right: 12px; top: 10px; animation: greetingBob 4s ease-in-out infinite alternate; }
.greeting-moon { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #eef0f7; right: 14px; top: 10px; }
.greeting-cloud { position: absolute; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.5); animation: greetingDrift 8s linear infinite; }
.greeting-star { position: absolute; border-radius: 50%; background: #fff; animation: greetingTwinkle 2.4s ease-in-out infinite; }
@keyframes greetingBob { 0% { transform: translateY(0); } 100% { transform: translateY(-4px); } }
@keyframes greetingDrift { 0% { transform: translateX(0); } 100% { transform: translateX(-12px); } }
@keyframes greetingTwinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .greeting-sun, .greeting-cloud, .greeting-star { animation: none; } }

.fleet-stat { padding: 14px; text-decoration: none; display: block; border-width: 2px; transition: transform .1s; }
.fleet-stat:active { transform: scale(0.98); }
.fleet-stat .num { font-size: 22px; }
.fleet-stat .label { font-size: 12px; }
.fleet-stat-yellow { border-color: var(--amber); }
.fleet-stat-yellow .num { color: var(--amber); }
.fleet-stat-green { border-color: var(--green); }
.fleet-stat-green .num { color: var(--green); }
.fleet-stat-blue { border-color: var(--cyan); }
.fleet-stat-blue .num { color: var(--cyan); }
.fleet-stat-red { border-color: var(--red); }
.fleet-stat-red .num { color: var(--red); }
.fleet-stat.active { background: var(--badge-rented-bg); }
@media (max-width: 560px) { .fleet-status-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
/* Payback's Invested/Recovered/Remaining tiles (2026-07-25) can run to
   7-8 digits plus cents ("$1,446,510.00") — at the base 22px this wrapped to
   two lines in the 2-column mobile grid above, which the owner flagged as
   hard to read (2026-09-06). Fleet Status's own tiles are short counts
   ("4") and never hit this, so this only bites the money tiles in practice;
   scoping it to the same breakpoint as the grid change above keeps desktop
   untouched, where there's room to spare. */
@media (max-width: 560px) { .fleet-stat .num { font-size: 16px; white-space: nowrap; } }
.investor-usd-grid { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 4px; color: var(--text); font-size: 14px; }

.investor-range-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text);
  font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.investor-range-pill:hover { border-color: var(--accent); }
.investor-range-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.investor-range-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.investor-range-apply { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
@media (max-width: 480px) { .investor-range-pill { padding: 5px 10px; font-size: 11px; } }

.investor-hero { border-radius: 16px; overflow: hidden; margin-bottom: 18px; }
.investor-hero .investor-greeting-banner { margin-bottom: 0; border-radius: 0; }
.investor-hero-stats {
  position: relative;
  background: var(--card); color: var(--text); padding: 18px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
[data-theme="dark"] .investor-hero-stats { background: linear-gradient(160deg, #2a211a 0%, #1c1713 65%, #14100d 100%); color: #fff; }
.investor-hero-stat-main { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 2px; }
.investor-hero-stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
[data-theme="dark"] .investor-hero-stat-label { color: rgba(255, 255, 255, 0.62); }
.investor-hero-stat-num { font-family: var(--font-mono); font-size: 30px; font-weight: 700; line-height: 1.15; }
[data-theme="dark"] .investor-hero-stat-num .amt-pos { color: #5fe093; }
[data-theme="dark"] .investor-hero-stat-num .amt-neg { color: #ff9186; }
.investor-hero-trend { display: inline-flex; align-items: center; gap: 4px; width: fit-content; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); margin-top: 6px; }
.investor-hero-trend.up { background: var(--badge-available-bg); color: var(--green); }
.investor-hero-trend.down { background: var(--flash-error-bg); color: var(--red); }
[data-theme="dark"] .investor-hero-trend.up { background: rgba(63, 189, 119, 0.2); color: #5fe093; }
[data-theme="dark"] .investor-hero-trend.down { background: rgba(226, 86, 74, 0.2); color: #ff9186; }
.investor-hero-sparkline { position: relative; z-index: 2; flex-shrink: 0; line-height: 0; color: var(--muted); }
[data-theme="dark"] .investor-hero-sparkline { color: #fff; }
.investor-hero-date { position: absolute; right: 18px; bottom: 14px; z-index: 1; text-align: right; }
.investor-hero-date-label { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.investor-hero-date-num { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--text); margin-top: 2px; }
[data-theme="dark"] .investor-hero-date-label { color: rgba(255, 255, 255, 0.4); }
[data-theme="dark"] .investor-hero-date-num { color: rgba(255, 255, 255, 0.55); }
@media (max-width: 560px) {
  .investor-hero-stats { flex-direction: column; align-items: flex-start; }
  .investor-hero-sparkline svg { width: 130px; height: 40px; }
}

.investor-tabbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 18px; }
@media (max-width: 560px) { .investor-tabbar { grid-template-columns: repeat(2, 1fr); } }
.investor-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 9px 10px; border-radius: var(--r-lg); border: 1px solid var(--border-strong);
  background: var(--card); color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none;
}
.investor-tab:hover { border-color: var(--accent); color: var(--text); }
.investor-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.investor-tab-panel { display: none; }
.investor-tab-panel.active { display: block; }
.investor-payback-ring-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.investor-payback-ring { flex-shrink: 0; line-height: 0; }

/* ============================================================== PRINT ==== */
@media print {
  .topbar, .sidebar, .btn-row, .filters, .trip-search-form { display: none !important; }
  .app-body { display: block; }
  .container { max-width: none; padding: 0; }
  .card { border-color: #ccc; box-shadow: none; break-inside: avoid; }
  body { background: #fff; color: #000; }
}
