/* Tirano POS · herramienta de trabajo: botones grandes, alto contraste, sin adornos */
:root {
  --pizarra: #26292a;
  --pizarra-2: #33373a;
  --naranja: #ffb444;
  --naranja-osc: #b8740a;
  --tinta: #1d1d1b;
  --gris: #6b6862;
  --linea: #dedbd5;
  --fondo: #eeeff0;
  --blanco: #ffffff;
  --rojo: #c0392b;
  --verde: #2e7d4f;
  --radio: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.4 Karla, system-ui, sans-serif; color: var(--tinta); background: var(--fondo); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; }
.loading { padding: 3rem; text-align: center; color: var(--gris); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Barra superior */
.top { position: sticky; top: 0; z-index: 10; background: var(--pizarra); color: #fff; padding: calc(.55rem + env(safe-area-inset-top)) 1rem .55rem; display: flex; align-items: center; gap: .75rem; }
.top h1 { font: 700 1.2rem "Zilla Slab", Georgia, serif; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .who { font-size: .85rem; color: #cfcbc4; }
.top button, .top a { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.35); border-radius: 999px; padding: .4rem .8rem; font-size: .9rem; text-decoration: none; }
.top .back { border: 0; padding: .4rem .2rem; font-size: 1rem; }
.station-dot { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: #cfe9d8; }
.station-dot::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: #4cd38a; }
.station-dot.off { color: #f3c2bb; }
.station-dot.off::before { background: #ff6b5a; }

main { max-width: 72rem; margin: 0 auto; padding: 1rem 1rem calc(7rem + env(safe-area-inset-bottom)); }
h2 { font: 700 1.15rem "Zilla Slab", Georgia, serif; margin: 1.25rem 0 .6rem; }
.muted { color: var(--gris); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 3rem; padding: .7rem 1.1rem; border-radius: var(--radio); border: 0; font-weight: 700; text-decoration: none; }
.btn-main { background: var(--naranja); color: var(--tinta); }
.btn-dark { background: var(--pizarra); color: #fff; }
.btn-line { background: var(--blanco); border: 1.5px solid var(--linea); color: var(--tinta); }
.btn-danger { background: var(--blanco); border: 1.5px solid var(--rojo); color: var(--rojo); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Login */
.login { max-width: 26rem; margin: 0 auto; padding: 2.5rem 1.25rem; text-align: center; }
.login img { width: 6rem; height: 6rem; border-radius: 50%; background: #fff; margin: 0 auto 1rem; display: block; }
.login h1 { font: 700 1.6rem "Zilla Slab", Georgia, serif; margin: 0 0 1.5rem; }
.users { display: grid; gap: .6rem; }
.users button { min-height: 3.5rem; background: var(--blanco); border: 1.5px solid var(--linea); border-radius: var(--radio); font-weight: 700; font-size: 1.1rem; display: flex; justify-content: space-between; align-items: center; padding: 0 1.1rem; }
.users button small { font-weight: 400; color: var(--gris); font-size: .85rem; }
.pin { font-size: 2rem; letter-spacing: .5em; text-align: center; width: 100%; padding: .6rem; border: 2px solid var(--linea); border-radius: var(--radio); background: #fff; margin: 1rem 0; }
.field { display: block; text-align: left; margin: .8rem 0; }
.field span { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .3rem; }
.field input, .field select, .field textarea { width: 100%; padding: .75rem; border: 1.5px solid var(--linea); border-radius: var(--radio); background: #fff; }
.error { color: var(--rojo); font-weight: 700; min-height: 1.4em; }

/* Mesas */
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.6rem, 1fr)); gap: .6rem; }
@media (min-width: 700px) { .tables { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .7rem; } }
.table { position: relative; text-align: left; min-height: 6.2rem; border-radius: var(--radio); border: 1.5px solid var(--linea); background: var(--blanco); padding: .75rem; display: flex; flex-direction: column; gap: .15rem; }
.table .n { font: 700 1.6rem/1 "Zilla Slab", Georgia, serif; }
.table .s { font-size: .8rem; color: var(--gris); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table.busy { background: var(--pizarra); color: #fff; border-color: var(--pizarra); }
.table.busy .s { color: #cfcbc4; }
.table .tot { font-weight: 700; font-size: 1.05rem; margin-top: auto; }
.badge { display: inline-block; background: var(--naranja); color: var(--tinta); font-weight: 700; font-size: .78rem; border-radius: 999px; padding: .1rem .5rem; }
.table .badge { position: absolute; top: .5rem; right: .5rem; font-size: .72rem; }
.row-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* Orden */
.items { list-style: none; margin: 0; padding: 0; background: var(--blanco); border-radius: var(--radio); border: 1.5px solid var(--linea); }
.items li { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .7rem; padding: .75rem .85rem; border-top: 1px solid var(--linea); align-items: start; }
.items li:first-child { border-top: 0; }
.items .q { font-weight: 700; min-width: 1.8rem; }
.items .name { font-weight: 700; }
.items .det { font-size: .88rem; color: var(--gris); }
.items .note { font-size: .88rem; color: var(--naranja-osc); font-weight: 700; }
.items .p { font-weight: 700; text-align: right; white-space: nowrap; }
.items .ctrl { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: center; margin-top: .3rem; }
.items .ctrl button { min-width: 2.75rem; min-height: 2.5rem; border-radius: 8px; border: 1.5px solid var(--linea); background: #fff; font-weight: 700; }
.items .ctrl .del { margin-left: auto; color: var(--rojo); border-color: transparent; }
.items li.void { opacity: .5; }
.items li.void .name, .items li.void .p { text-decoration: line-through; }
.pending-box .items { border-color: var(--naranja); border-width: 2px; }
.ticket-h { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--gris); margin: 1rem 0 .4rem; }
.ticket-h button { background: none; border: 0; color: var(--tinta); text-decoration: underline; font-size: .85rem; padding: .3rem; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--blanco); border-top: 1.5px solid var(--linea); padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); }
.bar .in { max-width: 72rem; margin: 0 auto; display: flex; gap: .6rem; align-items: center; }
.bar .total { margin-right: auto; }
.bar .total small { display: block; color: var(--gris); font-size: .8rem; }
.bar .total strong { font-size: 1.35rem; }

/* Selector de platos (pantalla completa) */
.sheet { position: fixed; inset: 0; z-index: 30; background: var(--fondo); display: flex; flex-direction: column; }
.sheet-head { background: var(--pizarra); color: #fff; padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem; display: flex; gap: .6rem; align-items: center; }
.sheet-head input { flex: 1; padding: .65rem .8rem; border-radius: 8px; border: 0; }
.sheet-head button { background: var(--naranja); color: var(--tinta); border: 0; border-radius: 8px; padding: .65rem 1rem; font-weight: 700; }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding: .6rem 1rem; background: var(--blanco); border-bottom: 1px solid var(--linea); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { white-space: nowrap; border: 1.5px solid var(--linea); background: #fff; border-radius: 999px; padding: .45rem .9rem; font-weight: 500; }
.chips button[aria-pressed="true"] { background: var(--naranja); border-color: var(--naranja); font-weight: 700; }
.sheet-body { flex: 1; overflow-y: auto; padding: .5rem 1rem 2rem; -webkit-overflow-scrolling: touch; }
.prod { width: 100%; display: flex; justify-content: space-between; gap: 1rem; text-align: left; background: var(--blanco); border: 1.5px solid var(--linea); border-radius: var(--radio); padding: .85rem; margin-top: .5rem; min-height: 3.4rem; align-items: center; }
.prod b { font-size: 1.02rem; }
.prod span { white-space: nowrap; color: var(--gris); }
.prod:disabled { opacity: .5; }

/* Modal */
.modal-bg { position: fixed; inset: 0; z-index: 40; background: rgba(20,22,23,.55); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--blanco); width: 100%; max-width: 32rem; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 1.25rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 16px; } }
.modal h3 { font: 700 1.3rem "Zilla Slab", Georgia, serif; margin: 0 0 .25rem; }
.group { margin-top: 1rem; }
.group .gl { font-weight: 700; margin-bottom: .45rem; }
.group .gl em { font-style: normal; font-weight: 400; color: var(--rojo); font-size: .85rem; }
.opts { display: flex; flex-wrap: wrap; gap: .45rem; }
.opts button { border: 1.5px solid var(--linea); background: #fff; border-radius: 8px; padding: .65rem .85rem; min-height: 2.9rem; }
.opts button[aria-pressed="true"] { background: var(--pizarra); color: #fff; border-color: var(--pizarra); font-weight: 700; }
.stepper { display: inline-flex; align-items: center; gap: .8rem; }
.stepper button { width: 3rem; height: 3rem; border-radius: 50%; border: 1.5px solid var(--linea); background: #fff; font-size: 1.4rem; font-weight: 700; }
.stepper output { font-size: 1.4rem; font-weight: 700; min-width: 1.5rem; text-align: center; }
.modal .actions { display: flex; gap: .6rem; margin-top: 1.25rem; }
.modal .actions .btn { flex: 1; }

/* Cobro */
.pay { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .pay { grid-template-columns: 1.1fr .9fr; align-items: start; } }
.card { background: var(--blanco); border: 1.5px solid var(--linea); border-radius: var(--radio); padding: 1rem; }
.sum { display: flex; justify-content: space-between; padding: .3rem 0; }
.sum.big { font-size: 1.5rem; font-weight: 700; border-top: 2px solid var(--tinta); margin-top: .4rem; padding-top: .6rem; }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.methods button, .seg button { min-height: 3rem; border-radius: 8px; border: 1.5px solid var(--linea); background: #fff; font-weight: 500; }
.methods button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--pizarra); color: #fff; border-color: var(--pizarra); font-weight: 700; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.change { font-size: 1.15rem; font-weight: 700; color: var(--verde); }
.done { text-align: center; padding: 3rem 1rem; }
.done h2 { font-size: 1.8rem; }

/* Admin */
.tabs { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: 1rem; }
.tabs button { border: 1.5px solid var(--linea); background: #fff; border-radius: 999px; padding: .5rem 1rem; font-weight: 500; white-space: nowrap; }
.tabs button[aria-pressed="true"] { background: var(--pizarra); color: #fff; border-color: var(--pizarra); font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .7rem; }
.kpi { background: var(--blanco); border: 1.5px solid var(--linea); border-radius: var(--radio); padding: .9rem; }
.kpi small { color: var(--gris); display: block; }
.kpi strong { font-size: 1.45rem; }
table.list { width: 100%; border-collapse: collapse; background: var(--blanco); border-radius: var(--radio); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: .65rem .75rem; border-top: 1px solid var(--linea); }
table.list th { font-size: .82rem; color: var(--gris); font-weight: 700; border-top: 0; }
table.list td.r, table.list th.r { text-align: right; font-variant-numeric: tabular-nums; }
.carta-prod { background: var(--blanco); border: 1.5px solid var(--linea); border-radius: var(--radio); padding: .75rem; margin-top: .5rem; }
.carta-prod .h { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.carta-prod .vs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.carta-prod .vs label { display: flex; align-items: center; gap: .35rem; font-size: .88rem; color: var(--gris); }
.carta-prod .vs input { width: 7rem; padding: .45rem; border: 1.5px solid var(--linea); border-radius: 6px; }
.switch { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; font-weight: 700; }
.switch input { width: 1.3rem; height: 1.3rem; accent-color: var(--verde); }
.carta-prod.off { opacity: .65; }

#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(6.5rem + env(safe-area-inset-bottom)); z-index: 50; display: grid; gap: .4rem; width: min(26rem, 92vw); }
.toast { background: var(--pizarra); color: #fff; padding: .75rem 1rem; border-radius: var(--radio); font-weight: 500; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.err { background: var(--rojo); }

/* ---------- fase 1.5 ---------- */
.link { background: none; border: 0; padding: .3rem 0; color: var(--tinta); text-decoration: underline; font-weight: 700; }
.guests { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .75rem; }
.guests button { min-height: 3.4rem; font-size: 1.3rem; font-weight: 700; border-radius: var(--radio); border: 1.5px solid var(--linea); background: #fff; }
.guests button[aria-pressed="true"] { background: var(--pizarra); color: #fff; border-color: var(--pizarra); }
.order-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; margin: .2rem 0 .4rem; }
.chip-btn { border: 1.5px solid var(--linea); background: #fff; border-radius: 999px; padding: .45rem .9rem; font-weight: 700; }
.items.paid { opacity: .7; }
.table .tot small { font-weight: 400; font-size: .72rem; color: #cfcbc4; }
.seg.two { grid-template-columns: 1fr 1fr; margin-bottom: .5rem; }
.items.pick li { cursor: default; }
.items.pick li.off { opacity: .45; }
.items.pick input { width: 1.4rem; height: 1.4rem; accent-color: var(--pizarra); }
.methods.small { grid-template-columns: repeat(5, 1fr); gap: .35rem; }
.methods.small button { min-height: 2.6rem; font-size: .82rem; padding: 0 .2rem; }
@media (max-width: 480px) { .methods.small { grid-template-columns: repeat(3, 1fr); } }
.pline { border: 1.5px solid var(--linea); border-radius: var(--radio); padding: .7rem; margin-top: .6rem; }
.pline-h { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.pline-h input { width: 9rem; padding: .55rem; border: 1.5px solid var(--linea); border-radius: 8px; text-align: right; font-weight: 700; }
.stepper.small button { width: 2.5rem; height: 2.5rem; font-size: 1.2rem; }
.stepper.small output { font-size: 1.15rem; }
.periods { flex-wrap: wrap; }
.period-t { margin: .2rem 0 .8rem; }
.range { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: .6rem; }
.range .field { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 1.5rem; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.warn { background: #fff4df; border: 1.5px solid var(--naranja); border-radius: var(--radio); padding: .75rem 1rem; font-weight: 700; }
.movform { display: grid; grid-template-columns: 7rem 1fr 7rem auto; gap: .4rem; margin-top: .6rem; }
.movform input, .movform select { padding: .6rem; border: 1.5px solid var(--linea); border-radius: 8px; background: #fff; min-width: 0; }
@media (max-width: 560px) { .movform { grid-template-columns: 1fr 1fr; } }
.closing { margin-top: 1.25rem; max-width: 34rem; }
.diff { font-size: 1.15rem; font-weight: 700; min-height: 1.4em; }
.diff.ok { color: var(--verde); }
.diff.bad, .neg { color: var(--rojo); }

/* Gráfica de barras de una serie */
.chart { display: flex; align-items: flex-end; gap: 2px; height: 11rem; background: var(--blanco); border: 1.5px solid var(--linea); border-radius: var(--radio); padding: 1.6rem .6rem 0; }
.chart .col { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; outline: none; }
.chart .cbar { width: min(100%, 2.4rem); background: var(--naranja-osc); border-radius: 4px 4px 0 0; }
.chart .lbl { font-size: .7rem; color: var(--gris); height: 1.5rem; line-height: 1.5rem; white-space: nowrap; }
.chart .top-v { position: absolute; top: -1.35rem; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.chart .col:hover .cbar, .chart .col:focus .cbar { background: var(--pizarra); }
.chart .col:hover::after, .chart .col:focus::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% - 1rem); left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--pizarra); color: #fff; font-size: .8rem; padding: .35rem .55rem; border-radius: 6px; white-space: nowrap; pointer-events: none;
}
.chart .col:first-child:hover::after, .chart .col:first-child:focus::after { left: 0; transform: none; }
.chart .col:last-child:hover::after, .chart .col:last-child:focus::after { left: auto; right: 0; transform: none; }
