/* D'Alfredo's · sistema de caja y comandas
   Colores del local: rojo #E2233A, negro #100D0C, amarillo #F4C63D, crema #F7EEDB. Letra: Archivo (ancha y gruesa en títulos). */
@font-face { font-family: "Archivo"; src: url("../fuentes/Archivo-var.ttf") format("truetype"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }

:root {
  color-scheme: dark;
  --fondo: #100D0C;
  --capa: #1A1615;
  --capa2: #241F1D;
  --capa3: #2F2826;
  --borde: #3A322F;
  --texto: #F7EEDB;
  --gris: #B9AD9C;
  --gris2: #8F8476;
  --amarillo: #F4C63D;
  --amarillo-osc: #C9962A;
  --rojo: #E2233A;
  --rojo-osc: #9E1424;
  --verde: #46C37B;
  --naranjo: #F08A24;
  --radio: 12px;
  --alto-barra: 68px;
  --sombra-flota: 0 18px 50px rgba(0,0,0,.55);
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo); color: var(--texto);
  font: 500 17px/1.4 "Archivo", system-ui, sans-serif; font-stretch: 100%;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
img { display: block; max-width: 100%; }
input, select, textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 10px;
  background: var(--capa2); border: 2px solid var(--borde); font-size: 18px; outline: none;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--amarillo); }
input::placeholder, textarea::placeholder { color: var(--gris2); }
:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 2px; }
.num, .plata { font-variant-numeric: tabular-nums; }
.gris { color: var(--gris); }
.centro { text-align: center; }
.oculto { display: none !important; }
.ancho { font-stretch: 125%; font-weight: 900; text-transform: uppercase; letter-spacing: .005em; }
h1, h2, h3 { font-stretch: 125%; font-weight: 900; text-transform: uppercase; line-height: 1.05; }

/* ───────── Botones ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 22px; border-radius: 12px;
  font-weight: 800; font-size: 18px; text-align: center; line-height: 1.1;
  transition: transform .12s var(--ease), background-color .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-pri { background: var(--amarillo); color: var(--fondo); }
.btn-pri:hover { background: #f8d257; }
.btn-rojo { background: var(--rojo); color: #fff; }
.btn-rojo:hover { background: #ec3a4f; }
.btn-verde { background: var(--verde); color: #0b1f12; }
.btn-sec { background: var(--capa3); color: var(--texto); }
.btn-sec:hover { background: #3a322f; }
.btn-peligro { background: transparent; color: #ff6b7c; box-shadow: inset 0 0 0 2px var(--rojo-osc); }
.btn-peligro:hover { background: rgba(226,35,58,.12); }
.btn-chico { min-height: 44px; padding: 0 14px; font-size: 16px; border-radius: 10px; }
.btn-gigante { min-height: 72px; font-size: 22px; font-stretch: 118%; text-transform: uppercase; font-weight: 900; }
.btn-bloque { width: 100%; }
.btn-x { width: 48px; height: 48px; border-radius: 10px; font-size: 22px; color: var(--gris); }
.btn-x:hover { background: var(--capa3); color: var(--texto); }
.fila-botones { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.fila-botones .btn { flex: 1 1 160px; }

/* ───────── Barra superior ───────── */
.barra {
  position: sticky; top: 0; z-index: 20; height: var(--alto-barra);
  display: flex; align-items: center; gap: 18px; padding: 0 16px;
  background: var(--fondo); border-bottom: 1px solid var(--borde);
}
.barra-logo { height: 40px; width: auto; flex: none; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: 10px;
  color: var(--gris); text-decoration: none; font-weight: 800; font-size: 16px; white-space: nowrap;
}
.nav a:hover { color: var(--texto); background: var(--capa); }
.nav a.activo { color: var(--fondo); background: var(--amarillo); }
.nav a .cuenta { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--rojo); color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.nav a.activo .cuenta { background: var(--fondo); color: var(--amarillo); }
.quien { display: flex; align-items: center; gap: 10px; flex: none; }
.quien-nombre { font-weight: 800; line-height: 1.1; text-align: right; }
.quien-nombre small { display: block; font-weight: 600; color: var(--gris); font-size: 13px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-stretch: 112%; color: var(--fondo); flex: none; }
.estado-red { width: 12px; height: 12px; border-radius: 50%; background: var(--verde); flex: none; }
.estado-red.mal { background: var(--rojo); animation: latido 1s infinite; }
.franja-prueba { background: var(--amarillo); color: var(--fondo); text-align: center; font-weight: 800; font-size: 14px; padding: 6px 12px; }
.franja-sinred { background: var(--rojo); color: #fff; text-align: center; font-weight: 800; padding: 8px 12px; }

.pantalla { padding: 20px 20px 40px; max-width: 1600px; margin: 0 auto; }
.titulo-fila { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.titulo-fila h1 { font-size: 28px; flex: 1; min-width: 200px; }
.titulo-fila .sub { width: 100%; color: var(--gris); margin-top: -8px; }

/* Pestañas grandes */
.pestanas { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.pestana {
  min-height: 52px; padding: 0 20px; border-radius: 12px; background: var(--capa); color: var(--gris);
  font-weight: 800; font-size: 17px; display: inline-flex; align-items: center; gap: 10px;
}
.pestana:hover { color: var(--texto); }
.pestana.activa { background: var(--texto); color: var(--fondo); }
.pestana .cuenta { background: var(--rojo); color: #fff; border-radius: 99px; padding: 1px 9px; font-size: 14px; }

/* Chips de filtro */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 46px; padding: 0 18px; border-radius: 99px; background: var(--capa2); color: var(--texto);
  font-weight: 700; font-size: 16px; white-space: nowrap;
}
.chip.activo { background: var(--amarillo); color: var(--fondo); }

/* Etiquetas de estado */
.etq { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; font-size: 14px; font-weight: 800; white-space: nowrap; flex: none; }
.etq::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.etq-nuevo { background: rgba(244,198,61,.16); color: var(--amarillo); }
.etq-por_confirmar { background: var(--rojo); color: #fff; }
.etq-pagoweb { height: auto; min-height: 36px; white-space: normal; border-radius: 10px; background: rgba(247,238,219,.08); color: var(--texto); font-weight: 700; }
.ped-web { box-shadow: inset 0 0 0 3px var(--rojo); }
.aviso-web { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; background: var(--rojo); color: #fff; border-radius: 16px; padding: 14px 18px; margin-bottom: 16px; animation: llega 1.2s var(--ease); }
.aviso-web span { grid-row: 1 / 3; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.22); }
.aviso-web span svg { width: 24px; height: 24px; }
.aviso-web b { font-size: 19px; font-weight: 900; }
.aviso-web small { font-size: 15px; font-weight: 700; opacity: .9; }
@media (prefers-reduced-motion: reduce) { .aviso-web { animation: none; } }
.etq-preparando { background: rgba(240,138,36,.18); color: #FFA54F; }
.etq-listo { background: rgba(70,195,123,.18); color: #6EE09D; }
.etq-entregado { background: var(--capa3); color: var(--gris); }
.etq-pagado { background: rgba(70,195,123,.18); color: #6EE09D; }
.etq-porpagar { background: rgba(226,35,58,.18); color: #FF7A8A; }
.etq-anulado { background: var(--capa3); color: var(--gris2); text-decoration: line-through; }
.etq-pagado::before, .etq-porpagar::before, .etq-anulado::before { display: none; }

/* ───────── Ventanas ───────── */
.velo {
  position: fixed; inset: 0; z-index: 100; background: rgba(8,6,6,.72);
  display: grid; place-items: center; padding: 16px; animation: aparece .16s var(--ease);
}
.velo.sale { animation: desaparece .16s var(--ease) forwards; }
.ventana {
  width: min(var(--ancho), 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--capa); border-radius: 18px; box-shadow: var(--sombra-flota);
  animation: sube .2s var(--ease);
}
.ventana-cab { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px 24px; background: var(--capa); }
.ventana-cab h2 { flex: 1; font-size: 22px; }
.ventana-cuerpo { padding: 4px 24px 24px; }
.texto-grande { font-size: 19px; line-height: 1.45; }
.campo { display: block; margin-bottom: 16px; }
.campo > span { display: block; font-weight: 800; margin-bottom: 8px; }
.campo small { display: block; color: var(--gris); margin-top: 6px; font-size: 14px; }
.dos-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@keyframes aparece { from { opacity: 0; } }
@keyframes desaparece { to { opacity: 0; } }
@keyframes sube { from { transform: translateY(14px) scale(.98); opacity: 0; } }
@keyframes latido { 50% { opacity: .35; } }

/* Avisos */
.avisos { position: fixed; z-index: 200; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 10px; width: min(560px, calc(100% - 32px)); }
.aviso {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; font-weight: 800; font-size: 18px;
  background: var(--texto); color: var(--fondo); box-shadow: var(--sombra-flota); animation: sube .22s var(--ease);
  transition: opacity .25s, transform .25s;
}
.aviso span { flex: 1; }
.aviso-error { background: var(--rojo); color: #fff; }
.aviso-listo { background: var(--verde); color: #0b1f12; }
.aviso.sale { opacity: 0; transform: translateY(8px); }
.aviso-btn { min-height: 44px; padding: 0 16px; border-radius: 10px; background: rgba(0,0,0,.14); font-weight: 900; }

/* ───────── PIN ───────── */
.pin-puntos { display: flex; justify-content: center; gap: 18px; margin: 8px 0 22px; }
.pin-puntos i { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--gris2); transition: background-color .1s, box-shadow .1s; }
.pin-puntos i.lleno { background: var(--amarillo); box-shadow: none; }
.pin-puntos.mal { animation: sacude .38s; }
.pin-puntos.mal i { box-shadow: inset 0 0 0 2.5px var(--rojo); }
@keyframes sacude { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.pin-teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 0 auto; }
.pin-tecla { height: 72px; border-radius: 16px; background: var(--capa3); font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; transition: transform .1s, background-color .1s; }
.pin-tecla:active { transform: scale(.94); background: var(--borde); }
.pin-borrar { font-size: 26px; color: var(--gris); }

/* ───────── Entrada ───────── */
.entrada { min-height: 100dvh; display: grid; place-items: center; padding: 28px 16px; }
.entrada-caja { width: min(760px, 100%); text-align: center; }
.entrada-logo { width: min(440px, 80%); margin: 0 auto 30px; }
.entrada h1 { font-size: 26px; margin-bottom: 22px; }
.personas { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.persona {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 12px 20px;
  border-radius: 18px; background: var(--capa); transition: transform .12s var(--ease), background-color .15s;
}
.persona:hover { background: var(--capa2); }
.persona:active { transform: scale(.97); }
.persona .avatar { width: 72px; height: 72px; font-size: 26px; }
.persona b { font-size: 20px; font-weight: 900; font-stretch: 112%; }
.persona small { color: var(--gris); font-weight: 700; margin-top: -8px; }
.entrada-pin { max-width: 380px; margin: 0 auto; }
.entrada-pin .avatar { width: 72px; height: 72px; font-size: 26px; margin: 0 auto 10px; }
.entrada-pin h2 { font-size: 24px; margin-bottom: 6px; }
.entrada-pin p { color: var(--gris); margin-bottom: 6px; }
.form-equipo { max-width: 420px; margin: 0 auto; text-align: left; }

/* ───────── Tomar pedido ───────── */
.toma { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.donde-opciones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 24px; }
.donde-op {
  min-height: 96px; border-radius: 16px; background: var(--capa); display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 22px; font-weight: 900; font-stretch: 118%; text-transform: uppercase; transition: transform .12s var(--ease), background-color .15s;
}
.donde-op svg { width: 34px; height: 34px; color: var(--amarillo); }
.donde-op:hover { background: var(--capa2); }
.donde-op:active { transform: scale(.98); }
.donde-op.activo { background: var(--amarillo); color: var(--fondo); }
.donde-op.activo svg { color: var(--fondo); }
.subtitulo { font-size: 19px; margin: 4px 0 14px; }
.mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.mesa {
  aspect-ratio: 1.15; border-radius: 16px; background: var(--capa); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: transform .12s var(--ease), background-color .15s;
}
.mesa:hover { background: var(--capa2); }
.mesa:active { transform: scale(.96); }
.mesa b { font-size: 40px; font-weight: 900; font-stretch: 118%; line-height: 1; font-variant-numeric: tabular-nums; }
.mesa small { font-size: 13px; font-weight: 700; color: var(--gris); }
.mesa.ocupada { box-shadow: inset 0 0 0 3px var(--amarillo); }
.mesa.ocupada small { color: var(--amarillo); }

.carta-cab { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.volver { min-height: 52px; padding: 0 16px 0 10px; border-radius: 12px; background: var(--capa2); font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.volver svg { width: 24px; height: 24px; }
.buscador { position: relative; flex: 1; min-width: 200px; }
.buscador input { padding-left: 48px; }
.buscador svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--gris); pointer-events: none; }
.productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 14px; }
.prod {
  position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: left;
  padding: 14px 14px 16px; border-radius: 16px; background: var(--capa); transition: transform .12s var(--ease), background-color .15s;
}
.prod:hover { background: var(--capa2); }
.prod:active { transform: scale(.97); }
.prod-foto { width: 100%; aspect-ratio: 1; display: grid; place-items: center; margin-bottom: 10px; }
.prod-foto img { width: 92%; height: 92%; object-fit: contain; }
.prod-foto .sin-foto { width: 80%; aspect-ratio: 1; border-radius: 50%; background: var(--capa3); display: grid; place-items: center; font-size: 40px; font-weight: 900; color: var(--gris2); }
.prod-nombre { font-weight: 900; font-stretch: 115%; text-transform: uppercase; font-size: 18px; line-height: 1.1; }
.prod-desc { color: var(--gris); font-size: 14px; line-height: 1.3; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-precio { color: var(--amarillo); font-weight: 900; font-size: 20px; margin-top: auto; padding-top: 8px; font-variant-numeric: tabular-nums; }
.prod-cuenta { position: absolute; top: 10px; right: 10px; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 99px; background: var(--amarillo); color: var(--fondo); font-weight: 900; font-size: 20px; display: grid; place-items: center; animation: brinca .25s var(--ease); }
@keyframes brinca { from { transform: scale(.4); } }
.prod.agotado { opacity: .45; pointer-events: none; }
.prod-agotado { position: absolute; top: 12px; left: 12px; background: var(--rojo); color: #fff; font-weight: 900; font-size: 13px; padding: 5px 10px; border-radius: 8px; letter-spacing: .04em; }
.prod-quedan { color: var(--naranjo); font-size: 13px; font-weight: 800; margin-top: 4px; }

.panel-pedido { position: sticky; top: calc(var(--alto-barra) + 20px); background: var(--capa); border-radius: 18px; display: flex; flex-direction: column; max-height: calc(100dvh - var(--alto-barra) - 40px); }
.panel-cab { padding: 18px 20px 8px; position: relative; }
.cerrar-hoja { display: none; position: absolute; right: 16px; top: 14px; }
.panel-pedido.abierto .cerrar-hoja { display: inline-flex; }
.fila-botones .btn-gigante { flex: 2 1 240px; white-space: nowrap; }
.panel-cab h2 { font-size: 24px; }
.panel-cab .gris { font-weight: 700; }
.lineas { flex: 1; overflow: auto; padding: 6px 12px; min-height: 120px; }
.vacio { color: var(--gris); text-align: center; padding: 40px 18px; font-size: 17px; }
.linea { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; align-items: center; padding: 12px 8px; border-bottom: 1px solid var(--borde); }
.linea:last-child { border-bottom: 0; }
.paso { display: flex; align-items: center; background: var(--capa3); border-radius: 12px; }
.paso button { width: 44px; height: 48px; font-size: 26px; font-weight: 700; display: grid; place-items: center; border-radius: 12px; }
.paso button:active { background: var(--borde); }
.paso b { min-width: 26px; text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; }
.linea-nombre { font-weight: 900; font-stretch: 110%; text-transform: uppercase; line-height: 1.1; }
.linea-nombre small { display: block; font-weight: 700; color: var(--gris); text-transform: none; font-stretch: 100%; font-size: 14px; margin-top: 2px; }
.linea-precio { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.linea-nota { grid-column: 2 / 4; display: flex; align-items: center; gap: 8px; text-align: left; min-height: 40px; padding: 6px 12px; border-radius: 10px; background: var(--capa2); color: var(--gris); font-weight: 700; font-size: 15px; }
.linea-ings { grid-column: 2 / 4; display: flex; align-items: center; gap: 10px; text-align: left; min-height: 40px; padding: 6px 12px; border-radius: 10px; background: rgba(247,238,219,.08); font-size: 15px; }
.linea-ings b { flex: 1; font-weight: 800; }
.linea-ings span { color: var(--gris); font-weight: 700; font-size: 14px; }
.ingredientes-op { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ingredientes-op .chip { min-height: 60px; font-size: 17px; border-radius: 14px; transition: background-color .12s, transform .12s var(--ease), opacity .12s; }
.ingredientes-op .chip:active { transform: scale(.96); }
.ingredientes-op .chip:disabled { opacity: .35; }
.ing-linea { font-weight: 800; }
.linea-nota.tiene { background: rgba(244,198,61,.14); color: var(--amarillo); }
.linea-extra.tiene { background: rgba(226,35,58,.16); }
.fila-amb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 22px; }
.fila-amb .btn svg { width: 20px; height: 20px; }
.precio-amb { display: flex; align-items: center; gap: 4px; }
.precio-amb small { color: var(--gris); font-weight: 700; font-size: 13px; }
.precio-amb input { width: 96px; min-height: 42px; padding: 0 10px; border-radius: 10px; border: 0; background: var(--capa2); color: var(--texto); font: inherit; font-weight: 900; font-size: 17px; text-align: right; box-shadow: inset 0 0 0 2px var(--amarillo-osc); }
.linea-extra.tiene b { color: #fff; }
.ings-elegidos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 52px; margin-bottom: 14px; }
.ings-elegidos .chip { min-height: 44px; }
.ings-cuenta { font-weight: 900; margin-right: 6px; }
.ing-n { margin-left: 6px; font-weight: 900; }
.linea-nota svg { width: 18px; height: 18px; flex: none; }
.extra-entrega { padding: 6px 20px 4px; display: grid; gap: 10px; }
.extra-entrega input { min-height: 48px; font-size: 17px; }
.panel-pie { padding: 14px 20px 20px; border-top: 1px solid var(--borde); }
.total-fila { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.total-fila span { font-weight: 800; color: var(--gris); }
.total-fila b { font-size: 34px; font-weight: 900; font-stretch: 112%; font-variant-numeric: tabular-nums; }
.barra-pedido { display: none; }

/* Notas rápidas */
.notas-rapidas { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.notas-rapidas .chip { min-height: 48px; }
.tamanos-op { display: grid; gap: 12px; }
.tamano-op { min-height: 72px; border-radius: 14px; background: var(--capa2); display: flex; justify-content: space-between; align-items: center; padding: 0 22px; font-size: 22px; font-weight: 900; font-stretch: 112%; text-transform: uppercase; }
.tamano-op:hover { background: var(--capa3); }
.tamano-op span:last-child { color: var(--amarillo); font-variant-numeric: tabular-nums; }

/* ───────── Pedidos (caja / garzón) ───────── */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
.ped { background: var(--capa); border-radius: 16px; padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; transition: background-color .3s; }
.ped.recien { animation: llega 1.2s var(--ease); }
@keyframes llega { 0% { background: rgba(244,198,61,.3); } }
.ped-cab { display: flex; align-items: flex-start; gap: 12px; }
.ped-num { font-size: 30px; font-weight: 900; font-stretch: 112%; line-height: 1; font-variant-numeric: tabular-nums; }
.ped-donde { flex: 1; min-width: 0; }
.ped-donde b { display: block; font-size: 19px; font-weight: 900; font-stretch: 112%; text-transform: uppercase; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ped-donde small { color: var(--gris); font-weight: 700; font-size: 14px; }
.ped-etqs { display: flex; gap: 6px; flex-wrap: wrap; }
.ped-items { list-style: none; display: grid; gap: 4px; font-size: 16px; }
.ped-items li { display: flex; gap: 8px; }
.ped-items li b { min-width: 22px; font-variant-numeric: tabular-nums; }
.ped-items .nota { color: var(--amarillo); font-weight: 700; font-size: 14px; }
.ped-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; border-top: 1px solid var(--borde); }
.ped-total b { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ped-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ped-acciones .btn { min-height: 52px; font-size: 16px; padding: 0 12px; }
.ped-acciones .ancho-total { grid-column: 1 / -1; }
.listado-vacio { background: var(--capa); border-radius: 16px; padding: 48px 24px; text-align: center; color: var(--gris); font-size: 19px; }
.listado-vacio b { display: block; color: var(--texto); font-size: 22px; margin-bottom: 6px; font-stretch: 112%; }

/* Cobrar */
.cobro-total { text-align: center; padding: 8px 0 18px; }
.cobro-total small { display: block; color: var(--gris); font-weight: 800; }
.cobro-total b { font-size: 52px; font-weight: 900; font-stretch: 112%; font-variant-numeric: tabular-nums; line-height: 1.05; }
.formas { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.forma { min-height: 72px; border-radius: 14px; background: var(--capa2); font-weight: 900; font-size: 18px; font-stretch: 110%; text-transform: uppercase; }
.forma.activo { background: var(--amarillo); color: var(--fondo); }
.rapidos { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.rapidos .btn { min-height: 52px; font-variant-numeric: tabular-nums; }
.vuelto { display: flex; justify-content: space-between; align-items: center; background: var(--capa2); border-radius: 14px; padding: 14px 18px; }
.vuelto span { font-weight: 800; font-size: 19px; }
.vuelto b { font-size: 36px; font-weight: 900; font-variant-numeric: tabular-nums; }
.vuelto.falta b { color: #FF7A8A; }
.vuelto.ok b { color: #6EE09D; }
.input-plata { font-size: 30px; font-weight: 900; min-height: 68px; text-align: right; font-variant-numeric: tabular-nums; }
.mesa-junta { display: grid; gap: 8px; margin-bottom: 16px; }
.check-fila { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 16px; border-radius: 12px; background: var(--capa2); font-weight: 700; cursor: pointer; }
.check-fila input { width: 26px; height: 26px; min-height: 0; accent-color: var(--amarillo); flex: none; }
.check-fila span { flex: 1; }

/* ───────── Cocina ───────── */
.cocina { padding: 14px; }
.cocina-cab { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.cocina-cab h1 { font-size: 26px; }
.cocina-reloj { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; margin-left: auto; }
.cocina-cuenta { font-weight: 800; color: var(--gris); font-size: 19px; }
.comandas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.comanda { background: var(--capa); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.comanda.recien { animation: llegaCocina 2.4s var(--ease); }
@keyframes llegaCocina { 0%, 30% { box-shadow: 0 0 0 4px var(--amarillo); transform: scale(1.02); } }
.comanda-cab { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--capa2); }
.comanda-cab .donde { flex: 1; min-width: 0; font-size: 26px; font-weight: 900; font-stretch: 115%; text-transform: uppercase; line-height: 1; }
.comanda-cab .donde small { display: block; font-size: 15px; font-stretch: 100%; text-transform: none; color: var(--gris); font-weight: 700; margin-top: 4px; }
.comanda-cab .n { font-size: 20px; font-weight: 900; color: var(--gris); font-variant-numeric: tabular-nums; }
.reloj-min { min-width: 76px; text-align: center; padding: 6px 10px; border-radius: 12px; font-weight: 900; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; background: rgba(70,195,123,.2); color: #6EE09D; }
.reloj-min small { display: block; font-size: 12px; font-weight: 800; margin-top: 2px; }
.reloj-min.aviso { background: rgba(244,198,61,.22); color: var(--amarillo); }
.reloj-min.alerta { background: var(--rojo); color: #fff; animation: latido 1.2s infinite; }
.comanda.atrasada { box-shadow: inset 0 0 0 3px var(--rojo); }
.comanda-items { list-style: none; padding: 12px 16px; display: grid; gap: 10px; }
.comanda-items li { display: grid; grid-template-columns: 44px 1fr; gap: 4px 10px; align-items: baseline; }
.comanda-items .c { font-size: 30px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; color: var(--amarillo); }
.comanda-items .nom { font-size: 23px; font-weight: 900; font-stretch: 112%; text-transform: uppercase; line-height: 1.05; }
.comanda-items .tam { display: block; font-size: 15px; color: var(--gris); font-weight: 700; text-transform: none; font-stretch: 100%; }
.comanda-items .ings { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.comanda-items .ings b { font-size: 18px; font-weight: 900; padding: 5px 11px; border-radius: 9px; background: var(--texto); color: var(--fondo); }
.comanda-items .ings.extra b { background: var(--rojo); color: #fff; }
.comanda-items .ings.extra em { font-style: normal; font-weight: 900; font-size: 15px; text-transform: uppercase; align-self: center; color: var(--rojo); }
.comanda-items .nota { grid-column: 2; background: var(--amarillo); color: var(--fondo); font-weight: 900; font-size: 19px; padding: 6px 12px; border-radius: 10px; line-height: 1.2; }
.comanda-pie { padding: 4px 16px 16px; display: grid; gap: 8px; margin-top: auto; }
.comanda-pie .btn { min-height: 68px; font-size: 22px; font-stretch: 118%; text-transform: uppercase; font-weight: 900; }
.comanda-tomo { color: var(--gris); font-size: 14px; font-weight: 700; padding: 0 16px 8px; }
.etq-prep { padding: 0 16px 2px; }
.activar-sonido { position: fixed; inset: 0; z-index: 150; background: rgba(16,13,12,.94); display: grid; place-items: center; text-align: center; padding: 24px; }
.activar-sonido .btn { min-height: 96px; font-size: 28px; padding: 0 48px; }
.activar-sonido p { color: var(--gris); margin-top: 18px; font-size: 18px; }
.listos-recien { margin-top: 20px; }
.listos-recien h2 { font-size: 18px; color: var(--gris); margin-bottom: 10px; }
.listos-fila { display: flex; gap: 10px; flex-wrap: wrap; }
.listo-chip { display: flex; align-items: center; gap: 10px; background: var(--capa); border-radius: 12px; padding: 8px 8px 8px 16px; font-weight: 800; }
.listo-chip .btn { min-height: 44px; }

/* ───────── Caja del día ───────── */
.caja-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.bloque { background: var(--capa); border-radius: 18px; padding: 20px 22px; }
.bloque h2 { font-size: 19px; margin-bottom: 14px; }
.cifras { display: grid; gap: 0; }
.cifra { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--borde); font-size: 18px; }
.cifra:last-child { border-bottom: 0; }
.cifra b { font-variant-numeric: tabular-nums; font-weight: 800; }
.cifra.fuerte { font-weight: 900; font-size: 20px; }
.cifra.fuerte b { font-size: 26px; font-weight: 900; color: var(--amarillo); }
.cifra .menos { color: #FF7A8A; }
.mov { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--borde); }
.mov:last-child { border-bottom: 0; }
.mov span { flex: 1; }
.mov small { color: var(--gris); display: block; font-size: 14px; }
.mov b { font-variant-numeric: tabular-nums; }
.dif { text-align: center; border-radius: 16px; padding: 18px; margin: 14px 0; background: var(--capa2); }
.dif b { display: block; font-size: 40px; font-weight: 900; font-stretch: 112%; font-variant-numeric: tabular-nums; }
.dif.sobra b { color: #6EE09D; } .dif.falta b { color: #FF7A8A; }
.abrir-caja { max-width: 560px; margin: 30px auto; text-align: center; }
.abrir-caja h1 { font-size: 30px; margin-bottom: 8px; }
.abrir-caja p { color: var(--gris); margin-bottom: 22px; font-size: 18px; }

/* ───────── Tablas y panel del dueño ───────── */
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 14px; font-weight: 700; color: var(--gris); padding: 10px 12px; }
.tabla td { padding: 12px; border-top: 1px solid var(--borde); vertical-align: middle; }
.tabla .der { text-align: right; font-variant-numeric: tabular-nums; }
.tabla tr.clic { cursor: pointer; }
.tabla tr.clic:hover td { background: var(--capa2); }
.prod-fila { display: flex; align-items: center; gap: 14px; }
.prod-fila img, .prod-fila .mini { width: 56px; height: 56px; object-fit: contain; flex: none; border-radius: 10px; }
.prod-fila .mini { background: var(--capa3); display: grid; place-items: center; font-weight: 900; color: var(--gris2); }
.prod-fila b { font-weight: 900; font-stretch: 110%; text-transform: uppercase; }
.prod-fila small { display: block; color: var(--gris); font-size: 14px; }
.interruptor { position: relative; width: 64px; height: 38px; border-radius: 99px; background: var(--capa3); flex: none; transition: background-color .15s; }
.interruptor::after { content: ""; position: absolute; top: 4px; left: 4px; width: 30px; height: 30px; border-radius: 50%; background: var(--gris); transition: transform .18s var(--ease), background-color .15s; }
.interruptor[aria-checked="true"] { background: var(--rojo); }
.interruptor[aria-checked="true"]::after { transform: translateX(26px); background: #fff; }
.interruptor.verde[aria-checked="true"] { background: var(--verde); }
.inter-fila { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.foto-subir { display: flex; align-items: center; gap: 16px; }
.foto-subir .vista { width: 110px; height: 110px; border-radius: 14px; background: var(--capa2); display: grid; place-items: center; overflow: hidden; flex: none; }
.foto-subir .vista img { width: 100%; height: 100%; object-fit: contain; }
.precios-tam { display: grid; gap: 10px; }
.precio-tam { display: grid; grid-template-columns: 1fr 180px; gap: 12px; align-items: center; font-weight: 800; }
.lista-simple { display: grid; gap: 8px; }
.item-simple { display: flex; align-items: center; gap: 12px; background: var(--capa2); border-radius: 12px; padding: 10px 10px 10px 18px; min-height: 64px; }
.item-simple > span { flex: 1; font-weight: 800; }
.item-simple small { display: block; color: var(--gris); font-weight: 600; font-size: 14px; }

/* ───────── Ventas ───────── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--capa); border-radius: 18px; margin-bottom: 20px; }
.kpi { padding: 20px 22px; border-left: 1px solid var(--borde); }
.kpi:first-child { border-left: 0; }
.kpi small { display: block; color: var(--gris); font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.kpi b { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi.lider b { font-size: 40px; color: var(--amarillo); font-weight: 900; }
.reportes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.barras-h { display: grid; gap: 12px; }
.barra-h { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.barra-h span { font-weight: 800; }
.barra-h b { font-variant-numeric: tabular-nums; }
.barra-h small { color: var(--gris); font-weight: 600; }
.barra-h i { grid-column: 1 / -1; height: 10px; border-radius: 99px; background: var(--capa3); overflow: hidden; display: block; }
.barra-h i::after { content: ""; display: block; height: 100%; width: var(--p); background: var(--amarillo); border-radius: 99px; }
.barra-h:first-child i::after { background: var(--rojo); }
.horas { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 24px; }
.hora-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.hora-col i { width: 100%; max-width: 44px; background: var(--capa3); border-radius: 6px 6px 0 0; height: var(--h); min-height: 2px; position: relative; }
.hora-col.pico i { background: var(--amarillo); }
.hora-col i::before { content: attr(data-n); position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 800; color: var(--gris); }
.hora-col.pico i::before { color: var(--amarillo); }
.hora-col small { font-size: 13px; color: var(--gris); font-weight: 700; font-variant-numeric: tabular-nums; }
.historial-cab { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.historial-cab h2 { font-size: 20px; flex: 1; }
.rango { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rango input { width: auto; min-height: 48px; }

/* ───────── Ganancias ───────── */
.kpis.kpis3 { grid-template-columns: repeat(3, 1fr); }
.kpis3 .kpi b { font-size: 36px; }
.kpis3 .kpi.lider b { color: #6EE09D; font-size: 42px; }
.mes-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.mes-nav b { font-size: 22px; font-weight: 900; font-stretch: 115%; text-transform: uppercase; min-width: 230px; text-align: center; }
.mes-nav .btn svg { width: 24px; height: 24px; }
.kpi.lider.neg b, .total-neto.neg b, .mes-col b.neg { color: #FF7A8A !important; }
.total-neto b { color: #6EE09D !important; }
.cifra small { font-weight: 600; font-size: 14px; }
.semaforo { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 14px; background: var(--capa2); }
.semaforo b { font-size: 40px; font-weight: 900; font-stretch: 112%; font-variant-numeric: tabular-nums; flex: none; }
.semaforo span { font-weight: 700; }
.semaforo.bien b { color: #6EE09D; } .semaforo.ojo b { color: var(--amarillo); } .semaforo.alto b { color: #FF7A8A; }
.pill-bien, .pill-ojo, .pill-alto { display: inline-block; padding: 3px 10px; border-radius: 99px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.pill-bien { background: rgba(70,195,123,.18); color: #6EE09D; }
.pill-ojo { background: rgba(244,198,61,.18); color: var(--amarillo); }
.pill-alto { background: rgba(226,35,58,.2); color: #FF7A8A; }
.pe-barra { height: 14px; border-radius: 99px; background: var(--capa3); overflow: hidden; margin-top: 14px; }
.pe-barra i { display: block; height: 100%; background: var(--amarillo); border-radius: 99px; transition: width .6s var(--ease); }
.leyenda { display: flex; gap: 18px; color: var(--gris); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.leyenda span { display: inline-flex; align-items: center; gap: 8px; }
.leyenda i { width: 12px; height: 12px; border-radius: 3px; }
.lv, .bv { background: var(--amarillo); } .lg, .bg { background: #8F8476; }
.meses-graf { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; align-items: end; }
.mes-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.barras2 { height: 170px; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.barras2 i { width: 36%; max-width: 40px; min-height: 2px; border-radius: 6px 6px 0 0; }
.mes-col b { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mes-col small { color: var(--gris); font-weight: 800; text-transform: uppercase; font-size: 13px; }
.mes-col.actual small { color: var(--amarillo); }
.receta-fila { display: grid; grid-template-columns: minmax(0, 1fr) 150px 100px 48px; gap: 10px; align-items: center; margin-bottom: 8px; }
.receta-fila b { text-align: right; }
.receta-cant { position: relative; display: block; }
.receta-cant input { padding-right: 48px; text-align: right; }
.receta-cant span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--gris); font-weight: 700; font-size: 14px; }

/* ───────── Tablet vertical / celular ───────── */
@media (max-width: 1100px) {
  .toma { grid-template-columns: 1fr; }
  .panel-pedido { display: none; }
  .panel-pedido.abierto {
    display: flex; position: fixed; inset: auto 0 0 0; top: auto; z-index: 60; max-height: 88dvh;
    border-radius: 22px 22px 0 0; box-shadow: var(--sombra-flota); animation: subeHoja .24s var(--ease);
  }
  .velo-hoja { position: fixed; inset: 0; z-index: 55; background: rgba(8,6,6,.6); animation: aparece .2s; }
  .barra-pedido {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; gap: 10px;
    background: var(--capa2); border-radius: 18px; padding: 10px; box-shadow: var(--sombra-flota);
  }
  .barra-pedido .ver { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: left; padding: 0 12px; min-height: 60px; border-radius: 12px; }
  .barra-pedido .ver small { color: var(--gris); font-weight: 700; }
  .barra-pedido .ver b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
  .toma { padding-bottom: 96px; }
  .caja-grid, .reportes-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(3) { border-left: 0; border-top: 1px solid var(--borde); }
  .kpi:nth-child(4) { border-top: 1px solid var(--borde); }
}
@keyframes subeHoja { from { transform: translateY(100%); } }
@media (max-width: 760px) {
  body { font-size: 16px; }
  .pantalla { padding: 14px 14px 32px; }
  .barra { gap: 10px; padding: 0 10px; }
  .barra-logo { height: 30px; }
  .quien-nombre { display: none; }
  .donde-op { min-height: 76px; font-size: 17px; flex-direction: column; gap: 6px; }
  .donde-op svg { width: 28px; height: 28px; }
  .mesas { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .mesa b { font-size: 32px; }
  .productos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .prod { padding: 10px 10px 12px; }
  .prod-nombre { font-size: 16px; }
  .tarjetas, .comandas { grid-template-columns: 1fr; }
  .dos-campos { grid-template-columns: 1fr; }
  .titulo-fila h1 { font-size: 22px; }
  .ventana-cuerpo { padding: 4px 16px 20px; }
  .ventana-cab { padding-left: 16px; }
  .cobro-total b { font-size: 42px; }
  .precio-tam { grid-template-columns: 1fr 140px; }
  .ocultar-cel { display: none; }
  .kpi { padding: 14px; min-width: 0; }
  .kpi b { font-size: 21px; white-space: nowrap; }
  .kpi.lider b { font-size: 24px; }
  .kpis.kpis3 { grid-template-columns: 1fr; }
  .kpis3 .kpi { border-left: 0; border-top: 1px solid var(--borde); }
  .kpis3 .kpi:first-child { border-top: 0; }
  .kpis3 .kpi b { font-size: 28px; }
  .kpis3 .kpi.lider b { font-size: 32px; }
  .kpi small { font-size: 13px; }
  .receta-fila { grid-template-columns: 1fr 1fr 40px; }
  .receta-fila select { grid-column: 1 / -1; }
  .meses-graf { gap: 6px; }
  .mes-col b { font-size: 12px; }
  .mes-nav b { min-width: 0; flex: 1; font-size: 18px; }
  .barra-pedido .btn-gigante { font-size: 17px; padding: 0 14px; }
  .barra-pedido .ver b { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print { body > *:not(iframe) { display: none !important; } }
