/* Sakura POS · tablet primero, táctil, con tema claro y oscuro.
   Layout: caja en 3 columnas (categorías · productos · ticket), cocina en tarjetas oscuras,
   back office con barra lateral. */
:root {
  --bg: #f2f2f0;
  --surface: #ffffff;
  --surface-2: #ebebe8;
  --surface-3: #f7f7f5;
  --ink: #141414;
  --ink-2: #4a4a47;
  --muted: #7c7c77;
  --line: #e3e3df;
  --accent: #141414;
  --accent-ink: #ffffff;
  --accent-soft: #ececea;
  --good: #23824f;
  --good-soft: #dcf0e3;
  --warn: #b97a0f;
  --warn-soft: #f8ecd2;
  --bad: #c42f2f;
  --bad-soft: #f9dddb;
  --info: #2a67b8;
  --info-soft: #dde8f7;
  --c-cost: #e7a37f;
  --c-waste: #b5b0a5;
  --c-exp: #8fa3b8;
  --shadow: 0 1px 2px rgb(20 20 20 / 4%), 0 4px 14px rgb(20 20 20 / 5%);
  --chrome: #ffffff;
  --chrome-ink: #141414;
  --radius: 18px;
  --radius-sm: 12px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0f; --surface: #191919; --surface-2: #262626; --surface-3: #1f1f1f; --ink: #f2f2ef; --ink-2: #bdbdb8; --muted: #8c8c87;
    --line: #2c2c2a; --accent: #f2f2ef; --accent-ink: #141414; --accent-soft: #2c2c2a; --good: #4cc483; --good-soft: #173525;
    --warn: #e2a63a; --warn-soft: #3a2c12; --bad: #f06363; --bad-soft: #3d1a1a; --info: #6aa5f0; --info-soft: #172a44;
    --c-cost: #c97d58; --c-waste: #6f6b63; --c-exp: #5e7287; --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 35%);
    --chrome: #191919; --chrome-ink: #f2f2ef;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0f; --surface: #191919; --surface-2: #262626; --surface-3: #1f1f1f; --ink: #f2f2ef; --ink-2: #bdbdb8; --muted: #8c8c87;
    --line: #2c2c2a; --accent: #f2f2ef; --accent-ink: #141414; --accent-soft: #2c2c2a; --good: #4cc483; --good-soft: #173525;
    --warn: #e2a63a; --warn-soft: #3a2c12; --bad: #f06363; --bad-soft: #3d1a1a; --info: #6aa5f0; --info-soft: #172a44;
    --c-cost: #c97d58; --c-waste: #6f6b63; --c-exp: #5e7287; --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 35%);
    --chrome: #191919; --chrome-ink: #f2f2ef;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
#app { height: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 650; }
h3 { font-size: 0.98rem; font-weight: 650; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.tiny { font-size: 0.8rem; }
.lead { font-size: 1.05rem; }
.mono { font-family: var(--mono); font-size: 0.85em; }
.selectable { user-select: all; }
.good-text { color: var(--good); }
.bad-text { color: var(--bad); }
.warn-text { color: var(--warn); }
.note-text { color: var(--warn); }
.mt { margin-top: 18px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; align-self: end; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.ic { flex: none; }

/* ---------- 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); background: var(--surface); font-weight: 600;
  transition: background .12s, transform .06s, border-color .12s; white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.ghost { background: transparent; }
.btn.big { min-height: 56px; font-size: 1.05rem; padding: 0 22px; }
.btn.sm { min-height: 34px; padding: 0 10px; font-size: 0.86rem; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); }
.link { background: none; border: 0; padding: 0; text-align: left; color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 550; font-size: 0.9rem;
}
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.big { min-height: 48px; font-size: 1rem; padding: 0 16px; }
.chip small { color: var(--muted); font-weight: 500; }
.chip.on small { color: inherit; opacity: .7; }
.chips { display: flex; gap: 8px; }
.chips.wrap { flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-weight: 700; font-style: normal; }
.badge.soft { background: var(--surface-2); color: var(--ink); }
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 650; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.neutral { background: var(--surface-2); color: var(--ink-2); }
.pill.soft { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.pill.good.soft { border-color: color-mix(in srgb, var(--good) 35%, transparent); color: var(--good); }
.pill.bad.soft { border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--bad); }

/* ---------- Formularios ---------- */
.input {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.xl { font-size: 1.6rem; font-weight: 700; min-height: 60px; font-variant-numeric: tabular-nums; }
.input.sm { min-height: 34px; padding: 4px 8px; font-size: 0.86rem; }
.input.color { padding: 4px; height: 44px; }
.input.code, textarea.code { font-family: var(--mono); font-size: 0.82rem; }
.input.warn { border-color: var(--warn); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field > label { font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.pass-row { display: flex; gap: 8px; }
.pass-row .btn { flex: none; width: 48px; padding: 0; }
.hint { color: var(--muted); font-size: 0.78rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.one { grid-template-columns: 1fr; }
.span2 { grid-column: 1 / -1; }
.qty-unit { display: inline-flex; align-items: center; gap: 6px; }
.qty-unit .input { width: 96px; text-align: right; }
.qty-unit small { color: var(--muted); min-width: 22px; text-align: left; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 40px; font-weight: 550; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform .15s; }
.switch input:checked + .sw { background: var(--good); }
.switch input:checked + .sw::after { transform: translateX(18px); }
.switch input:focus-visible + .sw { outline: 3px solid var(--accent-soft); }
.search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); flex: 1; min-width: 180px; }
.search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; color: var(--ink); min-height: 40px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; min-height: 38px; padding: 0 14px; border-radius: 9px; font-weight: 600; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg button b { font-size: 0.75rem; color: var(--muted); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }

/* ---------- Elegir pantalla / login ---------- */
.chooser { max-width: 980px; margin: 0 auto; padding-block: 48px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 28px; }
.chooser-head { display: flex; gap: 18px; align-items: center; }
.chooser-head h1 { font-size: 2.2rem; }
.brand-mark { width: 64px; height: 64px; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); display: grid; place-items: center; flex: none; }
.chooser-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left; transition: transform .1s, border-color .1s; }
.mode-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.mode-card strong { font-family: var(--display); font-size: 1.25rem; }
.mode-card span:last-child { color: var(--muted); }
.mode-ic { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 6px; }
.mode-ic.sm { width: 42px; height: 42px; margin: 0; }
.demo-pins { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 18px; }
.demo-pins summary { cursor: pointer; font-weight: 600; }
.demo-pins ul { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 4px; }
.login { min-height: 100%; display: grid; place-items: center; padding-block: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.login-card { width: min(400px, 100%); background: var(--surface); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login-top { display: flex; gap: 12px; align-items: center; }
.login-brand { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 650; }
.login-clock { display: none; }

/* ---------- PIN ---------- */
.pinpad { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pin-label { font-weight: 600; color: var(--ink-2); }
.pin-dots { display: flex; gap: 14px; height: 22px; align-items: center; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-2); transition: background .1s; }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-err { min-height: 20px; color: var(--bad); font-weight: 600; font-size: 0.9rem; text-align: center; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.pin-key { height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-3); font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.pin-key:active { background: var(--surface-2); transform: scale(.96); }
.pin-key.soft { background: transparent; font-size: 1.1rem; color: var(--ink-2); }

/* ---------- Modales ---------- */
#modal-root { position: relative; z-index: 50; }
.modal-layer { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; }
.modal-scrim { position: absolute; inset: 0; background: rgb(10 16 13 / 45%); backdrop-filter: blur(2px); animation: fade .15s; }
.modal-box { position: relative; width: 100%; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 20px; box-shadow: 0 24px 60px rgb(0 0 0 / 30%); animation: pop .16s ease-out; overflow: hidden; }
.modal-sm { max-width: 440px; } .modal-md { max-width: 600px; } .modal-lg { max-width: 820px; } .modal-xl { max-width: 1120px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px 12px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.25rem; }
.modal-body { padding: 18px 22px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; background: var(--surface-3); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

#toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); animation: pop .2s; transition: opacity .3s, transform .3s; text-align: center; }
.toast-ok { background: var(--good); color: #fff; }
.toast-error { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Autorización ---------- */
.approval-head { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--warn-soft); }
.lock-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--warn); color: #fff; display: grid; place-items: center; flex: none; }
.remote-wait { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 18px 0; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- CAJA ---------- */
.pos { display: grid; height: 100%; grid-template-columns: 210px minmax(0, 1fr) 380px; grid-template-rows: 72px minmax(0, 1fr); grid-template-areas: "top top top" "cats menu ticket"; background: var(--bg); }
.topbar { grid-area: top; display: flex; align-items: center; gap: 18px; padding: 0 16px 0 22px; background: var(--chrome); color: var(--chrome-ink); border-bottom: 1px solid var(--line); }
.tb-brand { display: flex; align-items: center; white-space: nowrap; margin-right: 6px; }
.topbar .seg { background: var(--surface-2); }
.topbar .seg button { color: var(--ink-2); min-height: 42px; padding: 0 18px; }
.topbar .seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tb-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.tb-btn, .tb-user { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; border-radius: 12px; border: 0; background: transparent; color: var(--chrome-ink); font-weight: 600; }
.tb-btn:hover, .tb-user:hover { background: var(--surface-3); }
.tb-btn .badge, .tb-btn .badge.soft { background: var(--ink); color: var(--bg); }
.tb-btn.warn { background: var(--warn); color: #fff; }
.tb-user { margin-left: 4px; padding: 0 16px 0 6px; border: 1px solid var(--line); border-radius: 999px; }
.tb-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 0.9rem; }

/* Marca: flor + SAKURA POS, con el nombre del local debajo */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-word { font-weight: 700; font-size: 1.02rem; letter-spacing: 0.26em; }
.brand-word i { font-style: normal; font-weight: 400; color: var(--muted); }
.brand-txt small { color: var(--muted); font-size: 0.78rem; font-weight: 500; }

.cats { grid-area: cats; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; overflow: auto; }
.cats-label { font-size: 0.72rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 0 14px 8px; }
.cat { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; border-radius: 14px; border: 0; background: transparent; text-align: left; font-weight: 550; font-size: 0.98rem; color: var(--ink-2); }
.cat:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.cat.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow); }

.menu { grid-area: menu; display: flex; flex-direction: column; min-height: 0; }
.menu-tools { padding: 20px 18px 0; display: flex; gap: 16px; align-items: center; }
.menu-title { font-size: 1.9rem; font-weight: 750; letter-spacing: -0.02em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-tools .search { flex: 0 1 340px; border-color: transparent; background: var(--surface); border-radius: 14px; }
.grid { padding: 16px 18px 90px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); grid-auto-rows: max-content; gap: 14px; align-content: start; }
.prod { display: flex; flex-direction: column; border: 0; border-radius: var(--radius); background: var(--surface); padding: 8px; overflow: hidden; text-align: left; box-shadow: var(--shadow); transition: transform .07s, box-shadow .12s; }
.prod:hover { box-shadow: 0 2px 4px rgb(20 20 20 / 5%), 0 10px 24px rgb(20 20 20 / 8%); }
.prod:active { transform: scale(.97); }
.prod-img { position: relative; flex: none; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; max-width: 100%; border-radius: 12px; }
.prod-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 2rem; font-weight: 800; letter-spacing: -0.02em;
  color: color-mix(in srgb, var(--c) 70%, var(--ink)); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.prod-count { position: absolute; top: 8px; right: 8px; min-width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 800; box-shadow: var(--shadow); }
.prod-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 6px 4px; flex: 1; }
.prod-body strong { font-size: 1rem; line-height: 1.2; }
.prod-body small { color: var(--muted); font-size: 0.78rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-price { margin-top: auto; padding-top: 6px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 12px; }

.ticket { grid-area: ticket; display: flex; flex-direction: column; min-height: 0; margin: 14px 14px 14px 0; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.t-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 18px 16px 10px 20px; }
.t-title { font-size: 1.2rem; font-weight: 750; }
.t-title span { color: var(--muted); font-weight: 500; }
.t-customer { margin: 4px 16px 6px; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border: 1.5px dashed var(--line); border-radius: 14px; background: none; padding: 6px 12px; font-weight: 600; color: var(--ink-2); }
.t-customer:hover { background: var(--surface-3); }
.t-customer.set { justify-content: flex-start; border-style: solid; background: var(--surface-3); text-align: left; }
.t-customer.set span { display: flex; flex-direction: column; line-height: 1.25; }
.t-customer.set small { color: var(--muted); font-weight: 500; }
.t-customer.need { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.t-lines { flex: 1; overflow: auto; padding: 4px 12px; }
.t-line { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "qn main amt" "qn main qty"; gap: 4px 10px; padding: 12px 6px; border-bottom: 1px solid var(--line); align-items: start; }
.t-qn { grid-area: qn; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-weight: 750; font-variant-numeric: tabular-nums; }
.t-line-main { grid-area: main; display: flex; flex-direction: column; gap: 2px; text-align: left; border: 0; background: none; padding: 4px 0 0; min-width: 0; }
.t-name { font-weight: 650; }
.t-name em { font-style: normal; font-weight: 600; color: var(--muted); }
.t-mods { font-size: 0.82rem; color: var(--muted); }
.t-note { font-size: 0.82rem; color: var(--warn); display: inline-flex; gap: 4px; align-items: center; }
.t-amt { grid-area: amt; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 4px; }
.t-qty { grid-area: qty; display: inline-flex; align-items: center; gap: 4px; justify-self: end; }
.t-qty span { min-width: 26px; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; }
.t-line .t-qty span { display: none; }
.q-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.q-btn.lg { width: 50px; height: 50px; }
.t-empty { height: 100%; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.t-extra { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; padding: 12px 16px 4px; }
.t-extra .btn { min-height: 46px; padding: 0 10px; }
.t-totals { margin: 0; padding: 10px 20px 4px; display: flex; flex-direction: column; gap: 4px; }
.t-totals div { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; color: var(--muted); }
.t-totals dt, .t-totals dd { margin: 0; }
.t-totals .disc { color: var(--good); }
.t-totals .grand { color: var(--ink); font-family: var(--display); font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line); align-items: baseline; }
.t-totals .grand dt { font-size: 1rem; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.t-totals.compact .grand { font-size: 1.2rem; }
.t-actions { padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.t-actions .btn.big { min-height: 60px; border-radius: 16px; font-size: 1.08rem; }
.cart-fab { display: none; }

.overlay-shift { position: fixed; inset: 64px 0 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; }
.shift-card { width: min(400px, 100%); background: var(--surface); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }

/* Producto: porción y modificadores */
.opt-sec { display: flex; flex-direction: column; gap: 10px; }
.opt-sec h3 { display: flex; gap: 10px; align-items: center; }
.req { font-family: var(--font); font-size: 0.72rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.opt { font-family: var(--font); font-size: 0.78rem; font-weight: 500; color: var(--muted); }
.variant-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.variant { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 10px; min-height: 86px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); }
.variant strong { font-family: var(--display); font-size: 1.3rem; }
.variant span { color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.variant.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.variant.on span { color: inherit; opacity: .8; }
.mod-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.mod { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; font-weight: 600; }
.mod b { color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.mod.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.mod.on b { color: inherit; }
.stepper { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.stepper span { min-width: 30px; text-align: center; font-size: 1.3rem; font-weight: 750; }

/* Cobro */
.pay-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.pay-left, .pay-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pay-due { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.pay-due strong { font-family: var(--display); font-size: 2rem; font-variant-numeric: tabular-nums; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.pay-m { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 80px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-weight: 650; }
.pay-m.on { border-color: var(--accent); background: var(--accent-soft); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-entry { display: flex; flex-direction: column; gap: 10px; }
.pay-done { display: flex; align-items: center; gap: 10px; padding: 18px; border-radius: 14px; background: var(--good-soft); color: var(--good); font-weight: 700; font-size: 1.1rem; }
.pay-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pay-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-3); }
.pay-list small { grid-column: 1 / -1; color: var(--muted); }
.change-due { margin-right: auto; font-size: 1.05rem; }
.change-due strong { font-family: var(--display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.paid { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 10px 0; }
.paid-ic { width: 76px; height: 76px; border-radius: 50%; background: var(--good-soft); color: var(--good); display: grid; place-items: center; }
.paid-change { font-family: var(--display); font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }

/* Órdenes */
.orders-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.order-list { display: flex; flex-direction: column; gap: 6px; }
.order-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto 64px 110px; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.order-row:hover { background: var(--surface-3); }
.or-num { font-family: var(--display); font-weight: 800; font-size: 1.2rem; }
.or-main { display: flex; flex-direction: column; min-width: 0; }
.or-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.or-st { display: flex; gap: 4px; flex-wrap: wrap; }
.or-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.or-time small { color: var(--warn); font-weight: 650; }
.or-amt { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.od-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.od-cust { padding: 10px 12px; border-radius: 10px; background: var(--surface-3); }
.refund-lines { display: flex; flex-direction: column; gap: 6px; }
.rf-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-3); }
.rf-line .t-qty { grid-area: auto; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; }
.kcol { background: var(--surface-3); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kcol h3 { display: flex; justify-content: space-between; }
.kcard { background: var(--surface); border-radius: 12px; border: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.kcard header { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; border-radius: 12px; background: var(--surface-3); display: flex; flex-direction: column; gap: 2px; }
.stat span { color: var(--muted); font-size: 0.82rem; }
.stat strong { font-family: var(--display); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.denoms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.denom { display: grid; grid-template-columns: 1fr 90px 76px; align-items: center; gap: 8px; }
.denom b { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.found { display: flex; gap: 6px; flex-wrap: wrap; }

/* Tablas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tbl th { text-align: left; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-3); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl.hover tbody tr { cursor: pointer; }
.tbl.hover tbody tr:hover { background: var(--surface-3); }
.tbl tr.total td { font-weight: 750; border-top: 2px solid var(--line); }
.tbl tr.struck td:first-child { text-decoration: line-through; color: var(--muted); }
.tbl tr.inactive td { opacity: .55; }
.tbl.compact td, .tbl.compact th { padding: 6px 8px; }
.tbl .input { min-height: 38px; }
.tbl.matrix td:not(:first-child), .tbl.matrix th:not(:first-child) { text-align: center; }
.tbl.matrix input { width: 20px; height: 20px; accent-color: var(--good); }
.row-actions { white-space: nowrap; text-align: right; }
.thumb { width: 52px; height: 40px; border-radius: 8px; overflow: hidden; position: relative; display: block; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .tile-ph { font-size: 0.9rem; }
.sev-row-high td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.sev-row-medium td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

/* ---------- COCINA ---------- */
body[data-mode="kds"] { background: #0b0f0d; color: #eef2ef; color-scheme: dark; }
.kds { --k-bg: #0b0f0d; --k-card: #151c19; --k-line: #27312c; --k-ink: #eef2ef; --k-mute: #8b978f; height: 100%; display: flex; flex-direction: column; background: var(--k-bg); color: var(--k-ink); }
.kds-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--k-line); flex-wrap: wrap; }
.kds-title { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.35rem; }
.kds-count { font-family: var(--font); font-size: 0.95rem; color: var(--k-mute); }
.kds-stations { display: flex; gap: 6px; flex-wrap: wrap; }
.kds-stations button { min-height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--k-line); background: transparent; color: var(--k-ink); font-weight: 650; font-size: 1rem; }
.kds-stations button.on { background: var(--c, #eef2ef); border-color: var(--c, #eef2ef); color: #0b0f0d; }
.kds-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.kds-tool { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--k-line); background: transparent; color: var(--k-ink); font-weight: 600; }
.kds-tool.on { background: #eef2ef; color: #0b0f0d; }
.kds-clock { font-family: var(--display); font-size: 1.5rem; font-weight: 700; padding: 0 8px; font-variant-numeric: tabular-nums; }
.kds-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; }
.kds-body.with-side { grid-template-columns: 1fr 280px; }
.kds-tickets { overflow: auto; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-content: start; }
.kds-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 80px 0; color: var(--k-mute); font-size: 1.3rem; }
.kt { --st: #3bbf78; background: var(--k-card); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; border: 2px solid var(--st); transition: opacity .18s, transform .18s; }
.kt.kt-warn { --st: #e8a93a; }
.kt.kt-late { --st: #f05a5a; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgb(240 90 90 / 22%); } }
.kt.bumping { opacity: 0; transform: scale(.95); }
.kt-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--st); color: #0b0f0d; }
.kt-num { font-family: var(--display); font-size: 1.7rem; font-weight: 800; }
.kt-type { font-weight: 800; font-size: 0.82rem; letter-spacing: 0.06em; }
.kt-time { margin-left: auto; font-family: var(--display); font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kt-cust { padding: 8px 14px 0; color: var(--k-mute); font-weight: 600; }
.kt-note { margin: 10px 12px 0; padding: 8px 10px; border-radius: 10px; background: #f4d35e; color: #2a2205; font-weight: 750; display: flex; gap: 6px; align-items: center; }
.kt-lines { list-style: none; margin: 0; padding: 6px 6px; flex: 1; }
.kt-line { width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 10px 8px; border: 0; border-bottom: 1px solid var(--k-line); background: none; color: inherit; text-align: left; border-radius: 8px; }
.kt-lines li:last-child .kt-line { border-bottom: 0; }
.kt-line:active { background: #1e2723; }
.kt-qty { font-family: var(--display); font-size: 1.8rem; font-weight: 800; min-width: 34px; line-height: 1; }
.kt-item { display: flex; flex-direction: column; gap: 3px; }
.kt-item strong { font-size: 1.22rem; line-height: 1.2; }
.kt-variant { align-self: flex-start; font-weight: 850; font-size: 1.05rem; letter-spacing: .03em; text-transform: uppercase; background: #eef2ef; color: #0b0f0d; padding: 1px 9px; border-radius: 6px; }
.kt-mods { display: flex; flex-direction: column; gap: 1px; font-size: 1.02rem; font-weight: 650; }
.kt-mods .plus { color: #7ed4a5; }
.kt-mods .minus { color: #ff8f8f; text-transform: uppercase; font-weight: 800; }
.kt-lnote { color: #f4d35e; font-weight: 700; }
.kt-added { align-self: flex-start; font-size: 0.72rem; font-weight: 800; background: #6aa5f0; color: #0b0f0d; padding: 1px 6px; border-radius: 4px; }
.kt-lines li.done .kt-item, .kt-lines li.done .kt-qty { opacity: .38; text-decoration: line-through; }
.kt-other { padding: 6px 14px; font-size: 0.85rem; color: var(--k-mute); border-top: 1px dashed var(--k-line); }
.kt-bump { margin: 8px; min-height: 64px; border-radius: 12px; border: 0; background: #eef2ef; color: #0b0f0d; font-family: var(--display); font-size: 1.4rem; font-weight: 850; letter-spacing: .04em; display: flex; align-items: center; justify-content: center; gap: 8px; }
.kt-bump:active { transform: scale(.98); background: #3bbf78; }
.kds-side { border-left: 1px solid var(--k-line); padding: 16px; overflow: auto; }
.allday { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.allday li { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--k-card); font-weight: 650; }
.allday b { font-family: var(--display); font-size: 1.5rem; min-width: 36px; }
.recall-list { display: flex; flex-direction: column; gap: 8px; }
.recall { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.recall b { font-family: var(--display); font-size: 1.3rem; }

/* ---------- Supervisor / repartidor ---------- */
.sup { max-width: 640px; margin: 0 auto; min-height: 100%; padding-bottom: 30px; }
.sup-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); background: var(--bg); border-bottom: 1px solid var(--line); }
.sup-bar div { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 1.15rem; }
.sup-sec { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 4px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 10px; }
.sup-sec h2 { display: flex; align-items: center; gap: 8px; }
.sup-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px; border-radius: var(--radius); background: var(--surface); color: var(--muted); text-align: center; }
.appr-card { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.appr-card header { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.appr-card p { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.appr-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.appr-btns .btn { min-height: 52px; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.feed li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); font-size: 0.9rem; }
.feed li > span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.feed li.sev-high { box-shadow: inset 3px 0 0 var(--bad); }
.feed li.sev-medium { box-shadow: inset 3px 0 0 var(--warn); }
.feed em { color: var(--muted); font-style: normal; }

/* ---------- Pantalla de clientes ---------- */
body[data-mode="display"] { background: #10201a; }
.cdisp { height: 100%; display: flex; flex-direction: column; background: #10201a; color: #f3f6f2; }
.cdisp header { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; font-family: var(--display); font-size: 1.6rem; color: #f3f6f2; }
.cdisp header div { display: flex; align-items: center; gap: 12px; color: #f06a4e; }
.cdisp header strong { color: #f3f6f2; }
.ghost-link { border: 0; background: transparent; color: #6f8a7e; }
.cd-cols { flex: 1; display: grid; grid-template-columns: 1fr 1.4fr; gap: 0; }
.cd-cols section { padding: 18px 28px; display: flex; flex-direction: column; gap: 16px; }
.cd-cols h2 { font-size: 1.6rem; color: #9fb7ab; text-transform: uppercase; letter-spacing: .06em; font-family: var(--font); font-weight: 750; }
.cd-ready { background: #f3f6f2; color: #10201a; border-radius: 28px 0 0 0; }
.cd-ready h2 { color: #23824f; }
.cd-nums { display: flex; flex-wrap: wrap; gap: 14px; }
.cd-nums span { font-family: var(--display); font-size: 3rem; font-weight: 800; min-width: 120px; color: #9fb7ab; display: flex; flex-direction: column; line-height: 1; }
.cd-nums.big span { font-size: 5rem; color: #10201a; animation: pop .4s; }
.cd-nums small { font-family: var(--font); font-size: 1.1rem; font-weight: 600; color: #4b6157; margin-top: 4px; }

/* ---------- BACK OFFICE ---------- */
.bo { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: 100%; }
.bo-nav { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.bo-brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid var(--line); }
.bo-brand .brand-word { font-size: 0.92rem; }
.bo-brand strong { display: block; color: var(--ink); font-family: var(--display); }
.bo-brand small { color: var(--muted); }
.bo-nav nav { flex: 1; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 1px; }
.nav-group { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; padding: 14px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 9px; border: 0; background: transparent; text-align: left; font-weight: 550; color: var(--ink-2); }
.nav-item span { flex: 1; }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.bo-user { border-top: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.bo-user > span { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.bo-main { overflow: auto; padding-block: 22px 60px; padding-left: max(16px, min(32px, 3vw)); padding-right: max(16px, min(32px, 3vw)); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bo-burger { display: none; }
.bo-scrim { display: none; }
.bo-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.bo-head h1 { font-size: 1.75rem; }
.bo-head p { max-width: 70ch; margin-top: 4px; }
.bo-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bo-tabs { align-self: flex-start; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .search { max-width: 340px; }
.bo-grid { display: grid; gap: 16px; }
.bo-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpis.small { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; }
.kpi.good::before { background: var(--good); } .kpi.warn::before { background: var(--warn); } .kpi.bad::before { background: var(--bad); }
.kpi-l { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.kpi-v { font-family: var(--display); font-size: 1.7rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi.good .kpi-v { color: var(--good); } .kpi.bad .kpi-v { color: var(--bad); }
.kpi-n { font-size: 0.8rem; color: var(--ink-2); }
.story { --chrome-ink: #f2f2ef; background: #141414; color: var(--chrome-ink); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.story-big { font-family: var(--display); font-size: clamp(1.3rem, 2.4vw, 1.9rem); line-height: 1.25; text-wrap: balance; max-width: 40ch; }
.story .good-text { color: #6fdc9d; } .story .bad-text { color: #ff8a80; }
.story p { max-width: 70ch; }
.flow { display: flex; height: 18px; border-radius: 999px; overflow: hidden; margin-top: 6px; gap: 2px; background: color-mix(in srgb, var(--chrome-ink) 12%, transparent); }
.flow span { min-width: 3px; }
.flow-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.88rem; }
.flow-legend li { display: flex; align-items: center; gap: 6px; }
.flow-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.goal-bar { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 8px; }
.goal-bar span { display: block; height: 100%; border-radius: 999px; }
.goal-bar .ok { background: var(--good); } .goal-bar .warn { background: var(--warn); } .goal-bar .bad { background: var(--bad); }
.attention { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.attention li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-3); }
.attention li .link { display: flex; gap: 8px; }
.attention li.bad { background: var(--bad-soft); color: var(--bad); }
.attention li.warn { background: var(--warn-soft); color: var(--warn); }
.chart-scroll { overflow-x: auto; }
.chart { width: 100%; height: auto; min-width: 320px; display: block; }
.chart .bar { fill: color-mix(in srgb, var(--accent) 45%, var(--surface-2)); }
.chart .bar.hi { fill: var(--accent); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .lbl { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart .val { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: var(--font); }
.scatter .q { fill: transparent; }
.scatter .q-star { fill: color-mix(in srgb, var(--good) 10%, transparent); }
.scatter .q-dog { fill: color-mix(in srgb, var(--bad) 8%, transparent); }
.scatter .q-plow { fill: color-mix(in srgb, var(--warn) 9%, transparent); }
.scatter .q-puzzle { fill: color-mix(in srgb, var(--info) 8%, transparent); }
.scatter .qlbl { fill: var(--muted); font-size: 12px; font-weight: 700; font-family: var(--font); }
.scatter .dlbl { fill: var(--ink); font-size: 11px; font-family: var(--font); }
.scatter .dot { stroke: var(--surface); stroke-width: 2; }
.dot-star { fill: var(--good); } .dot-plow { fill: var(--warn); } .dot-puzzle { fill: var(--info); } .dot-dog { fill: var(--bad); }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 0.9rem; }
.hb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: 999px; }
.hb-v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-v small { font-weight: 500; color: var(--muted); }
.plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cards.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ent-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left; overflow: hidden; }
button.ent-card:hover { border-color: var(--ink-2); }
.ent-card.inactive { opacity: .55; }
.ent-card.static { cursor: default; }
.ent-card.module.on { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.ent-card strong { font-size: 1.05rem; }
.ent-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.ent-card .row { width: 100%; }
.opt-list { font-size: 0.85rem; color: var(--ink-2); }
.big-num { font-family: var(--display); font-size: 1.5rem; font-weight: 750; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-family: var(--display); }
.pm-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; }
.checks li { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.checks li.on .ic { color: var(--good); } .checks li.off { color: var(--muted); } .checks li.off .ic { color: var(--bad); }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px 20px; }
.rule { padding: 6px 0; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
pre.code { margin: 0; padding: 14px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line); overflow: auto; font-family: var(--mono); font-size: 0.8rem; max-height: 360px; }
pre.code.ok { border-color: var(--good); } pre.code.bad { border-color: var(--bad); }
code { font-family: var(--mono); font-size: 0.85em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
.key-once { padding: 14px; border-radius: 12px; background: var(--warn-soft); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0; display: flex; justify-content: flex-end; background: linear-gradient(transparent, var(--bg) 40%); }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.receipt-preview { background: #fff; color: #111; border-radius: 10px; padding: 14px; max-width: 360px; margin: 0 auto; width: 100%; box-shadow: var(--shadow); }
.po-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-3); text-align: left; }
.po-card:hover { border-color: var(--accent); }
.scan-bar { display: flex; gap: 10px; }
.scan-input { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--accent); background: var(--surface); }
.scan-input input { flex: 1; border: 0; outline: none; background: transparent; font-size: 1.15rem; min-width: 0; }
.scan-last { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 12px; font-weight: 650; }
.scan-last.ok { background: var(--good-soft); color: var(--good); } .scan-last.bad { background: var(--bad-soft); color: var(--bad); }
.qty-in { width: 80px; text-align: center; min-height: 36px; }
tr.flash td, .count-row.flash { animation: flash 1.2s; }
@keyframes flash { from { background: var(--good-soft); } }
.receive-foot { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; }
.receive-foot .field { min-width: 240px; }
.cam { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 4 / 3; object-fit: cover; }
.count-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; }
.count-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.count-row:nth-child(odd) { background: var(--surface-3); }

/* Editor de productos */
.pe-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
.pe-photo { display: flex; flex-direction: column; gap: 8px; }
.photo-box { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--surface-2); max-width: 100%; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.pe-sec { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.pe-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.variants-ed { display: flex; flex-direction: column; gap: 14px; }
.variant-ed { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-3); }
.variant-ed-head { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 12px; align-items: end; }
.recipe { display: flex; flex-direction: column; gap: 8px; }
.recipe .tbl { background: var(--surface); border-radius: 10px; }
.cost-sum { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; font-size: 0.92rem; padding: 8px 10px; border-radius: 10px; background: var(--surface); }

/* ---------- Impresión 80 mm ---------- */
#print-area { display: none; }
.receipt { font-family: var(--mono); font-size: 12px; line-height: 1.35; color: #111; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 1px 0; vertical-align: top; }
.receipt hr { border: 0; border-top: 1px dashed #555; margin: 6px 0; }
.r-center { text-align: center; }
.r-right { text-align: right; white-space: nowrap; padding-left: 8px; }
.r-big { font-size: 15px; }
.r-total td { font-weight: 800; font-size: 14px; }
@media print {
  @page { size: 80mm auto; margin: 3mm; }
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { display: block; position: absolute; left: 0; top: 0; width: 74mm; }
  body { background: #fff; }
}

/* ---------- Tamaños ---------- */
@media (max-width: 1180px) {
  .pos { grid-template-columns: minmax(0, 1fr) 350px; grid-template-rows: 64px auto minmax(0, 1fr); grid-template-areas: "top top" "cats ticket" "menu ticket"; }
  .cats { flex-direction: row; overflow-x: auto; padding: 10px 14px 0; }
  .cats-label { display: none; }
  .cat { min-height: 46px; white-space: nowrap; flex: none; }
  .ticket { margin: 12px 12px 12px 0; }
  .tb-btn span { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .bo { grid-template-columns: 1fr; }
  .bo-nav { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(290px, 85vw); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); padding-top: env(safe-area-inset-top, 0px); }
  .bo.nav-open .bo-nav { transform: none; }
  .bo.nav-open .bo-scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgb(0 0 0 / 35%); }
  .bo-burger { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; }
  .bo-grid.two { grid-template-columns: 1fr; }
  .pay-wrap { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(4, 240px); }
  .pe-grid { grid-template-columns: 1fr; }
  .pe-photo { max-width: 260px; }
  .tb-brand .brand-txt { display: none; }
}
@media (max-width: 760px) {
  .pos { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "top" "cats" "menu"; }
  .topbar { gap: 6px; padding: 6px 6px 8px 10px; flex-wrap: wrap; }
  .topbar .seg { order: 3; width: 100%; }
  .topbar .seg button { flex: 1; padding: 0 8px; font-size: 0.88rem; justify-content: center; }
  .tb-btn, .tb-user { min-height: 42px; padding: 0 10px; }
  .tb-user span { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 10px 10px 90px; }
  .ticket { position: fixed; z-index: 30; inset: 0; margin: 0; border-radius: 0; padding-top: env(safe-area-inset-top, 0px); transform: translateY(100%); transition: transform .22s; }
  .menu-title { font-size: 1.4rem; }
  .menu-tools { flex-wrap: wrap; }
  .menu-tools .search { flex: 1 1 100%; }
  .pos.show-cart .t-head { padding-right: 150px; }
  .pos.show-cart .ticket { transform: none; }
  .cart-fab { display: inline-flex; align-items: center; gap: 8px; position: fixed; z-index: 31; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); min-height: 56px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 750; font-size: 1.02rem; box-shadow: var(--shadow); white-space: nowrap; }
  .pos.show-cart .cart-fab { bottom: auto; top: calc(10px + env(safe-area-inset-top, 0px)); left: auto; right: 12px; transform: none; min-height: 44px; padding: 0 14px; font-size: 0.9rem; }
  .overlay-shift { inset: 0; z-index: 40; }
  .order-row { grid-template-columns: 56px minmax(0, 1fr) 90px; }
  .or-st, .or-time { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .denoms { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-v { font-size: 1.35rem; }
  .modal-layer { padding: 0; align-items: end; }
  .modal-box { border-radius: 20px 20px 0 0; max-height: 94dvh; }
  .variant-ed-head { grid-template-columns: 1fr 1fr; }
  .variant-ed-head .row { grid-column: 1 / -1; }
  .cd-cols { grid-template-columns: 1fr; }
  .kds-body.with-side { grid-template-columns: 1fr; }
  .kds-side { display: none; }
  .hbars li { grid-template-columns: 90px minmax(0, 1fr) auto; }
  .chooser-head h1 { font-size: 1.6rem; }
}

/* ---------- Área de pruebas / modo prueba: nunca confundir con el sistema real ---------- */
body.env-test::after { content: ""; position: fixed; inset: 0; border: 4px solid #f5b400; pointer-events: none; z-index: 200; }
#env-banner { position: fixed; z-index: 201; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 10px; background: #f5b400; color: #1a1400; font-size: 0.8rem; box-shadow: var(--shadow); max-width: calc(100vw - 24px); flex-wrap: wrap; }
#env-banner strong { letter-spacing: 0.06em; }
#env-banner button { border: 0; border-radius: 7px; padding: 4px 10px; background: #1a1400; color: #f5b400; font-weight: 700; font-size: 0.78rem; cursor: pointer; }

/* Cliente encontrado por teléfono */
.known-cust { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--good-soft); color: var(--ink); }
.known-cust .ic { color: var(--good); margin-top: 2px; }
.known-cust div { display: flex; flex-direction: column; gap: 2px; }
.known-cust strong { color: var(--good); }
.known-cust small { color: var(--ink-2); }
