/* Alfa Car — pensado para el móvil, con manos sucias o guantes */
:root {
  --bg: #eef1f4; --card: #ffffff; --text: #18202a; --muted: #5d6875; --line: #d5dbe2;
  --primary: #c8102e; --primary-text: #fff; --top: #1b2430; --top-text: #fff;
  --btn: #e3e8ee; --btn-text: #18202a;
  --ok: #1e7d3a; --ok-bg: #e2f4e7; --warn: #8a5a00; --warn-bg: #fff3d6; --danger: #b3261e; --danger-bg: #fde4e1;
  --info-bg: #e3eefc; --plate-bg: #fff; --plate-border: #1b2430; --plate-strip: #1f4fbf;
  --radius: 14px; --tap: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141a; --card: #1a222c; --text: #e9eef4; --muted: #9aa7b5; --line: #2c3743;
    --top: #0a0e13; --btn: #2a3542; --btn-text: #e9eef4;
    --ok-bg: #143322; --ok: #7fdc9a; --warn-bg: #3a2c0b; --warn: #ffd27a; --danger-bg: #3d1614; --danger: #ff8a80;
    --info-bg: #15273f; --plate-bg: #f3f3f3; --plate-border: #000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141a; --card: #1a222c; --text: #e9eef4; --muted: #9aa7b5; --line: #2c3743;
  --top: #0a0e13; --btn: #2a3542; --btn-text: #e9eef4;
  --ok-bg: #143322; --ok: #7fdc9a; --warn-bg: #3a2c0b; --warn: #ffd27a; --danger-bg: #3d1614; --danger: #ff8a80;
  --info-bg: #15273f; --plate-bg: #f3f3f3; --plate-border: #000;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
h1 { font-size: 1.5rem; margin: .4rem 0 .8rem; }
h2 { font-size: 1.2rem; margin: 0 0 .7rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 .3rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }

/* Cabecera fija con buscador */
.top { position: sticky; top: 0; z-index: 20; background: var(--top); color: var(--top-text); padding: 8px 12px 0; padding-top: max(8px, env(safe-area-inset-top)); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.top-row { display: flex; gap: 10px; align-items: center; max-width: 960px; margin: 0 auto; }
.logo { font-weight: 800; font-size: 1.15rem; text-decoration: none; white-space: nowrap; letter-spacing: .5px; }
.logo::before { content: "▲"; color: var(--primary); margin-right: 4px; }
.search { flex: 1; display: flex; min-width: 0; }
.search input { flex: 1; min-width: 0; height: 50px; border: 0; border-radius: 12px 0 0 12px; padding: 0 14px; font-size: 1.2rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; background: #fff; color: #111; }
.search input::placeholder { text-transform: none; font-weight: 400; letter-spacing: 0; }
.search button { width: 58px; height: 50px; border: 0; border-radius: 0 12px 12px 0; background: var(--primary); color: #fff; font-size: 1.3rem; }
.nav { display: flex; gap: 4px; overflow-x: auto; max-width: 960px; margin: 6px auto 0; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: 0 0 auto; padding: 10px 12px; text-decoration: none; font-size: .95rem; white-space: nowrap; border-radius: 10px 10px 0 0; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.1); }

.wrap { max-width: 960px; margin: 0 auto; padding: 12px 12px 80px; }
.hello { color: var(--muted); margin-bottom: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 12px 0; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 10px 18px; border-radius: 12px; border: 2px solid transparent; background: var(--btn); color: var(--btn-text); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; user-select: none; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); filter: brightness(.95); }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-big { min-height: 68px; font-size: 1.1rem; width: 100%; }
.btn-huge { min-height: 88px; font-size: 1.4rem; width: 100%; }
.btn-small { min-height: 44px; padding: 6px 12px; font-size: .95rem; }
.btn-go { background: #1e8e3e; color: #fff; }
.btn-warn { background: #f2a900; color: #111; }
.btn-stop { background: #b3261e; color: #fff; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.btn-wa { background: #25d366; color: #0b2e17; }
.link-danger { background: none; border: 0; color: var(--danger); font: inherit; font-size: .85rem; padding: 6px 0; cursor: pointer; text-decoration: underline; }
form.inline { display: contents; }
.grid-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.grid-buttons.two { grid-template-columns: 1fr 1fr; }
.grid-buttons.three { grid-template-columns: repeat(3, 1fr); }
.grid-buttons > form:not(.inline) { margin: 0; }
.grid-buttons .btn { width: 100%; }
.btn-foto { width: 100%; }
.foto-form { margin: 0; }
.foto-form.btn-big .btn { min-height: 68px; font-size: 1.1rem; }
.foto-form.uploading .btn { opacity: .6; pointer-events: none; }

/* Formularios */
.form label { display: block; margin: 10px 0; font-weight: 600; font-size: .95rem; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea, .filter, .inline-search input {
  display: block; width: 100%; margin-top: 4px; min-height: 52px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-weight: 400; }
.form textarea { min-height: 90px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--primary); }
.form .check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.form .check input { width: 28px; height: 28px; flex: 0 0 auto; }
.big-check { background: var(--bg); padding: 10px; border-radius: 10px; }
.form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 8px; margin: 12px 0; }
.form legend { font-weight: 700; padding: 0 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.quick { display: flex; gap: 8px; margin: 10px 0; }
.input-plate { text-transform: uppercase; font-weight: 800 !important; letter-spacing: 2px; font-size: 1.3rem !important; }
.inline-search { display: flex; gap: 8px; align-items: stretch; margin: 10px 0; }
.inline-search input { margin: 0; }
.inline-form label { margin: 0; }
.filter { margin: 12px 0; }
.radio-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.radio-btn { display: flex !important; align-items: center; gap: 8px; min-height: 56px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; margin: 0 !important; cursor: pointer; }
.radio-btn input { width: 24px; height: 24px; }
.radio-btn:has(input:checked) { border-color: var(--text); background: var(--bg); }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 4px; min-height: 64px; text-decoration: none; }
.item:active { background: var(--bg); }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-main small, .item-col small { color: var(--muted); }
.item-col { flex-direction: column; align-items: flex-start; gap: 2px; }
.item-top { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.item-title { font-weight: 600; }
.item-alert { border-left: 4px solid var(--danger); padding-left: 10px; }
.plain { padding-left: 1.2rem; }
.block-link { display: block; text-decoration: none; font-weight: 700; }

/* Matrícula con aspecto de placa */
.plate { display: inline-block; flex: 0 0 auto; background: var(--plate-bg); color: #111; border: 2px solid var(--plate-border); border-left: 10px solid var(--plate-strip); border-radius: 6px; padding: 2px 8px; font-weight: 800; letter-spacing: 1.5px; font-family: ui-monospace, Menlo, Consolas, monospace; text-decoration: none; white-space: nowrap; font-size: .95rem; }
.plate-big { font-size: 1.6rem; padding: 6px 14px; }
.car-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.car-head h1 { margin: 0; }
@media (max-width: 560px) { .car-head { grid-template-columns: 1fr auto; } .car-head > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; } }

/* Etiquetas */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--btn); color: var(--btn-text); white-space: nowrap; }
.est-pendiente { background: #e4e7eb; color: #333; }
.est-en_curso { background: #cfe3ff; color: #0b3c86; }
.est-esperando_pieza { background: #ffe7b3; color: #6b4500; }
.est-listo { background: #c9f0d4; color: #0f5a26; }
.est-entregado { background: #e9e2f7; color: #4a2d86; }
.urg-urgente { background: #ffd5d1; color: #8f1d15; }
.urg-proxima { background: #ffe7b3; color: #6b4500; }
.urg-vigilar { background: #d9ecff; color: #0b3c86; }
.av-pendiente { background: #ffd5d1; color: #8f1d15; }
.av-avisado { background: #ffe7b3; color: #6b4500; }
.av-aceptado { background: #cfe3ff; color: #0b3c86; }
.av-rechazado { background: #e4e7eb; color: #333; }
.av-resuelto { background: #c9f0d4; color: #0f5a26; }

/* Avisos de la página */
.flash { padding: 12px 14px; border-radius: 12px; margin: 10px 0; font-weight: 600; }
.flash ul { margin: 6px 0 0; padding-left: 1.2rem; font-weight: 400; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.flash-info { background: var(--info-bg); }

/* Cronómetro */
.timer-card { text-align: center; }
.timer-card.running { border-color: #1e8e3e; box-shadow: 0 0 0 3px rgba(30,142,62,.25); }
.timer-card.paused { border-color: #f2a900; box-shadow: 0 0 0 3px rgba(242,169,0,.25); }
.timer { font-size: 2.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer-sub { color: var(--muted); }
.timer-card .form { text-align: left; }
details { margin-top: 10px; text-align: left; }
summary { cursor: pointer; font-weight: 700; padding: 8px 0; min-height: 44px; }

/* Fotos */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--bg); }
.gallery figcaption { font-size: .75rem; color: var(--muted); }

.details dt { font-weight: 700; color: var(--muted); font-size: .85rem; margin-top: 10px; }
.details dd { margin: 2px 0 0; }
.calc { border-top: 1px solid var(--line); padding: 10px 0; }
.extra { border-top: 1px solid var(--line); padding: 10px 0; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; }
.tabs a { padding: 10px 14px; border-radius: 999px; background: var(--btn); text-decoration: none; white-space: nowrap; font-weight: 600; font-size: .95rem; }
.tabs a.active { background: var(--text); color: var(--bg); }
.rev-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rev-vencida { border-left: 6px solid var(--danger); }
.rev-hecha { opacity: .7; }
blockquote { margin: 0; padding: 12px; border-left: 4px solid var(--line); background: var(--bg); border-radius: 8px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; white-space: nowrap; }

.login { max-width: 420px; margin: 8vh auto; }
.login h1 { font-size: 2rem; }
.login h1::before { content: "▲ "; color: var(--primary); }

@media (max-width: 420px) {
  body { font-size: 17px; }
  .logo { font-size: 0; } .logo::before { font-size: 1.6rem; margin: 0; }
  .grid-buttons.three { grid-template-columns: 1fr 1fr 1fr; }
  .grid-buttons.three .btn { padding: 8px 4px; font-size: .95rem; }
  .row2 { grid-template-columns: 1fr; }
  .timer { font-size: 2.3rem; }
}
@media print { .top, .btn, form { display: none !important; } body { background: #fff; } .card { border: 0; } }

/* ===== Modo taller (sencillo): manos sucias, móvil ===== */
.bottombar { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.chip { min-height: 48px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; }
.chip:active { background: var(--btn); }
.stack { display: grid; gap: 14px; margin: 14px 0; }
.section-title { margin: 22px 4px 10px; }
.big-card { display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 14px 16px; margin: 12px 0; background: var(--card); border: 2px solid var(--line); border-radius: 18px; text-decoration: none; }
.big-card:active { background: var(--btn); }
.big-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 1.15rem; font-weight: 700; }
.big-card-main small { font-weight: 400; color: var(--muted); font-size: .9rem; }
.job-link { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; }
.job-title { font-size: 1.25rem; font-weight: 700; }
.input-huge { min-height: 76px !important; font-size: 2rem !important; text-align: center; }
details.more { margin: 12px 0; }
details.more > summary { background: var(--btn); border-radius: 12px; padding: 14px 16px; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }
.more-big > summary { min-height: 72px; display: flex; align-items: center; font-size: 1.1rem; }

body.simple { font-size: 20px; padding-bottom: 96px; }
body.simple .wrap { padding: 14px 14px 110px; }
body.simple .top { padding-bottom: 8px; }
body.simple .home-btn { display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 14px; background: rgba(255,255,255,.12); font-size: 1.7rem; text-decoration: none; flex: 0 0 auto; }
body.simple .search input { height: 58px; font-size: 1.5rem; }
body.simple .search button { height: 58px; width: 66px; }
body.simple .btn { min-height: 72px; font-size: 1.15rem; border-radius: 16px; }
body.simple .btn-huge { min-height: 100px; font-size: 1.5rem; }
body.simple .btn-small { min-height: 60px; }
body.simple .grid-buttons { gap: 14px; }
body.simple .grid-buttons.two { grid-template-columns: 1fr 1fr; }
body.simple .grid-buttons.three { grid-template-columns: 1fr; }
body.simple .item { min-height: 80px; }
body.simple .plate { font-size: 1.15rem; padding: 4px 10px; }
body.simple .plate-big { font-size: 1.8rem; }
body.simple .badge { font-size: .95rem; padding: 5px 12px; }
body.simple .form input:not([type=checkbox]):not([type=radio]), body.simple .form select, body.simple .form textarea { min-height: 64px; font-size: 1.15rem; }
body.simple .form .check input { width: 36px; height: 36px; }
body.simple .radio-btn { min-height: 72px; }
body.simple .timer { font-size: 3.2rem; }
body.simple .gallery { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
body.simple .tabs a { padding: 14px 18px; }
body.simple a.small, body.simple .link-danger { display: inline-block; padding: 10px 0; }
body.simple .bottombar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--top); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,.3); }
body.simple .bottombar a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 78px; color: #fff; text-decoration: none; font-size: .85rem; font-weight: 600; }
body.simple .bottombar a span { font-size: 1.8rem; line-height: 1.1; }
body.simple .bottombar a:active { background: rgba(255,255,255,.12); }

.big-card-col { flex-direction: column; align-items: stretch; gap: 8px; }
.big-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Un único botón en una fila de dos: ocupa todo el ancho */
.grid-buttons > form.inline:only-child > .btn, .grid-buttons > a:only-child { grid-column: 1 / -1; }

/* Lista de la revisión: casillas grandes */
.checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.form .check-item { display: flex; align-items: center; gap: 14px; min-height: 64px; margin: 0; padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); font-size: 1.05rem; font-weight: 600; cursor: pointer; }
.form .check-item input { width: 32px; height: 32px; flex: 0 0 auto; accent-color: #1e8e3e; }
.form .check-item:has(input:checked) { border-color: #1e8e3e; background: var(--ok-bg); }
body.simple .form .check-item { min-height: 76px; font-size: 1.15rem; }
body.simple .form .check-item input { width: 40px; height: 40px; }

/* Submenú del cambio de aceite */
.sub-aceite { display: none; grid-column: 1 / -1; margin: -2px 0 6px; padding: 12px; border: 2px solid #1e8e3e; border-radius: 14px; background: var(--card); }
.checklist:has(input[data-aceite]:checked) .sub-aceite:not(.sub-bombillas), .checklist:has(input[data-bombillas]:checked) .sub-bombillas, .sub-aceite.open { display: block; }
.sub-title { font-weight: 700; margin: 4px 0 8px; }
.aceite-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 10px; }
.form .opt { display: block; margin: 0; }
.form .opt input { position: absolute; opacity: 0; pointer-events: none; }
.form .opt span, .opt-btn { display: flex; align-items: center; justify-content: center; min-height: 60px; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; font-weight: 800; font-size: 1.1rem; cursor: pointer; }
.form .opt input:checked + span { border-color: #1e8e3e; background: #1e8e3e; color: #fff; }
.form .opt input:focus-visible + span { outline: 3px solid var(--primary); }
.aceite-otro { display: none !important; }
.sub-aceite:has(input[value=otro]:checked) .aceite-otro { display: block !important; }
body.simple .form .opt span, body.simple .opt-btn { min-height: 68px; font-size: 1.2rem; }
.opt-btn.sel { border-color: #1e8e3e; background: #1e8e3e; color: #fff; }
.chip.sel { border-color: #1e8e3e; background: #1e8e3e; color: #fff; }
body.simple .chip { min-height: 56px; font-size: 1.05rem; }
.form .opt span, .opt-btn { padding: 4px 6px; text-align: center; line-height: 1.15; }

/* =====================================================================
   DISEÑO 2 — aspecto más profesional (solo estilo, no cambia funciones)
   ===================================================================== */
:root {
  --bg: #f1f4f8; --card: #ffffff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --primary: #d01c3c; --primary-2: #a3122c; --primary-soft: #fde8ec; --primary-text: #fff;
  --top: #0f172a; --top-2: #1e293b; --top-text: #f8fafc;
  --btn: #ffffff; --btn-text: #0f172a; --btn-line: #dbe2ea;
  --ok: #15803d; --ok-bg: #e8f7ee; --warn: #92400e; --warn-bg: #fff7e6; --danger: #b91c1c; --danger-bg: #fdecec;
  --info-bg: #eaf2ff; --accent: #2563eb;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .06);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --card: #131c2e; --text: #e6ebf3; --muted: #93a3b8; --line: #23304a;
    --primary-soft: #3a1520; --top: #060b16; --top-2: #0f172a;
    --btn: #1a2438; --btn-text: #e6ebf3; --btn-line: #2a3852;
    --ok: #6ee7a0; --ok-bg: #10291c; --warn: #fcd27a; --warn-bg: #2e2410; --danger: #fca5a5; --danger-bg: #331617;
    --info-bg: #13233d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --card: #131c2e; --text: #e6ebf3; --muted: #93a3b8; --line: #23304a;
  --primary-soft: #3a1520; --top: #060b16; --top-2: #0f172a;
  --btn: #1a2438; --btn-text: #e6ebf3; --btn-line: #2a3852;
  --ok: #6ee7a0; --ok-bg: #10291c; --warn: #fcd27a; --warn-bg: #2e2410; --danger: #fca5a5; --danger-bg: #331617;
  --info-bg: #13233d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
}

body { font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; }
h1 { font-size: 1.55rem; font-weight: 750; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h3 { font-weight: 650; }
a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
::selection { background: var(--primary-soft); }

/* Iconos */
.ic { width: 1.2em; height: 1.2em; flex: 0 0 auto; vertical-align: -.22em; }
h1 > .ic:first-child { width: 1.15em; height: 1.15em; color: var(--primary); }
.card h2 > .ic:first-child, .section-title > .ic:first-child {
  width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: gira .7s linear infinite; vertical-align: -.15em; }
@keyframes gira { to { transform: rotate(360deg); } }

/* Cabecera */
.top { background: linear-gradient(180deg, var(--top), var(--top-2)); box-shadow: 0 4px 18px rgba(2, 6, 23, .25); padding: 10px 14px 0;
  padding-top: max(10px, env(safe-area-inset-top)); }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; }
.logo::before { content: none; }
.logo img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 2px 8px rgba(208, 28, 60, .35); }
.search { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; overflow: hidden; }
.search:focus-within { background: #fff; border-color: #fff; box-shadow: 0 0 0 4px rgba(208, 28, 60, .35); }
.search input { background: transparent; color: #fff; border-radius: 0; height: 48px; font-size: 1.1rem; letter-spacing: 1.5px; }
.search:focus-within input { color: #0f172a; }
.search input::placeholder { color: rgba(255, 255, 255, .6); }
.search:focus-within input::placeholder { color: #94a3b8; }
.search button { background: var(--primary); height: 48px; width: 56px; border-radius: 0; display: flex; align-items: center; justify-content: center; }
.search button .ic { width: 22px; height: 22px; }
.nav { gap: 2px; margin-top: 10px; }
.nav a { display: flex; align-items: center; gap: 7px; padding: 10px 14px 12px; border-radius: 12px 12px 0 0; font-weight: 600; font-size: .92rem;
  color: rgba(248, 250, 252, .72); opacity: 1; position: relative; }
.nav a .ic { width: 18px; height: 18px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { color: #fff; }
.nav a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }

.wrap { padding-top: 18px; }
.hello { font-size: .95rem; font-weight: 500; }

/* Tarjetas */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 14px 0; }

/* Botones */
.btn { background: var(--btn); color: var(--btn-text); border: 1px solid var(--btn-line); box-shadow: var(--shadow-sm);
  border-radius: 14px; font-weight: 650; letter-spacing: -.005em; gap: 8px; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:hover { box-shadow: var(--shadow); }
.btn .ic { width: 1.25em; height: 1.25em; }
.btn-primary { background: linear-gradient(180deg, #e0284a, var(--primary-2)); color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(208, 28, 60, .28); }
.btn-go { background: linear-gradient(180deg, #22a55a, #15803d); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(21, 128, 61, .25); }
.btn-warn { background: linear-gradient(180deg, #fbbf24, #f59e0b); color: #1f1300; border-color: transparent; box-shadow: 0 6px 16px rgba(245, 158, 11, .25); }
.btn-stop { background: linear-gradient(180deg, #ef4444, #b91c1c); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(185, 28, 28, .25); }
.btn-danger { background: var(--card); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); box-shadow: none; }
.btn-wa { background: linear-gradient(180deg, #2bd46e, #1fae55); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(31, 174, 85, .25); }
.btn-big { min-height: 64px; font-size: 1.05rem; }
.btn-huge { min-height: 84px; font-size: 1.3rem; border-radius: 18px; }
.btn-huge .ic { width: 1.35em; height: 1.35em; }
.grid-buttons { gap: 12px; }
/* Accesos grandes del inicio y la ficha: icono encima del texto */
.grid-buttons:not(.two):not(.three) > .btn-big, .grid-buttons:not(.two):not(.three) > .foto-form .btn { flex-direction: column; gap: 6px; padding: 14px 10px; }
.grid-buttons:not(.two):not(.three) > .btn-big .ic { width: 28px; height: 28px; }
.foto-form .btn .lbl { display: inline-flex; align-items: center; gap: 8px; }

/* Formularios */
.form label { font-weight: 600; color: var(--text); font-size: .92rem; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea, .filter, .inline-search input {
  border: 1px solid var(--btn-line); background: var(--card); border-radius: 12px; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04); }
.form input:focus, .form select:focus, .form textarea:focus, .filter:focus, .inline-search input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.form fieldset { border-color: var(--line); border-radius: 14px; background: color-mix(in srgb, var(--bg) 50%, var(--card)); }
.form .check input, .form .check-item input, .radio-btn input { accent-color: var(--primary); }
.radio-btn { border: 1px solid var(--btn-line); background: var(--card); }
.radio-btn:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.big-check { border: 1px solid var(--line); }

/* Listas */
.list li + li { border-top-color: var(--line); }
.item { border-radius: 12px; padding: 12px 8px; transition: background .12s; }
.item:hover { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.list a.item:not(.item-col)::after { content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-left: 4px;
  border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: rotate(45deg); opacity: .45; }
.item-title { font-weight: 650; }
.item-main { font-weight: 600; }

/* Matrícula europea */
.plate { position: relative; padding: 3px 9px 3px 24px; border: 2px solid #111827; border-left: 0; border-radius: 7px; background: #fff;
  color: #111827; box-shadow: var(--shadow-sm); font-family: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace; }
.plate::before { content: "E"; position: absolute; left: 0; top: -2px; bottom: -2px; width: 16px; border-radius: 6px 0 0 6px;
  background: #1d4ed8; color: #fff; font-size: .62em; font-weight: 700; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 3px; letter-spacing: 0; }
.plate-big { padding: 6px 14px 6px 32px; font-size: 1.6rem; }
.plate-big::before { width: 22px; font-size: .45em; }

/* Etiquetas de estado */
.badge { font-weight: 650; font-size: .76rem; padding: 4px 10px; border-radius: 999px; letter-spacing: .01em;
  display: inline-flex; align-items: center; gap: 6px; }
.badge[class*="est-"]::before, .badge[class*="urg-"]::before, .badge[class*="av-"]::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.est-pendiente { background: #eef2f6; color: #475569; }
.est-en_curso { background: #e3edff; color: #1d4ed8; }
.est-esperando_pieza { background: #fff3d6; color: #a16207; }
.est-listo { background: #dcf7e6; color: #15803d; }
.est-entregado { background: #efe9fb; color: #6d28d9; }
.urg-urgente { background: #fde4e7; color: #be123c; }
.urg-proxima { background: #fff3d6; color: #a16207; }
.urg-vigilar { background: #e3edff; color: #1d4ed8; }

/* Avisos de la página */
.flash { border-radius: 14px; border: 1px solid transparent; font-weight: 600; box-shadow: var(--shadow-sm); }
.flash-ok { border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash-error { border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.flash-warn { border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.flash-info { border-color: color-mix(in srgb, var(--accent) 20%, transparent); }

/* Cronómetro */
.timer-card { padding: 22px 18px; }
.timer { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; }
.timer-card.running { border-color: #22a55a; box-shadow: 0 0 0 4px rgba(34, 165, 90, .15), var(--shadow); }
.timer-card.paused { border-color: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .15), var(--shadow); }
.timer-card.running .timer { color: #15803d; }

/* Ficha del coche */
.car-head { gap: 16px; }
.car-head h1 { font-size: 1.4rem; }

/* Pestañas */
.tabs { gap: 8px; padding-bottom: 2px; }
.tabs a { background: var(--card); border: 1px solid var(--btn-line); box-shadow: var(--shadow-sm); font-size: .9rem; }
.tabs a.active { background: var(--text); color: var(--card); border-color: var(--text); }

/* Tarjetas grandes del modo taller */
.big-card { border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 18px; }
.big-card:hover { border-color: var(--btn-line); }
.section-title { font-size: 1.1rem; }

/* Galería */
.gallery { gap: 10px; }
.gallery img { border-radius: 12px; box-shadow: var(--shadow-sm); }

/* Plegables */
details.more > summary { background: var(--card); border: 1px solid var(--btn-line); box-shadow: var(--shadow-sm); border-radius: 14px;
  display: flex; align-items: center; gap: 8px; }
details.more > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
details.more[open] > summary::before { content: ""; transform: rotate(45deg); }

/* Chips y opciones */
.chip { border: 1px solid var(--btn-line); background: var(--card); box-shadow: var(--shadow-sm); }
.chip.sel, .opt-btn.sel, .form .opt input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.form .opt span, .opt-btn { border: 1px solid var(--btn-line); background: var(--card); }
.form .check-item { border: 1px solid var(--btn-line); background: var(--card); }
.form .check-item:has(input:checked) { border-color: #22a55a; background: var(--ok-bg); }
.sub-aceite { border: 1px solid #22a55a; box-shadow: var(--shadow-sm); }

/* Tablas */
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }

/* Barra inferior del modo taller */
body.simple .bottombar { background: color-mix(in srgb, var(--top) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, .06); }
body.simple .bottombar a { color: rgba(248, 250, 252, .65); gap: 4px; }
body.simple .bottombar a span { display: flex; }
body.simple .bottombar a .ic { width: 26px; height: 26px; }
body.simple .bottombar a.active { color: #fff; }
body.simple .bottombar a.active span { color: #fb7185; }
body.simple .home-btn { color: #fff; }
body.simple .home-btn .ic { width: 26px; height: 26px; }

/* Entrada */
.login { margin: 10vh auto; padding: 28px 24px; }
.login h1 { flex-direction: column; align-items: flex-start; gap: 14px; }
.login h1::before { content: ""; width: 56px; height: 56px; border-radius: 15px; background: url(icon.svg) center / cover no-repeat;
  box-shadow: 0 8px 20px rgba(208, 28, 60, .35); }

@media (max-width: 420px) {
  body { font-size: 16px; }
  .logo span { display: none; }
  .logo { font-size: 1.1rem; }
  .logo::before { content: none; }
  h1 { font-size: 1.35rem; }
}

/* Ajustes finos */
body.simple .plate { padding: 4px 10px 4px 27px; }
body.simple .plate-big { padding: 6px 14px 6px 34px; }
.btn { flex-wrap: nowrap; }
.grid-buttons > .foto-form, .grid-buttons > .foto-form .btn { height: 100%; }
.grid-buttons:not(.two):not(.three) > .foto-form .btn .lbl { flex-direction: column; gap: 6px; }
.grid-buttons:not(.two):not(.three) > .foto-form .btn .ic { width: 28px; height: 28px; }
.grid-buttons > .foto-form { display: flex; }
.grid-buttons > .foto-form > .btn { flex: 1; width: 100%; }
.grid-buttons > .foto-form.btn-big { padding: 0 !important; }
