/* VEXUM POS — sistema visual. Oscuro, táctil, números tabulares. */
:root {
  --bg: #0e0f13;
  --s1: #15171d;
  --s2: #1c1f27;
  --s3: #252935;
  --line: #2a2f3b;
  --line-2: #363c4b;
  --text: #eef0f5;
  --muted: #9097a8;
  --dim: #636a7c;
  --accent: #f5b544;
  --accent-ink: #1c1405;
  --green: #4fd1a5;
  --red: #ff5d6c;
  --blue: #7c8cff;
  --violet: #c77dff;
  --orange: #ff7a59;
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --nav-w: 84px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .money { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ───────── Botones ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--s2); font-weight: 700; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { background: var(--s3); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #ffc35c; }
.btn.green { background: var(--green); border-color: var(--green); color: #06251b; }
.btn.danger { border-color: rgba(255, 93, 108, .5); color: var(--red); background: rgba(255, 93, 108, .08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--s2); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { min-height: 56px; font-size: 17px; padding: 0 22px; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 10px; }
.btn svg, .nav svg { width: 20px; height: 20px; flex: none; }

/* ───────── Formularios ───────── */
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line-2); outline: none;
}
.input:focus { border-color: var(--accent); }
textarea.input { min-height: 80px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 14px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--s3); transition: background .15s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + i { background: rgba(79, 209, 165, .3); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--green); }

.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font-weight: 700; color: var(--muted); min-height: 36px; }
.seg button.on { background: var(--s3); color: var(--text); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--s3); color: var(--muted); white-space: nowrap; }
.pill.green { background: rgba(79, 209, 165, .14); color: var(--green); }
.pill.amber { background: rgba(245, 181, 68, .14); color: var(--accent); }
.pill.red { background: rgba(255, 93, 108, .14); color: var(--red); }
.pill.blue { background: rgba(124, 140, 255, .16); color: var(--blue); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ───────── Estructura ───────── */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; height: 100dvh; }
.nav {
  background: var(--s1); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  align-items: stretch; padding: 14px 8px; gap: 4px; overflow-y: auto;
}
.nav .brand { display: grid; place-items: center; height: 48px; margin-bottom: 10px; }
.nav .brand img { width: 40px; height: 40px; }
.nav a {
  display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; color: var(--muted);
  text-decoration: none; font-size: 11px; font-weight: 700; letter-spacing: .01em; position: relative;
}
.nav a:hover { background: var(--s2); color: var(--text); }
.nav a.on { background: var(--s3); color: var(--accent); }
.nav a .badge { position: absolute; top: 6px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; display: grid; place-items: center; }
.nav .grow { flex: 1; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--line);
  min-height: 64px; background: rgba(14, 15, 19, .9); backdrop-filter: blur(10px);
}
.topbar .title { display: grid; }
.topbar .title small { color: var(--muted); font-size: 12px; font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 99px; background: var(--s2); border: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #111; flex: none; }
.view { flex: 1; min-height: 0; overflow: auto; padding: 22px; }
.view.flush { padding: 0; overflow: hidden; }

.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--s1); position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .015); }
.tbl .r, .r { text-align: right; }
.tbl td.r { font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow: auto; }

/* ───────── Ingreso ───────── */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(900px 500px at 10% 110%, rgba(245, 181, 68, .22), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(124, 140, 255, .18), transparent 60%), var(--s1);
  border-right: 1px solid var(--line);
}
.login-art .big { font-size: clamp(40px, 5.4vw, 76px); font-weight: 800; line-height: .95; letter-spacing: -.045em; }
.login-art .big em { font-style: normal; color: var(--accent); }
.login-art .clock { font: 700 clamp(48px, 7vw, 96px)/1 var(--mono); letter-spacing: -.04em; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-box { width: min(420px, 100%); display: grid; gap: 22px; }
.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.who button { display: grid; justify-items: center; gap: 8px; padding: 16px 8px; border-radius: var(--radius); background: var(--s1); border: 1px solid var(--line); font-weight: 700; }
.who button small { color: var(--muted); font-weight: 600; font-size: 12px; }
.who button.on { border-color: var(--accent); background: var(--s2); }
.who .avatar { width: 46px; height: 46px; font-size: 17px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; height: 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 64px; border-radius: var(--radius); background: var(--s1); border: 1px solid var(--line); font: 700 24px var(--mono); }
.keypad button:active { background: var(--s3); }

/* ───────── Salón ───────── */
.salon { display: grid; grid-template-columns: 1fr 340px; height: 100%; }
.salon-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.salon-bar { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stat { display: grid; }
.stat small { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.floor-wrap { flex: 1; overflow: auto; padding: 22px; }
.floor {
  position: relative; min-height: 560px; height: 100%; border-radius: 20px; border: 1px dashed var(--line);
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 24px 24px;
}
.tbl-tile {
  position: absolute; width: 128px; height: 104px; transform: translate(-0%, -0%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 10px 12px;
  border-radius: 16px; background: var(--s1); border: 2px solid var(--line-2); text-align: left;
  transition: border-color .15s, background .15s, transform .1s; user-select: none; touch-action: none;
}
.tbl-tile:hover { border-color: var(--muted); }
.tbl-tile.round { border-radius: 52px; padding: 12px 18px; }
.tbl-tile.bar { width: 86px; height: 86px; border-radius: 50%; padding: 10px; align-items: center; justify-content: center; text-align: center; }
.tbl-tile .tname { font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.tbl-tile .tmeta { font-size: 12px; color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; gap: 6px; }
.tbl-tile .ttotal { font: 700 14px var(--mono); }
.tbl-tile.busy { background: linear-gradient(160deg, rgba(124, 140, 255, .2), rgba(124, 140, 255, .06)); border-color: var(--blue); }
.tbl-tile.billing { background: linear-gradient(160deg, rgba(245, 181, 68, .24), rgba(245, 181, 68, .06)); border-color: var(--accent); }
.tbl-tile .flag { position: absolute; top: -9px; right: -6px; display: flex; gap: 4px; }
.tbl-tile .flag .pill { padding: 2px 7px; font-size: 11px; background: var(--bg); border: 1px solid currentColor; }
.tbl-tile.ready { animation: readyGlow 1.6s ease-in-out infinite; }
@keyframes readyGlow { 50% { box-shadow: 0 0 0 6px rgba(79, 209, 165, .22); } }
.floor.editing .tbl-tile { cursor: grab; border-style: dashed; }
.floor.editing .tbl-tile.dragging { cursor: grabbing; transform: scale(1.05); z-index: 5; border-color: var(--accent); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; border: 2px solid var(--line-2); }

.side { border-left: 1px solid var(--line); background: var(--s1); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.side-list { flex: 1; overflow: auto; padding: 10px; display: grid; gap: 8px; align-content: start; }
.order-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 12px; border-radius: 12px; background: var(--s2); border: 1px solid var(--line); }
.order-row:hover { border-color: var(--line-2); }
.order-row .kind { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--s3); }
.order-row b { display: block; }
.order-row small { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ───────── Comanda ───────── */
.order { display: grid; grid-template-columns: 1fr 400px; height: 100%; }
.menu-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.menu-tools { display: flex; gap: 10px; padding: 14px 18px 10px; align-items: center; }
.menu-tools .input { max-width: 320px; }
.cats { display: flex; gap: 8px; padding: 0 18px 12px; overflow-x: auto; scrollbar-width: none; }
.cats button { flex: none; border: 1px solid var(--line); background: var(--s1); border-radius: 99px; padding: 8px 14px; font-weight: 700; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.cats button.on { color: var(--text); border-color: var(--c, var(--accent)); background: var(--s2); }
.cats button i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.products { flex: 1; overflow: auto; padding: 4px 18px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; }
.prod {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 92px;
  text-align: left; padding: 12px 12px 10px 14px; border-radius: 12px; background: var(--s1); border: 1px solid var(--line);
  overflow: hidden; transition: background .12s, transform .08s;
}
.prod::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--accent)); }
.prod:hover { background: var(--s2); }
.prod:active { transform: scale(.97); }
.prod b { font-size: 14px; line-height: 1.25; font-weight: 700; }
.prod .price { font: 700 14px var(--mono); color: var(--muted); }
.prod.out { opacity: .45; }
.prod.out .price::after { content: ' · agotado'; color: var(--red); font-family: var(--font); }
.prod .count { position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }

.ticket { border-left: 1px solid var(--line); background: var(--s1); display: flex; flex-direction: column; min-height: 0; }
.ticket-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.ticket-head .tt { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.ticket-body { flex: 1; overflow: auto; padding: 6px 0; }
.group-label { padding: 12px 18px 6px; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); }
.line { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 9px 18px; }
.line:hover { background: rgba(255, 255, 255, .02); }
.line .q { font: 700 14px var(--mono); min-width: 30px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--s3); }
.line .n { font-weight: 700; font-size: 14px; }
.line .note { font-size: 12px; color: var(--accent); font-weight: 600; }
.line .sub { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.line .amt { font: 700 14px var(--mono); text-align: right; }
.line.void .n, .line.void .amt { text-decoration: line-through; color: var(--dim); }
.line.pending { background: rgba(245, 181, 68, .05); }
.qty-ctl { display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; }
.qty-ctl button { width: 30px; height: 28px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--s2); font-weight: 800; }
.st-sent { color: var(--blue); } .st-preparing { color: var(--accent); } .st-ready { color: var(--green); } .st-delivered { color: var(--dim); }
.totals { border-top: 1px solid var(--line); padding: 12px 18px; display: grid; gap: 4px; font-size: 14px; }
.totals .tr { display: flex; justify-content: space-between; color: var(--muted); font-weight: 600; }
.totals .tr b { color: var(--text); font-family: var(--mono); }
.totals .grand { font-size: 24px; font-weight: 800; color: var(--text); margin-top: 4px; letter-spacing: -.02em; }
.totals .grand b { font-size: 24px; }
.ticket-actions { padding: 12px 18px 16px; display: grid; gap: 8px; }
.ticket-actions .row > .btn { flex: 1; }
.mobile-bar { display: none; }

/* ───────── Cobro ───────── */
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-methods button { min-height: 64px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--s2); font-weight: 800; display: flex; gap: 10px; align-items: center; justify-content: center; }
.pay-methods button.on { border-color: var(--accent); background: rgba(245, 181, 68, .12); color: var(--accent); }
.amount-big { font: 700 34px var(--mono); letter-spacing: -.03em; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { border: 1px solid var(--line-2); background: var(--s2); border-radius: 8px; padding: 7px 11px; font-size: 13px; font-weight: 700; }
.quick button.on { border-color: var(--accent); color: var(--accent); }
.change { padding: 14px; border-radius: 12px; background: rgba(79, 209, 165, .1); color: var(--green); display: flex; justify-content: space-between; font-weight: 800; font-size: 18px; }
.pay-summary { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 6px; }

/* ───────── KDS ───────── */
.kds { display: flex; flex-direction: column; height: 100%; }
.kds-bar { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.kds-grid { flex: 1; overflow: auto; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-content: start; }
.kcard { background: var(--s1); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.kcard-head { padding: 12px 14px; display: flex; align-items: center; gap: 10px; background: var(--s2); border-bottom: 1px solid var(--line); }
.kcard-head .tname { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.kcard-head .timer { margin-left: auto; font: 700 15px var(--mono); padding: 3px 9px; border-radius: 8px; background: var(--s3); }
.kcard.warn .kcard-head { background: rgba(245, 181, 68, .16); } .kcard.warn .timer { color: var(--accent); }
.kcard.late .kcard-head { background: rgba(255, 93, 108, .18); } .kcard.late .timer { color: var(--red); background: rgba(255, 93, 108, .15); }
.kcard.done { opacity: .6; }
.kitem { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; text-align: left; width: 100%; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.kitem:last-child { border-bottom: 0; }
.kitem .q { font: 800 18px var(--mono); }
.kitem .n { font-weight: 700; font-size: 16px; }
.kitem .note { color: var(--accent); font-size: 13px; font-weight: 700; }
.kitem.preparing { background: rgba(245, 181, 68, .08); }
.kitem.ready { background: rgba(79, 209, 165, .08); }
.kitem.ready .n { text-decoration: line-through; color: var(--muted); }
.kcard-foot { padding: 10px; display: flex; gap: 8px; border-top: 1px solid var(--line); margin-top: auto; }
.kcard-foot .btn { flex: 1; }

/* ───────── Paneles de gestión ───────── */
.page { max-width: 1280px; margin: 0 auto; display: grid; gap: 18px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--s1); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; }
.kpi small { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi b { font: 700 24px var(--mono); letter-spacing: -.03em; }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi.hero { background: linear-gradient(150deg, rgba(245, 181, 68, .18), rgba(245, 181, 68, .03)); border-color: rgba(245, 181, 68, .35); }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols-3-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding: 6px 2px 0; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.bars .b i { width: 100%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent), rgba(245, 181, 68, .35)); min-height: 2px; position: relative; }
.bars .b i:hover::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -6px); background: var(--s3); padding: 3px 7px; border-radius: 6px; font: 700 11px var(--mono); white-space: nowrap; }
.bars .b small { font-size: 11px; color: var(--dim); font-weight: 700; }
.hbar { height: 6px; border-radius: 99px; background: var(--s3); overflow: hidden; margin-top: 6px; }
.hbar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 12px 16px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; vertical-align: middle; }
.cat-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; text-align: left; font-weight: 700; color: var(--muted); }
.cat-list button.on, .cat-list button:hover { background: var(--s2); color: var(--text); }
.cat-list button .n { margin-left: auto; font-size: 12px; color: var(--dim); }

/* ───────── Modales y avisos ───────── */
.overlay { position: fixed; inset: 0; background: rgba(5, 6, 9, .66); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal { width: min(520px, 100%); max-height: calc(100dvh - 32px); background: var(--s1); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 80; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--s3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 700; max-width: 360px; animation: pop .2s; display: flex; gap: 10px; align-items: center; }
.toast.err { border-color: rgba(255, 93, 108, .6); color: #ffd3d8; }
.toast.ok { border-color: rgba(79, 209, 165, .55); }
.toast.ready { background: #0f3a2d; border-color: var(--green); color: #d6fff0; font-size: 16px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.choice-grid button { height: 56px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--s2); font: 700 18px var(--mono); }
.choice-grid button.on { border-color: var(--accent); color: var(--accent); background: rgba(245, 181, 68, .1); }
.check-line { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--s2); cursor: pointer; }
.check-line input { width: 20px; height: 20px; accent-color: var(--accent); }

.loading { display: grid; place-items: center; height: 100%; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.offline { position: fixed; top: 0; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-weight: 800; font-size: 13px; padding: 6px 16px; border-radius: 0 0 10px 10px; z-index: 90; }

/* ───────── Responsivo ───────── */
@media (max-width: 1100px) {
  .salon { grid-template-columns: 1fr; }
  .salon .side { border-left: 0; border-top: 1px solid var(--line); max-height: 40dvh; }
  .order { grid-template-columns: 1fr 340px; }
  .cols-2, .cols-3-1 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --nav-w: 0px; }
  body { font-size: 14px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .nav { order: 2; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); overflow-x: auto; }
  .nav .brand, .nav .grow { display: none; }
  .nav a { flex: 1 0 64px; padding: 6px 2px; }
  .topbar { padding: 10px 14px; min-height: 56px; }
  .topbar .hide-sm { display: none; }
  .view { padding: 14px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .floor { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; border: 0; background: none; min-height: 0; }
  .floor .tbl-tile { position: relative; left: auto !important; top: auto !important; width: auto; height: 92px; }
  .floor .tbl-tile.bar { width: auto; border-radius: 16px; }
  .floor-wrap { padding: 14px; }
  .salon-bar { padding: 12px 14px; }
  .order { grid-template-columns: 1fr; position: relative; }
  .order .ticket { position: absolute; inset: 0; z-index: 4; border-left: 0; transform: translateX(100%); transition: transform .22s; }
  .order.show-ticket .ticket { transform: none; }
  .mobile-bar { display: flex; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--s1); }
  .mobile-bar .btn { flex: 1; }
  .products { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding: 4px 14px 14px; }
  .menu-tools, .cats { padding-left: 14px; padding-right: 14px; }
  .pay { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .modal { border-radius: 18px 18px 0 0; align-self: end; }
  .overlay { padding: 0; }
}

/* ───────── Impresión de tickets (80 mm) ───────── */
@media print {
  body * { visibility: hidden; }
}
input[type=radio]:checked + .swatch { outline: 2px solid var(--text); }
.keypad svg { width: 26px; height: 26px; }
.user-chip .muted:empty { display: none; }
.toast svg { width: 22px; height: 22px; flex: none; }
.tbl-tile .tmeta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-tile .tmeta svg { width: 13px; height: 13px; vertical-align: -2px; }
.pay-methods svg { width: 22px; height: 22px; }
.kind svg { width: 20px; height: 20px; }
.amount-big.input { min-height: 60px; padding: 8px 14px; }
.switch { display: inline-block; vertical-align: middle; }
@media (max-width: 760px) {
  .view.flush:has(.salon) { overflow: auto; }
  .salon { height: auto; display: block; }
  .salon-main { min-height: 0; }
  .floor-wrap { overflow: visible; }
  .salon .side { max-height: none; }
}

/* Factura en el cobro */
.pay > .stack { align-content: start; }
.doc-seg { display: flex; }
.doc-seg button { flex: 1; }
.fact { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.fact-rut { display: flex; gap: 8px; }
.fact-rut .input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.fact-rut .btn svg { width: 18px; height: 18px; }
.fact .input { min-height: 42px; padding-top: 8px; padding-bottom: 8px; }
.fact-msg { grid-column: 1 / -1; }
.err-text { color: var(--red); font-weight: 600; }
@media (max-width: 1100px) { .fact { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .fact { grid-template-columns: 1fr; } }

/* Cobro en la máquina de tarjetas */
.term-panel { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 34px 16px 26px; min-height: 340px; align-content: center; }
.term-panel h2 { font-size: 22px; max-width: 460px; }
.term-panel p { margin: 0; max-width: 460px; }
.term-amount { font-size: 30px; font-weight: 700; margin-top: 4px; }
.term-ico { position: relative; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(245, 181, 68, .12); color: var(--accent); }
.term-ico svg { width: 38px; height: 38px; position: relative; }
.term-panel.err .term-ico { background: rgba(255, 93, 108, .12); color: var(--red); }
.term-pulse { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: term-pulse 1.6s ease-out infinite; }
@keyframes term-pulse { from { transform: scale(1); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }
.modal.charging .modal-foot, .modal.charging [data-x] { display: none; }
.pill svg { width: 14px; height: 14px; }
@media (prefers-reduced-motion: reduce) { .term-pulse { animation: none; } }

/* Carta QR: llamados de mesa y pedidos del cliente */
.calls-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: 999px;
  background: var(--red); color: #fff; border: 0; font-weight: 800; animation: ring 1.6s ease-in-out infinite; }
.calls-btn svg { width: 18px; height: 18px; }
@keyframes ring { 0%, 70%, 100% { box-shadow: 0 0 0 0 rgba(255, 93, 108, .55); } 35% { box-shadow: 0 0 0 8px rgba(255, 93, 108, 0); } }
.calls-list { display: grid; gap: 8px; }
.call-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--s2); border: 1px solid var(--line); }
.call-row > div { flex: 1; min-width: 0; display: grid; }
.call-row small { color: var(--muted); }
.call-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255, 93, 108, .14); color: var(--red); }
.call-row.cuenta .call-ico { background: rgba(245, 181, 68, .14); color: var(--accent); }
.call-row.pedido .call-ico { background: rgba(124, 140, 255, .16); color: var(--blue); }
.qr-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; vertical-align: 2px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em; background: rgba(124, 140, 255, .16); color: var(--blue); }
.call-banner { display: flex; align-items: center; gap: 10px; margin: 8px 12px 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255, 93, 108, .1); border: 1px solid rgba(255, 93, 108, .35); font-weight: 700; font-size: 14px; }
.call-banner.cuenta { background: rgba(245, 181, 68, .1); border-color: rgba(245, 181, 68, .35); }
.call-banner.pedido { background: rgba(124, 140, 255, .1); border-color: rgba(124, 140, 255, .35); }
.call-banner span { flex: 1; }
.tbl-tile.calling { border-color: var(--red) !important; animation: ring 1.6s ease-in-out infinite; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.qr-card { display: grid; justify-items: center; gap: 6px; padding: 14px 12px; border-radius: var(--radius); background: var(--s2); border: 1px solid var(--line); text-align: center; }
.qr-card .qr-img { background: #fff; border-radius: 10px; padding: 4px; line-height: 0; }
.qr-card b { font-size: 15px; }
.qr-card small { color: var(--muted); font-size: 11.5px; word-break: break-all; }
.totals .web-pay { font-size: 12.5px; color: var(--green); }
.totals .web-pay span { display: inline-flex; align-items: center; gap: 6px; }
.totals .web-pay svg { width: 15px; height: 15px; }

/* ───────── Delivery ───────── */
.dl-page { max-width: 1440px; }
.dl-chan { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.dl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }
.dl-off { display: flex; align-items: center; gap: 16px; }
.dl-off > div:first-child { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--s3); color: var(--accent); }
.dl-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.dl-ch { background: var(--s1); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 8px; }
.dl-ch.paused { border-top-color: var(--line-2); opacity: .8; }
.dl-ch.paused .dl-dot { background: var(--dim); }
.dl-ch-top { display: flex; align-items: center; gap: 8px; }
.dl-ch-top .pill { margin-left: auto; }
.dl-ch-mid { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.dl-sold { margin-left: auto; font-size: 12px; }
.dl-ch-mid b { color: var(--text); font: 700 16px var(--mono); }
.dl-ch-toggle { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.dl-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dl-col { background: var(--s1); border: 1px solid var(--line); border-radius: var(--radius); min-height: 220px; display: flex; flex-direction: column; }
.dl-col > header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dl-col.new > header h3 { color: var(--text); }
.dl-list { padding: 10px; display: grid; gap: 10px; }
.dl-empty { text-align: center; color: var(--dim); font-weight: 600; font-size: 13px; padding: 28px 10px; }
.dcard { background: var(--s2); border: 1px solid var(--line-2); border-left: 4px solid var(--c); border-radius: 12px; overflow: hidden; cursor: pointer; transition: border-color .15s, transform .1s; }
.dcard:hover { border-color: var(--line-2); transform: translateY(-1px); }
.dcard.new { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), 0 10px 30px color-mix(in srgb, var(--c) 12%, transparent); }
.dcard.fresh { animation: dl-in .35s ease-out; }
@keyframes dl-in { from { transform: translateY(-6px); opacity: 0; } }
.dcard-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 0; }
.dl-code { font-size: 17px; letter-spacing: -.02em; }
.dl-timer { margin-left: auto; font: 700 13px var(--mono); padding: 3px 8px; border-radius: 7px; background: var(--s3); color: var(--text); white-space: nowrap; }
.dl-timer.soft { color: var(--muted); font-family: var(--font); font-weight: 700; font-size: 12px; }
.dl-timer.urgent { background: rgba(255, 93, 108, .18); color: var(--red); animation: dl-blink 1s steps(2) infinite; }
@keyframes dl-blink { 50% { opacity: .55; } }
.dcard-body { padding: 8px 12px 10px; display: grid; gap: 6px; }
.dl-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; font-weight: 700; color: var(--muted); }
.dl-meta svg { width: 16px; height: 16px; }
.dl-items { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 3px; font-size: 14px; }
.dl-items li b { font-family: var(--mono); color: var(--accent); margin-right: 2px; }
.dl-items small { display: block; color: var(--muted); font-size: 12px; padding-left: 26px; }
.dl-warn { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: rgba(245, 181, 68, .2); color: var(--accent); font-size: 11px; font-weight: 800; }
.dl-note { font-size: 13px; padding: 6px 9px; border-radius: 8px; background: rgba(124, 140, 255, .1); color: #c3caff; }
.dl-prog { height: 5px; border-radius: 99px; background: var(--s3); overflow: hidden; }
.dl-prog i { display: block; height: 100%; background: var(--green); transition: width .3s; }
.dl-total { padding-top: 6px; border-top: 1px dashed var(--line-2); font-size: 13px; }
.dl-total b { font: 700 15px var(--mono); }
.dcard-foot { display: flex; gap: 8px; padding: 0 10px 10px; }
.dcard-foot .btn { flex: 1; }
.dl-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dl-reasons button, .dl-pick button { min-height: 48px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--s2); font-weight: 700; padding: 0 12px; text-align: left; }
.dl-reasons button.on { border-color: var(--red); color: var(--red); background: rgba(255, 93, 108, .08); }
.dl-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.dl-pick button { display: inline-flex; align-items: center; gap: 8px; }
.dl-pick button.on, .dl-pick button:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--s2)); }
.dl-detail { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; }
.dl-detail .dl-items { font-size: 15px; gap: 6px; }
.dl-sum { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; font-size: 14px; }
.dl-sum div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.dl-sum b { color: var(--text); font-family: var(--mono); }
.dl-sum .big { font-size: 16px; color: var(--text); font-weight: 700; }
.dl-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dl-facts > div { background: var(--s2); border-radius: 10px; padding: 9px 11px; display: grid; gap: 1px; font-size: 14px; }
.dl-facts small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); }
.dl-facts .muted { font-size: 12px; }
.dl-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; max-height: 210px; overflow: auto; }
.dl-log li { display: flex; gap: 10px; }
.dl-log time { font: 700 12px var(--mono); color: var(--dim); padding-top: 1px; }
.dl-manual { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dl-results { display: grid; gap: 4px; max-height: 210px; overflow: auto; }
.dl-results button { display: flex; justify-content: space-between; gap: 10px; text-align: left; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--s2); font-weight: 600; }
.dl-results button:hover { border-color: var(--accent); }
.dl-results b { font-family: var(--mono); color: var(--muted); }
.dl-cart { border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; }
.dl-cline { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dl-cline:last-child { border-bottom: 0; }
.dl-cline > span { flex: 1; min-width: 0; }
.dl-cline .qty-ctl { margin: 0; }
.dl-cline .qty-ctl b { min-width: 22px; text-align: center; }
.dl-cline .qty-ctl svg { width: 14px; height: 14px; }
.dl-cline > b { font-family: var(--mono); min-width: 72px; text-align: right; }
.dl-cline.total { font-weight: 700; }
.call-banner.app { background: rgba(79, 209, 165, .08); border-color: rgba(79, 209, 165, .3); }
.dl-chcfg { border-top: 3px solid var(--c); }
.dl-hook { display: flex; align-items: center; gap: 8px; font: 600 12px var(--mono); background: var(--s2); border-radius: 8px; padding: 7px 10px; overflow-x: auto; white-space: nowrap; }
.dl-hook small { font-family: var(--font); color: var(--dim); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 10px; flex: none; }
@media (max-width: 1100px) { .dl-board { grid-template-columns: 1fr 1fr; } .dl-detail, .dl-manual { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .dl-board { grid-template-columns: 1fr; } .dl-reasons, .dl-facts { grid-template-columns: 1fr; } }

.demo-hint { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 10px 12px; border-radius: 12px; font-size: 13px;
  background: rgba(245, 181, 68, .08); border: 1px solid rgba(245, 181, 68, .3); color: var(--muted); }
.demo-hint > b { color: var(--accent); }
.demo-hint span b { color: var(--text); }
.demo-hint small { flex-basis: 100%; color: var(--dim); }
.demo-hint a { color: var(--accent); }
