/* Los de Camarón — POS  ·  estilos */
:root {
  --bg: #f5f2ec;
  --panel: #ffffff;
  --panel-2: #faf8f4;
  --ink: #1b2830;
  --ink-2: #4c5a63;
  --muted: #7a868d;
  --line: #e6dfd4;
  --line-2: #efe9df;
  --brand: #e8603c;
  --brand-2: #cf4f2d;
  --brand-soft: #fdebe5;
  --on-brand: #ffffff;
  --nav: #13232e;
  --nav-ink: #b9c7cf;
  --nav-active: #233a49;
  --ok: #2b8a3e;
  --ok-soft: #e6f6ea;
  --warn: #b35c00;
  --warn-soft: #fff1dc;
  --danger: #c92a2a;
  --danger-soft: #fdecec;
  --info: #1864ab;
  --info-soft: #e5f0fb;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 4px 14px rgba(20, 30, 40, .06);
  --shadow-lg: 0 20px 60px rgba(10, 20, 30, .25);
  --r: 14px;
  --r-sm: 10px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1a21; --panel: #172630; --panel-2: #1c2e3a; --ink: #e8eef1; --ink-2: #b7c4cb; --muted: #8796a0;
  --line: #2a3e4b; --line-2: #22343f; --brand: #f0734f; --brand-2: #e8603c; --brand-soft: #3a2621; --on-brand: #fff;
  --nav: #0a141a; --nav-ink: #9fb1bc; --nav-active: #1d303c;
  --ok: #51cf66; --ok-soft: #173326; --warn: #ffa94d; --warn-soft: #3a2a14; --danger: #ff6b6b; --danger-soft: #3b1f22;
  --info: #74c0fc; --info-soft: #172d40; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 20px 60px rgba(0,0,0,.6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1a21; --panel: #172630; --panel-2: #1c2e3a; --ink: #e8eef1; --ink-2: #b7c4cb; --muted: #8796a0;
    --line: #2a3e4b; --line-2: #22343f; --brand: #f0734f; --brand-2: #e8603c; --brand-soft: #3a2621; --on-brand: #fff;
    --nav: #0a141a; --nav-ink: #9fb1bc; --nav-active: #1d303c;
    --ok: #51cf66; --ok-soft: #173326; --warn: #ffa94d; --warn-soft: #3a2a14; --danger: #ff6b6b; --danger-soft: #3b1f22;
    --info: #74c0fc; --info-soft: #172d40; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 20px 60px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input, select, textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 12px; min-height: 46px; outline: none;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); }
label.f { display: block; font-size: 13px; color: var(--ink-2); margin: 12px 0 5px; font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.hide { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font-weight: 600; white-space: nowrap; user-select: none;
  transition: transform .06s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.lg { min-height: 56px; font-size: 17px; padding: 0 22px; border-radius: var(--r); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.icon { padding: 0; width: 46px; }
.btn.sm.icon { width: 36px; }
.btn.block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); font-weight: 600; white-space: nowrap; color: var(--ink-2);
}
.chip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand-2); }

.seg { display: flex; background: var(--line-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; min-height: 40px; border-radius: 9px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: 92px 1fr; height: 100vh; height: 100dvh; }
.side { background: var(--nav); color: var(--nav-ink); display: flex; flex-direction: column; align-items: stretch; padding: 10px 8px; gap: 4px; overflow-y: auto; }
.side .logo { display: grid; place-items: center; height: 56px; margin-bottom: 6px; }
.side .logo img { width: 46px; height: 46px; border-radius: 50%; background: #fff; }
.side a, .side button.nav {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px;
  color: inherit; text-decoration: none; font-size: 12px; font-weight: 600; border: 0; background: transparent;
}
.side a svg, .side button.nav svg { width: 24px; height: 24px; }
.side a.on { background: var(--nav-active); color: #fff; }
.side a.on svg { color: var(--brand); }
.side .spacer { flex: 1; }
.side .me { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin: 0 auto; }
main#view { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.page { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--panel); min-height: 70px; flex-wrap: wrap; }
.topbar h1 { font-size: 21px; margin: 0; flex: 1; min-width: 140px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad { padding: 18px; }
.card h3 { margin: 0 0 12px; font-size: 16px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 44px; margin-bottom: 8px; }

table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); position: sticky; top: 0; }
table.t td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--panel-2); }
.table-wrap { overflow-x: auto; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi .l { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.brand { background: var(--nav); border-color: var(--nav); color: #fff; }
.kpi.brand .l, .kpi.brand .s { color: var(--nav-ink); }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #1f3a4a, var(--nav) 60%); padding: 20px; }
.login .box { width: 100%; max-width: 360px; text-align: center; color: #fff; }
.login img.login-logo { display: block; width: 190px; height: 190px; max-width: 60vw; max-height: 60vw; margin: 0 auto 16px; border-radius: 50%; background: #fff; box-shadow: 0 10px 34px rgba(0, 0, 0, .45); }
@media (max-height: 640px) { .login img.login-logo { width: 130px; height: 130px; } }
.login h1 { margin: 14px 0 2px; font-size: 26px; }
.login p { margin: 0 0 22px; color: var(--nav-ink); }
.dots { display: flex; justify-content: center; gap: 14px; height: 22px; margin-bottom: 22px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #5d7686; }
.dots i.f { background: var(--brand); border-color: var(--brand); }
.dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keypad button { height: 72px; border-radius: 18px; border: 0; background: rgba(255,255,255,.08); color: #fff; font-size: 28px; font-weight: 600; }
.keypad button:active { background: rgba(255,255,255,.2); }
.keypad button.go { background: var(--brand); }
.login .err { color: #ffa8a8; min-height: 22px; margin-top: 14px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 400px; height: 100%; min-height: 0; }
.pos-menu { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pos-top { display: flex; gap: 10px; padding: 14px 18px 8px; }
.search { position: relative; flex: 1; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; color: var(--muted); }
.search input { padding-left: 40px; }
.cats { display: flex; gap: 8px; padding: 6px 18px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.cats::-webkit-scrollbar { display: none; }
.products { flex: 1; overflow-y: auto; padding: 4px 18px 100px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start; }
.prod {
  position: relative; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r);
  padding: 12px; min-height: 124px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform .08s;
}
.prod::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, var(--brand)); }
.prod:active { transform: scale(.96); }
.prod .em { font-size: 30px; line-height: 1; }
.prod .n { font-weight: 600; font-size: 14.5px; line-height: 1.25; flex: 1; }
.prod .p { font-weight: 700; color: var(--brand-2); font-variant-numeric: tabular-nums; }
.prod .q { position: absolute; top: 8px; right: 8px; background: var(--brand); color: #fff; font-weight: 700; min-width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; font-size: 13px; padding: 0 7px; }
.prod.off { opacity: .45; }
.prod.pulse { animation: pulse .25s; }
@keyframes pulse { 50% { transform: scale(.94); background: var(--brand-soft); } }

.pos-cart { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cart-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.cart-head .title { display: flex; align-items: center; gap: 8px; }
.cart-head .title b { font-size: 17px; flex: 1; }
.ctx { display: flex; gap: 8px; }
.ctx .btn { flex: 1; justify-content: flex-start; font-weight: 600; min-width: 0; }
.ctx .btn span { overflow: hidden; text-overflow: ellipsis; }
.ctx .btn.need { border-style: dashed; border-color: var(--brand); color: var(--brand-2); }
.cart-items { flex: 1; overflow-y: auto; padding: 6px 0; }
.ci { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.ci .nm { font-weight: 600; cursor: pointer; }
.ci .nt { font-size: 13px; color: var(--warn); font-style: italic; }
.ci .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ci .lt { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.stepper { display: flex; align-items: center; gap: 2px; justify-self: end; }
.stepper button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); font-size: 20px; font-weight: 700; display: grid; place-items: center; }
.stepper b { min-width: 30px; text-align: center; font-size: 16px; }
.cart-foot { border-top: 1px solid var(--line); padding: 12px 16px 16px; background: var(--panel-2); }
.tot { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); padding: 2px 0; }
.tot.big { font-size: 22px; font-weight: 800; color: var(--ink); padding-top: 6px; }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.cart-actions .full { grid-column: 1 / -1; }
.cart-fab { display: none; }
.cart-close { display: none; }

/* ---------- Mesas ---------- */
.zone-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 10px; }
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.tbl { border: 2px solid var(--line); background: var(--panel); border-radius: var(--r); padding: 14px; min-height: 108px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.tbl .n { font-weight: 700; font-size: 17px; }
.tbl.busy { border-color: var(--brand); background: var(--brand-soft); }
.tbl.paid { border-color: var(--ok); background: var(--ok-soft); }
.tbl .s { font-size: 13px; color: var(--ink-2); }
.tbl .amt { font-weight: 700; font-size: 16px; margin-top: auto; font-variant-numeric: tabular-nums; }

.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.oc { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.oc .h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.oc .h b { font-size: 16px; }
.when { font-weight: 700; color: var(--brand-2); }
.oc.late { border-color: var(--danger); }
.oc.late .when { color: var(--danger); }
.ctx .btn.sched { border-color: var(--brand); color: var(--brand-2); background: var(--brand-soft); }

/* ---------- Cocina ---------- */
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; align-items: start; }
.kc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.kc .kh { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--ok-soft); border-bottom: 1px solid var(--line); }
.kc.t2 .kh { background: var(--warn-soft); }
.kc.t3 .kh { background: var(--danger-soft); }
.kc .kh b { font-size: 17px; }
.kc .tm { font-weight: 800; font-variant-numeric: tabular-nums; }
.kc.t3 .tm { color: var(--danger); }
.kc ul { list-style: none; margin: 0; padding: 6px 0; }
.kc li { padding: 8px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 16px; }
.kc li .qq { font-weight: 800; min-width: 30px; }
.kc li .nt { display: block; font-size: 14px; color: var(--warn); font-weight: 600; }
.kc li.done { color: var(--muted); text-decoration: line-through; }
.kc li.new { background: var(--info-soft); }
.kc .kf { padding: 10px 14px 14px; display: flex; gap: 8px; }
.kc .kf .btn { flex: 1; }
.kc .kn { padding: 0 14px 6px; font-size: 14px; color: var(--warn); font-weight: 600; }

/* ---------- Gráficas (barras simples) ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding: 10px 0 0; border-bottom: 1px solid var(--line); }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 34px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b:hover i { background: var(--brand-2); }
.bars .b:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--panel); font-size: 12px; padding: 6px 8px; border-radius: 8px; white-space: pre; z-index: 5; pointer-events: none;
}
.bars-x { display: flex; gap: 6px; }
.bars-x span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); padding-top: 4px; min-width: 0; overflow: hidden; }
.hbar { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.hbar .track { height: 12px; background: var(--line-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }

/* ---------- Menú admin ---------- */
.split { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.catlist .ci2 { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.catlist .ci2.on { background: var(--brand-soft); }
.catlist .ci2 .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 30px; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.emojis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.emojis button { width: 44px; height: 44px; font-size: 24px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.emojis button.on { border-color: var(--brand); background: var(--brand-soft); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid transparent; }
.colors button.on { border-color: var(--ink); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 16, 22, .55); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border-radius: 18px; width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: rise .18s; }
.modal.wide { max-width: 860px; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }
.modal .mh { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal .mh h2 { margin: 0; font-size: 18px; flex: 1; }
.modal .mb { padding: 16px 18px; overflow-y: auto; flex: 1; }
.modal .mf { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal .err { color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* Pago */
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pay .due { background: var(--nav); color: #fff; border-radius: var(--r); padding: 16px; text-align: center; margin-bottom: 12px; }
.pay .due .l { color: var(--nav-ink); font-size: 13px; }
.pay .due .v { font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.methods button { min-height: 64px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.methods button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-2); }
.methods button span { font-size: 22px; }
.change { text-align: center; padding: 14px; border-radius: var(--r); background: var(--ok-soft); color: var(--ok); margin-top: 12px; }
.change .v { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.change.neg { background: var(--danger-soft); color: var(--danger); }
.split-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }

/* Toast */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--panel); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-lg); animation: rise .2s; max-width: 90vw; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.err { background: var(--danger); color: #fff; }

.spin { width: 36px; height: 36px; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: sp 0.8s linear infinite; margin: 60px auto; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .pos { grid-template-columns: 1fr 360px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .side { order: 2; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); overflow-x: auto; overflow-y: hidden; gap: 2px; }
  .side .logo, .side .spacer { display: none; }
  .side a, .side button.nav { min-width: 64px; padding: 6px 4px; font-size: 11px; }
  .side .me { width: 36px; height: 36px; margin: auto 6px; flex: none; }
  .pos { grid-template-columns: 1fr; }
  .pos-cart { position: fixed; inset: 0; z-index: 40; transform: translateY(100%); transition: transform .25s; border: 0; }
  .pos-cart.open { transform: none; }
  .cart-close { display: inline-flex; }
  .cart-fab {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30;
    justify-content: space-between; align-items: center; background: var(--brand); color: #fff; border: 0;
    border-radius: 16px; min-height: 58px; padding: 0 18px; font-weight: 700; font-size: 16px; box-shadow: var(--shadow-lg);
  }
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .split, .pay { grid-template-columns: 1fr; }
  .products { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding: 4px 16px 150px; }
  .pos-top, .cats { padding-left: 16px; padding-right: 16px; }
  .hbar { grid-template-columns: 100px 1fr auto; }
  .rep-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .grid2 { grid-template-columns: 1fr; }
  .modal-bg { padding: 0; place-items: end stretch; }
  .modal { border-radius: 18px 18px 0 0; max-height: 94dvh; }
}
