/*
VOICE   Mostrador de taquería: directo, cálido, rápido. Nada que leer de más.
IDEA    La comanda de papel y la canasta: botones grandes como fichas, ticket a la derecha.
PICTURE La pantalla de venta misma: rejilla de guisos + comanda con el total gigante.
COLOUR  Café tostado (#3a1d10) → naranja fuego (#e2531c) de la marca, naranja logo (#f28c28), fondo gris cálido.
TYPE    Young Serif para títulos y montos; Bitter para todo lo demás.
*/
:root {
  --cafe: #3a1d10;
  --cafe-2: #5a2c15;
  --fuego: #e2531c;
  --naranja: #f28c28;
  --crema: #fbf3e8;
  --gris: #ecebe8;
  --gris-2: #dcd9d4;
  --tinta: #24150d;
  --tenue: #6d5a4e;
  --verde: #2f8a4c;
  --rojo: #c0362c;
  --azul: #2f6db3;
  --radio: 14px;
  --sombra: 0 2px 0 rgba(58, 29, 16, .18), 0 6px 18px rgba(58, 29, 16, .10);
  color-scheme: light;
}
* { box-sizing: border-box; min-width: 0; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--gris);
  color: var(--tinta);
  font: 17px/1.45 Bitter, Georgia, serif;
  overflow-x: clip;
  user-select: none;
  -webkit-user-select: none;
}
input, select, textarea { user-select: text; -webkit-user-select: text; }
h1, h2, h3, .serif { font-family: 'Young Serif', Georgia, serif; font-weight: 400; margin: 0; line-height: 1.1; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- barra superior ---------- */
.top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px max(2vw, 14px);
  background: linear-gradient(100deg, var(--cafe) 0%, var(--cafe-2) 55%, var(--fuego) 130%);
  color: #fff;
}
.marca { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.marca .logo { font-family: 'Young Serif', serif; font-size: 26px; letter-spacing: .3px; }
.marca .logo b { color: var(--naranja); font-weight: 400; }
.marca small { opacity: .8; font-size: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  padding: 10px 16px; border-radius: 999px; min-height: 46px;
  background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600;
}
.tab.on { background: #fff; color: var(--cafe); }
.quien { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.quien .salir { background: rgba(255, 255, 255, .16); color: #fff; padding: 10px 14px; border-radius: 10px; min-height: 46px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill.ok { background: rgba(47, 138, 76, .18); color: #bff3cf; }
.pill.warn { background: #ffd8a8; color: #6a3500; }

main { padding: 14px max(2vw, 14px) 28px; max-width: 1400px; margin: 0 auto; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: 12px; font-weight: 700; font-size: 17px;
  background: #fff; color: var(--cafe); box-shadow: var(--sombra);
}
.btn.prim { background: var(--fuego); color: #fff; }
.btn.oscuro { background: var(--cafe); color: #fff; }
.btn.verde { background: var(--verde); color: #fff; }
.btn.rojo { background: var(--rojo); color: #fff; }
.btn.plano { box-shadow: none; background: transparent; text-decoration: underline; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.grande { min-height: 74px; font-size: 24px; border-radius: 16px; }
.btn:active:not(:disabled) { transform: translateY(1px); }

/* ---------- acceso ---------- */
.acceso {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 80% at 10% 0%, var(--fuego) 0%, var(--cafe-2) 45%, var(--cafe) 100%);
}
.acceso .caja {
  width: min(880px, 100%); background: var(--crema); border-radius: 22px; padding: clamp(20px, 4vw, 40px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.acceso h1 { font-size: clamp(30px, 5vw, 44px); color: var(--cafe); }
.acceso h1 b { color: var(--fuego); font-weight: 400; }
.acceso .sub { color: var(--tenue); margin: 6px 0 22px; }
.rejilla-nombres { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.nombre {
  min-height: 92px; border-radius: 16px; background: #fff; box-shadow: var(--sombra);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 12px 16px; text-align: left;
}
.nombre strong { font-size: 20px; }
.nombre span { font-size: 14px; color: var(--tenue); text-transform: capitalize; }
.pin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.pin .puntos { display: flex; gap: 14px; margin: 18px 0; }
.pin .puntos i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--cafe); }
.pin .puntos i.lleno { background: var(--cafe); }
.teclado { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.teclado button { min-height: 76px; border-radius: 16px; background: #fff; box-shadow: var(--sombra); font-size: 32px; font-family: 'Young Serif', serif; }
.teclado button.sec { font-size: 17px; font-family: Bitter, serif; font-weight: 700; color: var(--tenue); }
.error { color: var(--rojo); font-weight: 700; min-height: 1.5em; }

/* ---------- venta ---------- */
.venta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 16px; align-items: start; }
.cats { display: flex; gap: 8px; margin-bottom: 12px; }
.cat { min-height: 54px; padding: 0 22px; border-radius: 12px; background: #fff; font-weight: 800; font-size: 18px; box-shadow: var(--sombra); }
.cat.on { background: var(--cafe); color: #fff; }
.productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.prod {
  position: relative; min-height: 112px; border-radius: 16px; padding: 14px; text-align: left;
  background: #fff; box-shadow: var(--sombra);
  display: flex; flex-direction: column; justify-content: space-between;
  border-top: 7px solid var(--naranja);
}
.prod.bebida { border-top-color: var(--azul); }
.prod.otro { border-top-color: var(--verde); }
.prod strong { font-size: 19px; line-height: 1.15; }
.prod .precio { color: var(--tenue); font-weight: 700; }
.prod .cuantos {
  position: absolute; top: -10px; right: -6px; min-width: 38px; height: 38px; border-radius: 19px; padding: 0 8px;
  background: var(--fuego); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
}
.prod:active { transform: scale(.98); }

.comanda {
  position: sticky; top: 12px; background: var(--crema); border-radius: 18px; box-shadow: var(--sombra);
  display: flex; flex-direction: column; max-height: calc(100vh - 110px); overflow: hidden;
}
.comanda header { padding: 14px 16px 8px; display: flex; justify-content: space-between; align-items: center; }
.comanda h2 { font-size: 24px; color: var(--cafe); }
.tipo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 10px; }
.tipo button { min-height: 52px; border-radius: 12px; font-weight: 800; background: #fff; border: 2px solid var(--gris-2); }
.tipo button.on { background: var(--cafe); color: #fff; border-color: var(--cafe); }
.lineas { overflow-y: auto; padding: 0 16px; flex: 1; min-height: 120px; }
.linea { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--gris-2); }
.linea .n { font-weight: 700; }
.linea .n small { display: block; font-weight: 500; color: var(--tenue); }
.mas-menos { display: flex; align-items: center; gap: 6px; }
.mas-menos button { width: 46px; height: 46px; border-radius: 12px; background: #fff; box-shadow: var(--sombra); font-size: 24px; font-weight: 800; }
.mas-menos b { min-width: 28px; text-align: center; font-size: 20px; }
.linea .imp { min-width: 72px; text-align: right; font-weight: 800; }
.vacio { color: var(--tenue); text-align: center; padding: 30px 10px; }
.total { padding: 12px 16px 16px; border-top: 2px solid var(--gris-2); background: #fff; }
.total .fila { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.total .fila span { color: var(--tenue); font-weight: 700; }
.total .fila strong { font-family: 'Young Serif', serif; font-size: 46px; font-weight: 400; color: var(--cafe); }
.total .acciones { display: grid; grid-template-columns: auto 1fr; gap: 8px; }

/* ---------- cobro ---------- */
.metodos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.metodos button { min-height: 72px; border-radius: 14px; background: #fff; border: 3px solid var(--gris-2); font-weight: 800; font-size: 18px; }
.metodos button.on { border-color: var(--fuego); background: #fff4ec; }
.billetes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.billetes button { min-height: 64px; border-radius: 12px; background: #fff; box-shadow: var(--sombra); font-size: 22px; font-weight: 800; }
.billetes button.on { background: var(--cafe); color: #fff; }
.cobro-total { display: flex; justify-content: space-between; align-items: baseline; }
.cobro-total strong { font-family: 'Young Serif', serif; font-size: 54px; font-weight: 400; }
.cambio { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #eef7f0; display: flex; justify-content: space-between; align-items: baseline; }
.cambio strong { font-family: 'Young Serif', serif; font-size: 40px; font-weight: 400; color: var(--verde); }
.cambio.falta { background: #fdeceb; }
.cambio.falta strong { color: var(--rojo); }
.listo { text-align: center; padding: 10px 0; }
.listo .chulo { width: 96px; height: 96px; margin: 0 auto 10px; border-radius: 50%; background: var(--verde); color: #fff; display: grid; place-items: center; font-size: 58px; }
.listo .grande { font-family: 'Young Serif', serif; font-size: 64px; color: var(--verde); line-height: 1; }

/* ---------- modal y avisos ---------- */
.modal { position: fixed; inset: 0; background: rgba(36, 21, 13, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal .caja { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--crema); border-radius: 20px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.modal .caja.ancha { width: min(860px, 100%); }
.modal h2 { font-size: 30px; color: var(--cafe); margin-bottom: 4px; }
.modal .pie { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; background: var(--cafe); color: #fff; padding: 14px 20px; border-radius: 12px; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); max-width: calc(100vw - 32px); }
.toast.mal { background: var(--rojo); }

/* ---------- tarjetas, tablas, formularios ---------- */
.titulo { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.titulo h1 { font-size: clamp(28px, 4vw, 40px); color: var(--cafe); }
.titulo p { margin: 4px 0 0; color: var(--tenue); }
.card { background: #fff; border-radius: var(--radio); box-shadow: var(--sombra); padding: 16px; }
.card h3 { font-size: 21px; color: var(--cafe); margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border-radius: var(--radio); box-shadow: var(--sombra); padding: 14px 16px; border-left: 6px solid var(--naranja); }
.kpi span { color: var(--tenue); font-weight: 700; font-size: 14px; }
.kpi strong { display: block; font-family: 'Young Serif', serif; font-weight: 400; font-size: clamp(26px, 3vw, 36px); color: var(--cafe); }
.kpi.prim { background: var(--cafe); border-left-color: var(--fuego); }
.kpi.prim span { color: #f3d6c3; }
.kpi.prim strong { color: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th { text-align: left; font-size: 13px; color: var(--tenue); font-weight: 700; padding: 8px; border-bottom: 2px solid var(--gris-2); }
td { padding: 10px 8px; border-bottom: 1px solid var(--gris); vertical-align: middle; }
td.r, th.r { text-align: right; }
tr.cancelada td { color: var(--tenue); text-decoration: line-through; }
.scroll { overflow-x: auto; }
.barras .b { display: grid; grid-template-columns: minmax(80px, 30%) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 0; }
.barras .b .t { height: 22px; background: var(--gris); border-radius: 6px; overflow: hidden; }
.barras .b .t i { display: block; height: 100%; background: linear-gradient(90deg, var(--naranja), var(--fuego)); border-radius: 6px; }
.barras .b span:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.horas { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; align-items: end; height: 170px; padding-top: 10px; }
.horas .h { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.horas .h i { width: 100%; background: linear-gradient(180deg, var(--fuego), var(--naranja)); border-radius: 6px 6px 0 0; min-height: 2px; }
.horas .h small { font-size: 12px; color: var(--tenue); }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chip { min-height: 46px; padding: 0 16px; border-radius: 999px; background: #fff; font-weight: 700; box-shadow: var(--sombra); }
.chip.on { background: var(--cafe); color: #fff; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px 14px; }
.campo { display: flex; flex-direction: column; gap: 4px; }
.campo.full { grid-column: 1 / -1; }
.campo label { font-size: 14px; font-weight: 700; color: var(--tenue); }
input, select, textarea {
  font: inherit; font-size: 17px; min-height: 50px; padding: 10px 12px; border-radius: 10px;
  border: 2px solid var(--gris-2); background: #fff; color: var(--tinta); width: 100%;
}
textarea { min-height: 84px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; min-height: 50px; }
.check input { width: 26px; min-height: 26px; height: 26px; }
.estado { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; text-transform: capitalize; }
.estado.cotizado { background: #fff1d6; color: #7a4a00; }
.estado.confirmado { background: #dcebff; color: #1e4f8a; }
.estado.entregado { background: #dff3e5; color: #1f6a39; }
.estado.cancelado { background: #f2e1df; color: #8a2a22; }
.bajo { color: var(--rojo); font-weight: 800; }
.nota { font-size: 14px; color: var(--tenue); }
.botonera { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.botonera button { min-height: 86px; border-radius: 14px; background: #fff; box-shadow: var(--sombra); font-weight: 800; font-size: 18px; text-align: left; padding: 12px 14px; border-left: 6px solid var(--naranja); }
.botonera button small { display: block; font-weight: 500; color: var(--tenue); font-size: 14px; }
.botonera button.on { background: var(--cafe); color: #fff; }
.botonera button.on small { color: #f3d6c3; }
.tipos-mov { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tipos-mov button { min-height: 80px; border-radius: 14px; background: #fff; box-shadow: var(--sombra); font-weight: 800; font-size: 19px; border: 3px solid transparent; }
.tipos-mov button small { display: block; font-weight: 500; font-size: 13px; color: var(--tenue); }
.tipos-mov button.on { border-color: var(--fuego); background: #fff4ec; }
.cantidad { display: flex; align-items: center; gap: 10px; }
.cantidad button { width: 64px; height: 64px; border-radius: 14px; background: #fff; box-shadow: var(--sombra); font-size: 30px; font-weight: 800; }
.cantidad input { text-align: center; font-size: 28px; font-family: 'Young Serif', serif; max-width: 150px; min-height: 64px; }

@media (max-width: 900px) {
  .venta { grid-template-columns: minmax(0, 1fr); }
  .comanda { position: static; max-height: none; }
  .pin { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .productos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .marca small { display: none; }
  table { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
