/* CK (15-oct): app del conductor. Siempre clara (se usa a pleno sol). Los colores de marca los pone app.js con la marca
   del partner: --p (cabecera), --b (botón principal), --bt (texto del botón). Botones de 48 px: se usan con guantes. */
:root {
  --p: #15181D; --b: #FFD500; --bt: #15181D; --b-suave: #FFF5CC;
  --bg: #F4F5F7; --card: #FFFFFF; --ink: #15181D; --ink2: #3A414C; --mut: #5B6370; --line: #E2E5EA; --soft: #F7F8FA;
  --ok: #1E7B3A; --ok-s: #E6F4EA; --mal: #B42318; --mal-s: #FDECEA; --esp: #B45309; --esp-s: #FEF3E2; --az: #1E3A8A; --az-s: #E8EEFC;
  --sans: 'IBM Plex Sans', system-ui, 'Segoe UI', Roboto, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.4 var(--sans); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--az); outline-offset: 2px; }
[hidden] { display: none !important; }
.app { min-height: 100%; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; background: var(--bg); }
.ab { background: var(--p); color: #fff; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; }
.ab .tt { flex: 1; min-width: 0; }
.ab .tt b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab .tt small { color: rgba(255,255,255,.75); font-size: 12px; }
.ab .volver { width: 44px; height: 44px; border: 0; background: rgba(255,255,255,.12); border-radius: 12px; color: #fff; font-size: 22px; flex: none; }
.ab .estado { font-size: 11.5px; background: rgba(255,255,255,.14); border-radius: 999px; padding: 4px 9px; white-space: nowrap; }
.ab .estado.off { background: var(--esp); color: #fff; }
.ab .logo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; background: #fff; flex: none; }
.ab .inicial { width: 32px; height: 32px; border-radius: 8px; background: var(--b); color: var(--bt); display: grid; place-items: center; font: 700 13px var(--mono); flex: none; }
.avance { background: var(--card); border-bottom: 1px solid var(--line); padding: 8px 14px 6px; }
.avance .barras { display: flex; gap: 4px; }
.avance .barras i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.avance .barras i.ok { background: var(--ok); } .avance .barras i.ya { background: var(--b); } .avance .barras i.mal { background: var(--mal); } .avance .barras i.esp { background: #F59E0B; }
.avance .nombres { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--mut); margin-top: 5px; }
.avance .nombres b { color: var(--ink); }
.cu { flex: 1; padding: 14px 14px 140px; display: flex; flex-direction: column; gap: 12px; }
.cargando { color: var(--mut); text-align: center; margin-top: 40px; }
.pie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--card); border-top: 1px solid var(--line); padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 6px; max-width: 560px; margin: 0 auto; }
.pie small { text-align: center; color: var(--mut); font-size: 12px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 0 calc(8px + env(safe-area-inset-bottom, 0px)); max-width: 560px; margin: 0 auto; }
.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--mut); min-height: 48px; }
.tabbar button.on { color: var(--ink); font-weight: 700; }
.tabbar svg { width: 22px; height: 22px; }
.cd { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; display: flex; flex-direction: column; gap: 8px; }
.cd.marca { background: var(--b); border-color: transparent; color: var(--bt); }
.cd.marca .eti { color: var(--bt); opacity: .8; }
.cd.alerta-mal { border: 2px solid var(--mal); }
.cd.alerta-esp { border-color: #F5C77E; }
.cd h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.eti { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.grande { font-size: 20px; font-weight: 700; line-height: 1.25; }
.mono { font-family: var(--mono); }
.placa { font: 700 15px var(--mono); letter-spacing: .08em; border: 2px solid var(--ink); border-radius: 5px; padding: 1px 7px; background: #fff; color: var(--ink); white-space: nowrap; }
.placa.g { font-size: 24px; padding: 3px 12px; border-width: 3px; }
.fl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fl .g { flex: 1; min-width: 0; }
.fl .g small, .lista .g small, .sub { display: block; color: var(--mut); font-size: 12.5px; }
.lista .g { flex: 1; min-width: 0; }
.ch { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.ch.ok { background: var(--ok-s); color: #14532D; } .ch.mal { background: var(--mal-s); color: #8F1B12; } .ch.esp { background: var(--esp-s); color: #7C2D12; } .ch.az { background: var(--az-s); color: var(--az); } .ch.gr { background: #EEF0F3; color: var(--ink2); } .ch.b { background: var(--b); color: var(--bt); }
.bt { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border-radius: 12px; font-weight: 600; font-size: 15.5px; border: 1px solid #D0D5DD; background: #fff; color: var(--ink); padding: 0 14px; text-align: center; width: 100%; }
.bt.pr { background: var(--b); border-color: var(--b); color: var(--bt); }
.bt.ng { background: var(--ink); border-color: var(--ink); color: #fff; }
.bt.mal { background: var(--mal); border-color: var(--mal); color: #fff; }
.bt.lnk { border: 0; background: none; color: var(--ink2); text-decoration: underline; min-height: 40px; font-weight: 500; }
.bt:disabled { opacity: .45; cursor: default; }
.bt.peq { min-height: 40px; font-size: 14px; border-radius: 10px; width: auto; }
.fila-bt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.campo { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--mut); }
.campo input, .campo select, .campo textarea { border: 1.5px solid #D0D5DD; border-radius: 12px; min-height: 52px; padding: 10px 12px; font-size: 18px; color: var(--ink); background: #fff; width: 100%; }
.campo textarea { min-height: 70px; font-size: 15px; }
.campo input:focus, .campo textarea:focus { border-color: var(--ink); outline: none; }
.campo.mono input { font-family: var(--mono); letter-spacing: .06em; }
.alerta { border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; }
.alerta.esp { background: var(--esp-s); color: #6B3405; } .alerta.mal { background: var(--mal-s); color: #7A1A12; } .alerta.ok { background: var(--ok-s); color: #14532D; } .alerta.az { background: var(--az-s); color: #1E3A8A; } .alerta.b { background: var(--b-suave); color: #4A3B00; }
.lista .it { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lista .it:last-child { border-bottom: 0; }
.lista button.it { width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; }
.ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.ico.ok { background: var(--ok); color: #fff; } .ico.mal { background: var(--mal); color: #fff; } .ico.esp { background: var(--esp-s); color: var(--esp); border: 2px solid var(--esp); } .ico.no { background: #EEF0F3; color: var(--mut); }
/* punto de tres estados */
.punto { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.punto:last-child { border-bottom: 0; }
.punto .g { flex: 1; min-width: 0; } .punto .g b { font-size: 15px; } .punto .g small { display: block; color: var(--mut); font-size: 12px; }
.tri { display: inline-grid; grid-template-columns: repeat(3, 46px); gap: 4px; flex: none; }
.tri button { height: 44px; border-radius: 10px; border: 1.5px solid #D0D5DD; background: #fff; font: 700 11px var(--sans); color: var(--mut); padding: 0; }
.tri button[aria-pressed="true"].bien { background: var(--ok); border-color: var(--ok); color: #fff; }
.tri button[aria-pressed="true"].bajo { background: #F59E0B; border-color: #D97706; color: #15181D; }
.tri button[aria-pressed="true"].mal { background: var(--mal); border-color: var(--mal); color: #fff; }
.tri-cab { display: flex; justify-content: flex-end; gap: 4px; font-size: 10px; color: var(--mut); font-weight: 700; letter-spacing: .04em; }
.tri-cab span { width: 46px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips button { min-height: 44px; border: 1.5px solid #D0D5DD; border-radius: 999px; padding: 0 14px; background: #fff; font-size: 14px; }
.chips button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips button.falla { border-color: var(--mal); color: var(--mal); font-weight: 700; background: var(--mal-s); }
.chips button.bien { border-color: var(--ok); color: var(--ok); font-weight: 600; background: var(--ok-s); }
.varilla { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.varilla button { height: 44px; border-radius: 8px; border: 1.5px solid #D0D5DD; background: #EEF0F3; }
.varilla button.on { background: var(--ok); border-color: var(--ok); }
.varilla button.on.bajo { background: #F59E0B; border-color: #D97706; }
.varilla-t { display: flex; justify-content: space-between; font-size: 11px; color: var(--mut); }
.fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.foto { position: relative; border-radius: 10px; height: 84px; overflow: hidden; background: #1F2937; border: 0; padding: 0; color: #fff; }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto span { position: absolute; left: 5px; bottom: 4px; right: 5px; font-size: 10.5px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.7); text-align: left; }
.foto.falta { border: 2px dashed #C9CED6; background: var(--card); color: var(--ink2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; }
.foto.falta b { font-size: 22px; color: var(--mut); line-height: 1; }
.foto.falta.req { border-color: var(--mal); color: var(--mal); }
.dibujo { background: var(--soft); border-radius: 12px; padding: 6px; }
.dibujo svg { width: 100%; height: auto; display: block; }
.dibujo .rueda { cursor: pointer; }
.firma { width: 100%; height: 150px; border: 1.5px dashed #C9CED6; border-radius: 12px; background: #fff; touch-action: none; display: block; }
.anillo { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.anillo span { width: 48px; height: 48px; border-radius: 50%; background: #fff; display: grid; place-items: center; font: 700 13px var(--mono); }
.hoja-fondo { position: fixed; inset: 0; background: rgba(21,24,29,.5); z-index: 40; }
.hoja { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--card); border-radius: 20px 20px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; max-height: 88%; overflow: auto; max-width: 560px; margin: 0 auto; }
.hoja .asa { width: 40px; height: 4px; border-radius: 2px; background: #D5D9E0; align-self: center; }
.hoja h2 { margin: 0; font-size: 18px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.error { background: #7A1A12; }
.centro { text-align: center; align-items: center; }
.n-logo { width: 72px; height: 72px; border-radius: 20px; background: var(--ink); display: grid; place-items: center; }
.cod-entrada input { text-transform: uppercase; text-align: center; font: 700 26px var(--mono) !important; letter-spacing: .3em; }
.kpis3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.kpis3 b { display: block; font: 700 22px var(--mono); }
.kpis3 small { color: var(--mut); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
