/* Pepes TPV — estilos con la imagen corporativa de Los Pepes */
/* Poppins va dentro del TPV (licencia SIL OFL, fonts/OFL.txt): funciona sin internet */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/poppins-400.woff) format('woff'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/poppins-500.woff) format('woff'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/poppins-700.woff) format('woff'); }

:root {
  /* Imagen corporativa de Los Pepes (lospepesburger.es): rojo #E10000, naranja #F39200, gris #3A3A3A, Poppins */
  --brand-red: #e10000; --brand-red-dark: #b30000; --brand-orange: #f39200; --brand-ink: #1d1d1b; --brand-grey: #3a3a3a;
  --bg: #f6f3ef; --surface: #ffffff; --surface-2: #f3eee8; --border: #e6dfd6; --border-input: #9b9288;
  --text: #262524; --text-muted: #6b6259; --accent: var(--brand-red); --on-accent: #ffffff;
  --accent-2: var(--brand-orange); --on-accent-2: var(--brand-ink); --accent-soft: #fde7e5;
  --danger: #9f1c16; --on-danger: #ffffff; --success: #16834a; --on-success: #ffffff; --warning: #b86a00;
  --table-free: #ffffff; --table-busy: var(--brand-red); --table-reserved: #dbe7f6; --focus: var(--brand-orange);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Menlo, monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  --shadow-card: 0 1px 2px rgba(29,29,27,.06), 0 2px 8px rgba(29,29,27,.06);
  --shadow-pop: 0 18px 48px rgba(29,29,27,.25);
  --fast: 90ms; --ease: cubic-bezier(.2,.8,.2,1);
  --topbar: 64px; --ticket: 380px;
  color-scheme: light;
}
* { box-sizing: border-box; }
/* Márgenes seguros: muesca/isla y barra de inicio del iPhone, bordes en horizontal, barras de Android.
   El hueco de arriba se pinta del color de la barra superior y el de abajo del fondo. */
:root { --sa-t: env(safe-area-inset-top, 0px); --sa-r: env(safe-area-inset-right, 0px); --sa-b: env(safe-area-inset-bottom, 0px); --sa-l: env(safe-area-inset-left, 0px); --notch: var(--brand-red); }
html, body { margin: 0; height: 100%; color: var(--text); font: 500 16px/1.5 var(--font); -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html { background: var(--bg); }
body { padding: var(--sa-t) var(--sa-r) var(--sa-b) var(--sa-l); background: linear-gradient(var(--notch) 50%, var(--bg) 50%) fixed; }
#app { background: var(--bg); }
/* TPV y pantallas: la página no se desplaza entera; cada zona tiene su propio scroll */
html:has(body.app-fixed), body.app-fixed { overflow: hidden; overscroll-behavior: none; }
body.app-fixed #app, body.app-fixed main { overflow: hidden; }
body.app-fixed .order { min-height: 0; overflow: hidden; }
body.app-fixed .order > * { min-height: 0; }
.ticket { overflow-y: auto; }
.actions .btn { min-width: 0; white-space: normal; line-height: 1.15; }
/* iPhone hace zoom al escribir en campos de menos de 16 px */
@supports (-webkit-touch-callout: none) { input, select, textarea { font-size: max(16px, 1em); } }
body { overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
input, textarea, select { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--text-muted); }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* Botones */
.btn { min-height: 48px; padding: 0 18px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border);
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform var(--fast) var(--ease), filter var(--fast); }
a.btn { color: inherit; text-decoration: none; }
.btn:active { transform: scale(.97); filter: brightness(.95); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); border-radius: var(--r-pill); }
.btn.orange { background: var(--accent-2); color: var(--on-accent-2); border-color: var(--accent-2); border-radius: var(--r-pill); }
.btn.success { background: var(--success); color: var(--on-success); border-color: var(--success); border-radius: var(--r-pill); }
.btn.danger { background: var(--danger); color: var(--on-danger); border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.lg { min-height: 64px; font-size: 20px; border-radius: var(--r-pill); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.chip { min-height: 48px; padding: 6px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 2px solid var(--border); font-weight: 600; text-align: left; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.chip .price { color: var(--text-muted); font-size: 14px; margin-left: 6px; }

/* Barra superior */
.topbar { height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--brand-red); color: #fff; border-bottom: 0; box-shadow: 0 2px 8px rgba(29,29,27,.15); }
.topbar .who { color: rgba(255,255,255,.85); }
.topbar .pill { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }
.topbar .pill.warn { background: var(--brand-orange); border-color: var(--brand-orange); color: var(--brand-ink); }
.topbar .pill.err { background: #fff; color: var(--brand-red); border-color: #fff; }
.topbar .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); color: #fff; border-radius: var(--r-pill); }
.topbar .btn.primary, .topbar .btn.orange { background: var(--brand-orange); border-color: var(--brand-orange); color: var(--brand-ink); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: .02em; white-space: nowrap; color: #fff; }
.brand img { height: 44px; width: auto; display: block; }
.brand span { font-weight: 700; opacity: .95; }
.brand b { color: #fff; }
.tabs { display: flex; gap: 6px; margin: 0 auto; }
.tab { min-height: 44px; padding: 0 20px; border-radius: var(--r-pill); font-weight: 700; color: var(--text-muted); }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--brand-red); box-shadow: none; }
.topbar .tab { color: rgba(255,255,255,.88); }
.topbar .tab[aria-selected="true"] { background: #fff; color: var(--brand-red); }
.who { color: var(--text-muted); font-size: 14px; white-space: nowrap; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.pill.warn { color: var(--warning); border-color: var(--warning); }
.pill.err { color: var(--danger); border-color: var(--danger); }

#app { height: 100%; }
main { height: calc(100% - var(--topbar)); }

/* Login */
.center { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 24px; }
.login { width: min(380px, 100%); text-align: center; }
.login h1 { font-size: 26px; margin: 0 0 4px; }
.center:has(> .login) { background: var(--brand-red) url(/brand/fondo.svg) center/480px repeat; }
.card.login { border: 0; box-shadow: var(--shadow-pop); border-radius: 28px; }
.card.login::before { content: ""; display: block; height: 92px; margin: 4px 0 14px; background: url(/brand/logo-los-pepes.svg) center / contain no-repeat; }
.dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0; height: 20px; }
.dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-input); }
.dots span.on { background: var(--accent); border-color: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key { min-height: 64px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); font-size: 26px; font-weight: 700; }
.key:active { filter: brightness(1.3); }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* Pantalla de pedido: categorías | productos | ticket */
.order { display: grid; grid-template-columns: 170px 1fr var(--ticket); height: 100%; }
.cats { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; border-right: 1px solid var(--border); }
.cat { min-height: 56px; border-radius: var(--r-md); padding: 8px 12px; text-align: left; font-weight: 700; background: var(--surface); border-left: 6px solid var(--c, var(--border)); }
.cat[aria-selected="true"] { background: var(--surface-2); outline: 2px solid var(--accent); }
.grid { overflow-y: auto; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: 104px; gap: 10px; align-content: start; }
.tile { position: relative; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card);
  padding: 10px 12px 10px 16px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c, var(--accent)); }
.tile .name { font-weight: 700; line-height: 1.2; }
.tile .price { color: var(--text-muted); font-size: 15px; }
.tile.combo .price::after { content: " · menú"; }
.tile.out { opacity: .4; }
.tile.out .price::after { content: " · AGOTADO"; color: var(--danger); font-weight: 800; }
.tile:active { transform: scale(.97); }
.search { margin: 12px 12px 0; }
input.field, textarea.field, select.field { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--border-input); color: var(--text); font: inherit; }
textarea.field { min-height: 160px; font-family: var(--mono); font-size: 13px; }
label.lbl { display: block; font-size: 14px; color: var(--text-muted); margin: 10px 0 4px; font-weight: 600; }

/* Ticket lateral */
.ticket { display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); min-height: 0; }
.ticket-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.ticket-head h2 { font-size: 20px; margin: 0; flex: 1; line-height: 1.2; }
.ticket-head small { display: block; color: var(--text-muted); font-size: 13px; font-weight: 500; }
.lines { flex: 1; overflow-y: auto; padding: 6px 0; min-height: 0; }
.line { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; gap: 6px; padding: 8px 14px; text-align: left; border-bottom: 1px solid rgba(29,29,27,.06); }
.line .q { font-weight: 800; color: var(--accent); }
.line .n { font-weight: 700; line-height: 1.25; }
.line .sub { display: block; color: var(--text-muted); font-size: 13px; font-weight: 500; }
.line .note { display: block; color: var(--warning); font-size: 13px; }
.line.pending { background: rgba(242,183,5,.07); }
.line.pending .n::after { content: " ●"; color: var(--accent); font-size: 12px; }
.line.voided { opacity: .5; text-decoration: line-through; }
.line.paid .n::before { content: "✓ "; color: var(--success); }
.line[aria-pressed="true"] { background: var(--accent-soft); }
.empty { padding: 32px 16px; text-align: center; color: var(--text-muted); }
.totals { padding: 10px 14px; border-top: 1px solid var(--border); }
.totals .row { display: flex; justify-content: space-between; color: var(--text-muted); }
.totals .big { font-size: 28px; font-weight: 800; color: var(--text); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px 14px; }
.actions .wide { grid-column: span 2; }
.seg { display: inline-flex; background: var(--bg); border-radius: var(--r-md); padding: 3px; border: 1px solid var(--border); }
.seg button { min-height: 40px; padding: 0 12px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--text-muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* Sala */
.floor { display: flex; flex-direction: column; height: 100%; }
.zones { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.plan-wrap { flex: 1; overflow: auto; position: relative; }
.plan { position: relative; transform-origin: 0 0; }
.table { position: absolute; border-radius: var(--r-md); background: var(--table-free); border: 2px solid var(--border); display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-weight: 800; font-size: 22px; box-shadow: var(--shadow-card); }
.table.circle { border-radius: 50%; }
.table.busy { background: var(--table-busy); border-color: var(--brand-red-dark); color: #fff; }
.table.busy small { color: #fff; }
.table small { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.legend { display: flex; gap: 16px; padding: 8px 12px; color: var(--text-muted); font-size: 14px; border-top: 1px solid var(--border); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1px solid var(--border); }

/* Lista de cuentas */
.list-view { height: 100%; overflow-y: auto; padding: 16px; }
.list-view h2 { font-size: 20px; margin: 8px 0 12px; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.acc-card { text-align: left; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); }
.acc-card b { display: block; font-size: 18px; }
.acc-card .amt { font-size: 22px; font-weight: 800; margin: 6px 0; }
.acc-card .pill { display: inline-block; margin: 4px 4px 0 0; white-space: nowrap; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { color: var(--text-muted); font-size: 13px; font-weight: 700; }
.badge { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.badge.paid { color: var(--success); } .badge.voided, .badge.refunded { color: var(--danger); }

/* Modales */
.backdrop { position: fixed; inset: 0; background: rgba(29,29,27,.55); display: grid; place-items: center; padding: calc(16px + var(--sa-t)) calc(16px + var(--sa-r)) calc(16px + var(--sa-b)) calc(16px + var(--sa-l)); z-index: 20; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px - var(--sa-t) - var(--sa-b)); max-height: calc(100dvh - 32px - var(--sa-t) - var(--sa-b)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.modal.wide { width: min(860px, 100%); }
.modal header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.modal header h3 { margin: 0; font-size: 20px; flex: 1; }
.modal .body { padding: 16px 20px; overflow-y: auto; }
.modal footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.group { margin-bottom: 18px; }
.group h4 { margin: 0 0 8px; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.req { font-size: 12px; font-weight: 800; color: var(--on-accent); background: var(--accent); padding: 1px 8px; border-radius: 999px; }
.req.ok { background: var(--success); color: var(--on-success); }
.opt { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 22px; font-weight: 800; }
.stepper output { min-width: 36px; text-align: center; font-weight: 800; font-size: 20px; }
.amount { font-size: 40px; font-weight: 800; text-align: right; padding: 6px 12px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--border-input); margin-bottom: 10px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pay-confirm { text-align: center; padding: 6px 0; }
.pay-confirm .pc-who { font-size: 20px; font-weight: 700; }
.pay-confirm .pc-amount { font-size: 40px; font-weight: 700; margin: 6px 0 2px; }
.pay-confirm .pc-how { font-size: 18px; }
.pay-confirm p { margin: 10px 0 0; }
.menu-list { display: grid; gap: 8px; }
.menu-list .btn { justify-content: flex-start; }
@keyframes fade { from { opacity: 0; } }

/* Avisos */
.toasts { position: fixed; left: 50%; bottom: calc(20px + var(--sa-b)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 40; width: min(520px, calc(100% - 32px)); }
.toast { padding: 14px 18px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow-pop); font-weight: 600; animation: fade var(--fast); }
.toast.err { border-color: var(--danger); color: var(--danger); }
.toast.ok { border-color: var(--success); }

/* Móvil / comandero */
@media (max-width: 1024px) { :root { --ticket: 320px; } .order { grid-template-columns: 130px 1fr var(--ticket); } }
@media (max-width: 760px), (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  .order { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .cats { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 8px; }
  .cat { min-height: 48px; white-space: nowrap; flex: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); grid-auto-rows: 84px; }
  .ticket { border-left: 0; border-top: 1px solid var(--border); max-height: 58vh; }
  .ticket .lines { min-height: 96px; }
  .ticket-head { padding: 8px 12px; }
  .totals .big { font-size: 22px; }
  .actions .btn.lg { min-height: 52px; font-size: 18px; }
  .brand { display: none; }
  .topbar { gap: 6px; padding: 0 8px; }
  .topbar .pill.warn { display: none; }
  .topbar .btn { padding: 0 12px; }
  .tabs { margin: 0; flex: 1; }
  .tab { padding: 0 10px; font-size: 15px; }
  .who { display: none; }
  .pay-grid { grid-template-columns: 1fr; }
}

/* Pedido web por aceptar (en el ticket) */
.web-banner { margin: 8px 12px 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--accent-soft); border: 2px solid var(--accent); display: grid; gap: 6px; }
.web-banner .row { display: flex; gap: 6px; flex-wrap: wrap; }
.web-banner .muted { font-size: 13px; }

/* Reservas */
.res-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.res-day { display: grid; text-transform: none; }
.res-day b { font-size: 18px; }
.res-card a { color: var(--accent); font-weight: 700; text-decoration: none; }
.res-slots { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.res-slot { flex: none; display: grid; text-align: center; padding: 4px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 14px; }
.res-slot small { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.res-slot.some { border-color: var(--brand-orange); }
.res-slot.full { background: var(--accent-soft); border-color: var(--accent); }
.res-group h3 { margin: 14px 0 8px; font-size: 17px; }
.res-card { display: grid; gap: 4px; cursor: default; }
.res-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.res-top b { font-size: 17px; }
.res-meta { font-weight: 600; }
.res-note { color: var(--warning); font-weight: 600; font-size: 14px; }
.res-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.res-card.st-cancelled, .res-card.st-noshow { opacity: .55; }
.pill.ok { color: var(--success); border-color: var(--success); }
.res-tables { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.res-tables .btn { min-width: 64px; }
.table.reserved { background: var(--table-reserved); border-color: #7aa3d6; }

/* Panel → Asistente IA: simulador de conversación */
.ai-log { height: 360px; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-msg { max-width: 80%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; line-height: 1.4; }
.ai-msg.me { align-self: flex-end; background: var(--brand-red, #e10000); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ai-msg.sys { align-self: center; max-width: 95%; font-size: 14px; color: var(--text-muted); text-align: center; background: none; }
.ai-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ai-acts .badge { font-weight: 600; }

/* TPV: avisos de las mesas con QR (pedidos, camarero, cuenta) */
.mreqs { position: fixed; right: calc(12px + var(--sa-r)); top: calc(76px + var(--sa-t)); z-index: 35; display: grid; gap: 8px; width: min(340px, calc(100vw - 24px)); max-height: calc(100vh - 100px); overflow: auto; pointer-events: none; }
.mreq { display: block; text-align: left; pointer-events: auto; background: var(--surface); border: 2px solid var(--brand-orange, #f39200); border-radius: var(--r-lg); padding: 10px 12px; box-shadow: var(--shadow-pop); animation: fade var(--fast); }
.mreq.mreq-order { border-color: var(--brand-red, #e10000); }
.mreq-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mreq-h small { color: var(--text-muted); white-space: nowrap; }
.mreq-items { display: block; font-size: 14px; margin: 6px 0; line-height: 1.35; }
.mreq-a { display: flex; flex-direction: row; gap: 6px; margin-top: 6px; }
.mreq-a .btn { min-height: 44px; border-radius: 999px; width: auto; height: auto; }
.mreq-a .btn { flex: 1; }
.clock-ok { text-align: center; } .clock-ok::before { display: none; } .clock-big { font-size: 64px; } .clock-ok h2 { margin: 6px 0; }

/* Panel → Ventas */
.vt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 12px; }
.vt-kpi { padding: 16px 18px; } .vt-big { font-size: 28px; font-weight: 800; margin: 2px 0; }
.vt-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.vt-cols { display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-top: 8px; }
.vt-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.vt-colbar { width: 100%; max-width: 46px; background: var(--brand-red, #e10000); border-radius: 4px 4px 0 0; }
.vt-col:hover .vt-colbar { opacity: .75; }
.vt-col small { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.vt-bars { display: grid; gap: 6px; }
.vt-row { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; align-items: center; gap: 8px; font-size: 14px; }
.vt-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-track { background: var(--surface-2); border-radius: 4px; height: 12px; }
.vt-fill { background: var(--brand-red, #e10000); height: 12px; border-radius: 4px; min-width: 2px; }
.vt-v { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.vt-heat { display: grid; gap: 2px; font-size: 12px; }
.vt-hh { text-align: center; color: var(--text-muted); } .vt-dn { color: var(--text-muted); align-self: center; }
.vt-cell { height: 28px; border-radius: 4px; background: rgba(225, 0, 0, var(--a)); display: grid; place-items: center; font-weight: 700; color: var(--text); background-color: color-mix(in srgb, #e10000 calc(var(--a) * 100%), var(--surface-2)); }

/* ═══════════ Diseño 1.11: más rápido de leer en hora punta ═══════════ */
:root { --table-long: #f39200; --table-late: #7a0000; }

/* Categorías: la elegida se rellena con su color; el número dice cuántos productos hay */
.cat { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-left-width: 5px; transition: background var(--fast), color var(--fast); }
.cat small { font-size: 12px; font-weight: 700; min-width: 24px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); display: inline-grid; place-items: center; background: var(--surface-2); color: var(--text-muted); }
.cat[aria-selected="true"] { background: var(--c, var(--accent)); color: #fff; outline: none; border-left-color: var(--c, var(--accent)); box-shadow: 0 4px 14px rgba(29,29,27,.18); }
.cat[aria-selected="true"] small { background: rgba(255,255,255,.25); color: #fff; }

/* Productos: con foto se reconocen sin leer. Precio en tinta fuerte, no en gris */
.grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: auto; }
.tile { min-height: 96px; padding: 10px 12px 10px 15px; gap: 6px; }
.tile::before { width: 5px; }
.tile .name { font-size: 16px; }
.tile .price { color: var(--text); font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.tile.photo { padding: 0; min-height: 200px; justify-content: flex-start; }
.tile.photo::before { width: auto; height: 5px; right: 0; bottom: auto; z-index: 1; }
.tile.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; padding: 8px 8px 0; }
.tile.photo .name { padding: 6px 12px 0; }
.tile.photo .price { padding: 0 12px 10px; margin-top: auto; }
.tile.out { opacity: .45; filter: grayscale(.8); }

/* Ticket como una comanda de papel: borde dentado encima del total */
.ticket { background: var(--surface-2); }
.ticket-head { background: var(--surface); }
.ticket .lines { flex: 1; overflow-y: auto; background: var(--surface); min-height: 0; }
.ticket .totals { position: relative; background: var(--surface-2); border-top: 0; padding-top: 18px; }
.ticket .totals::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; filter: drop-shadow(0 2px 1px rgba(29,29,27,.08));
  background: linear-gradient(-45deg, transparent 8px, var(--surface) 0) 0 0 / 16px 12px repeat-x, linear-gradient(45deg, transparent 8px, var(--surface) 0) 0 0 / 16px 12px repeat-x; }
.ticket .totals { padding-top: 22px; }
.ticket .totals .big { font-size: 30px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.line { padding: 10px 14px; border-bottom: 1px dashed rgba(29,29,27,.12); }
.line .q { font-size: 17px; }
.line .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.line.pending { background: #fff8e6; }

/* Avisos arriba y compactos: ya no tapan los botones de cobrar */
.toasts { top: calc(var(--topbar) + 10px + var(--sa-t)); bottom: auto; width: min(460px, calc(100% - 32px)); }
.toast { padding: 10px 14px; font-size: 15px; background: var(--brand-ink); color: #fff; border: 0; border-left: 5px solid var(--brand-orange); animation: toast-in 160ms var(--ease); }
.toast.ok { border-left-color: #2fbf71; } .toast.err { border-left-color: var(--brand-red); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Sala: el color dice cuánto lleva la mesa; un punto naranja si hay platos sin comandar */
.table { transition: background var(--fast); }
.table.busy.long { background: var(--table-long); border-color: #c26f00; color: var(--brand-ink); }
.table.busy.long small { color: var(--brand-ink); }
.table.busy.late { background: var(--table-late); border-color: #4d0000; }
.table.unsent::after { content: ""; position: absolute; top: 8px; right: 8px; width: 14px; height: 14px; border-radius: 50%; background: #ffd23f; box-shadow: 0 0 0 3px rgba(255,255,255,.9); }
.table.circle.unsent::after { top: 14%; right: 14%; }
.legend { flex-wrap: wrap; }
.legend i.dot { border-radius: 50%; background: #ffd23f; border-color: #e0b400; }

/* Cuentas abiertas: una franja de color por tipo (barra, mesa, llevar, delivery, web, kiosko) */
.acc-card { position: relative; overflow: hidden; padding-top: 16px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; }
.acc-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--brand-grey); }
.acc-card.k-table::before { background: var(--brand-red); } .acc-card.k-takeaway::before { background: var(--brand-orange); }
.acc-card.k-delivery::before { background: #2b6cb0; } .acc-card.k-web::before { background: #16834a; } .acc-card.k-kiosk::before { background: #7b3fa0; }
.acc-card .amt { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .cat, .table { transition: none; } }
/* Tablet de 10": columna de categorías estrecha → sin contador */
@media (max-width: 1100px) { .cat small { display: none; } .cat { font-size: 15px; padding: 8px 10px; } }
/* Móvil: poco sitio → baldosas de texto (sin foto), más productos a la vista */
@media (max-width: 760px), (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  .grid { grid-auto-rows: 84px; }
  .tile, .tile.photo { min-height: 0; padding: 8px 10px 8px 13px; justify-content: space-between; }
  .tile.photo img { display: none; }
  .tile.photo::before { width: 5px; height: auto; right: auto; bottom: 0; }
  .tile.photo .name, .tile.photo .price { padding: 0; }
  .tile .name { font-size: 15px; }
  .cat small { display: inline-grid; }
  .toasts { top: calc(var(--topbar) + 6px + var(--sa-t)); }
  .ticket .empty { padding: 16px; } .ticket .empty::before { display: none; }
}

.ticket .empty { margin: auto; padding: 40px 24px; color: var(--text-muted); }
.ticket .empty::before { content: ""; display: block; width: 72px; height: 54px; margin: 0 auto 10px; opacity: .18; background: url(/brand/logo-los-pepes.svg) center / contain no-repeat; filter: grayscale(1); }

/* Modo sin conexión */
.off-banner { min-height: var(--topbar); display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: #5c0d0a; color: #fff; flex-wrap: wrap; }
.off-banner b { font-size: 18px; } .off-banner span { flex: 1; min-width: 220px; }
.off-banner .btn { background: #fff; color: #5c0d0a; }
body.is-offline { --notch: #5c0d0a; }
body.is-offline .off-banner + main { height: calc(100% - var(--topbar)); }
.off-big { background: #fffbe8; border: 2px dashed var(--brand-orange); border-radius: 14px; padding: 14px 18px; font-size: 22px; font-weight: 700; line-height: 1.4; }
.off-big b { display: block; font-size: 28px; margin-bottom: 6px; }
/* Panel → Inventario */
.inv-row { display: grid; grid-template-columns: 1fr 110px 34px auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.inv-table td:not(:first-child), .inv-table th { white-space: nowrap; }
.inv-table td:first-child { min-width: 260px; }

/* Club Los Pepes en el TPV */
.club-pill { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 999px; border: 0; background: #fff3d6; color: #7a4a00; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.club-pill.gift { background: #ffe08a; animation: clubpulse 1.6s ease-in-out infinite; }
@keyframes clubpulse { 50% { box-shadow: 0 0 0 4px #ffe08a88; } }
.club-card { display: grid; gap: 4px; padding: 14px; border-radius: 14px; background: #fff8ec; text-align: center; color: #222; }
.club-pts { font-size: 42px; font-weight: 900; line-height: 1.1; }
.club-pts small { font-size: 16px; font-weight: 600; }
.club-ok { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.club-ok input { width: 22px; height: 22px; flex: none; }

/* Foto del ticket de plataforma (1.16) */
.tk-head { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: start; }
.tk-photo { width: 100%; max-height: 260px; object-fit: contain; object-position: top; border-radius: 10px; border: 1px solid var(--border); background: #fff; cursor: zoom-in; }
.tk-photo.big { position: fixed; inset: 3vh 3vw; width: 94vw; height: 94vh; max-height: none; z-index: 1000; cursor: zoom-out; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.tk-lines { display: grid; gap: 10px; }
.tk-line { border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: grid; gap: 8px; background: var(--surface); }
.tk-line.warn { border-color: #e0a800; background: color-mix(in srgb, #ffc107 12%, var(--surface)); }
.tk-top { display: flex; gap: 8px; align-items: center; }
.tk-qty { display: flex; align-items: center; gap: 6px; }
.tk-qty b { min-width: 22px; text-align: center; font-size: 18px; }
.tk-prod { flex: 1; min-width: 0; font-weight: 700; }
.tk-eur { white-space: nowrap; font-weight: 700; }
.tk-read { font-size: 13px; color: var(--text-muted); }
.tk-groups { display: grid; gap: 6px; }
.tk-g { display: grid; grid-template-columns: 140px 1fr; gap: 8px; align-items: center; font-size: 14px; }
.tk-warn { color: #8a5a00; font-weight: 700; font-size: 14px; }
.tk-total { margin-top: 12px; font-size: 17px; }
.tk-diff { color: #b30000; font-weight: 700; }
@media (max-width: 640px) { .tk-head { grid-template-columns: 1fr; } .tk-photo { max-height: 160px; } .tk-g { grid-template-columns: 1fr; } .tk-top { flex-wrap: wrap; } .tk-prod { flex-basis: 100%; order: 3; } }
.tk-cta { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 18px 12px; }
.tk-cta .btn { width: 100%; max-width: 320px; font-size: 20px; }
.tk-cta p { margin: 0; }

/* Logo del ticket (1.16) */
.logo-box { background: #fff; border: 1px dashed var(--border); border-radius: 10px; padding: 12px; display: flex; justify-content: center; max-width: 360px; }
.logo-prev { width: 100%; max-width: 320px; height: auto; image-rendering: pixelated; }

/* 1.16.3 · Cuentas con globito en la barra de arriba */
.tab-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--brand-orange); color: var(--brand-ink); font-size: 13px; font-weight: 800; vertical-align: 1px; }
.tab { white-space: nowrap; }
.ticket-mini, .sheet-close { display: none; }

/* 1.16.3 · Comandero en móvil: carta a pantalla completa y la cuenta en una barra abajo que se abre */
@media (max-width: 760px), (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  .order { grid-template-rows: auto 1fr auto; }
  .order > section { min-height: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-y: auto; padding-bottom: 12px; }
  .ticket { max-height: none; border-top: 0; box-shadow: 0 -4px 16px rgba(29,29,27,.14); }
  .ticket:not(.open) > :not(.ticket-mini) { display: none; }
  .ticket-mini { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--brand-ink); color: #fff; }
  body:has(.ticket-mini) { background: linear-gradient(var(--notch) 50%, var(--brand-ink) 50%) fixed; }
  .tm-info { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; color: inherit; background: none; border: 0; padding: 2px 0; font: inherit; cursor: pointer; }
  .tm-t { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tm-s { grid-row: 2; font-size: 13px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tm-eur { grid-row: 1 / 3; grid-column: 2; font-size: 20px; font-weight: 800; }
  .tm-up { grid-row: 1 / 3; grid-column: 3; font-size: 18px; opacity: .8; }
  .ticket-mini .btn { flex: none; min-height: 44px; padding: 0 12px; }
  .ticket-mini { flex-wrap: wrap; }
  .ticket-mini > .seg { flex: 1 0 100%; display: flex; background: rgba(255,255,255,.12); border-color: transparent; }
  .ticket-mini > .seg button { flex: 1; color: rgba(255,255,255,.85); }
  .ticket-mini > .seg button[aria-pressed="true"] { color: var(--on-accent); }
  .ticket-mini > .tm-deliv { flex: 1 0 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .ticket-mini > .tm-deliv .btn { width: 100%; }
  .ticket-mini > .tm-deliv .btn:not(.primary) { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); color: #fff; }
  .ticket.open { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; top: calc(var(--topbar) + var(--sa-t, 0px)); display: flex; flex-direction: column; overflow: hidden; }
  .ticket.open > .ticket-mini { display: none; }
  .ticket.open .lines { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
  .ticket.open .actions { padding-bottom: calc(10px + var(--sa-b, 0px)); }
  .sheet-close { display: inline-flex; order: -1; flex: none; }
  .tab { padding: 0 9px; font-size: 14px; }
  .tab-n { margin-left: 4px; min-width: 20px; height: 20px; font-size: 12px; }
}
@media (max-width: 420px) {
  .topbar { gap: 4px; padding: 0 6px; }
  .tabs { gap: 2px; }
  .tab { padding: 0 7px; font-size: 13.5px; min-height: 40px; }
  .topbar .btn { padding: 0 10px; min-height: 40px; }
  .tm-eur { font-size: 18px; }
}

/* 1.16.4 · La barra de arriba nunca se sale: las pestañas se encogen y Caja siempre se ve */
.topbar > * { flex: none; }
.topbar > .tabs { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; justify-content: center; }
.topbar > .tabs::-webkit-scrollbar { display: none; }
.topbar .tab { flex: none; }
.ticket-head { flex-wrap: wrap; }
.ticket-head h2 { min-width: 150px; }
@media (max-width: 1180px) { .brand span { display: none; } .topbar .tab { padding: 0 14px; } }
@media (max-width: 760px), (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  .topbar > .tabs { justify-content: flex-start; }
  .topbar .pill.err { padding: 0 8px; font-size: 0; }
  .topbar .pill.err::before { content: "🖨️ !"; font-size: 15px; }
}
/* Auto-ajuste: en pantallas estrechas el texto y el hueco de las pestañas se encogen con el ancho */
@media (max-width: 760px), (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  .topbar .tab { font-size: clamp(11px, 3.4vw, 15px); padding: 0 clamp(3px, 1.4vw, 10px); }
  .topbar .pill.err { padding: 0 6px; } .topbar .pill.err::before { content: "🖨️!"; font-size: 14px; }
  .topbar .btn { padding: 0 clamp(8px, 2.4vw, 12px); font-size: clamp(13px, 3.8vw, 16px); }
  .topbar .tab-n { min-width: 18px; height: 18px; font-size: 11px; margin-left: 3px; padding: 0 5px; }
}
/* 1.16.6 · Pantalla de contacto del delivery */
.dl-phone { font-size: 22px; font-weight: 700; letter-spacing: .03em; }
.dl-known { min-height: 22px; margin: 6px 0 2px; font-size: 14px; display: grid; gap: 6px; }
.dl-known b { color: var(--success, #188a4d); }
.dl-known .chip { text-align: left; white-space: normal; }

/* 1.17.3 · «Enviar pedido»: naranja de la marca, con relieve, para que no se escape */
.btn.send { background: linear-gradient(#ffad2e, var(--brand-orange)); color: var(--brand-ink); font-weight: 800; letter-spacing: .2px;
  border: 0; border-bottom: 6px solid #a85f00; border-radius: var(--r-pill);
  box-shadow: 0 6px 14px rgba(243,146,0,.45), inset 0 2px 0 rgba(255,255,255,.45); text-shadow: 0 1px 0 rgba(255,255,255,.35);
  transition: transform .06s, box-shadow .06s, border-bottom-width .06s; animation: send-glow 1.6s ease-in-out infinite; }
.btn.send:active:not(:disabled) { transform: translateY(4px); border-bottom-width: 2px; box-shadow: 0 2px 6px rgba(243,146,0,.4), inset 0 2px 0 rgba(255,255,255,.3); }
.btn.send:disabled { background: var(--surface-2); color: var(--text-muted); border-bottom: 2px solid var(--border); box-shadow: none; text-shadow: none; animation: none; opacity: 1; }
@keyframes send-glow { 0%, 100% { box-shadow: 0 6px 14px rgba(243,146,0,.45), inset 0 2px 0 rgba(255,255,255,.45); } 50% { box-shadow: 0 6px 22px rgba(243,146,0,.85), inset 0 2px 0 rgba(255,255,255,.45); } }
@media (prefers-reduced-motion: reduce) { .btn.send { animation: none; } }

/* Insignia con las unidades que ya lleva el pedido (v1.19.4) */
.tile .qty-badge { position: absolute; top: 8px; right: 8px; z-index: 2; min-width: 30px; height: 30px; padding: 0 9px; border-radius: var(--r-pill);
  background: var(--brand-red); color: #fff; font-weight: 800; font-size: 15px; line-height: 1; display: inline-grid; place-items: center;
  font-variant-numeric: tabular-nums; box-shadow: 0 2px 8px rgba(225,0,0,.35), 0 0 0 2px #fff; pointer-events: none; }
.tile.in-order { border-color: var(--c, var(--accent)); box-shadow: 0 0 0 2px var(--c, var(--accent)), var(--shadow-card); }
.tile.in-order .name { padding-right: 34px; }
.tile.photo.in-order .name { padding-right: 12px; }

/* Formas de pago con color propio, para no confundir Tarjeta y Bizum con prisa (v1.19.5) */
.btn.pm-cash { background: #16834a; border-color: #16834a; color: #fff; }
.btn.pm-card { background: #1f3a5f; border-color: #1f3a5f; color: #fff; }
.btn.pm-bizum { background: #05c3dd; border-color: #05c3dd; color: #00323a; }
.btn.pm-cash:disabled, .btn.pm-card:disabled, .btn.pm-bizum:disabled { opacity: .45; }

/* Pase de cocina dentro del TPV (v1.19.6) */
.tab-n.pase-n { background: var(--success); color: #fff; }
.pase-tpv { height: 100%; overflow-y: auto; padding: 14px; }
.pt-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pt-bar h2 { margin: 0; font-size: 22px; }
.pt-bar h2 small { font-size: 16px; color: var(--text-muted); font-weight: 600; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.pt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; display: flex; flex-direction: column; }
.pt-card > header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--brand-ink); color: #fff; font-size: 18px; }
.pt-card.kind-table > header { background: var(--brand-red); }
.pt-card.kind-delivery > header { background: #1f3a5f; }
.pt-card.warn .pt-min { background: var(--brand-orange); color: var(--brand-ink); }
.pt-card.late .pt-min { background: #fff; color: var(--brand-red); animation: pt-blink 1s steps(2) infinite; }
.pt-min { font-weight: 800; padding: 2px 10px; border-radius: var(--r-pill); background: rgba(255,255,255,.18); font-variant-numeric: tabular-nums; }
.pt-sub { padding: 6px 14px; font-size: 14px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.pt-card ul { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.pt-line { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); min-height: 56px; }
.pt-line:active { transform: scale(.98); }
.pt-q { font-weight: 800; color: var(--brand-red); font-size: 18px; }
.pt-n { font-weight: 700; font-size: 17px; display: flex; flex-direction: column; line-height: 1.25; }
.pt-n small { font-weight: 500; font-size: 13px; color: var(--text-muted); }
.pt-n small.punto { color: var(--brand-red); font-weight: 800; text-transform: uppercase; }
.pt-n small.note { color: var(--warning); }
.pt-go { background: var(--success); color: #fff; font-weight: 800; border-radius: var(--r-pill); padding: 8px 14px; }
.pt-line.held { opacity: .75; }
.pt-line.held .pt-go { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.pt-cooking { font-size: 13px; color: var(--text-muted); padding: 2px 8px; }
.pt-card > .btn { margin: 4px 8px 10px; width: auto; }
.pt-held { margin: 4px 14px 12px; font-size: 14px; color: var(--text-muted); }
.pt-empty { display: grid; place-items: center; min-height: 50vh; font-size: 20px; color: var(--text-muted); }
@keyframes pt-blink { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .pt-card.late .pt-min { animation: none; } }

/* Avisos abajo, pequeños y que no tapan nada ni se pueden tocar sin querer (v1.19.7) */
.toasts { top: auto; bottom: calc(16px + var(--sa-b)); width: min(420px, calc(100% - 32px)); gap: 6px; pointer-events: none; }
.toast { padding: 8px 14px; font-size: 14px; border-radius: var(--r-pill); text-align: center; box-shadow: 0 6px 18px rgba(29,29,27,.28); animation: toast-up 160ms var(--ease); }
@keyframes toast-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* En el móvil, encima de la barra de la cuenta */
@media (max-width: 760px), (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) { .toasts { top: auto; bottom: calc(84px + var(--sa-b)); } }
.toast { border-left: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
.toast::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-orange); }
.toast.ok::before { background: #2fbf71; } .toast.err::before { background: #ff5a4f; }

/* 1.27.1: el logo vuelve al inicio; botón «＋ Nuevo» */
button.brand { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
button.brand:active { transform: scale(.96); }
.btn.new-order { font-weight: 800; white-space: nowrap; }

/* 1.27.3: cobro por unidades */
.units-pick { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line, rgba(0,0,0,.1)); }
.units-pick .chip[aria-pressed="true"] { background: var(--brand-orange, #f39200); color: #111; font-weight: 800; }
.line .paid-part { color: var(--success); font-weight: 700; }

/* 1.28.0 · punto recomendado (Fat Smash) */
.recom-note{margin:2px 0 8px;font-size:13px;color:#2e7d32;font-weight:600}
.chip.recom{box-shadow:inset 0 0 0 2px #2e7d32}

/* 1.29.0 · Pantalla autoajustable en cualquier dispositivo */
/* Lo centrado nunca se corta por arriba: si no cabe, empieza arriba y se desplaza */
.center { place-items: safe center; }
.center:has(> .login) { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.backdrop { place-items: safe center; overflow-y: auto; }
/* Móvil en horizontal: más columnas de productos y PIN compacto */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 72px; }
  .login { width: min(600px, 100%); padding-top: 12px; padding-bottom: 12px; }
  .card.login::before { height: 46px; margin: 0 0 6px; }
  .login > div:first-child { display: grid; grid-template-columns: 1fr 1.3fr; column-gap: 18px; align-items: center; }
  .login > div:first-child > :not(.keypad) { grid-column: 1; }
  .login > div:first-child > .keypad { grid-column: 2; grid-row: 1 / span 4; gap: 6px; }
  .login .keypad .key { min-height: 44px; height: 44px; }
  .dots { margin: 10px 0; }
  .modal { max-height: calc(100dvh - 16px); }
  .modal header { padding: 10px 16px; }
  .modal .body { padding: 10px 16px; }
  .modal footer { padding: 8px 16px; }
}
/* Móviles pequeños (≤ 360 px): un poco menos de relleno */
@media (max-width: 360px) {
  .modal header, .modal .body, .modal footer { padding-left: 12px; padding-right: 12px; }
  .grid { gap: 6px; padding-left: 6px; padding-right: 6px; }
}
/* Textos largos (alemán, por ejemplo) nunca rompen el ancho */
.tab, .cat, .chip, .tile .name, .modal h3 { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
