/* ═══════════════════════════════════════════
   CSS VARIABLES & THEME
═══════════════════════════════════════════ */
:root {
  /* Brand coral, from the app icon's orange car — kept for the few things
     you act on: primary buttons, the active nav item and the sign-in screen.
     --brand is the bright glow; --brand-fill the deeper shade that holds 4.5:1
     under white text; --brand-ink the coral for text/icons (bright in dark).
     Everything that only shows state (selected chips, today, tabs, links,
     calendar events, charts) stays on the calm blue --primary, so coral never
     gets confused with the red of returns and overdue. --primary-ink is that
     blue for text, icons and focus rings, lifted in dark mode to stay legible. */
  --brand: #f4704a;
  --brand-deep: #d9461f;
  --brand-fill: #cf4a20;
  --brand-fill-hover: #b93a16;
  --brand-ink: var(--brand-fill);
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-ink: var(--primary);
  --success: #16a34a;
  --success-light: #f0fdf4;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --info: #0891b2;
  --info-light: #ecfeff;

  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;
  --bg-secondary: #f8fafc;   /* subtle inset surface (strips, info boxes) */
  --bg-soft: #f1f5f9;        /* soft empty-state / placeholder panels */
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: var(--brand);
  --sidebar-active-bg: rgba(244,112,74,0.14);
  --sidebar-hover: rgba(255,255,255,0.06);
  --sidebar-width: 88px;

  --topbar-h: 60px;
  --mobile-nav-h: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);

  --transition: 0.15s ease;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1); /* quick settle, no bounce — the sign-in card's curve */
  /* Apple's own font on iPhone and Mac; each other device uses its system font. */
  --font: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: var(--font);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #253348;
  --bg-secondary: #253348;   /* subtle inset surface (strips, info boxes) */
  --bg-soft: #1b2536;        /* soft empty-state / placeholder panels */
  --border: #334155;
  --border-strong: #475569;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --primary-light: rgba(37,99,235,0.15);
  --primary-ink: #60a5fa;
  --brand-ink: var(--brand);
  --success-light: rgba(22,163,74,0.15);
  --danger-light: rgba(220,38,38,0.15);
  --warning-light: rgba(217,119,6,0.15);
  --info-light: rgba(8,145,178,0.15);
}

/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
a { text-decoration: none; color: inherit; }
a.entity-link:hover { text-decoration: underline; opacity: .8; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* Display face — Space Grotesk carries titles and the big numbers, as it does
   the wordmark on the sign-in screen; Inter keeps everything else. */
.section-title, .card-title, .modal-header h3, .sidebar-logo-text {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.kpi-value, .pulse-num, .stat-value, .settlement-value {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════
   AUTH SCREEN
═══════════════════════════════════════════ */
/* Night-time lot seen from above, echoing the app icon: painted bay lines
   along the top and bottom edges, a warm glow where the orange car parks.
   Dark in both themes; the surface tokens are redefined here so the card and
   fields go dark with it. */
#auth-screen {
  --lot: #0b1220;
  --lot-2: #131d33;
  --glow-hot: rgba(244,112,74,0.16);
  --glow-cool: rgba(59,92,170,0.22);
  --bay-line: rgba(255,255,255,0.07);
  --wordmark: #f8fafc;
  --tagline: #94a3b8;
  --bg-card: #121b2e;
  --bg-secondary: #0b1322;
  --bg-hover: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.12);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --danger: #fca5a5;
  --danger-light: rgba(239,68,68,0.14);
  color-scheme: dark;
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(2rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(60% 38% at 50% 18%, var(--glow-hot), transparent 70%),
    radial-gradient(80% 50% at 50% 110%, var(--glow-cool), transparent 70%),
    linear-gradient(180deg, var(--lot) 0%, var(--lot-2) 100%);
  overflow: hidden;
}
#auth-screen::before,
#auth-screen::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 120px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, var(--bay-line) 0 2px, transparent 2px) calc(50% - 42px) 0 / 84px 100% repeat-x;
}
#auth-screen::before {
  top: 0;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%);
          mask-image: linear-gradient(180deg, transparent, #000 60%);
}
#auth-screen::after {
  bottom: 0;
  -webkit-mask-image: linear-gradient(0deg, transparent, #000 60%);
          mask-image: linear-gradient(0deg, transparent, #000 60%);
}
/* Paint the page behind the login dark too, so Safari tints its toolbars to
   match instead of showing the app's light background. */
html:has(#auth-screen:not([style*="none"])),
body:has(#auth-screen:not([style*="none"])) { background: #0b1220; }
.auth-wrap {
  width: 100%;
  max-width: 392px;
  animation: authRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes authRise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-logo-icon {
  display: inline-flex;
  width: 72px;
  height: 72px;
  margin-bottom: 1rem;
}
.auth-logo-icon svg {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 12px 28px -6px rgba(0,0,0,0.6),
    0 18px 50px -12px rgba(244,112,74,0.35);
}
.auth-logo h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--wordmark);
}
.auth-logo p {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tagline);
}
.auth-logo p::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 10px rgba(244,112,74,0.8);
}
.auth-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.07),
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 24px 60px -16px rgba(0,0,0,0.6);
}
.auth-form h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.auth-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0.3rem 0 1.5rem;
}
.auth-form .form-group label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}
/* 16px text keeps iOS Safari from zooming into the field on focus. */
.auth-form input[type="text"],
.auth-form input[type="password"] {
  height: 50px;
  padding: 0 0.95rem;
  font-size: 1rem;
  border-radius: 12px;
  background: var(--bg-secondary);
  border-color: var(--border-strong);
}
.auth-form input::placeholder { color: #64748b; }
/* Keep autofilled fields dark (WebKit paints them pale yellow otherwise). */
.auth-form input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 100px var(--bg-secondary) inset;
}
.auth-form input:focus {
  background: var(--bg-card);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(244,112,74,0.16);
}
.auth-pwd { position: relative; }
.auth-form .auth-pwd input { padding-right: 3.25rem; }
.auth-pwd-toggle {
  position: absolute;
  top: 5px; right: 5px; bottom: 5px;
  width: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  transition: background-color var(--transition), color var(--transition);
}
.auth-pwd-toggle:hover { background: var(--bg-hover); color: var(--text); }
/* The app-wide focus rings (blue, 8px radius) are restated in brand orange so
   they keep this screen's shapes. */
#auth-screen input:focus-visible { outline: none; border-radius: 12px; }
#auth-screen .auth-pwd-toggle:focus-visible {
  outline: none;
  border-radius: 9px;
  box-shadow: 0 0 0 2px var(--brand);
}
.auth-pwd-toggle svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.auth-pwd-toggle .eye-shut,
.auth-pwd-toggle[aria-pressed="true"] .eye-open { display: none; }
.auth-pwd-toggle[aria-pressed="true"] .eye-shut { display: block; }
.auth-error {
  margin: -0.25rem 0 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--danger-light);
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 500;
}
.auth-submit {
  justify-content: center;
  height: 52px;
  margin-top: 0.5rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 8px 20px -6px rgba(217,70,31,0.55);
}
.auth-submit:hover { filter: brightness(1.06); }
.auth-submit:active { transform: translateY(1px) scale(0.99); }
#auth-screen .auth-submit:focus-visible {
  outline: none;
  border-radius: 12px;
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--brand);
}
@media (min-width: 480px) {
  .auth-card { padding: 2rem 2rem 1.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-wrap { animation: none; }
}

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
#app {
  display: flex;
  min-height: 100vh;
}
#sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}
#main {
  flex: 1;
  min-width: 0; /* flex items refuse to shrink below their content's intrinsic
    width by default (min-width:auto) — without this, any sufficiently wide
    content (e.g. a wide table) can push #main/#content past the viewport
    instead of clipping/wrapping as expected. */
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
#content {
  flex: 1;
  min-width: 0; /* same trap one level down — #content is a flex item too */
  padding: 1.5rem;
  overflow-y: auto;
}
#mobile-nav { display: none; }

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-logo-icon { width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.sidebar-logo-text { font-size: 1rem; font-weight: 700; color: #fff; }
.nav-list { padding: 0.75rem 0; flex: 1; }
.nav-list li { margin: 2px 8px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active { background: var(--sidebar-active-bg); color: var(--sidebar-active); }
/* Nav feedback: icons squish under a press, and the newly active tab's icon
   gives one small pop. Toggling .active to the value it already has doesn't
   restart the animation, so same-page re-renders leave it alone. */
.nav-link svg, .mob-link svg { transition: transform .14s var(--ease-spring); }
.nav-link:active svg, .mob-link:active svg { transform: scale(.86); }
.nav-link.active svg, .mob-link.active svg { animation: nav-pop .42s var(--ease-spring); }
@keyframes nav-pop { 0% { transform: scale(.82); } 55% { transform: scale(1.1); } 100% { transform: none; } }
/* Lucide icon inside nav — <i data-lucide> becomes <svg> */
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 18px; height: 18px; }
.sidebar-footer {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-footer .nav-link { flex: 1; }
/* Sidebar actions (New / Export / theme) — mirror the removed top bar. Shown at
   all sizes: in the desktop & tablet rail, and in the phone slide-in drawer. */
.drawer-actions { display: block; border-top: 1px solid rgba(255,255,255,0.07); padding-top: 0.5rem; }
.drawer-actions .nav-link { width: 100%; background: none; border: none; cursor: pointer; font: inherit; text-align: left; }

/* Desktop sidebar: compact rail with the icon on top and a small label
   underneath (mirrors the phone bottom nav). Scoped to >1024px so the tablet
   icon-only rail and the mobile drawer keep their own layouts. */
@media (min-width: 1025px) {
  .sidebar-logo { flex-direction: column; gap: .3rem; padding: 1rem .25rem; justify-content: center; text-align: center; }
  .sidebar-logo-text { font-size: .7rem; }

  .nav-list li { margin: 2px 6px; }
  .nav-link { flex-direction: column; gap: .3rem; padding: .55rem .25rem; justify-content: center; text-align: center; }
  .drawer-actions .nav-link { text-align: center; }
  .nav-label { font-size: .62rem; line-height: 1.15; }
  .nav-icon, .nav-icon svg { width: 20px; height: 20px; }

  .sidebar-footer { flex-direction: column; gap: .4rem; padding: .6rem .25rem; }
  .sidebar-footer .nav-link { flex: none; width: 100%; }
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
/* Same build as the sign-in button: a top-lit coral face with a warm cast
   shadow, scaled down for the app's smaller buttons. Both gradient stops hold
   4.5:1 under white text. */
.btn-primary {
  background: linear-gradient(180deg, var(--brand-fill) 0%, var(--brand-fill-hover) 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 1px 2px rgba(185,58,22,0.22),
    0 3px 10px -4px rgba(207,74,32,0.4);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--brand-fill-hover) 0%, #a3310f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 1px 2px rgba(185,58,22,0.28),
    0 5px 14px -4px rgba(207,74,32,0.5);
}
/* The "on" state of toggle chips and segmented filters — a state, not an
   action, so it stays blue and flat. */
.btn-selected { background: var(--primary); color: #fff; }
.btn-selected:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon {
  background: none;
  border: none;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text); }
.btn-icon svg { width: 18px; height: 18px; }

/* Pressed feedback — transform only, no layout shift */
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-icon:active { transform: translateY(1px) scale(0.94); }

/* Keyboard focus: an offset double-ring (surface halo + brand ring) that stays
   legible on any background, including same-colored (primary) buttons and the
   dark sidebar. Mouse clicks don't trigger :focus-visible, so it's keyboard-only. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--primary-ink);
  border-radius: var(--radius-sm);
}
/* Checkboxes keep their accent fill; give them a crisp outline instead of a halo. */
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--primary-ink);
  outline-offset: 2px;
}

/* Respect users who reduce motion — neutralize transitions/animations globally. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════
   FORMS
═══════════════════════════════════════════ */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
/* Offer Maker date row (desktop/tablet): keep Pickup + Hour + Dropoff + Hour on
   one row, with the date inputs sized to content instead of filling the card. */
@media (min-width: 701px) {
}
input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="tel"], input[type="email"],
input[type="search"], input[type="url"], input[type="datetime-local"],
input[type="time"], input[type="month"], select, textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
textarea { resize: vertical; min-height: 80px; }
select option { background: var(--bg-card); }

/* Combo: a type-to-search box over a hidden <select> (Combo in vehicle-form.js). */
select.combo-native { display: none; }
.combo { position: relative; }
.combo .combo-input { padding-right: 2rem; text-overflow: ellipsis; }
.combo-caret {
  position: absolute; right: .6rem; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none; transition: transform var(--transition);
}
.combo-input[aria-expanded="true"] + .combo-caret { transform: rotate(180deg); }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  max-height: min(280px, 45vh); overflow-y: auto; overscroll-behavior: contain;
  margin: 0; padding: 4px; list-style: none;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 2px 4px rgba(15,23,42,.08), 0 12px 28px -8px rgba(15,23,42,.28);
}
.combo-list li {
  padding: .5rem .65rem; border-radius: 4px; font-size: .9rem; color: var(--text);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-list li.is-active { background: var(--bg-hover); }
.combo-list li[aria-selected="true"] { color: var(--primary); font-weight: 600; }
.combo-list li.combo-other { color: var(--text-muted); border-top: 1px solid var(--border); border-radius: 0 0 4px 4px; margin-top: 2px; }
.combo-list li.combo-other.is-active { color: var(--text); }
.combo-list li.combo-empty { color: var(--text-muted); font-size: .8rem; cursor: default; white-space: normal; }
@media (hover: hover) { .combo-list li[role="option"]:hover { background: var(--bg-hover); } }

/* ═══════════════════════════════════════════
   CARDS & SECTIONS
═══════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 0.95rem; font-weight: 600; }
.card-body { padding: 1.25rem; }

/* ═══════════════════════════════════════════
   STATS CARDS
═══════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .7rem;
  margin-bottom: 1rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--primary);
}
.stat-card.success::before { background: var(--success); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.info::before { background: var(--info); }
.stat-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.45rem; font-weight: 700; color: var(--text); margin: 0.15rem 0; line-height: 1.2; }
.stat-sub { font-size: 0.75rem; color: var(--text-muted); }

/* Slim variant — a summary row that shouldn't cost half a screen of height.
   Label, qualifier and number sit on one line instead of stacking. */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .5rem;
  margin-bottom: 1rem;
}
.stat-strip .stat-card {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .45rem .7rem .45rem .85rem;
}
/* The number is never the thing that gets clipped — the label truncates first. */
.stat-strip .stat-label {
  order: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-strip .stat-sub {
  order: 2;
  font-size: .68rem;
  /* The qualifier is the first thing to go when the card gets tight. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-strip .stat-value {
  order: 3;
  margin: 0 0 0 auto;
  font-size: 1.05rem;
  flex: 0 0 auto;
  white-space: nowrap;
}
/* A name or a month, not a number — it reads as a value, not a headline, and
   has to survive a long car name in a narrow card. */
.stat-strip .stat-value-text {
  font-size: .85rem;
  font-weight: 600;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════
   DASHBOARD — PULSE (now) + KPI (meaningful)
═══════════════════════════════════════════ */
.dash-pulse {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .6rem;
  margin-bottom: 1.1rem;
}
.pulse-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .05rem;
  align-items: flex-start;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .7rem .85rem;
  box-shadow: var(--shadow);
  font-family: inherit;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.pulse-tile::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
}
.pulse-tile.is-go::before    { background: var(--success); }
.pulse-tile.is-alert::before { background: var(--danger); }
.pulse-tile.is-money::before { background: var(--warning); }
.pulse-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.pulse-tile:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; }
.pulse-ico { position: absolute; top: .55rem; right: .6rem; color: var(--text-light); display: inline-flex; }
.pulse-ico i, .pulse-ico svg { width: 17px; height: 17px; }
/* Number and label share the first line (they wrap only when the number is
   too wide, like a money total); the detail line goes under them. */
.pulse-tile { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: .45rem; }
.pulse-tile .pulse-meta { flex-basis: 100%; }
.pulse-tile .pulse-label { padding-right: 1.4rem; }
.pulse-num {
  font-size: 1.55rem;
  font-weight: 750;
  line-height: 1.15;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pulse-tile.is-alert .pulse-num { color: var(--danger); }
.pulse-tile.is-money .pulse-num { color: var(--warning); }
.pulse-tile.is-go .pulse-num    { color: var(--success); }
.pulse-label { font-size: .8rem; font-weight: 600; color: var(--text); }
.pulse-meta  { font-size: .7rem; color: var(--text-muted); }

.dash-section-head { display: flex; align-items: center; gap: .6rem; margin: .25rem 0 .5rem; flex-wrap: wrap; }
.dash-scope-pill { font-size: .75rem; background: var(--primary); color: #fff; padding: 2px 10px; border-radius: 999px; }
.dash-scope { font-size: .75rem; color: var(--text-muted); }

/* Phones: the four core tiles make a 2×2; the occasional extra tile (owner
   requests, website misses) takes a full row instead of leaving a gap. */
@media (max-width: 560px) {
  .dash-pulse { grid-template-columns: 1fr 1fr; }
  .dash-pulse .pulse-wide, #dash-requests > .pulse-tile { grid-column: 1 / -1; }
}

/* Next 7 days: a table on wide screens, two-line rows on phones. */
.dash-actions { margin-bottom: 1.25rem; }
.dash-actions-list { display: none; }
.dash-act-row {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .6rem 1rem; background: none; border: 0; border-top: 1px solid var(--border);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.dash-act-row:first-child { border-top: 0; }
.dash-act-row:active { background: var(--bg-hover, rgba(148,163,184,.08)); }
.dash-act-type {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.dash-act-type.handout { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.dash-act-type.return  { color: var(--danger);  background: color-mix(in srgb, var(--danger) 14%, transparent); }
.dash-act-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-act-car  { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-act-meta { font-size: .76rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-act-amt  { flex: 0 0 auto; font-weight: 600; font-size: .85rem; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .dash-actions-wide { display: none; }
  .dash-actions-list { display: block; }
}

/* Overview goals: "View all" stays on the title line — and these dashboard
   cards keep title and count side by side on phones, where card headers stack. */
.dash-goals .card-header, .dash-actions .card-header, .today-banner .card-header, .forecast-card .card-header {
  flex-direction: row; align-items: center; flex-wrap: nowrap;
}
.dash-goals .card-title, .dash-actions .card-title { min-width: 0; }
.dash-goals-all { flex: 0 0 auto; font-size: .82rem; font-weight: 600; color: var(--primary-ink); text-decoration: none; white-space: nowrap; }
.dash-goals-all:hover { text-decoration: underline; }
.dash-goals-all:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; border-radius: 4px; }

/* Phones: a half-width KPI card can't hold its label and the comparison on one
   line — the comparison moves under the number instead. */
@media (max-width: 560px) {
  .kpi-card:not(.kpi-hero) .kpi-top { display: contents; }
  .kpi-card:not(.kpi-hero) .kpi-label { order: 0; }
  .kpi-card:not(.kpi-hero) .kpi-value { order: 1; }
  .kpi-card:not(.kpi-hero) .kpi-delta { order: 2; white-space: normal; flex-wrap: wrap; row-gap: 0; }
  .kpi-card:not(.kpi-hero) .kpi-foot  { order: 3; }
  /* Hero + three cards: the third takes the full row instead of sitting alone. */
  .kpi-grid > .kpi-card:last-child:nth-child(even) { grid-column: 1 / -1; }
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: .7rem;
  margin-bottom: 1.25rem;
}
.kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 110px;
}
.kpi-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border-strong);
}
.kpi-card.accent-info::before    { background: var(--info); }
.kpi-card.accent-success::before { background: var(--success); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 1rem; }
.kpi-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.kpi-value {
  font-size: 1.6rem;
  font-weight: 750;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.kpi-hero .kpi-value { font-size: 2.15rem; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem; margin-top: auto; }
.kpi-sub { font-size: .72rem; color: var(--text-muted); }
.kpi-delta { font-size: .72rem; font-weight: 600; display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.kpi-delta-lbl { color: var(--text-light); font-weight: 500; font-size: .68rem; }
.kpi-spark { flex-shrink: 0; }
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-hero { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .kpi-hero { grid-column: 1 / -1; }
  .kpi-value { font-size: 1.4rem; }
  .kpi-hero .kpi-value { font-size: 1.8rem; }
  .pulse-num { font-size: 1.35rem; }
}

/* Entrance motion — plays only while Router has .view-enter on #content,
   i.e. when the page changes; saves, filter clicks and syncs re-render
   without it, so nothing replays. The keyframes give only a start state, so
   each element settles to its own resting look (a cancelled rental stays
   dimmed), and the backwards fill lets go once it ends, so hover lifts work. */
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 700px) {
  #content { touch-action: pan-y pinch-zoom; }
  /* Rental lists are cards on a phone, so a sideways swipe on them changes tab. */
  .table-wrap:has(> .res-table) { touch-action: pan-y pinch-zoom; }
}
#content.view-enter > * { animation: riseIn .16s var(--ease-spring) backwards; }
#content.view-enter :is(.dash-pulse .pulse-tile, .kpi-grid .kpi-card, .stats-grid .stat-card,
  .vehicle-card, .owner-card, .offer-card, #res-table-wrap .res-row) {
  animation: riseIn .2s var(--ease-spring) backwards;
}
#content.view-enter :is(.pulse-tile, .kpi-card, .stat-card, .vehicle-card, .owner-card, .offer-card, .res-row):nth-child(2)  { animation-delay: 10ms; }
#content.view-enter :is(.pulse-tile, .kpi-card, .stat-card, .vehicle-card, .owner-card, .offer-card, .res-row):nth-child(3)  { animation-delay: 20ms; }
#content.view-enter :is(.pulse-tile, .kpi-card, .stat-card, .vehicle-card, .owner-card, .offer-card, .res-row):nth-child(4)  { animation-delay: 30ms; }
#content.view-enter :is(.pulse-tile, .kpi-card, .stat-card, .vehicle-card, .owner-card, .offer-card, .res-row):nth-child(5)  { animation-delay: 40ms; }
#content.view-enter :is(.pulse-tile, .kpi-card, .stat-card, .vehicle-card, .owner-card, .offer-card, .res-row):nth-child(6)  { animation-delay: 50ms; }
#content.view-enter :is(.pulse-tile, .kpi-card, .stat-card, .vehicle-card, .owner-card, .offer-card, .res-row):nth-child(7)  { animation-delay: 60ms; }
#content.view-enter :is(.pulse-tile, .kpi-card, .stat-card, .vehicle-card, .owner-card, .offer-card, .res-row):nth-child(8)  { animation-delay: 70ms; }
#content.view-enter :is(.pulse-tile, .kpi-card, .stat-card, .vehicle-card, .owner-card, .offer-card, .res-row):nth-child(n+9) { animation-delay: 80ms; }
/* KPI sparklines draw themselves left to right (the polyline has
   pathLength="1"), the area fill washes in under them, and the end dot lands
   last — all inside the second .view-enter is held. */
#content.view-enter .kpi-spark polyline { stroke-dasharray: 1; animation: spark-draw .7s .18s cubic-bezier(.4, 0, .2, 1) backwards; }
#content.view-enter .kpi-spark polygon  { animation: spark-fade .45s .4s ease backwards; }
#content.view-enter .kpi-spark circle   { transform-box: fill-box; transform-origin: center; animation: spark-dot .3s .66s var(--ease-spring) backwards; }
@keyframes spark-draw { from { stroke-dashoffset: 1; } }
@keyframes spark-fade { from { opacity: 0; } }
@keyframes spark-dot  { from { transform: scale(0); } }

/* Static pulse tiles (non-clickable summaries: Offer Maker, Fleet glance) */


/* Shared summary cards — adopt the refined dashboard polish everywhere they appear
   (Reports, Finance, Goals, owner & vehicle detail) */
.stat-card { transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat-value { font-variant-numeric: tabular-nums; }
.settlement-card { transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.settlement-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.settlement-value { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .stats-grid .stat-card { animation: none; } }

/* ═══════════════════════════════════════════
   TABLES
═══════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead th {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.45rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody td {
  padding: 0.4rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr {
  transition: background var(--transition);
}
tbody tr:hover { background: var(--bg-hover); }
tbody tr:hover td:first-child {
  box-shadow: inset 2px 0 0 var(--primary);
}

/* Finance by-vehicle: full treatment (most cramped) */
.finance-vehicle-table thead th { padding: 0.45rem 0.5rem; font-size: 0.68rem; }
.finance-vehicle-table tbody td { padding: 0.4rem 0.5rem; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.finance-vehicle-table tbody td:nth-child(2),
.finance-vehicle-table thead th:nth-child(2) { white-space: nowrap; min-width: 110px; }
.finance-vehicle-table tbody td:nth-child(3),
.finance-vehicle-table thead th:nth-child(3) { white-space: nowrap; }
/* Right-align all numeric columns (from col 4 = Rentals onward) */
.finance-vehicle-table thead th:nth-child(n+4),
.finance-vehicle-table tbody td:nth-child(n+4) { text-align: right; }
.finance-vehicle-table .booked-stack { line-height: 1.15; }
.finance-vehicle-table .booked-stack .booked-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}


/* Finance by-month */
.finance-month-table tbody td { padding: 0.4rem 0.6rem; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.finance-month-table thead th { padding: 0.45rem 0.6rem; }
.finance-month-table thead th:nth-child(n+2),
.finance-month-table tbody td:nth-child(n+2) { text-align: right; }

/* Per-row expanded reservation list (Finance detail) */
.finance-detail-table td { padding: 0.35rem 0.5rem; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.finance-detail-table th { padding: 0.4rem 0.5rem; font-size: 0.68rem; }

/* ── Reports: horizontal-scroll affordance ── */
/* A subtle right-edge fade hints the wide finance tables can be scrolled. */
.table-wrap { position: relative; }
.table-wrap::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--bg-card, var(--bg)));
  opacity: 0;
  transition: opacity var(--transition);
}
.table-wrap.is-scrollable::after { opacity: 1; }

/* ── Reports: util% color key (By Vehicle header) ── */
.util-key { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.util-key-dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; }

/* Dashboard actions table */
.dash-actions-table tbody td { padding: 0.4rem 0.6rem; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.dash-actions-table thead th { padding: 0.45rem 0.6rem; }
.dash-actions-table tbody td:nth-child(1) { white-space: nowrap; }

/* Fleet calendar: nudge header padding only */
.fleet-table thead th { padding: 0.4rem 0.4rem; }

/* Improved Reservations Table */
.res-table { font-size: 0.85rem; }
.res-table thead th {
  cursor: pointer;
  padding: 0.6rem 0.6rem;
  border-bottom: 2px solid var(--border-strong);
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.res-table thead th:hover { background: var(--bg-hover); }
.res-table tbody tr { transition: background-color var(--transition), color var(--transition); }
.res-row:hover { background: var(--primary-light) !important; }
.res-row:active { background: var(--primary-light) !important; }
.res-row { -webkit-tap-highlight-color: transparent; }
.res-row-selected { background: rgba(37,99,235,0.08) !important; }
.res-row-selected:hover { background: rgba(37,99,235,0.14) !important; }
.res-row-overdue { border-left: 3px solid var(--warning); }
.res-new-badge { margin-left: .4rem; padding: .1rem .45rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }
.res-row-cancelled { opacity: .55; }
.res-row-cancelled .res-date strong,
.res-row-cancelled .res-vehicle strong,
.res-row-cancelled .res-client > div { text-decoration: line-through; text-decoration-color: var(--danger); }
.res-group-header td {
  background: var(--bg);
  padding: .25rem .75rem;
  cursor: pointer;
  user-select: none;
  border-top: 2px solid var(--border);
}
.res-group-header:hover td { background: var(--border); }
.res-group-label {
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.res-group-count {
  margin-left: .5rem;
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 400;
}
.res-row-overdue td:first-child { padding-left: 0.6rem; }
.res-row td { padding: 0.4rem 0.6rem; font-variant-numeric: tabular-nums; }
.res-date { min-width: 110px; font-weight: 600; white-space: nowrap; }
.res-vehicle { min-width: 130px; font-weight: 600; white-space: nowrap; }
.res-client { min-width: 140px; }
.res-actions {
  text-align: center;
  white-space: nowrap;
}
.res-actions > * { margin: 0 0.1rem; vertical-align: middle; }
.btn-xs { padding: 0.35rem 0.5rem; font-size: 0.75rem; }

/* Profit colors */
.profit-positive { color: var(--success); font-weight: 600; }
.profit-negative { color: var(--danger); font-weight: 600; }

/* Owner Detail View */
.owner-header {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.owner-header-top { margin-bottom: 1rem; }
.owner-header-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.owner-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.owner-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.owner-tab {
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
.owner-tab:hover { color: var(--text); }
.owner-tab.active {
  color: var(--primary-ink);
  border-bottom-color: var(--primary);
}

/* Vehicle Management Grid */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.vehicle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  position: relative;
  overflow: hidden;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.vehicle-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ── Vehicles-tab card restyle (scoped so the owner-detail Fleet list is untouched) ── */
/* Wider than the default grid: the name is the thing you scan by, and at 260px
   anything longer than "Polo" was ellipsized away. Capped at four across
   (the min is never under a quarter of the row) so wide laptop screens give
   each card more room for the name instead of squeezing in a fifth. */
.vehicle-grid.vehicles-manage {
  grid-template-columns: repeat(auto-fill, minmax(max(300px, calc((100% - 3rem) / 4)), 1fr));
}
/* Chosen "per row" count (Vehicles header picker) — desktop only. */
.fleet-cols-picker { display: flex; align-items: center; gap: .2rem; flex-shrink: 0; }
.fleet-cols-picker > span { font-size: .75rem; color: var(--text-muted); margin-right: .2rem; }
@media (min-width: 900px) {
  .vehicle-grid.vehicles-manage.has-cols { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
}
/* Fewer, wider cards -> a bigger photo. */
@media (min-width: 900px) {
  .vehicles-manage.cols-3 .vehicle-card .veh-thumb { flex-basis: 112px; width: 112px; height: 84px; border-radius: 8px; }
  .vehicles-manage.cols-4 .vehicle-card .veh-thumb { flex-basis: 88px; width: 88px; height: 66px; }
}
/* Offer Maker grid follows the Fleet tab's per-row choice. */
@media (min-width: 900px) {
  .offer-grid.has-cols { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
  .offer-grid.cols-3 .veh-thumb { flex-basis: 112px; width: 112px; height: 84px; border-radius: 8px; }
  .offer-grid.cols-4 .veh-thumb { flex-basis: 88px; width: 88px; height: 66px; }
}
@media (min-width: 900px) {
  .offer-card { padding: .9rem 1rem; gap: .6rem; }
  .offer-card-head { align-items: flex-start; justify-content: flex-start; gap: .85rem; margin-bottom: 0; }
  .offer-photo { position: relative; flex: 0 0 auto; }
  .offer-photo .offer-select {
    position: absolute; top: 6px; left: 6px; z-index: 2;
    padding: 4px; border-radius: 6px; background: rgba(15,23,42,.55); backdrop-filter: blur(4px);
  }
  .offer-card-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
  .offer-card-main .offer-card-id { flex: 0 0 auto; }
  .offer-card-main .offer-card-id strong { font-size: .95rem; }
  .offer-card-main .offer-total { font-size: 1.1rem; }
  .offer-card-foot { margin-top: auto; justify-content: stretch; flex-wrap: nowrap; gap: .5rem; padding-top: .15rem; }
  .offer-card-foot .offer-reserve { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 899px) {
  .offer-photo { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
  .offer-card-main { flex: 1 1 auto; min-width: 0; }
  /* Phones keep the buttons beside the name (a footer row would double the card's height). */
  .offer-card { position: relative; }
  .offer-card-foot { position: absolute; top: .65rem; right: .75rem; flex-wrap: nowrap; }
  .offer-card-main { padding-right: 8.5rem; }
  .offer-card-booked .offer-card-main { padding-right: 11.5rem; }
  .fleet-cols-picker { display: none; }
}
.vehicles-manage .vehicle-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.9rem 1rem 0.85rem;
}
.vehicle-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
/* Takes every pixel the status pill doesn't need, so the name is the last
   thing to truncate rather than the first. */
.vehicle-card-heading {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
}
.vehicle-card-name {
  flex: 0 1 auto;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Owner gets its own line under the name — secondary, and never competing. */
.vehicle-card-owner {
  margin: 0.2rem 0 0 calc(14px + 0.45rem); /* line up with the name, past the swatch */
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* soft-tinted status pill */
.vstatus {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.vstatus-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vstatus--available   { color: var(--success); background: var(--success-light); }
.vstatus--inuse       { color: var(--warning); background: var(--warning-light); }
.vstatus--maintenance { color: var(--warning); background: var(--warning-light); }
.vstatus--inactive    { color: var(--text-muted); background: var(--bg-secondary); }

/* 3-up stat strip */
.vehicle-stats, .owner-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0.75rem 0;
  padding: 0.55rem 0.25rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}
.vstat, .ostat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  text-align: center;
  min-width: 0;
}
.vstat + .vstat, .ostat + .ostat { border-left: 1px solid var(--border); }
.vstat-val, .ostat-val { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.vstat-lbl, .ostat-lbl {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.vehicle-card-header {
  margin-bottom: 1rem;
  padding-top: 0.25rem;
}
.vehicle-card-header h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 700;
}
.vehicle-card-header > span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.vehicle-swatch {
  display: inline-block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.label {
  font-weight: 600;
  color: var(--text);
}

.vehicle-card-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
/* pin footer to the bottom so rows line up */
.vehicles-manage .vehicle-card-actions {
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}
/* Status picker sizes to its own text; the buttons hold the right edge. */
.vehicles-manage .vehicle-status-select { flex: 0 1 auto; }
.vehicle-card-icons {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}
.vehicle-status-select {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
}

/* Settlement Workflow */
.settlement-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.settlement-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.settlement-card.total {
  border-left: 4px solid var(--danger);
  background: rgba(220, 38, 38, 0.03);
}
.settlement-card.info {
  border-left: 4px solid var(--info);
  background: rgba(8, 145, 178, 0.03);
}

.settlement-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.settlement-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.settlement-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}
@media (max-width: 700px) {
  .settlement-summary { gap: .5rem; margin-bottom: 1rem; }
  .settlement-card { text-align: left; padding: .6rem .8rem; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .5rem; }
  .settlement-label { margin: 0; font-size: .7rem; flex-basis: 100%; }
  .settlement-value { font-size: 1.35rem; margin: 0; }
  .settlement-sub { font-size: .72rem; }
}

.settlement-owner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.settlement-owner-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.settlement-owner-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--danger);
}

.settlement-owner-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.settlement-table {
  font-size: 0.85rem;
}

.settlement-row:hover {
  background: var(--primary-light) !important;
}

.settlement-row td {
  padding: 0.45rem 1rem;
}

.finance-detail-table {
  width: 100%;
  font-size: 0.82rem;
  border-collapse: collapse;
}
.finance-detail-table thead th {
  padding: 0.3rem 0.5rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-transform: none;
  letter-spacing: 0;
  position: static;
}
.finance-detail-table tbody td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   BADGES
═══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger);  }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info);    }

/* ═══════════════════════════════════════════
   MODAL
═══════════════════════════════════════════ */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
  animation: backdrop-in .2s ease;
}
/* The copy of a closing pop-up (Utils._modalGhost): leaves the way it came. */
#modal-overlay.modal-ghost { pointer-events: none; animation: backdrop-out .18s ease forwards; }
.modal-ghost #modal-box { animation: modal-out .18s ease-in forwards; }
@keyframes backdrop-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: scale(0.96) translateY(10px); } }
@keyframes modal-down { to { opacity: 0; transform: translateY(36px); } }
#modal-box {
  background: var(--bg-card);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.34s var(--ease-spring);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes modal-up {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: none; }
}
#modal-box.wide { max-width: 780px; }
/* Clicking outside a form modal doesn't close it — the box bounces instead, so
   the click reads as "heard you, not closing" rather than as a frozen app. */
#modal-box.modal-nudge { animation: modal-nudge 0.3s ease; }
@keyframes modal-nudge {
  0%, 100% { transform: scale(1); }
  40%      { transform: scale(1.015); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
#modal-body { padding: 1.5rem; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

/* ═══════════════════════════════════════════
   RIHLADRIVE LISTING EDITOR — photo grid
   Only the states inline styles can't express live here: hover, focus-visible,
   and the drag pseudo-states. Everything else stays inline, per house style.
═══════════════════════════════════════════ */
/* Until you're signed in to the website, every field is disabled — say so
   visually, or the form looks editable and silently isn't. */
.rf-edit input:disabled,
.rf-edit select:disabled,
.rf-edit textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-soft);
}
.rf-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.rf-empty {
  grid-column: 1 / -1;
  padding: 1.1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}
.rf-ph {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  cursor: grab;
}
.rf-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rf-ph-blank { width: 100%; height: 100%; background: var(--bg-soft); }
.rf-ph.drag-over { outline: 2px solid var(--primary-ink); outline-offset: -2px; }
.rf-ph.rf-ph-busy { cursor: default; opacity: 0.65; }
/* The cover badge earns the accent colour: imgs[0] is what the website and every
   WhatsApp preview actually show. */
.rf-ph-num {
  position: absolute; top: 4px; left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.65rem; font-weight: 600; line-height: 1.5;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
}
.rf-ph-num.first { background: var(--primary); }
.rf-ph-prog {
  position: absolute; inset: auto 0 0 0;
  padding: 3px 6px;
  font-size: 0.65rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
}
.rf-ph-bar {
  position: absolute; inset: auto 0 0 0;
  display: flex; align-items: stretch;
  opacity: 0;
  background: rgba(15, 23, 42, 0.78);
  transition: opacity 0.12s ease;
}
.rf-ph:hover .rf-ph-bar,
.rf-ph:focus-within .rf-ph-bar { opacity: 1; }
.rf-ph-bar button {
  flex: 1;
  min-height: 26px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0 2px;
}
.rf-ph-bar button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.18); }
.rf-ph-bar button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.rf-ph-bar button:disabled { opacity: 0.3; cursor: default; }
.rf-ph-bar .rf-ph-del:hover { background: var(--danger); }
/* Touch has no hover — keep the controls visible so reorder works on a phone. */
@media (hover: none) {
  .rf-ph-bar { opacity: 1; }
}
.rf-drop {
  display: flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.85rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
/* On the vehicle form the drop zone is a <label> inside a .form-group, whose
   label rule would shout it in uppercase. */
.form-group label.rf-drop {
  display: flex; text-transform: none; letter-spacing: 0; font-weight: 400;
  font-size: 0.8rem; margin: 0;
}
.rf-drop:hover:not(.rf-drop-off) { border-color: var(--primary); color: var(--primary-ink); }
.rf-drop.drag { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-light); }
.rf-drop:focus-within { outline: 2px solid var(--primary-ink); outline-offset: 2px; }
.rf-drop-off { cursor: not-allowed; opacity: 0.55; }

/* ═══════════════════════════════════════════
   CONFIRM DIALOG
═══════════════════════════════════════════ */
#confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-box {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.75rem;
  max-width: 360px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.confirm-box p { margin-bottom: 1.5rem; color: var(--text); }
.confirm-actions { display: flex; gap: 0.75rem; justify-content: center; }

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.1rem;
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toast-in 0.42s var(--ease-spring);
  transition: opacity 0.2s ease, transform 0.2s ease;
  min-width: 220px;
  max-width: 350px;
}
/* Set just before removal so the toast fades down and out instead of vanishing. */
.toast.leaving { opacity: 0; transform: translateY(6px) scale(0.98); }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--primary); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════
   SECTION HEADER
═══════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.section-title { font-size: 1rem; font-weight: 600; }
.section-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════
   SEARCH & FILTER BAR
═══════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
/* Filter chips are navigation, not actions — they get a quieter, denser box
   than a real button so a 15-owner strip costs one row instead of two. Phones
   deliberately override this further down: there a chip has to stay tappable. */
.filter-bar .btn-sm,
.fleet-controls .btn-sm {
  padding: .2rem .5rem;
  font-size: .72rem;
  line-height: 1.35;
  gap: .3rem;
}
/* Text/select controls in a filter strip grow to fill it; checkboxes must not
   (min-width:140px + flex:1 stretched them into 140px slabs). */
.filter-bar input:where(:not([type="checkbox"]):not([type="radio"])), .filter-bar select {
  width: auto;
  flex: 1;
  min-width: 140px;
  max-width: 220px;
}
.search-input { min-width: 200px !important; }

/* ── Reservation summary stats ── */
.res-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .35rem .7rem;
  min-width: 72px;
}

/* ── Reservations toolbar (search + dates + new button) ── */
.res-toolbar {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  max-width: 340px;
  min-width: 160px;
}
.search-wrap .search-ico {
  position: absolute;
  left: .7rem;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-wrap .search-input { flex: 1; padding-left: 2.2rem; }
.res-pills-inline { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.res-pills-inline .filter-bar { margin-bottom: 0; }
/* Group divider inside a filter bar. On a wrapped phone strip it reliably
   lands at the end of a row, where it reads as a rendering artifact. */
.fb-sep { opacity: .3; margin: 0 .1rem; align-self: center; }

.res-date-input { min-width: 130px; }
/* Keep 'Dates:' welded to its two inputs — as loose flex children the label
   orphaned onto the end of the owner-chip row while the inputs wrapped below. */
.res-date-group { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: nowrap; }
.res-date-arrow { color: var(--text-muted); flex-shrink: 0; }
.res-date-lbl { font-size: .75rem; color: var(--text-muted); margin-right: .15rem; }
.res-new-btn { white-space: nowrap; margin-left: auto; }
/* One "Any dates" field (the app's own range picker) in place of two empty boxes. */
.res-dates-btn { white-space: nowrap; }
.res-dates-btn.is-set { color: var(--primary-ink); border-color: var(--primary); }
.res-dates-clear { padding-left: .4rem; padding-right: .4rem; }
/* The dates are short and never wrap: the column takes only what they need,
   and the spare width goes to the car and the client. */
@media (min-width: 701px) { .res-table td.res-date { width: 1%; } }   /* phones lay rows out as cards — not there */
/* Rentals table: each title sits over its numbers. Length is centred like its
   cells. Every badge after a profit gets one width, so the amounts share a
   right edge and the Profit title sits above them (the cell's 1rem padding +
   badge + gap). Desktop only: phones lay rows out as cards. */
@media (min-width: 701px) {
  .res-table th.res-th-center { text-align: center; }
  #res-table-wrap .res-table th.res-th-profit { text-align: right; padding-right: calc(1rem + 4.6rem + .4rem); }
  .res-table td.res-profit .badge { min-width: 4.6rem; justify-content: center; }
}

/* ── Clients ── */
.clients-bar { display: flex; align-items: center; gap: .4rem .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.clients-search {
  flex: 1 1 220px; min-width: 0; max-width: 320px;
  padding: .45rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text); font: inherit; font-size: .85rem;
}
.clients-sort { width: auto; flex: 0 0 auto; padding: .35rem .6rem; font-size: .82rem; }
.clients-count { margin-left: auto; font-size: .82rem; color: var(--text-muted); white-space: nowrap; }
.clients-cards { display: none; }
.client-row {
  display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem;
  border-top: 1px solid var(--border); cursor: pointer;
}
.client-row:first-child { border-top: 0; }
.client-row:active { background: var(--bg-hover, rgba(148,163,184,.08)); }
.client-row:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: -2px; }
.client-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.client-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-name .badge { margin-left: .3rem; vertical-align: 1px; }
.client-meta { font-size: .76rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-wa {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; color: #25d366;
}
.client-wa i, .client-wa svg { width: 17px; height: 17px; }
@media (max-width: 700px) {
  .clients-search { flex-basis: 100%; max-width: none; }
  .clients-count { margin-left: 0; }
  .clients-sort { margin-left: auto; }
  .clients-table { display: none; }
  .clients-cards { display: block; }
}

/* ── Reservations filter bars ── */
.res-quick-bar {
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: .5rem;
}
.res-secondary-bar {
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: .75rem;
}
/* No margin-left:auto here — Excel already carries one, and two autos split
   the free space, stranding Filters in the middle of the row. */
.res-filter-count {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 0 .4rem;
  border-radius: 999px;
  margin-left: .25rem;
  min-width: 18px;
  text-align: center;
}


/* Sticky table header inside reservations card */
#res-table-wrap { position: relative; }
#res-table-wrap .res-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-card);
}

/* ── Dashboard filter bar ── */
.dash-filter-bar {
  margin-bottom: 1rem;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
}
/* Scoped to the bar for the same reason as .fleet-control-input: the base
   `input[type="date"]` rule carries an attribute selector and outweighs a lone
   class, so these fields were wearing .9rem text and .55rem padding inside a
   30px box. Chip metrics now, so the Range fields match the chips beside them. */
.dash-filter-bar .dash-date-input {
  height: auto;
  padding: .2rem .4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .72rem;
  line-height: 1.35;
  width: auto;
  max-width: 140px;
}

/* ── Dashboard goals row ── */
.dash-goal-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 0;
  border-top: 1px solid var(--border);
}
.dash-goal-label {
  font-size: .82rem;
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-goal-days {
  font-size: .72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.dash-goal-bar {
  width: 100px;
  flex-shrink: 0;
  background: var(--border);
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}
.dash-goal-pct {
  font-size: .8rem;
  font-weight: 700;
  min-width: 2.8rem;
  text-align: right;
}
.dash-goal-status {
  font-size: .75rem;
  min-width: 4.5rem;
}

/* ═══════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════ */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.chart-container { position: relative; height: 240px; }

/* ═══════════════════════════════════════════
   FLEET GANTT TIMELINE
═══════════════════════════════════════════ */
/* The grid holds a full quarter and is scrolled through sideways, so the swipe
   must stay inside it (no browser back-navigation) and the scrollbar must not
   shift the layout when it shows up. */
.fleet-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
}
.fleet-table {
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 900px;
}
.fleet-table th, .fleet-table td {
  padding: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}
.fleet-th-vehicle {
  text-align: left !important;
  padding: 0.5rem 0.75rem !important;
  background: var(--bg);
  position: sticky;
  left: 0;
  z-index: 6;
  min-width: 160px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-right: 2px solid var(--border-strong) !important;
}
.fleet-th-owner {
  text-align: left !important;
  padding: 0.5rem 0.5rem !important;
  background: var(--bg);
  position: sticky;
  left: var(--fleet-veh-w, 160px);
  z-index: 5;
  min-width: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-right: 2px solid var(--border-strong) !important;
}
.fleet-th-date {
  min-width: 36px;
  width: 36px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0.1rem;
  background: var(--bg);
}
.fleet-th-date.weekend { color: var(--warning); }
/* After .weekend on purpose: today on a Saturday/Sunday keeps the today colour. */
.fleet-th-date.today { background: var(--primary-light); color: var(--primary-ink); font-weight: 700; }
.fleet-th-month {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem;
}
/* A month can be wider than the viewport once the grid scrolls, so its name
   rides along the left edge of its own span instead of sitting off-screen at
   the centre. The offset clears the pinned Vehicle + Owner columns. */
.fleet-month-label {
  position: sticky;
  left: 272px;
  display: inline-block;
}
.fleet-td-vehicle {
  text-align: left !important;
  padding: 0.45rem 0.75rem !important;
  background: var(--bg-card);
  position: sticky;
  left: 0;
  font-weight: 500;
  font-size: 0.82rem;
  z-index: 4;
  border-right: 2px solid var(--border-strong) !important;
}
.fleet-td-owner {
  text-align: left !important;
  padding: 0.45rem 0.5rem !important;
  background: var(--bg-card);
  position: sticky;
  left: var(--fleet-veh-w, 160px);
  font-size: 0.78rem;
  color: var(--text-muted);
  z-index: 3;
  border-right: 2px solid var(--border-strong) !important;
}
/* The pinned columns cast a soft edge so the bars read as passing *under* them
   while the timeline is scrolled, rather than being clipped mid-air. */
.fleet-th-owner, .fleet-td-owner { box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.35); }
/* No Owner column (owners off): the vehicle column carries the edge instead. */
.fleet-no-owner .fleet-th-vehicle, .fleet-no-owner .fleet-td-vehicle { box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.35); }

/* Owner subtitle inside vehicle cell — only shown on mobile when owner col is hidden */
.fleet-td-vehicle-owner { display: none; }

/* Fleet controls (sort + filters + date) */
.fleet-controls {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: .6rem;
}
/* Scoped to the parent on purpose: `input[type="date"]` in the base form rules
   carries an attribute selector, so it outweighs a bare class and this field was
   rendering at width:100% with .9rem text inside a 28px box — a slab across the
   whole strip. Two classes take the weight back, and the metrics match a chip. */
.fleet-controls .fleet-control-input {
  width: auto;
  height: auto;
  padding: .2rem .4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .72rem;
  line-height: 1.35;
}

/* Fleet pagination nav */
.fleet-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.fleet-nav-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}
.fleet-nav-next { margin-left: auto; }

/* ── Gantt bar cells ── */
.fleet-cell-res {
  padding: 3px 2px !important;
  vertical-align: middle;
}
.fleet-cell-res.today-col { background: rgba(37,99,235,0.04); }
.fleet-cell-free {
  min-width: 36px;
  width: 36px;
  background: transparent;
}
.fleet-cell-free.today-col { background: rgba(37,99,235,0.06); }

.gantt-bar {
  position: relative;
  height: 26px;
  border-left-width: 3px;
  border-left-style: solid;
  display: flex;
  align-items: center;
  padding: 0 6px;
  cursor: pointer;
  overflow: hidden;
  transition: filter var(--transition), opacity var(--transition);
  min-width: 0;
}
.gantt-bar:hover { filter: brightness(0.88); opacity: 0.95; }
.gantt-label {
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* The days a booking is double-booked against another on the same car. Both
   bars carry it over the same columns, so the clash reads as a region of the
   row — you can see where it starts and how far it runs. */
.gantt-clash {
  position: absolute;
  top: 0;
  bottom: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(220, 38, 38, 0.34) 0 5px,
    rgba(220, 38, 38, 0) 5px 10px
  );
  box-shadow: inset 0 0 0 1px var(--danger);
  pointer-events: none;
}
.gantt-label { position: relative; }
/* A bar that runs in from under the pinned columns keeps its renter's name in
   sight: the label rides along the pinned edge (--fleet-pin-w, measured by
   fleetGrid_mount) until the bar itself ends, as the month names do. The bar
   must not clip, or it becomes the label's scroll box and the label never
   moves; a clash hatch at a rounded end is rounded in _ganttBar instead. */
.fleet-wrap .gantt-bar   { overflow: visible; }
.fleet-wrap .gantt-label { position: sticky; left: calc(var(--fleet-pin-w, 0px) + 6px); }

/* A car with overlapping bookings gets one lane per booking that has to run
   alongside another. The lanes are one band: no rule between them, and shorter
   bars so a double-booked row doesn't tower over the rest of the grid. */
.gantt-lane-open > td { border-bottom-color: transparent; }
.gantt-lane-open > .fleet-td-vehicle,
.gantt-lane-open > .fleet-td-owner { border-bottom-color: var(--border); }
.gantt-lane-multi .fleet-cell-res { padding: 2px !important; }
.gantt-lane-multi .gantt-bar { height: 20px; }

/* The one column a same-day handover shares — outgoing on the left half,
   incoming on the right. */
.gantt-turn { display: flex; gap: 2px; }
.gantt-turn .gantt-half { flex: 1 1 0; padding: 0; }

/* Autofill detection — fires animationstart on webkit when a field is autofilled */
@keyframes onAutoFillStart { from {} to {} }
input:-webkit-autofill { animation-name: onAutoFillStart; }

/* Pulse animation when jumping to a conflict */
@keyframes ganttConflictPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); outline: 2px solid transparent; }
  50%      { box-shadow: 0 0 0 6px rgba(220,38,38,.35); outline: 2px solid var(--danger); }
}
.gantt-bar-conflict-pulse {
  animation: ganttConflictPulse 0.8s ease-in-out 3;
  position: relative;
  z-index: 5;
}

/* Conflict indicator (replaces emoji) */
.gantt-conflict {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: default;
  flex-shrink: 0;
}

/* Busy row: very subtle red tint — layered over bg-card so the sticky
   vehicle/owner cells stay opaque and don't reveal gantt bars beneath
   them when the table is scrolled horizontally. */
.gantt-row-busy .fleet-td-vehicle,
.gantt-row-busy .fleet-td-owner {
  background: linear-gradient(rgba(239,68,68,.03), rgba(239,68,68,.03)), var(--bg-card);
}

/* Legend chips */
.gantt-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
}
.gantt-legend::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gantt-legend-free { background: var(--success-light); color: var(--success); }
.gantt-legend-free::before { background: var(--success); }
.gantt-legend-reserved { background: var(--primary-light); color: var(--primary-ink); }
.gantt-legend-reserved::before { background: var(--primary); }

/* ═══════════════════════════════════════════
   WEEKLY CALENDAR
═══════════════════════════════════════════ */
.week-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
/* Plain wrapping grid — no swipe/scroll/drag. Navigation is button-only
   (Prev/Today/Next in _calWeek), which is the only thing that changes which
   days are shown. Days that don't fit a row wrap to the next one. */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}
.day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
  transition: border-color var(--transition);
}
.day-card.today {
  border-color: var(--primary);
  border-width: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent), 0 4px 16px color-mix(in srgb, var(--primary) 15%, transparent);
  background: color-mix(in srgb, var(--primary) 4%, var(--bg-card));
}
.day-card.weekend .day-header { background: var(--bg-hover); }
.day-header {
  padding: 0.3rem 0.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.day-header.today,
.day-card.weekend .day-header.today { background: var(--primary); color: #fff; } /* weekend tint must not cover today's white text */
.day-name {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.day-header.today .day-name { color: rgba(255,255,255,.8); }
.day-date {
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
  color: var(--text);
  line-height: 1.1;
  margin-top: 0.05rem;
}
.day-card.today .day-date { color: #fff; }
.day-count {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  border-radius: 99px;
  padding: 1px 5px;
}
.day-header.today .day-count { background: rgba(255,255,255,.25); }
.day-events { padding: 0.35rem; display: flex; flex-direction: column; gap: 0.25rem; }
.day-free { font-size: 0.68rem; color: var(--text-light); padding: 0.25rem 0.2rem; }
/* Cars just out on rent — one quiet line per day, opened on tap. */
.day-onrent { display: flex; flex-direction: column; gap: 0.25rem; }
.day-onrent > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .35rem;
  font-size: 0.68rem; font-weight: 600; color: var(--primary-ink);
  padding: 0.25rem 0.4rem; border-radius: 5px;
}
.day-onrent > summary::-webkit-details-marker { display: none; }
.day-onrent > summary::after { content: '›'; margin-left: auto; opacity: .6; transition: transform .15s ease; }
.day-onrent[open] > summary::after { transform: rotate(90deg); }
.day-onrent > summary:hover { background: var(--primary-light); }
.day-onrent > summary:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 1px; }
.day-onrent-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--primary); flex-shrink: 0; }
.wk-head-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.day-event {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  font-size: 0.7rem;
  padding: 0.25rem 0.4rem;
  border-radius: 5px;
  line-height: 1.3;
  border-left: 2px solid transparent;
}
.day-event-icon { font-weight: 700; flex-shrink: 0; line-height: 1.4; }
.day-event-body { display: flex; flex-direction: column; gap: 0; min-width: 0; }
/* Vehicle line: car name + owner side by side. Flex (not one text run) so the
   two truncate independently in the narrow day column, instead of the owner
   simply falling off the end of the car name's ellipsis. */
.day-event-vehicle { font-weight: 600; display: flex; align-items: baseline; gap: .3rem; min-width: 0; }
.day-event-vname   { font-size: 0.66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-event-client  { font-size: 0.65rem; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Car owner — quietest thing in the row, so it reads as provenance rather
   than competing with the vehicle/renter. */
.day-event-owner   { font-size: 0.58rem; font-weight: 500; opacity: 0.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.day-event.handout { background: var(--success-light); color: var(--success); border-left-color: var(--success); }
.day-event.return  { background: var(--danger-light);  color: var(--danger);  border-left-color: var(--danger); }
.day-event.active  { background: var(--primary-light); color: var(--primary-ink); border-left-color: var(--primary); }
.day-event:hover   { filter: brightness(0.92); }
.day-event-chk {
  flex-shrink: 0;
  width: 15px; height: 15px;
  margin-top: 1px;
  cursor: pointer;
  accent-color: var(--success);
}
.day-event.finished { opacity: 0.5; }
.day-event.finished .day-event-vehicle,
.day-event.finished .day-event-client,
.day-event.finished .day-event-owner { text-decoration: line-through; }
/* Cancelled bookings stay visible on the calendar but read as struck-out and muted */
.day-event.cancelled {
  background: var(--bg);
  color: var(--text-muted);
  border-left-color: var(--text-muted);
  border-left-style: dashed;
  opacity: 0.7;
}
.day-event.cancelled .day-event-vehicle,
.day-event.cancelled .day-event-client,
.day-event.cancelled .day-event-owner { text-decoration: line-through; }
.day-event-cancel-tag {
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: .6rem;
  color: var(--danger);
}
/* Owner-booked: only on screen while the toggle is on, and marked so it reads
   as "off the road, but not ours to earn from". */
.day-event-owner-tag {
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: .6rem;
  color: var(--text-muted);
}
.day-event.owner-made { border-left-style: dotted; }
/* Week view on a computer: seven columns have room to spare, so the day boxes
   stand taller and the rentals inside read at a normal size (they were 9–10px,
   in boxes a third of the screen high). Scoped to .week-grid so the day sheet
   that opens from a box keeps its own sizes; phones keep the swipe strip. */
@media (min-width: 701px) {
  .week-grid .day-card    { min-height: 16rem; }
  .week-grid .day-header  { padding: 0.45rem 0.65rem; }
  .week-grid .day-name    { font-size: 0.72rem; }
  .week-grid .day-date    { font-size: 1.35rem; }
  .week-grid .day-count   { font-size: 0.72rem; padding: 1px 6px; }
  .week-grid .day-events  { padding: 0.45rem; gap: 0.35rem; }
  .week-grid .day-event   { font-size: 0.8rem; padding: 0.4rem 0.5rem; gap: 0.4rem; }
  .week-grid .day-event-vname  { font-size: 0.82rem; }
  .week-grid .day-event-client { font-size: 0.76rem; }
  .week-grid .day-event-owner  { font-size: 0.68rem; }
  /* At this size a car and its owner don't share a line: the owner drops
     below rather than cutting the car's name short. */
  .week-grid .day-event-vehicle { flex-wrap: wrap; row-gap: 0; }
  .week-grid .day-onrent > summary { font-size: 0.76rem; padding: 0.35rem 0.45rem; }
  .week-grid .day-free    { font-size: 0.76rem; }
}

/* ── Calendar ── */
.cal-view-tabs { margin-bottom: 1rem; }
.profit-positive { color: var(--success); font-weight: 600; }
.profit-negative { color: var(--danger); font-weight: 600; }

/* ═══════════════════════════════════════════
   OWNERS / VEHICLES CARDS
═══════════════════════════════════════════ */
.owners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.owner-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.owner-card { display: flex; flex-direction: column; height: 100%; }
.owner-card-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem 0.4rem;
}
.owner-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}
.owner-card-name { font-size: 1rem; font-weight: 700; color: var(--text); }
/* Under the stats, not under the name: beside the Access button the number
   wrapped onto two lines and pushed that card's stats out of line with its
   neighbours. Here it has the card's full width. */
.owner-card-phone { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owner-card-phone a { color: inherit; text-decoration: none; }
.owner-card-phone a:hover { color: var(--text); }
.owner-card-phone svg { width: 12px; height: 12px; display: inline; vertical-align: -1px; margin-right: .25rem; }
.owner-archived-chip {
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  vertical-align: middle;
}
.owner-card-body { padding: 0 1.1rem; }
.owner-stats { margin: 0.35rem 0 0.5rem; }
.owner-stats-detail { grid-template-columns: repeat(2, 1fr); margin-top: 0.4rem; }
.owners-grid.compact .owner-stats-detail { display: none; }
.owner-actions {
  margin-top: auto;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
/* Owner cards: Access and ⋮ in the header row, beside the name. */
.owner-card-top > div:not(.owner-actions) { flex: 1; }
.owner-actions.owner-actions-top { margin: 0 0 0 auto; padding: 0; border-top: 0; flex: 0 0 auto; }
.owner-card-body { padding-bottom: .75rem; }

/* ═══════════════════════════════════════════
   RECEIPT PRINT
═══════════════════════════════════════════ */
.receipt {
  font-family: var(--font);
  max-width: 480px;
  margin: 2rem auto;
  padding: 2.5rem 2.25rem;
  background: #fff;
  color: #111;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 12px 32px -12px rgba(0,0,0,0.12);
  line-height: 1.5;
}
.receipt-header { text-align: center; margin-bottom: 2rem; }
.receipt-header h2 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #111;
  margin: 0 0 .4rem;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 0.92rem;
}
.receipt-row:last-child { border-bottom: none; }
.receipt-row span { color: #6b6b6b; }
.receipt-row strong { font-weight: 500; color: #111; text-align: right; }
.receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.1rem 0 .25rem;
  margin-top: .25rem;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.receipt-total span:first-child {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6b6b6b;
  font-weight: 600;
}
.receipt-total span:last-child {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.receipt-footer {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  text-align: center;
  font-size: 0.78rem;
  color: #9a9a9a;
  letter-spacing: 0.03em;
}
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  .receipt { box-shadow: none; margin: 0 auto; }
}

/* In-modal reservation details — uses theme colors, not the receipt-card chrome */
.res-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}
.res-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  min-width: 0;
}
.res-info-row:last-child { border-bottom: none; }
.res-info-row span {
  color: var(--text-muted);
  flex-shrink: 0;
}
.res-info-row strong {
  font-weight: 500;
  color: var(--text);
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.res-info-actions {
  /* Four equal secondary actions on one row, the primary edit spanning the
     full width beneath — every button lines up on the same grid. */
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}
.res-info-actions .btn { justify-content: center; min-height: 2.5rem; }
.res-info-actions .btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.res-info-actions .btn span { overflow: hidden; text-overflow: ellipsis; }
.res-info-actions .res-info-edit { grid-column: 1 / -1; font-weight: 600; }
.res-info-actions .res-info-delete { color: var(--danger); }
.res-info-actions .res-info-wa { grid-column: span 2; color: #25d366; border-color: color-mix(in srgb, #25d366 35%, var(--border)); }
.res-info-actions .res-info-wa:hover { color: #25d366; background: color-mix(in srgb, #25d366 10%, transparent); }
.res-info-actions .res-info-wa + .res-info-edit { grid-column: span 2; }
.res-info-actions .res-info-delete:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.res-info-actions .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.res-info-actions .btn:active { transform: translateY(1px); }
@media (max-width: 420px) {
  .res-info-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .res-info-actions .res-info-wa, .res-info-actions .res-info-wa + .res-info-edit { grid-column: span 1; }
}

/* Dashboard pulse-tile detail popup list */
.pulse-list-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.pulse-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.pulse-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.pulse-list-row:hover {
  background: rgba(255,255,255,.06);
  border-color: var(--primary);
  transform: translateX(2px);
}
.pulse-list-row:focus-visible {
  outline: 2px solid var(--primary-ink);
  outline-offset: 2px;
}
.pulse-list-row:active { transform: translateX(0) scale(.995); }
.pulse-list-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.pulse-list-client {
  font-weight: 600;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pulse-list-vehicle {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pulse-list-meta {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}
.pulse-list-empty {
  padding: 1.5rem 0.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.pulse-list-section-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0.75rem 0 0.35rem;
}
.pulse-list-section-head:first-child { margin-top: 0; }
.pulse-list-section-count {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════
   SETTINGS
═══════════════════════════════════════════ */
.settings-section { margin-bottom: 2rem; }
.settings-section h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row label:not(.btn) { font-size: 0.9rem; color: var(--text); } /* Import buttons are <label class="btn"> — keep them styled like Export */
.settings-row .sub { font-size: 0.78rem; color: var(--text-muted); }
/* Settings → Features: one switch per optional part of the app. */
.feat-intro { margin: -.25rem 0 .5rem; line-height: 1.5; font-size: .8rem; color: var(--text-muted); }
.feat-row { gap: 1rem; }
.feat-text { display: flex; align-items: flex-start; gap: .7rem; min-width: 0; }
.feat-text .sub { line-height: 1.45; margin-top: .1rem; }
.feat-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: .1rem; color: var(--text-muted); }
.feat-row .toggle input:disabled + .toggle-slider { opacity: .5; cursor: not-allowed; }
/* Parts of a form hidden by a switched-off feature (Features). The form
   classes set their own display, which would otherwise beat [hidden]. */
#modal-body .form-group[hidden], #modal-body .form-row[hidden], #modal-body select[hidden], #modal-body div[hidden] { display: none !important; }
.settings-logo { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.settings-logo img { height: 2.25rem; max-width: 6rem; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px; }

/* Toggle switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 99px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Phone alert preview — a notification arriving over the sign-in screen's
   night lot. The stage stays dark in both themes: it stands in for a phone's
   lock screen, which is dark whatever the app's theme. */
.np-stage {
  --np-lot: #0b1220;
  --np-card: rgba(30, 41, 59, 0.78);
  --np-text: #f8fafc;
  --np-muted: #a5b4c8;
  --np-rule: rgba(255, 255, 255, 0.09);
  position: relative;
  overflow: hidden;
  padding: 1.5rem 1rem 1.25rem;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(244,112,74,0.20), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(59,92,170,0.28), transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(255,255,255,0.05) 58px 60px),
    var(--np-lot);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 6px 20px -8px rgba(11,18,32,0.45);
}
.np-card {
  max-width: 380px;
  margin: 0 auto;
  padding: 0.75rem 0.9rem 0;
  border-radius: 18px;
  background: var(--np-card);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--np-text);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 12px 28px -10px rgba(0,0,0,0.6);
  animation: np-arrive 0.5s var(--ease-spring) both;
}
/* The card's edge glow carries the alert's urgency, the one cue that works
   at a glance: blue heads-up, coral due-now, red follow-up. */
.np-warn30  { box-shadow: 0 0 0 1px rgba(96,165,250,0.35), 0 12px 28px -10px rgba(0,0,0,0.6); }
.np-attime  { box-shadow: 0 0 0 1px rgba(244,112,74,0.55), 0 12px 32px -8px rgba(244,112,74,0.35); animation: np-arrive 0.5s var(--ease-spring) both, np-buzz 0.9s 0.5s ease-in-out; }
.np-after30 { box-shadow: 0 0 0 1px rgba(248,113,113,0.6), 0 12px 32px -8px rgba(220,38,38,0.35); animation: np-arrive 0.5s var(--ease-spring) both, np-buzz 0.9s 0.5s ease-in-out; }
.np-head {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; letter-spacing: 0.02em; color: var(--np-muted);
  margin-bottom: 0.35rem;
}
.np-head img { width: 18px; height: 18px; border-radius: 5px; }
.np-head span:first-of-type { color: var(--np-text); font-weight: 600; }
.np-dot { opacity: 0.6; }
.np-title { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; margin-bottom: 0.15rem; }
.np-line { font-size: 0.84rem; line-height: 1.45; color: #dbe3ee; font-variant-numeric: tabular-nums; }
.np-actions {
  display: flex;
  margin: 0.7rem -0.9rem 0;
  border-top: 1px solid var(--np-rule);
}
.np-actions span {
  flex: 1;
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-size: 0.8rem; font-weight: 600;
  color: #93c5fd;
}
.np-actions span + span { border-left: 1px solid var(--np-rule); }
@keyframes np-arrive {
  from { opacity: 0; transform: translateY(-14px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
/* Mirrors the vibration in sw.js: a short side-to-side, like a phone on a desk. */
@keyframes np-buzz {
  0%, 100% { transform: none; }
  10%, 30%, 50% { transform: translateX(-2px); }
  20%, 40%, 60% { transform: translateX(2px); }
  70% { transform: none; }
}
.np-kinds {
  display: flex; gap: 0.35rem; flex-wrap: wrap;
  margin: 0.75rem 0 0.35rem;
}
.np-kinds button {
  font: inherit; font-size: 0.78rem; font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.np-kinds button:hover { background: var(--bg-hover); color: var(--text); }
.np-kinds button:active { transform: scale(0.97); }
.np-kinds button:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; }
.np-kinds button.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-ink); }
.np-note { font-size: 0.75rem; color: var(--text-muted); margin: 0 0 0.25rem; }
.np-steps { margin: 0 0 0.5rem; padding-left: 1.25rem; font-size: 0.85rem; line-height: 1.9; color: var(--text); }
.np-steps i { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; color: var(--primary-ink); }
@media (prefers-reduced-motion: reduce) {
  .np-card, .np-attime, .np-after30 { animation: none; }
}

/* ═══════════════════════════════════════════
   MISC
═══════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state p { font-size: 0.9rem; }

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

/* ═══════════════════════════════════════════
   RESPONSIVE — SMALL LAPTOP (Reports By-Vehicle)
   Hide owner-facing columns on narrower screens so the table
   fits without horizontal scroll. Full table returns ≥1281px.
═══════════════════════════════════════════ */
@media (max-width: 1280px) {
  /* Cols: 10=Owner/d, 12=Owner € — least-scanned columns */
  .finance-vehicle-table th:nth-child(10),
  .finance-vehicle-table td:nth-child(10),
  .finance-vehicle-table th:nth-child(12),
  .finance-vehicle-table td:nth-child(12) { display: none; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — TABLET
═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-width: 60px; }
  .nav-label, .sidebar-logo-text { display: none; }
  .sidebar-logo { justify-content: center; padding: 1rem; }
  .nav-link { justify-content: center; padding: 0.65rem; }
  .sidebar-footer { justify-content: center; }
  #sidebar-logout { display: none; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE
═══════════════════════════════════════════ */
/* Undo snackbar: bottom-centre on desktop; repositioned to the top on phones
   (see the max-width:700px block below) so it clears the mobile bottom nav. */
#undo-bar {
  position: fixed;
  bottom: 1.25rem; left: 50%;
  transform: translateX(-50%) translateY(1rem);
  display: flex; align-items: center; gap: .6rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  font-size: .82rem; font-weight: 500;
  padding: .4rem .4rem .4rem .9rem;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0,0,0,.3);
  z-index: 10000;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
#undo-bar.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

@media (max-width: 700px) {
  body { overflow-x: hidden; }

  /* Sidebar: hidden by default, slides in as full drawer */
  #sidebar { display: none; }
  #sidebar.open {
    display: flex;
    width: 240px;
    z-index: 200;
  }
  #sidebar.open .nav-label,
  #sidebar.open .sidebar-logo-text { display: inline; }
  #sidebar.open .sidebar-logo { justify-content: flex-start; padding: 1.25rem 1rem; }
  #sidebar.open .nav-link { justify-content: flex-start; padding: 0.6rem 0.75rem; }
  #sidebar.open .sidebar-footer { justify-content: flex-start; }
  #sidebar.open #sidebar-logout { display: inline-flex; }

  #main { margin-left: 0; }
  .drawer-actions { display: block; }
  #mob-more { background: none; border: none; cursor: pointer; }
  #mob-more.active { background: color-mix(in srgb, var(--text) 20%, transparent); } /* lit on pages that live in the More panel */

  /* Mobile bottom nav — sits above the OS / browser safe-area inset
     (notches on iOS, gesture bar on Android, persistent URL bars on some browsers).
     Total reserved height = nav height + safe-area inset; padding-bottom pushes the
     content above the inset so taps still hit the icons. */
  #mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  }
  .mob-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    gap: 0.1rem;
    padding: 0.3rem;
    transition: color var(--transition);
    min-height: 44px;
  }
  .mob-link svg { width: 20px; height: 20px; }
  .mob-link.active { color: var(--brand-ink); }

  /* Content: pad bottom so mobile nav doesn't cover content (account for safe-area too) */
  #content { padding: calc(env(safe-area-inset-top, 0px) + 0.6rem) 0.75rem calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 1rem); max-width: 100vw; overflow-x: hidden; }

  /* Prevent any descendant from making the page itself scroll horizontally on phones */
  html, body { overflow-x: hidden; max-width: 100vw; }
  #main { max-width: 100vw; overflow-x: hidden; }

  /* Toast: float above mobile nav bar */
  #toast-container {
    bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 0.75rem);
    right: 0.75rem;
    left: 0.75rem;
  }
  .toast { max-width: 100%; min-width: 0; }

  /* Idle warning: above mobile nav */
  #idle-warning { bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 1rem); }

  /* Undo snackbar: to the top on phones (clears the bottom nav), slides in from above */
  #undo-bar {
    top: calc(env(safe-area-inset-top, 0px) + 0.75rem);
    bottom: auto;
    transform: translateX(-50%) translateY(-1rem);
  }
  #undo-bar.show { transform: translateX(-50%) translateY(0); }

  /* Grids */
  .charts-grid { grid-template-columns: 1fr; }

  /* Prev/Today/Next split the full row on phones — bigger tap targets, and
     the row reads as one control instead of three buttons hugging the left. */
  .week-nav .btn {
    flex: 1;
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  /* Week calendar on phones: a horizontal swipe strip (same feel as the owner
     portal) instead of a wrapping 2-column grid — days move sideways with
     snap, so reading the week never means scrolling the page down. */
  .week-grid {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-padding-left: 0.15rem;
    padding: 0.15rem 0.15rem 0.6rem;
    margin: 0 -0.15rem;
    scrollbar-width: none;
  }
  .week-grid::-webkit-scrollbar { display: none; }
  .week-grid .day-card {
    flex: 0 0 46%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
  }
  /* Invisible tail marker the IntersectionObserver watches to append more days */
  .week-grid .day-card.wk-sentinel {
    flex: 0 0 1px;
    min-height: 1px;
    border: 0;
    background: none;
    box-shadow: none;
    padding: 0;
  }
  /* A packed day scrolls inside its own card rather than stretching the strip */
  .week-grid .day-events {
    max-height: 62vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  /* Edit/New Rental form: keep Date + Hour paired, and Owner/Vehicle,
     Client/Phone side by side so the form isn't one long scroll. */
  .form-row.rental-dt-row {
    grid-template-columns: 1fr 96px;
    gap: .65rem;
    align-items: end;
  }
  .form-row.rental-2up, .form-row.keep-2up {
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
  }
  .form-row-3.keep-3up { grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
  .form-row.keep-2up .form-group, .form-row-3.keep-3up .form-group { min-width: 0; }
  .form-row.keep-2up input, .form-row.keep-2up select,
  .form-row-3.keep-3up input, .form-row-3.keep-3up select { min-width: 0; width: 100%; box-sizing: border-box; }
  .form-row.rental-dt-row .form-group,
  .form-row.rental-2up .form-group {
    max-width: none;
    min-width: 0;
    margin-bottom: .75rem;
  }
  .form-row.rental-dt-row input,
  .form-row.rental-dt-row select,
  .form-row.rental-2up input,
  .form-row.rental-2up select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Pricing rows: keep Owner/Client rate paired, and the totals block as a
     tidy 2x2 instead of one long stack (or 4 cramped columns). */
  /* Labels are one short line now, so the three line up from the top — the
     hint under Days no longer pushes the other two down. */
  .form-row-3.rental-price-row { grid-template-columns: 1fr 1fr 1fr; gap: .5rem; align-items: start; }
  .form-row-3.rental-totals-row { grid-template-columns: 1fr 1fr !important; gap: .6rem; }
  .form-row-3.rental-price-row .form-group,
  .form-row-3.rental-totals-row .form-group { min-width: 0; }
  .form-row-3.rental-price-row input,
  .form-row-3.rental-totals-row input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Calendar: full-width touch-friendly view chooser + bigger tap targets */
  .cal-view-tabs { gap: .25rem; }
  .cal-view-tabs .owner-tab { flex: 1; justify-content: center; text-align: center; }

  /* Offer Maker: keep Date + Hour on the same row on mobile */

  /* Offer Maker: pull everything up so more cards are visible without scrolling */
  .offer-form.card { padding: .7rem .8rem !important; margin-bottom: .6rem !important; }
  .offer-form > div:first-child { margin-bottom: .5rem !important; }
  .offer-form .form-group label { margin-bottom: .2rem; font-size: .68rem; }
  #offer-filters .filter-bar { margin-bottom: .55rem !important; }
  #offer-results .offer-section { margin-top: .55rem; }
  #offer-results .offer-section:first-child { margin-top: 0; }
  .offer-card { padding: .65rem .75rem; gap: .25rem; }

  /* Reclaim the top of the screen: the form card was pushing the first result
     card fully below the fold. */
  /* Too narrow for two controls side by side: the window field's dates would
     wrap. Stack them again, each full width. */
  .offer-fields-row { gap: .5rem; }
  .offer-window-group {
    flex: 1 1 100% !important;      /* the row rules live later in the file */
    max-width: none !important;
  }
  .offer-actions { margin-left: 0; width: 100%; }
  .offer-summary { margin: 0 0 .6rem; }

  /* Card head: tighter gaps, honest tap targets. */
  .offer-head-right { gap: .3rem; }
  .veh-thumb { flex-basis: 48px !important; width: 48px !important; height: 36px !important; }   /* base rule lives later in the file */
  .offer-total { font-size: 1.1rem; }
  .offer-copy-one, .offer-reserve { min-height: 36px; }
  .offer-reserve { padding: .3rem .65rem; }
  .offer-reserve i, .offer-reserve svg { display: none; }   /* the word is enough; the name gets the room */

  /* ── Filter strips ──────────────────────────────────────────────────────
     On phones every chip bar becomes a single-line sideways-scrolling strip
     (the same pattern the owner portal uses) instead of wrapping into 4–5
     rows that push the actual content below the fold. Chips stay chips — the
     dropdown replacement was deliberately reverted (28d8d84); only the layout
     of the row changes. The half-visible chip at the right edge is the scroll
     affordance. nowrap needs !important because several bars carry an inline
     flex-wrap:wrap. Applies to dashboard, reservations, fleet, reports,
     owner detail, offer maker, etc. */
  .filter-bar, .fleet-controls {
    gap: .3rem;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;              /* keep chip focus rings unclipped */
  }
  .filter-bar::-webkit-scrollbar, .fleet-controls::-webkit-scrollbar { display: none; }
  .filter-bar > *, .fleet-controls > * { flex-shrink: 0; }
  /* Row-break spacers (flex-basis:100%) are meaningless in a one-line strip
     and would otherwise sit as a full-width empty gap mid-strip. */
  .filter-bar > [style*="flex-basis:100%"],
  .fleet-controls > [style*="flex-basis:100%"] { display: none; }
  /* `Owner:` / `Dates:` labels ride along inside the strip. */
  .filter-bar > span, .fleet-controls > span { align-self: center; }
  /* Bigger, more tappable/readable filter chips on phones (was .7rem ≈ 11px). */
  .filter-bar .btn-sm,
  .fleet-controls .btn-sm,
  .fleet-controls .btn {
    font-size: .82rem;
    padding: .44rem .78rem;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }
  .filter-bar input[type="search"],
  .filter-bar input[type="text"],
  .filter-bar input[type="date"],
  .filter-bar select,
  .fleet-controls input[type="search"],
  .fleet-controls input[type="text"],
  .fleet-controls input[type="date"],
  .fleet-controls select,
  .fleet-controls .fleet-control-input {
    font-size: .7rem !important;
    padding: .3rem .5rem !important;
    min-width: 0 !important;
    flex: 0 0 130px;                  /* fixed slot in the strip — don't collapse */
  }
  .filter-bar input[type="search"] { flex: 1 1 140px; }
  .filter-bar label, .fleet-controls label { font-size: .7rem !important; }
  .fleet-controls > span { font-size: .68rem !important; }

  /* Owner filter strips (Rentals, Offer, Fleet): wrap so every owner chip is
     visible at once instead of hiding behind a sideways swipe. */
  .res-secondary-bar,
  #offer-filters .filter-bar,
  .reports-filter-bar,
  .fleet-owner-filter,
  .fleet-controls {
    flex-wrap: wrap !important;
    overflow-x: visible;
  }
  /* Restore the row-break spacers so a wrapped strip splits cleanly
     (e.g. Fleet's Owner row vs Vehicle row). */
  .res-secondary-bar > [style*="flex-basis:100%"],
  .reports-filter-bar > [style*="flex-basis:100%"],
  .fleet-controls > [style*="flex-basis:100%"] { display: block; }

  /* Rentals Dates filter: too fiddly on a phone and it crowded the quick
     bar — the year/month filters cover the same ground. Hidden fields stay
     empty, so render() still reads "no date range". */
  .res-quick-bar .res-date-group { display: none; }
  /* Excel export is a desk job — on a phone it only stretched the quick bar. */
  .res-quick-bar [onclick*="exportExcel"] { display: none; }
  /* Smaller owner chips (Rentals, Offer, Fleet, Vehicles, Reports) so the list
     costs two rows, not three, and the content starts higher up. */
  .res-secondary-bar,
  #offer-filters .filter-bar,
  .reports-filter-bar,
  .fleet-controls,
  .fleet-owner-filter { gap: .3rem !important; }
  .res-secondary-bar { margin-bottom: .5rem !important; }
  .res-secondary-bar .btn-sm,
  #offer-filters .filter-bar .btn-sm,
  .reports-filter-bar .btn-sm,
  .fleet-controls .btn-sm,
  .fleet-owner-filter .btn-sm { padding: .25rem .55rem !important; font-size: .78rem !important; min-height: 0 !important; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .owners-grid { grid-template-columns: 1fr; }

  /* Filter bar */
  .filter-bar input, .filter-bar select { max-width: 100%; }
  .search-input { min-width: 0 !important; }

  /* Rentals toolbar: search and “+ New” share the top row; the filter strip
     goes full-width beneath them instead of “+ New” sitting alone on a row. */
  .res-toolbar { flex-wrap: wrap; }
  .res-toolbar .search-wrap { flex: 1 1 0; min-width: 0; }
  .res-toolbar .res-new-btn { order: 2; flex: 0 0 auto; }
  .res-toolbar .res-pills-inline { order: 3; flex-basis: 100%; min-width: 0; }
  .res-pills-inline .filter-bar { width: 100%; }

  /* Card headers: allow wrapping */
  .card-header { flex-wrap: wrap; gap: 0.5rem; }

  /* Section actions: wrap */
  .section-actions { flex-wrap: wrap; }

  /* Modal: full-width, top-anchored on mobile so the title and first fields are visible immediately */
  #modal-overlay { padding: 0; align-items: flex-start; }
  #modal-box {
    border-radius: 0;
    max-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    animation-name: modal-up;
  }
  .modal-ghost #modal-box { animation-name: modal-down; }
  .modal-header { position: sticky; top: 0; background: var(--bg-card); z-index: 2; }
  #modal-body { flex: 1; min-height: 0; }
  /* Sticky footer inside modal body so Save/Cancel are always reachable */
  #modal-body .modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    margin: 1rem -1.25rem 0;
    padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
  }
  /* Cancel booking gets its own full-width row above Cancel/Save on mobile */
  #modal-body .modal-footer .footer-cancel-booking {
    flex: 1 0 100%;
    margin: 0 0 .5rem !important;
  }

  /* Today banner: stack columns + compact spacing for mobile */
  .today-split { grid-template-columns: 1fr; }
  .today-col + .today-col { border-left: none; border-top: 1px solid var(--border); }
  .today-banner { margin-bottom: .6rem; }
  .today-banner .card-header {
    padding: .4rem .8rem !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: .5rem !important;
  }
  .today-banner .card-title { font-size: .85rem; }
  .today-banner .card-header .badge { flex-shrink: 0; }
  .today-col { padding: .45rem .8rem; }
  .today-row { font-size: .8rem; padding: .15rem 0; gap: .3rem; }
  .today-col-label { font-size: .68rem; margin-bottom: .2rem; }
  .today-phone { font-size: .72rem; }

  /* Owner detail stat-grid */
  .stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }

  /* ── Reservations List → stacked cards on mobile ──
     Cell order: 1=checkbox 2=Dates 3=Vehicle 4=Client/Owner 5=Length 6=Profit 7=Actions */
  /* Hide the table header row entirely */
  #res-table-wrap .res-table thead { display: none; }

  /* Collapse table semantics so rows can become cards */
  #res-table-wrap .res-table,
  #res-table-wrap .res-table tbody { display: block; width: 100%; }

  /* Group headers (Ongoing / Future / Past) stay as full-width block labels */
  #res-table-wrap .res-group-header { display: block; }
  #res-table-wrap .res-group-header td { display: block; width: auto; }

  /* Each rental row = a card */
  #res-table-wrap .res-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "vehicle date   act"
      "client  client act";
    column-gap: .5rem;
    row-gap: .2rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .6rem .7rem;
    margin-bottom: .55rem;
  }
  #res-table-wrap .res-row-overdue { border-left: 3px solid var(--warning); }
  #res-table-wrap .res-row-selected { background: rgba(37,99,235,0.10) !important; }

  /* Reset td block + remove desktop min-widths/borders */
  #res-table-wrap .res-row td {
    display: block;
    padding: 0;
    border: none;
    min-width: 0;
    white-space: normal;
  }

  /* Assign cells to grid areas (matches column order above) */
  #res-table-wrap .res-row td:nth-child(1) { display: none; }                    /* Checkbox — hidden on mobile */
  #res-table-wrap .res-row td:nth-child(2) { grid-area: date; font-size: .8rem; color: var(--text-muted); }
  /* Dates sit beside the car name; a long name pushes the return date onto a
     second line instead of under the price. */
  #res-table-wrap .res-row td:nth-child(2) { white-space: normal !important; align-self: baseline; }
  #res-table-wrap .res-row td:nth-child(2) strong { white-space: nowrap; }
  #res-table-wrap .res-row td:nth-child(3) { align-self: baseline; }
  #res-table-wrap .res-row td:nth-child(2) .res-new-badge { margin-left: .25rem; }
  #res-table-wrap .res-row td:nth-child(3) { grid-area: vehicle; font-size: .95rem; }
  #res-table-wrap .res-row td:nth-child(4) { grid-area: client; }
  #res-table-wrap .res-row td:nth-child(5) { display: none; }            /* Length */
  /* Profit, status pill and WhatsApp shortcut are desktop-only — the card is
     just car, dates, client and the ⋮ menu. A cancelled card still reads as
     one from its strike-through and fade. */
  #res-table-wrap .res-row td:nth-child(6) { display: none; }
  #res-table-wrap .res-row td:nth-child(7) a { display: none; }
  /* Plain ⋮, no box: still a 40px-tall tap target, but narrow enough that
     most date ranges fit beside the car name. */
  #res-table-wrap .res-row td:nth-child(7) .btn { border-color: transparent; background: none; min-width: 28px !important; margin-right: -.4rem; }
  #res-table-wrap .res-row td:nth-child(7) {
    grid-area: act;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .15rem;
  }

  /* Empty-state row ("No reservations found") stays full width */
  #res-table-wrap .res-table tbody tr:only-child td[colspan] { display: block; }

  /* Reservations toolbar: collapse date inputs to a single row, keep button compact */
  .res-toolbar .res-date-input { flex: 1; min-width: 0; }
  .res-toolbar .res-new-btn { padding: .5rem .75rem; font-size: .85rem; min-height: 40px; }
  .res-stat { flex-shrink: 0; min-width: 68px; padding: .3rem .55rem; }

  /* Filter bars: wrap on mobile */
  /* Both rows are one-line swipeable strips. The owner row previously used
     overflow-x:visible, which — with the base .filter-bar nowrap — meant the
     chips ran off the page and got clipped by #content (no scroll at all). */
  .res-quick-bar, .res-secondary-bar {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding: 0 .25rem .3rem; margin: 0 -.25rem .5rem;
  }
  .res-quick-bar::-webkit-scrollbar, .res-secondary-bar::-webkit-scrollbar { height: 4px; }
  .res-quick-bar > *, .res-secondary-bar > * { flex-shrink: 0; }
  /* Excel already carries margin-left:auto; a second auto here split the free
     space and stranded Filters in the middle of the row. */
  .fb-sep { display: none; }
  /* Push table thead below the sticky tabs so they don't overlap */
  #res-table-wrap .res-table thead th { top: 48px; }

  /* ── DASHBOARD ── */
  /* Filter bar: scroll horizontally, don't wrap into 3 cramped rows */
  .dash-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -.25rem 1rem;
    padding: 0 .25rem .25rem;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  .dash-filter-bar::-webkit-scrollbar { height: 4px; }
  .dash-filter-bar > * { flex-shrink: 0; }
  /* Two classes, to keep the phone's 30px field ahead of the desktop rule. */
  .dash-filter-bar .dash-date-input { min-width: 130px; height: 30px; }

  /* Stat cards: tighter padding, smaller value font */
  .stat-card { padding: .6rem .7rem; min-width: 0; overflow: hidden; }
  .stat-card::before { width: 2px; }
  .stat-label { font-size: .68rem; }
  .stat-value { font-size: 1.25rem; margin: .15rem 0; overflow-wrap: anywhere; }
  .stat-sub { font-size: .68rem; }
  .stats-grid { gap: .5rem; margin-bottom: .8rem; min-width: 0; }

  /* Charts: shorter on mobile */
  .chart-container { height: 200px; }

  /* Goals row: stack into two lines (label + days on top, bar + pct + status below) */
  .dash-goal-row {
    flex-wrap: wrap;
    gap: .4rem .6rem;
    padding: .6rem 0;
  }
  /* Line 1: the goal and what's left; line 2: days, bar and percent. */
  .dash-goal-label { flex: 1 1 70%; white-space: normal; font-weight: 600; }
  .dash-goal-status { order: 0; flex: 0 0 auto; margin-left: auto; min-width: 0; text-align: right; font-size: .72rem; white-space: nowrap; }
  .dash-goal-days { order: 1; font-size: .7rem; }
  .dash-goal-bar { flex: 1; width: auto; min-width: 80px; order: 2; }
  .dash-goal-pct { order: 3; min-width: 2.4rem; }

  /* Actions table: hide Owner (col 4) and Days (col 6) on mobile to keep essentials visible */
  .dash-actions-table th:nth-child(4),
  .dash-actions-table td:nth-child(4),
  .dash-actions-table th:nth-child(6),
  .dash-actions-table td:nth-child(6) { display: none; }

  /* ── FINANCE ── */
  /* By Vehicle table hides Owner col on mobile (col 3): vehicle name often implies it */
  .finance-vehicle-table th:nth-child(3),
  .finance-vehicle-table td:nth-child(3) { display: none; }

  /* ── SETTLEMENT ── */
  /* Summary cards: tighter padding, smaller value font */
  .settlement-card { padding: .85rem 1rem; }
  .settlement-value { font-size: 1.4rem; }
  .settlement-label { font-size: .7rem; margin-bottom: .25rem; }
  .settlement-sub { font-size: .72rem; }
  .settlement-summary { gap: .6rem; margin-bottom: 1rem; grid-template-columns: 1fr 1fr; }
  /* The 3rd card spans full width below the first two */
  .settlement-summary > :nth-child(3) { grid-column: 1 / -1; }

  /* Settlement owner cards: tighter header */
  .settlement-owner-grid { gap: .6rem; padding: .75rem; }
  .settlement-owner-card { padding: .6rem .8rem; }
  .settlement-owner-header h4 { font-size: .95rem; }

  /* Settlement table cols: 1=Dates 2=Owner 3=Vehicle/Client 4=Days 5=Amount 6=Action
     Hide Owner (already grouped above) and Days on mobile */
  .settlement-table th:nth-child(2),
  .settlement-table td:nth-child(2),
  .settlement-table th:nth-child(4),
  .settlement-table td:nth-child(4) { display: none; }
  .settlement-row td { padding: .6rem .5rem; }

  /* ── OWNERS ── */
  /* Hide notes on mobile; detail stats follow the Compact/Detailed toggle */
  .owner-stat-secondary { display: none !important; }
  .owner-card-top { padding: .75rem 1rem .3rem; }
  .owner-card-body { padding: 0 1rem; }
  .owner-stats { margin: .3rem 0 .45rem; }
  .owner-actions:not(.owner-actions-top) { padding: .6rem 1rem .85rem; gap: .35rem; }
  .owner-actions-top { gap: .3rem; }

  /* ── FLEET AVAILABILITY (Gantt) ── */
  /* Hide standalone Owner column; show owner under vehicle name instead */
  .fleet-th-owner, .fleet-td-owner { display: none; }
  .fleet-td-vehicle-owner {
    display: block;
    font-size: .55rem;
    color: var(--text-muted);
    margin-top: .05rem;
  }
  /* Vehicle col auto-sizes to longest name — no fixed min/max, so short
     names take less space and long ones aren't forced to wrap. */
  .fleet-th-vehicle, .fleet-td-vehicle {
    min-width: 0 !important;
    width: 1% !important;
    white-space: nowrap;
  }
  .fleet-td-vehicle { font-size: .6rem !important; padding: .25rem .35rem !important; line-height: 1.15; }
  /* Owner column is gone here, so the vehicle column carries the scroll edge */
  .fleet-th-vehicle, .fleet-td-vehicle { box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.35); }
  .fleet-td-vehicle .entity-link { white-space: nowrap; }
  /* Smaller date cells: 5-6 fit instead of 3-4 */
  .fleet-th-date, .fleet-cell-free { min-width: 28px !important; width: 28px !important; }
  .fleet-th-date { font-size: .6rem; padding: .35rem .05rem; }
  /* Fleet table doesn't need 900px min — let it fit available space */
  .fleet-table { min-width: 0; }

  /* Availability filter chips: one-line swipeable strip. This used to be
     flex-wrap:wrap + overflow-x:visible, but the base .filter-bar rule forces
     nowrap !important, so the chips (owner + vehicle + date, ~1400px) ran off
     the page and were clipped by #content with no way to scroll — same bug as
     the rentals owner row. Keep the inherited nowrap; make overflow scroll. */
  .fleet-controls {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    margin: 0 -.25rem .5rem;
    padding: 0 .25rem .3rem;
  }
  /* Two classes, to stay ahead of the desktop rule of the same weight. */
  .fleet-controls .fleet-control-input { min-height: 36px; height: 36px; }

  /* Pagination nav: keep it on a single row, scroll if needed */
  .fleet-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -.25rem .75rem;
    padding: 0 .25rem .25rem;
  }
  .fleet-nav > * { flex-shrink: 0; }
  .fleet-nav-label { font-size: .8rem; }

  /* ── VEHICLES ── */
  /* Compact card: less padding, smaller header */
  .vehicles-manage .vehicle-card { padding: .8rem; }
  .vehicle-card-header { margin-bottom: .6rem; padding-top: .15rem; }
  .vehicle-card-header h3 { font-size: 1rem; }
  .vehicle-stats { margin: .6rem 0; padding: .5rem .2rem; }
  .vehicle-status-select { font-size: .8rem; min-height: 36px; padding: 0 .5rem; }


  /* Finance by-vehicle (mobile): hide secondary columns to make the table scannable.
     Cols: 1=chevron 2=Vehicle 3=Owner 4=Rnt 5=Days 6=Idle 7=Util% 8=Len 9=Client/d
           10=Owner/d 11=Profit/Rnt 12=Owner€ 13=Client€ 14=Profit 15=Booked
     Keep: Vehicle, Util%, Profit, Booked. Rest is horizontally scrollable. */
  .finance-vehicle-table th:nth-child(6),
  .finance-vehicle-table td:nth-child(6),
  .finance-vehicle-table th:nth-child(8),
  .finance-vehicle-table td:nth-child(8),
  .finance-vehicle-table th:nth-child(10),
  .finance-vehicle-table td:nth-child(10),
  .finance-vehicle-table th:nth-child(12),
  .finance-vehicle-table td:nth-child(12) { display: none; }

  /* Stat value slightly smaller to fit 2-col */
  .stat-value { font-size: 1.35rem; }

  /* ── TOUCH-FRIENDLY BUTTONS ── */
  /* Increase all button minimum touch targets to 44px */
  .btn {
    min-height: 44px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    border-radius: 8px;
  }
  .btn-sm { min-height: 40px; padding: 0.5rem 0.75rem; }
  .btn-xs { min-height: 36px; padding: 0.35rem 0.6rem; }
  /* Fleet's status strip shares the header row with Add Vehicle; at the 44px
     touch size five pills took three rows, so these stay compact chips. */
  .fleet-status-filter .btn-xs {
    min-height: 28px;
    padding: .25rem .55rem;
    font-size: .74rem;
    border-radius: 6px;
  }
  .btn-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .btn-icon svg { width: 20px; height: 20px; }

  /* ── FORM INPUTS ── */
  /* Checkboxes/radios are excluded: a 44px-tall, 0.65rem-padded checkbox is
     what made the Offer Maker filter boxes tower over their labels. Their tap
     target comes from the wrapping label, not the box itself. */
  /* :where() so the exclusion costs no specificity — a plain :not() here would
     outrank .search-wrap .search-input and eat its icon padding. */
  input:where(:not([type="checkbox"]):not([type="radio"])), select, textarea {
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    font-size: 16px; /* Prevent zoom on iOS */
    border-radius: 8px;
  }
  textarea { min-height: 100px; }

  /* ── MOBILE CARD SIMPLIFICATIONS ── */
  .card { margin-bottom: 1rem; }
  /* Title and its count / small controls share a line and wrap only when
     they don't fit — stacking every header cost a line on most cards. */
  .card-header { flex-direction: row; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .8rem 1rem; }
  .card-header h3 { width: 100%; }

  /* Owner detail: simplified tabs */
  .owner-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }
  .owner-tab {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  /* Every tab in sight: four or more (Reports, Settings, an owner's page) ran
     off the right edge, and the rest were only found by swiping. */
  .owner-tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; }

  /* Vehicle cards: single column on mobile (compact rules above in DASHBOARD/VEHICLES block) */
  .vehicle-grid { grid-template-columns: 1fr; }

  /* Settlement: stack to single-column owner grid */
  .settlement-owner-grid { grid-template-columns: 1fr; }

  /* Owner vehicles tab: simplified */
  .stat-grid { grid-template-columns: 1fr; }

  /* ── MODAL IMPROVEMENTS ── */
  #modal-box { width: 100%; }
  .modal-header { padding: 1.25rem; }
  #modal-body { padding: 1.25rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }

  /* Form rows: full width on mobile */
  .form-group { width: 100%; }
  label { font-size: 0.95rem; margin-bottom: 0.35rem; }

  /* ── TABLE SIMPLIFICATIONS ── */
  table { font-size: 0.85rem; }
  th, td { padding: 0.75rem 0.5rem; }

  /* Settlement table: swipe-friendly */
  .settlement-table { font-size: 0.8rem; }
  .settlement-row { padding: 1rem 0.75rem; }

  /* ── SPACING & GAP ADJUSTMENTS ── */
  .section { margin-bottom: 1.5rem; padding: 1rem; }
  .chart { margin-bottom: 1.5rem; }

  /* Owner detail header: stack on mobile */
  .owner-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .owner-header-info h2 { font-size: 1.5rem; }
  .owner-header-actions { width: 100%; display: flex; gap: 0.5rem; }
  .owner-header-actions button { flex: 1; }

  /* ── BOTTOM NAV IMPROVEMENTS ── */
  .mob-link {
    min-height: 50px;
    font-size: 0.7rem;
  }
  .mob-link svg { width: 22px; height: 22px; }

  /* Increase bottom padding for content under mobile nav (account for safe-area too) */
  #content { padding: calc(env(safe-area-inset-top, 0px) + 1rem) 0.75rem calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 1.5rem); }
}

/* Sidebar overlay for mobile */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}
#sidebar-overlay.visible { display: block; }

/* ── TODAY BANNER ── */
.today-banner { margin-bottom: .85rem; border-left: 3px solid var(--primary); }
.today-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.today-col {
  padding: .55rem .9rem;
}
.today-col + .today-col {
  border-left: 1px solid var(--border);
}
.today-col-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}
.today-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .15rem 0;
  font-size: .8rem;
}
.today-col-times {
  display: inline-flex;
  gap: .25rem;
  margin-left: .5rem;
  vertical-align: middle;
}
.today-col-times .today-time { font-size: .65rem; padding: .1rem .4rem; }
.today-vehicle { font-weight: 600; }
.today-client  { color: var(--text-muted); }
.today-phone   { color: var(--primary-ink); font-size: .75rem; text-decoration: underline; }
/* One line per handover: time · car · renter · call. */
.today-row { flex-wrap: nowrap; align-items: center; }
.today-list { padding: .4rem .9rem .5rem; }
.today-row .today-time { flex: 0 0 3.6rem; font-weight: 700; font-size: .78rem; font-variant-numeric: tabular-nums; }
.today-row .today-time.handout { color: var(--success); }
.today-row .today-time.return  { color: var(--danger); }
/* Ticked done (on the calendar or here): greyed and struck through, as on
   the calendar's day cards, and left out of the "to do" count. */
.today-row.is-done { opacity: .5; }
.today-row.is-done .today-main { text-decoration: line-through; }
.today-main {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.today-main:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; border-radius: 4px; }
.today-call {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; color: var(--primary-ink);
}
.today-call:hover { background: var(--bg-hover, rgba(148,163,184,.1)); }
.today-call i, .today-call svg { width: 15px; height: 15px; }

/* ── STATUS BADGES ── */
.status-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.status-upcoming { background: rgba(99,102,241,.12); color: #6366f1; }
.status-active   { background: rgba(59,130,246,.12); color: #3b82f6; }
.status-returned { background: rgba(245,158,11,.12); color: #d97706; }
.status-paid     { background: rgba(34,197,94,.12);  color: #16a34a; }

/* ── IDLE LOCK WARNING ── */
#idle-warning {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: #fff;
  padding: .6rem 1.2rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  z-index: 9999;
  display: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

/* ── Checkbox component ────────────────────────────────────────────────────
   Custom-drawn (appearance:none) because iOS Safari inflates an unstyled
   checkbox to ~44px regardless of the surrounding font-size, which is what made
   the Offer Maker filter checkboxes tower over their 11px labels. Drawing the
   box ourselves means no UA has a say in its size. */
.ck {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex: 0 0 18px; margin: 0; padding: 0;
  min-width: 18px; max-width: 18px; min-height: 18px;
  border: 1.5px solid var(--border-strong); border-radius: 4px;
  background: var(--bg-card); cursor: pointer;
  display: inline-grid; place-content: center;
  transition: background var(--transition), border-color var(--transition);
}
.ck::after {
  content: ''; width: 10px; height: 10px; transform: scale(0);
  transition: transform .12s ease;
  background: #fff;
  clip-path: polygon(14% 44%, 0 60%, 39% 100%, 100% 18%, 84% 0, 39% 68%);
}
.ck:hover { border-color: var(--primary); }
.ck:checked { background: var(--primary); border-color: var(--primary); }
.ck:checked::after { transform: scale(1); }
.ck-wa:checked { background: #25d366; border-color: #25d366; }
.ck-wa:hover { border-color: #25d366; }

/* ── Offer Maker ── */
.offer-section { margin-top: 1.25rem; }
.offer-inline-check {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--text-muted); cursor: pointer;
}
.offer-checks { display: inline-flex; align-items: center; gap: 1rem; margin-left: .35rem; }
.offer-summary {
  display: flex; justify-content: flex-end; align-items: center;
  flex-wrap: wrap; gap: .5rem; margin: 0 0 .85rem;
}
.offer-summary-range { font-size: .85rem; color: var(--text-muted); }
.offer-summary-range strong { color: var(--text); }
.offer-section-title {
  font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  margin: 0 0 .6rem; display: flex; align-items: center; gap: .5rem;
}
.offer-count {
  font-size: .7rem; padding: 1px 7px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted);
  font-weight: 600;
}
/* Section headers carry their status color so Available / Tight / Booked read
   at a glance, and the count pill tracks its header. */
.offer-section-title.offer-available { color: var(--success); }
.offer-section-title.offer-tight     { color: var(--warning); }
.offer-section-title.offer-booked    { color: var(--danger); }
.offer-available .offer-count { color: var(--success); border-color: rgba(22,163,74,.4);  background: rgba(22,163,74,.08); }
.offer-tight     .offer-count { color: var(--warning); border-color: rgba(217,119,6,.4);  background: rgba(217,119,6,.08); }
.offer-booked    .offer-count { color: var(--danger);  border-color: rgba(220,38,38,.4);  background: rgba(220,38,38,.08); }
.offer-grid {
  display: grid; gap: .75rem;
  /* 340px: with the photo tile in the head row, a 300px column squeezed
     "A3 Black Manual" onto three lines. */
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
}
.offer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem .9rem;
  display: flex; flex-direction: column; gap: .35rem;
  position: relative;
  transition: transform .12s, box-shadow .12s;
}
.offer-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.offer-card-available { border-left: 3px solid var(--success); }
.offer-card-tight     { border-left: 3px solid var(--warning); background: rgba(217,119,6,.05); }
.offer-card-booked    { border-left: 3px solid var(--danger); background: rgba(220,38,38,.06); }
.offer-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin-bottom: .15rem;
}
/* Listing photo tile. Fixed 4:3 box so a card with no photo (car icon) keeps the
   same head geometry as one with. The icon sits behind the photo and only shows
   through when there is no <img> — or the one we got 404s (.is-empty). */
.veh-thumb {
  flex: 0 0 56px; width: 56px; height: 42px;
  border-radius: 6px; overflow: hidden; position: relative;
  background: var(--bg-secondary); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light);
  transition: transform .12s, border-color .12s;
}
.veh-thumb:hover { border-color: var(--primary); transform: scale(1.04); }
.veh-thumb:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; }
.veh-thumb i, .veh-thumb svg { width: 20px; height: 20px; }
.veh-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.veh-thumb.is-empty img { display: none; }
/* Brand logo standing in for a photo, on the ordinary tile. Black and silver
   marks would vanish on the dark theme, so those (Catalog.LOGOS_LIFT_ON_DARK)
   get their lightness flipped there; hue-rotate(180) undoes invert's hue flip. */
.veh-thumb img.veh-logo { object-fit: contain; padding: 14%; box-sizing: border-box; }
.veh-thumb.is-logo i, .veh-thumb.is-logo svg { display: none; }
[data-theme="dark"] .veh-thumb img.veh-logo--lift { filter: invert(1) hue-rotate(180deg); }
.veh-thumb--lg { flex-basis: 96px; width: 96px; height: 72px; border-radius: 8px; }
/* Maker badge: the brand's mark, small, bottom-left on the photo. No chip —
   the mark is drawn white with a soft shadow, so it reads on a black car and
   a white one alike (the logo files are dark or coloured, made for a light
   tile). Only shown over a real photo; a logo-only or empty tile already
   says the brand. */
.veh-badge {
  --badge: 20px;
  position: absolute; left: 3px; bottom: 3px; z-index: 1; pointer-events: none;
  width: var(--badge); height: var(--badge);
  display: flex; align-items: center; justify-content: center;
}
.veh-thumb .veh-badge img {
  position: static; inset: auto; width: 100%; height: 100%; object-fit: contain; display: block;
  filter: brightness(0) invert(1) drop-shadow(0 0 1px rgba(0,0,0,.8)) drop-shadow(0 1px 2px rgba(0,0,0,.6));
}
.veh-thumb.is-logo .veh-badge, .veh-thumb.is-empty .veh-badge, .veh-thumb:not(:has(> img)) .veh-badge { display: none; }
.veh-thumb--lg .veh-badge { --badge: 26px; left: 5px; bottom: 5px; }
.car-tile .veh-badge { --badge: 24px; left: 4px; bottom: 4px; }
.car-pick .veh-badge { --badge: 16px; left: 2px; bottom: 2px; }
@media (max-width: 560px) {
  .veh-badge { --badge: 18px; left: 2px; bottom: 2px; }
  .car-tile .veh-badge { --badge: 22px; left: 3px; bottom: 3px; }
  .car-pick .veh-badge { --badge: 16px; }
}
.veh-thumb--lg i, .veh-thumb--lg svg { width: 28px; height: 28px; }
/* Rental form vehicle picker: a select-shaped button showing the chosen car's
   photo, opening a photo grid of the owner's cars. The real <select> stays in
   the DOM (visually hidden) as the value the form saves. */
.car-pick-native {
  position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important;
  padding: 0 !important; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0 !important; opacity: 0;
}
.car-pick {
  width: 100%; min-height: 2.6rem; display: flex; align-items: center; gap: .6rem;
  padding: .3rem .65rem .3rem .3rem; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font: inherit; font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.car-pick:hover:not(:disabled) { border-color: var(--border-strong); }
.car-pick:focus-visible, .car-pick[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); outline: none; }
.car-pick:disabled { cursor: not-allowed; opacity: .6; }
.car-pick .veh-thumb { flex-basis: 44px; width: 44px; height: 33px; border-radius: 4px; }
.car-pick .veh-thumb:hover { transform: none; }
.car-pick-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.car-pick-name.is-placeholder { padding-left: .4rem; color: var(--text-muted); }
.car-pick-note { color: var(--text-muted); font-size: .75rem; font-weight: 400; }
.car-pick-chev {
  flex: 0 0 16px; width: 16px; height: 16px; fill: none; stroke: var(--text-muted);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease-spring);
}
.car-pick[aria-expanded="true"] .car-pick-chev { transform: rotate(180deg); }
.car-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .45rem;
  margin: -.25rem 0 1rem; padding: .45rem; max-height: min(17rem, 45vh); overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-secondary);
  animation: car-grid-in .22s var(--ease-spring);
}
.car-grid[hidden] { display: none; }
@keyframes car-grid-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.car-tile {
  display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--text); font: inherit;
  transition: border-color var(--transition), transform .12s;
}
.car-tile:hover { border-color: var(--primary); }
.car-tile:active { transform: scale(.98); }
.car-tile:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; }
.car-tile.is-on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.car-tile .veh-thumb {
  flex: none; width: 100%; height: auto; aspect-ratio: 16 / 10; border: 0; border-radius: 0;
}
.car-tile .veh-thumb:hover { transform: none; }
.car-tile .veh-thumb i, .car-tile .veh-thumb svg { width: 20px; height: 20px; }
.car-tile-name {
  padding: .3rem .4rem; font-size: .72rem; font-weight: 600; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.car-tile .car-pick-note { padding: 0 .4rem .3rem; margin-top: -.2rem; font-size: .65rem; }
.car-grid-empty { grid-column: 1 / -1; margin: .25rem; color: var(--text-muted); font-size: .85rem; }
/* Is the car free for the form's dates? A dark pill with a coloured dot sits
   on the tile's photo (readable over any picture, in both themes); under the
   closed picker, a line of text says who has the car — only when it clashes. */
.car-tile { position: relative; }
.car-status {
  display: inline-flex; align-items: center; gap: .3rem; flex: none;
  padding: .12rem .45rem; border-radius: 999px; font-size: .68rem; font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.car-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.car-tile .car-status {
  position: absolute; top: 4px; right: 4px; color: #fff; background: rgba(15,23,42,.78);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.car-tile .car-status.is-free::before   { background: #4ade80; }
.car-tile .car-status.is-tight::before  { background: #fbbf24; }
.car-tile .car-status.is-booked::before { background: #f87171; }
.car-tile.is-booked .veh-thumb, .car-tile.is-booked .car-tile-name { opacity: .5; }
.car-pick-clash:empty { display: none; }
.car-pick-clash { margin-top: .35rem; font-size: .75rem; line-height: 1.35; font-weight: 500; }
.car-pick-clash .is-tight  { color: var(--warning); }
.car-pick-clash .is-booked { color: var(--danger); }
.find-free-row { display: flex; justify-content: flex-end; margin: -.35rem 0 .9rem; }
/* Offer Maker while the rental form's "Find a free car" is choosing here. */
.offer-swap-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1rem; padding: .7rem .85rem; border-radius: var(--radius-sm);
  border: 1px solid var(--primary); background: var(--primary-light); font-size: .9rem;
}
.offer-swap-text { flex: 1 1 220px; min-width: 0; }
.offer-swap-warn { margin-top: .25rem; font-size: .78rem; color: var(--warning); }
@media (max-width: 560px) {
  .car-pick { min-height: 44px; font-size: 16px; }
  /* Beat the phone-wide !important thumb size (Offer Maker cards). */
  .car-tile .veh-thumb { flex-basis: auto !important; width: 100% !important; height: auto !important; }
  .car-pick .veh-thumb { flex-basis: 44px !important; width: 44px !important; height: 33px !important; }
  .car-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .car-grid { animation: none; }
  .car-pick-chev, .car-tile { transition: none; }
}
/* Fleet cards have the room — a slightly bigger photo reads better at a glance. */
.vehicle-card .veh-thumb { flex-basis: 68px; width: 68px; height: 51px; }
/* Fleet inventory card: the owner line lines up with the name, past the tile. */
.vehicle-card-owner--thumbed { margin-left: calc(56px + 0.5rem + 14px + 0.45rem); }
/* Owner page card: the header becomes tile + name, pill on the right. */
.vehicle-card-header { display: flex; align-items: center; gap: 0.6rem; }
.vehicle-card-header .badge { flex-shrink: 0; }
.offer-card-id { display: flex; align-items: baseline; gap: .4rem; min-width: 0; flex: 1 1 auto; flex-wrap: wrap; }
.offer-card-head strong {
  font-size: .9rem; line-height: 1.25; min-width: 0;
  /* Two lines at most, broken between words — never mid-word. */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; overflow-wrap: normal; word-break: normal;
}
.offer-card-head strong a:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; border-radius: 3px; }
.offer-owner { font-size: .72rem; color: var(--text-muted); }
.offer-status-badge { font-size: .64rem; padding: .05rem .4rem; align-self: center; }
.offer-status-off { background: rgba(148,163,184,.18); color: var(--text-muted); border: 1px dashed var(--border); }
.offer-card-off .veh-thumb,
.offer-card-off .offer-price-row,
.offer-card-off .offer-timeline { opacity: .55; }
.offer-card-off .offer-card-head strong a { color: var(--text-muted); }
.offer-head-right {
  display: flex; align-items: center; gap: .6rem; flex-shrink: 0;
  flex-wrap: wrap; justify-content: flex-end;
}
.offer-price-row { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.offer-total {
  font-size: 1.25rem; font-weight: 800; color: var(--text); line-height: 1.1;
  white-space: nowrap;
}
.offer-reserve { white-space: nowrap; }
.offer-reserve-anyway { color: var(--danger); border-color: rgba(220,38,38,.45); background: rgba(220,38,38,.06); }
.offer-reserve-anyway:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.offer-rate-line { font-size: .78rem; color: var(--text-muted); }
.offer-basis { font-size: .7rem; color: var(--text-muted); font-style: italic; opacity: .85; }
.offer-warn {
  font-size: .75rem; color: var(--warning); margin-top: .35rem;
  padding: .35rem .5rem; background: rgba(217,119,6,.08); border-radius: 4px; line-height: 1.4;
}
.offer-card-booked .offer-warn { color: var(--danger); background: rgba(220,38,38,.10); }

/* ── Offer Maker: multi-select → send on WhatsApp ── */
.offer-select { display: inline-flex; align-items: center; flex-shrink: 0; cursor: pointer; }
.offer-card.selected {
  border-color: #25d366;
  box-shadow: 0 0 0 1px #25d366 inset;
}
.offer-send-bar { display: none; }
.offer-send-bar.on {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  flex-wrap: wrap;
  position: sticky; top: .5rem; z-index: 20;
  margin-bottom: 1rem; padding: .6rem .85rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid #25d366; border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.offer-send-count { font-size: .85rem; color: var(--text); }
.offer-send-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.offer-send-wa { background: #25d366; border-color: #25d366; color: #fff; white-space: nowrap; }
.offer-send-wa:hover { background: #1eb457; border-color: #1eb457; }
.offer-copy-one { padding: .35rem .5rem; flex-shrink: 0; }

/* Mini availability timeline — shares the fleet Gantt's bar colors */
.offer-timeline { margin-top: .5rem; }
.offer-tl-track {
  display: grid; align-items: center; position: relative;
  height: 20px; border-radius: 6px; overflow: hidden;
  background: var(--bg-subtle, rgba(0,0,0,.045));
}
.offer-tl-track > * { grid-row: 1; }        /* stack band + bars in one row */
.offer-tl-req {                              /* the requested pickup→dropoff window */
  height: 100%; z-index: 0; border-radius: 4px;
  background: rgba(217,119,6,.14);
  border: 1px dashed rgba(217,119,6,.6);
}
.offer-tl-bar {
  height: 15px; z-index: 1; overflow: hidden; cursor: pointer;
  font-size: .58rem; font-weight: 600; line-height: 15px;
  padding: 0 3px; white-space: nowrap;
  transition: filter .12s ease, transform .12s ease;
}
.offer-tl-bar:hover { filter: brightness(1.12); transform: translateY(-1px); }
.offer-tl-bar:focus-visible { outline: 2px solid var(--brand, #d97706); outline-offset: 1px; }
.offer-tl-bar span { display: block; overflow: hidden; text-overflow: ellipsis; }
/* Begin→end date sitting directly under each bar */
.offer-tl-daterow { display: grid; margin-top: .25rem; }
.offer-tl-daterow > * { grid-row: 1; }
.offer-tl-datelabel {
  font-size: .6rem; font-weight: 600; line-height: 1.2; cursor: pointer;
  text-align: center; white-space: nowrap; overflow: visible;
}
.offer-tl-datelabel:hover { text-decoration: underline; }
/* 'Your dates' caption keyed to the amber requested-window band */
.offer-tl-your {
  display: flex; align-items: center; gap: .35rem; flex-wrap: wrap;
  margin-top: .3rem; font-size: .7rem; color: var(--text-muted);
}
.offer-tl-your strong { font-weight: 600; color: var(--text); }
.offer-tl-band-dot {
  width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0;
  background: rgba(217,119,6,.16); border: 1px dashed rgba(217,119,6,.7);
}
.offer-tl-ok { color: var(--success); font-weight: 600; }

/* ═══ POLISH PASS: focus visibility + numeric alignment ═══
   Every clickable element gets a visible keyboard-focus ring (the accent color
   ring reads on both themes); pointer users are unaffected. Money/date columns
   use tabular figures so digits line up down a column. */
.btn:focus-visible,
.nav-link:focus-visible,
.mob-link:focus-visible,
.btn-icon:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-ink);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.res-table td,
.res-table th,
table td[style*="text-align:right"],
table td.u-right,
.receipt-row strong,
.receipt-total,
.stat-card .stat-value,
.pulse-list-meta {
  font-variant-numeric: tabular-nums;
}

/* Calendar color legend — sits at the end of the view-tabs row */
.cal-legend {
  display: flex; align-items: center; gap: .85rem;
  margin: -.35rem 0 .85rem;
  font-size: .74rem; color: var(--text-muted); white-space: nowrap;
}
/* Dark mode lives in Settings; the computer menu is for going places. */
@media (min-width: 701px) { .drawer-actions li:has(#drawer-theme) { display: none; } }
.cal-legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.cal-legend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.cal-legend-check { color: var(--success); font-weight: 700; }
@media (max-width: 700px) { .cal-legend { display: none; } } /* self-evident on the compact agenda; save the row */


/* ── Action menu (⋯ popover for row/card actions) ── */
.action-menu {
  position: fixed; z-index: 10000; min-width: 208px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: .3rem; display: flex; flex-direction: column;
  transform-origin: top right;
  animation: menu-pop .22s var(--ease-spring);
}
@keyframes menu-pop { from { opacity: 0; transform: scale(.94); } }
.action-menu.is-leaving { animation: menu-out .13s ease-in forwards; }
@keyframes menu-out { to { opacity: 0; transform: scale(.94); } }
@media (prefers-reduced-motion: reduce) {
  .action-menu, .action-menu.as-sheet, #modal-overlay, #modal-box { animation: none; }
}
/* Phone bottom sheet (Utils.actionMenu adds .as-sheet at ≤700px). */
.action-menu-backdrop {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(2,6,23,.45);
  animation: backdrop-in .2s ease;
}
@keyframes backdrop-in { from { opacity: 0; } }
.action-menu.as-sheet {
  left: 0; right: 0; bottom: 0; top: auto;
  min-width: 0;
  border: 0; border-radius: 18px 18px 0 0;
  padding: 1.35rem .6rem calc(.75rem + env(safe-area-inset-bottom, 0px));
  /* The solid second shadow fills the gap when the sheet is pulled up past its rest. */
  box-shadow: 0 -12px 40px -12px rgba(2,6,23,.45), 0 120px 0 0 var(--bg-card);
  animation: sheet-up .36s var(--ease-spring);
}
.action-menu.as-sheet::before {
  content: ""; position: absolute; top: .5rem; left: 50%;
  width: 36px; height: 4px; margin-left: -18px;
  border-radius: 999px; background: var(--border-strong);
}
@keyframes sheet-up { from { transform: translateY(100%); } }
.action-menu.as-sheet .action-menu-item { min-height: 48px; padding: .7rem .8rem; font-size: 1rem; gap: .8rem; border-radius: 10px; }
.action-menu.as-sheet .action-menu-item svg { width: 19px; height: 19px; }
.action-menu.as-sheet .action-menu-sep { margin: .35rem .8rem; }
.action-menu-item {
  display: flex; align-items: center; gap: .55rem;
  width: 100%; padding: .48rem .6rem; border: 0; background: none;
  font: inherit; font-size: .84rem; color: var(--text); text-align: left;
  border-radius: var(--radius-sm); cursor: pointer;
}
.action-menu-item:hover, .action-menu-item:focus-visible { background: var(--bg-hover); }
/* Long menus (e.g. the Reports period) scroll instead of running off screen. */
.action-menu { max-height: min(70vh, 560px); overflow-y: auto; }
.action-menu.as-sheet { max-height: 80vh; }
.action-menu-check { margin-left: auto; color: var(--primary-ink); flex-shrink: 0; }

/* Reports on phones: the Period button and the revenue scope share one row —
   the field names go, the calendar icon and the ⓘ say enough. */
@media (max-width: 560px) {
  .reports-filter-bar .rf-lbl { display: none; }
  .reports-filter-group { margin-right: .3rem; }
}
/* Period comparison: the dates are the title, the MoM/QoQ/YoY switch sits beside them. */
.cmp-basis { margin-bottom: 1rem; }
.cmp-basis-title { font-size: .85rem; font-weight: 600; margin-bottom: .55rem; }
.cmp-basis-title span { font-weight: 400; color: var(--text-muted); margin-left: .25rem; }
.cmp-block > .card-header { flex-direction: row !important; align-items: center !important; flex-wrap: wrap; gap: .5rem; }
/* Reports: one Period field beside the revenue scope. */
.reports-filter-group { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin-right: .6rem; }
.reports-period-btn { white-space: nowrap; }
.reports-period-btn.is-set { color: var(--primary-ink); border-color: var(--primary); }
/* Period comparison: a figure never breaks across lines ("€" alone on one). */
.cmp-card .stat-value, .cmp-card .stat-value + div { white-space: nowrap; }
@media (max-width: 560px) { .cmp-card .stat-value { font-size: 1.3rem; } }
/* A stat label with an ⓘ: the words may truncate, the ⓘ never does. */
.stat-label.stat-label-tip { display: flex; align-items: center; overflow: visible; }
.stat-label.stat-label-tip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Settlement: an owner row opens that owner's payments. */
.settlement-owner-card.is-link { cursor: pointer; }
.settlement-owner-card.is-link:hover { border-color: var(--border-strong); }
.settlement-owner-card.is-link:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; }

/* Goals tab: the three counts sit side by side on phones too; one Sort menu. */
@media (max-width: 560px) {
  .stat-strip.goals-summary { grid-template-columns: repeat(3, 1fr); }
  /* A third of a phone is too narrow for label, qualifier and number on one
     line — stack them instead of truncating the label. */
  .stat-strip.goals-summary .stat-card { display: grid; gap: .05rem; padding: .45rem .6rem .45rem .75rem; }
  .stat-strip.goals-summary .stat-card { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .35rem; }
  .stat-strip.goals-summary .stat-value { order: 1; margin: 0; }
  .stat-strip.goals-summary .stat-label { order: 2; }
  .stat-strip.goals-summary .stat-sub   { order: 3; flex-basis: 100%; }
}
/* Goal cards keep the status and ⋮ on the title's line on phones too. */
.goal-card > .card-header { flex-direction: row; align-items: center; flex-wrap: nowrap; }
.goals-sort { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--text-muted); }
.goals-sort select {
  padding: .3rem .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text); font: inherit; font-size: .82rem;
}

/* Requests: when it happened, and (on closed requests) a small message icon. */
.req-when { display: flex; align-items: center; justify-content: flex-end; gap: .25rem; margin-top: .3rem; font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.req-msg-btn { padding: .2rem !important; min-width: 0 !important; min-height: 0 !important; }
.req-msg-btn i, .req-msg-btn svg { width: 15px; height: 15px; }

/* Owner / vehicle pages: Back sits beside the title. */
.detail-title { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.detail-back { flex: 0 0 auto; width: 36px; height: 36px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
.detail-back i, .detail-back svg { width: 18px; height: 18px; }
/* Owner payments */
.pay-filter { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.pay-filter-period { display: inline-flex; align-items: center; gap: .35rem; margin-right: auto; font-size: .85rem; font-weight: 600; }
.pay-filter-period > i, .pay-filter-period > svg { color: var(--text-muted); }
.pay-filter-actions { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.pay-head { display: flex; flex-direction: column; }
.pay-head small { font-size: .78rem; font-weight: 500; color: var(--text-muted); }
.pay-list { display: none; }
.pay-row { display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; border-top: 1px solid var(--border); cursor: pointer; }
.pay-row:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: -2px; }
.pay-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pay-car { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-car span { font-weight: 400; color: var(--text-muted); }
.pay-meta { font-size: .75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-amt { flex: 0 0 auto; font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.pay-row .badge { cursor: pointer; flex: 0 0 auto; }
@media (max-width: 700px) {
  .pay-table { display: none; }
  .pay-list { display: block; }
  /* Detail headers: tighter card, one row of short buttons. */
  .owner-header { padding: 1rem; }
  .owner-header-info { gap: .85rem; }
  .owner-header-actions { flex-wrap: nowrap; }
  .owner-header-actions .btn { flex: 1 1 auto; min-width: 0; white-space: nowrap; justify-content: center; padding-left: .55rem; padding-right: .55rem; }
  .owner-header h1 { font-size: 1.35rem !important; }
  /* Stat strips with a page of figures: two to a row, not one — label and
     count on top, the figure under them, so nothing has to be cut short. */
  .stat-grid.stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-grid.stat-strip .stat-card { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: .4rem; row-gap: .1rem; }
  .stat-grid.stat-strip .stat-label { grid-column: 1; grid-row: 1; }
  .stat-grid.stat-strip .stat-sub   { grid-column: 2; grid-row: 1; }
  .stat-grid.stat-strip .stat-value { grid-column: 1 / -1; grid-row: 2; margin: 0; }
}

/* Rental details: a second line under a value (phone, owner, place). */
.res-info-row strong small { display: block; margin-top: .1rem; font-size: .8rem; font-weight: 400; color: var(--text-muted); }
.res-info-row strong small a { color: inherit; }
.res-info-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding-top: .7rem; }
.res-info-money > div { display: flex; flex-direction: column; gap: .1rem; }
.res-info-money span { font-size: .72rem; color: var(--text-muted); }
.res-info-money strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
/* Rental details: what each edit changed (RentalHistory.html), folded. */
/* Edit rental: customer changes — "+ days" under the window, past changes,
   and the live "This change" box above Save. */
.f-extend-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.f-extend-chip { padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-card); color: var(--text); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; transition: transform .12s ease; }
.f-extend-chip:hover { border-color: var(--info); color: var(--info); }
.f-extend-chip:focus-visible { outline: 2px solid var(--info); outline-offset: 1px; }
.f-extend-chip:active { transform: scale(.96); }
.res-info-ext.form-changes { margin: 0 0 .9rem; }
.f-was { color: var(--info) !important; font-weight: 600; }
.f-change-summary { margin: 0 0 1rem; padding: .7rem .8rem; border: 1px solid color-mix(in srgb, var(--info) 40%, var(--border)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--info) 7%, transparent); font-size: .85rem; line-height: 1.45; }
.f-change-summary[hidden] { display: none; }
.f-change-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--info); margin-bottom: .2rem; }
.f-change-warn { margin-top: .4rem; color: var(--warning); font-weight: 600; font-size: .8rem; }
.f-change-warn[hidden] { display: none; }
.f-change-note { display: flex; flex-direction: column; gap: .25rem; margin-top: .55rem; font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.f-change-note small { font-weight: 400; }
.f-change-summary .f-change-note input { width: 100%; box-sizing: border-box; }
.res-info-ext { margin-top: .75rem; padding: .55rem .7rem; border-radius: 8px; background: var(--info-light); font-size: .84rem; }
.res-info-ext > span { display: block; font-weight: 700; color: var(--info); margin-bottom: .2rem; }
.res-info-ext ul { margin: 0; padding-left: 1rem; }
.res-info-ext li { margin: .1rem 0; }
.res-ext-badge { margin-left: .3rem; font-size: .7rem; padding: .05rem .35rem; vertical-align: middle; }
.res-info-changes { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid var(--border); font-size: .82rem; }
.res-info-changes summary { cursor: pointer; color: var(--text-muted); font-weight: 600; }
.res-info-changes summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.res-info-changes ul { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .45rem; }
.res-info-changes li { line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.res-info-changes li > span { color: var(--text-muted); margin-right: .3rem; font-variant-numeric: tabular-nums; }
/* Edit rental: cancelling the booking sits at the end of the form, not
   beside the footer's "Cancel". */
.form-cancel-row { display: flex; justify-content: flex-start; margin: .25rem 0 .75rem; }

/* ⓘ — an explanation on demand (Utils.infoTip / showTip). */
.info-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; margin-left: .25rem; border: 0; border-radius: 999px;
  background: none; color: var(--text-light); cursor: pointer; vertical-align: -3px; flex-shrink: 0;
}
.info-tip i, .info-tip svg { width: 14px; height: 14px; }
.info-tip:hover { color: var(--text-muted); }
.info-tip:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 1px; }
@media (pointer: coarse) { .info-tip { width: 28px; height: 28px; margin: -5px -5px -5px -.1rem; } }
.info-pop {
  position: fixed; z-index: 10001; max-width: min(300px, calc(100vw - 16px));
  padding: .55rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-lg);
  font-size: .78rem; font-weight: 400; line-height: 1.45; text-transform: none; letter-spacing: 0;
  animation: menu-pop .18s var(--ease-spring);
}
.action-menu-item:active { background: var(--bg-secondary); }
.action-menu-item svg { width: 15px; height: 15px; color: var(--text-muted); flex: 0 0 auto; }
.action-menu-item.danger, .action-menu-item.danger svg { color: var(--danger); }
.action-menu-item.danger:hover { background: var(--danger-light); }
.action-menu-sep { height: 1px; background: var(--border); margin: .3rem .35rem; }

/* ── Date picker (replaces the one-month native calendar) ── */
.dp-pop {
  position: fixed; z-index: 10001;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: .7rem; user-select: none;
}
/* The native calendar is gone, so its trigger icon would be a dead affordance. */
input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
input[type="date"] { cursor: pointer; }

/* Rental History filters (owner and car pages). iPhone Safari draws an empty
   date input with no text and won't let it shrink below its own width, so each
   one needs a visible caption and an explicit min-width: 0 or it spills out of
   the card. Scoped to the parent: the base input[type="date"] rule outranks a
   lone class. */
.history-filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .5rem; align-items: end; margin-bottom: 1rem; padding: 0 1rem;
}
.history-filters > * { min-width: 0; }
.history-date { display: block; }
.history-date > span {
  display: block; margin-bottom: .25rem;
  font-size: .75rem; color: var(--text-muted, inherit);
}
.history-filters .history-date input[type="date"] {
  display: block; width: 100%; min-width: 0; max-width: 100%;
  box-sizing: border-box; -webkit-appearance: none; appearance: none;
}

/* On a phone each rental is a small card, like the Rentals page, so nothing
   falls off the edge: two lines (three on a car page, for the money), dates
   without times. Tapping the row opens it, so its pencil can go. */
@media (max-width: 700px) {
  .table-wrap:has(> .history-table) { touch-action: pan-y pinch-zoom; }
  .history-table thead { display: none; }
  .history-table, .history-table tbody, .history-table tr:not(.res-row), .history-table .empty-state { display: block; width: 100%; }
  .history-table .res-row {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: .75rem; row-gap: .15rem;
    grid-template-areas: "vehicle client profit" "dates days status" "toowner fromclient .";
    padding: .55rem 1rem; border-bottom: 1px solid var(--border);
  }
  .history-table .res-row td { display: block; padding: 0; border: 0; min-width: 0; text-align: left; }
  .history-table .h-dates { grid-area: dates; font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
  .history-table .h-dates strong { font-weight: 400; }
  .history-table .h-dates br, .history-table .history-time { display: none; }
  .history-table .h-dates .u-muted-xs { font-size: inherit; }
  .history-table .h-dates .u-muted-xs::before { content: " \2192  "; }
  .history-table .h-vehicle { grid-area: vehicle; font-weight: 600; }
  .history-table .h-client { grid-area: client; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .history-table:not(:has(.h-vehicle)) .h-client { grid-column: 1 / 3; font-weight: 600; }
  .history-table .h-days { grid-area: days; font-size: .8rem; color: var(--text-muted); }
  .history-table .h-days::after { content: " " attr(data-unit); }
  .history-table .h-profit { grid-area: profit; text-align: right; }
  .history-table .h-status { grid-area: status; text-align: right; }
  .history-table .h-to-owner, .history-table .h-from-client { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
  .history-table .h-to-owner { grid-area: toowner; }
  .history-table .h-from-client { grid-area: fromclient; }
  .history-table .h-to-owner::before { content: "Owner "; }
  .history-table .h-from-client::before { content: "Client paid "; }
  .history-table .res-row .h-phone, .history-table .res-row .h-edit { display: none; }
}

/* Owner page, Vehicles tab: one compact row per car (photo, name, a one-line
   summary, status and the two buttons) instead of a tall card. */
.owner-car-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: .6rem; padding: 1rem;
}
.owner-car-list .owner-car {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: .75rem; padding: .65rem .8rem; cursor: pointer; margin: 0;
}
.owner-car-list .owner-car .veh-thumb { flex-basis: 56px; width: 56px; height: 42px; }
.owner-car-main { min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.owner-car-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owner-car-meta { font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owner-car-side { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.owner-car-actions { display: flex; gap: .25rem; }
.owner-car:active { transform: scale(.99); }
@media (max-width: 700px) {
  .owner-car-list { grid-template-columns: 1fr; gap: 0; padding: 0; }
  .owner-car-list .owner-car { border: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--border); padding: .65rem 1rem; }
  .owner-car-meta { white-space: normal; }
}

.dp-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; }
.dp-nav {
  flex: 0 0 auto; width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font-size: 1.1rem; line-height: 1; cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.dp-nav:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.dp-nav:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 1px; }
/* The title row tracks the month columns below it, so the jump select lands
   over the first month and each further month gets a plain heading. */
.dp-titles { flex: 1 1 auto; display: flex; gap: 1rem; min-width: 0; }
.dp-titles > * { flex: 1 1 0; min-width: 0; text-align: center; }
.dp-jump {
  width: 100%; padding: .3rem .4rem;
  font-size: .82rem; font-weight: 600; text-align: center;
}
.dp-mlabel { align-self: center; font-size: .82rem; font-weight: 600; color: var(--text); }

/* pan-y keeps vertical scrolling with the browser while we take the sideways
   drag for paging months. */
.dp-months { display: flex; gap: 1rem; touch-action: pan-y; will-change: transform; }
/* Fixed, not fluid. With a flexible month the popover took its width from
   whatever its widest content happened to be — so the footer text changing as
   you hovered resized the whole calendar under the cursor. */
.dp-month { flex: 0 0 244px; width: 244px; }
.dp-dow, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
/* Separates the weeks, so a long range reads as one pill per row rather than
   a single solid block. The track fills the cell height exactly, so the gap
   has to come from the grid, not from insetting the track.

   The height is pinned to six rows — the most any month needs — because
   otherwise a 5-row month renders shorter and the whole popover resizes as
   you page through, sliding the grid and footer around under the cursor. */
.dp-grid {
  row-gap: 3px;
  grid-auto-rows: 34px;
  min-height: calc(6 * 34px + 5 * 3px);
  align-content: start;
}
.dp-dow span {
  font-size: .66rem; font-weight: 600; color: var(--text-light);
  text-align: center; padding-bottom: .2rem;
}
.dp-cell { position: relative; }
/* A fixed height rather than a square aspect ratio: the cells stretch with the
   popover, and on a full-width phone sheet an aspect-ratio day grows into a
   circle big enough to collide with its neighbours. */
.dp-day {
  position: relative; z-index: 1;
  display: block; width: 100%; max-width: 38px; height: 34px; margin: 0 auto;
  border: 0; background: none; padding: 0;
  font: inherit; font-size: .8rem; color: var(--text);
  border-radius: 999px; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.dp-day:hover:not([disabled]) { background: var(--bg-hover); }
.dp-day:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: -2px; }
.dp-day.dp-past { color: var(--text-light); }
.dp-day[disabled] { color: var(--text-light); opacity: .35; cursor: default; }
.dp-day.dp-today { font-weight: 700; box-shadow: inset 0 0 0 1px var(--border-strong); }
.dp-day.dp-sel,
.dp-day.dp-sel:hover { background: var(--primary); color: #fff; font-weight: 600; box-shadow: none; }

/* The span between the two dates. It sits behind the day buttons and bleeds
   past the cell edges so neighbouring days join into one continuous track;
   the first and last column of each week cap it, so a range that wraps a week
   reads as one pill per row rather than a bar running off the grid. */
.dp-in::before, .dp-pv::before {
  content: ''; position: absolute; inset: 0 -1px; z-index: 0;
  background: var(--primary-light);
}
.dp-pv::before { background: var(--bg-hover); }
.dp-start::before { left: 0; border-radius: 999px 0 0 999px; }
.dp-end::before   { right: 0; border-radius: 0 999px 999px 0; }
.dp-grid > :nth-child(7n+1)::before { left: 0; border-radius: 999px 0 0 999px; }
.dp-grid > :nth-child(7n)::before   { right: 0; border-radius: 0 999px 999px 0; }

/* Both ends of the window, spelled out with their hours. */
.dp-when {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-top: .6rem; padding-top: .55rem; border-top: 1px solid var(--border);
}
.dp-when-row { display: flex; align-items: center; gap: .45rem; flex: 1 1 0; min-width: 0; }
.dp-when-lbl {
  font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-light); flex: 0 0 auto;
}
/* Centred and fixed-width so stepping through dates of different lengths
   ("1 Aug" → "30 Sept") doesn't shuffle the buttons around it. */
.dp-when-date {
  flex: 1 1 auto; min-width: 62px; text-align: center;
  font-size: .82rem; font-weight: 600; color: var(--text);
}
.dp-step {
  flex: 0 0 auto; width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-muted);
  font: inherit; font-size: .9rem; line-height: 1; cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.dp-step:hover:not(:disabled) { background: var(--primary-light); color: var(--primary-ink); border-color: var(--primary); }
.dp-step:active:not(:disabled) { background: var(--primary); color: #fff; }
.dp-step:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 1px; }
.dp-step:disabled { opacity: .3; cursor: default; }
.dp-when-date.dp-when-empty { color: var(--text-light); font-weight: 400; }
/* ── Hour picker ──
   Our own, not the OS dropdown: 24 hours as one grid you hit in a single tap,
   in the popover's own visual language. It opens *over* the calendar rather
   than pushing it, so the popover keeps its fixed size. Hours only — every one
   of the 622 timestamps in the data sits exactly on the hour. */
.dp-timewrap { position: relative; flex: 0 0 auto; display: inline-flex; }
/* Chip + spinner welded into one control: nudging an hour is the common edit,
   opening the 24-hour grid is the rare one, so the nudge lives on the surface. */
.dp-timeset { display: inline-flex; align-items: stretch; }
.dp-time {
  padding: .28rem .5rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: 0;
  background: var(--bg); color: var(--text);
  font: inherit; font-size: .78rem; font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.dp-spin { display: flex; flex-direction: column; flex: 0 0 auto; }
.dp-hstep {
  display: flex; align-items: center; justify-content: center;
  flex: 1 1 0; width: 20px; padding: 0; min-height: 0;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.dp-hstep:first-child { border-radius: 0 var(--radius-sm) 0 0; border-bottom: 0; }
.dp-hstep:last-child  { border-radius: 0 0 var(--radius-sm) 0; }
.dp-hstep svg { width: 11px; height: 11px; }
.dp-hstep:hover:not(:disabled) { background: var(--primary-light); color: var(--primary-ink); border-color: var(--primary); }
.dp-hstep:active:not(:disabled) { background: var(--primary); color: #fff; }
.dp-hstep:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 1px; }
.dp-hstep:disabled { opacity: .3; cursor: default; }
.dp-time:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--border-strong); }
.dp-time[aria-expanded="true"] { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-light); }
.dp-time:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 1px; }
.dp-time:disabled { opacity: .45; cursor: default; }

/* Four columns of "09:00", under a heading, on a raised surface. Six columns
   of bare two-digit numbers was a month grid in all but name — and this panel
   opens directly over the real one. */
.dp-hours {
  position: absolute; bottom: calc(100% + 6px); right: 0; z-index: 3;
  display: block; padding: .45rem;
  background: var(--bg-secondary); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.dp-hours[hidden] { display: none; }
.dp-hours-head {
  display: flex; align-items: center; gap: .3rem;
  padding: 0 .2rem .35rem;
  font-size: .66rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-light); white-space: nowrap;
}
.dp-hours-head svg { width: 12px; height: 12px; }
.dp-hours-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.dp-hour {
  padding: .3rem .4rem;
  border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text);
  font: inherit; font-size: .74rem; font-variant-numeric: tabular-nums;
  white-space: nowrap; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.dp-hour-min { color: var(--text-light); }
.dp-hour:hover { background: var(--bg-hover); }
.dp-hour:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: -2px; }
.dp-hour-on, .dp-hour-on:hover { background: var(--primary); color: #fff; font-weight: 600; }
.dp-hour-on .dp-hour-min { color: rgba(255,255,255,.7); }

/* The quarter, under the hours it applies to. Its own rule rather than a fifth
   column of the grid above: which hour and how far past it are two different
   questions, and the divider is what says the hour chips carry whatever is
   chosen down here. Filled, not solid, so the hour stays the louder mark. */
.dp-mins {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px;
  margin-top: .4rem; padding-top: .4rem; border-top: 1px solid var(--border);
}
.dp-min {
  padding: .3rem .4rem;
  border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-light);
  font: inherit; font-size: .74rem; font-variant-numeric: tabular-nums;
  white-space: nowrap; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.dp-min:hover { background: var(--bg-hover); color: var(--text); }
.dp-min:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: -2px; }
.dp-min-on, .dp-min-on:hover { background: var(--primary-light); color: var(--primary-ink); font-weight: 600; }

.dp-foot {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
  margin-top: .6rem; padding-top: .55rem; border-top: 1px solid var(--border);
}
.dp-done {
  flex: 0 0 auto; padding: .35rem .9rem;
  border: 1px solid var(--primary); border-radius: var(--radius-sm);
  background: var(--primary); color: #fff;
  font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: background var(--transition);
}
.dp-done:hover { background: var(--primary-hover); }
.dp-done:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; }
/* Sits with the day count rather than with Done: it undoes the picking, it
   doesn't finish it. Dead until there is something to clear. */
.dp-reset {
  flex: 0 0 auto; padding: .3rem .65rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-muted);
  font: inherit; font-size: .74rem; font-weight: 600; cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.dp-reset:hover:not(:disabled) {
  color: var(--danger); border-color: rgba(220,38,38,.45); background: rgba(220,38,38,.06);
}
.dp-reset:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; }
.dp-reset:disabled { opacity: .4; cursor: default; }

/* ── The window field: one control for a whole datetime range ── */
.dtw-field {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  width: 100%; padding: .5rem .75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font: inherit; font-size: .9rem; text-align: left; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.dtw-field:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.dtw-field:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.dtw-field svg { width: 15px; height: 15px; color: var(--text-muted); flex: 0 0 auto; }
.dtw-end { font-weight: 600; white-space: nowrap; }
.dtw-time { color: var(--text-muted); font-weight: 400; }
.dtw-arrow { color: var(--text-light); flex: 0 0 auto; }
.dtw-dur {
  margin-left: auto; padding: .1rem .5rem; border-radius: 999px;
  background: var(--primary-light); color: var(--primary-ink);
  font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.dtw-empty { color: var(--text-light); }
/* Left to itself the field stretches the whole card and strands the duration
   pill on the far side of a lot of nothing. Stacking the phone under it cost a
   second field's height for no reason, so the two share one row and align on
   their controls — the labels are free to be different heights. */
.offer-fields-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem;
}
.offer-fields-row .form-group { margin-bottom: 0; }
.offer-window-group { flex: 1 1 340px; max-width: 520px; }
/* Actions ride the same row, pushed to the far edge and sitting on the same
   baseline as the controls — a row of their own left the card half empty. */
.offer-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-left: auto; }
.dp-presets { display: flex; gap: .3rem; flex-wrap: wrap; }
.dp-chip {
  padding: .28rem .55rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg); color: var(--text-muted);
  font: inherit; font-size: .72rem; cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.dp-chip:hover { background: var(--primary-light); color: var(--primary-ink); border-color: var(--primary); }
.dp-chip:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 1px; }
/* Right-aligned in whatever space is left, so its text changing length moves
   nothing else on the row. */
.dp-summary {
  flex: 1 1 auto; min-width: 0; text-align: right;
  font-size: .76rem; color: var(--text-muted); white-space: nowrap;
}
.dp-summary strong { color: var(--text); }

/* Phones: one month as a bottom sheet — an anchored popover would sit under
   the keyboard-height fold and clip against the viewport edge. */
.dp-pop.dp-sheet {
  left: 0; right: 0; bottom: 0; top: auto;
  width: 100%; padding: .8rem .8rem calc(.8rem + env(safe-area-inset-bottom));
  border-radius: var(--radius) var(--radius) 0 0;
  border-width: 1px 0 0;
  /* The sheet handles both axes itself — page months, pull down to dismiss.
     Leaving the browser `pan-y` meant it claimed the vertical drag as a scroll
     and cancelled the pointer, so the dismiss gesture never arrived. */
  touch-action: none;
}
.dp-pop.dp-sheet .dp-months { touch-action: none; }
/* The grab handle — the affordance that says this sheet can be pulled down. */
.dp-pop.dp-sheet::before {
  content: ''; display: block;
  width: 36px; height: 4px; margin: -.2rem auto .5rem;
  border-radius: 999px; background: var(--border-strong);
}
/* The sheet is as wide as the phone, so here the month does flex. */
.dp-pop.dp-sheet .dp-month { flex: 1 1 auto; width: auto; min-width: 0; max-width: 360px; margin: 0 auto; }
.dp-pop.dp-sheet .dp-day { max-width: 44px; height: 44px; font-size: .9rem; }
.dp-pop.dp-sheet .dp-grid { grid-auto-rows: 44px; min-height: calc(6 * 44px + 5 * 3px); }
.dp-pop.dp-sheet .dp-nav { width: 40px; height: 40px; }
.dp-pop.dp-sheet .dp-chip { padding: .45rem .7rem; font-size: .78rem; }
.dp-pop.dp-sheet .dp-foot { justify-content: center; }
.dp-pop.dp-sheet .dp-when { flex-direction: column; gap: .5rem; }
.dp-pop.dp-sheet .dp-time { min-height: 36px; font-size: .85rem; }
.dp-pop.dp-sheet .dp-hour { min-height: 40px; padding: .5rem .45rem; font-size: .82rem; }
.dp-pop.dp-sheet .dp-min { min-height: 40px; padding: .5rem .45rem; font-size: .82rem; }
.dp-pop.dp-sheet .dp-step { width: 34px; height: 34px; font-size: 1.05rem; }
/* Stacked, the two chevrons would be 18px of thumb each. The sheet row has the
   width to spare, so they sit side by side at full height instead. */
.dp-pop.dp-sheet .dp-spin { flex-direction: row; }
.dp-pop.dp-sheet .dp-hstep { width: 34px; }
.dp-pop.dp-sheet .dp-hstep:first-child { border-radius: 0; border-bottom: 1px solid var(--border); border-right: 0; }
.dp-pop.dp-sheet .dp-hstep:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.dp-pop.dp-sheet .dp-hstep svg { width: 14px; height: 14px; }
.dp-pop.dp-sheet .dp-done { min-height: 40px; padding: .4rem 1.4rem; }
.dp-pop.dp-sheet .dp-reset { min-height: 40px; padding: .4rem .9rem; font-size: .78rem; }

@media (prefers-reduced-motion: reduce) {
  .dp-day, .dp-chip, .dp-nav { transition: none; }
}

/* Pending owner-request count on the phone nav: on Fleet when Fleet is on the
   bar, otherwise on ••• (and on the Fleet tile inside More). */
#mob-more { position: relative; }
.mob-more-badge {
  position: absolute; top: 4px; right: 50%; margin-right: -22px;
  min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff;
  font-size: .62rem; font-weight: 700; text-align: center; border-radius: 999px;
}

/* Comfortable touch targets: on coarse pointers, the compact icon buttons in
   table rows and cards get a ≥40px hit area without growing visually. */
@media (pointer: coarse) {
  .res-actions .btn-xs, .owner-actions .btn-xs, .vehicle-card-icons .btn-xs {
    min-width: 40px; min-height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
  }
}

/* Section headers inside long modal forms (New Rental) — pure wayfinding */
.form-section-head {
  display: flex; align-items: center; gap: .5rem;
  margin: 1.1rem 0 .6rem; font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
}
.form-section-head::after { content: ''; flex: 1; height: 1px; background: var(--border); }
/* Field labels in pop-up forms are plain sentence case — uppercase is kept
   for section heads, so the two levels read as two levels, and an aside
   beside a label doesn't shout. */
#modal-body .form-group > label:not(.rf-drop) {
  text-transform: none; letter-spacing: 0; font-size: .82rem; color: var(--text);
}
.label-opt { font-size: .75rem; font-weight: 400; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.form-section-head:first-child { margin-top: 0; }

/* Dates prefilled from an owner's change request — tinted so it's obvious the
   form isn't showing what's currently saved. */
.form-row.dt-requested input,
.form-row.dt-requested select,
.dtw-field.dt-requested {
  border-color: var(--warning);
  background: var(--warning-light);
}

/* Keep the save-status pill clear of the phone bottom nav (its position is set
   inline from store.js, hence the !important). On phones it only appears when
   an upload fails, so the top stays free for the undo bar. */
@media (max-width: 700px) {
  #save-status { bottom: calc(var(--mobile-nav-h) + .75rem) !important; }
}

/* Notice slot between the stats and the footer. Reserving one line's height
   means the common card — exactly one notice — leaves no slack for the pinned
   footer to absorb, so it sits flush instead of floating below a gap. */
.vehicle-card-notes { min-height: 1.4rem; }
/* Fleet inventory cards: the website note became an icon and the footer
   moved up beside the owner, so the slot only holds real alerts now. */
.vehicles-manage .vehicle-card-notes { min-height: 0; }
/* Fleet card: photo · name over owner · actions, all on one row. */
.vehicle-card-titles { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.vehicle-card-ownerline { display: flex; align-items: center; gap: .4rem; min-width: 0; padding-left: calc(14px + .45rem); font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; }
.vehicle-card-ownerline .vstatus { flex: 0 0 auto; }
.vehicles-manage .vehicle-card-top > .vehicle-card-icons { flex: 0 0 auto; margin-left: 0; }
.vehicles-manage .vehicle-stats { margin-top: .7rem; margin-bottom: 0; }
/* Status filters: one row that scrolls sideways instead of three wrapped rows. */
.fleet-status-head .fleet-status-filter { flex-wrap: nowrap !important; overflow-x: auto !important; scrollbar-width: none; }   /* beats the phone rule that wraps every chip strip */
.fleet-status-head .fleet-status-filter::-webkit-scrollbar { display: none; }
.fleet-status-head .fleet-status-filter > * { flex: 0 0 auto; }
/* Phone: the sideways row hid "All" and "Not on website" behind + New with no
   sign there was more. The compact chips wrap into two short rows instead. */
@media (max-width: 700px) {
  .fleet-status-head .fleet-status-filter { flex-wrap: wrap !important; overflow-x: visible !important; }
  .fleet-status-head .fleet-status-filter .fb-sep { display: none; }
}
.vehicles-manage .vehicle-card-owner {
  display: flex; align-items: center; gap: .4rem; overflow: visible; white-space: normal;
}
.vehicle-card-ownername { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vehicles-manage .vehicle-card-owner .vehicle-card-icons { flex-shrink: 0; }
/* "Not on the website" — a globe with a slash through it. */
.veh-offweb {
  position: relative; display: inline-flex; flex-shrink: 0; margin-left: .3rem;
  color: var(--text-light); vertical-align: -2px;
}
.veh-offweb i, .veh-offweb svg { width: 14px; height: 14px; }
.veh-offweb::after {
  content: ''; position: absolute; left: 50%; top: -1px; bottom: -1px; width: 1.5px;
  background: currentColor; transform: translateX(-50%) rotate(45deg); border-radius: 1px;
}
/* Owner cards open the owner — the whole card is the link. */
.owner-card-link { cursor: pointer; }
.owner-card-link:hover { border-color: var(--border-strong); }
.owner-card-link:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; }

/* Vehicle paperwork warnings on fleet cards — a real deadline, so it shouts. */
.vehicle-card-doc {
  margin-top: .45rem; font-size: .76rem; font-weight: 600;
  color: var(--warning); display: flex; align-items: center; gap: .3rem;
}
.vehicle-card-doc.expired { color: var(--danger); }

/* Routine card notices (e.g. "not on the website"). Same slot as the paperwork
   warning but pitched at the owner line's volume — it lands on most of the
   fleet, and dressing it as an alert buried the ones that are. */
.vehicle-card-note {
  margin-top: .45rem; font-size: .76rem; font-weight: 500;
  color: var(--text-muted); display: flex; align-items: center; gap: .3rem;
}

/* ═══════════════ ACTIVITY LOG (Settings → Activity) ═══════════════
   A timestamped feed of what was done in the app. The time column is the
   thing being scanned, so it's fixed-width and leads the row; the icon
   carries the category so the sentence itself doesn't have to. */
.act-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap; margin-bottom: .85rem;
}
.act-head .sub { font-size: .78rem; color: var(--text-muted); }
.act-head-actions { display: flex; gap: .4rem; }

.act-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.act-chip {
  font: inherit; font-size: .75rem; font-weight: 600;
  padding: .26rem .65rem; border-radius: 999px; cursor: pointer;
  background: var(--bg-secondary); color: var(--text-muted);
  border: 1px solid var(--border);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.act-chip:hover { color: var(--text); border-color: var(--border-strong); }
.act-chip:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; }
.act-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* The feed scrolls on its own so the tab bar and the actions above stay put
   on a long history instead of the whole settings page growing unbounded. */
.act-feed { max-height: 60vh; overflow-y: auto; margin: 0 -.15rem; padding: 0 .15rem; }

.act-day {
  position: sticky; top: 0; z-index: 1;
  /* Matches the page, not a card: settings content sits directly on the body
     background, so anything else reads as a filled band rather than a heading
     that simply occludes the rows scrolling under it. */
  background: var(--bg);
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-light);
  padding: .6rem 0 .35rem;
}
.act-day:first-child { padding-top: 0; }

.act-row {
  display: grid; grid-template-columns: 3.1rem 1.55rem 1fr;
  align-items: start; gap: .55rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.act-row:last-child { border-bottom: none; }

.act-time {
  font-size: .78rem; font-weight: 600; color: var(--text-muted);
  font-variant-numeric: tabular-nums; padding-top: .12rem;
}

.act-icon {
  width: 1.55rem; height: 1.55rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary); color: var(--text-muted);
}
.act-icon i { width: 13px; height: 13px; }
/* Category tints — each reads at a glance without a legend. */
.act-icon-rental  { background: var(--primary-light); color: var(--primary-ink); }
.act-icon-money   { background: var(--success-light); color: var(--success); }
.act-icon-fleet   { background: var(--info-light);    color: var(--info);    }
.act-icon-owner   { background: var(--warning-light); color: var(--warning); }
.act-icon-doc     { background: var(--bg-soft);       color: var(--text);    }
.act-icon-website { background: var(--info-light);    color: var(--info);    }
.act-icon-data    { background: var(--bg-soft);       color: var(--text);    }
.act-icon-system  { background: var(--bg-soft);       color: var(--text-muted); }

.act-text { min-width: 0; }
.act-what { display: block; font-size: .86rem; color: var(--text); }
.act-detail {
  display: block; font-size: .78rem; color: var(--text-muted);
  margin-top: .1rem; overflow-wrap: anywhere;
}

.act-foot { font-size: .74rem; color: var(--text-light); margin-top: .85rem; }

.act-empty { text-align: center; padding: 2rem 1rem; color: var(--text-muted); }
.act-empty i { width: 28px; height: 28px; color: var(--text-light); margin-bottom: .6rem; }
.act-empty p { font-size: .88rem; margin: 0; }
.act-empty p.sub { font-size: .78rem; color: var(--text-light); margin-top: .4rem; max-width: 34ch; margin-inline: auto; }

/* On a phone the page already scrolls, so capping the feed would put a second
   scroller inside the first — awkward to flick through, and it clips the last
   row mid-sentence. Let it run and use the page scroll instead. */
@media (max-width: 700px) {
  .act-feed { max-height: none; overflow-y: visible; }
}

/* ═══════════════════════════════════════════
   CAR COLOUR CHIPS (vehicle form)
   A paint swatch + its name. Picking one sets the car's dot colour and,
   unless the Label says something else, the Label — so the colour reads in
   the car's name and goes to the website as its variant.
═══════════════════════════════════════════ */
.fv-swatches { display: flex; flex-wrap: wrap; gap: 0.4rem; }
/* Colour dots only — the chosen name shows beside the "Colour" label, and
   each dot names itself on hover. One row instead of four on a phone. */
#fv-swatches .fv-sw { padding: 0.25rem; gap: 0; border-radius: 50%; }
#fv-swatches .fv-sw-dot { width: 22px; height: 22px; }
#fv-swatches .fv-sw[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); background: transparent; }
@media (max-width: 560px) { #fv-swatches { gap: .3rem; } #fv-swatches .fv-sw-dot { width: 20px; height: 20px; } }
/* Vehicle form: folded sections with a one-line summary. */
.fv-fold { border: 1px solid var(--border); border-radius: var(--radius-sm); margin: .9rem 0; padding: 0 .85rem; }
.fv-fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: .6rem;
  padding: .7rem 0; font-size: .85rem;
}
.fv-fold > summary::-webkit-details-marker { display: none; }
.fv-fold > summary::after { content: '›'; margin-left: auto; color: var(--text-muted); transition: transform .15s ease; }
.fv-fold[open] > summary::after { transform: rotate(90deg); }
.fv-fold[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: .75rem; }
.fv-fold > summary:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; border-radius: 4px; }
.fv-fold-title { font-weight: 600; color: var(--text); flex: 0 0 auto; }
.fv-fold-sum { font-size: .78rem; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-fold-sum.warn { color: var(--warning); font-weight: 600; }
/* Requests: finished items older than a week, folded. Cards keep their own gap. */
.req-done { margin-top: 1.5rem; }
.req-done > summary:hover .fv-fold-title { color: var(--primary-ink); }
.req-done[open] > summary { margin-bottom: .9rem; }
.fv-warn { margin-top: .3rem; font-size: .75rem; font-weight: 600; color: var(--warning); }
.fv-warn.bad { color: var(--danger); }
input.fv-date-due { border-color: var(--warning); }
input.fv-date-bad { border-color: var(--danger); }
.fv-sw {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.65rem 0.3rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text);
  font: inherit; font-size: 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
}
.fv-sw-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--sw, transparent);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);   /* keeps White visible on white */
  flex-shrink: 0;
}
.fv-sw:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.fv-sw:focus-visible, .fv-sw:focus-within { outline: 2px solid var(--primary-ink); outline-offset: 2px; }
.fv-sw:active { background: var(--bg-soft); }
.fv-sw[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-light); color: var(--primary-ink); font-weight: 600; }
.fv-sw-other { position: relative; }
.fv-sw-other .fv-sw-dot { background: conic-gradient(#dc2626, #eab308, #16a34a, #2563eb, #9333ea, #dc2626); }
.fv-sw-other[aria-pressed="true"] .fv-sw-dot { background: var(--sw); }
.fv-sw-other input[type="color"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.form-group label.fv-sw {
  display: inline-flex; margin: 0;
  font-size: 0.8rem; font-weight: 400; color: var(--text);
  text-transform: none; letter-spacing: 0;
}
.form-group label.fv-sw[aria-pressed="true"] { color: var(--primary-ink); font-weight: 600; }

/* ── Car page: photos, now/next, facts, condensed stats ── */
.veh-thumb.is-zoomable { cursor: zoom-in; padding: 0; font: inherit; }
button.veh-thumb:not(.is-zoomable) { cursor: default; padding: 0; }
button.veh-thumb:not(.is-zoomable):hover { transform: none; border-color: var(--border); }

.vd-photos {
  display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x proximity;
  margin: 0 0 1rem; padding-bottom: .25rem; -webkit-overflow-scrolling: touch;
}
.vd-photo {
  flex: 0 0 auto; width: 168px; height: 126px; padding: 0; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; background: var(--bg-secondary);
  cursor: zoom-in; scroll-snap-align: start;
  transition: transform .15s cubic-bezier(.2,.8,.2,1), opacity .15s;
}
.vd-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vd-photo:hover { transform: translateY(-2px); }
.vd-photo:active { transform: scale(.98); }
.vd-photo:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; }
.vd-photos--empty {
  align-items: center; gap: .5rem; padding: .6rem 1rem; border: 1px dashed var(--border);
  border-radius: var(--radius); color: var(--text-muted); font-size: .85rem;
}

.vd-now {
  display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem;
  padding: .85rem 1rem; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.vd-now-dot { flex: 0 0 10px; height: 10px; border-radius: 50%; background: var(--success); }
.vd-now--busy .vd-now-dot { background: #f59e0b; }
.vd-now--warning .vd-now-dot { background: #f97316; }
.vd-now--muted .vd-now-dot { background: #94a3b8; }
.vd-now-text { flex: 1; min-width: 0; }
.vd-now-head { font-weight: 700; font-size: 1.05rem; }
.vd-now-sub { font-size: .82rem; color: var(--text-muted); margin-top: .1rem; }
.vd-now .btn { flex-shrink: 0; }

.vd-facts { margin-bottom: 1rem; padding: .35rem 1rem; }
.vd-fact-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .25rem 1rem; padding: .55rem 0; }
.vd-fact-row + .vd-fact-row { border-top: 1px solid var(--border); }
.vd-fact { display: flex; flex-direction: column; min-width: 0; }
.vd-fact-lbl { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.vd-fact-val { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-fact-val.vd-danger, .vd-fact-val.vd-danger a { color: var(--danger); }
.vd-fact-val.vd-warning, .vd-fact-val.vd-warning a { color: var(--warning); }
.vd-none { color: var(--text-light, var(--text-muted)); font-weight: 400; }

.vd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.vd-stats .stat-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-util-label { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.vd-win {
  font-size: .72rem; padding: .1rem .3rem; height: auto; width: auto; min-height: 0;
  border-radius: 6px; text-transform: none; letter-spacing: 0;
}
.vd-util-bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; margin: .25rem 0 .3rem; }
.vd-util-bar span { display: block; height: 100%; background: var(--primary); border-radius: inherit; transform-origin: left; }
@media (max-width: 720px) {
  .vd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vd-photo { width: 136px; height: 102px; }
  .vd-now { flex-wrap: wrap; }
  .vd-now .btn { width: 100%; justify-content: center; }
}

/* Full-screen photo viewer (PhotoViewer) */
.pv {
  position: fixed; inset: 0; z-index: 10000; background: rgba(5, 8, 15, .94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .18s ease; overflow: hidden;
}
.pv.is-open { opacity: 1; }
.pv-track { position: absolute; inset: 0; touch-action: pan-y pinch-zoom; will-change: transform; }
.pv-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pv-img { max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 6px; user-select: none; -webkit-user-drag: none; }
.pv-btn {
  position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s, opacity .12s; opacity: .85;
}
.pv-btn:hover { opacity: 1; transform: scale(1.06); }
.pv-btn:active { transform: scale(.95); }
.pv-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pv-btn svg { width: 24px; height: 24px; }
.pv-close { top: max(14px, env(safe-area-inset-top)); right: 14px; }
.pv-prev { left: 14px; top: 50%; margin-top: -22px; }
.pv-next { right: 14px; top: 50%; margin-top: -22px; }
.pv-count {
  position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  color: #fff; font-size: .85rem; background: rgba(0,0,0,.45); padding: .2rem .65rem; border-radius: 999px;
}
@media (max-width: 720px) { .pv-prev, .pv-next { display: none; } .pv-img { max-width: 100vw; border-radius: 0; } }
@media (prefers-reduced-motion: reduce) { .pv, .vd-photo, .pv-btn { transition: none; } }

/* ── Named one-liners for styles the screen code repeated inline ──
   Plain classes, no !important: code that sets el.style at runtime (the
   profit colour on the rental form, for one) still wins, as it did over the
   old inline styles. Red text stays inline on purpose: as a class it lost to
   .btn-ghost:hover and .res-info-row strong, which the inline style beat. */
.u-right   { text-align: right; }
.u-pointer { cursor: pointer; }
.u-muted   { color: var(--text-muted); }
.u-muted-xs       { font-size: .75rem; color: var(--text-muted); }
.u-muted-xs-light { font-size: .75rem; color: var(--text-muted); font-weight: 400; }
.u-muted-sm       { font-size: .8rem; color: var(--text-muted); }
.u-mb-lg   { margin-bottom: 1.5rem; }
/* Icon sizes: lucide copies the <i>'s classes onto the <svg> it draws. */
.u-i14      { width: 14px; height: 14px; }
.u-i14-lead { width: 14px; height: 14px; display: inline; vertical-align: -2px; margin-right: .3rem; }
.u-i14-inl  { width: 14px; height: 14px; display: inline; margin-right: .3rem; }
.u-i16-lead { width: 16px; height: 16px; display: inline; margin-right: .3rem; }

/* ═══════════════════════════════════════════
   PHOTO EDITOR (rotate & crop — licence photo)
═══════════════════════════════════════════ */
.ped-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(2,6,23,.82);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; transition: opacity .18s ease;
}
.ped-overlay.open { opacity: 1; }
.ped-box {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: min(760px, 100%); height: min(640px, 100%);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(8px) scale(.985); transition: transform .2s ease;
}
.ped-overlay.open .ped-box { transform: none; }
.ped-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem .6rem; }
.ped-head h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.ped-hint { font-size: .78rem; color: var(--text-muted); }
.ped-stage {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  background: #0b1120; margin: 0 1.1rem; border-radius: 10px; overflow: hidden;
}
.ped-frame { position: relative; touch-action: none; }
.ped-canvas { display: block; }
.ped-crop {
  position: absolute; cursor: move; touch-action: none;
  box-shadow: 0 0 0 9999px rgba(2,6,23,.6);
  outline: 1.5px solid #fff; outline-offset: -1px;
  background-image:
    linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)),
    linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)),
    linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.35)),
    linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.35));
  background-size: 1px 100%, 1px 100%, 100% 1px, 100% 1px;
  background-position: 33.33% 0, 66.66% 0, 0 33.33%, 0 66.66%;
  background-repeat: no-repeat;
}
.ped-crop:focus-visible { outline: 2px solid var(--brand); }
.ped-h {
  position: absolute; width: 26px; height: 26px; touch-action: none;
}
.ped-h::before {
  content: ''; position: absolute; width: 14px; height: 14px;
  border: 0 solid #fff; transition: transform .12s ease;
}
.ped-h[data-h="nw"] { left: -6px; top: -6px; cursor: nwse-resize; }
.ped-h[data-h="ne"] { right: -6px; top: -6px; cursor: nesw-resize; }
.ped-h[data-h="sw"] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.ped-h[data-h="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }
.ped-h[data-h="nw"]::before { left: 4px; top: 4px; border-left-width: 4px; border-top-width: 4px; }
.ped-h[data-h="ne"]::before { right: 4px; top: 4px; border-right-width: 4px; border-top-width: 4px; }
.ped-h[data-h="sw"]::before { left: 4px; bottom: 4px; border-left-width: 4px; border-bottom-width: 4px; }
.ped-h[data-h="se"]::before { right: 4px; bottom: 4px; border-right-width: 4px; border-bottom-width: 4px; }
.ped-h:hover::before, .ped-crop.dragging .ped-h::before { transform: scale(1.15); }
.ped-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; padding: .8rem 1.1rem 1rem; }
.ped-tools { display: flex; gap: .5rem; }
.ped-tools:last-child { margin-left: auto; }
.ped-tools .btn { display: inline-flex; align-items: center; gap: .35rem; }
.ped-tools .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ped-tools .btn:active { transform: scale(.97); }
@media (max-width: 600px) {
  .ped-overlay { padding: 0; }
  .ped-box { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .ped-stage { margin: 0 .6rem; }
  .ped-hint { display: none; }
}

/* Account paused by the admin (Store.accountPaused): covers the app until the
   account is resumed. */
.paused-screen {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: var(--bg);
}
.paused-card {
  max-width: 26rem; width: 100%; padding: 1.75rem 1.5rem; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}
.paused-card h2 { margin: 0 0 .6rem; font-size: 1.2rem; }
.paused-card p { margin: 0 0 1.25rem; color: var(--text-muted); line-height: 1.5; font-size: .92rem; }

/* Glass for everything that floats. Only floating things get it:
   cards and figures stay solid so they stay readable. */
:root {
    --glass: rgba(255,255,255,.58); --glass-strong: rgba(255,255,255,.82); --glass-rim: rgba(255,255,255,.75);
    --glass-shadow: 0 10px 28px -8px rgba(0,0,0,.42), 0 0 0 .5px rgba(0,0,0,.12),
      inset 0 1px 1px rgba(255,255,255,.5), inset 0 -1px 1px rgba(255,255,255,.18),
      inset 3px 0 5px -3px rgba(255,255,255,.35), inset -3px 0 5px -3px rgba(255,255,255,.35);
    --sheet-ease: cubic-bezier(.32,.72,0,1);
  }
  [data-theme="dark"] { --glass: rgba(11,13,18,.66); --glass-strong: rgba(14,17,24,.84); --glass-rim: rgba(255,255,255,.2); }

/* Phone tab bar: floating "Liquid Glass" pill, icons only, matching current iOS.
   Height stays --mobile-nav-h and it sits inside the safe area, so every offset
   already based on that variable (page padding, toasts, idle warning) still clears it.
   The words stay in the page for screen readers, just not on show. */
@media (max-width: 700px) {
  #mobile-nav {
    left: 12px; right: 12px;
    bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) - 12px));
    height: var(--mobile-nav-h);
    padding: 5px;
    border: 1px solid var(--glass-rim);
    border-radius: 999px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(190%);
    backdrop-filter: blur(18px) saturate(190%);
    box-shadow: 0 10px 28px -8px rgba(0,0,0,.42), 0 0 0 .5px rgba(0,0,0,.12),
      inset 0 1px 1px rgba(255,255,255,.5), inset 0 -1px 1px rgba(255,255,255,.18),
      inset 3px 0 5px -3px rgba(255,255,255,.35), inset -3px 0 5px -3px rgba(255,255,255,.35);
  }
  .mob-link {
    position: relative;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border-radius: 999px;
    color: var(--text);
    transition: transform .14s var(--ease-spring);
  }
  .mob-link > span:not(.requests-badge) {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .mob-link svg { width: 25px; height: 25px; }
  .mob-link.active { color: var(--text); background: color-mix(in srgb, var(--text) 20%, transparent); }
  .mob-link:active { transform: scale(.92); }
  .mob-link:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: -2px; }
  @media (hover: hover) { .mob-link:hover { background: color-mix(in srgb, var(--text) 10%, transparent); } }
}
/* Solid bar for people who turned on Reduce Transparency, and browsers without blur. */
@media (max-width: 700px) and (prefers-reduced-transparency: reduce) {
  #mobile-nav { background: var(--bg-card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  @media (max-width: 700px) { #mobile-nav { background: var(--bg-card); } }
}

/* Phone: top tabs are a glass pill like the bottom bar, and stay in view on scroll.
   The page must clip rather than hide sideways, or the tabs can't stick. */
@media (max-width: 700px) {
  body, #main { overflow-x: clip; }
  #content { overflow-x: clip; overflow-y: visible; }
  /* iPhone zooms the whole page into any box with text under 16px, and stays
     zoomed. !important because the base input[type=…] rule and many page-level
     rules otherwise win over the phone size. */
  input:where(:not([type="checkbox"]):not([type="radio"])), select, textarea { font-size: 16px !important; }
  /* More menu: a small glass card rising from the menu button. The six pages
     are already on the bottom bar, so it only holds what the bar doesn't. */
  #sidebar.open {
    top: auto; left: auto; right: 12px;
    bottom: calc(max(10px, calc(env(safe-area-inset-bottom, 0px) - 12px)) + var(--mobile-nav-h) + 10px);
    width: 224px;
    padding: 6px;
    border: 1px solid var(--glass-rim);
    border-radius: 26px;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    backdrop-filter: blur(24px) saturate(190%);
    box-shadow: var(--glass-shadow);
    transform-origin: 90% 100%;
    animation: glass-menu-in .28s var(--sheet-ease);
  }
  @keyframes glass-menu-in { from { opacity: 0; transform: scale(.82) translateY(14px); } }
  #sidebar.open .sidebar-logo,
  #sidebar.open .nav-list:not(.drawer-actions) { display: none; }
  #sidebar.open .drawer-actions { padding: 0; margin: 0; border: 0; }
  #sidebar.open .drawer-actions li { margin: 2px 0; }
  #sidebar.open .sidebar-footer {
    padding: 4px 0 0; margin: 4px 0 0; align-items: center;
    border-top: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  }
  #sidebar.open .sidebar-footer .nav-link { flex: 1; }
  #sidebar.open .nav-link { min-height: 44px; margin: 0; padding: .6rem .75rem; border-radius: 20px; color: var(--text); }
  #sidebar.open .nav-link:active { background: color-mix(in srgb, var(--text) 16%, transparent); }
  #sidebar.open .nav-link.active { color: var(--text); background: color-mix(in srgb, var(--text) 20%, transparent); }
  #sidebar-overlay { background: rgba(0,0,0,.3); }

  /* Forms and pop-ups: a sheet that slides up, page dimmed behind it. */
  #modal-overlay { align-items: flex-end; padding: calc(env(safe-area-inset-top, 0px) + 12px) 0 0; }
  #modal-box {
    height: auto;
    max-height: 100%;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    animation: sheet-up .38s var(--sheet-ease);
  }
  .modal-ghost #modal-box { animation: sheet-down .2s ease-in forwards; }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  @keyframes sheet-down { to { transform: translateY(100%); } }
  #modal-box::before {
    content: ''; flex: none; align-self: center;
    width: 36px; height: 5px; margin-top: 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text) 28%, transparent);
  }
  .modal-header { flex: none; position: static; padding: .55rem 1.25rem .8rem; touch-action: none; }
  #modal-close { margin: -6px -6px -6px 0; }
  #modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  /* Padding here left a strip of the form showing below the Save bar. */
  #modal-body:has(.modal-footer) { padding-bottom: 0; }
  #modal-body .modal-footer {
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(190%);
    backdrop-filter: blur(18px) saturate(190%);
    border-top: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  }
}
/* Turned-off blur and calmer motion, for people who asked for them. */
@media (max-width: 700px) and (prefers-reduced-transparency: reduce) {
  .owner-tabs, #sidebar.open, #modal-body .modal-footer { background: var(--bg-card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  #sidebar.open, #modal-box, .modal-ghost #modal-box { animation: none; }
}

/* The shared look, at every screen size. */
.owner-tabs {
  position: relative;
  z-index: 30;
  width: fit-content;
  max-width: 100%;
  gap: 2px;
  padding: 4px;
  overflow: visible;
  border: 1px solid var(--glass-rim);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(190%);
  backdrop-filter: blur(18px) saturate(190%);
  box-shadow: var(--glass-shadow);
}
.owner-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 38px;
  padding: 0 1.05rem;
  margin: 0;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  font-size: .85rem;
  transition: transform .14s var(--ease-spring);
}
.owner-tab.active { color: var(--text); border-bottom-color: transparent; background: color-mix(in srgb, var(--text) 20%, transparent); }
.owner-tab:active { transform: scale(.95); }
.owner-tab:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: -2px; }
@media (hover: hover) { .owner-tab:not(.active):hover { background: color-mix(in srgb, var(--text) 10%, transparent); } }

/* Small messages: glass pills. The coloured dot says what kind. */
.toast, .toast.success, .toast.error, .toast.info, #undo-bar {
  border: 1px solid var(--glass-rim);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  backdrop-filter: blur(20px) saturate(190%);
  box-shadow: var(--glass-shadow);
}
.toast { border-radius: 24px; width: fit-content; }

/* One button shape: capsules, and circles for icon-only ones. */
.btn, #content .btn { border-radius: 999px; }
.btn-icon { border-radius: 50%; }

/* Cards: no outlines or decorative stripes, softer corners. Status marks
   (free/booked offers) stay, as a short straight bar. */
.card, .stat-card, .pulse-tile, .kpi-card, .vehicle-card, .owner-card, .offer-card { border-radius: 18px; }
.card, .stat-card, .pulse-tile, .kpi-card, .vehicle-card, .owner-card { border-color: transparent; }
.offer-card { position: relative; border-color: transparent; }
.offer-card-available, .offer-card-tight, .offer-card-booked { border-left: 1px solid transparent; }
.offer-card-available::before, .offer-card-tight::before, .offer-card-booked::before {
  content: ''; position: absolute; left: 5px; top: 16px; bottom: 16px; width: 3px; border-radius: 3px;
  background: var(--success);
}
.offer-card-tight::before { background: var(--warning); }
.offer-card-booked::before { background: var(--danger); }
/* Goal cards already say their status in words. */
.goal-card { border-left: 0 !important; }
.stat-card::before, .pulse-tile::before, .kpi-card::before { display: none; }
.today-banner { border-left: 0; }
.card-header { border-bottom-color: color-mix(in srgb, var(--text) 8%, transparent); }

/* Pop-ups. */
#modal-close {
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  /* A 32px circle drawn inside a 44px tap area. */
  border: 6px solid transparent; background: color-mix(in srgb, var(--text) 12%, transparent) padding-box;
}

/* Instant press feedback. */
.btn, .btn-icon, .pulse-tile, .vehicle-card, .owner-card {
  transition: transform .1s ease-out, background-color var(--transition), color var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.btn:active { transform: scale(.96); }
.btn-icon:active { transform: scale(.9); }
.pulse-tile:active, .vehicle-card:active, .owner-card:active { transform: scale(.98); }

/* Computer and tablet: a floating glass rail, matching the phone's bottom bar. */
@media (min-width: 701px) {
  #sidebar {
    top: 10px; left: 10px; bottom: 10px;
    overflow-y: auto;
    border: 1px solid var(--glass-rim);
    border-radius: 24px;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    backdrop-filter: blur(24px) saturate(190%);
    box-shadow: var(--glass-shadow);
  }
  #main { margin-left: calc(var(--sidebar-width) + 10px); }
  #sidebar .sidebar-logo-text { color: var(--text); }
  #sidebar .nav-link { color: var(--text); border-radius: 16px; }
  #sidebar .nav-link:hover { color: var(--text); background: color-mix(in srgb, var(--text) 10%, transparent); }
  #sidebar .nav-link.active { color: var(--text); background: color-mix(in srgb, var(--text) 20%, transparent); }
  #sidebar .drawer-actions, #sidebar .sidebar-footer, #sidebar .sidebar-logo { border-color: color-mix(in srgb, var(--text) 12%, transparent); }
  #sidebar .btn-icon { color: var(--text); }
  #modal-box { border-radius: 24px; }
  .card:has(#res-table-wrap) { overflow: hidden; }
  #modal-close { margin: -6px -6px -6px 0; }
}

/* The rental-window field matches the other soft fields. */
.dtw-field { border-radius: 12px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.dtw-field:not(:focus-visible):not(:hover) { border-color: transparent; }

/* Search boxes are capsules, like iPhone search bars. */
.search-wrap input.search-input, input.clients-search { border-radius: 999px; }
/* The "Done" fold on Requests is a calm card like its neighbours. */
.req-done { border-color: transparent; border-radius: 18px; background: var(--bg-card); box-shadow: var(--shadow); }
/* Reports: tabs on the left, Excel and Print apart from them. */
.reports-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.reports-head .owner-tabs { margin-bottom: 0; }
.reports-actions { display: inline-flex; gap: .35rem; flex: 0 0 auto; }
.reports-actions-end { display: none; }
@media print { .reports-head, .reports-live, .reports-actions-end { display: none !important; } }

/* Phone-only parts of the look. */
@media (max-width: 700px) {
  /* display: contents so the tabs can still stay in view while scrolling. */
  .reports-head { display: contents; }
  .reports-head .owner-tabs { margin-bottom: .6rem; }
  .reports-head > .reports-actions { display: none; }
  .reports-actions-end { display: flex; justify-content: flex-end; margin-top: 1.25rem; }
  /* Whole words: label and figure share one row. */
  .stat-strip .stat-label { flex-shrink: 0; overflow: visible; letter-spacing: .01em; }
  /* Tabs fill the width and stay in view while scrolling. */
  .owner-tabs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 8px); width: auto; flex-wrap: wrap; margin-bottom: 1rem; }
  /* Five or more tabs wrap onto two rows; a full pill would look wrong there. */
  .owner-tabs:has(> :nth-child(5)) { border-radius: 24px; }
  .owner-tab { flex: 1 1 auto; padding: 0 .7rem; }
  .owner-tabs:has(> :nth-child(5)) .owner-tab { flex-basis: 30%; }
  #toast-container { align-items: center; }
  /* Overdue rentals keep their mark as a short straight bar. */
  #res-table-wrap .res-row-overdue { border-left: 1px solid transparent; }
  #res-table-wrap .res-row-overdue::before {
    content: ''; position: absolute; left: 5px; top: 16px; bottom: 16px; width: 3px; border-radius: 3px;
    background: var(--warning);
  }
  /* Rentals: rows float on the page instead of sitting in a boxed table. */
  .card:has(#res-table-wrap) { background: transparent; box-shadow: none; }
  #res-table-wrap .res-row { position: relative; background: var(--bg-card); box-shadow: var(--shadow); border-radius: 18px; border-color: transparent; }
  #res-table-wrap .res-group-header td, #res-table-wrap .res-group-header:hover td { background: transparent; border: 0; padding-left: .25rem; }
  /* No grey flash or tap delay. */
  a, button, [onclick] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  .modal-header { touch-action: none; }
  #sidebar.open.closing { animation: glass-menu-out .17s ease-in forwards; pointer-events: none; }
  @keyframes glass-menu-out { to { opacity: 0; transform: scale(.82) translateY(14px); } }
}
@media (prefers-reduced-transparency: reduce) {
  .owner-tabs, .toast, .toast.success, .toast.error, .toast.info, #undo-bar, #sidebar { background: var(--bg-card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active, .btn-icon:active, .pulse-tile:active, .vehicle-card:active, .owner-card:active { transform: none; }
  #sidebar.open.closing { animation: none; }
}

/* San Francisco wants slightly tighter letters at title sizes. */
.section-title, .card-title, .modal-header h3 { letter-spacing: -.02em; }

/* Last leftovers of the shared look. */
.vd-now { border-color: transparent; border-radius: 18px; }
.dp-done, .dp-reset { border-radius: 999px; }
.dp-nav, .dp-step { border-radius: 50%; }
.car-pick:not(:focus-visible) { border-color: transparent; border-radius: 12px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.combo .combo-input:not(:focus) { border-color: transparent; border-radius: 12px; background: color-mix(in srgb, var(--text) 7%, transparent); }
/* The period picker has to fit beside "Utilization" in a narrow tile. */
.vd-util-label .vd-win { flex: 0 0 auto; width: 70px; padding: .15rem .4rem; }

/* Rental details on the phone: four actions in one row, icon over a full word
   (like iPhone action rows), so "Contact" and "Contract" are never cut to "Con…". */
@media (max-width: 700px) {
  .res-info-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .res-info-actions .res-info-wa, .res-info-actions .res-info-wa + .res-info-edit { grid-column: span 2; }
  .res-info-actions .btn:not(.res-info-wa):not(.res-info-edit) {
    flex-direction: column; gap: .2rem;
    min-height: 3.4rem; padding: .4rem .15rem;
    border-radius: 16px;
    font-size: .74rem;
  }
  .res-info-actions .btn svg { width: 18px; height: 18px; }
}

/* Phone: a scroll that reaches the end of a pop-up stops there. */
@media (max-width: 700px) {
  #modal-overlay, #modal-box, #modal-body { overscroll-behavior: contain; }
}

/* Rental form: short and plain. */
.rental-form .form-group { margin-bottom: .7rem; }
.rental-form .form-section-head { margin: .85rem 0 .5rem; }
.rental-form .form-row, .rental-form .form-row-3 { margin-bottom: 0; }
.f-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem; }
#modal-body .f-label-row > label { margin-bottom: .3rem; text-transform: none; letter-spacing: 0; font-size: .82rem; color: var(--text); }
.f-link { display: inline-flex; align-items: center; gap: .2rem; padding: 0; border: 0; background: none; color: var(--primary-ink); font-size: .76rem; font-weight: 500; white-space: nowrap; }
.f-link svg { width: 12px; height: 12px; }
.f-driver-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.f-driver-row > input { flex: 1 1 0; min-width: 0; }
.f-licence { flex: 0 0 auto; max-width: 100%; }
.f-licence:has(#f-licence-has[style*="flex"]) { flex: 1 1 100%; }
.f-licence-state { align-items: center; gap: .4rem; }
#f-licence-img { font-size: 0; width: 56px; height: 36px; object-fit: cover; border-radius: 6px; background: color-mix(in srgb, var(--text) 8%, transparent); }
#f-licence-note { flex: 1; min-width: 0; font-size: .75rem; color: var(--text-muted); }
#f-licence-note:empty { visibility: hidden; }
.f-profit-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; margin: -.1rem 0 .8rem; font-size: .85rem; color: var(--text-muted); }
.f-profit-line strong { font-weight: 700; }
.f-profit-line small { flex-basis: 100%; font-size: .72rem; }
.f-more { margin-bottom: .7rem; border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent); }
.f-more > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-size: .88rem; font-weight: 600; color: var(--text); cursor: pointer; list-style: none; }
.f-more > summary::-webkit-details-marker { display: none; }
.f-more > summary::after { content: '›'; color: var(--text-muted); font-size: 1.1rem; transition: transform .15s ease; }
.f-more[open] > summary::after { transform: rotate(90deg); }
.f-more > summary:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; border-radius: 6px; }
.f-check { display: flex; align-items: center; gap: .55rem; min-height: 36px; font-size: .875rem; color: var(--text); cursor: pointer; }
.f-check[hidden] { display: none; }
.f-check input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--accent); }
.f-foot-total { display: flex; flex-direction: column; margin-right: auto; line-height: 1.15; font-variant-numeric: tabular-nums; }
.f-foot-total strong { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.f-foot-lbl, .f-foot-dep { font-size: .72rem; color: var(--text-muted); }

/* Car form: short and plain. */
.fv-hint { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }
.fv-hint:empty { display: none; }
#fv-website-fold, #fv-more-fold, .fv-fold { margin: .5rem 0; }
.fv-fold > .form-group:last-child { margin-bottom: .85rem; }
/* One line of colours; the rest are a swipe away. Padding keeps the ring on the picked one. */
#fv-swatches { flex-wrap: nowrap; overflow-x: auto; padding: 3px; margin: -3px; scrollbar-width: none; }
#fv-swatches::-webkit-scrollbar { display: none; }
#fv-swatches .fv-sw { flex: 0 0 auto; }


/* ── Reports: three tabs, one Period and one Owner menu ── */
.rep-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.rep-caret { width: 13px; height: 13px; margin-left: .25rem; opacity: .7; }
.rep-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.rep-cards.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rep-card { display: flex; flex-direction: column; gap: .15rem; align-items: flex-start; text-align: left; padding: .85rem 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; color: inherit; font: inherit; min-width: 0; }
.rep-card-label { font-size: .78rem; color: var(--text-muted); }
.rep-card-num { font-size: 1.55rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rep-card-num.is-owed, .rep-owes { color: var(--warning); }
.rep-card-sub { font-size: .75rem; color: var(--text-muted); }
button.rep-card { cursor: pointer; transition: transform .12s ease, opacity .12s ease; }
button.rep-card:hover { opacity: .85; }
button.rep-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button.rep-card:active { transform: scale(.98); }
.rep-note { margin: .6rem 0 0; font-size: .8rem; color: var(--text-muted); }
.rep-card-head { padding-top: .65rem; padding-bottom: .65rem; flex-direction: row; align-items: center; justify-content: space-between; gap: .5rem; }
.rep-head-note { font-size: .82rem; color: var(--text-muted); }
.rep-head-note strong { color: var(--text); }
.rep-table { width: 100%; }
.rep-table tbody td { font-variant-numeric: tabular-nums; }
.rep-table th:nth-child(n+4), .rep-n, .rep-profit { text-align: right; }
.rep-table .rep-chev { width: 24px; padding-right: 0; color: var(--text-muted); }
.rep-busy { display: inline-block; min-width: 38px; padding: 2px 8px; border-radius: 999px; text-align: center; }
.rep-busy-high { background: rgba(34,197,94,.15); color: var(--success); }
.rep-busy-mid { background: rgba(234,179,8,.15); color: var(--warning); }
.rep-busy-low { background: rgba(239,68,68,.15); color: var(--danger); }
.rep-more { padding: .6rem; text-align: center; border-top: 1px solid var(--border); }
.rep-total td { font-weight: 700; background: var(--bg); }
.rep-table .finance-vehicle-detail > td { padding: .85rem 1rem; background: var(--bg); border-top: 1px solid var(--border); }
.rep-detail-head { display: flex; justify-content: flex-end; margin-bottom: .5rem; }
.rep-paid { white-space: nowrap; text-align: right; }
.rep-paid-yes { margin-left: .3rem; font-size: .72rem; color: var(--success); }
.rep-lead { display: flex; flex-direction: column; gap: .15rem; padding-bottom: .4rem; }
.rep-big { font-size: 1.7rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rep-big.is-owed { color: var(--warning); }
/* Settlement in the Reports look: owner boxes as soft as the figure boxes. */
.settlement-owner-grid { gap: .6rem; padding: .6rem 1.25rem 1.25rem; }
.settlement-owner-grid .settlement-owner-card { background: transparent; border-radius: 14px; padding: .85rem 1rem; box-shadow: none; transition: transform .12s ease, opacity .12s ease; }
.settlement-owner-grid .settlement-owner-card:hover { box-shadow: none; border-color: var(--border); }
@media (hover: hover) { .settlement-owner-grid .settlement-owner-card.is-link:hover { opacity: .85; } }
.settlement-owner-grid .settlement-owner-card.is-link:active { transform: scale(.98); }
@media (max-width: 700px) { .settlement-owner-grid { padding: .6rem 1rem 1rem; } }
.rep-tight { padding-top: .5rem; }
.rep-cards:last-child { margin-bottom: 0; }
.rep-table th.rep-n { text-align: right; }
@media (max-width: 640px) { .reports-head .owner-tabs .owner-tab { padding-left: .35rem; padding-right: .35rem; font-size: .8rem; white-space: nowrap; } }
.cal-alerts { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.cal-alerts:not(:has(button)) { display: none; }
.cal-alert { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border: 1px solid var(--warning); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: .8rem; cursor: pointer; transition: transform .12s ease, opacity .12s ease; }
.cal-alert svg { width: 14px; height: 14px; color: var(--warning); }
.cal-alert:hover { opacity: .8; }
.cal-alert:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cal-alert:active { transform: scale(.97); }
@media (max-width: 640px) {
  .rep-cards, .rep-cards.is-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rep-busy { min-width: 0; padding: 0; background: none !important; }
  .rep-owners { table-layout: fixed; }
  .rep-owners thead th { font-size: .62rem; padding-left: .25rem; padding-right: .25rem; white-space: normal; }
  .rep-owners thead th:nth-child(2) { width: 34%; }
  .rep-owners tbody td { padding-left: .25rem; padding-right: .25rem; }
  .rep-table .finance-vehicle-detail > td { padding: .5rem .7rem; }
  .rep-table .finance-detail-table, .rep-table .finance-detail-table tbody { display: block; width: 100%; }
  .rep-table .finance-detail-table thead { display: none; }
  .rep-table .finance-detail-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .9rem; padding: .55rem 0; border-top: 1px solid var(--border); }
  .rep-table .finance-detail-table td { display: block; padding: 0; border: 0; font-size: .8rem; text-align: left; }
  .rep-table .finance-detail-table td:first-child { width: 100%; }
  .rep-table .finance-detail-table td[data-d]::before { content: attr(data-d) " "; color: var(--text-muted); font-weight: 400; }
  .rep-table .finance-detail-table .rep-paid { margin-left: auto; }
}

/* Goals: the In progress / Achieved / Missed boxes are that page's tabs. */
.goals-tab { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.goals-tab.active { border-color: var(--tab-color); box-shadow: inset 0 0 0 1px var(--tab-color); }
.goals-tab:active { transform: scale(.97); }
.goals-tab:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
@media (hover: hover) { .goals-tab:not(.active):hover { border-color: var(--text-muted); } }

/* ── Phone bar: ••• and its More panel (mobile-bar.js) ──
   The panel sits right behind the bar and rises out of it, so bar and panel
   read as one piece of glass that grew taller. */
#mob-panel, #mob-scrim { display: none; }
@media (max-width: 700px) {
  #mobile-nav .mob-link.off-bar { display: none !important; }
  #mobile-nav.fleet-on-bar #mob-more .requests-badge { display: none !important; }
  /* While the More panel is open, ••• carries the shading (it opened the panel),
     not the page you're on. */
  #mobile-nav.more-open .mob-link.active:not(#mob-more) { background: none; }
  #mobile-nav.more-open #mob-more { background: color-mix(in srgb, var(--text) 20%, transparent); }
  /* Notes ("The bar holds 4 pages…") rise above the open panel instead of covering its tiles. */
  body.mob-panel-open #save-status { bottom: calc(var(--mob-panel-h, 200px) + max(10px, calc(env(safe-area-inset-bottom, 0px) - 12px)) + 10px) !important; }
  body.mob-panel-open #toast-container { bottom: calc(var(--mob-panel-h, 200px) + max(10px, calc(env(safe-area-inset-bottom, 0px) - 12px)) + 10px); }

  #mob-scrim {
    display: block; position: fixed; inset: 0; z-index: 98;
    background: rgba(0,0,0,.22); opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  #mob-scrim.visible { opacity: 1; pointer-events: auto; }

  #mob-panel {
    display: block; position: fixed; z-index: 99;
    left: 12px; right: 12px;
    bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) - 12px));
    padding: 14px 8px calc(var(--mobile-nav-h) + 8px);
    border: 1px solid var(--glass-rim);
    border-radius: 30px;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    backdrop-filter: blur(24px) saturate(190%);
    box-shadow: var(--glass-shadow);
    transform-origin: 50% 100%;
    opacity: 0; transform: translateY(18px) scaleY(.7);
    visibility: hidden; pointer-events: none;
    transition: opacity .18s ease, transform .34s var(--sheet-ease), visibility 0s linear .34s;
  }
  #mob-panel.open {
    opacity: 1; transform: none; visibility: visible; pointer-events: auto;
    transition: opacity .18s ease, transform .34s var(--sheet-ease), visibility 0s;
  }
  .mob-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 10px; }
  #mob-panel-title { font-size: 1.02rem; font-weight: 600; color: var(--text); }
  #mob-panel-edit {
    border: 0; background: none; cursor: pointer; font: inherit; font-size: .95rem; font-weight: 600;
    color: var(--brand-ink); padding: 6px 10px; margin: -6px -10px; border-radius: 999px;
    transition: transform .14s var(--ease-spring);
  }
  #mob-panel-edit:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
  #mob-panel-edit:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
  #mob-panel-edit:active { transform: scale(.94); }

  #mob-panel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .mob-tile {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 10px 2px 8px; border: 0; border-radius: 18px; background: none;
    color: var(--text); font: inherit; font-size: .74rem; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .14s var(--ease-spring);
  }
  .mob-tile-icon { position: relative; display: inline-flex; }
  .mob-tile-icon svg { width: 25px; height: 25px; }
  .mob-tile-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .mob-tile.active { background: color-mix(in srgb, var(--text) 16%, transparent); }
  .mob-tile:active { transform: scale(.92); }
  .mob-tile:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: -2px; }
  @media (hover: hover) { .mob-tile:hover { background: color-mix(in srgb, var(--text) 9%, transparent); } }
  .mob-tile-badge {
    position: absolute; top: -6px; right: -12px;
    min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px;
    background: var(--danger); color: #fff; font-size: .62rem; font-weight: 700;
    text-align: center; border-radius: 999px;
  }

  /* Edit: every page, ticked ones are on the bar. */
  #mob-panel.editing .mob-tile:not(.on-bar) { opacity: .5; }
  .mob-tile-check { display: none; }
  #mob-panel.editing .mob-tile-check {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: -6px; right: -10px; width: 17px; height: 17px; border-radius: 50%;
    background: var(--bg-card); border: 1.5px solid color-mix(in srgb, var(--text) 30%, transparent);
  }
  #mob-panel.editing .mob-tile-check svg { width: 11px; height: 11px; opacity: 0; }
  #mob-panel.editing .on-bar .mob-tile-check { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
  #mob-panel.editing .on-bar .mob-tile-check svg { opacity: 1; }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  #mob-panel, #mob-panel.open { transform: none; transition: opacity .15s ease, visibility 0s; }
}

/* Car form → Website & photos: the "Show on website" switch and its details. */
.fv-webapp { margin: 1rem 0 .85rem; padding-top: .9rem; border-top: 1px solid var(--border); }
/* Settings → Website → Choose cars (WebMove.openPicker) */
.wp-intro { font-size: .84rem; color: var(--text-muted); margin: 0 0 .75rem; line-height: 1.45; }
.wp-intro strong { color: var(--text); font-weight: 600; }
.wp-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: 0 0 .75rem; }
.wp-counts { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .82rem; color: var(--text-muted); }
.wp-counts b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.wp-counts .wp-changed { color: var(--primary); font-weight: 600; }
.wp-list { max-height: min(56vh, 620px); overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
.wp-group + .wp-group { border-top: 1px solid var(--border-strong); }
.wp-ghead { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .6rem .8rem; background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.wp-gname { display: flex; align-items: baseline; gap: .45rem; min-width: 0; font-size: .92rem; }
.wp-gname strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-you { font-size: .68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--primary);
  background: var(--primary-light); padding: .1rem .4rem; border-radius: 999px; }
.wp-row { display: flex; align-items: center; gap: .75rem; padding: .55rem .8rem; }
.wp-row + .wp-row { border-top: 1px solid var(--border); }
.wp-thumb { width: 56px; height: 42px; flex: 0 0 auto; object-fit: cover; border-radius: 6px; background: var(--bg-soft); }
.wp-name { display: flex; flex-direction: column; gap: .1rem; min-width: 0; flex: 1 1 auto; font-size: .88rem; }
.wp-name strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-sub { font-size: .76rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-new { color: var(--success); font-weight: 600; }
.wp-noprice { color: var(--warning); }
.wp-warn { font-size: .74rem; color: var(--warning); }
.wp-seg { display: inline-flex; flex: 0 0 auto; padding: 2px; gap: 2px; border-radius: 9px; background: var(--bg-soft); border: 1px solid var(--border); }
.wp-seg button { appearance: none; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: .76rem; font-weight: 550;
  padding: .32rem .6rem; border-radius: 7px; cursor: pointer; white-space: nowrap;
  transition: background-color var(--transition), color var(--transition), transform .12s ease; }
@media (hover: hover) { .wp-seg button:hover { color: var(--text); background: var(--bg-hover); } }
.wp-seg button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.wp-seg button:active { transform: scale(.96); }
.wp-seg button[aria-pressed="true"] { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.wp-seg button[data-s="main"][aria-pressed="true"] { background: var(--primary); color: #fff; }
.wp-seg button[data-s="off"][aria-pressed="true"] { color: var(--text-muted); }
.wp-ghead .wp-seg.is-mixed { border-style: dashed; }
.wp-needs { margin: .75rem 0 0; font-size: .84rem; }
.wp-needs summary { cursor: pointer; color: var(--text-muted); padding: .2rem 0; }
.wp-needs summary:hover { color: var(--text); }
.wp-needs summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.wp-needs-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.wp-needs-list a { font-size: .78rem; padding: .25rem .55rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.wp-needs-list a:hover { background: var(--bg-hover); }
.wp-needs-list a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.wp-needs-list a:active { transform: scale(.97); }
@media (max-width: 600px) {
  .wp-list { max-height: none; overflow: visible; }   /* the sheet scrolls, not a box inside it */
  .wp-row { flex-wrap: wrap; row-gap: .45rem; }
  .wp-row .wp-name { flex-basis: calc(100% - 56px - .75rem); }
  .wp-row .wp-seg { width: 100%; }
  .wp-row .wp-seg button { flex: 1 1 0; }
  .wp-ghead { flex-wrap: wrap; row-gap: .4rem; }
  .wp-ghead .wp-seg { width: 100%; }
  .wp-ghead .wp-seg button { flex: 1 1 0; }
  .wp-seg button { font-size: .82rem; padding: .45rem .5rem; }
}
.fv-webapp .fv-webapp-switch { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; margin-bottom: .9rem;
  font-weight: 400; font-size: .9rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.fv-webapp .fv-webapp-switch input[type="checkbox"] { width: 18px; height: 18px; margin: .1rem 0 0; flex: 0 0 auto; accent-color: var(--primary); }
.fv-webapp .fv-webapp-switch:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

/* Install-the-app how-to (Safari has no install prompt) */
.install-steps { margin: 0 0 1rem; padding-left: 1.25rem; display: grid; gap: .6rem; line-height: 1.45; }
.install-note { margin: 0 0 1rem; color: var(--text-muted, #64748b); font-size: .88rem; }
.drawer-actions li[hidden] { display: none; }
