:root {
  --paper: #F2ECE0;
  --card: #FBF8F2;
  --ink: #1D1A15;
  --muted: #6F675B;
  --line: #E3DACA;
  --fuego: #C2452A;
  --fuego-d: #9E3720;
  --agua: #1E5A57;
  --agua-l: #E1ECEA;
  --ok: #2F7D4F;
  --bad: #B23A2B;
  --r: 14px;
  --sh: 0 1px 0 rgba(29, 26, 21, .05), 0 6px 16px -10px rgba(29, 26, 21, .35);
  --fh: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --fb: 'Figtree', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.4 var(--fb); -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .4; }
button:focus-visible, .input:focus-visible { outline: 2px solid var(--agua); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--fh); font-weight: 600; margin: 0; letter-spacing: -.005em; }
b, .t-price, .amount, .paytotal, .kpi b { font-variant-numeric: tabular-nums; }

#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--ink); color: var(--paper); flex: none; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--fh); font-weight: 600; font-size: 18px; white-space: nowrap; }
.logo { width: 26px; height: 26px; flex: none; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav button { padding: 9px 14px; border-radius: 999px; color: #CFC6B6; font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.nav button.on { background: var(--paper); color: var(--ink); }
.count { background: var(--fuego); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.top-r { display: flex; align-items: center; gap: 8px; }
.pill { display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 7px 11px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #CFC6B6; white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: #5CC28A; box-shadow: 0 0 0 3px rgba(92, 194, 138, .2); }
.pill.off i { background: #E9A23B; box-shadow: 0 0 0 3px rgba(233, 162, 59, .25); }
.lang { padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .22); font-weight: 700; font-size: 12px; }
.who { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-weight: 700; }
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--fuego); color: #fff; display: grid; place-items: center; font-family: var(--fh); font-weight: 600; flex: none; }
.av.big { width: 54px; height: 54px; font-size: 24px; }
.av.sm { width: 22px; height: 22px; font-size: 12px; }

/* ---------- till ---------- */
.till { flex: 1; min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr) 380px; }
.cats { overflow: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; border-right: 1px solid var(--line); }
.cats button {
  display: flex; align-items: center; text-align: left; padding: 12px 14px; min-height: 56px; border-radius: 14px;
  font-family: var(--fh); font-weight: 600; font-size: 16px; line-height: 1.15;
  background: color-mix(in srgb, var(--c) 14%, var(--card)); border: 2px solid color-mix(in srgb, var(--c) 35%, transparent);
  box-shadow: var(--sh); transition: transform .1s, background .12s;
}
.cats button:active { transform: scale(.97); }
.cats button i { display: none; }
.cats button.on { background: var(--c); border-color: var(--c); color: #fff; }
.items { overflow: auto; padding: 20px 20px 110px; }
.items-h { margin-bottom: 16px; }
.items-h h2 { font-size: 28px; }
.items-h p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 62ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.tile { position: relative; background: var(--card); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; display: flex; flex-direction: column; }
.tile::before { content: ""; height: 6px; background: var(--c); flex: none; }
.tile-main { flex: 1; display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 12px 14px 14px; gap: 4px; min-height: 120px; transition: background .12s, transform .12s; }
.tile-main:active { background: #EFE7D8; transform: scale(.985); }
.t-name { font-family: var(--fh); font-weight: 600; font-size: 18px; line-height: 1.15; }
.t-desc { font-size: 12.5px; color: var(--muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-price { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 15px; }
.tile-x { display: flex; align-items: center; gap: 6px; border-top: 1px dashed var(--line); padding: 9px 14px; font-size: 13px; font-weight: 700; color: var(--agua); }
.tile-x:active { background: var(--agua-l); }
.tile.out { opacity: .6; }
.tile.out::before { background: repeating-linear-gradient(45deg, var(--c) 0 6px, transparent 6px 12px); }
.badge { display: inline-block; background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .05em; }

.order { background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.order-h { padding: 18px 18px 8px; display: flex; justify-content: space-between; align-items: center; }
.order-h h2 { font-size: 22px; }
.x { font-size: 28px; line-height: 1; width: 40px; height: 40px; border-radius: 50%; }
.mob { display: none; }
.tabbar { margin: 4px 14px 8px; padding: 10px 12px; background: var(--agua-l); color: var(--agua); border-radius: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.tabbar button { font-weight: 700; text-decoration: underline; }
.lines { flex: 1; overflow: auto; padding: 0 10px; }
.line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.line.new { animation: flash .7s ease-out; }
.qty { display: flex; align-items: center; background: var(--paper); border-radius: 999px; padding: 2px; }
.qty button { width: 32px; height: 32px; border-radius: 50%; font-size: 18px; font-weight: 700; }
.qty button:active { background: var(--line); }
.qty b { min-width: 20px; text-align: center; }
.l-body { text-align: left; display: flex; flex-direction: column; padding-top: 6px; min-width: 0; }
.l-name { font-weight: 700; }
.l-mod { font-size: 12.5px; color: var(--agua); font-weight: 600; }
.l-note { font-size: 12.5px; color: var(--muted); font-style: italic; }
.l-tot { font-weight: 700; padding-top: 6px; }
.order-f { padding: 14px 16px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.tot { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--fh); font-size: 18px; }
.tot b { font-size: 32px; font-weight: 600; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.row-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { color: var(--muted); text-align: center; padding: 40px 12px; margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; font-weight: 700; min-height: 48px; transition: background .12s, transform .1s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--fuego); color: #fff; }
.btn.primary:active:not(:disabled) { background: var(--fuego-d); }
.btn.agua { background: var(--agua); color: #fff; }
.btn.ghost { border: 1.5px solid var(--line); background: var(--card); }
.btn.ghost.danger { border-color: var(--bad); color: var(--bad); }
.btn.big { min-height: 64px; font-size: 20px; font-family: var(--fh); font-weight: 600; }
.btn.full { width: 100%; margin-top: 16px; }
.mobbar { display: none; }

/* ---------- modals ---------- */
.mback { position: fixed; inset: 0; background: rgba(29, 26, 21, .5); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal { background: var(--card); border-radius: 22px; width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); animation: rise .2s cubic-bezier(.2, .8, .3, 1); }
.modal.wide { width: min(760px, 100%); }
.m-h h3 { display: flex; align-items: center; gap: 10px; }
.m-h h3::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--fuego)); flex: none; }
.m-h h3 { font-size: 26px; }
.m-h p { color: var(--muted); margin: 3px 0 0; font-size: 14px; }
.m-g { margin-top: 20px; }
.m-g h4 { font-size: 16px; margin-bottom: 9px; display: flex; gap: 10px; align-items: baseline; }
.m-g h4 small, .lbl { font-family: var(--fb); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; display: flex; gap: 8px; align-items: center; min-height: 50px; }
.opt small { color: var(--muted); font-weight: 700; }
.opt.on { border-color: var(--agua); background: var(--agua-l); color: var(--agua); }
.opt.on small { color: var(--agua); }
.input { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; background: #fff; color: var(--ink); min-height: 46px; }
.input:focus { outline: none; border-color: var(--agua); }
.input:disabled { background: var(--paper); }
.m-f { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.m-f .btn { flex: 1; }
.m-f .btn.primary { flex: 1.6; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { height: 58px; border-radius: 12px; background: var(--paper); font-size: 24px; font-family: var(--fh); font-weight: 500; }
.keypad button:active { background: var(--line); }
.amount { font-family: var(--fh); font-size: 38px; font-weight: 600; margin: 2px 0 12px; }
.paytotal { font-family: var(--fh); font-size: 54px; font-weight: 600; text-align: center; margin: 10px 0 2px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--paper); padding: 5px; border-radius: 14px; }
.seg button { padding: 13px 8px; border-radius: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.seg button.on { background: var(--card); box-shadow: var(--sh); color: var(--agua); }
.cash { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 20px; align-items: start; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; }
.quick button:active { background: var(--agua-l); }
.change { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--paper); display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.change b { font-size: 28px; font-family: var(--fh); font-weight: 600; }
.change.ok { background: #E3F0E7; color: var(--ok); }
.hint { margin: 22px 0 4px; padding: 22px; border-radius: 14px; background: var(--agua-l); color: var(--agua); text-align: center; font-weight: 700; }
.paid { text-align: center; }
.tick { width: 76px; height: 76px; border-radius: 50%; background: #E3F0E7; color: var(--ok); display: grid; place-items: center; margin: 4px auto 14px; animation: pop .35s cubic-bezier(.22, 1, .36, 1); }
.paid h3 { font-size: 28px; }
.paid p { color: var(--muted); margin: 4px 0 0; }
.bigchange { margin: 18px auto 0; padding: 16px 20px; border-radius: 16px; background: var(--paper); display: inline-flex; flex-direction: column; min-width: 220px; }
.bigchange span { font-weight: 700; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.bigchange b { font-family: var(--fh); font-size: 44px; font-weight: 600; }
.tablist { display: grid; gap: 8px; margin-top: 16px; }
.tabpick { display: flex; justify-content: space-between; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line); font-weight: 600; }
.tabpick:active { border-color: var(--agua); background: var(--agua-l); }
.newtab { display: flex; gap: 8px; margin-top: 14px; }
.newtab .input { flex: 1; }
.tablines { margin: 16px 0; border-top: 1px solid var(--line); }
.tl { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tl small { display: block; color: var(--agua); font-size: 12.5px; font-weight: 600; }

.scan-drop { margin-top: 18px; padding: 30px; border: 2px dashed var(--line); border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); }
.scan-drop > svg { width: 40px; height: 40px; }
.reading { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--muted); font-weight: 700; }
.reading img { max-height: 220px; max-width: 100%; border-radius: 12px; box-shadow: var(--sh); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--fuego); animation: spin .8s linear infinite; }
.changes { display: grid; gap: 8px; margin-top: 10px; }
.chg { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 13px 16px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line); cursor: pointer; }
.chg input { width: 20px; height: 20px; accent-color: var(--agua); }
.chg small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.chg em { font-style: normal; font-weight: 700; color: var(--agua); }
.note-demo { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; padding: 10px 12px; background: var(--paper); border-radius: 10px; }

/* ---------- pages ---------- */
.page { flex: 1; overflow: auto; padding: 26px 24px 60px; width: 100%; }
.page > * { max-width: 1160px; margin-left: auto; margin-right: auto; }
.page.narrow > * { max-width: 560px; }
.page-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-h h1 { font-size: 32px; }
.sub { color: var(--muted); margin: 4px 0 0; max-width: 64ch; }
.card { background: var(--card); border-radius: 16px; box-shadow: var(--sh); padding: 20px; }
.card h3 { font-size: 18px; margin-bottom: 12px; }
.card h3.mt { margin-top: 22px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.chip { padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 700; white-space: nowrap; background: var(--card); display: flex; align-items: center; gap: 8px; }
.chip i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.tabgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tabcard { background: var(--card); border-radius: 16px; box-shadow: var(--sh); padding: 18px; text-align: left; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; padding-top: 24px; }
.tabcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--agua); }
.tabcard:active { transform: scale(.99); }
.tc-name { font-family: var(--fh); font-weight: 600; font-size: 20px; }
.tc-meta { font-size: 13px; color: var(--muted); }
.tc-tot { font-family: var(--fh); font-size: 26px; font-weight: 600; margin-top: 10px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi span { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.kpi b { display: block; font-family: var(--fh); font-size: 30px; font-weight: 600; margin-top: 4px; }
.rgrid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 12px; margin-top: 12px; }
.rgrid.even { grid-template-columns: 1fr 1fr; }
.cols { display: flex; align-items: flex-end; gap: 5px; height: 200px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.colbar { width: 100%; background: var(--agua); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.col:hover .colbar { background: var(--fuego); }
.col span { font-size: 11px; color: var(--muted); font-weight: 600; }
.split { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-bottom: 12px; gap: 2px; }
.leg { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.leg > i { width: 10px; height: 10px; border-radius: 3px; }
.leg small { color: var(--muted); font-weight: 700; min-width: 34px; text-align: right; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin-bottom: 11px; font-size: 14px; }
.hbar .track { grid-column: 1 / -1; height: 8px; background: var(--paper); border-radius: 4px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--c, var(--fuego)); border-radius: 4px; }

.mhead, .mrow { display: grid; grid-template-columns: 1.3fr 1.3fr 120px 150px 44px; gap: 10px; align-items: center; }
.mhead { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 12px 6px; }
.mrow { background: var(--card); border-radius: 14px; padding: 10px 12px; box-shadow: var(--sh); margin-bottom: 8px; }
.mgroups { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.mgroups span { font-size: 11.5px; background: var(--agua-l); color: var(--agua); padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.money { position: relative; }
.money span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.money .input { padding-left: 36px; }
.sw { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 700; position: relative; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw i { width: 42px; height: 26px; border-radius: 13px; background: #D2C8B6; position: relative; transition: background .2s; flex: none; }
.sw i::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.sw input:checked + i { background: var(--ok); }
.sw input:checked + i::after { left: 19px; }
.sw input:focus-visible + i { outline: 2px solid var(--agua); outline-offset: 2px; }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: #F6E3DE; color: var(--bad); }

.closegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.summary { display: grid; grid-template-columns: 1fr auto; gap: 10px 0; margin: 0; }
.summary dd { padding-left: 16px; }
.summary dt { color: var(--muted); font-weight: 600; }
.summary dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.summary .sep { border-top: 1px solid var(--line); padding-top: 12px; }
.summary .strong { font-family: var(--fh); font-size: 22px; color: var(--ink); font-weight: 600; border-top: 2px solid var(--ink); padding-top: 10px; }
.diff { margin-top: 16px; padding: 14px 16px; border-radius: 12px; display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; background: var(--paper); }
.diff b { font-family: var(--fh); font-size: 20px; font-weight: 600; }
.diff.ok { background: #E3F0E7; color: var(--ok); }
.diff.short { background: #F6E3DE; color: var(--bad); }
.diff.over { background: #FBF0D9; color: #8A5A0C; }
.counter h4 { font-size: 12px; font-family: var(--fb); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 6px 0 2px; }
.counter h4 ~ h4 { margin-top: 14px; }
.crow { display: grid; grid-template-columns: 84px 1fr 96px; align-items: center; gap: 10px; padding: 3px 0; }
.den { font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 42px; height: 42px; border-radius: 10px; background: var(--paper); font-size: 20px; font-weight: 700; flex: none; }
.stepper button:active { background: var(--line); }
.stepper .input { width: 64px; text-align: center; min-height: 42px; padding: 8px; }
.csub { text-align: right; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.ctotal { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; margin-top: 10px; border-top: 2px solid var(--ink); font-family: var(--fh); font-size: 20px; }
.ctotal b { font-size: 28px; font-weight: 600; }

/* ---------- login ---------- */
.login { flex: 1; display: grid; place-items: center; padding: 20px; overflow: auto;
  background: radial-gradient(1200px 600px at 10% 110%, rgba(30, 90, 87, .14), transparent 60%), radial-gradient(900px 500px at 100% -10%, rgba(194, 69, 42, .14), transparent 60%), var(--paper); }
.login-card { width: min(500px, 100%); background: var(--card); border-radius: 26px; box-shadow: 0 30px 70px -30px rgba(29, 26, 21, .4); padding: 30px 26px 22px; text-align: center; }
.login-brand .logo { width: 54px; height: 54px; }
.login-brand h1 { font-size: 34px; margin-top: 4px; }
.login-brand p { color: var(--muted); margin: 2px 0 24px; letter-spacing: .16em; text-transform: uppercase; font-size: 12px; font-weight: 700; }
.login h2 { font-size: 22px; font-weight: 500; }
.staffgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.staff { padding: 18px 8px 14px; border-radius: 18px; background: var(--paper); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.staff:active { transform: scale(.97); }
.staff b { font-size: 16px; }
.staff small { color: var(--muted); font-size: 12px; font-weight: 600; }
.back { display: block; margin: 0 auto 10px 0; font-weight: 700; color: var(--muted); }
.dots { display: flex; justify-content: center; gap: 16px; margin: 20px 0 6px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); transition: background .1s; }
.dots i.on { background: var(--ink); }
.dots.err { animation: shake .35s; }
.dots.err i { border-color: var(--bad); }
.pin-err { color: var(--bad); font-weight: 700; font-size: 14px; margin: 0 0 12px; }
.pinpad { max-width: 300px; margin: 0 auto; }
.demo { font-size: 12px; color: var(--muted); margin: 22px 0 6px; }
.lang-link { font-weight: 700; color: var(--agua); text-decoration: underline; font-size: 14px; }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px); background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px; font-weight: 700; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 60; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
@keyframes flash { from { background: var(--agua-l); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .till { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr); }
  .cats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .cats button { justify-content: center; text-align: center; padding: 10px 8px; min-height: 52px; font-size: 15px; }
  .items { grid-row: 2; }
  .order { grid-row: 2; grid-column: 2; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .rgrid, .rgrid.even, .closegrid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .top { flex-wrap: wrap; row-gap: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .top-r { margin-left: auto; }
  .pill span, .who-n { display: none; }
  .mhead { display: none; }
  .mrow { grid-template-columns: 1fr 1fr; }
  .mrow .money { grid-column: 1; }
  .mrow .sw { grid-column: 2; }
  .mrow .icon-btn { position: absolute; }
  .mrow { position: relative; padding-right: 54px; }
  .mrow .icon-btn { top: 8px; right: 6px; }
}
@media (max-width: 720px) {
  .till { grid-template-columns: 1fr; }
  .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 10px 12px; }
  .cats button { min-height: 46px; font-size: 13.5px; padding: 6px; border-radius: 12px; }
  .items { padding: 16px 16px 100px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile-main { min-height: 108px; }
  .t-name { font-size: 16.5px; }
  .order { position: fixed; left: 0; right: 0; bottom: 0; height: 88dvh; transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .3, 1); z-index: 30; border-radius: 22px 22px 0 0; border-left: 0; box-shadow: 0 -16px 50px rgba(0, 0, 0, .3); }
  .order.open { transform: none; }
  .mob { display: block; }
  .mobbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); padding: 0 18px; height: 60px; border-radius: 16px; background: var(--fuego); color: #fff; font-weight: 700; z-index: 25; box-shadow: 0 12px 30px -10px rgba(194, 69, 42, .7); }
  .mobbar > span:nth-child(2) { text-align: left; opacity: .9; }
  .mobbar > b { font-family: var(--fh); font-size: 20px; font-weight: 600; }
  .page { padding: 20px 16px 50px; }
  .page-h h1 { font-size: 26px; }
  .cash { grid-template-columns: 1fr; gap: 14px; }
  .paytotal { font-size: 44px; }
  .modal { padding: 20px 18px; }
  .mback { align-items: end; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; max-height: 94dvh; width: 100%; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .seg button span { font-size: 13px; }
  .staffgrid { gap: 8px; }
  .crow { grid-template-columns: 70px 1fr 80px; }
}

/* ---------- print (80mm thermal or A4) ---------- */
#print { display: none; }
@media print {
  @page { margin: 4mm; }
  body { background: #fff; }
  #app, #modal, #toast { display: none !important; }
  #print { display: block; }
  .rc { width: 72mm; font: 12px/1.35 'Courier New', ui-monospace, monospace; color: #000; }
  .rc h1 { font: 700 17px/1.2 'Courier New', monospace; text-align: center; }
  .rc h2 { font: 700 13px/1.2 'Courier New', monospace; text-align: center; margin-top: 6px; text-transform: uppercase; }
  .rc h3 { font: 700 12px/1.2 'Courier New', monospace; margin: 4px 0; text-transform: uppercase; }
  .rc p { margin: 2px 0; }
  .rc .c { text-align: center; }
  .rc .sm { font-size: 10px; }
  .rc hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
  .rl { display: flex; justify-content: space-between; gap: 8px; }
  .rl.b { font-weight: 700; }
  .rm { padding-left: 14px; font-size: 11px; }
}
.paybreak { text-align: center; color: var(--muted); font-weight: 600; margin: 0 0 14px; font-variant-numeric: tabular-nums; }
.fee-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
