/* Hielo Aspe · app de operación. Identidad tomada de hieloaspe.mx: azul marino de marca, azul medio,
   verde solo para acciones de venta, fondos "hielo". Poppins en títulos, Open Sans en texto.
   Layout: móvil primero con barra inferior; desde 900px barra lateral (oficina y dueño). */
:root {
  --brand-900: #0d2d6c; --brand-800: #093a7e; --brand-600: #0054a6; --brand-300: #7cb3e4; --brand-200: #b3d3f1; --brand-50: #eef5fc;
  --go: #1fa348; --go-hover: #15803d; --go-soft: #e6f5ea;
  --bg: #f6f7f8; --surface: #ffffff; --surface-2: #f3f5f5; --line: #e4ecf2;
  --ink: #0d2d6c; --text: #494b51; --muted: #6b7280;
  --ok: #15803d; --ok-bg: #e6f5ea; --warn: #b45309; --warn-bg: #fdf3e2; --crit: #c22e2e; --crit-bg: #fbe7e7; --info-bg: #eef5fc;
  --shadow: 0 1px 2px #0d2d6c0f, 0 8px 24px -8px #0d2d6c24;
  --shadow-lg: 0 2px 4px #0d2d6c14, 0 20px 44px -12px #0d2d6c38;
  --r-card: 20px; --r-ctl: 14px;
  --font-head: "Poppins", system-ui, sans-serif;
  --font: "Open Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t-tap: 120ms; --t-state: 200ms; --ease: cubic-bezier(.16,1,.3,1);
  --nav-h: 68px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0a1426; --surface: #111e36; --surface-2: #17274a; --line: #22355c;
  --ink: #e6efff; --text: #c4d0e4; --muted: #8b9ab6; --brand-50: #14254a; --brand-200: #3b5c94;
  --go-soft: #123a24; --ok: #5dd58f; --ok-bg: #12301f; --warn: #f0b24a; --warn-bg: #33270f; --crit: #ff8080; --crit-bg: #3a1818; --info-bg: #14254a;
  --shadow: 0 1px 2px #0006, 0 8px 24px -8px #0008; --shadow-lg: 0 20px 44px -12px #000a; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0a1426; --surface: #111e36; --surface-2: #17274a; --line: #22355c;
  --ink: #e6efff; --text: #c4d0e4; --muted: #8b9ab6; --brand-50: #14254a; --brand-200: #3b5c94;
  --go-soft: #123a24; --ok: #5dd58f; --ok-bg: #12301f; --warn: #f0b24a; --warn-bg: #33270f; --crit: #ff8080; --crit-bg: #3a1818; --info-bg: #14254a;
  --shadow: 0 1px 2px #0006, 0 8px 24px -8px #0008; --shadow-lg: 0 20px 44px -12px #000a; color-scheme: dark; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 26px; font-weight: 700; } h2 { font-size: 20px; font-weight: 600; } h3 { font-size: 16px; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; } /* iOS no hace zoom */
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand-300); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left)); background:
  radial-gradient(circle at 20% 10%, #ffffff12 0 2px, transparent 3px) 0 0/34px 34px, linear-gradient(160deg, var(--brand-900), var(--brand-800) 55%, var(--brand-600)); }
.login-card { width: min(100%, 400px); background: var(--surface); border-radius: 28px; padding: 28px 22px 22px; box-shadow: var(--shadow-lg); }
.login-card .logo { display: block; width: 150px; margin: 0 auto 6px; }
.login-card p.sub { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .lbl { font-size: 13px; font-weight: 600; color: var(--ink); }
.input { width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); transition: border-color var(--t-state); }
.input:focus { border-color: var(--brand-600); outline: none; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 6px 0 14px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brand-600); }
.pin-dots span.on { background: var(--brand-600); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { min-height: 60px; border: 0; border-radius: 16px; background: var(--surface-2); font: 600 24px var(--font-head); color: var(--ink); transition: transform var(--t-tap) var(--ease), background var(--t-tap); }
.keypad button:active { transform: scale(.96); background: var(--brand-50); }
.keypad .k-alt { font-size: 15px; font-family: var(--font); }
.login-err { min-height: 22px; color: var(--crit); text-align: center; font-size: 14px; font-weight: 600; margin: 8px 0 0; }

/* ---------- Estructura ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--brand-900); color: #fff;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 12px; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--brand-900); }
.topbar .logo { height: 34px; width: auto; }
.topbar .who { flex: 1; min-width: 0; line-height: 1.2; }
.topbar .who b { display: block; font: 600 15px var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who small { color: var(--brand-200); font-size: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #ffffff1f; border: 1px solid #ffffff38; color: #fff; white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #61ce70; }
.chip.off .dot { background: #f0b24a; } .chip.bad .dot { background: #ff8080; }
button.chip { cursor: pointer; }
.iconbtn { border: 0; background: #ffffff1f; color: #fff; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.iconbtn svg { width: 20px; height: 20px; }
.main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); box-shadow: 0 -8px 24px -16px #0d2d6c40; }
.nav button { flex: 1; border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; color: var(--muted); font-size: 11.5px; font-weight: 600; min-height: 54px; }
.nav button svg { width: 24px; height: 24px; }
.nav button[aria-current="page"] { color: var(--brand-600); background: var(--brand-50); }
.nav .badge { position: absolute; transform: translate(14px, -4px); background: var(--crit); color: #fff; font-size: 10px; border-radius: 999px; padding: 0 5px; }
@media (min-width: 900px) {
  .app.wide { flex-direction: row; flex-wrap: wrap; }
  .app.wide .topbar { width: 100%; }
  .app.wide .nav { position: sticky; top: 60px; align-self: flex-start; flex-direction: column; width: 220px; height: calc(100vh - 60px); border-top: 0; border-right: 1px solid var(--line); box-shadow: none; padding: 16px 12px; gap: 4px; }
  .app.wide .nav button { flex: none; grid-template-columns: 24px 1fr; justify-items: start; align-items: center; gap: 12px; font-size: 14px; padding: 10px 12px; min-height: 46px; text-align: left; }
  .app.wide .main { flex: 1; min-width: 0; padding-bottom: 40px; }
}

/* ---------- Componentes ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .v { font: 700 clamp(20px, 2.1vw, 26px)/1.15 var(--font-head); color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 4px; white-space: nowrap; }
.kpi .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.go .v { color: var(--go); }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--brand-600); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; transition: transform var(--t-tap) var(--ease), background var(--t-state); }
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn.primary:hover { background: var(--brand-900); }
.btn.go { background: var(--go); border-color: var(--go); color: #fff; }
.btn.go:hover { background: var(--go-hover); }
.btn.danger { color: var(--crit); border-color: var(--crit-bg); background: var(--crit-bg); }
.btn.big { min-height: 64px; font-size: 19px; width: 100%; border-radius: 20px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.contado { background: var(--ok-bg); color: var(--ok); } .pill.credito { background: var(--warn-bg); color: var(--warn); }
.pill.pend { background: var(--warn-bg); color: var(--warn); } .pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.cancel { background: var(--crit-bg); color: var(--crit); }
.pill.demo { background: var(--info-bg); color: var(--brand-600); }
.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.search .input { padding-left: 44px; min-height: 54px; border-radius: 18px; }
.list { display: grid; gap: 10px; }
.item { width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-height: 72px; box-shadow: var(--shadow); transition: transform var(--t-tap) var(--ease); }
button.item:active { transform: scale(.985); }
.item .av { width: 44px; height: 44px; border-radius: 14px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; font: 700 16px var(--font-head); flex: none; }
.item .body { flex: 1; min-width: 0; }
.item .t { display: block; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.item .m { display: block; font-size: 13.5px; color: var(--muted); }
.item .r { text-align: right; flex: none; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; border: 1.5px dashed var(--line); border-radius: var(--r-card); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; color: var(--muted); min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--brand-600); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.note { font-size: 13.5px; color: var(--muted); }
.warnbox { background: var(--warn-bg); color: var(--text); border-radius: 14px; padding: 10px 14px; font-size: 14px; }
.infobox { background: var(--info-bg); border-radius: 14px; padding: 10px 14px; font-size: 14px; }

/* ---------- Venta ---------- */
.sale-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.qty { display: grid; gap: 10px; }
.qrow { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 12px; box-shadow: var(--shadow); }
.qrow .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.qrow .top b { color: var(--ink); font-family: var(--font-head); }
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; align-items: center; }
.stepper button { height: 64px; border-radius: 18px; border: 0; background: var(--brand-50); color: var(--brand-600); font: 700 30px var(--font-head); transition: transform var(--t-tap) var(--ease); }
.stepper button:active { transform: scale(.94); }
.stepper input { height: 64px; text-align: center; font: 700 30px var(--font-head); border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); width: 100%; min-width: 0; }
.quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick button { flex: 1; min-height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; color: var(--ink); min-width: 56px; }
.totalbar { position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 12px; box-shadow: var(--shadow-lg); }
.totalbar .tt { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; padding: 0 4px; }
.totalbar .tt b { font: 700 30px var(--font-head); color: var(--ink); }
.done { text-align: center; padding: 18px 8px; }
.done .check { width: 76px; height: 76px; border-radius: 50%; background: var(--go); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; }
.done .check svg { width: 42px; height: 42px; }

/* ---------- Ticket (vista previa) ---------- */
.ticket { font: 13px/1.35 var(--mono); background: #fffef9; color: #111; padding: 14px 12px; border-radius: 6px; white-space: pre; overflow-x: auto; box-shadow: inset 0 0 0 1px #0001; margin: 0 auto; width: max-content; max-width: 100%; }
.ticket + .ticket { margin-top: 12px; }

/* ---------- Firma ---------- */
.sign { position: relative; border: 2px dashed var(--brand-300); border-radius: 18px; background: #fff; touch-action: none; }
.sign canvas { display: block; width: 100%; height: 200px; border-radius: 16px; }
.sign .hint { position: absolute; inset: auto 0 10px; text-align: center; color: #94a3b8; font-size: 13px; pointer-events: none; }

/* ---------- Modal y avisos ---------- */
.backdrop { position: fixed; inset: 0; background: #0d2d6c66; z-index: 50; display: grid; align-items: end; justify-items: center; }
.sheet { width: min(100%, 560px); max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 26px 26px 0 0; padding: 18px max(16px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); box-shadow: var(--shadow-lg); animation: up 280ms var(--ease); }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 26px; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet .sh { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.x { border: 0; background: var(--surface-2); width: 40px; height: 40px; border-radius: 12px; font-size: 20px; color: var(--ink); }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--brand-900); color: #fff; padding: 12px 18px; border-radius: 16px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); animation: up 240ms var(--ease); }
.toast.bad { background: var(--crit); } .toast.ok { background: var(--go-hover); }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sh 1.4s infinite; border-radius: 14px; height: 72px; }
@keyframes sh { to { background-position: -200% 0; } }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--go); box-shadow: 0 0 0 0 #1fa34866; animation: pulse 2s infinite; }
.live.off i { background: var(--warn); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px #1fa34800; } }
.map { height: 360px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.split { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .split { grid-template-columns: 1.4fr 1fr; } }
.firma-mini { height: 36px; width: auto; background: #fff; border-radius: 6px; border: 1px solid var(--line); }
.hide-sm { } @media (max-width: 640px) { .hide-sm { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand-600); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 0; }
#area-impresion { display: none; }
@media print {
  body > *:not(#area-impresion) { display: none !important; }
  #area-impresion { display: block; }
  #area-impresion pre { font: 13px/1.35 'Courier New', monospace; color: #000; margin: 0 auto; width: max-content; white-space: pre; page-break-after: always; break-after: page; }
  #area-impresion pre:last-child { page-break-after: auto; break-after: auto; }
  @page { margin: 15mm; }
}
/* Almacén: tarjeta por planta */
.card.planta { display: grid; gap: 14px; margin-bottom: 16px; }
.card.planta h3 { font: 600 15px/1.3 var(--font-head); color: var(--ink); margin: 4px 0 -4px; }
.card.planta .ahora { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; padding: 16px; border-radius: 18px; background: var(--brand-50); }
.card.planta .ahora .k { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-600); }
.card.planta .grande { font: 700 40px/1.05 var(--font-head); color: var(--ink); }
.card.planta .grande small { font: 600 15px var(--font); color: var(--muted); }
.card.planta .chips-pres { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; }
.card.planta .chips-pres b { color: var(--ink); }
.card.planta tr.tot td { font-weight: 700; border-top: 2px solid var(--line); }
:root[data-theme="dark"] .card.planta .ahora { background: rgba(124,179,228,.10); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card.planta .ahora { background: rgba(124,179,228,.10); } }
.card.planta .tablewrap { box-shadow: none; }
.card.planta th { letter-spacing: .02em; padding: 9px 8px; }
.card.planta td { padding: 10px 8px; }
.card.planta th:first-child, .card.planta td:first-child { padding-left: 12px; }
.card.planta th:last-child, .card.planta td:last-child { padding-right: 12px; }
/* Dirección: franjas por planta en el tablero */
.franjas { display: grid; gap: 8px; margin-bottom: 14px; }
@media (min-width: 900px) { .franjas { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); } }
.franja { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); font-size: 14px; color: var(--muted); }
.franja > b { color: var(--ink); font-family: var(--font-head); font-size: 15px; margin-right: auto; }
.franja span b { color: var(--ink); font-size: 16px; }
/* Almacén: plantas lado a lado en pantalla ancha */
.plantas { display: grid; gap: 16px; }
@media (min-width: 1100px) { .plantas { grid-template-columns: 1fr 1fr; align-items: start; } .plantas .card.planta { margin-bottom: 0; } }
.card.planta .grande { font-size: clamp(30px, 3.2vw, 40px); }
/* Filas compactas (salidas por repartidor) */
.filas { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.fila:last-child { border-bottom: 0; }
.fila .m { display: block; font-size: 13px; color: var(--muted); }
.fila > b { font-size: 17px; color: var(--ink); white-space: nowrap; }
/* Reporte: dos columnas en pantalla ancha */
.cols-rep { display: grid; gap: 16px; }
.cols-rep h3 { margin: 0 0 8px; }
@media (min-width: 1100px) { .cols-rep { grid-template-columns: 1fr 2fr; align-items: start; } }
/* Usuarios y permisos */
.permisos-ayuda { display: grid; gap: 8px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
@media (min-width: 900px) { .permisos-ayuda { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.permisos-ayuda > div { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.permisos-ayuda .m, .perm-check .m { font-size: 13px; color: var(--muted); }
.perm-lista { display: flex; flex-wrap: wrap; gap: 4px; }
.pill.perm-ruta { background: #e7f6ec; color: #15803d; }
.pill.perm-planta { background: #e6f1fb; color: #0054a6; }
.pill.perm-oficina { background: #eef0f6; color: #0d2d6c; }
.pill.perm-llave { background: #fff4e0; color: #9a5b00; }
.pill.perm-admin { background: #f3e8ff; color: #6b21a8; }
.perm-checks { display: grid; gap: 8px; }
.perm-check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--surface); }
.perm-check:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); }
.perm-check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--brand-600); flex: none; }
.perm-check > span { display: flex; flex-direction: column; gap: 2px; }
:root[data-theme="dark"] .perm-check:has(input:checked) { background: rgba(124,179,228,.10); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .perm-check:has(input:checked) { background: rgba(124,179,228,.10); } }
.pill.perfil-chofer { background: #e7f6ec; color: #15803d; }
.pill.perfil-encargado { background: #e6f1fb; color: #0054a6; }
.pill.perfil-oficina { background: #eef0f6; color: #0d2d6c; }
.pill.perfil-direccion { background: #f3e8ff; color: #6b21a8; }
.pill.perfil-administracion { background: #eef0f6; color: #0d2d6c; }
.pill.perfil-dueno { background: #f3e8ff; color: #6b21a8; }
.pill.perfil-otro { background: var(--surface-2); color: var(--muted); }
/* Etapa 1: encargado sin turno propio (solo la pestaña Turno) y bodega del iPad en la barra */
.nav button[aria-disabled="true"] { opacity: .4; }
.aviso-turno { margin: 12px 16px 0; font-weight: 600; }
.who small .chip { padding: 2px 8px; font-size: 12px; margin-right: 4px; }
.perm-check[hidden] { display: none; }
.sep-v { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }

/* ---------- Domicilio del cliente (mapa + campos) ---------- */
.dom { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-2); }
.dom-buscar { position: relative; }
.dom-buscar .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.dom-buscar .ic svg { width: 18px; height: 18px; display: block; }
.dom-buscar .input { padding-left: 42px; background: var(--surface); }
.dom-sug { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); box-shadow: var(--shadow-lg); }
.dom-sug li { display: grid; gap: 1px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; line-height: 1.3; }
.dom-sug li b { color: var(--ink); font-weight: 600; }
.dom-sug li span { color: var(--muted); font-size: 13px; }
.dom-sug li:hover { background: var(--brand-50); }
.dom-mapa { position: relative; height: 280px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.dom-mapa .empty { height: 100%; display: grid; place-items: center; text-align: center; padding: 16px; }
.dom-lienzo { position: absolute; inset: 0; }
.dom-aqui { position: absolute; right: 10px; bottom: 10px; z-index: 2; min-height: 40px; padding: 0 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; }
.dom-ayuda { margin: -2px 0 2px; font-size: 13px; }
.dom-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.dom-campos .field { margin-bottom: 10px; }
.dom-campos .span-2, .dom-campos .span-all { grid-column: 1 / -1; }
.dom-campos .input { background: var(--surface); }
@media (min-width: 520px) { .dom-campos { grid-template-columns: 2fr 1fr 1fr; } .dom-campos .span-2 { grid-column: span 1; } .dom-campos .span-all { grid-column: 1 / -1; } }
@media (max-width: 420px) { .dom-mapa { height: 240px; } }

/* Alerta del tablero: un repartidor vendió más de lo que salió con él */
.alertbox { background: var(--crit-bg); color: var(--crit); border-radius: 14px; padding: 10px 14px; font-size: 14px; font-weight: 600; margin: 0 0 10px; }
tr.exceso td { background: var(--crit-bg); color: var(--crit); }
/* Indicadores de ventas que filtran la lista */
.kpi.kfiltro { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .2s, background .2s; }
.kpi.kfiltro[aria-pressed="true"] { border-color: var(--ink); background: var(--info-bg); }
.kpi.kfiltro:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); text-decoration: underline; cursor: pointer; }
/* Llegada con el cliente (V-09) y pausas de máquina (P-06) */
.llegada { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.llegada .pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 12px; }
.llegada .pill svg, .llegada .btn svg { width: 16px; height: 16px; }
.llego { color: var(--ok); font-weight: 600; }
.alertbox.pausa-on { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0; }
.alertbox.pausa-on .btn { background: var(--surface); }
.enpausa { color: var(--crit); font-size: 13px; font-weight: 600; }

/* v1.6.0 planta */
.seg.seg-grande button { min-height: 56px; padding: 10px 20px; font-size: 17px; line-height: 1.2; }
.stepper.stepper-xl { grid-template-columns: 80px 1fr 80px; }
.stepper.stepper-xl button, .stepper.stepper-xl input { height: 80px; font-size: 42px; }
.quick.quick-grande button { min-height: 56px; font-size: 18px; border-radius: 14px; }
.input.input-grande { min-height: 56px; font-size: 18px; }
.btn.btn-tablet { min-height: 56px; font-size: 17px; padding: 10px 22px; }
.hora-final { font: 700 20px var(--font-head); color: var(--ink); }
.hora-final.bad { color: var(--crit); font: 600 15px var(--font); }
.exist { font-size: 15px; font-weight: 600; color: var(--muted); }
.exist b { font: 700 20px var(--font-head); color: var(--ink); }
.qrow.excede { border-color: var(--crit); box-shadow: 0 0 0 2px var(--crit-bg); }
.qrow.excede .exist b { color: var(--crit); }
.exceso { margin-top: 8px; color: var(--crit); font-weight: 700; font-size: 15px; }
tr.anulada td { color: var(--muted); text-decoration: line-through; }
.anul-motivo { display: inline-block; text-decoration: none; color: var(--crit); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.pill.tarde { background: var(--warn-bg); color: var(--warn); }
.pill.destino { background: var(--info-bg); color: var(--brand-600); }
/* v1.6.0 oficina */
/* Cierre del día del chofer: números grandes y cuadre en vivo */
.card.cierre { margin-top: 16px; display: grid; gap: 14px; }
.card.cierre h2 { margin: 0; }
.cierre-campos { display: grid; gap: 10px; }
@media (min-width: 700px) { .cierre-campos { grid-template-columns: 1fr 1fr; } }
.cierre-campos .qrow .top { flex-wrap: wrap; }
.cierre-efectivo { display: grid; gap: 10px; }
@media (min-width: 700px) { .cierre-efectivo { grid-template-columns: 1fr 1.4fr; } }
.input.cifra { height: 64px; font: 700 30px var(--font-head); color: var(--ink); text-align: center; font-variant-numeric: tabular-nums; }
.cuadre { display: grid; gap: 10px; }
@media (min-width: 700px) { .cuadre { grid-template-columns: 1fr 1fr; } }
.cu-col { background: var(--surface-2); border-radius: 16px; padding: 6px 14px; }
.cu-fila { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.cu-fila:last-child { border-bottom: 0; }
.cu-fila b { font: 700 22px var(--font-head); color: var(--ink); white-space: nowrap; }
.cu-fila.tot b { font-size: 26px; }
.cu-fila.ok b { color: var(--ok); } .cu-fila.mal b { color: var(--crit); }
.cu-nota { grid-column: 1 / -1; margin: 0; }

/* Revisión B / S / L: bloques por chofer como el papel */
.rv-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .rv-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .rv-grid { grid-template-columns: repeat(3, 1fr); } }
.rv-blk { display: grid; gap: 0; align-content: start; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 16px; padding: 0 0 12px; box-shadow: var(--shadow); cursor: pointer; overflow: hidden; width: 100%; min-width: 0; }
.rv-blk:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.rv-blk.ok { border-left-color: var(--ok); } .rv-blk.mal { border-left-color: var(--crit); } .rv-blk.falta { border-left-color: var(--warn); }
.rv-blk.nada { opacity: .6; box-shadow: none; }
.rv-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 14px; background: var(--info-bg); }
.rv-h b { font: 700 16px var(--font-head); color: var(--ink); text-transform: uppercase; letter-spacing: .02em; }
.rv-h span { font-size: 12.5px; color: var(--muted); }
.rv-l { display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; padding: 8px 14px 6px; border-bottom: 1px solid var(--line); }
.rv-l .k { font: 700 16px var(--font-head); color: var(--ink); grid-row: span 2; }
.rv-l .v { font: 700 22px var(--font-head); color: var(--ink); line-height: 1.15; overflow-wrap: anywhere; }
.rv-l .d { font-size: 12px; color: var(--muted); }
.rv-c { display: flex; align-items: center; gap: 14px; padding: 12px 14px 0; }
.rv-circ { flex: none; width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--line); display: grid; place-content: center; text-align: center; gap: 2px; background: var(--surface-2); }
.rv-circ .c { font: 700 24px var(--font-head); font-variant-numeric: tabular-nums; line-height: 1; }
.rv-circ .t { font-size: 11.5px; font-weight: 700; line-height: 1.15; padding: 0 6px; }
.rv-circ.ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.rv-circ.mal { border-color: var(--crit); background: var(--crit-bg); color: var(--crit); }
.rv-circ.falta { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.rv-circ.nada { color: var(--muted); }
.rv-ef { display: grid; gap: 3px; font-size: 13px; min-width: 0; }
.rv-ef b { color: var(--ink); }
.rv-ef .ok { color: var(--ok); font-weight: 700; } .rv-ef .mal { color: var(--crit); font-weight: 700; }
.kpi .v.rv-rojo { color: var(--crit); } .kpi .v.rv-ambar { color: var(--warn); }
.rv-det h3 { margin: 16px 0 8px; }
.rv-det .tablewrap { margin-bottom: 6px; }
.rv-det tr.tot td { border-top: 2px solid var(--line); }
.rv-firma { margin-top: 22px; color: var(--muted); }

/* Producción: registros anulados (tachados, fuera de totales) */
.btn.mini { min-height: 34px; padding: 4px 12px; font-size: 13px; }
tr.anulada td:not(.acc) { text-decoration: line-through; color: var(--muted); }
.item.anulada .t, .item.anulada .m { text-decoration: line-through; color: var(--muted); }
.item .acc { display: block; margin-top: 6px; }
.item .acc:empty { display: none; }
.pill.anul-motivo { white-space: normal; }

/* Almacén: mermas por aprobar */
.mermas-of { margin-bottom: 18px; }
.mermas-grid { display: grid; gap: 10px; }
@media (min-width: 900px) { .mermas-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.card.merma-of { display: grid; gap: 6px; border-left: 6px solid var(--warn); }
.card.merma-of p { margin: 0; }
.merma-n { font: 700 22px var(--font-head); color: var(--crit); }

/* Clientes: factura y empresa */
.pill.tag-factura { background: var(--info-bg); color: var(--ink); }
.pill.tag-almisa { background: var(--warn-bg); color: var(--warn); }

/* Impresión en hoja carta de la revisión y del control de ventas */
@media print {
  #area-impresion.rv-print { font: 11px/1.35 Arial, sans-serif; color: #000; }
  #area-impresion.rv-print * { color: #000; }
  .rv-print-h { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
  .rv-print-h h1 { font-size: 16px; margin: 0; }
  #area-impresion.rv-print .rv-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  #area-impresion.rv-print .rv-blk { box-shadow: none; border: 1px solid #000; border-left-width: 4px; break-inside: avoid; opacity: 1; background: #fff; }
  #area-impresion.rv-print .rv-h { background: #dbe8f3; -webkit-print-color-adjust: exact; print-color-adjust: exact; padding: 4px 8px; }
  #area-impresion.rv-print .rv-l { padding: 4px 8px; }
  #area-impresion.rv-print .rv-l .v { font-size: 15px; }
  #area-impresion.rv-print .rv-circ { width: 64px; height: 64px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #area-impresion.rv-print .rv-circ .c { font-size: 16px; }
  #area-impresion.rv-print .rv-circ.ok, #area-impresion.rv-print .rv-circ.ok * { color: #15803d; }
  #area-impresion.rv-print .rv-circ.mal, #area-impresion.rv-print .rv-circ.mal * { color: #c22e2e; }
  #area-impresion.rv-print .rv-circ.falta, #area-impresion.rv-print .rv-circ.falta * { color: #b45309; }
  #area-impresion.rv-print table { width: 100%; border-collapse: collapse; }
  #area-impresion.rv-print th, #area-impresion.rv-print td { border: 1px solid #999; padding: 3px 6px; text-align: left; }
  #area-impresion.rv-print .n { text-align: right; }
  #area-impresion.rv-print .empty, #area-impresion.rv-print .warnbox { border: 1px dashed #999; padding: 6px; }
}

/* etapa 1 planta */
.planta1 .mb { margin-bottom: 8px; }
.planta1 .sec { margin-top: 24px; }
.planta1 .sec-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.planta1 .card.grid { gap: 18px; }
.planta1 .lbl { font-size: 15px; }
.seg.seg-llena { display: flex; width: 100%; }
.seg.seg-llena button { flex: 1 1 0; min-width: 120px; }
.planta1 .seg.seg-grande button { min-height: 60px; font-size: 18px; }
.planta1 .seg button[aria-pressed="true"] { background: var(--brand-600); color: #fff; box-shadow: none; }
.planta1 .btn.big { min-height: 72px; font-size: 21px; }
.planta1 .quick.quick-grande button { min-height: 60px; font-size: 20px; }
.planta1 .stepper.stepper-xl { grid-template-columns: 96px 1fr 96px; }
.planta1 .stepper.stepper-xl button { height: 96px; font-size: 30px; }
.planta1 .stepper.stepper-xl input { height: 96px; font-size: 60px; }
.planta1 .stepper.stepper-pl { grid-template-columns: 76px 1fr 76px; }
.planta1 .stepper.stepper-pl button { height: 68px; font-size: 22px; }
.planta1 .stepper.stepper-pl input { height: 68px; font-size: 34px; }
.planta1 .qty { display: grid; gap: 10px; }
@media (min-width: 760px) { .planta1 .qty { grid-template-columns: 1fr 1fr; } }
.planta1 [data-limpiar] { min-height: 56px !important; }
.planta1 .sign canvas { height: 220px; }
.planta1 td .btn.btn-tablet { white-space: nowrap; }
.planta1 td.acc { text-align: right; }
.planta1 td.bolsas-g { font: 700 22px var(--font-head); color: var(--ink); }
.planta1 td.hora-g { font: 700 18px var(--font-head); color: var(--ink); }
.planta1 .firma-mini { height: 48px; min-width: 60px; }
.pill.bajo { background: var(--crit-bg); color: var(--crit); }
.inv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 600px) { .inv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.inv-c { display: grid; gap: 2px; padding: 14px 16px; border-radius: 18px; background: var(--brand-50); border: 1px solid var(--line); }
.inv-c .k { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-600); }
.inv-c .v { font: 700 clamp(28px, 4vw, 38px)/1.1 var(--font-head); color: var(--ink); }
.resumen-sal { font-size: 17px; color: var(--text); min-height: 1px; }
.resumen-sal b { font: 700 24px var(--font-head); color: var(--ink); }
.foto-btn { cursor: pointer; }
.foto-prev { display: block; max-width: 100%; max-height: 320px; border-radius: 16px; border: 1px solid var(--line); }
.conteo { display: grid; gap: 10px; }
@media (min-width: 760px) { .conteo { grid-template-columns: 1fr 1fr; } }
.conteo-fila .input.cifra { height: 76px; font-size: 38px; }
.planta1 .res { margin-top: 8px; min-height: 26px; font-size: 18px; font-weight: 700; }
.planta1 .res .ok { color: var(--ok); } .planta1 .res .mal { color: var(--crit); }
.conteo-total { border-width: 2px; }
.turno-ok { display: grid; gap: 6px; border-left: 6px solid var(--go); }
.turno-ok p { margin: 0; }
.planta1 td.num { white-space: nowrap; }
/* etapa 1 oficina */
.of-ch { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.of-ch h3, .of-h3 { font: 600 16px/1.3 var(--font-head); color: var(--ink); margin: 0; }
.of-h3 { margin: 16px 0 8px; font-size: 14.5px; }
.of-cols { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 14px; }
@media (min-width: 760px) { .of-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .of-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } .of-cols.of-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .of-span2 { grid-column: span 2; } }
.of-cols > .card { min-width: 0; }
.of-bar { margin-bottom: 14px; }
.of-fecha { width: auto; min-height: 44px; }
.of-kpi-pend { border-color: var(--warn); } .of-kpi-pend .v { color: var(--warn); }
.of-inv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.of-inv > div { background: var(--brand-50); border-radius: 14px; padding: 10px 12px; display: grid; }
.of-inv span { font-size: 12px; font-weight: 700; color: var(--brand-600); text-transform: uppercase; letter-spacing: .04em; }
.of-inv b { font: 700 24px/1.15 var(--font-head); color: var(--ink); }
.of-inv small { color: var(--muted); font-size: 12px; }
.of-tot { border-top: 1px solid var(--line); padding-top: 8px; }
.of-tot b { font: 700 20px var(--font-head); color: var(--ink); }
.of-scroll { max-width: 100%; }
tr.of-bajo td { background: var(--crit-bg); }
.of-rojo { color: var(--crit); }
.of-aprob { display: grid; gap: 12px; }
.of-ap { display: grid; grid-template-columns: 1fr; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: var(--surface); }
@media (min-width: 560px) { .of-ap { grid-template-columns: 170px 1fr; } .of-ap.of-ap-c { grid-template-columns: 1fr; } }
.of-ap p { margin: 6px 0; }
.of-foto { min-height: 120px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: 13px; overflow: hidden; }
.of-foto img { width: 100%; height: 100%; max-height: 220px; object-fit: cover; display: block; }
.of-big { font: 700 24px var(--font-head); color: var(--crit); }
.of-antes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.of-antes > div { border-radius: 12px; padding: 8px 10px; background: var(--surface-2); display: grid; gap: 2px; }
.of-antes > div:last-child { background: var(--ok-bg); }
.of-antes span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.of-antes b { color: var(--ink); }
.of-bajas { margin-top: 10px; } .of-bajas summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.of-min td { vertical-align: top; }
.of-min-par { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 130px; }
.of-min-par .input { min-height: 40px; padding: 6px 8px; text-align: right; }
.of-min-par .input[data-k="m"] { border-color: var(--warn); }
/* Hojas: réplica del papel (fondo blanco también en tema oscuro, como la hoja impresa). */
.of-hoja { background: #fff; color: #1d2433; border: 1px solid #c9d6e8; border-radius: 12px; padding: 16px; margin-bottom: 18px; box-shadow: var(--shadow); --line: #c9d6e8; --muted: #5b6475; --ink: #0d2d6c; --text: #1d2433; --surface: #fff; --surface-2: #dbe7f5; --crit-bg: #fbe7e7; --warn-bg: #fdf3e2; --crit: #c22e2e; }
.of-hh { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.of-hh h2 { font: 700 18px var(--font-head); color: #0d2d6c; margin: 0 0 4px; }
.of-hh-d { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.of-clave { background: #0d2d6c; color: #fff; font: 700 15px var(--font-head); padding: 3px 12px; border-radius: 6px; }
.of-hoja .tablewrap { box-shadow: none; border-radius: 6px; background: #fff; }
.of-hoja table { font-size: 12.5px; }
.of-hoja th { background: #dbe7f5; color: #0d2d6c; padding: 6px 7px; font-size: 10.5px; }
.of-hoja td { padding: 3px 7px; border-color: #dfe6f0; height: 24px; }
.of-b51 tr.of-banda td { background: #bed2ec; color: #0d2d6c; font-weight: 700; font-size: 11.5px; letter-spacing: .04em; }
.of-b51 tr.of-pie td { background: #dbe7f5; font-weight: 700; color: #0d2d6c; }
.of-b51 .of-reg { color: #5b6475; }
.of-b51 .of-sal { font-variant-numeric: tabular-nums; white-space: nowrap; color: #0d2d6c; min-width: 220px; }
.of-hoja tr.of-vacia td { color: #9aa3b3; }
.of-hoja tr.of-bajo td { background: #fbe7e7; }
.of-firmas { display: grid; gap: 10px; margin-top: 10px; }
@media (min-width: 760px) { .of-firmas { grid-template-columns: 1fr 1fr; } }
.of-firmas > div { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; border-top: 1px solid #9aa3b3; padding-top: 6px; }
.of-firmas .lbl { width: 100%; }
.of-firma { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.of-hoja .firma-mini { height: 30px; }
.of-blks { display: grid; gap: 12px; }
@media (min-width: 900px) { .of-blks { grid-template-columns: 1fr 1fr; } }
.of-blks > div { display: grid; gap: 10px; align-content: start; min-width: 0; }
.of-blk { border: 1px solid #c9d6e8; border-radius: 8px; overflow-x: auto; }
.of-blk table { font-size: 12px; }
.of-blk td { height: 30px; } .of-blk .firma-mini { height: 24px; }
.of-blk-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #bed2ec; color: #0d2d6c; padding: 5px 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.of-blk-vacio .of-blk-h { background: #e9eef6; color: #5b6475; }
.of-circ { border: 2px solid #0054a6; border-radius: 999px; padding: 1px 10px; font-weight: 700; background: #fff; text-transform: none; }
.of-pie-g { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 900px) { .of-pie-g { grid-template-columns: 1fr 1fr; } .of-pie-g > :last-child { grid-column: span 2; } }
.of-pie-t { border: 1px solid #c9d6e8; border-radius: 8px; overflow-x: auto; }
.of-pie-t > b { display: block; background: #bed2ec; color: #0d2d6c; padding: 5px 10px; font-size: 13px; text-transform: uppercase; }
.of-pie-t tr.of-final td { background: #e6f5ea; font-weight: 700; color: #15803d; }
/* Gráficas SVG */
.of-svg { width: 100%; height: auto; display: block; }
.of-svg-h { max-width: 720px; }
.of-nw { white-space: nowrap; }
.of-ax { font: 600 11px var(--font); fill: var(--muted); }
.of-ax-b { fill: var(--ink); font-weight: 700; }
.of-ax-l { fill: var(--text); font-size: 12px; }
@media (max-width: 640px) { .of-ax { font-size: 15px; } .of-hoja { padding: 10px; } .of-hh h2 { font-size: 15px; } }
/* iPad: historial de salidas sin cortar el botón de corrección */
.planta1 .tablewrap td{white-space:normal;vertical-align:middle}
.planta1 .tablewrap td .btn-tablet{white-space:nowrap;padding-inline:12px;min-width:0}

/* ================= v2.1.0 · celular primero ================= */
/* Botones de opción sueltos, sin el óvalo gris detrás (todas las pantallas). */
.seg { display: flex; flex-wrap: wrap; gap: 8px; background: none; padding: 0; border-radius: 0; }
.seg button { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 8px 14px; min-height: 44px; font-size: 15px; transition: background var(--t-state), border-color var(--t-state); }
.seg button[aria-pressed="true"], .planta1 .seg button[aria-pressed="true"] { background: var(--brand-600); border-color: var(--brand-600); color: #fff; box-shadow: none; }
.topbar .seg button { min-height: 40px; }
/* Barra inferior: etiqueta larga en iPad y computadora, corta en celular. */
.nav .l-corta { display: none; }
.nav button span { line-height: 1.15; }
/* Chip de conexión */
.chip .txt-n { font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  :root { --nav-h: 60px; }
  body { font-size: 15px; }
  h1 { font-size: 22px; } h2 { font-size: 18px; }
  /* Encabezado compacto: nombre arriba; bodega y turno en una línea */
  .topbar { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .topbar .logo { height: 28px; }
  .topbar .who b { font-size: 15px; }
  .topbar .who small { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; font-size: 12.5px; margin-top: 2px; }
  .who small .chip { padding: 3px 10px; font-size: 13px; min-height: 28px; margin: 0; flex: none; }
  .who small .turno-txt { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .chips { flex-wrap: nowrap; }
  .chip.net.on { padding: 6px; } .chip.net.on .txt { display: none; }
  .chip .txt { display: none; } .chip.net.off .txt { display: inline; }
  .iconbtn { width: 40px; height: 40px; }
  /* Barra inferior: 5 pestañas de una línea */
  .nav { padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); }
  .nav button { min-height: 52px; padding: 5px 0; font-size: 11.5px; gap: 3px; border-radius: 12px; min-width: 0; }
  .nav button svg { width: 22px; height: 22px; }
  .nav .l-larga { display: none; } .nav .l-corta { display: block; white-space: nowrap; }
  .aviso-turno { margin: 10px 16px 0; font-size: 14px; }
  /* Página */
  .main { padding-top: 12px; }
  .page-head { margin-bottom: 10px; gap: 8px; }
  .page-head p { font-size: 13.5px; }
  .card { padding: 14px; border-radius: 18px; }
  .btn { min-height: 46px; padding: 8px 16px; }
  .btn.big, .planta1 .btn.big { min-height: 52px; font-size: 17px; border-radius: 14px; }
  .btn.btn-tablet { min-height: 46px; font-size: 15px; padding: 8px 16px; }
  .input.input-grande { min-height: 48px; font-size: 16px; }
  .planta1 .card.grid { gap: 14px; }
  .planta1 .sec { margin-top: 20px; }
  .planta1 .lbl { font-size: 14px; }
  .planta1 .mb { margin-bottom: 6px; }
  /* Opciones en rejilla */
  .seg.seg-llena { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
  .seg.seg-llena.seg-c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg.seg-llena.seg-c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seg.seg-llena.seg-c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .seg.seg-llena button, .planta1 .seg.seg-grande button, .seg.seg-grande button { min-width: 0; min-height: 46px; padding: 6px 8px; font-size: 15px; border-radius: 12px; }
  .seg.seg-llena.seg-c4 button { padding: 6px 2px; font-size: 14px; white-space: nowrap; }
  /* Cantidades */
  .qrow { padding: 10px; border-radius: 16px; }
  .qrow .top { margin-bottom: 6px; flex-wrap: wrap; }
  .planta1 .stepper.stepper-xl, .stepper.stepper-xl { grid-template-columns: 64px 1fr 64px; gap: 8px; }
  .planta1 .stepper.stepper-xl button, .stepper.stepper-xl button { height: 64px; font-size: 22px; border-radius: 14px; }
  .planta1 .stepper.stepper-xl input, .stepper.stepper-xl input { height: 64px; font-size: 40px; border-radius: 14px; }
  .planta1 .stepper.stepper-pl { grid-template-columns: 52px 1fr 52px; gap: 6px; }
  .planta1 .stepper.stepper-pl button { height: 48px; font-size: 17px; border-radius: 12px; }
  .planta1 .stepper.stepper-pl input { height: 48px; font-size: 26px; border-radius: 12px; }
  .quick.quick-grande, .quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
  .quick.qc1 { grid-template-columns: 1fr; } .quick.qc2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .quick.qc3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick.qc5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .quick button, .quick.quick-grande button, .planta1 .quick.quick-grande button { min-width: 0; min-height: 44px; font-size: 16px; border-radius: 12px; }
  .exist { font-size: 13.5px; } .exist b { font-size: 17px; }
  .hora-final { font-size: 17px; }
  .resumen-sal { font-size: 15px; } .resumen-sal b { font-size: 20px; }
  .planta1 [data-limpiar] { min-height: 44px !important; }
  .planta1 .sign canvas, .sign canvas { height: 190px; }
  .conteo-fila .input.cifra, .input.cifra { height: 56px; font-size: 28px; }
  .planta1 .res { font-size: 15px; }
  /* Inventario */
  .inv-grid { gap: 8px; }
  .inv-c { padding: 10px 12px; border-radius: 14px; }
  .inv-c .k { font-size: 11.5px; } .inv-c .v { font-size: 26px; }
  /* Indicadores de oficina */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; border-radius: 14px; }
  .kpi .k { font-size: 11px; } .kpi .v { font-size: 22px; } .kpi .s { font-size: 12px; }
  .of-inv b { font-size: 20px; }
  .fila { flex-wrap: wrap; padding: 10px 12px; }
  .fila .row { gap: 6px; }
  .of-ap { padding: 10px; }
  .of-foto img { max-height: 180px; }
  .of-fecha { min-height: 46px; }
  .franja { padding: 10px 12px; }
  /* Hojas modales */
  .sheet { max-height: 92dvh; padding-top: 14px; border-radius: 20px 20px 0 0; }
  .sheet .sh h2 { font-size: 19px; }
  .sheet .grid .btn.big { min-height: 50px; }
  .toast { bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); width: max-content; font-size: 14px; }
  /* Login */
  .login-card { padding: 24px 18px 18px; }
  .login .btn.big { min-height: 52px; }
}
@media (max-width: 380px) {
  .nav button { font-size: 10.5px; }
  .seg.seg-llena.seg-c4 button { font-size: 13px; }
  .quick button, .quick.quick-grande button, .planta1 .quick.quick-grande button { font-size: 15px; }
  .topbar .logo { height: 24px; }
  .planta1 .stepper.stepper-xl, .stepper.stepper-xl { grid-template-columns: 56px 1fr 56px; }
}

/* Tablas como tarjetas en celular (las réplicas del papel conservan su tabla con scroll propio) */
@media (max-width: 700px) {
  .tablewrap:has(> table.tcard) { overflow: visible; border: 0; background: none; box-shadow: none; border-radius: 0; }
  table.tcard, table.tcard tbody { display: block; width: 100%; }
  table.tcard thead { display: none; }
  table.tcard tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
  table.tcard td { display: block; padding: 0; border: 0; text-align: left; min-width: 0; overflow-wrap: anywhere; font-size: 14px; background: none !important; }
  table.tcard td:empty, table.tcard td.hide-sm { display: none; }
  table.tcard td[data-l]::before { content: attr(data-l); display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
  table.tcard td:first-child { grid-column: 1 / -1; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  table.tcard td:first-child::before { display: none; }
  table.tcard td:first-child { font-weight: 700; color: var(--ink); font-size: 15px; }
  table.tcard td:first-child .note, table.tcard td:first-child .pill { font-weight: 600; }
  table.tcard td.tc-ancha { grid-column: 1 / -1; }
  table.tcard td.n { text-align: left; }
  table.tcard td.acc { grid-column: 1 / -1; text-align: left; }
  table.tcard td.acc { justify-self: end; }
  table.tcard td.acc .btn { min-height: 40px; padding: 6px 14px; font-size: 14px; }
  /* Caídas de hoy: 4 datos en una fila (cayó, registro, presentación, bolsas), chips y corrección abajo */
  .planta1 table.t-caidas tr { grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 8px 12px; }
  .planta1 table.t-caidas td:first-child { grid-column: auto; padding: 0; border: 0; }
  .planta1 table.t-caidas td:first-child::before { display: block; }
  .planta1 table.t-caidas td.hora-g { font-size: 16px; white-space: nowrap; }
  .planta1 table.t-caidas td.hora-g br, .planta1 table.t-caidas td.hora-g .note { display: none; }
  .planta1 table.t-caidas td:nth-child(2) { font-size: 13.5px; }
  .planta1 table.t-caidas td.n { text-align: right; }
  .planta1 table.t-caidas td.bolsas-g { font-size: 22px; }
  .planta1 table.t-caidas td:nth-child(5) { grid-column: 1 / 3; align-self: center; }
  .planta1 table.t-caidas td:nth-child(5)::before { display: none; }
  .planta1 table.t-caidas td.acc { grid-column: 3 / -1; }
  .planta1 table.t-caidas td.acc .btn { padding: 6px 10px; font-size: 13.5px; }
  .planta1 table.t-caidas td .pill { font-size: 11.5px; padding: 2px 8px; }
  table.tcard tr.anulada td:not(.acc) { text-decoration: line-through; }
  table.tcard tr.of-bajo, table.tcard tr.exceso { background: var(--crit-bg); border-color: var(--crit); }
  table.tcard tr.tot { background: var(--surface-2); }
  table.tcard tr[data-u] { cursor: pointer; }
  /* Caídas, salidas y devoluciones: hora arriba y bolsas grandes */
  .planta1 table.tcard td.hora-g { font-size: 17px; }
  .planta1 table.tcard td.hora-g br { display: none; }
  .planta1 table.tcard td.hora-g .note { margin-left: 8px; font-family: var(--font); font-weight: 600; }
  .planta1 table.tcard td.bolsas-g { font-size: 22px; line-height: 1.1; }
  .planta1 .firma-mini { height: 40px; }
  table.tcard .of-min-par { min-width: 0; }
  /* Réplicas del papel: scroll solo dentro de su caja */
  .of-hoja .tablewrap, .of-blk, .of-pie-t { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 700px) {
  table.tcard .pill { white-space: normal; }
  table.tcard.of-min tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.tcard.of-min .of-min-par .input { min-height: 44px; padding: 6px; text-align: center; }
}
@media (max-width: 600px) {
  .input.cifra::placeholder { font: 600 16px var(--font); color: var(--muted); }
  .planta1 .res:empty { display: none; }
  .planta1 .res { margin-top: 6px; min-height: 0; }
}
@media (max-width: 380px) { .topbar .who small { font-size: 12px; gap: 5px; } .who small .chip { padding: 3px 8px; font-size: 12.5px; } }
@media (max-width: 380px) {
  .planta1 table.t-caidas tr { gap: 4px 10px; }
  .planta1 table.t-caidas td.hora-g { font-size: 15px; }
  .planta1 table.t-caidas td:nth-child(2) { font-size: 13px; }
  .planta1 table.t-caidas td:nth-child(3)::before { content: "Tipo"; }
}

/* ===== Panel de planta por pasos (v2.2.0, 26-nov-2026) =====
   Encargado: inicio con un botón por función y asistentes de una decisión por pantalla, sin scroll.
   Todo control mide 64 px o más. Quitar este bloque no afecta a la oficina. */
.app.planta-solo .nav { display: none; }
.app.planta-solo .main { padding-bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; min-height: 0; }
.app.planta-solo { height: 100dvh; min-height: 0; }
.app.planta-solo.asist-on .topbar, .app.planta-solo.asist-on #aviso-turno { display: none; }
.app.planta-solo .toast, .planta-solo ~ .toast { bottom: calc(110px + env(safe-area-inset-bottom)); }
.planta-solo #cambiar-bodega { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.planta-solo #menu { width: 48px; height: 48px; }
.mal { color: var(--crit); }

/* Inicio */
.inicio { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(84px, 1.1fr) minmax(0, 3fr) auto; gap: 12px; }
.ini-g { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(72px, 1fr); gap: 12px; min-height: 0; }
.ini-b { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink);
  font: 700 clamp(18px, 2.4vw, 24px)/1.15 var(--font-head); box-shadow: var(--shadow); padding: 8px; min-height: 72px; text-align: center; transition: transform var(--t-tap) var(--ease); }
.ini-b:active { transform: scale(.97); }
.ini-b svg { width: 34px; height: 34px; color: var(--brand-600); flex: none; }
.ini-b small { font: 600 14px var(--font); color: var(--text); }
.ini-b.ini-p { flex-direction: row; gap: 14px; background: var(--go-hover); border-color: var(--go-hover); color: #fff; font-size: clamp(24px, 3.4vw, 34px); }
.ini-b.ini-p svg { width: 44px; height: 44px; color: #fff; }
.ini-inv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: stretch; }
.ini-inv-t { grid-column: 1 / -1; font-size: 14px; font-weight: 700; color: var(--text); }
.ini-inv-c { display: grid; gap: 0; padding: 8px 10px; border-radius: 14px; background: var(--brand-50); border: 1px solid var(--line); min-width: 0; }
.ini-inv-c small { font-size: 13px; font-weight: 700; color: var(--brand-600); }
.ini-inv-c b { font: 700 clamp(20px, 3vw, 30px)/1.1 var(--font-head); color: var(--ink); }
@media (max-height: 640px) { .ini-b svg { display: none; } .inicio { gap: 8px; } .ini-g { gap: 8px; } }

/* Asistente */
.asist { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; max-width: 860px; width: 100%; margin: 0 auto; }
.asist-h { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.asist-h b { font: 700 16px var(--font-head); color: var(--text); text-align: center; }
.asist-n { justify-self: end; font-size: 15px; font-weight: 700; color: var(--text); }
.asist-x { justify-self: start; min-height: 56px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; color: var(--ink); }
.asist-q { font-size: clamp(24px, 3.6vw, 34px); }
.asist-s { margin: -4px 0 0; font-size: 16px; color: var(--text); }
.asist-c { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.asist-c > * { flex: 1; min-height: 0; }
.asist-c > .field, .asist-c > p, .asist-c > .lst-t { flex: none; margin: 0; }
.asist-f { flex: none; display: grid; grid-template-columns: minmax(110px, 1fr) 2fr; gap: 12px; }
.asist-f > :only-child { grid-column: 1 / -1; }
.asist .asist-f .btn.big { min-height: 76px; font-size: clamp(19px, 2.6vw, 24px); border-radius: 22px; line-height: 1.15; }
.btn.falta { background: var(--surface-2); border-color: var(--line); color: var(--ink); }

/* Opciones */
.opc { display: grid; gap: 12px; grid-auto-rows: minmax(64px, 1fr); align-content: stretch; }
.opc-c1 { grid-template-columns: 1fr; } .opc-c2 { grid-template-columns: 1fr 1fr; } .opc-c3 { grid-template-columns: repeat(3, 1fr); }
.opc-b { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; max-height: 150px; padding: 6px 10px; border: 2px solid var(--line); border-radius: 20px; background: var(--surface);
  font: 700 clamp(19px, 2.6vw, 26px)/1.15 var(--font-head); color: var(--ink); box-shadow: var(--shadow); text-align: center; transition: transform var(--t-tap) var(--ease); }
.opc-b small { font: 600 15px var(--font); color: var(--text); }
.opc-b:active { transform: scale(.97); }
.opc-b[aria-pressed="true"] { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.opc-b[aria-pressed="true"] small { color: #fff; }
.hora-otra label, .txt-paso label { font-size: 16px; font-weight: 700; color: var(--ink); }
.asist .input.input-grande { min-height: 72px; font-size: 26px; border-width: 2px; }
.txt-paso { flex: none !important; }

/* Teclado de números */
.tecl { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); gap: 8px; }
.tecl-v { display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 6px 12px; border: 2px solid var(--brand-300); border-radius: 20px; background: var(--surface); }
.tecl-v b { font: 700 clamp(38px, 7.5vh, 72px)/1.1 var(--font-head); color: var(--ink); }
.tecl-v span { font-size: 18px; font-weight: 700; color: var(--text); }
.tecl-v.mal { border-color: var(--crit); } .tecl-v.mal b { color: var(--crit); }
.tecl-n { min-height: 22px; text-align: center; font-size: 17px; font-weight: 700; color: var(--text); }
.tecl-r { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.tecl-r button { min-height: 56px; border: 0; border-radius: 16px; background: var(--brand-50); color: var(--ink); font: 700 20px var(--font-head); }
.tecl-k { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(56px, 1fr); gap: 8px; min-height: 0; }
.tecl-k button { border: 2px solid var(--line); border-radius: 18px; background: var(--surface); font: 700 clamp(26px, 4.4vh, 36px) var(--font-head); color: var(--ink); max-height: 110px; }
.tecl-k button:active, .tecl-r button:active { background: var(--brand-200); }
.tecl-k .tecl-b { font-size: 20px; background: var(--surface-2); }
@media (max-width: 600px) { .tecl-r { gap: 6px; } .tecl-r button { font-size: 17px; border-radius: 14px; } .app.planta-solo.asist-on .main { padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); } }
/* Celular bajo (menos de 660 px de alto): todo sigue en una pantalla; los controles bajan a 48 px, nunca menos. */
@media (max-height: 660px) {
  .asist { gap: 8px; } .asist-x { min-height: 48px; } .asist-q { font-size: 22px; }
  .asist .asist-f .btn.big { min-height: 60px; }
  .tecl { gap: 6px; } .tecl-v { padding: 2px 12px; } .tecl-v b { font-size: 38px; } .tecl-n:empty { display: none; }
  .tecl-r button { min-height: 48px; } .tecl-k { grid-auto-rows: minmax(48px, 1fr); gap: 6px; }
  .opc, .lst { gap: 8px; } .opc { grid-auto-rows: minmax(56px, 1fr); } .lst { grid-auto-rows: minmax(60px, 1fr); } .lst-b { min-height: 60px; }
}

/* Lista de presentaciones */
.lst { display: grid; gap: 10px; grid-auto-rows: minmax(72px, 1fr); }
.lst-b { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; max-height: 130px; padding: 8px 18px; border: 2px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); text-align: left; color: var(--ink); }
.lst-n { display: grid; gap: 2px; min-width: 0; } .lst-n b { font: 700 clamp(19px, 2.6vw, 24px)/1.15 var(--font-head); } .lst-n small { font-size: 15px; font-weight: 600; color: var(--text); }
.lst-v { font: 700 clamp(30px, 5vw, 44px)/1 var(--font-head); color: var(--ink); }
.lst-v.cero { color: var(--text); }
.lst-b.mal { border-color: var(--crit); } .lst-b.mal .lst-n small { color: var(--crit); }
.lst-t { text-align: right; font-size: 18px; font-weight: 700; color: var(--ink); min-height: 26px; }
.lst-t b { font: 700 24px var(--font-head); }

/* Firma, foto y resumen */
.firma-paso { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; }
.asist .firma-paso .btn.big, .asist .foto-paso .btn.big { min-height: 60px; }
.firma-paso .sign { min-height: 120px; } .asist .firma-paso .sign canvas { height: 100%; }
.asist .sign .hint { font-size: 17px; color: #5b6472; }
.firma-ver { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #fff; border: 2px solid var(--line); border-radius: 18px; }
.foto-paso { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.foto-paso .foto-prev { max-height: 100%; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.foto-paso .foto-btn { align-self: end; }
.resu { flex: none !important; display: grid; gap: 0; border: 2px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; }
.resu-f { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.resu-f:last-child { border-bottom: 0; }
.resu-f > span { font-size: 16px; font-weight: 600; color: var(--text); }
.resu-f b { font: 700 clamp(19px, 2.8vw, 26px)/1.2 var(--font-head); color: var(--ink); text-align: right; }
.resu-f small { display: block; font: 600 14px var(--font); }
.resu .firma-mini { height: 54px; vertical-align: middle; }

/* Turno propio y Lo de hoy */
.turno-mio { display: grid; gap: 14px; }
.hoy-h { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.hoy-h .btn.big { width: auto; min-height: 64px; padding: 0 26px; }
.app.planta-solo .main:has(.hoy), .app.planta-solo .main:has(.turno-mio) { display: block; }
.app.planta-solo:has(.hoy), .app.planta-solo:has(.turno-mio) { height: auto; min-height: 100%; }
.hoy .seg.seg-grande button { min-height: 64px; }
.app.planta-solo:has(.asist) #aviso-turno { display: none; } /* al recibir turno el asistente ya dice qué hacer */

/* v2.2.1: más y menos junto al número, y aviso de usuario en la pantalla del PIN */
.tecl-fila { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.tecl-fila > .tecl-v:only-child { grid-column: 1 / -1; }
.tecl-pm { width: clamp(64px, 16vw, 110px); min-height: 56px; border: 0; border-radius: 20px; background: var(--brand-600); color: #fff; font: 700 40px/1 var(--font-head); }
.tecl-pm:active { background: var(--brand-900); }
.login-quien { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 10px; color: var(--text); }
.login-quien b { color: var(--ink); font-size: 18px; }

/* v2.3.0: accesos separados por área (menú de la raíz y pantalla de entrada de cada área) */
.accesos { display: grid; gap: 12px; }
.acc-b { display: grid; gap: 2px; justify-items: center; min-height: 84px; padding: 12px; border: 2px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); transition: transform var(--t-tap) var(--ease); }
.acc-b b { font: 700 22px/1.2 var(--font-head); } .acc-b small { font-size: 15px; font-weight: 600; color: var(--text); }
.acc-b:active { transform: scale(.97); background: var(--brand-50); }
.login-card p.sub { color: var(--text); font-size: 17px; font-weight: 600; }
.login-area { text-align: center; margin: 0 0 16px; font: 700 22px/1.2 var(--font-head); color: var(--ink); }
.login-cambiar { width: 100%; margin-top: 10px; border-color: transparent; background: none; color: var(--text); font-weight: 600; text-decoration: underline; }

/* v2.3.1: línea de ayuda bajo cada botón del inicio */
.ini-b small { font: 600 14px/1.2 var(--font); color: var(--text); }
.ini-b.ini-p { flex-wrap: wrap; row-gap: 0; align-content: center; }
.ini-b.ini-p small { flex-basis: 100%; color: #fff; font-size: 16px; }
@media (max-height: 640px) { .ini-b small { font-size: 13px; } }

/* v2.3.2: la lista no se encima con su total; si no cabe, se desliza */
.asist-c > .lst { flex: 1 0 auto; }
.lst-n small { line-height: 1.25; }

/* v2.4.0: aviso del relevo en la pantalla de entrada */
.login-aviso { text-align: center; font-size: 16px; font-weight: 600; color: var(--ink); margin: 0 0 14px; }
.resu-f { padding: 8px 18px; }
.resu-f small { display: inline; margin-left: 8px; }
.asist-c > .infobox, .asist-c > .warnbox { flex: none; margin: 0; }

/* v2.4.1: pestañas de Lo de hoy en cuadrícula (no se salen en celular) y selector de pantalla grande en el menú */
.hoy #hsec { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; background: none; padding: 0; border-radius: 0; }
.hoy #hsec button { min-height: 64px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); font-size: 17px; padding: 6px 4px; white-space: normal; overflow-wrap: anywhere; line-height: 1.15; }
.hoy #hsec button[aria-pressed="true"] { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
@media (max-width: 600px) { .hoy #hsec { grid-template-columns: 1fr 1fr; } .hoy-h h1 { font-size: 19px; } }
.seg.seg-tema { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg.seg-tema button { min-height: 56px; font-size: 16px; }

/* v2.5.0: entrada de planta con un botón por turno */
.login .accesos .acc-b { min-height: 92px; } .login .accesos .acc-b b { font-size: 26px; }
.login-quien b { font: 700 24px/1.2 var(--font-head); }
.login .accesos .acc-b { align-content: center; }
