/* ============================================================
   Portal de pedidos Mondel — estilos
   Mobile first. Los tokens de color viven en :root y se
   redefinen para el tema oscuro del sistema.
   ============================================================ */
:root {
  --ink: #152534; --ink-2: #44586b; --ink-3: #7b8d9d;
  --ground: #eef1f3; --surface: #ffffff; --line: #d9e0e6;
  --accent: #b8761c; --accent-soft: #f6ecd9;
  --brand: #152534; --on-brand: #ffffff;
  --ok: #2e7d4f; --ok-soft: #e3f2e9; --warn: #b4532a; --bad: #b3261e; --bad-soft: #fbe9e7;
  --info: #1f5a8c; --info-soft: #e3edf7;
  --shadow: 0 1px 2px rgba(21,37,52,.06), 0 8px 20px rgba(21,37,52,.05);
  --r: 10px;
  --nav-inf: 62px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8edf1; --ink-2: #a6b6c3; --ink-3: #74879a;
    --ground: #101820; --surface: #18232e; --line: #2a3a48;
    --accent: #e0a34a; --accent-soft: #2a2115;
    --brand: #e8edf1; --on-brand: #101820;
    --ok: #5cba84; --ok-soft: #14301f; --warn: #e08a5e; --bad: #f28b82; --bad-soft: #3a1f1c;
    --info: #8fc1ea; --info-soft: #16283a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 20px rgba(0,0,0,.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
/* El atributo hidden debe ganar aunque la clase fije display (botones, filas, enlaces). */
[hidden] { display: none !important; }
html { height: 100%; }
/* body crece con el contenido (min-height, no height): si tuviera altura fija,
   la cabecera sticky dejaría de pegarse en cuanto el scroll pasara de una pantalla. */
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  display: flex; flex-direction: column; min-height: 100%;
}
main { flex: 1; }
a { color: inherit; }
h1 { font-family: Newsreader, Georgia, serif; font-weight: 600; font-size: 26px; line-height: 1.15; margin: 0 0 6px; text-wrap: balance; }
code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .92em; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.eyebrow { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.wordmark { font-family: Newsreader, Georgia, serif; font-weight: 600; font-size: 22px; letter-spacing: .10em; text-transform: uppercase; color: var(--brand); text-decoration: none; line-height: 1; }
.pill { display: inline-block; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--warn); font-weight: 600; margin-left: 6px; vertical-align: middle; }

/* ---------- Botones y formularios ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 11px 18px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn-primario { background: var(--brand); color: var(--on-brand); }
.btn-secundario { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .chip:focus-visible, .fav:focus-visible, .dropzone:focus-visible, .fila:focus-visible, .enlace:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=search], input[type=text], input[type=tel], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--ground); color: var(--ink); font: inherit; font-size: 15px;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b8d9d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
textarea { resize: vertical; min-height: 60px; line-height: 1.4; }
input:focus, select:focus, textarea:focus { background-color: var(--surface); }
.error { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin-top: 14px; }

/* ---------- Acceso ---------- */
.login { max-width: 420px; margin: 0 auto; padding: 48px 16px 32px; }
.login-marca { text-align: center; margin-bottom: 26px; }
.login-marca .wordmark { font-size: 30px; }
.login-sub { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px 20px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 24px; }
.login-card .btn { width: 100%; margin-top: 18px; }
.login-enlaces { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; font-size: 13.5px; }
.login-enlaces a { color: var(--ink-2); }
.login-pie { text-align: center; font-size: 12px; margin-top: 22px; }

/* ---------- Cascarón ---------- */
/* El contenedor entero es el que se pega arriba: un sticky solo se mantiene
   mientras su padre siga en pantalla, y #shell abarca toda la página. */
#shell { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.cab { background: var(--surface); border-bottom: 1px solid var(--line); }
.cab-in { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.nav-sup { display: none; gap: 4px; margin-left: 12px; }
.nav-sup a { text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.nav-sup a.activo { background: var(--ground); color: var(--ink); font-weight: 600; }
.quien { margin-left: auto; text-align: right; line-height: 1.2; min-width: 0; }
.quien-nombre { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.quien-rol { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.btn-salir, .campana { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink-3); border: 1px solid var(--line); flex: 0 0 auto; }
.btn-salir svg, .campana svg { width: 18px; height: 18px; }
.campana { position: relative; }
.campana-n { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.nav-inf { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.nav-inf a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 500; }
.nav-inf a.activo { color: var(--brand); }
.nav-inf svg { width: 22px; height: 22px; }
main { padding-bottom: calc(var(--nav-inf) + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 760px) {
  .nav-sup { display: flex; }
  .nav-inf { display: none; }
  main { padding-bottom: 24px; }
  .quien-nombre { max-width: none; }
}
.pie { text-align: center; font-size: 11px; color: var(--ink-3); padding: 14px 16px calc(14px + var(--nav-inf)); }
@media (min-width: 760px) { .pie { padding-bottom: 14px; } }

/* ---------- Páginas ---------- */
.pagina { max-width: 1080px; margin: 0 auto; padding: 20px 16px; }
.pagina-cab { margin-bottom: 18px; }
.accesos { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .accesos { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .accesos { grid-template-columns: repeat(3, 1fr); } }
.acceso { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; text-decoration: none; box-shadow: var(--shadow); }
.acceso svg { width: 26px; height: 26px; color: var(--accent); flex: 0 0 auto; margin-top: 2px; }
.acceso-titulo { font-weight: 600; font-size: 15px; }
.acceso-texto { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.acceso-prox { opacity: .6; pointer-events: none; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles-3 .tile { padding: 12px 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; min-width: 0; }
a.tile:hover { border-color: var(--ink-3); }
.tile-v { font-family: Newsreader, Georgia, serif; font-size: 30px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.tile-l { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* ---------- Catálogo ---------- */
.cat-cab { position: sticky; top: calc(57px + env(safe-area-inset-top, 0px)); z-index: 15; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px 0; }
.cat-cab > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.buscar { position: relative; }
.buscar input { padding-left: 38px; }
.buscar svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 500; }
.chip .n { opacity: .6; margin-left: 5px; font-variant-numeric: tabular-nums; }
.cat-cuenta { font-size: 12.5px; color: var(--ink-3); margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.card.on { border-color: var(--accent); }
.card-off { opacity: .55; }
.ph { position: relative; aspect-ratio: 1; background: #fff; display: flex; align-items: center; justify-content: center; }
.ph img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sin-img-in { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 100%; background: repeating-linear-gradient(135deg, var(--ground) 0 8px, var(--surface) 8px 16px); color: var(--ink-3); }
.sin-img-in svg { width: 26px; height: 26px; opacity: .45; }
.sin-img-in span { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 10px; letter-spacing: .04em; }
.ph.sin-img .sin-img-in { display: flex; }
.tag { position: absolute; top: 7px; left: 7px; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; border-radius: 4px; font-weight: 600; }
.tag-gen { background: var(--accent-soft); color: var(--warn); }
.tag-none { background: var(--ground); color: var(--ink-3); border: 1px solid var(--line); }
.tag-off { background: var(--bad-soft); color: var(--bad); top: auto; bottom: 7px; }
.fav { position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; border: 0; background: transparent; color: var(--line); font-size: 22px; line-height: 1; cursor: pointer; border-radius: 50%; }
.fav:hover { color: var(--accent); }
.fav-on { color: var(--accent); }
.body { padding: 10px 11px 11px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.sku { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 10.5px; color: var(--ink-3); letter-spacing: .02em; }
.nm { font-size: 13.5px; font-weight: 500; line-height: 1.3; text-wrap: balance; }
.meta { font-size: 12px; color: var(--ink-2); margin-top: auto; padding-top: 4px; }
.meta b { font-weight: 600; color: var(--ink); }
.step { display: flex; align-items: center; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--ground); }
.step button { flex: 0 0 38px; height: 36px; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 19px; line-height: 1; cursor: pointer; }
.step button:hover { background: var(--line); color: var(--ink); }
.step input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; text-align: center; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; -moz-appearance: textfield; padding: 0; }
.step input::-webkit-outer-spin-button, .step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.card.on .step { background: var(--accent-soft); border-color: var(--accent); }
.vacio { padding: 50px 16px; text-align: center; color: var(--ink-3); }
.barra { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-inf) + env(safe-area-inset-bottom, 0px)); z-index: 25; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px; box-shadow: 0 -4px 20px rgba(21,37,52,.07); }
@media (min-width: 760px) { .barra { bottom: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); } }
.barra-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.barra-sum { flex: 1; min-width: 0; }
.barra-sum .l { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-sum .v { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.barra-sum .eta { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.catalogo .pagina { padding-bottom: 96px; }

/* ---------- Admin: fotos ---------- */
.dropzone { border: 2px dashed var(--line); border-radius: 14px; padding: 28px 18px; text-align: center; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dropzone svg { width: 30px; height: 30px; color: var(--accent); }
.dropzone.sobre { border-color: var(--accent); background: var(--accent-soft); }
.cola-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 12px; }
.cola-acciones { margin-left: auto; display: flex; gap: 8px; }
.cola-lista { display: flex; flex-direction: column; gap: 8px; }
.cola-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px 8px 8px; }
.cola-item.error { border-color: var(--bad); }
.cola-item.ok { border-color: var(--ok); }
.cola-thumb { width: 56px; height: 56px; border-radius: 6px; background: #fff; border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.cola-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cola-info { min-width: 0; }
.cola-nombre { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cola-detalle { font-size: 12px; color: var(--ink-3); }
.cola-item.error .cola-detalle { color: var(--bad); }
.cola-estado { font-size: 12px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.cola-item.ok .cola-estado { color: var(--ok); }
.cola-item.error .cola-estado { color: var(--bad); }

/* ---------- Etapa 2: bloques, listas y fichas ---------- */
.bloque { margin-top: 22px; }
.bloque-t { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0 0 10px; }
h3.bloque-t { margin-top: 18px; }
.cab-con-accion { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cab-con-accion > div { min-width: 0; }
.cab-con-accion h1 { margin-bottom: 2px; }
.volver { display: inline-block; font-size: 13.5px; color: var(--ink-2); text-decoration: none; margin-bottom: 8px; }
.volver:hover { color: var(--ink); }
.enlace { display: inline-block; background: none; border: 0; padding: 8px 0 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: none; }
.enlace:hover { text-decoration: underline; }
.lista { display: flex; flex-direction: column; gap: 8px; }
.lista > .muted, .lista > .vacio { padding: 18px 4px; }
.fila { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; text-decoration: none; color: inherit; font: inherit; cursor: pointer; box-shadow: var(--shadow); }
a.fila:hover, button.fila:hover { border-color: var(--ink-3); }
.fila-static { cursor: default; }
.fila-static:hover { border-color: var(--line); }
.fila-off { opacity: .55; }
.fila-nuevo { border-left: 3px solid var(--accent); }
.fila-ico { flex: 0 0 auto; width: 26px; text-align: center; font-size: 17px; }
.fila-main { flex: 1; min-width: 0; }
.fila-t { font-size: 14.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.fila-s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.35; overflow-wrap: anywhere; }
.fila-der { flex: 0 0 auto; display: flex; align-items: center; color: var(--ink-3); font-size: 18px; }
.num { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .9em; color: var(--ink-3); font-weight: 500; }
.punto { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.estado { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.4; }
.estado-gris { background: var(--ground); color: var(--ink-2); border: 1px solid var(--line); }
.estado-ambar { background: var(--accent-soft); color: var(--warn); }
.estado-azul { background: var(--info-soft); color: var(--info); }
.estado-verde { background: var(--ok-soft); color: var(--ok); }
.estado-rojo { background: var(--bad-soft); color: var(--bad); }
.tarjetas { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .tarjetas { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; min-width: 0; overflow-wrap: anywhere; }
.tarjeta-l { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.tarjeta-v { font-size: 15px; font-weight: 600; line-height: 1.3; }
.ficha-sel { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.ficha-nombre { font-weight: 600; font-size: 15px; }
.nota { font-size: 13px; color: var(--ink-2); background: var(--ground); border-radius: 8px; padding: 9px 12px; margin: 10px 0 0; }
.alerta { background: var(--accent-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin: 12px 0; }
.alerta-ok { background: var(--ok-soft); color: var(--ok); }
.alerta .opciones, .alerta label { color: var(--ink); }
.sim-lista { margin: 8px 0 10px; padding-left: 18px; font-size: 14px; }
.sim-lista li { margin: 4px 0; }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.acciones .btn { flex: 1 1 auto; }
@media (min-width: 560px) { .acciones .btn { flex: 0 0 auto; } }
.btn-chico { padding: 7px 12px; font-size: 13px; border-radius: 7px; }
.btn-peligro { background: var(--bad); color: #fff; }
.btn-peligro-sec { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.pedido-nuevo { padding-bottom: 110px; }
.detalle .pagina-cab { margin-bottom: 12px; }

/* Formularios */
.formulario { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 16px 18px; }
.formulario .bloque-t { margin-top: 20px; }
.dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.check { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: 0 0 auto; }
.opciones { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; }
.opcion { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; line-height: 1.35; }
.opcion input { margin: 3px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.opcion:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opcion-dir > span { min-width: 0; overflow-wrap: anywhere; }

/* Líneas del pedido (revisión y corrección) */
.lineas { display: flex; flex-direction: column; gap: 8px; }
.linea { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.linea-off { opacity: .55; }
.linea-main { flex: 1; min-width: 0; }
.linea-t { font-size: 14px; font-weight: 500; line-height: 1.3; }
.linea-s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.step-chico { margin-top: 0; flex: 0 0 auto; width: 118px; }
.step-chico button { flex: 0 0 34px; height: 34px; font-size: 18px; }
.entrega { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 14px 10px; }
.entrega-fila { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.entrega-fila:last-of-type { border-bottom: 0; }
.entrega-fila b { text-align: right; }
.entrega .error { margin-top: 10px; }

/* Tablas e historial */
.tabla { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: 14px; }
.tabla th, .tabla td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.tabla th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; background: var(--ground); }
.tabla tr:last-child td { border-bottom: 0; }
.tabla th.num, .tabla td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabla .cant { font-weight: 700; font-size: 15px; }
.tabla tr.fila-err td { color: var(--bad); }
.fila.fila-err { border-color: var(--bad); }
.fila.fila-err .fila-t { color: var(--bad); }
.historial { list-style: none; margin: 0; padding: 2px 0 0 16px; border-left: 2px solid var(--line); }
.historial li { position: relative; padding: 0 0 14px 10px; font-size: 14px; }
.historial li:last-child { padding-bottom: 0; }
.historial li::before { content: ""; position: absolute; left: -24px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-3); }
.hist-f { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Hoja inferior (modal) */
.hoja-fondo { position: fixed; inset: 0; z-index: 50; background: rgba(21,37,52,.45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.hoja-fondo.visible { opacity: 1; }
.hoja { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border-radius: 16px 16px 0 0; padding: 8px 18px calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateY(24px); transition: transform .2s; box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
.hoja-fondo.visible .hoja { transform: none; }
.hoja-asa { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 10px; }
.hoja-titulo { font-family: Newsreader, Georgia, serif; font-size: 21px; font-weight: 600; margin: 4px 0 8px; line-height: 1.2; }
.hoja-cuerpo { font-size: 14.5px; }
.hoja-cuerpo p { margin: 6px 0 10px; }
.hoja-cuerpo > label:first-child, .hoja-cuerpo > .dos:first-child label { margin-top: 6px; }
.hoja-botones { display: flex; gap: 10px; margin-top: 18px; }
.hoja-botones .btn { flex: 1; }
body.con-hoja { overflow: hidden; }
@media (min-width: 760px) {
  .hoja-fondo { align-items: center; padding: 20px; }
  .hoja { border-radius: 16px; padding-bottom: 18px; }
  .hoja-asa { display: none; }
}

/* ---------- Avisos ---------- */
#avisos { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-inf) + 14px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 760px) { #avisos { bottom: 24px; } }
.aviso { background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 8px; font-size: 13.5px; max-width: 480px; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; box-shadow: var(--shadow); }
.aviso.visible { opacity: 1; transform: none; }
.aviso-ok { background: var(--ok); color: #fff; }
.aviso-error { background: var(--bad); color: #fff; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
