/* 4PL Veintiséis87 · App del operador de última milla (móvil, alto contraste para uso en calle) */
:root {
  color-scheme: light;
  /* Colores institucionales de Veintiséis87 (azul #008FBE, verde #00A887) y sus tonos oscuros para texto y botones */
  --azul: #008FBE; --verde: #00A887; --navy: #063a4f; --navy-2: #0a4a63; --navy-50: #eaf5f9; --green: #00866c; --green-50: #e3f6f0; --noche: #011329; --marino: #061a35;
  --ink: #0d1117; --ink-2: #3f4852; --ink-3: #6b7480; --line: #e2ddd1; --bg: #f4efe3; --surface: #fbf8f1;
  --good: #0ca30c; --good-bg: #e7f6e7; --good-ink: #0a6b0a; --warn: #fab219; --warn-bg: #fff4d6; --warn-ink: #7a5000;
  --crit: #d03b3b; --crit-bg: #fdecec; --crit-ink: #a22323; --info: #2a78d6; --info-bg: #e8f1fc; --info-ink: #1c5cab;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 16px; line-height: 1.4; color: var(--ink); background: var(--bg) url('../assets/marca/marca-agua.svg') center / 360px repeat fixed; overscroll-behavior-y: contain; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.oculto { display: none !important; }
svg.ic { width: 20px; height: 20px; flex: none; }

/* Barra superior */
.barra { position: sticky; top: 0; z-index: 20; background: radial-gradient(140% 220% at 0% 0%, #0b2545 0%, var(--marino) 45%, var(--noche) 100%); color: #fff; padding: 8px 14px; display: flex; align-items: center; gap: 10px; min-height: 58px; }
.barra::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--azul), var(--verde)); }
.barra img, .barra .logo { width: 40px; height: 40px; flex: none; }
.barra .t { line-height: 1.15; min-width: 0; }
.barra .t b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra .t span { font-size: 12.5px; color: #b7c6d8; }
.barra .der { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.chip-red { font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 999px; display: inline-flex; gap: 5px; align-items: center; background: rgba(255,255,255,.12); }
.chip-red i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.chip-red.off i { background: #fbbf24; }
.env-qa { background: #fde68a; color: #6b4b00; font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 5px; }
.btn-barra { background: rgba(255,255,255,.12); border: 0; color: #fff; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }

main#vista { padding: 14px 14px calc(96px + var(--safe-b)); max-width: 720px; margin: 0 auto; }
h1.v { font-size: 22px; margin: 4px 0 4px; letter-spacing: -.01em; }
p.sub { margin: 0 0 14px; color: var(--ink-2); }

/* Tarjetas, listas, botones */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card h2 { font-size: 15px; margin: 0 0 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid #c9d2dc; background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.pri { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn.mal { background: var(--surface); border-color: #efb5b5; color: var(--crit-ink); }
.btn.ancho { width: 100%; }
.btn.grande { min-height: 58px; font-size: 17px; }
.btn.chico { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.botones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.botones.tres { grid-template-columns: 1fr 1fr 1fr; }
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.campo label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
input:not([type]), input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea { min-height: 50px; padding: 0 14px; border: 1px solid #c9d2dc; border-radius: 12px; background: var(--surface); width: 100%; font-size: 17px; }
textarea { padding: 12px 14px; min-height: 90px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid #7aa7db; outline-offset: 1px; }
.pin { font-family: var(--mono); font-size: 26px; letter-spacing: .4em; text-align: center; }

.pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.bien { background: var(--good-bg); color: var(--good-ink); } .pill.aviso { background: var(--warn-bg); color: var(--warn-ink); }
.pill.mal { background: var(--crit-bg); color: var(--crit-ink); } .pill.info { background: var(--info-bg); color: var(--info-ink); }
.pill.gris { background: #eceff3; color: #4f5862; } .pill.navy { background: var(--navy-50); color: var(--navy-2); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }

.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 15px; }
.aviso.info { background: var(--info-bg); color: var(--info-ink); } .aviso.warn { background: var(--warn-bg); color: var(--warn-ink); } .aviso.mal { background: var(--crit-bg); color: var(--crit-ink); } .aviso.ok { background: var(--good-bg); color: var(--good-ink); }

.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; display: flex; gap: 12px; align-items: center; }
.lista > li.clic { cursor: pointer; }
.lista > li .n { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; font-size: 14px; }
.lista > li .n.ok { background: var(--good); } .lista > li .n.exc { background: var(--warn); color: #3b2a00; } .lista > li .n.pend { background: var(--crit); } .lista > li .n.gris { background: #aab3bd; }
.lista > li .cuerpo { min-width: 0; flex: 1; }
.lista > li .cuerpo b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista > li .cuerpo span { font-size: 13.5px; color: var(--ink-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista > li .der { margin-left: auto; text-align: right; flex: none; }
.lista > li.arrastrando { opacity: .6; border-style: dashed; }
.asa { width: 28px; height: 40px; display: grid; place-items: center; color: var(--ink-3); cursor: grab; touch-action: none; flex: none; }

.pasos { counter-reset: p; list-style: none; padding: 0; margin: 0 0 12px; }
.pasos li { counter-increment: p; display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.pasos li::before { content: counter(p); width: 28px; height: 28px; border-radius: 50%; background: var(--navy-50); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.pasos li.hecho::before { content: "✓"; background: var(--good); color: #fff; }
.pasos li.actual::before { background: var(--navy); color: #fff; }

/* Parada actual */
.actual { background: var(--surface); border: 2px solid var(--navy); border-radius: 16px; padding: 16px; margin-bottom: 12px; box-shadow: 0 6px 20px rgba(6, 58, 79, .12); }
.actual .cab { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.actual h2 { font-size: 21px; margin: 6px 0 2px; line-height: 1.25; }
.actual .dest { font-size: 16px; color: var(--ink-2); margin-bottom: 6px; }
.actual .refs { background: #fffbea; border-left: 3px solid var(--warn); padding: 8px 10px; border-radius: 8px; font-size: 14.5px; margin: 8px 0; }
.acciones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.acciones .btn { flex-direction: column; gap: 4px; min-height: 64px; padding: 6px; font-size: 12.5px; border-radius: 12px; }
.acciones .btn svg { width: 22px; height: 22px; }

/* Progreso */
.progreso { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 12px; }
.progreso .b { flex: 1; height: 10px; border-radius: 5px; background: #e3e8ee; position: relative; overflow: hidden; }
.progreso .b i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--good); border-radius: 5px; }
.progreso .b b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); }

/* Navegación inferior */
nav.abajo { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + var(--safe-b)); }
nav.abajo button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 6px 0; cursor: pointer; position: relative; }
nav.abajo button.activo { color: var(--navy); }
nav.abajo button svg { width: 24px; height: 24px; }
nav.abajo button .badge { position: absolute; top: 0; right: calc(50% - 22px); background: var(--crit); color: #fff; font-size: 10.5px; border-radius: 999px; padding: 0 5px; min-width: 18px; }

/* Hojas (modales inferiores) */
.velo { position: fixed; inset: 0; background: rgba(13, 17, 23, .45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.hoja { background: var(--surface); width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 8px 16px calc(18px + var(--safe-b)); animation: sube .18s ease-out; }
.hoja .asa-h { width: 44px; height: 5px; border-radius: 3px; background: #cfd6de; margin: 6px auto 10px; }
.hoja h3 { margin: 0 0 10px; font-size: 19px; }
@keyframes sube { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.opciones button { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 13px 14px; margin-bottom: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.opciones button.sel { border: 2px solid var(--navy); background: var(--navy-50); }
.opciones button b { display: block; }
.opciones button span { font-size: 13.5px; color: var(--ink-3); }
.check { display: flex; gap: 10px; align-items: center; padding: 10px 0; font-size: 16px; }
.check input { width: 22px; height: 22px; }

/* Escáner */
.escaner { position: relative; background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 3 / 4; max-height: 56vh; margin-bottom: 12px; }
.escaner video { width: 100%; height: 100%; object-fit: cover; }
.escaner .mira { position: absolute; left: 8%; right: 8%; top: 32%; height: 30%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); }
.escaner .estado { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 12px 14px; border-radius: 12px; font-weight: 600; color: #fff; background: rgba(6,58,79,.9); }
.escaner .estado.ok { background: rgba(10, 107, 10, .92); } .escaner .estado.warn { background: rgba(122, 80, 0, .92); } .escaner .estado.mal { background: rgba(162, 35, 35, .92); }
.contador { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }

/* Mapa */
.mapa-app { height: calc(100vh - 56px - 74px - 120px); min-height: 360px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #e6ebf0; }
.mk { width: 30px; height: 30px; border-radius: 50%; color: #fff; font: 700 12px var(--sans); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.yo { width: 18px; height: 18px; border-radius: 50%; background: #2a78d6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(42,120,214,.25); }

.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(86px + var(--safe-b)); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #0f1a26; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 15px; max-width: 560px; box-shadow: 0 10px 24px rgba(0,0,0,.25); animation: sube .18s ease-out; }
.toast.ok { background: #0b5d2c; } .toast.mal { background: #8b1e1e; } .toast.warn { background: #6b4b00; }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(0,0,0,.15); border-top-color: var(--navy); border-radius: 50%; display: inline-block; animation: gira .8s linear infinite; vertical-align: middle; }
@keyframes gira { to { transform: rotate(360deg); } }
.grande-num { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.kpi .e { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.kpi .v { font-size: 26px; font-weight: 800; }
.segmentos { display: flex; background: #e6ebf0; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.segmentos button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 10px 6px; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.segmentos button.activo { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.foto-prev { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin: 6px 0 10px; }

/* Buscador de la lista y escáner dentro de una hoja */
.buscar { margin: 12px 0 0; }
.escaner.chico { aspect-ratio: 4 / 3; margin-bottom: 10px; }

/* ───── Marca 4PL Veintiséis87 ───── */
.marca-hero { background: radial-gradient(130% 160% at 20% 30%, #0b2545 0%, #061a35 48%, #011329 100%); border-radius: 18px; padding: 16px 14px; margin: 0 0 18px; position: relative; overflow: hidden; }
.marca-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--azul), var(--verde)); }
picture.m { display: contents; }
.marca-hero img { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; }
.espera { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 10px; color: var(--ink-3); font-weight: 600; font-size: 14.5px; text-align: center; }
.espera img { width: 84px; height: 84px; }
.btn.pri .spinner, .btn.ok .spinner, .btn.mal .spinner { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
/* Pantalla de inicio: una vez por sesión, un toque la quita */

/* Cuentas de muestra (sólo pruebas) */
.card.demo { border: 1px dashed #e6c766; background: #fffbea; margin-top: 14px; }
.demo-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card.demo .lista { margin: 0; }

/* 2.0 · entrega con requisitos del cliente (OXXO: firma, lista de colocación, fotos adicionales) */
canvas.firma { width: 100%; height: 170px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; display: block; margin-bottom: 6px; }
.chk-item { padding: 4px 0; border-top: 1px dashed var(--line); }
.chk-item:first-of-type { border-top: 0; }
.chk-item .nota-ck { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; margin: 2px 0 6px; font-size: 14px; }
.extras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.extras img.foto-prev { margin: 0; height: 90px; object-fit: cover; }

/* Firma de APX Vektr: sólo en la pantalla de acceso (marca/ESTANDAR-DE-MARCA.md) */
.apx { margin: 16px 0 0; text-align: center; font-size: 11.5px; letter-spacing: .04em; color: var(--ink-3); }
