/* Avenida Motor · diseño negro y formal.
   Plata para la marca, rojo del logo solo como acento; los colores de estado van siempre con texto. */
:root {
  --bg: #000000; --surface: #0E0F12; --surface-2: #15171B; --surface-3: #1D2025; --line: #262930; --line-2: #343840;
  --ink: #F2F3F5; --muted: #9AA0A9; --faint: #686D76;
  --brand: #E0261C; --brand-2: #B81D15;
  --primary: #F2F3F5; --primary-ink: #000000;
  --ok: #3CC97D; --ok-soft: rgba(60, 201, 125, .13); --warn: #F0B13F; --warn-soft: rgba(240, 177, 63, .14);
  --bad: #FF6A5C; --bad-soft: rgba(255, 106, 92, .14); --info: #8DB4FF; --info-soft: rgba(141, 180, 255, .13);
  --c2: #3A3F47; --c3: #A98BF0;
  --signal: #F2B417; --signal-ink: #141000;
  --plate-bg: #FFFFFF; --plate-ink: #111111; --plate-edge: #1A1A1A; --plate-eu: #1F3F9C; --plate-eu-ink: #FFFFFF;
  --silver: linear-gradient(180deg, #FFFFFF 0%, #E4E6EA 38%, #9EA4AD 52%, #D9DCE1 70%, #F5F6F8 100%);
  --f-brand: "Michroma", "Eurostile", "Arial Black", sans-serif;
  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
img { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: .02em; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: 32px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
td, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; color: var(--muted); }

/* logotipo: archivo del taller o, si falta, el nombre en texto */
.logo-img { display: block; max-width: 100%; height: auto; object-fit: contain; }
.logo-text { display: inline-block; font-family: var(--f-brand); text-transform: uppercase; letter-spacing: .12em; line-height: 1.1; background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.logo-img.logo-sm { height: 42px; width: auto; }
.logo-text.logo-sm { font-size: 15px; }
.gate-brand { width: 100%; display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1; }
.gate-sub { margin: 4px 0 0; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; font-size: 12px; text-align: center; }
table.horario input[type="time"] { min-width: 96px; }
.logo-img.gate-logo { width: min(440px, 82vw); max-height: 36vh; }
.logo-text.gate-logo { font-size: clamp(26px, 7vw, 54px); margin: 24px 0 6px; text-align: center; white-space: normal; }
.logo-img.logo-screen { height: 92px; width: auto; }
.logo-text.logo-screen { font-size: 26px; }

/* barra superior */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(0, 0, 0, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 10px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--brand) 20%, var(--brand) 22%, transparent 40%); opacity: .7; }
.brand { background: none; border: 0; padding: 0; cursor: pointer; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.brand .sub { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; border-left: 1px solid var(--line-2); padding-left: 12px; }
.top-spacer { flex: 1; }
.clock { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.clock b { font-family: var(--f-display); font-size: 22px; color: var(--ink); font-weight: 500; letter-spacing: .04em; }
.who { display: flex; align-items: center; gap: 10px; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.conn.off { background: var(--bad); }
.demo-band { background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 6px; }
.demo-band b { color: var(--signal); font-weight: 600; }

main { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 24px 64px; max-width: 1400px; margin: 0 auto; }
main.wide { max-width: none; padding-block: 16px 24px; }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; min-height: 38px; text-align: center; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn-primary:hover { background: #FFFFFF; border-color: #FFFFFF; }
.btn-brand { background: var(--brand); color: #FFFFFF; border-color: var(--brand); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-lg { min-height: 52px; font-size: 17px; padding: 12px 22px; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 980px) { .split, .split.even { grid-template-columns: minmax(0, 1fr); } }

/* estados */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.nodot::before { display: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.info { background: var(--info-soft); color: var(--info); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; border: 1px solid currentColor; margin-right: 4px; }
.tag.urg { color: var(--bad); } .tag.sala { color: var(--info); } .tag.sc { color: var(--muted); } .tag.gar { color: var(--c3); }

/* matrícula española */
.plate { display: inline-flex; align-items: stretch; border: 1.5px solid var(--plate-edge); border-radius: 4px; background: var(--plate-bg); color: var(--plate-ink); font-family: var(--f-display); font-weight: 700; line-height: 1; overflow: hidden; white-space: nowrap; vertical-align: middle; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.plate-eu { background: var(--plate-eu); color: var(--plate-eu-ink); font-size: .55em; display: flex; align-items: flex-end; padding: 0 3px 2px; }
.plate-num { padding: 3px 6px 2px; letter-spacing: .06em; }
.plate.lg { font-size: 32px; border-width: 2.5px; border-radius: 6px; }
.plate.xl { font-size: 44px; border-width: 3px; border-radius: 7px; }

/* tablas */
.tbl-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; }
table.data input, table.data select { border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 7px; background: var(--surface-2); width: 100%; min-width: 72px; }

/* pestañas y filtros */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; letter-spacing: .02em; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.fchip { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.fchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* listas */
.list { display: flex; flex-direction: column; }
.li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.li:last-child { border-bottom: 0; }
.li-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.banner { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r); padding: 12px 16px; margin-bottom: 16px; background: var(--warn-soft); border: 1px solid var(--warn); }
.banner .ic { font-weight: 800; color: var(--warn); font-family: var(--f-display); font-size: 18px; line-height: 1.2; }

/* acceso */
.gate { position: relative; min-height: calc(100vh - 140px); display: flex; flex-direction: column; align-items: center; padding-top: 10px; overflow: hidden; }
.gate-tag { font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); text-align: center; }
.gate-car { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); width: min(1100px, 140%); opacity: .55; pointer-events: none; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 32px; width: 100%; max-width: 1000px; position: relative; z-index: 1; }
.prof { text-align: left; background: rgba(14, 15, 18, .86); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 118px; position: relative; }
.prof:hover { border-color: var(--line-2); background: var(--surface-2); }
.prof:hover .ico { color: var(--ink); }
.prof b { font-family: var(--f-display); font-size: 21px; font-weight: 600; letter-spacing: .02em; }
.prof span { color: var(--muted); font-size: 13.5px; }
.prof .lock { position: absolute; top: 14px; right: 14px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.prof .ico { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--muted); display: grid; place-items: center; }
.prof .ico svg { width: 20px; height: 20px; }
.prof.soon { cursor: default; border-style: dashed; background: transparent; }
.login { width: 100%; max-width: 420px; margin-top: 28px; position: relative; z-index: 1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%; }
.field textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pinpad button { min-height: 62px; font-size: 26px; font-family: var(--f-display); font-weight: 500; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; }
.pinpad button:active { background: var(--surface-3); }
.pindots { display: flex; gap: 14px; justify-content: center; margin: 18px 0 4px; }
.pindots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.pindots i.on { background: var(--ink); border-color: var(--ink); }
.err { color: var(--bad); font-size: 14px; font-weight: 600; min-height: 20px; text-align: center; }
.ayuda-pasos { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; }
details.faq summary { cursor: pointer; }
details.faq p { margin: 6px 0 0; color: var(--muted); }
.chat { display: grid; gap: 8px; max-height: 260px; overflow-y: auto; }
.chat .msg { margin: 0; padding: 8px 12px; border-radius: 12px; max-width: 90%; font-size: 15px; }
.chat .msg.yo { justify-self: end; background: var(--surface-3, #1D2025); }
.chat .msg.asistente { justify-self: start; border: 1px solid var(--line-2); }
.chat .msg.aviso { justify-self: start; color: var(--warn, #F5B544); font-size: 14px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
label.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.legal-links { position: relative; z-index: 1; display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin: 18px 0 8px; font-size: 13px; }
.legal-links a, .login a { color: var(--muted); }
.legal-links a:hover { color: var(--ink); }
.hint { font-size: 13px; color: var(--muted); text-align: center; }

/* modal */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); z-index: 50; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 24px max(12px, env(safe-area-inset-left, 0px)); }
.modal { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; width: 100%; max-width: 700px; box-shadow: 0 24px 80px rgba(0, 0, 0, .7); min-width: 0; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.x { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.steps { display: flex; gap: 4px; padding: 12px 20px 0; flex-wrap: wrap; }
.steps span { font-size: 12px; font-weight: 600; color: var(--faint); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.steps span.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.steps span.done { color: var(--muted); border-color: var(--line-2); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 8px; }
.choice { text-align: left; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 10px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.choice span { font-size: 13px; color: var(--muted); }
.choice[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--ink); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: var(--surface-2); text-align: left; width: 100%; }
.toggle[aria-pressed="true"] { border-color: var(--ink); }
.toggle .sw { width: 42px; height: 24px; border-radius: 999px; background: var(--c2); position: relative; flex: none; transition: background .15s; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: left .15s; }
.toggle[aria-pressed="true"] .sw { background: var(--ok); }
.toggle[aria-pressed="true"] .sw::after { left: 21px; }
.drop { border: 1px dashed var(--line-2); border-radius: 12px; padding: 24px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--brand); color: #FFFFFF; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.count.zero { background: var(--surface-3); color: var(--muted); }
.aviso { border-bottom: 1px solid var(--line); }
.aviso:last-child { border-bottom: 0; }
.aviso-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; background: none; border: 0; text-align: left; cursor: pointer; flex-wrap: wrap; }
.aviso-head:hover .plate-num { text-decoration: underline; }
.aviso-body { padding: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.aviso-body .wa { margin-left: 0; font-size: 14px; }
.plate-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.qc { border: 1px solid var(--line-2); border-left: 3px solid var(--warn); border-radius: 8px; padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.qc.retrabajo { border-left-color: var(--bad); } .qc.justificada { border-left-color: var(--ok); }
.qc textarea { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 8px 10px; width: 100%; min-height: 54px; resize: vertical; }
.logo-prev { background: #000000; border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: flex; justify-content: center; }
.logo-prev img { max-height: 220px; max-width: 100%; object-fit: contain; }
/* indicador de conexión: siempre visible */
.estado { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.estado::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.estado-ok { background: var(--ok-soft); color: var(--ok); }
.estado-sin { background: var(--warn-soft); color: var(--warn); white-space: normal; }
.estado-sinc { background: var(--info-soft); color: var(--info); }
.estado-sinc::before { animation: latido 1s ease-in-out infinite; }
@keyframes latido { 50% { opacity: .25; } }
.tag.pend { color: var(--warn); border-style: dashed; }
.toast.aviso { background: var(--warn); color: #1A1200; }
.codigo-grande { font-family: var(--f-display); font-size: 64px; font-weight: 600; letter-spacing: .25em; text-align: center; padding: 12px; border: 1px dashed var(--line-2); border-radius: 12px; }
.qr { width: 200px; height: 200px; background: #FFFFFF; padding: 8px; border-radius: 8px; }
.uso { display: flex; flex-direction: column; gap: 6px; }
.progress i.ok { background: var(--ok); } .progress i.warn { background: var(--warn); } .progress i.bad { background: var(--bad); }
.pantalla-pie { position: fixed; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; align-items: center; z-index: 25; }
.pinpad button.ok { background: var(--primary); color: var(--primary-ink); }
.corto { display: none; }
@media (max-width: 760px) { #who .nombre, .largo { display: none; } .corto { display: inline; } }
/* modo demostración */
.tour-boton { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; background: var(--brand); color: #FFFFFF; border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); }
.tour { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: min(380px, calc(100vw - 32px)); background: var(--surface-2); border: 1px solid var(--brand); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .7); }
.tour-pasos { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.tour-pasos button { background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--muted); cursor: pointer; }
.tour-pasos li.on button { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tour-pasos li.hecho button { color: var(--ink); }
.tour.tour-min { flex-direction: row; align-items: center; width: auto; max-width: calc(100vw - 32px); padding: 8px 8px 8px 14px; gap: 10px; border-radius: 999px; }
.tour-mas { background: none; border: 0; color: var(--ink); font-size: 14px; cursor: pointer; padding: 0; text-align: left; }
.banner.ver-como { background: var(--info-soft); border-color: var(--info); }
.banner.ver-como .ic { color: var(--info); }
.read-tag { font-size: 11px; font-weight: 700; color: var(--ok); text-transform: uppercase; letter-spacing: .06em; }
.photo-prev { max-height: 220px; border-radius: 8px; object-fit: contain; border: 1px solid var(--line); }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 15px; }
.summary dt { color: var(--muted); } .summary dd { margin: 0; font-weight: 600; }
.wa-wrap { background: #0B141A; border-radius: 10px; padding: 16px; border: 1px solid var(--line); }
.wa { background: #005C4B; color: #E9EDEF; border-radius: 10px 10px 2px 10px; padding: 10px 12px; max-width: 440px; margin-left: auto; font-size: 15px; }

/* aviso emergente */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 60; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-weight: 600; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); max-width: calc(100% - 32px); }
.toast.error { background: var(--bad); color: #000; }

/* pantalla central */
.screen { min-width: 0; }
.screen-head { display: grid; grid-template-columns: minmax(0, auto) 1fr auto; gap: 24px; align-items: center; padding: 0 2px 18px; }
.screen-head .stat { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.screen-head .stat div { display: flex; flex-direction: column; align-items: center; }
.screen-head .stat b { font-family: var(--f-display); font-size: 34px; line-height: 1; font-weight: 500; }
.screen-head .stat span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.screen-clock { font-family: var(--f-display); font-size: 54px; font-weight: 500; line-height: 1; letter-spacing: .03em; }
@media (max-width: 900px) { .screen-head { grid-template-columns: 1fr; justify-items: start; } }
.board-wrap { overflow-x: auto; }
.board { display: grid; grid-template-columns: repeat(var(--cols, 7), minmax(170px, 1fr)); gap: 10px; min-width: calc(var(--cols, 7) * 176px); }
.col { background: var(--surface); border-radius: 10px; border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); gap: 8px; }
.col-head b { font-family: var(--f-display); font-size: 22px; font-weight: 600; line-height: 1.05; letter-spacing: .02em; }
.col-head small { display: block; font-size: 12px; color: var(--muted); }
.lift { background: var(--signal); color: var(--signal-ink); font-family: var(--f-display); font-weight: 700; font-size: 20px; border-radius: 6px; padding: 2px 8px; text-align: center; line-height: 1.1; white-space: nowrap; }
.lift small { display: block; font-size: 9.5px; letter-spacing: .1em; font-family: var(--f-body); font-weight: 700; }
.col-now { padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; border-top: 4px solid var(--line-2); align-items: flex-start; }
.col-now.ok { border-top-color: var(--ok); } .col-now.warn { border-top-color: var(--warn); } .col-now.bad { border-top-color: var(--bad); } .col-now.unk { border-top-color: var(--faint); }
.col-now .model { font-size: 17px; font-weight: 600; }
.col-now .job { font-family: var(--f-display); font-size: 24px; font-weight: 500; line-height: 1.1; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; width: 100%; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.bar i.ok { background: var(--ok); } .bar i.warn { background: var(--warn); } .bar i.bad { background: var(--bad); }
.state { font-weight: 700; font-size: 15px; }
.state.ok { color: var(--ok); } .state.warn { color: var(--warn); } .state.bad { color: var(--bad); } .state.unk { color: var(--muted); }
.col-next { padding: 10px 12px 12px; border-top: 1px dashed var(--line-2); font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.col-next b { color: var(--ink); font-weight: 600; }
.col.off { opacity: .5; }
.col.off .col-now { justify-content: center; align-items: center; text-align: center; font-family: var(--f-display); font-size: 22px; color: var(--muted); }
.screen-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 14px 2px 0; }
.screen-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.screen-car { display: block; width: min(900px, 100%); margin: 26px auto 0; opacity: .35; }

/* móvil del mecánico */
.mech-app { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.now-card { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.now-card .job { font-family: var(--f-display); font-size: 28px; font-weight: 600; line-height: 1.1; }
.big-btn { width: 100%; border: 0; border-radius: 16px; font-family: var(--f-display); font-weight: 700; font-size: 36px; letter-spacing: .06em; text-transform: uppercase; min-height: 128px; cursor: pointer; }
.big-btn.go { background: var(--ok); color: #00150A; }
.big-btn.park { background: var(--primary); color: var(--primary-ink); }
.big-btn.campa { background: var(--signal); color: var(--signal-ink); }

/* recambista */
.parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.part-card { display: flex; flex-direction: column; gap: 12px; }
.part-card .big-btn { min-height: 78px; font-size: 24px; background: var(--ok); color: #00150A; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* jefe de taller */
.live { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.live-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.live-col.over { border-color: var(--ink); background: var(--surface-2); }
.live-col h3 { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.jc { border: 1px solid var(--line-2); border-radius: 8px; padding: 9px; background: var(--surface-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.jc[draggable="true"] { cursor: grab; }
.jc.cur { border-left: 3px solid var(--ok); }
.jc select { font-size: 12.5px; border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 5px; background: var(--surface); width: 100%; }
.lifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.lift-tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); align-items: flex-start; }
.lift-tile .lift { font-size: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.kpi b { font-family: var(--f-display); font-size: 36px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--muted); }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--muted); flex-wrap: wrap; }
.alert.bad { border-left-color: var(--bad); } .alert.warn { border-left-color: var(--warn); } .alert.info { border-left-color: var(--info); }
.alert .k { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; min-width: 92px; }
.alert.bad .k { color: var(--bad); } .alert.warn .k { color: var(--warn); } .alert.info .k { color: var(--info); }
.alert .t { flex: 1; min-width: 200px; }
.progress { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 4px 0; }
.cal button { min-height: 66px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); padding: 4px; text-align: left; display: flex; flex-direction: column; gap: 2px; cursor: pointer; font-size: 12px; min-width: 0; overflow: hidden; }
.cal button b { font-size: 14px; }
.cal button.today { border-color: var(--ink); }
.cal button:disabled { background: transparent; color: var(--faint); cursor: default; }
.cal .ab { display: block; background: var(--warn-soft); color: var(--warn); border-radius: 4px; padding: 0 4px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-nav { display: flex; gap: 8px; align-items: center; }

/* gráficos */
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 90px; gap: 10px; align-items: center; font-size: 14px; }
.hbar .track { height: 16px; display: flex; gap: 2px; }
.hbar .seg-a { background: var(--ink); border-radius: 0 4px 4px 0; height: 100%; }
.hbar .seg-a.mid { border-radius: 0; }
.hbar .seg-b { background: var(--c2); border-radius: 0 4px 4px 0; height: 100%; }
.hbar .seg-neg { background: var(--bad); border-radius: 0 4px 4px 0; height: 100%; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 520px) { .hbar { grid-template-columns: 84px minmax(0, 1fr) 74px; font-size: 13px; } }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.split100 { display: flex; gap: 2px; height: 28px; margin: 10px 0 10px; }
.split100 div { height: 100%; }
.split100 div:first-child { border-radius: 4px 0 0 4px; } .split100 div:last-child { border-radius: 0 4px 4px 0; }
.formula { font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--muted); }
.formula b { color: var(--ink); font-weight: 600; }
details summary { cursor: pointer; color: var(--ink); font-weight: 600; font-size: 14px; }
#tip { position: fixed; z-index: 70; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 13px; padding: 6px 9px; border-radius: 6px; max-width: 280px; }
.foot { text-align: center; color: var(--faint); font-size: 13px; margin-top: 30px; }

@media (max-width: 600px) {
  h1 { font-size: 27px; }
  .clock span.d, .brand .sub { display: none; }
  .modal-body { padding: 16px; }
  .plate.xl { font-size: 38px; }
  .big-btn { font-size: 30px; min-height: 112px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
