/* BT MOTORS — estilos
   Layout: app de una columna pensada para el celular (barra superior + barra de pestañas abajo);
   en pantallas anchas el panel del taller usa un riel lateral y el contenido llega a 1120px. */
:root {
  --bg: #eef2f3;
  --surface: #ffffff;
  --surface-2: #f5f8f9;
  --line: #d5dfe2;
  --fg: #11191c;
  --muted: #5b6b70;
  --primary: #0d5c6b;
  --primary-hover: #0a4a57;
  --primary-soft: #dcecef;
  --on-primary: #ffffff;
  --signal: #f0a400;
  --signal-soft: #fff1cc;
  --signal-ink: #6b4700;
  --ok: #1f7a4a;
  --ok-soft: #dff2e7;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;
  --on-ok: #ffffff;
  --on-bad: #ffffff;
  --wa: #1a7d44;
  --plate-bg: #ffffff;
  --plate-fg: #0b0b0b;
  --plate-line: #2b2b2b;
  --shadow: 0 1px 2px rgba(17, 25, 28, .06), 0 4px 16px rgba(17, 25, 28, .06);
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --tabbar-h: 64px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1214; --surface: #141d20; --surface-2: #1a2529; --line: #2a383d; --fg: #e5edef; --muted: #93a5aa;
    --primary: #3fb0c4; --primary-hover: #63c3d4; --primary-soft: #16343a; --on-primary: #06181c;
    --signal: #ffbf2e; --signal-soft: #3a2d0b; --signal-ink: #ffd877;
    --ok: #4cc98a; --ok-soft: #12301f; --bad: #ff7b72; --bad-soft: #3b1715; --on-ok: #06180e; --on-bad: #1f0605;
    --plate-bg: #f4f4f1; --plate-fg: #0b0b0b; --plate-line: #f4f4f1;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1214; --surface: #141d20; --surface-2: #1a2529; --line: #2a383d; --fg: #e5edef; --muted: #93a5aa;
  --primary: #3fb0c4; --primary-hover: #63c3d4; --primary-soft: #16343a; --on-primary: #06181c;
  --signal: #ffbf2e; --signal-soft: #3a2d0b; --signal-ink: #ffd877;
  --ok: #4cc98a; --ok-soft: #12301f; --bad: #ff7b72; --bad-soft: #3b1715; --on-ok: #06180e; --on-bad: #1f0605;
  --plate-bg: #f4f4f1; --plate-fg: #0b0b0b; --plate-line: #f4f4f1;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
/* iOS hace zoom al escribir si la letra del campo es menor a 16px */
input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: max(16px, 1em); }
/* Controles: respuesta inmediata al toque y sin seleccionar el texto al mantener presionado */
button, .btn, .tabbar a, .segmented button, .chip-toggle, .quick a, a.svc, .job, a.item, .brand-tile, .wa-float, label.check {
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: .005em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0; }
.num, .tab { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- Estructura ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; background: var(--fg); color: var(--bg);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; flex: none;
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: .04em; white-space: nowrap; }
.brand-name b { color: var(--primary); font-weight: 700; }
.topbar .spacer { flex: 1; }
.page { max-width: 1120px; margin: 0 auto; padding: 20px 16px calc(var(--tabbar-h) + 32px); display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head > div { min-width: 0; overflow-wrap: anywhere; }
.page-head p { color: var(--muted); margin-top: 4px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar-in { max-width: 640px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: var(--tabbar-h); }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 500; position: relative;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--primary); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.tabbar .badge { position: absolute; top: 8px; left: calc(50% + 6px); }

/* Panel del taller: riel lateral en pantallas anchas */
.admin-shell .topbar-in, .admin-shell .page { max-width: 1280px; }
@media (min-width: 960px) {
  .admin-shell .tabbar { top: calc(57px + env(safe-area-inset-top, 0px)); bottom: 0; right: auto; width: 220px; border-top: 0; border-right: 1px solid var(--line); padding: 12px 0; }
  .admin-shell .tabbar-in { display: flex; flex-direction: column; height: auto; gap: 2px; padding: 0 10px; }
  .admin-shell .tabbar a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .92rem; }
  .admin-shell .tabbar a.on { background: var(--primary-soft); }
  .admin-shell .tabbar a.on::before { display: none; }
  .admin-shell .tabbar .badge { position: static; margin-left: auto; }
  .admin-shell .page { margin-left: 220px; padding-bottom: 48px; }
  .admin-shell .tab-more { display: none !important; }
}
@media (max-width: 959px) { .admin-shell .tab-wide { display: none !important; } }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card.pad-lg { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.cols-main { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .cols-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.divider { height: 1px; background: var(--line); border: 0; margin: 4px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font-weight: 600; font-size: .93rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-signal { background: var(--signal); border-color: var(--signal); color: #1f1500; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.btn-danger { color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; padding: 0; min-height: 0; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--fg); font-size: 16px;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.input.upper { text-transform: uppercase; font-family: var(--font-mono); letter-spacing: .06em; }
.help { font-size: .8rem; color: var(--muted); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }

.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented button, .chip-toggle {
  min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; font-size: .88rem;
}
.segmented button.on, .chip-toggle.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--signal); color: #1f1500; font-size: .7rem; font-weight: 700; }

/* Estado de la orden */
.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status[data-s="recibido"], .status[data-s="diagnostico"], .status[data-s="reparacion"] { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.status[data-s="esperando_aprobacion"] { background: var(--signal-soft); color: var(--signal-ink); border-color: transparent; }
.status[data-s="listo"] { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.status[data-s="cancelada"] { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* Patente chilena */
.plate {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px 1px; border: 2px solid var(--plate-line); border-radius: 5px;
  background: var(--plate-bg); color: var(--plate-fg); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: .08em; line-height: 1.25; white-space: nowrap;
  box-shadow: inset 0 0 0 1px #fff;
}
.plate i { font-style: normal; font-size: .6em; opacity: .55; margin: 0 1px; }
.plate.lg { font-size: 1.5rem; padding: 3px 12px 2px; }

.list { display: flex; flex-direction: column; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; text-decoration: none; color: inherit; }
.list > .item:first-child { border-top: 0; padding-top: 0; }
.list > .item:last-child { padding-bottom: 0; }
.item-title { font-weight: 600; overflow-wrap: anywhere; }
.item-sub { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.time-col { font-family: var(--font-mono); font-weight: 500; font-size: .95rem; width: 52px; flex: none; }

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi.alert { border-color: var(--signal); background: var(--signal-soft); }
.kpi.alert .v { color: var(--signal-ink); }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg { width: 40px; height: 40px; opacity: .5; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--signal-soft); color: var(--signal-ink); }
.notice.info { background: var(--primary-soft); color: var(--primary); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.notice .grow > * + * { margin-top: 6px; }

/* Línea de tiempo del trabajo */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: grid; grid-template-columns: 24px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 11px; top: 22px; bottom: -2px; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; z-index: 1; }
.step.done .dot { background: var(--primary); border-color: var(--primary); }
.step.done .dot::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--on-primary); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.step.done::before { background: var(--primary); }
.step.now .dot { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.step.now .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.step.wait .dot { border-color: var(--signal); box-shadow: 0 0 0 4px var(--signal-soft); }
.step.wait .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
.step .t { font-weight: 600; }
.step:not(.done):not(.now):not(.wait) .t { color: var(--muted); font-weight: 500; }

/* Servicios */
.svc-cat { display: flex; flex-direction: column; gap: 10px; }
.svc { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: inherit; min-width: 0; }
.svc-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.svc-icon svg { width: 24px; height: 24px; }
.svc .price { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.svc .price small { font-family: var(--font-body); font-weight: 500; font-size: .7rem; color: var(--muted); display: block; text-align: right; }

/* Accesos rápidos del inicio */
.quick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.quick a { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--fg); font-weight: 600; }
.quick a svg { width: 26px; height: 26px; color: var(--primary); }
.quick a span { font-weight: 400; color: var(--muted); font-size: .82rem; }

/* Portada (cliente sin sesión) */
.hero {
  position: relative; overflow: hidden; border-radius: 16px; padding: 28px 20px; color: #eaf3f5;
  background: #0f2a30;
  background-image: radial-gradient(120% 140% at 100% 0%, rgba(63, 176, 196, .35), transparent 55%), repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 12px);
}
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); text-transform: uppercase; letter-spacing: .01em; max-width: 14ch; }
.hero h1 em { font-style: normal; color: #ffbf2e; }
.hero p { margin-top: 10px; max-width: 46ch; color: #b9cfd4; }
.hero .row { margin-top: 18px; }
.hero .btn:not(.btn-signal) { background: transparent; color: #eaf3f5; border-color: rgba(255, 255, 255, .35); }
.gauge { position: absolute; right: -40px; bottom: -60px; width: 240px; height: 240px; opacity: .55; pointer-events: none; }
@media (max-width: 520px) { .gauge { width: 170px; height: 170px; right: -50px; bottom: -70px; } }

/* Selector de días y horas */
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.day { flex: none; width: 62px; padding: 8px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-align: center; cursor: pointer; }
.day .d { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day .n { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1.1; }
.day .m { font-size: .7rem; color: var(--muted); }
.day.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.day.on .d, .day.on .m { color: var(--on-primary); opacity: .85; }
.day[disabled] { opacity: .4; cursor: not-allowed; }
.slots { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.slot { min-height: 42px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-family: var(--font-mono); font-weight: 500; cursor: pointer; }
.slot.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.slot[disabled] { text-decoration: line-through; opacity: .4; cursor: not-allowed; }

.wizard-steps { display: flex; gap: 6px; }
.wizard-steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.wizard-steps span.on { background: var(--primary); }
.choice { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: left; width: 100%; }
.choice.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-soft); }

/* Fotos */
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photo { width: 84px; height: 84px; border-radius: var(--radius-sm); overflow: hidden; position: relative; border: 1px solid var(--line); background: var(--surface-2); flex: none; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.photo-add { display: grid; place-items: center; cursor: pointer; color: var(--muted); border-style: dashed; }
.photo-add svg { width: 26px; height: 26px; }

/* Tablas */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.low td { background: var(--signal-soft); }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; font-variant-numeric: tabular-nums; }
.totals .big { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }

/* Códigos OBD */
.dtc { display: flex; gap: 12px; align-items: baseline; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.dtc .c { font-family: var(--font-mono); font-weight: 600; color: var(--signal-ink); background: var(--signal-soft); padding: 1px 8px; border-radius: 4px; flex: none; }

/* Sellos de fidelización */
.stamps { display: flex; gap: 8px; flex-wrap: wrap; }
.stamp { width: 38px; height: 38px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted); }
.stamp.on { border: 2px solid var(--primary); background: var(--primary); color: var(--on-primary); }
.stamp svg { width: 18px; height: 18px; }

/* Barras simples para reportes */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; align-items: end; height: 180px; padding-top: 20px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bar .b { width: 100%; max-width: 46px; background: var(--primary); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.bar.cur .b { background: var(--signal); }
.bar .bv { font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar .bl { font-size: .75rem; color: var(--muted); text-transform: capitalize; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.hbar .track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.hbar .fill { height: 100%; background: var(--primary); border-radius: 4px; }

/* Tablero del taller */
.board { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.board-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.board-col h3 { font-size: 1rem; display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; }
.job { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; }
.job.flag { border-color: var(--signal); background: var(--signal-soft); }

/* Modal y avisos */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 12, 14, .55); z-index: 100; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 640px) { .modal-bg { align-items: center; padding: 24px; } }
.modal { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; border-radius: 16px 16px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 640px) { .modal { border-radius: 16px; padding: 24px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 10px; z-index: 200; font-weight: 500; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.toast.err { background: var(--bad); color: var(--on-bad); }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* Acceso */
.auth { max-width: 420px; width: 100%; margin: 0 auto; }
.demo-bar { background: var(--signal-soft); color: var(--signal-ink); font-size: .82rem; }
.demo-bar .topbar-in { min-height: 0; padding: 8px 16px; flex-wrap: wrap; gap: 8px; }
.demo-bar a, .demo-bar button { color: inherit; font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

/* Informe para imprimir */
.report { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 32px; border-radius: 8px; border: 1px solid var(--line); }
.report h1 { font-size: 2rem; letter-spacing: .04em; }
.report .muted { color: #555; }
.report table.t th, .report table.t td { border-color: #ddd; }
.report .dtc { background: #f6f6f6; border-color: #ddd; }
.report .dtc .c { background: #fff1cc; color: #6b4700; }
.report .plate { box-shadow: none; border-color: #222; }
@media print {
  .topbar, .tabbar, .demo-bar, .no-print { display: none !important; }
  body { background: #fff; }
  .page { padding: 0 !important; margin: 0 !important; max-width: none; }
  .report { border: 0; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  /* Menos movimiento, no cero: se mantienen los fundidos, se quitan los desplazamientos */
  .btn:active, .tabbar a:active svg, .quick a:active, a.svc:active, .job:active, a.item:active, .brand-tile:active, .wa-float:active { transform: none !important; }
  .modal, .modal-bg.closing .modal { transform: none !important; }
  .toast, .toast.show { transform: translateX(-50%) !important; }
  * { animation: none !important; }
}
.show-sm { display: none; }
@media (max-width: 560px) { .hide-sm { display: none; } .show-sm { display: block; } }

/* Lugar del trabajo (taller o domicilio) */
.lugar { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); min-width: 0; }
.lugar svg { width: 16px; height: 16px; flex: none; }
.lugar.dom { color: var(--primary); font-weight: 500; }
.lugar span { overflow-wrap: anywhere; }
.choice[disabled] { opacity: .5; cursor: not-allowed; }
.route-stop { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.route-stop:first-child { border-top: 0; padding-top: 0; }
.route-stop .time-col { font-size: 1.05rem; }
.route-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* Repuestos que compra el cliente */
.rep-dot { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--signal-soft); color: var(--signal-ink); flex: none; }
.rep-dot svg { width: 18px; height: 18px; }
.rep.ok .rep-dot { background: var(--ok-soft); color: var(--ok); }
.rep.ok .item-title { color: var(--muted); }
.price small + small, .price small:last-child { white-space: nowrap; }
.price small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .7rem; color: var(--muted); text-align: right; letter-spacing: 0; }

/* Avisos (campanita) */
.bell { position: relative; color: inherit; }
.bell svg { width: 22px; height: 22px; }
.bell .badge { position: absolute; top: 0; right: -2px; }
.list > .item.unread .item-title::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); margin-right: 8px; vertical-align: middle; }
.promo-banner { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius); background: var(--dark, #0f2a30); color: #eaf3f5; }
.promo-banner svg { width: 28px; height: 28px; flex: none; color: var(--signal); }
.promo-banner strong { display: block; font-family: var(--font-display); font-size: 1.35rem; text-transform: uppercase; letter-spacing: .02em; color: #ffbf2e; }
.promo-banner .small { color: #b9cfd4; }
.tag-promo { display: inline-block; background: var(--signal); color: #1f1500; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .04em; }
.legal h2 { font-size: 1.1rem; margin-top: 8px; }
.legal p, .legal li { line-height: 1.55; }

/* Marketing */
.proof { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: .9rem; color: #d7e7ea; position: relative; }
.proof strong { color: #fff; }
.stars { color: var(--signal); letter-spacing: .05em; white-space: nowrap; }
.stars .off { color: rgba(127,127,127,.35); }
.next-slot { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.1); color: #eaf3f5; font-size: .9rem; position: relative; }
.next-slot svg { width: 18px; height: 18px; color: #7fd0de; flex: none; }
.testis { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.testi { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.testi blockquote { margin: 0; line-height: 1.5; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:first-child { border-top: 0; padding-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; }
.refer .code-row { padding: 10px 12px; border: 1px dashed var(--primary); border-radius: var(--radius-sm); }
.refer .code { font-family: var(--font-mono, monospace); font-weight: 700; font-size: 1.3rem; letter-spacing: .12em; color: var(--primary); }
.rate-stars { display: flex; gap: 6px; }
.rate-stars button { font-size: 2.4rem; line-height: 1; background: none; border: 0; padding: 4px; cursor: pointer; color: rgba(127,127,127,.35); min-width: 48px; min-height: 48px; }
.rate-stars button.on { color: var(--signal); }
.wa-float { position: fixed; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; background: var(--wa); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 40; }
.wa-float svg { width: 30px; height: 30px; }
.seg-card { cursor: pointer; }
.seg-card.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }

/* --- Fichas técnicas --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.spec { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: 7px 14px; margin: 0; font-size: .92rem; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.spec-sm { font-size: .85rem; gap: 4px 10px; }
.verif { display: inline-block; font-size: .7rem; font-weight: 600; color: var(--signal-ink); background: var(--signal-soft); border-radius: 999px; padding: 1px 7px; vertical-align: 1px; white-space: nowrap; }
.dist-correa { font-weight: 600; color: var(--signal-ink); }
.flist { margin: 4px 0 0; padding-left: 1.15em; display: grid; gap: 4px; }
.flist.tips li::marker { color: var(--primary); }
.fgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: start; }
.ficha-motor.is-match { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok), var(--shadow); }
.match-tag { font-size: .72rem; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.ficha-mini { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.ficha-mini:first-of-type { border-top: 0; padding-top: 0; }
.brand-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.brand-tile { text-decoration: none; color: inherit; display: grid; gap: 2px; padding: 14px 16px; transition: border-color .15s; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; }
.chip { font-size: .74rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--fg); white-space: nowrap; }
.chip-warn { background: var(--signal-soft); border-color: transparent; color: var(--signal-ink); }
.code-big { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 600; letter-spacing: .02em; }
.code-sm { font-family: var(--font-mono); font-weight: 600; min-width: 58px; flex: none; }
.code-hint { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; line-height: 1.45; }
details.fold > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details.fold[open] > summary { margin-bottom: 8px; }
details.fold .list > .item { padding: 9px 0; }
.steps { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
.ftable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ftable td { border-top: 1px solid var(--line); padding: 8px 4px; vertical-align: top; }
.ftable tr:first-child td { border-top: 0; }
.ftable td:first-child { color: var(--muted); width: 42%; padding-right: 12px; }
.lt-big { font-size: 1.05rem; }
.src-line { display: flex; gap: 8px; align-items: flex-start; font-size: .78rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }
.src-line svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--ok); }
.src-line.no-src svg { color: var(--signal-ink); }
.src-line a { color: inherit; }
.version-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 6px; }
.taller-box { background: var(--ok-soft); color: var(--fg); border: 1px solid var(--ok); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 6px; }
.taller-box strong { color: var(--ok); }
.manual-box { background: var(--primary-soft); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 6px; }
.manual-box strong:first-child { color: var(--primary); }

/* Scanner del taller */
.scan-box { border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 4px; border: 1px solid var(--line); }
.scan-box svg { width: 18px; height: 18px; flex: none; }
.scan-tag { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; justify-self: start; }
.scan-completo { background: var(--ok-soft); } .scan-completo .scan-tag, .scan-tag.scan-completo { background: var(--ok-soft); color: var(--ok); }
.scan-box.scan-completo .scan-tag { background: var(--ok); color: #fff; }
.scan-revisar, .scan-obd { background: var(--signal-soft); } .scan-tag.scan-revisar, .scan-tag.scan-obd { background: var(--signal-soft); color: var(--signal-ink); }
.scan-box.scan-revisar .scan-tag, .scan-box.scan-obd .scan-tag { background: var(--signal); color: #1a1a1a; }
.brand-tile .scan-tag { display: inline-block; width: fit-content; align-self: flex-start; margin-top: 6px; }

/* ---------- Pulido táctil y movimiento ---------- */
/* Hover solo con mouse: en el celular el toque dejaba el efecto pegado */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: var(--muted); }
  .btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
  .btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
  a.item:hover .item-title { color: var(--primary); }
  a.svc:hover, .quick a:hover, .job:hover, .brand-tile:hover { border-color: var(--primary); }
  .tabbar a:hover { color: var(--fg); }
}
/* Respuesta al presionar (en el momento del toque, no al soltar) */
.quick a, a.svc, .job, .brand-tile, .wa-float { transition: transform 160ms var(--ease-out), border-color 150ms ease; }
.quick a:active, a.svc:active, .job:active, .brand-tile:active { transform: scale(0.98); }
.wa-float:active { transform: scale(0.94); }
a.item { transition: opacity 120ms ease; }
a.item:active { opacity: .6; }
.tabbar a svg { transition: transform 160ms var(--ease-out); }
.tabbar a:active svg { transform: scale(0.88); }
.segmented button, .chip-toggle { transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
.segmented button:active, .chip-toggle:active { transform: scale(0.96); }

/* Ventana: en el celular sube desde abajo como una hoja; en pantalla grande aparece al centro */
.modal-bg { transition: background-color 200ms ease; }
.modal { transition: transform 320ms var(--ease-drawer), opacity 200ms ease; }
@starting-style { .modal-bg { background-color: rgba(5, 12, 14, 0); } .modal { transform: translateY(100%); } }
.modal-bg.closing { background-color: rgba(5, 12, 14, 0); transition-duration: 160ms; }
.modal-bg.closing .modal { transform: translateY(100%); transition: transform 200ms var(--ease-out); }
@media (min-width: 640px) {
  .modal { transition: transform 200ms var(--ease-out), opacity 200ms var(--ease-out); }
  @starting-style { .modal { transform: scale(0.96); opacity: 0; } }
  .modal-bg.closing .modal { transform: scale(0.98); opacity: 0; transition-duration: 140ms; }
}

/* Aviso flotante: entra desde abajo y se puede reemplazar sin saltos */
.toast { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity 200ms var(--ease-out), transform 240ms var(--ease-out); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
/* En celulares angostos la etiqueta "Panel del taller" chocaba con el logo */
@media (max-width: 400px) { .tab-wide-txt { display: none; } }

/* ---------- Superficies del navegador y accesibilidad ---------- */
:root { accent-color: var(--primary); caret-color: var(--primary); scrollbar-color: var(--line) transparent; }
::selection { background: var(--primary-soft); color: var(--fg); }
a { text-underline-offset: 2px; }
/* Con el dedo, todo lo que se toca mide al menos 44 px */
@media (pointer: coarse) {
  .btn-sm { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .segmented button, .chip-toggle { min-height: 44px; }
  .photo button { width: 32px; height: 32px; }
}
.photo button svg { width: 16px; height: 16px; }
/* Botón ocupado mientras se guarda: evita enviar dos veces */
.btn[aria-busy="true"] { opacity: .65; pointer-events: none; cursor: progress; }
