/* SHFIT Rent — sistema de diseño.
   Móvil primero (360–430 px), barra lateral desde 960 px.
   Tema: variables en :root; [data-tema="claro"|"oscuro"] fuerza, sin atributo = automático.
   Nada de estilos en línea: la CSP solo permite esta hoja. Desde JS, el.style.setProperty('--pct', 40). */

/* ───────────────────────── Tokens ───────────────────────── */
:root {
  color-scheme: light;
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --surface-3: #e7ebf1;
  --line: #d6dce4;
  --line-strong: #b3bccb;
  --text: #172033;
  --text-2: #3e4a5e;
  --text-3: #5b6779;
  --primary: #1f49b6;
  --primary-hover: #183c99;
  --primary-ink: #ffffff;
  --primary-soft: #e2e9fb;
  --primary-soft-ink: #1a3d99;
  --ok: #13795b;
  --ok-ink: #ffffff;
  --ok-soft: #daf2e7;
  --ok-soft-ink: #0d5e46;
  --warn: #f2b705;
  --warn-ink: #2f2400;
  --warn-soft: #fff1c7;
  --warn-soft-ink: #6b4b00;
  --danger: #b42318;
  --danger-hover: #961d14;
  --danger-ink: #ffffff;
  --danger-soft: #fde3df;
  --danger-soft-ink: #8f1c13;
  --orange: #c2410c;
  --orange-soft: #ffe6d5;
  --orange-soft-ink: #8a2e08;
  --neutral-soft: #e4e8ee;
  --neutral-soft-ink: #3e4a5e;

  /* Estados de contrato (calendario, chips, barras) */
  --est-reserva: #f2b705;
  --est-reserva-ink: #2f2400;
  --est-en_curso: #1f49b6;
  --est-en_curso-ink: #ffffff;
  --est-finalizado: #6b778a;
  --est-finalizado-ink: #ffffff;
  --est-cancelado: #d6dce4;
  --est-cancelado-ink: #3e4a5e;

  /* Matrícula: objeto real, igual en los dos temas */
  --plate-bg: #fbfbf8;
  --plate-ink: #111418;
  --plate-band: #1f3fa8;

  --focus: #1f49b6;
  --overlay: rgba(15, 22, 35, 0.48);
  --shadow-pop: 0 10px 30px rgba(15, 22, 35, 0.18), 0 2px 6px rgba(15, 22, 35, 0.08);
  --shadow-bar: 0 -1px 0 var(--line);

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "DIN Next", "D-DIN", "sans-serif-condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;

  --fs-xs: 0.75rem;   /* 12 */
  --fs-sm: 0.875rem;  /* 14 */
  --fs-md: 1rem;      /* 16 */
  --fs-lg: 1.125rem;  /* 18 */
  --fs-xl: 1.375rem;  /* 22 */
  --fs-2xl: 1.75rem;  /* 28 */
  --fs-3xl: 2.25rem;  /* 36 */
  --fs-num: 2.5rem;   /* 40, km y combustible */

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  --tap: 44px;
  --tap-lg: 52px;
  --header-h: 56px;
  --nav-h: 64px;
  --side-w: 248px;
  --content-max: 1180px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    color-scheme: dark;
    --bg: #0e131b;
    --surface: #161d28;
    --surface-2: #1b2431;
    --surface-3: #232e3d;
    --line: #2a3546;
    --line-strong: #3d4b60;
    --text: #e8edf4;
    --text-2: #c0cad7;
    --text-3: #93a0b2;
    --primary: #86a6ff;
    --primary-hover: #a3bcff;
    --primary-ink: #0a1638;
    --primary-soft: #1c2b4f;
    --primary-soft-ink: #b9cbff;
    --ok: #4cc79a;
    --ok-ink: #04261a;
    --ok-soft: #12352a;
    --ok-soft-ink: #8fe3c2;
    --warn: #f5c451;
    --warn-ink: #2a1f00;
    --warn-soft: #3a2f0d;
    --warn-soft-ink: #f8d77f;
    --danger: #ff8a7a;
    --danger-hover: #ffa699;
    --danger-ink: #3a0802;
    --danger-soft: #401a17;
    --danger-soft-ink: #ffb4a9;
    --orange: #ff9f66;
    --orange-soft: #3d2312;
    --orange-soft-ink: #ffc29c;
    --neutral-soft: #263142;
    --neutral-soft-ink: #c0cad7;
    --est-reserva: #f5c451;
    --est-reserva-ink: #2a1f00;
    --est-en_curso: #86a6ff;
    --est-en_curso-ink: #0a1638;
    --est-finalizado: #7d8a9e;
    --est-finalizado-ink: #0e131b;
    --est-cancelado: #2f3a4b;
    --est-cancelado-ink: #c0cad7;
    --focus: #a3bcff;
    --overlay: rgba(0, 0, 0, 0.6);
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
  }
}

:root[data-tema="oscuro"] {
  color-scheme: dark;
  --bg: #0e131b;
  --surface: #161d28;
  --surface-2: #1b2431;
  --surface-3: #232e3d;
  --line: #2a3546;
  --line-strong: #3d4b60;
  --text: #e8edf4;
  --text-2: #c0cad7;
  --text-3: #93a0b2;
  --primary: #86a6ff;
  --primary-hover: #a3bcff;
  --primary-ink: #0a1638;
  --primary-soft: #1c2b4f;
  --primary-soft-ink: #b9cbff;
  --ok: #4cc79a;
  --ok-ink: #04261a;
  --ok-soft: #12352a;
  --ok-soft-ink: #8fe3c2;
  --warn: #f5c451;
  --warn-ink: #2a1f00;
  --warn-soft: #3a2f0d;
  --warn-soft-ink: #f8d77f;
  --danger: #ff8a7a;
  --danger-hover: #ffa699;
  --danger-ink: #3a0802;
  --danger-soft: #401a17;
  --danger-soft-ink: #ffb4a9;
  --orange: #ff9f66;
  --orange-soft: #3d2312;
  --orange-soft-ink: #ffc29c;
  --neutral-soft: #263142;
  --neutral-soft-ink: #c0cad7;
  --est-reserva: #f5c451;
  --est-reserva-ink: #2a1f00;
  --est-en_curso: #86a6ff;
  --est-en_curso-ink: #0a1638;
  --est-finalizado: #7d8a9e;
  --est-finalizado-ink: #0e131b;
  --est-cancelado: #2f3a4b;
  --est-cancelado-ink: #c0cad7;
  --focus: #a3bcff;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ───────────────────────── Base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { margin: 0; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-4) 0; }
ul.plain, ol.plain { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-xs); }
::selection { background: var(--primary-soft); color: var(--text); }
[hidden] { display: none !important; }

@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; }
}

/* Arranque */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; color: var(--text-3); }
.noscript { padding: var(--sp-5); text-align: center; }

/* ───────────────────────── Shell ───────────────────────── */
.shell { min-height: 100vh; min-height: 100dvh; }
.shell-body { min-width: 0; }
.shell-main:focus { outline: none; }
.skip-link { position: absolute; left: var(--sp-3); top: -60px; z-index: 100; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-md); background: var(--primary); color: var(--primary-ink); font-weight: 650; }
.skip-link:focus { top: var(--sp-3); color: var(--primary-ink); }
.shell-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--sp-2);
  height: calc(var(--header-h) + var(--safe-t));
  padding: var(--safe-t) var(--sp-2) 0 var(--sp-4);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.shell-brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--sp-2); color: var(--text); text-decoration: none; }
.shell-brand:hover { color: var(--text); }
.shell-brand-name { font-weight: 700; font-size: var(--fs-lg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-main { padding: var(--sp-4) var(--sp-4) calc(var(--nav-h) + var(--safe-b) + var(--sp-6)); max-width: var(--content-max); margin: 0 auto; }
.shell-foot { display: none; }

/* Navegación inferior (móvil) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  box-shadow: var(--shadow-bar);
}
.bottom-nav a, .bottom-nav button {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0; border: 0; background: none; padding: 6px 2px 4px;
  color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; text-decoration: none;
}
.bottom-nav .icon { width: 24px; height: 24px; }
.bottom-nav [aria-current="page"], .bottom-nav .is-active { color: var(--primary); }
.bottom-nav [aria-current="page"]::before, .bottom-nav .is-active::before {
  content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary);
}

/* Barra lateral (PC) */
.side-nav { display: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--side-w) 1fr; }
  .shell-header, .bottom-nav { display: none; }
  .side-nav {
    display: flex; flex-direction: column; gap: var(--sp-1);
    position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
    padding: var(--sp-4) var(--sp-3);
    background: var(--surface); border-right: 1px solid var(--line);
  }
  .side-brand { padding: var(--sp-2) var(--sp-2) var(--sp-4); font-weight: 700; font-size: var(--fs-lg); line-height: 1.25; color: var(--text); text-decoration: none; }
  .side-brand:hover { color: var(--text); }
  .side-new { margin: 0 0 var(--sp-3); }
  .side-nav nav { display: flex; flex-direction: column; gap: 2px; }
  .side-link {
    display: flex; align-items: center; gap: var(--sp-3);
    min-height: 42px; padding: 0 var(--sp-3); border-radius: var(--r-md);
    color: var(--text-2); font-weight: 550; text-decoration: none;
  }
  .side-link .icon { width: 20px; height: 20px; flex: none; color: var(--text-3); }
  .side-link:hover { background: var(--surface-2); color: var(--text); }
  .side-link[aria-current="page"] { background: var(--primary-soft); color: var(--primary-soft-ink); }
  .side-link[aria-current="page"] .icon { color: var(--primary-soft-ink); }
  .side-sep { height: 1px; background: var(--line); margin: var(--sp-2) var(--sp-2); }
  .side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-2); padding-top: var(--sp-4); }
  .side-user { padding: 0 var(--sp-2); font-size: var(--fs-sm); color: var(--text-3); }
  .side-user strong { display: block; color: var(--text); font-weight: 600; }
  .shell-main { width: 100%; padding: var(--sp-5) var(--sp-6) var(--sp-7); }
  .shell-foot { display: block; padding: 0 var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); }
}

/* Menú "Más" (hoja) */
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.more-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 84px; padding: var(--sp-3) var(--sp-1);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
  color: var(--text); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; text-align: center;
}
.more-tile .icon { width: 26px; height: 26px; color: var(--primary); }
.more-tile[aria-current="page"] { border-color: var(--primary); background: var(--primary-soft); }
.more-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }

/* ───────────────────────── Pantalla y cabecera ───────────────────────── */
.screen { display: flex; flex-direction: column; gap: var(--sp-4); }
.page-header { display: flex; align-items: flex-start; gap: var(--sp-3); flex-wrap: wrap; }
.page-header-text { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.page-title { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.page-sub { color: var(--text-3); font-size: var(--fs-sm); }
.page-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.page-back {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--tap); height: var(--tap); margin: -4px 0 0 -10px; border-radius: var(--r-pill);
  color: var(--text-2); text-decoration: none;
}
.page-back:hover { background: var(--surface-3); color: var(--text); }
@media (max-width: 559px) {
  .page-title { font-size: var(--fs-xl); }
  .page-header-text { flex-basis: 0; flex-grow: 1; }
  .page-actions:has(> .btn:not(.btn-icon)) { width: 100%; }
  .page-actions > .btn:not(.btn-icon) { flex: 1 1 auto; }
  .page-actions > .btn-icon { margin: -6px -8px 0 0; }
}

.section { display: flex; flex-direction: column; gap: var(--sp-3); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.section-title { font-size: var(--fs-lg); font-weight: 650; }
.section-note { color: var(--text-3); font-size: var(--fs-sm); }

/* ───────────────────────── Utilidades de layout ───────────────────────── */
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.stack-xs { display: flex; flex-direction: column; gap: var(--sp-1); }
.stack-sm { display: flex; flex-direction: column; gap: var(--sp-2); }
.stack-lg { display: flex; flex-direction: column; gap: var(--sp-5); }
.row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.row-nowrap { display: flex; align-items: center; gap: var(--sp-2); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.row-end { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--sp-3); grid-template-columns: 1fr; }
.grid-auto { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.span-all { grid-column: 1 / -1; }

.gap-0 { gap: 0; } .gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); } .gap-5 { gap: var(--sp-5); }
.m-0 { margin: 0; }
.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); }
.mb-1 { margin-bottom: var(--sp-1); } .mb-2 { margin-bottom: var(--sp-2); } .mb-3 { margin-bottom: var(--sp-3); } .mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); }
.p-0 { padding: 0; } .p-2 { padding: var(--sp-2); } .p-3 { padding: var(--sp-3); } .p-4 { padding: var(--sp-4); }
.w-full { width: 100%; }

.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.strong { font-weight: 650; }
.num { font-variant-numeric: tabular-nums; }
.big-num { font-family: var(--font-num); font-size: var(--fs-num); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pre-line { white-space: pre-line; }
.break { overflow-wrap: anywhere; }
.text-ok { color: var(--ok); } .text-danger { color: var(--danger); } .text-warn { color: var(--warn-soft-ink); } .text-primary { color: var(--primary); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 719px) { .hide-mobile { display: none !important; } }
@media (min-width: 720px) { .hide-desktop { display: none !important; } }

/* ───────────────────────── Iconos ───────────────────────── */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* ───────────────────────── Botones ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: 0 var(--sp-4);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: var(--fs-md); line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
  user-select: none; touch-action: manipulation;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { background: var(--surface-3); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-ink); }
.btn-primary:active { background: var(--primary-hover); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: var(--ok-ink); }
.btn-ok:hover, .btn-ok:active { background: var(--ok); color: var(--ok-ink); filter: brightness(0.94); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); }
.btn-danger:hover, .btn-danger:active { background: var(--danger-hover); border-color: var(--danger-hover); color: var(--danger-ink); }
.btn-danger-outline { color: var(--danger); border-color: var(--danger); background: var(--surface); }
.btn-danger-outline:hover { background: var(--danger-soft); color: var(--danger-soft-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.btn-link:hover { background: none; color: var(--primary-hover); }
.btn-sm { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-lg { min-height: var(--tap-lg); padding: 0 var(--sp-5); font-size: var(--fs-lg); }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: var(--tap); padding: 0; flex: none; }
.btn-icon.btn-sm { width: 36px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: var(--text-3); border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.btn-primary[aria-busy="true"]::after, .btn-ok[aria-busy="true"]::after, .btn-danger[aria-busy="true"]::after { border-color: rgba(255, 255, 255, 0.9); border-right-color: transparent; }
.btn-group { display: inline-flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ───────────────────────── Tarjetas ───────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4); min-width: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.card-flush > .card-head { margin: 0; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.card-title { font-size: var(--fs-lg); font-weight: 650; }
.card-sub { color: var(--text-3); font-size: var(--fs-sm); }
.card-foot { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }
a.card, .card-link { display: block; color: inherit; text-decoration: none; }
a.card:hover, .card-link:hover { border-color: var(--line-strong); color: inherit; }
.card-inset { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3); }
.card-accent { border-left: 4px solid var(--primary); }

/* ───────────────────────── Listas ───────────────────────── */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.list-flat { border: 0; border-radius: 0; background: transparent; }
.list > li + li, .list > .item + .item { border-top: 1px solid var(--line); }
.item {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 60px; padding: var(--sp-3) var(--sp-4);
  color: inherit; text-decoration: none; background: transparent; width: 100%; border: 0; text-align: left;
}
a.item:hover, button.item:hover { background: var(--surface-2); color: inherit; }
a.item:active, button.item:active { background: var(--surface-3); }
.item-lead { flex: none; display: flex; align-items: center; justify-content: center; }
.item-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-title { font-weight: 600; overflow-wrap: anywhere; }
.item-sub { color: var(--text-3); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.item-meta { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; color: var(--text-3); font-size: var(--fs-sm); }
.item-trail { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.item-chevron { flex: none; color: var(--text-3); }

/* Lista de clave/valor (fichas) */
.kv { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: var(--sp-2) var(--sp-5); margin: 0; }
.kv dt { color: var(--text-3); font-size: var(--fs-sm); padding-top: 1px; }
.kv dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
@media (min-width: 720px) { .kv-2 { grid-template-columns: minmax(110px, 18%) 1fr minmax(110px, 18%) 1fr; } }

/* ───────────────────────── Tablas (tarjetas en móvil) ───────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 10px var(--sp-3); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table th { font-weight: 600; color: var(--text-3); background: var(--surface-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num, .table .text-right { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.is-link { cursor: pointer; }
.table-link { color: var(--text); font-weight: 650; text-decoration: none; }
.table-link:hover { color: var(--primary); text-decoration: underline; }
.table tr.is-link:hover td { background: var(--surface-2); }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line-strong); border-bottom: 0; }
@media (max-width: 719px) {
  .table-cards { background: transparent; border: 0; overflow: visible; }
  .table-cards .table, .table-cards tbody, .table-cards tfoot { display: block; }
  .table-cards thead { display: none; }
  .table-cards tr { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--sp-3); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
  .table-cards td { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 2px 0; border: 0; grid-column: 1 / -1; font-size: var(--fs-sm); }
  .table-cards td::before { content: attr(data-label); color: var(--text-3); font-weight: 500; }
  .table-cards td.num { text-align: right; }
  .table-cards td.cell-title { grid-column: 1; font-size: var(--fs-md); font-weight: 650; }
  .table-cards td.cell-title::before, .table-cards td.cell-badge::before, .table-cards td[data-label=""]::before { content: none; }
  .table-cards td.cell-badge { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .table-cards td.cell-hide { display: none; }
  .table-cards tfoot tr { background: var(--surface-2); }
}

/* ───────────────────────── Formularios ───────────────────────── */
.form { display: flex; flex-direction: column; gap: var(--sp-4); }
.form-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-4) var(--sp-4); }
@media (min-width: 720px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4); margin: 0; background: var(--surface); display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.fieldset > legend { padding: 0 var(--sp-2); margin-left: calc(var(--sp-2) * -1); font-weight: 650; font-size: var(--fs-lg); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); }
.field-label .req { color: var(--danger); margin-left: 2px; }
.field-hint { font-size: var(--fs-xs); color: var(--text-3); }
.field-error { font-size: var(--fs-sm); color: var(--danger); font-weight: 600; }
.control {
  width: 100%; min-height: var(--tap); padding: 10px var(--sp-3);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-md); /* 16 px evita el zoom de iOS */
  transition: border-color 0.12s, box-shadow 0.12s;
}
.control::placeholder { color: var(--text-3); opacity: 0.8; }
.control:hover { border-color: var(--text-3); }
.control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.control:focus-visible { outline: none; }
.control[disabled], .control[readonly] { background: var(--surface-2); color: var(--text-2); }
textarea.control { min-height: 96px; resize: vertical; line-height: 1.45; }
select.control {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
input[type="date"].control, input[type="time"].control, input[type="datetime-local"].control { min-width: 0; }
.field.is-invalid .control { border-color: var(--danger); }
.field.is-invalid .control:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.control-big { min-height: 64px; font-family: var(--font-num); font-size: var(--fs-3xl); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.input-group { display: flex; align-items: stretch; }
.input-group .control { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.input-group .addon { display: flex; align-items: center; padding: 0 var(--sp-3); border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--r-md) var(--r-md) 0; background: var(--surface-2); color: var(--text-3); font-weight: 600; white-space: nowrap; }
.dt-pair { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--sp-2); }

.check { display: flex; align-items: flex-start; gap: var(--sp-3); min-height: var(--tap); padding: 10px 0; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 2px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); display: grid; place-content: center; cursor: pointer; }
.check input::after { content: ""; width: 12px; height: 7px; border: 3px solid var(--primary-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.check-label { padding-top: 1px; }
.check-label .field-hint { display: block; margin-top: 2px; }

.segmented { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-3); border-radius: var(--r-md); max-width: 100%; overflow-x: auto; }
.segmented button { flex: 1 0 auto; min-height: 38px; padding: 0 var(--sp-3); border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
.segmented button[aria-pressed="true"], .segmented button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.segmented-block { display: flex; width: 100%; }

.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .control { padding-left: 42px; }

.form-actions { display: flex; gap: var(--sp-2); justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 719px) {
  .form-actions > .btn { flex: 1 1 auto; }
}
/* Barra de acciones fija abajo en móvil (formularios largos y asistentes) */
.actionbar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 20;
  display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4);
  margin: 0 calc(var(--sp-4) * -1);
  background: var(--bg); border-top: 1px solid var(--line);
}
.actionbar > .btn { flex: 1 1 0; }
@media (min-width: 960px) {
  .actionbar { bottom: 0; margin: 0; padding: var(--sp-3) 0; justify-content: flex-end; }
  .actionbar > .btn { flex: 0 0 auto; min-width: 140px; }
}

/* ───────────────────────── Badges y chips ───────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 24px; padding: 2px 8px; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: 650; line-height: 1.2; white-space: nowrap;
  background: var(--neutral-soft); color: var(--neutral-soft-ink);
}
.badge-ok { background: var(--ok-soft); color: var(--ok-soft-ink); }
.badge-info { background: var(--primary-soft); color: var(--primary-soft-ink); }
.badge-aviso { background: var(--warn-soft); color: var(--warn-soft-ink); }
.badge-peligro { background: var(--danger-soft); color: var(--danger-soft-ink); }
.badge-naranja { background: var(--orange-soft); color: var(--orange-soft-ink); }
.badge-neutro { background: var(--neutral-soft); color: var(--neutral-soft-ink); }
.badge-solid-reserva { background: var(--est-reserva); color: var(--est-reserva-ink); }
.badge-solid-en_curso { background: var(--est-en_curso); color: var(--est-en_curso-ink); }
.badge-tachado { text-decoration: line-through; }
.badge-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.chips { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .count { font-variant-numeric: tabular-nums; opacity: 0.75; }

/* Estado de contrato como fondo (bloques de calendario, barras) */
.est-reserva { background: var(--est-reserva); color: var(--est-reserva-ink); }
.est-en_curso { background: var(--est-en_curso); color: var(--est-en_curso-ink); }
.est-finalizado { background: var(--est-finalizado); color: var(--est-finalizado-ink); }
.est-cancelado { background: var(--est-cancelado); color: var(--est-cancelado-ink); }

/* ───────────────────────── Matrícula (elemento firma) ───────────────────────── */
.plate {
  display: inline-flex; align-items: stretch; flex: none;
  height: 26px; border: 1.5px solid var(--plate-ink); border-radius: var(--r-xs);
  background: var(--plate-bg); color: var(--plate-ink); overflow: hidden;
  font-family: var(--font-num); font-weight: 600; font-size: 15px; line-height: 1; letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums; white-space: nowrap; vertical-align: middle;
}
.plate-band { display: flex; align-items: flex-end; justify-content: center; width: 12px; padding-bottom: 2px; background: var(--plate-band); color: #fff; font-family: var(--font-ui); font-size: 7px; font-weight: 700; letter-spacing: 0; }
.plate-text { display: flex; align-items: center; padding: 0 7px 0 6px; }
.plate-sm { height: 21px; font-size: 12.5px; }
.plate-sm .plate-band { width: 9px; font-size: 0; }
.plate-lg { height: 40px; font-size: 24px; border-width: 2px; border-radius: var(--r-sm); }
.plate-lg .plate-band { width: 18px; font-size: 10px; padding-bottom: 4px; }
.plate-lg .plate-text { padding: 0 12px 0 10px; }

/* ───────────────────────── Avisos en línea ───────────────────────── */
.alert { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary-soft-ink); border-left: 4px solid var(--primary); }
.alert .icon { margin-top: 2px; }
.alert-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alert-title { font-weight: 650; }
.alert-ok { background: var(--ok-soft); color: var(--ok-soft-ink); border-left-color: var(--ok); }
.alert-aviso { background: var(--warn-soft); color: var(--warn-soft-ink); border-left-color: var(--warn); }
.alert-peligro { background: var(--danger-soft); color: var(--danger-soft-ink); border-left-color: var(--danger); }
.alert a { color: inherit; font-weight: 650; }

/* Severidad de avisos (Inicio, listados) */
.sev { border-left: 4px solid var(--line-strong); }
.sev-critico { border-left-color: var(--danger); }
.sev-urgente { border-left-color: var(--orange); }
.sev-aviso { border-left-color: var(--warn); }

/* ───────────────────────── Estadísticas y barras ───────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.stat { padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: 4px; min-width: 0; border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin: -1px 0 0 -1px; }
.stat-label { color: var(--text-3); font-size: var(--fs-sm); }
.stat-value { font-family: var(--font-num); font-size: var(--fs-xl); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.stat-value.is-neg { color: var(--danger); }
.stat-note { color: var(--text-3); font-size: var(--fs-xs); }

.bar { position: relative; height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; --pct: 0; }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: calc(min(var(--pct), 100) * 1%); background: var(--primary); border-radius: inherit; }
.bar-ok .bar-fill { background: var(--ok); }
.bar-warn .bar-fill { background: var(--warn); }
.bar-danger .bar-fill { background: var(--danger); }

/* ───────────────────────── Pestañas ───────────────────────── */
.tabs { display: flex; gap: var(--sp-1); overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; flex: none; min-height: var(--tap); padding: 0 var(--sp-3); border: 0; background: none; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--primary); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: var(--sp-2); right: var(--sp-2); bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
.tab .count { margin-left: 4px; font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 500; }
.tab-panel { padding-top: var(--sp-4); }
.tab-panel:focus-visible { outline: none; }

/* ───────────────────────── Pasos de asistente ───────────────────────── */
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.step { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }
.step::before { content: ""; height: 4px; border-radius: var(--r-pill); background: var(--surface-3); }
.step.is-done::before { background: var(--primary); }
.step.is-current { color: var(--text); }
.step.is-current::before { background: var(--primary); }
.step-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 559px) {
  .step .step-label { display: none; }
  .step.is-current .step-label { display: block; }
  .step.is-current { flex-grow: 3; }
}
.wizard { display: flex; flex-direction: column; gap: var(--sp-4); }
.wizard-head { display: flex; flex-direction: column; gap: var(--sp-3); }
.wizard-body { display: flex; flex-direction: column; gap: var(--sp-4); }

/* Bloque de número grande (km, combustible) */
.metric { display: flex; flex-direction: column; gap: 4px; }
.metric-label { color: var(--text-3); font-size: var(--fs-sm); }
.metric-value { font-family: var(--font-num); font-size: var(--fs-num); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-unit { font-size: var(--fs-lg); color: var(--text-3); margin-left: 4px; font-weight: 500; }

/* ───────────────────────── Estados vacío y carga ───────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-6) var(--sp-4); color: var(--text-3); }
.empty .icon { width: 36px; height: 36px; stroke-width: 1.6; color: var(--line-strong); margin-bottom: var(--sp-1); }
.empty-title { color: var(--text); font-weight: 650; font-size: var(--fs-lg); }
.empty-text { max-width: 42ch; }
.empty .btn { margin-top: var(--sp-2); }
.empty-inline { padding: var(--sp-4); text-align: center; color: var(--text-3); font-size: var(--fs-sm); }

.loading { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); padding: var(--sp-6) var(--sp-4); color: var(--text-3); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--primary); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; border-radius: var(--r-sm); min-height: 16px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.error-state { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); padding: var(--sp-6) var(--sp-4); text-align: center; }
.error-state .icon { width: 36px; height: 36px; color: var(--danger); }

/* ───────────────────────── Modales (hoja inferior en móvil) ───────────────────────── */
dialog.modal {
  padding: 0; border: 0; color: var(--text); background: var(--surface);
  width: 100%; max-width: 100%; max-height: 92vh; max-height: 92dvh;
  margin: auto 0 0; border-radius: 18px 18px 0 0; box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; overflow: hidden;
}
dialog.modal:not([open]) { display: none; }
dialog.modal::backdrop { background: var(--overlay); }
dialog.modal[open] { animation: sheet-in 0.2s ease-out; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.modal-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 8px auto 0; flex: none; }
.modal-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-2) var(--sp-2) var(--sp-4); flex: none; }
.modal-title { flex: 1; min-width: 0; font-size: var(--fs-lg); font-weight: 650; }
.modal-body { padding: var(--sp-2) var(--sp-4) var(--sp-4); overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--sp-4); }
.modal-body > p { color: var(--text-2); }
.modal-actions { display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + var(--safe-b)); border-top: 1px solid var(--line); flex: none; background: var(--surface); }
.modal-actions > .btn { flex: 1 1 0; }
@media (min-width: 720px) {
  dialog.modal { width: min(560px, calc(100% - 48px)); margin: auto; border-radius: var(--r-lg); max-height: 86vh; }
  dialog.modal.modal-lg { width: min(820px, calc(100% - 48px)); }
  dialog.modal.modal-sm { width: min(420px, calc(100% - 48px)); }
  dialog.modal[open] { animation: pop-in 0.16s ease-out; }
  .modal-grip { display: none; }
  .modal-head { padding-top: var(--sp-4); }
  .modal-actions { justify-content: flex-end; padding-bottom: var(--sp-3); }
  .modal-actions > .btn { flex: 0 0 auto; min-width: 110px; }
}
@keyframes pop-in { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
dialog.modal.modal-full { max-height: 100vh; max-height: 100dvh; height: 100%; border-radius: 0; margin: 0; width: 100%; max-width: 100%; }

/* Visor de fotos */
dialog.viewer { padding: 0; border: 0; margin: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; background: #05070a; color: #fff; }
dialog.viewer::backdrop { background: #05070a; }
dialog.viewer[open] { display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: calc(var(--sp-2) + var(--safe-t)) var(--sp-2) var(--sp-2) var(--sp-4); font-variant-numeric: tabular-nums; }
.viewer-bar .btn { color: #fff; background: transparent; border-color: transparent; }
.viewer-bar .btn:hover { background: rgba(255, 255, 255, 0.12); }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; touch-action: pan-y pinch-zoom; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; display: grid; place-items: center; }
.viewer-prev { left: 8px; }
.viewer-next { right: 8px; }

/* ───────────────────────── Toasts ───────────────────────── */
.toasts { position: fixed; z-index: 1000; left: var(--sp-3); right: var(--sp-3); bottom: calc(var(--nav-h) + var(--safe-b) + var(--sp-3)); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); pointer-events: none; }
@media (min-width: 960px) { .toasts { left: auto; right: var(--sp-5); bottom: var(--sp-5); align-items: flex-end; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--sp-3);
  max-width: 480px; width: 100%; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-pop); font-weight: 550;
  animation: toast-in 0.18s ease-out;
}
@media (min-width: 960px) { .toast { width: auto; min-width: 280px; } }
.toast .icon { flex: none; }
.toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-ok .icon { color: var(--ok); }
.toast-error { background: var(--danger); color: var(--danger-ink); }
.toast-aviso { background: var(--warn); color: var(--warn-ink); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; }
.toast-close { border: 0; background: none; color: inherit; opacity: 0.8; padding: 4px; display: grid; place-items: center; border-radius: var(--r-sm); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 959px) {
  /* Con una barra de acciones fija (asistentes, formularios largos), los avisos van encima de ella y no tapan sus botones. */
  body:has(.actionbar) .toasts { bottom: calc(var(--nav-h) + var(--safe-b) + 72px + var(--sp-3)); }
  /* Dentro de un modal (hoja inferior), arriba: así no tapan los botones de la hoja. */
  html body dialog[open] .toasts { top: calc(var(--safe-t) + var(--sp-3)); bottom: auto; }
}
/* Pantalla táctil: nada pulsable por debajo de 44 px (botones pequeños, chips, selectores, cerrar aviso). */
@media (pointer: coarse) {
  .btn-sm, .chip, .segmented button { min-height: var(--tap); }
  .btn-icon.btn-sm { width: var(--tap); }
  .toast-close { min-width: var(--tap); min-height: var(--tap); margin: calc(var(--sp-2) * -1) calc(var(--sp-2) * -1) calc(var(--sp-2) * -1) 0; }
}

/* ───────────────────────── Galería de fotos ───────────────────────── */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: var(--sp-2); }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); }
.thumb > button.thumb-open, .thumb > a.thumb-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; color: var(--text-2); text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-doc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%; padding: var(--sp-2); font-size: var(--fs-xs); font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.thumb-remove { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(5, 7, 10, 0.7); color: #fff; display: grid; place-items: center; }
.thumb-add { aspect-ratio: 1; border: 2px dashed var(--line-strong); border-radius: var(--r-md); background: transparent; color: var(--text-3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: var(--fs-xs); font-weight: 600; }
.thumb-add:hover { border-color: var(--primary); color: var(--primary); }

/* ───────────────────────── Pickers ───────────────────────── */
.picker { display: flex; flex-direction: column; gap: var(--sp-2); }
.picker-results { max-height: 320px; overflow-y: auto; }
.picker-selected { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4); border: 1px solid var(--primary); border-radius: var(--r-md); background: var(--primary-soft); }
.picker-selected .item-sub { color: var(--text-2); }
.vehicle-options { display: grid; gap: var(--sp-2); grid-template-columns: 1fr; }
@media (min-width: 720px) { .vehicle-options { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
.vehicle-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: var(--sp-3) var(--sp-4); border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: inherit; width: 100%;
}
.vehicle-option:hover { border-color: var(--line-strong); }
.vehicle-option[aria-checked="true"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.vehicle-option[aria-disabled="true"] { opacity: 0.55; }
.vehicle-option .vo-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); width: 100%; }
.vehicle-option .vo-name { font-weight: 650; }
.vehicle-option .vo-meta { color: var(--text-3); font-size: var(--fs-sm); }

/* ───────────────────────── Login y cambio de contraseña ───────────────────────── */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--sp-5) var(--sp-4) calc(var(--sp-5) + var(--safe-b)); gap: var(--sp-5); }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: var(--sp-5); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); text-align: center; }
.auth-brand .plate { height: 46px; font-size: 26px; border-width: 2px; border-radius: var(--r-sm); }
.auth-brand .plate-band { width: 20px; font-size: 11px; padding-bottom: 5px; }
.auth-brand .plate-text { padding: 0 14px 0 12px; letter-spacing: 0.1em; }
.auth-title { font-size: var(--fs-xl); font-weight: 650; }
.auth-sub { color: var(--text-3); font-size: var(--fs-sm); }
.auth-foot { color: var(--text-3); font-size: var(--fs-xs); }

/* ───────────────────────── Inicio ───────────────────────── */
.dash { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .dash { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .dash-wide { grid-column: 1 / -1; }
}
.dash-col { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
.day-head { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.day-head .section-title { text-transform: none; }
.day-date { color: var(--text-3); font-size: var(--fs-sm); }

.agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.agenda > li + li { border-top: 1px solid var(--line); }
.agenda-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); }
.agenda-time { display: flex; flex-direction: column; gap: 4px; padding-top: 1px; }
.agenda-hour { font-family: var(--font-num); font-size: 1.625rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.agenda-kind { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-xs); font-weight: 700; }
.agenda-kind .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.agenda-kind-entrega { color: var(--ok); }
.agenda-kind-devolucion { color: var(--primary); }
.agenda-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.agenda-who { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.agenda-client { font-weight: 650; font-size: var(--fs-lg); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.agenda-client:hover { color: var(--primary); text-decoration: underline; }
.agenda-car { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; color: var(--text-2); font-size: var(--fs-sm); }
.agenda-place { display: flex; align-items: center; gap: 4px; color: var(--text-3); font-size: var(--fs-sm); }
.agenda-actions { grid-column: 1 / -1; display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.agenda-actions .btn-main { flex: 1 1 auto; min-width: 0; }
@media (min-width: 720px) {
  .agenda-actions { grid-column: 2; margin-top: var(--sp-2); }
  .agenda-actions .btn-main { flex: 0 0 auto; min-width: 150px; }
}
.agenda-empty { padding: var(--sp-4); color: var(--text-3); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); font-size: var(--fs-sm); }

.fleet { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.fleet > li + li { border-top: 1px solid var(--line); }
.fleet-item { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-3) var(--sp-4); color: inherit; text-decoration: none; }
a.fleet-item:hover { background: var(--surface-2); color: inherit; }
.fleet-top { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.fleet-model { font-weight: 600; flex: 1 1 auto; min-width: 0; }
.fleet-line { color: var(--text-2); font-size: var(--fs-sm); }
.fleet-next { display: flex; flex-wrap: wrap; gap: 2px var(--sp-4); color: var(--text-3); font-size: var(--fs-sm); }

.notices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.notice { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--r-md); color: inherit; text-decoration: none; }
a.notice:hover { background: var(--surface-2); color: inherit; }
.notice-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notice-title { font-weight: 600; overflow-wrap: anywhere; }
.notice-title::first-letter { text-transform: uppercase; }
.notice-detail { color: var(--text-3); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.notice-more { align-self: flex-start; }

.occ { display: flex; flex-direction: column; gap: var(--sp-3); }
.occ-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 52px; align-items: center; gap: var(--sp-3); }
.occ-pct { text-align: right; font-family: var(--font-num); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ───────────────────────── Firma, daños, combustible (base) ───────────────────────── */
.sign-pad { position: relative; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); background: #fff; touch-action: none; }
.sign-pad canvas { display: block; width: 100%; height: 220px; touch-action: none; cursor: crosshair; }
.sign-hint { position: absolute; left: 0; right: 0; bottom: 28px; text-align: center; color: #8a94a6; font-size: var(--fs-sm); pointer-events: none; }
.sign-line { position: absolute; left: 24px; right: 24px; bottom: 52px; border-top: 1px solid #c9d0db; pointer-events: none; }
.fuel { display: flex; flex-direction: column; gap: var(--sp-2); }
.fuel-steps { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; }
.fuel-step { min-height: var(--tap-lg); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text-3); font-family: var(--font-num); font-weight: 600; font-size: var(--fs-sm); padding: 0; }
.fuel-step.is-on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.fuel-step[aria-checked="true"] { outline: 3px solid var(--focus); outline-offset: 1px; }
.damage { display: flex; flex-direction: column; gap: var(--sp-3); }
.damage-svg { width: 100%; max-width: 220px; margin: 0 auto; aspect-ratio: 1 / 2; touch-action: manipulation; }

/* ───────────────────────── Impresión ───────────────────────── */
@media print {
  .shell-header, .bottom-nav, .side-nav, .actionbar, .page-actions, .toasts { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}
