:root {
  --azul: #0B2545; --azul2: #13315C; --celeste: #5BC0EB; --celeste-claro: #E6F5FC; --coral: #F28C6B;
  --fondo: #F4F8FB; --texto: #0B2545; --gris: #4F6478; --linea: #D5DCE6; --rojo: #C62828; --verde: #2E7D32;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
.barra { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--azul); color: #fff; }
.barra h1 { flex: 1; margin: 0; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icono { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 20px; font-weight: 700; }
.estado { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--coral); color: var(--azul); font-weight: 700; }
main { padding: 16px 14px 120px; max-width: 640px; margin: 0 auto; }
.cargando { text-align: center; color: var(--gris); margin-top: 40px; }
.tarjeta { background: #fff; border-radius: 16px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(11,37,69,.08); }
.grande { display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px; border: 0; border-radius: 16px; background: var(--azul); color: #fff; font-size: 20px; font-weight: 700; text-align: left; margin-bottom: 12px; }
.grande small { display: block; font-size: 14px; font-weight: 400; opacity: .85; }
.grande.claro { background: #fff; color: var(--azul); box-shadow: 0 1px 2px rgba(11,37,69,.12); }
.grande .ico { font-size: 28px; width: 36px; text-align: center; }
.cifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.cifra { background: #fff; border-radius: 14px; padding: 10px 6px; text-align: center; border: 0; }
.cifra b { display: block; font-size: 24px; }
.cifra span { font-size: 12px; color: var(--gris); }
label.campo { display: block; font-weight: 700; margin: 14px 0 6px; }
label.campo small { font-weight: 400; color: var(--gris); }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; padding: 13px 14px; border: 2px solid var(--linea); border-radius: 12px; background: #fff; font-size: 18px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--celeste); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 10px 14px; border-radius: 99px; border: 2px solid var(--linea); background: #fff; font-weight: 600; font-size: 16px; }
.chip.si { background: var(--azul); border-color: var(--azul); color: #fff; }
.boton { display: block; width: 100%; padding: 16px; border: 0; border-radius: 14px; background: var(--azul); color: #fff; font-size: 19px; font-weight: 700; margin-top: 18px; }
.boton.sec { background: #fff; color: var(--azul); border: 2px solid var(--azul); }
.boton.peligro { background: #fff; color: var(--rojo); border: 2px solid var(--rojo); }
.boton:disabled { opacity: .5; }
.foto-caja { display: flex; align-items: center; gap: 14px; }
.foto-prev { width: 96px; height: 96px; border-radius: 14px; background: var(--celeste-claro) center/cover no-repeat; display: grid; place-items: center; font-size: 34px; color: var(--azul2); flex: none; }
.fila { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--linea); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.fila .mini { width: 52px; height: 52px; border-radius: 10px; background: var(--celeste-claro) center/cover no-repeat; flex: none; display: grid; place-items: center; color: var(--azul2); }
.fila .txt { flex: 1; min-width: 0; }
.fila .txt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila .txt span { font-size: 14px; color: var(--gris); }
.fila input[type=number] { width: 104px; flex: none; text-align: right; padding: 10px; }
.etq { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #FDECE6; color: #8A3418; margin-left: 4px; }
.etq.ok { background: #E3F2E5; color: var(--verde); }
.nota { color: var(--gris); font-size: 15px; }
.aviso { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--azul); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 30; max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.aviso.error { background: var(--rojo); }
.dialogo-fondo { position: fixed; inset: 0; background: rgba(11,37,69,.55); z-index: 40; display: grid; place-items: end center; padding: 16px; }
.dialogo { background: #fff; border-radius: 18px; padding: 20px; width: 100%; max-width: 560px; }
.dialogo h2 { margin: 0 0 8px; font-size: 20px; }
.dialogo .boton { margin-top: 10px; }
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.interruptor input { width: 26px; height: 26px; }
/* Guía paso a paso */
.guia-resalte { outline: 4px solid #E53935 !important; outline-offset: 3px; border-radius: 12px; position: relative; z-index: 21; }
.guia { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 22; background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.3); border-top: 6px solid #E53935; max-width: 600px; margin: 0 auto; }
.guia p { margin: 0 0 12px; font-size: 17px; }
.guia .pie { display: flex; align-items: center; gap: 10px; }
.guia .pie span { flex: 1; color: var(--gris); font-size: 14px; }
.guia .x { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 22px; color: var(--gris); }
.guia button.sig { padding: 10px 18px; border-radius: 12px; border: 0; background: var(--azul); color: #fff; font-weight: 700; }
/* Timón: inicio por módulos */
.hola { font-size: 24px; font-weight: 800; margin: 4px 0 14px; }
.modulos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.modulo { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border: 0; border-radius: 18px; background: #fff; color: var(--azul); text-align: left; box-shadow: 0 1px 2px rgba(11,37,69,.12); min-height: 132px; }
.modulo .ico { font-size: 30px; }
.modulo b { font-size: 18px; line-height: 1.2; }
.modulo small { font-size: 14px; color: var(--gris); }
.modulo:first-child { background: var(--azul); color: #fff; } .modulo:first-child small { color: rgba(255,255,255,.8); }
.marca { text-align: center; color: var(--gris); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-top: 24px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.resumen { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--linea); }
.fila.anulada .txt { text-decoration: line-through; opacity: .55; }
.fila a.mini { flex: none; }
.sec-tit { display: flex; align-items: center; gap: 8px; padding: 8px 4px; font-size: 18px; }
.fila-abrir { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; background: none; border: 0; text-align: left; padding: 0; }
.sw { width: 26px; height: 26px; flex: none; accent-color: var(--azul); }
.grande-foto { width: 130px; height: 98px; }
.op-fila { display: grid; grid-template-columns: 1fr 120px; gap: 8px; margin-bottom: 8px; }
textarea { resize: vertical; }
.lista-cort .fila .txt b { white-space: normal; }

/* ---------- Compras, caja y PIN (27 nov) ---------- */
.fotos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.foto-nota { position: relative; width: 92px; height: 120px; border-radius: 12px; background: var(--celeste-claro) center/cover no-repeat; display: grid; place-items: center; font-size: 30px; }
.foto-nota .quitar { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--rojo); color: #fff; font-weight: 700; }
.renglon { border: 2px solid var(--linea); border-radius: 14px; padding: 10px; margin-top: 10px; background: #fff; }
.renglon.dudoso { border-color: var(--coral); background: #FFF6F2; }
.tres { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 8px 0; }
.tres select, .tres input { padding: 11px 8px; font-size: 16px; }
.chips.chico .chip { padding: 6px 10px; font-size: 14px; }
.quitar-renglon { border: 0; background: none; color: var(--rojo); font-size: 14px; padding: 8px 0 0; }
.etq-nuevo { color: #8A3418 !important; font-size: 13px; margin: 4px 0 0; }
.saldo { text-align: center; }
.saldo b { display: block; font-size: 38px; margin: 4px 0; }
.alerta { border-left: 6px solid var(--rojo); }
input.pin { font-size: 34px; letter-spacing: 14px; text-align: center; }
.grupo-reemb { margin: 8px 0 14px; }
.fila .sw { margin-right: 4px; }

/* ---------- Paleta Timón: fondo azul con toques salmón y celeste (27 nov) ---------- */
:root { --fondo: #0B2545; }
.barra { background: #081B33; border-bottom: 3px solid var(--coral); }
main { color: #EAF2F8; }
main .nota, main .cargando { color: #B9CCDD; }
main .marca { color: #8FA8C0; }
.tarjeta, .dialogo, .modulo, .cifra, .grande.claro, .fila, .renglon, .chip, input, select, textarea { color: var(--texto); }
.tarjeta .nota, .dialogo .nota, .renglon .nota, .cifra span { color: var(--gris); }
.grande, .boton { background: var(--coral); color: var(--azul); }
.grande small { opacity: .9; }
.boton.sec { background: #fff; color: var(--azul); border-color: var(--azul); }
main > .dos > .boton.sec { border-color: #fff; }
.modulo:first-child { background: var(--coral); color: var(--azul); } .modulo:first-child small { color: var(--azul2); }
.chip.si { background: var(--azul); border-color: var(--azul); color: #fff; }
main > .chips .chip { border-color: transparent; }
main > .chips .chip.si { background: var(--coral); border-color: var(--coral); color: var(--azul); }
#cj-botones { margin-bottom: 14px; }

/* ---------- Alta con mínimos, máximos y proveedores (30 nov) ---------- */
.dos input { width: 100%; }
.nota a { color: var(--azul); font-weight: 600; }

/* ---------- Modo tableta, pedido alfabético y merma libre (3 dic) ---------- */
.terminar { border: 0; border-radius: 99px; padding: 9px 14px; background: var(--coral); color: var(--azul); font-weight: 800; font-size: 15px; white-space: nowrap; }
body.modo-tableta #btn-ayuda { display: none; }
body.modo-tableta main { max-width: 760px; }
.pin-caja { text-align: center; margin: 24px auto 0; max-width: 380px; }
.pin-tit { font-size: 26px; font-weight: 800; margin: 0 0 18px; color: #fff; }
.pin-puntos { display: flex; justify-content: center; gap: 18px; margin-bottom: 8px; }
.pin-puntos span { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #fff; }
.pin-puntos span.lleno { background: var(--coral); border-color: var(--coral); }
.pin-puntos.sacude { animation: sacude .35s; }
@keyframes sacude { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.pin-msg { min-height: 24px; color: var(--coral) !important; font-weight: 700; }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 8px; }
.teclado button { height: 78px; border-radius: 20px; border: 0; background: #fff; color: var(--azul); font-size: 32px; font-weight: 800; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.teclado button:active { background: var(--coral); }
.teclado button[data-borrar] { background: transparent; color: #fff; box-shadow: none; }
.salir-tableta { display: block; margin: 40px auto 0; border: 0; background: none; color: #8FA8C0; font-size: 14px; text-decoration: underline; }
.botonera .grande { min-height: 84px; }
.tarjeta.listo { border-left: 6px solid var(--verde); }
.pd-buscar { position: sticky; top: 63px; z-index: 4; background: var(--fondo); padding: 6px 0 8px; margin: 0 0 8px; }
.letras { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.letras button { min-width: 34px; height: 34px; border: 0; border-radius: 8px; background: rgba(255,255,255,.14); color: #fff; font-weight: 700; font-size: 15px; }
.pd-letra { font-weight: 800; color: var(--coral); padding: 10px 4px 2px; scroll-margin-top: 170px; }
.pd-fila { padding: 8px 4px; }
.pd-fila.pedido { background: #FFF3EE; }
.pd-fila.pedido input { border-color: var(--coral); font-weight: 800; }
.pd-pie { position: sticky; bottom: 0; z-index: 4; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; background: var(--fondo); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); }
.pd-pie .boton { margin: 0; }
.pd-pie .chip { border-color: transparent; }
#pd-notas { margin-top: 4px; }
.renglon.libre { border-style: dashed; }
.cruce { font-size: 14px !important; margin: 2px 0 6px; }
.cruce.ok { color: var(--verde) !important; }
.cruce.alerta { color: #8A3418 !important; font-weight: 600; }
.pd-u { width: 58px; flex: none; font-size: 14px; color: var(--gris); }
.pd-fila input[type=number] { width: 96px; }
.pin-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 380px; margin: 26px auto 0; }
.pin-extra .boton { margin: 0; font-size: 16px; padding: 12px; }
.pin-extra.uno { grid-template-columns: 1fr; }
