/* Pits Xpress — piso de taller: legible a distancia, botones grandes para tablet con guantes.
   Concreto + tinta grafito + naranja de señalización; verde/ámbar/rojo solo para estado. */
:root {
  --bg: #eceeea;          /* concreto */
  --panel: #ffffff;
  --panel-2: #f5f6f3;
  --ink: #1c2530;         /* grafito */
  --ink-2: #4a5563;
  --muted: #7a8491;
  --line: #d6d9d3;
  --accent: #e8590c;      /* naranja de señalización */
  --accent-ink: #ffffff;
  --accent-soft: #fde7da;
  --side: #1c2530;
  --side-ink: #d8dde3;
  --ok: #2b8a3e;  --ok-soft: #dcf2e1;
  --warn: #b7791f; --warn-soft: #fbf0d6;
  --bad: #c92a2a; --bad-soft: #fbe0e0;
  --info: #1864ab; --info-soft: #dbe9f7;
  --plate-blue: #1d3f8f;
  --shadow: 0 1px 2px rgba(28,37,48,.06), 0 4px 14px rgba(28,37,48,.06);
  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", "Consolas", ui-monospace, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12171d; --panel: #1a2129; --panel-2: #212a33; --ink: #e6eaee; --ink-2: #b4bdc7; --muted: #8590a0;
    --line: #2d3742; --accent: #ff7a2e; --accent-ink: #1a0d04; --accent-soft: #3a2416; --side: #0c1015; --side-ink: #c6cdd5;
    --ok: #51cf66; --ok-soft: #173322; --warn: #f2b84b; --warn-soft: #3a2f14; --bad: #ff6b6b; --bad-soft: #3d1a1a;
    --info: #63a8f0; --info-soft: #162a40; --plate-blue: #3a64c4; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12171d; --panel: #1a2129; --panel-2: #212a33; --ink: #e6eaee; --ink-2: #b4bdc7; --muted: #8590a0;
  --line: #2d3742; --accent: #ff7a2e; --accent-ink: #1a0d04; --accent-soft: #3a2416; --side: #0c1015; --side-ink: #c6cdd5;
  --ok: #51cf66; --ok-soft: #173322; --warn: #f2b84b; --warn-soft: #3a2f14; --bad: #ff6b6b; --bad-soft: #3d1a1a;
  --info: #63a8f0; --info-soft: #162a40; --plate-blue: #3a64c4; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; letter-spacing: .01em; margin: 0; text-wrap: balance; }
h2 { font-size: 22px; } h3 { font-size: 18px; } h4 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
a { color: var(--info); }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100%; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px; gap: 14px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand strong { font-family: var(--f-display); font-size: 21px; letter-spacing: .06em; color: #fff; display: block; line-height: 1; }
.brand small { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #8d98a6; }
.brand-mark { width: 30px; height: 30px; border-radius: 6px; background: linear-gradient(135deg, transparent 50%, var(--accent) 50%), #2b3644; flex: none; }
nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
nav a { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 8px; color: var(--side-ink); text-decoration: none; font-weight: 500; }
nav a:hover { background: rgba(255,255,255,.06); }
nav a.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
nav a .ic { width: 20px; text-align: center; opacity: .85; }
nav a .badge { margin-left: auto; }
nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #6b7685; padding: 12px 10px 4px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 8px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.side-foot .btn { color: var(--side-ink); border-color: rgba(255,255,255,.15); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding-block: 12px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); background: var(--bg); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 26px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.view { padding-block: 20px 60px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.only-mobile { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .only-mobile { display: inline-flex; }
  .top h1 { font-size: 22px; }
  .top { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .view { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}

/* ---------- Controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 600 14px var(--f-body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.lg { min-height: 52px; padding: 0 22px; font-size: 16px; }
.btn.icon { width: 40px; padding: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.rec { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.rec .dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.btn.rec.on .dot { animation: blink 1s infinite; border-radius: 2px; }
@keyframes blink { 50% { opacity: .2; } }

.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); min-width: 0; }
input, select, textarea { font: 15px var(--f-body); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; min-height: 42px; width: 100%; min-width: 0; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input.big { font: 700 22px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
@media (min-width: 761px) and (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.span2 { grid-column: span 2; } @media (max-width: 760px) { .span2 { grid-column: auto; } }

/* ---------- Paneles ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > header { padding: 14px 16px 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.kpi .val { font: 700 30px/1.1 var(--f-display); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--ink-2); }

/* Tablas */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--panel-2); }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }

/* Chips de estado */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge { background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }

/* Placa salvadoreña */
.plate { display: inline-flex; flex-direction: column; align-items: center; background: #fff; color: #111; border: 2px solid #222; border-radius: 5px; padding: 0 6px 1px; line-height: 1; min-width: 92px; box-shadow: inset 0 0 0 1px #fff; vertical-align: middle; }
.plate::before { content: "EL SALVADOR"; display: block; width: calc(100% + 12px); background: var(--plate-blue); color: #fff; font: 700 7px/1.6 var(--f-body); letter-spacing: .2em; text-align: center; border-radius: 2px 2px 0 0; margin-bottom: 1px; }
.plate b { font: 700 16px/1.15 var(--f-mono); letter-spacing: .04em; white-space: nowrap; }
.plate.lg { min-width: 150px; } .plate.lg b { font-size: 28px; } .plate.lg::before { font-size: 10px; }

/* Bahías */
.bays { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.bay { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.bay .bay-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.bay .bay-h strong { font: 700 18px var(--f-display); letter-spacing: .04em; }
.bay .bay-b { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.bay.free .bay-b { align-items: center; justify-content: center; color: var(--muted); min-height: 130px; }
.bay.busy { border-color: var(--accent); }
.timer { font: 700 22px var(--f-mono); font-variant-numeric: tabular-nums; }
.timer.late { color: var(--bad); }

/* Stepper de estados */
.steps { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.steps .st { flex: 1; min-width: 92px; text-align: center; padding: 8px 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; background: var(--panel-2); color: var(--muted); border-radius: 6px; border-bottom: 3px solid var(--line); }
.steps .st.done { color: var(--ink-2); border-bottom-color: var(--ok); }
.steps .st.now { background: var(--accent-soft); color: var(--accent); border-bottom-color: var(--accent); }

/* Inspección */
.insp { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.insp-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.insp-item .nm { font-weight: 600; font-size: 14px; }
.insp-item input { grid-column: 1 / -1; min-height: 34px; padding: 5px 9px; font-size: 13px; }
.tri { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.tri button { border: 0; background: transparent; padding: 6px 9px; font: 600 12px var(--f-body); cursor: pointer; color: var(--muted); min-height: 32px; }
.tri button + button { border-left: 1px solid var(--line); }
.tri button.on[data-v="ok"] { background: var(--ok); color: #fff; }
.tri button.on[data-v="atencion"] { background: var(--warn); color: #fff; }
.tri button.on[data-v="urgente"] { background: var(--bad); color: #fff; }
.insp-item.atencion { border-color: var(--warn); } .insp-item.urgente { border-color: var(--bad); }

/* Combustible */
.fuel { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.fuel button { border: 0; background: var(--panel); padding: 0 12px; min-height: 42px; font: 700 14px var(--f-mono); cursor: pointer; color: var(--ink-2); }
.fuel button + button { border-left: 1px solid var(--line); }
.fuel button.on { background: var(--ink); color: var(--panel); }

/* Odómetro */
.odo { font: 700 18px var(--f-mono); background: var(--ink); color: #f1f3f5; padding: 2px 8px; border-radius: 4px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }

/* Líneas de servicio */
.lines { display: flex; flex-direction: column; gap: 6px; }
.line { display: grid; grid-template-columns: 96px 110px 1fr 36px; gap: 6px 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.line > :first-child { grid-column: 1 / -1; }
.line input { min-height: 36px; padding: 5px 8px; }
.line .tot { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .line { grid-template-columns: 86px 100px 1fr 32px; } }
.totals { margin-left: auto; min-width: 260px; display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; font-variant-numeric: tabular-nums; }
.totals .grand { font: 700 24px var(--f-display); border-top: 2px solid var(--ink); padding-top: 6px; }

/* Buscador / chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 12px; font: 600 13px var(--f-body); cursor: pointer; color: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.chip:hover { border-color: var(--ink-2); }
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.searchbar input { flex: 1 1 240px; }

/* Cámaras */
.cams { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
@media (max-width: 420px) { .cams { grid-template-columns: 1fr; } }
.cam { background: #000; border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); }
.cam .screen { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #0b0e12; display: flex; align-items: center; justify-content: center; color: #8d98a6; }
.cam .screen video, .cam .screen img, .cam .screen canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.cam .ovl { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; align-items: center; }
.cam .live { background: rgba(201,42,42,.9); color: #fff; font: 700 11px var(--f-body); letter-spacing: .12em; padding: 2px 7px; border-radius: 4px; }
.cam .recbadge { background: #fff; color: #c92a2a; font: 700 11px var(--f-mono); padding: 2px 7px; border-radius: 4px; }
.cam .camname { position: absolute; right: 10px; bottom: 8px; color: rgba(255,255,255,.75); font: 500 11px var(--f-mono); text-shadow: 0 1px 2px #000; }
.cam .msg { padding: 20px; text-align: center; font-size: 13px; line-height: 1.5; max-width: 90%; }
.cam .ctrl { display: flex; gap: 6px; padding: 8px; background: var(--panel); flex-wrap: wrap; align-items: center; }
.cam .ctrl .info { font-size: 12px; color: var(--ink-2); margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam.full { position: fixed; inset: 0; z-index: 80; border-radius: 0; }
.cam.full .screen { aspect-ratio: auto; flex: 1; }

.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.clip { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.clip .th { aspect-ratio: 16/9; background: #0b0e12; display: flex; align-items: center; justify-content: center; color: #fff; position: relative; max-width: 100%; }
.clip .th img, .clip .th video { width: 100%; height: 100%; object-fit: cover; }
.clip .th .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.7); font: 600 11px var(--f-mono); padding: 1px 6px; border-radius: 4px; }
.clip .th .play { position: absolute; font-size: 30px; opacity: .85; }
.clip .meta { padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }

/* Gráficos */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .ax { fill: var(--muted); font: 11px var(--f-body); }
.chart .grid line { stroke: var(--line); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 200px) 1fr 80px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { background: var(--panel-2); height: 18px; border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--ink); border-radius: 4px; }
.bar-row:first-child .fill { background: var(--accent); }
.bar-row .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(12,16,21,.55); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal .box { background: var(--panel); border-radius: 12px; width: min(720px, 100%); padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal .box.wide { width: min(1000px, 100%); }
.modal .box > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal .box > footer { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.toast { position: fixed; bottom: max(20px, env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 12px 18px; border-radius: 8px; z-index: 100; font-weight: 600; max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); color: #fff; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--side); }
.login .box { background: var(--panel); border-radius: 14px; padding: 28px; width: min(440px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login h1 { font-size: 34px; letter-spacing: .05em; }
.users { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.users button { text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; font: 600 14px var(--f-body); color: var(--ink); }
.users button small { display: block; color: var(--muted); font-weight: 500; text-transform: capitalize; }
.users button.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pin button { min-height: 56px; font: 700 22px var(--f-mono); border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; cursor: pointer; color: var(--ink); }
.pin-dots { display: flex; justify-content: center; gap: 10px; min-height: 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink-2); }
.pin-dots i.f { background: var(--ink); }

.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); background: var(--panel); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.banner { padding: 12px 14px; border-radius: var(--r); background: var(--info-soft); color: var(--ink); border: 1px solid transparent; font-size: 14px; }
.banner.warn { background: var(--warn-soft); }
.banner.acc { background: var(--accent-soft); }
.banner.ok { background: var(--ok-soft); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: 600 14px var(--f-body); color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.due-bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; min-width: 80px; }
.due-bar i { display: block; height: 100%; }

@media print {
  #shell, #login, #modal, #toast { display: none !important; }
  body { background: #fff; color: #000; }
  #print { display: block !important; }
}
.print-only { display: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Hoja de recepción: dibujo del vehículo */
.veh-views { display: grid; grid-template-columns: minmax(0, 620px); justify-content: center; gap: 12px; }
@media (max-width: 640px) { .veh-views { grid-template-columns: 1fr; } }
.veh-fig { margin: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px; min-width: 0; }
.veh-fig figcaption { font-size: 12px; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .06em; }
svg.veh { width: 100%; height: auto; display: block; max-width: 100%; }
svg.veh[data-mark] { cursor: crosshair; }
svg.veh polygon, svg.veh polyline, svg.veh line { stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
svg.veh .vb { fill: var(--panel); }
svg.veh .vg { fill: var(--info-soft); }
svg.veh .vw { fill: var(--ink); }
svg.veh .vhub { fill: var(--panel-2); }
svg.veh .vh { fill: var(--warn-soft); }
svg.veh .vt { fill: var(--bad-soft); }
svg.veh .vr { fill: var(--panel-2); }
svg.veh .vp { fill: var(--panel); }
svg.veh .vd { fill: var(--panel-2); }
svg.veh .vi { fill: var(--line); }
svg.veh .vl { fill: none; stroke-width: 1; }
svg.veh path, svg.veh rect, svg.veh circle.vw, svg.veh circle.vhub { stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; }
svg.veh .va { fill: var(--panel-2); }
svg.veh .vrail { stroke-width: 3; }
svg.veh .vlab { fill: var(--muted); font: 600 13px var(--f-body); letter-spacing: .08em; }
svg.veh .vmk { cursor: pointer; }
svg.veh .vmk circle { stroke: #fff; stroke-width: 2; }
svg.veh .vmk text { fill: #fff; font: 700 12px var(--f-body); pointer-events: none; }
.chip.dmg { display: inline-flex; align-items: center; gap: 6px; }
.chip.dmg b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 11px; }
.dmg-row { gap: 8px; }
.dmg-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font: 700 12px var(--f-body); flex: none; }
.dmg-note { flex: 1 1 220px; min-height: 34px; padding: 5px 9px; font-size: 13px; }

/* Icono del vehículo por tipo (cabecera de orden y página del cliente) */
.veh-ico { height: 56px; width: auto; max-width: 150px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.18)); }
@media (max-width: 560px) { .veh-ico { height: 42px; max-width: 110px; } }

/* Detalle extra de líneas (intervalo del técnico, compra externa) y metas de recomendaciones */
.line-x { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--ink-2); }
.line-x label { display: inline-flex; align-items: center; gap: 6px; }
.line-x input { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.line-x input[type=number] { width: 110px; }
.line-x input:not([type]) { flex: 1 1 180px; }
.rec-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.rec-meta input { grid-column: auto; width: auto; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.rec-meta input[type=number] { width: 130px; }
.gasto-ot input:not([type]) { flex: 1 1 140px; }
.gasto-ot input[type=number] { width: 100px; }
.cp-line select { min-height: 36px; padding: 5px 8px; }

/* Foto de perfil del vehículo */
.foto-veh { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }
.fv-img { width: 150px; height: 100px; border-radius: 8px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; flex: none; }
.fv-img img { width: 100%; height: 100%; object-fit: cover; }
.fv-img span { font-size: 12px; color: var(--muted); }
.veh-foto { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; border: 1px solid var(--line); }

/* Servicios agrupados por categoría */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; align-items: start; }
.svc-col { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.svc-col h5 { margin: 0 0 2px; font: 700 12px var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.svc-col .chip { text-align: left; }

/* Flujo por fases */
.fase-guia { background: var(--panel-2); border-left: 4px solid var(--accent); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h3::before { content: '▸ '; color: var(--muted); }
details.fold[open] > summary h3::before { content: '▾ '; }
.qc { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.qc-item { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 14px; }
.qc-item input { width: 18px; height: 18px; min-height: 0; flex: none; }
.qc-item.on { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.firmas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.firma { display: flex; flex-direction: column; gap: 8px; }
.firma-tit { font-weight: 700; font-size: 13px; }
.firma-pad { width: 100%; height: 130px; border: 1px dashed var(--muted); border-radius: 8px; background: #fff; touch-action: none; }
.firma img { width: 100%; max-width: 360px; height: 110px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.app-ver { font-size: 10px; opacity: .45; margin-top: 4px; letter-spacing: .04em; }
.brand-mark.has-logo { background-color: #fff; background-position: center; background-size: contain; background-repeat: no-repeat; border-radius: 6px; }
.brand-mark.has-logo::before, .brand-mark.has-logo::after { display: none !important; }

/* Lectura de la tarjeta de circulación */
.tj-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .tj-slots { grid-template-columns: 1fr; } }
.tj-slot { display: flex; flex-direction: column; gap: 6px; }
.tj-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1.585; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; background: var(--panel-2); text-align: center; padding: 8px; }
.tj-prev { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; background: #111 center / 100% 100% no-repeat; overflow: hidden; }
.tj-prev i { position: absolute; border: 3px solid #2f9e44; box-shadow: 0 0 0 999px rgba(0,0,0,.45); border-radius: 6px; }
.tj-acc { gap: 6px; }
.tj-ic { font-size: 30px; }
.tj-mini { height: 54px; border-radius: 6px; border: 1px solid var(--line); }
.tj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; }
.tj-dud input { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.tj-crop { position: relative; user-select: none; touch-action: none; width: fit-content; margin: 0 auto; overflow: hidden; }
.tj-crop img { max-width: 100%; max-height: 62vh; display: block; }
.tj-rect { position: absolute; border: 3px solid #2f9e44; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); border-radius: 6px; cursor: move; }
.tj-h { position: absolute; width: 26px; height: 26px; border-radius: 50%; background: #2f9e44; border: 3px solid #fff; }
.tj-h.nw { left: -4px; top: -4px; cursor: nwse-resize; } .tj-h.ne { right: -4px; top: -4px; cursor: nesw-resize; }
.tj-h.sw { left: -4px; bottom: -4px; cursor: nesw-resize; } .tj-h.se { right: -4px; bottom: -4px; cursor: nwse-resize; }
.lockbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--panel-2); border: 1px dashed var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; color: var(--ink-2); }
input:disabled, select:disabled, textarea:disabled { background: var(--panel-2); color: var(--ink-2); cursor: not-allowed; opacity: .85; }

/* v2.5 — nombre fijo de líneas del catálogo, prefijos $ / Cant., notas que crecen, inspección bloqueada */
.line-nm { font-weight: 600; font-size: 15px; padding: 6px 2px 2px; line-height: 1.3; }
.pre { position: relative; display: block; min-width: 0; }
.pre::before { content: attr(data-pre); position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; color: var(--muted); pointer-events: none; }
.pre[data-pre="$"]::before { font-size: 15px; color: var(--ink-2); }
.pre input { width: 100%; padding-left: 22px; }
.pre[data-pre="Cant."] input { padding-left: 40px; }
.line-x .pre { display: inline-block; }
.line-x .pre input { width: 110px; }
textarea.auto { min-height: 36px; resize: none; overflow: hidden; line-height: 1.35; field-sizing: content; }
.insp-item textarea { grid-column: 1 / -1; padding: 6px 9px; font-size: 13px; }
.tri button:disabled { cursor: not-allowed; }
.tri button:disabled:not(.on) { opacity: .45; }
.tri button.on:disabled { filter: saturate(.55); }
@media (max-width: 640px) { .line { grid-template-columns: 86px 100px 1fr 32px; } }

/* v2.6 — marca Pits Xpress: banner a lo ancho del recuadro superior izquierdo */
.brand { flex-direction: column; align-items: stretch; gap: 6px; padding: 0 0 10px; }
.brand-banner { display: block; width: 100%; height: auto; border-radius: 8px; background: #04080e; }
.brand small { text-align: center; }
.login-banner { display: block; width: min(320px, 80vw); height: auto; border-radius: 10px; margin: 0 auto 10px; }
