/* Canasta Fácil · © 2026 Pedro Duarte Vaca */
/* Letras guardadas en la app (sin Google Fonts) */
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400 800; font-display: swap; src: url(fuentes/jakarta-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400 800; font-display: swap; src: url(fuentes/jakarta-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(fuentes/plex-mono-latin.woff2) format('woff2'); }

/* Colores: verde de marca y un color por área (como en el diagrama del proceso) */
:root {
  --bg: #f4f7f4;
  --surface: #ffffff;
  --ink: #102016;
  --muted: #53645a;
  --line: #e1e9e3;
  --marca: #14532d;
  --marca-2: #1d7a43;
  --accent: #15803d;
  --accent-soft: #e6f4ea;
  --verde: #16a34a;
  --azul: #2563eb;
  --amarillo: #ca8a04;
  --morado: #7c3aed;
  --naranja: #ea580c;
  --gris: #475569;
  --rojo: #dc2626;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(16, 32, 22, .05), 0 4px 16px rgba(16, 32, 22, .05);
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.muted { color: var(--muted); margin: 0; }
.nota { color: var(--muted); font-size: .85rem; margin: 0; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
code { font-family: var(--mono); font-size: .82rem; background: var(--bg); padding: 1px 6px; border-radius: 6px; }

/* ---------- Botones y campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sec { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.peligro { background: var(--surface); color: var(--rojo); border-color: #f5c2c2; }
.btn.grande { min-height: 50px; width: 100%; font-size: 1rem; }
.btn.chico { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.btn.morado { background: var(--morado); }
.btn.naranja { background: var(--naranja); }
.btn.cargando { position: relative; color: transparent !important; }
.btn.cargando::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; animation: gira .7s linear infinite;
}
.btn.sec.cargando::after, .btn.peligro.cargando::after { border-color: var(--line); border-top-color: var(--accent); }
@keyframes gira { to { transform: rotate(360deg); } }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: .88rem; cursor: pointer; }
.icono-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.icono-btn:hover { background: rgba(127, 127, 127, .12); }

.campo { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--ink); }
.campo small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 400;
}
textarea { resize: vertical; }
input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--accent); flex: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 1px;
}
.pila { display: flex; flex-direction: column; gap: 14px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.acciones.izq { justify-content: flex-start; }

/* ---------- Acceso ---------- */
.pantalla-centro {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, #d5f0dc 0, transparent 60%), var(--bg);
}
.caja { width: 100%; max-width: 440px; background: var(--surface); border-radius: 18px; padding: 28px 24px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 16px; }
.marca { display: flex; align-items: center; gap: 12px; }
.marca strong { display: block; font-size: 1.05rem; }
.marca small { display: block; color: var(--muted); font-size: .8rem; }
.logo {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--marca-2), var(--marca)); color: #fff;
}
.logo .ico { width: 24px; height: 24px; }
.pestanas { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); padding: 4px; border-radius: 12px; }
.pestanas button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.pestanas button[aria-selected=true] { background: var(--surface); color: var(--ink); box-shadow: var(--sombra); }
.empresa-encontrada { margin: 0; padding: 10px 12px; border-radius: 10px; background: #e8f7ee; color: #14532d; font-size: .88rem; }
.empresa-encontrada.no { background: #fdecec; color: #8a1c1c; }
.consentimiento { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--muted); font-weight: 400; }
.error { margin: 0; color: var(--rojo); font-size: .9rem; }
.exito { margin: 0; color: var(--verde); font-size: .9rem; }
.copyright { margin: 0; text-align: center; font-size: .75rem; color: var(--muted); }
.lateral-copy { color: rgba(255,255,255,.55); font-size: .7rem; margin-top: -8px; }
.enlaces-legales { display: flex; gap: 14px; justify-content: center; font-size: .8rem; }
.espera { text-align: center; align-items: center; }
.espera .ico-grande { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.espera .ico-grande .ico { width: 32px; height: 32px; }
.planes-pago { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-pago { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.plan-pago span { font-size: 1.2rem; font-weight: 800; color: var(--marca); }
.plan-pago small { color: var(--muted); }

/* ---------- Estructura: menú lateral + contenido ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px;
  background: var(--marca); color: #fff; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent;
}
.lateral .marca small { color: rgba(255,255,255,.7); }
.lateral .logo { background: #fff; color: var(--marca); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; color: rgba(255,255,255,.82); font-weight: 500; font-size: .93rem; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.activo { background: rgba(255,255,255,.16); color: #fff; font-weight: 700; }
.nav-seccion { margin: 14px 12px 4px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.burbuja { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #f59e0b; color: #fff; font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; }
.icono-btn .burbuja { position: absolute; top: 2px; right: 0; margin: 0; background: var(--rojo); min-width: 18px; height: 18px; font-size: .66rem; }
.usuario-bloque { display: flex; align-items: center; gap: 6px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.15); }
.usuario-fila { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: #fff; }
.usuario-txt { min-width: 0; }
.usuario-txt strong, .usuario-txt small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario-txt small { color: rgba(255,255,255,.7); font-size: .78rem; }
.avatar {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--marca); font-weight: 700; font-size: .85rem;
}
.lateral .avatar { background: rgba(255,255,255,.18); color: #fff; }

.principal { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 500; display: flex; align-items: center; gap: 10px;
  padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
}
.top h1 { font-size: 1.3rem; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vista { padding: 4px 28px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 1150px; width: 100%; }
.solo-movil { display: none; }
.barra-inferior { display: none; }
.velo { position: fixed; inset: 0; z-index: 900; background: rgba(16, 32, 22, .45); }

/* ---------- Tarjetas, listas y datos ---------- */
.tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 18px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tarjeta-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.formulario { max-width: 760px; }
.vacio { color: var(--muted); text-align: center; padding: 18px 8px; margin: 0; }
.saludo { margin: 0; color: var(--muted); }
.saludo strong { color: var(--ink); }
.lista { display: flex; flex-direction: column; }
.fila { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: inherit; }
.fila:last-child { border-bottom: 0; }
a.fila:hover { background: var(--bg); border-radius: 10px; }
.fila-num { flex: none; width: 54px; font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.fila-txt { flex: 1; min-width: 0; }
.fila-txt strong { display: block; }
.fila-txt small { display: block; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila-monto { text-align: right; font-weight: 700; white-space: nowrap; }
.fila-monto small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.fila.no-leida { background: var(--accent-soft); border-radius: 10px; padding-left: 10px; }
.datos { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.datos dt { color: var(--muted); font-size: .88rem; }
.datos dd { margin: 0; overflow-wrap: anywhere; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }

/* Estados del pedido (colores del diagrama) */
.chip { flex: none; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--bg); color: var(--muted); white-space: nowrap; }
.chip.pendiente { background: #dbeafe; color: #1e40af; }
.chip.aprobado { background: #fef3c7; color: #92400e; }
.chip.en_preparacion { background: #ede9fe; color: #5b21b6; }
.chip.entregado { background: #dcfce7; color: #166534; }
.chip.descontado { background: #e0f2fe; color: #075985; }
.chip.rechazado { background: #ffe4e6; color: #9f1239; }
.chip.cancelado { background: #f1f5f9; color: #64748b; text-decoration: line-through; }
.chip.activo { background: #dcfce7; color: #166534; }
.chip.inactivo { background: #f1f5f9; color: #64748b; }
.chip.bajo { background: #ffe4e6; color: #9f1239; }
.chip.generado { background: #dbeafe; color: #1e40af; }
.chip.validado { background: #fef3c7; color: #92400e; }
.chip.exportado { background: #ede9fe; color: #5b21b6; }

/* ---------- Panel principal ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 14px 16px; color: inherit; box-shadow: var(--sombra); border-top: 4px solid var(--c, var(--accent)); }
.kpi small { display: block; color: var(--muted); font-weight: 600; font-size: .8rem; }
.kpi strong { display: block; font-size: 1.5rem; font-weight: 800; margin: 2px 0; }
.kpi em { font-style: normal; color: var(--muted); font-size: .8rem; }
a.kpi:hover { border-color: var(--c, var(--accent)); }
.limite { display: flex; flex-direction: column; gap: 8px; }
.limite-cifras { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.limite-cifras strong { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.barra { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); }
.barra span { display: block; height: 100%; border-radius: inherit; background: var(--verde); }
.barra.alto span { background: var(--amarillo); }
.barra.lleno span { background: var(--rojo); }
.accesos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.acceso {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 104px; padding: 14px 8px; border-radius: var(--radio); color: #fff; font-weight: 700; font-size: .9rem; line-height: 1.2;
  box-shadow: var(--sombra); background: var(--c, var(--accent)); transition: transform .15s;
}
.acceso:hover { transform: translateY(-2px); }
.acceso .ico { width: 30px; height: 30px; stroke-width: 1.7; }

/* ---------- Barra de filtros ---------- */
.barra-acciones { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.barra-acciones input[type=search] { flex: 1 1 240px; width: auto; }
.barra-acciones select, .barra-acciones input[type=month] { width: auto; flex: 0 1 200px; }
.barra-acciones .btn.derecha { margin-left: auto; }
.segmentos { display: inline-flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); padding: 3px; border-radius: 11px; gap: 2px; }
.segmentos button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmentos button[aria-selected=true] { background: var(--accent); color: #fff; }
.segmentos button span { opacity: .75; font-weight: 500; }

/* ---------- Catálogo ---------- */
.catalogo { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.producto { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--sombra); }
.producto-img { aspect-ratio: 4 / 3; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); }
.producto-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.producto-img .ico { width: 42px; height: 42px; stroke-width: 1.4; }
.producto-cuerpo { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.producto-cuerpo strong { line-height: 1.3; }
.producto-cuerpo small { color: var(--muted); font-size: .8rem; }
.producto-precio { font-size: 1.15rem; font-weight: 800; color: var(--marca); }
.producto-pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.producto.combo { border-color: #c9b7f5; }
.producto.combo .producto-img { background: #f3efff; color: var(--morado); }
.producto.agotado { opacity: .55; }
.cantidad { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cantidad button { width: 36px; height: 36px; border: 0; background: var(--bg); font: inherit; font-weight: 700; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.cantidad button:disabled { opacity: .4; cursor: not-allowed; }
.cantidad span { min-width: 34px; text-align: center; font-weight: 700; }
.combo-contenido { margin: 0; padding-left: 18px; font-size: .8rem; color: var(--muted); }
.carrito-barra {
  position: sticky; bottom: 16px; z-index: 400; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 14px; background: var(--marca); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.carrito-barra .fila-txt small { color: rgba(255,255,255,.75); white-space: normal; }
.carrito-barra.excede { background: #991b1b; }
.carrito-barra .btn { background: #fff; color: var(--marca); }
.aviso-limite { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #fff1f2; color: #9f1239; font-weight: 600; }
.aviso-info { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--marca); font-size: .9rem; }
.aviso-amarillo { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #fffbeb; color: #92400e; font-size: .9rem; }
.autorizacion { padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--naranja); border-radius: 10px; background: #fffaf5;
  font: .95rem/1.6 Georgia, "Times New Roman", serif; white-space: pre-wrap; }
.huella { font-family: var(--mono); font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Pedido ---------- */
.estados-pedido { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.estados-pedido li { flex: 1; min-width: 92px; text-align: center; position: relative; padding-top: 30px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.estados-pedido li::before { content: ""; position: absolute; top: 8px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--line); z-index: 1; }
.estados-pedido li::after { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 4px; background: var(--line); }
.estados-pedido li:first-child::after { display: none; }
.estados-pedido li.hecho { color: var(--ink); }
.estados-pedido li.hecho::before, .estados-pedido li.hecho::after { background: var(--verde); }
.estados-pedido li small { display: block; font-weight: 400; font-size: .7rem; }
.tabla-envoltura { overflow-x: auto; margin: 0 -4px; }
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabla td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabla tfoot td { font-weight: 800; border-bottom: 0; }
.tabla .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabla select, .tabla input { min-height: 36px; padding: 6px 8px; }
.tabla tr.inactivo td { opacity: .5; }
.tabla tr.falta td { background: #fff1f2; }
.tabla tr.bajo td:first-child { box-shadow: inset 3px 0 0 var(--rojo); }
.mini { display: inline-block; width: 38px; height: 38px; border-radius: 8px; overflow: hidden; background: var(--accent-soft); vertical-align: middle; }
.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imagen-prev { width: 120px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); }
.imagen-prev img { width: 100%; height: 100%; object-fit: cover; }
.con-imagen { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.codigo-registro { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.codigo-registro strong { font: 700 1.6rem var(--mono); letter-spacing: .1em; padding: 6px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--marca); }
.clave-caja { max-width: 440px; text-align: center; align-items: center; }
.clave-grande { font: 700 2.2rem var(--mono); letter-spacing: .15em; padding: 10px 18px; background: var(--accent-soft); border-radius: 12px; color: var(--marca); }
.solicitud { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid #bfdbfe; border-radius: 12px; background: #f8fbff; }
.cupo p { margin: 4px 0 0; }
.fila-bitacora { border-bottom: 1px solid var(--line); }
.fila-bitacora summary { display: flex; gap: 12px; padding: 10px 4px; cursor: pointer; list-style: none; }
.fila-bitacora summary::-webkit-details-marker { display: none; }
.fila-bitacora pre { margin: 4px 0 12px; padding: 10px; background: var(--bg); border-radius: 8px; font: .75rem/1.4 var(--mono); max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.pasos-nomina { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.paso-n { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.paso-n small { color: var(--muted); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.paso-n.hecho { border-color: #bbe5c8; background: #f1fbf4; }
.paso-n.actual { border-color: var(--naranja); background: #fff7ed; }
.barra-h { display: grid; grid-template-columns: minmax(110px, 30%) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; padding: 4px 0; }
.barra-h .barra { height: 12px; }
.barra-h .barra span { background: var(--naranja); }
.modal { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px; background: rgba(16, 32, 22, .6); }
.modal-caja { width: min(560px, 100%); max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Aviso flotante ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 4000; max-width: min(92vw, 480px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .25s;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 500;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--rojo); }

/* ---------- Impresión del comprobante ---------- */
@media print {
  .lateral, .top, .barra-inferior, .acciones, .no-imprimir, .toast { display: none !important; }
  .shell { display: block; }
  .vista { padding: 0; max-width: none; }
  .tarjeta { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}

/* ---------- Celular ---------- */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .lateral {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 1000; width: 280px; height: 100%;
    transform: translateX(-105%); transition: transform .22s ease; padding-top: calc(20px + env(safe-area-inset-top));
  }
  .lateral.abierto { transform: none; }
  .solo-movil { display: inline-grid; }
  .top { padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: var(--marca); color: #fff; }
  .top h1 { font-size: 1.1rem; }
  .vista { padding: 14px 16px calc(90px + env(safe-area-inset-bottom)); }
  .barra-inferior {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 800; display: grid; grid-template-columns: repeat(4, 1fr);
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .barra-inferior a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; color: var(--muted); font-size: .72rem; font-weight: 600; }
  .barra-inferior a.activo { color: var(--accent); }
  .barra-inferior .ico { width: 22px; height: 22px; }
  .barra-inferior .burbuja { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; font-size: .65rem; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .carrito-barra { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi strong { font-size: 1.2rem; }
  .accesos { grid-template-columns: 1fr 1fr; }
  .barra-acciones .btn.derecha { margin-left: 0; }
  .pasos-nomina { grid-template-columns: 1fr 1fr; }
  .tres { grid-template-columns: 1fr; }
  .tarjeta { padding: 14px; }
}
@media (max-width: 480px) {
  .dos { grid-template-columns: 1fr; }
  .catalogo { grid-template-columns: 1fr 1fr; gap: 10px; }
  .producto-cuerpo { padding: 10px; }
  .producto-pie { flex-direction: column; align-items: stretch; }
  .producto-pie .btn, .producto-pie .cantidad { width: 100%; justify-content: space-between; }
  .datos { grid-template-columns: 1fr; gap: 0; }
  .datos dt { margin-top: 8px; }
  .planes-pago { grid-template-columns: 1fr; }
  .acciones:not(.izq) .btn { flex: 1; }
  .barra-h { grid-template-columns: 1fr auto; }
  .estados-pedido li { min-width: 0; font-size: .7rem; }
  .estados-pedido li small { display: none; }
  .barra-h .barra { grid-column: 1 / -1; order: 3; }
}
