/* Restoga — estilos */
:root {
  --bg: #f6f5f4;
  --surface: #ffffff;
  --surface-2: #faf9f8;
  --line: #e9e5e3;
  --ink: #1c1917;
  --ink-2: #4a4441;
  --muted: #7a726e;
  --primary: #e5484d;
  --primary-ink: #ffffff;
  --primary-soft: #feeceb;
  --accent: #ff7a59;
  --good: #1f9d6b;
  --good-soft: #e3f6ee;
  --warn: #c77800;
  --warn-soft: #fff3dc;
  --info: #2563eb;
  --info-soft: #e8f0fe;
  --bill: #7c4dff;
  --bill-soft: #f0eaff;
  --bad: #c42b37;
  --bad-soft: #fde8ea;
  --side: #171514;
  --side-ink: #cfc8c4;
  --shadow: 0 1px 2px rgba(28, 20, 18, .06), 0 4px 16px rgba(28, 20, 18, .06);
  --shadow-lg: 0 10px 40px rgba(28, 20, 18, .18);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121111;
    --surface: #1b1a19;
    --surface-2: #232120;
    --line: #302c2a;
    --ink: #f3f1f0;
    --ink-2: #d2ccc9;
    --muted: #9b9390;
    --primary: #f2555a;
    --primary-soft: #3a1c1d;
    --good: #3cc68d;
    --good-soft: #15332a;
    --warn: #f0a53a;
    --warn-soft: #3a2c14;
    --info: #7aa7ff;
    --info-soft: #172544;
    --bill: #a78bfa;
    --bill-soft: #2a2145;
    --bad: #ff6b78;
    --bad-soft: #3d1b20;
    --side: #0d0c0c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; } /* sin zoom por doble toque */
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.hp { position: absolute; left: -9999px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Botones e inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: var(--surface); color: var(--ink); border-color: var(--line);
  transition: background .15s, transform .05s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-good { background: var(--good); color: #fff; border-color: var(--good); }
.btn-danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%;
  min-height: 40px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); margin: 0; }
input[type=color] { padding: 4px; height: 40px; }
/* Etiqueta de campo: el texto (y su aclaración chica) en un renglón, el campo abajo y la ayuda debajo del campo.
   Así dos campos lado a lado quedan siempre a la misma altura. */
label { display: block; font-weight: 500; font-size: 13.5px; color: var(--ink-2); }
label > small { font-weight: 400; }
label > :where(input:not([type=checkbox], [type=radio]), select, textarea) { display: block; margin-top: 6px; }
label > :where(.row, .seg, .pay-lines, div) { margin-top: 6px; }
label > :where(input, select, textarea, .row, div) ~ :where(small) { display: block; margin-top: 5px; line-height: 1.35; }
/* Etiquetas que arman su propia fila o grilla (casillas, billetes, mini campos): sin el espacio de arriba */
:is(.check-row, .perm-item, .seg label, .bill, .sw, .rec-waste, .mg-mini, .pay-cash, .rep-field, label.btn, .chat-attach) > * { margin-top: 0; }
.check-row { display: flex; flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-section { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 12px; align-items: start; }
.grid3 .span3, .grid3 .span-all { grid-column: 1 / -1; }
@media (max-width: 600px) { .grid3 { grid-template-columns: 1fr 1fr; } }
.grid2 .span2 { grid-column: span 2; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.upd-list { margin: 6px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.setting-row > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.setting-row .seg { flex: none; flex-wrap: nowrap; }
@media (max-width: 600px) { .setting-row { flex-direction: column; align-items: flex-start; } }
.seg label { display: flex; flex-direction: row; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; }

.alert { padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.alert-error { background: var(--bad-soft); color: var(--bad); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-info { background: var(--primary-soft); color: var(--primary); }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: inherit; letter-spacing: -.02em; }
.brand img { width: 32px; height: 32px; }
.brand-lg { font-size: 26px; }
.brand-lg img { width: 42px; height: 42px; }

/* ---------- Login / registro ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); min-height: 100vh; }
.auth-hero {
  background: radial-gradient(1200px 600px at -10% -10%, #e5484d 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 110%, #ff7a59 0%, transparent 55%), #171514;
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 28px;
}
.auth-hero h2 { font-size: 36px; line-height: 1.15; font-weight: 800; }
.hero-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: #e6dfdb; }
.hero-list li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.14); margin-right: 10px; font-size: 12px; }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 28px; font-weight: 800; }
.auth-alt { text-align: center; color: var(--muted); }
.auth-card > h1 { text-wrap: balance; }
.auth-card > h1 + .muted { margin: -8px 0 4px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 84px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); height: calc(100% - 8px); min-width: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pw-eye:active { transform: translateY(-50%) scale(.97); }
@media (hover: hover) and (pointer: fine) { .pw-eye:hover { color: var(--ink); background: var(--surface-2); } }
.field-hint { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.auth-forgot { text-align: center; font-size: 13.5px; color: var(--muted); }
.auth-forgot { margin: 0; }
.auth-forgot a { display: inline-block; padding: 6px; color: var(--muted); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .auth-forgot a:hover { color: var(--ink); } }
.auth-done { display: flex; flex-direction: column; gap: 12px; }
.auth-done .btn { white-space: normal; text-align: center; }
.auth-done p { margin: 0; line-height: 1.55; color: var(--ink-2); }
.btn-wa .wa-ico { width: 20px; height: 20px; flex: none; }
/* Botón flotante de WhatsApp (sitio público, ingreso y registro) */
.wa-float { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 60; display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 16px; border-radius: 999px; background: #25d366; color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; box-shadow: 0 8px 24px rgba(18, 140, 75, .35), 0 2px 6px rgba(0,0,0,.12); transition: transform .15s ease-out, box-shadow .15s; animation: wa-in .3s ease-out .6s both; }
.wa-float .wa-ico { width: 28px; height: 28px; flex: none; }
.wa-float:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .wa-float:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(18, 140, 75, .4), 0 2px 6px rgba(0,0,0,.12); color: #fff; } }
@keyframes wa-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }
@media (max-width: 600px) { .wa-float { width: 56px; padding: 0; justify-content: center; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); } .wa-float span { display: none; } }
@media (prefers-reduced-motion: reduce) { .wa-float { animation: none; } }
/* Plataforma → Contraseñas */
.pw-list { display: flex; flex-direction: column; gap: 10px; }
.pw-req { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.pw-req.is-done { background: var(--surface-2); }
.pw-req-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pw-req-mail { font-weight: 700; word-break: break-all; }
.pw-req-note { color: var(--ink-2); font-style: italic; }
.pw-req-act { display: flex; gap: 8px; flex-wrap: wrap; }
.entry-links a { display: inline-flex; align-items: center; gap: 6px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 13px; }
.check.ok { color: var(--good); } .check.bad { color: var(--bad); font-weight: 600; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 16px; gap: 14px; }
  .auth-hero h2 { font-size: 24px; }
  .hero-list { display: none; }
}

/* ---------- Landing ---------- */
.landing { background: var(--side); color: #fff; }
.land-nav { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; max-width: 1180px; margin: 0 auto; gap: 12px; }
.land-nav .btn-ghost { color: #e6e1f5; }
.land-nav .btn-ghost:hover { background: rgba(255,255,255,.08); }
.land-hero { text-align: center; padding: 72px 16px 56px; max-width: 900px; margin: 0 auto; }
.land-hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.05; font-weight: 800; letter-spacing: -.03em; margin: 18px 0; }
.land-hero p { font-size: 18px; color: #bdb6d3; max-width: 640px; margin: 0 auto; }
.grad { background: linear-gradient(90deg, #a597ff, #ff8f70); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pill { display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.08); color: #d8d2ee; font-size: 13px; font-weight: 600; }
.land-cta { display: flex; gap: 12px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.land-cta .btn-ghost { color: #fff; border-color: rgba(255,255,255,.2); }
.land-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 1180px; margin: 0 auto; padding: 32px 16px 64px; }
.feature { background: #1f1b2b; border: 1px solid #2c2739; border-radius: 18px; padding: 24px; }
.feature-icon { font-size: 28px; }
.feature h3 { margin: 12px 0 6px; font-size: 18px; }
.feature p { margin: 0; color: #b0a9c6; }
.land-find { max-width: 560px; margin: 26px auto 0; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.land-find label { color: #cfc9e3; font-weight: 600; font-size: 15px; }
.land-find-row { display: flex; align-items: center; background: #fff; border-radius: 14px; padding: 6px 6px 6px 14px; gap: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.land-find-prefix { color: #6f6764; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.land-find-row input { flex: 1; min-width: 0; border: 0; box-shadow: none; padding: 10px 4px; font-size: 16px; font-weight: 600; color: #1c1917; background: transparent; }
.land-find-row input:focus { outline: none; box-shadow: none; }
.land-find-err { color: #ffb4b4; font-size: 14px; }
@media (max-width: 600px) { .land-find-prefix { display: none; } }
.land-foot { text-align: center; color: #8a83a0; padding: 24px; font-size: 13px; }

/* ---------- Shell de la app ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: none; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { color: #fff; padding: 0 8px; }
.bar-name { padding: 4px 10px 16px; font-size: 13px; color: #9a918c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-ink); font-weight: 500; }
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(229,72,77,.35), rgba(229,72,77,.12)); color: #fff; }
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot .btn-ghost { color: #b3aaa5; }
.sidebar-foot .btn-ghost:hover { background: rgba(255,255,255,.06); }
.user-chip { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; color: inherit; padding: 6px 8px; border-radius: 10px; cursor: pointer; text-align: left; font: inherit; }
.user-chip:hover { background: rgba(255,255,255,.06); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #e5484d, #ff8a4c); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-meta strong { color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: #9a918c; }
.sidebar-backdrop { display: none; }
.nav a.has-update, .side-platform.has-update { position: relative; }
.nav a.has-update::after, .side-platform.has-update::after { content: ''; position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #ff5a5f; box-shadow: 0 0 0 2px var(--side); }
/* Plataforma (super administrador) */
.platform-page { background: var(--bg); }
.pf-top { display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 20; }
.pf-top .brand { color: #fff; }
.pf-top .brand img { width: 30px; height: 30px; }
.pf-top .btn-ghost { color: #cfc8c4; }
.pf-tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--primary); color: #fff; margin-left: 4px; }
.pf-main { max-width: 1240px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.pf-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pf-kpis .pf-alert { border-color: var(--bad); }
.pf-tabs { align-self: flex-start; }
.pf-head { flex-wrap: wrap; gap: 10px; }
.pf-head input { max-width: 280px; }
.pf-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-filters .chip { padding: 5px 11px; font-size: 13px; }
.pf-detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; padding: 18px; overflow-y: auto; }
.pf-actions { flex-wrap: wrap; gap: 8px; }
/* Importar precios desde Excel */
.imp-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.imp-chip { padding: 6px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.imp-chip.good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.imp-chip.bad { background: #fde8e8; border-color: transparent; color: var(--bad); }
.imp-table { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.imp-table .tbl th { position: sticky; top: 0; z-index: 1; }
.imp-big td { background: var(--warn-soft); }
.imp-up { color: var(--good); font-weight: 700; }
.imp-down { color: var(--bad); font-weight: 700; }
.imp-problems summary { cursor: pointer; font-weight: 600; color: var(--bad); }
.imp-problems ul { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
/* Pedidos de la tienda online */
.src-online { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #fff1e6; color: #c2410c; border: 1px solid #fed7aa; white-space: nowrap; vertical-align: middle; }
.src-online.on-dark { margin-left: 8px; }
.oa-bar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: #fff4ec; color: #7c2d12; position: sticky; top: 0; z-index: 150; border-bottom: 1px solid #fed7aa; }
.oa-bar .oa-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #ffe4cc; color: #c2410c; flex: none; }
.oa-bar .oa-icon .ico { width: 18px; height: 18px; }
.oa-bar .oa-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.oa-bar .oa-text strong { font-size: 14px; }
.oa-bar .oa-text small { color: #9a3412; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oa-bar .oa-hint { font-weight: 700; }
.oa-bar .oa-mute { background: transparent; border-color: #fed7aa; color: #7c2d12; }
.oa-bar .btn-primary { background: #f97316; color: #fff; border-color: #f97316; }
@media (max-width: 600px) { .oa-bar { flex-wrap: wrap; } .oa-bar .oa-text { flex-basis: calc(100% - 50px); } .oa-bar .btn-primary { flex: 1; } }
.oa-bar .oa-unlock { background: #fff; color: #c2410c; border-color: #fdba74; font-weight: 700; }
:root[data-theme="dark"] .oa-bar { background: #2a1a10; color: #fed7aa; border-bottom-color: #4a2a14; }
:root[data-theme="dark"] .oa-bar .oa-text small, :root[data-theme="dark"] .oa-bar .oa-mute { color: #fdba74; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .oa-bar { background: #2a1a10; color: #fed7aa; border-bottom-color: #4a2a14; } :root:not([data-theme="light"]) .oa-bar .oa-text small, :root:not([data-theme="light"]) .oa-bar .oa-mute { color: #fdba74; } }
.sales-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sales-top .mode-tabs { flex: 1 1 420px; }
.sound-chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sound-chip.off { color: var(--muted); opacity: .7; }
.sound-mute { padding: 0 10px; line-height: 1; }
.nav a .nav-count { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ff5a1f; color: #fff; font-size: 11px; font-weight: 800; font-style: normal; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--side); }
.mobile-tabs a, .bottom-nav a { position: relative; }
.mobile-tabs a .nav-count, .bottom-nav a .nav-count { top: 2px; right: calc(50% - 22px); box-shadow: 0 0 0 2px var(--surface); }
.pf-bar { gap: 10px; flex-wrap: wrap; }
.pf-team { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pf-team .tbl.tbl td, .pf-detail .tbl.tbl td { white-space: normal; vertical-align: middle; overflow-wrap: anywhere; }
.pf-team .tbl.tbl td.r, .pf-detail .tbl.tbl td.r { white-space: nowrap; width: 1%; overflow-wrap: normal; }
.pf-detail > *, .pf-detail .card, .pf-detail form { min-width: 0; }
.pf-detail .row { flex-wrap: wrap; }
@media (max-width: 700px) { .pf-table th:nth-child(2), .pf-table td:nth-child(2), .pf-table th:nth-child(5), .pf-table td:nth-child(5) { display: none; } .tbl.pf-table td { white-space: normal; padding: 10px 12px; } .tbl.pf-table td.r { white-space: nowrap; } .pf-head input { max-width: none; width: 100%; } }
.pf-log { list-style: none; margin: 0; padding: 4px 16px 12px; display: flex; flex-direction: column; font-size: 13.5px; }
.pf-log li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.pf-log li span { min-width: 0; overflow-wrap: anywhere; }
.pf-log li:first-child { border-top: 0; }
.pf-log small { white-space: nowrap; }
@media (max-width: 900px) { .pf-team { grid-template-columns: 1fr; } .pf-log li { flex-direction: column; gap: 2px; } }
.pf-cred { display: grid; gap: 10px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 14px; }
.pf-cred div { display: flex; flex-direction: column; gap: 2px; }
.pf-cred small { color: var(--muted); }
.pf-cred strong { font-size: 18px; }
@media (max-width: 900px) { .pf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pf-detail { grid-template-columns: minmax(0, 1fr); padding: 12px; } .pf-main { padding: 14px; } .pf-top { padding: 10px 14px; } }
.billing-strip { display: flex; align-items: center; gap: 12px; padding: 9px 16px 9px 20px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; background: var(--warn-soft); color: var(--warn); }
.billing-strip.bad { background: #fde8e8; color: var(--bad); }
.billing-strip span { flex: 1; }
.update-strip { display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 20px; background: var(--primary-soft); color: var(--ink); border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.update-strip span { flex: 1; }
.side-btn { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #b3aaa5; font-size: 13.5px; font-weight: 500; }
.side-btn svg { width: 20px; height: 20px; flex: none; }
.side-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-tip { position: fixed; z-index: 200; pointer-events: none; background: #262220; color: #fff; padding: 7px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 24px rgba(16, 12, 10, .35); animation: tip-in .12s ease-out; }
/* Flechita arriba, apuntando al ícono (--ax la calcula main.js) */
.side-tip::before { content: ''; position: absolute; left: var(--ax, 50%); top: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
@keyframes tip-in { from { opacity: 0; margin-top: -4px; } }
@media (prefers-reduced-motion: reduce) { .side-tip, .user-pop { animation: none; } }

/* En la compu: barra angosta con íconos grandes; el nombre aparece flotando al pasar el mouse */
@media (min-width: 961px) {
  .sidebar { width: 84px; padding: 16px 0; align-items: center; }
  .sidebar .brand { padding: 0; margin-bottom: 18px; }
  .sidebar .brand img { width: 40px; height: 40px; }
  .brand-text, .bar-name, .nav a span, .side-btn span, .user-meta { display: none; }
  .nav { align-items: center; gap: 6px; width: 100%; padding: 0 12px; }
  .nav a { width: 58px; height: 54px; flex: none; justify-content: center; padding: 0; border-radius: 15px; color: #b5ada8; }
  .nav a svg { width: 27px; height: 27px; }
  .nav a.active { background: var(--primary); color: #fff; box-shadow: 0 8px 20px -8px var(--primary); }
  .sidebar-foot { align-items: center; width: 100%; gap: 6px; padding: 12px 12px 0; }
  .user-chip { padding: 4px; border-radius: 50%; }
  .user-chip .avatar { width: 40px; height: 40px; font-size: 16px; }
  .side-btn { width: 48px; height: 44px; justify-content: center; padding: 0; border-radius: 12px; }
  .side-btn svg { width: 23px; height: 23px; }
  /* En pantallas bajas (notebooks) los botones se achican solos para que entre todo, sin barras de desplazamiento */
  .nav { scrollbar-width: none; overflow-x: hidden; min-height: 0; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 1 54px; height: auto; min-height: 32px; }
}
@media (min-width: 961px) and (max-height: 840px) {
  .sidebar { padding: 12px 0; }
  .sidebar .brand { margin-bottom: 10px; }
  .sidebar .brand img { width: 34px; height: 34px; }
  .nav { gap: 4px; }
  .nav a { border-radius: 13px; }
  .nav a svg { width: 23px; height: 23px; }
  .sidebar-foot { gap: 2px; padding-top: 8px; }
  .side-btn { width: 44px; height: 36px; }
  .side-btn svg { width: 20px; height: 20px; }
  .user-chip .avatar { width: 32px; height: 32px; font-size: 14px; }
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-x: clip; } /* nada ensancha la página en el celular */
.topbar {
  display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.clock { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.menu-toggle { display: none; }
.view { padding: 24px; flex: 1; min-width: 0; }

@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
  .sidebar .nav { flex: 1 0 auto; overflow: visible; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(16, 12, 10, .45); z-index: 55; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 0 12px 0 8px; }
  .view { padding: 16px; }
  .clock { display: none; }
}

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15.5px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .cols-2 { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .cols-4 { grid-template-columns: 1fr 1fr; gap: 10px; } }

.stat { padding: 18px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
@media (max-width: 520px) { .stat { padding: 14px; } .stat-value { font-size: 21px; } }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge-good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge-primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); padding: 4px; border-radius: 12px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--muted); padding: 7px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: var(--surface-2); }
.tbl .wrap { white-space: normal; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-icon { font-size: 36px; margin-bottom: 8px; }

.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(12, 10, 22, .5); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal-lg { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px; }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 10px 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (max-width: 600px) {
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .grid2 { grid-template-columns: 1fr; } .grid2 .span2 { grid-column: auto; }
}

.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 36px); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .2s; }
.toast.error { background: var(--bad); color: #fff; }
.toast.good { background: var(--good); color: #fff; }

/* ---------- Salón ---------- */
.salon-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.legend { display: flex; gap: 6px 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; flex: 1 1 260px; min-width: 0; }
.floor-tools { display: flex; gap: 6px; flex: none; margin-left: auto; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.floor {
  position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 420px; container-type: size;
  display: grid; place-items: center;
  background-color: var(--surface);
  background-image: radial-gradient(var(--line) 1.2px, transparent 1.2px);
  background-size: 22px 22px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
/* El salón tiene siempre la misma proporción (16:9) y entra entero en el espacio disponible, centrado */
.floor-canvas { position: relative; width: min(100cqw, 177.78cqh); aspect-ratio: 16 / 9; container-type: inline-size; }
/* Grilla del salón: cada mesa ocupa casilleros enteros (--c, --r: columna y fila; --cw, --ch: cuántos ocupa).
   El tamaño de los casilleros sale del zoom del salón (--cols × --rows) */
.floor-canvas { --cols: var(--fc, 12); --rows: var(--fr, 7); --ox: 0; --oy: 0; --cell: calc(100cqw / var(--cols, 12)); }
.floor-canvas .tbl-node {
  --gap: calc(var(--cell) * .08);
  left: calc((var(--c) - var(--ox)) * 100% / var(--cols, 12) + var(--gap)); top: calc((var(--r) - var(--oy)) * 100% / var(--rows, 7) + var(--gap));
  width: calc(var(--cw, 1) * 100% / var(--cols, 12) - 2 * var(--gap)); height: calc(var(--ch, 1) * 100% / var(--rows, 7) - 2 * var(--gap));
  min-width: 0; aspect-ratio: auto; border-radius: calc(var(--cell) * .16); padding: 2px;
}
.floor-canvas .tbl-node.s-S, .floor-canvas .tbl-node.bar { --gap: calc(var(--cell) * .17); }
.floor-canvas .tbl-node.round, .floor-canvas .tbl-node.bar { border-radius: 50%; }
/* Los textos acompañan el tamaño del casillero */
.floor-canvas .tbl-node .t-name { font-size: clamp(11px, calc(var(--cell) * .24), 22px); }
.floor-canvas .tbl-node .t-sub, .floor-canvas .tbl-node .t-time { font-size: clamp(8px, calc(var(--cell) * .14), 12px); }
.floor-canvas .tbl-node.s-S .t-name, .floor-canvas .tbl-node.bar .t-name { font-size: clamp(10px, calc(var(--cell) * .2), 16px); }
.floor-canvas .tbl-node.s-S .t-time, .floor-canvas .tbl-node.bar .t-time { display: none; }
/* Casilleros chicos (plano angosto o mucho zoom): solo el nombre de la mesa */
@container (max-width: 640px) {
  .fe-canvas .tbl-node .t-sub { display: none; }
  .fe-canvas .tbl-node .t-name { font-size: clamp(9px, calc(var(--cell) * .34), 18px); }
}
.tbl-node {
  /* Tamaño: --w (chica, mediana, grande) × --k (forma: rectangular más larga, barra más chica) */
  --w: 9.5%; --mw: 44px; --k: 1;
  /* El tamaño es relativo al plano: el salón se ve siempre igual, más grande o más chico según la pantalla */
  position: absolute; width: calc(var(--w) * var(--k)); min-width: calc(var(--mw) * var(--k)); aspect-ratio: 1.2; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; border-radius: 16px; cursor: pointer; user-select: none;
  background: var(--surface-2); border: 2px solid var(--line); color: var(--ink); transition: box-shadow .15s, transform .1s;
  touch-action: none; text-align: center; padding: 4px;
}
/* Los textos no se salen de la mesa; la etiqueta (Cuenta, listo) sí puede asomar por la esquina */
.tbl-node .t-name, .tbl-node .t-sub, .tbl-node .t-time { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tbl-node.s-S { --w: 7%; --mw: 36px; }
.tbl-node.s-L { --w: 13%; --mw: 60px; }
.tbl-node.round { border-radius: 50%; aspect-ratio: 1; }
.tbl-node.rect { --k: 1.8; aspect-ratio: 2.3; }
.tbl-node.bar { --k: .7; border-radius: 50%; aspect-ratio: 1; }
.tbl-node.s-S .t-name, .tbl-node.bar .t-name { font-size: 14px; }
.tbl-node.s-S .t-sub, .tbl-node.s-S .t-time, .tbl-node.bar .t-sub, .tbl-node.bar .t-time { font-size: 10px; }
.tbl-node.bar .t-time { display: none; }
.tbl-node:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tbl-node .t-name { font-weight: 800; font-size: 18px; }
.tbl-node .t-sub { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tbl-node .t-time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tbl-node.busy { background: var(--primary-soft); border-color: var(--primary); }
.tbl-node.busy .t-sub { color: var(--primary); font-weight: 600; }
.tbl-node.ready { background: var(--good-soft); border-color: var(--good); }
.tbl-node.ready .t-sub { color: var(--good); }
.tbl-node.paying { background: var(--warn-soft); border-color: var(--warn); }
.tbl-node.paying .t-sub { color: var(--warn); }
.tbl-node.cuenta { background: var(--bill-soft); border-color: var(--bill); box-shadow: 0 0 0 2px var(--bill-soft); }
.tbl-node.cuenta .t-sub { color: var(--bill); font-weight: 700; }
.tbl-node .t-flag.cuenta { background: var(--bill); }
.st-tag.cuenta { border-color: var(--bill); color: var(--bill); }
.btn-bill { border-color: var(--bill); color: var(--bill); }
.tbl-node .t-flag { position: absolute; top: -8px; right: -8px; background: var(--good); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
/* Celular: el mismo plano de la PC, recortado a la zona con mesas, con casilleros cuadrados y entero a lo ancho.
   Solo si el salón es enorme (casilleros de menos de 30px) se desliza de costado. */
@media (max-width: 760px) {
  .floor { display: block; aspect-ratio: auto; min-height: 0; padding: 6px; overflow-x: auto; overscroll-behavior-x: contain; border-radius: 16px; container-type: inline-size; }
  .floor-canvas { --cols: var(--mc, 12); --rows: var(--mr, 7); --ox: var(--mx, 0); --oy: var(--my, 0);
    width: max(100%, calc(var(--cols) * 30px)); aspect-ratio: var(--cols) / var(--rows); margin: 0 auto; }
  .floor-canvas .tbl-node { --gap: calc(var(--cell) * .07); }
  .floor-canvas .tbl-node:hover { transform: none; }
  .floor-canvas .tbl-node .t-name { font-size: clamp(13px, calc(var(--cell) * .3), 22px); }
  .floor-canvas .tbl-node .t-sub { font-size: clamp(9px, calc(var(--cell) * .17), 12px); }
  .floor-canvas .tbl-node .t-time { display: none; }
  /* Mesas libres chicas: solo el número (los lugares no entran) */
  .floor-canvas .tbl-node:is(.s-S, .bar):not(.busy, .ready, .paying, .cuenta) .t-sub { display: none; }
  /* Casilleros chicos: las mesas de un casillero muestran solo el número; el color dice si está ocupada */
  .floor.compact .tbl-node:not(.s-L.round, .s-L.square) .t-sub { display: none; }
  .floor.compact .tbl-node { padding: 0; }
  .floor.compact .tbl-node:is(.s-S, .bar) { --gap: calc(var(--cell) * .12); }
  .floor.compact .tbl-node:is(.s-S, .bar) .t-name { font-size: clamp(10px, calc(var(--cell) * .34), 14px); text-overflow: clip; }
  .floor.compact .tbl-node .t-flag { font-size: 0; width: 10px; height: 10px; padding: 0; top: -3px; right: -3px; }
  .salon-top { flex-wrap: nowrap; gap: 8px; }
  .salon-top .tabs { min-width: 0; }
  .salon-top .floor-tools .btn { white-space: nowrap; }
  .floor-canvas .tbl-node .t-flag { font-size: 10px; padding: 1px 6px; top: -6px; right: -4px; }
}
.swatch { width: 14px; height: 14px; border-radius: 5px; border: 2px solid; display: inline-block; }

/* ---------- Pedido (POS) ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.pos-catalog { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.prod {
  position: relative; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px;
  padding: 14px 14px 12px; cursor: pointer; font: inherit; color: var(--ink); min-height: 92px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px; overflow: hidden; transition: transform .06s, box-shadow .15s;
}
.prod::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--primary)); }
.prod:hover { box-shadow: var(--shadow); }
.prod:active { transform: scale(.98); }
.prod-name { font-weight: 600; line-height: 1.25; }
.prod-price { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.prod .stock { position: absolute; top: 8px; right: 8px; }
.prod:disabled { opacity: .45; }

.ticket { position: sticky; top: 82px; display: flex; flex-direction: column; max-height: calc(100vh - 106px); }
.ticket-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.ticket-head h3 { font-size: 18px; }
.ticket-body { overflow-y: auto; flex: 1; min-height: 120px; }
.ticket-section { padding: 8px 18px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.line { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 18px; border-bottom: 1px dashed var(--line); }
.line.pending { background: var(--warn-soft); }
.line-name { font-weight: 600; min-width: 0; }
.line-name small { display: block; color: var(--muted); font-weight: 500; }
.line-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.qty button { width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer; font-size: 16px; color: var(--ink-2); border-radius: 8px; }
.qty button:hover { background: var(--surface-2); }
.qty span { min-width: 22px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.k-status { font-size: 11px; }
.ticket-totals { padding: 12px 18px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.ticket-totals .row { justify-content: space-between; }
.ticket-totals .grand { font-size: 22px; font-weight: 800; }
.ticket-actions { padding: 12px 18px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ticket-actions .full { grid-column: span 2; }
.pos-mobile-bar { display: none; }
@media (max-width: 1100px) {
  .pos { grid-template-columns: 1fr; }
  .ticket { position: static; max-height: none; }
  .pos-mobile-bar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; gap: 10px;
    background: var(--ink); color: var(--bg); border-radius: 14px; padding: 10px 10px 10px 16px; align-items: center; box-shadow: var(--shadow-lg); transition: transform .2s, opacity .2s;
  }
  .pos-mobile-bar strong { font-size: 17px; }
  .pos-mobile-bar.out { transform: translateY(140%); opacity: 0; pointer-events: none; }
  .view.has-mobile-bar { padding-bottom: 92px; }
}

.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.pay-methods button { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.pay-methods button.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.pay-summary div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.pay-summary small { color: var(--muted); display: block; font-size: 12px; }
.pay-summary strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.quick-amounts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Cocina ---------- */
.kds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kds-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px; min-height: 300px; }
.kds-col h3 { display: flex; align-items: center; justify-content: space-between; font-size: 15px; padding: 4px 6px 12px; }
.kds-ticket { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow); border-top: 4px solid var(--warn); }
.kds-ticket.preparando { border-top-color: var(--info); }
.kds-ticket.listo { border-top-color: var(--good); }
.kds-ticket.late { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px var(--bad-soft); } }
.kds-head { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; }
.kds-head strong { font-size: 17px; }
.kds-time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.kds-time.late { color: var(--bad); }
.kds-items { list-style: none; margin: 0; padding: 0 14px 6px; }
.kds-items li { padding: 6px 0; border-top: 1px dashed var(--line); font-size: 15px; }
.kds-items b { font-size: 16px; margin-right: 4px; }
.kds-items .note { display: block; color: var(--bad); font-size: 13px; font-weight: 600; }
.kds-ticket .btn { margin: 6px 14px 12px; width: calc(100% - 28px); }
@media (max-width: 900px) { .kds { grid-template-columns: 1fr; } .kds-col { min-height: 0; } }

/* ---------- Gráficos (reportes) ---------- */
.chart { position: relative; padding-top: 10px; padding-bottom: 24px; }
.plot { position: relative; height: 200px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--muted); }
.chart-gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); font-size: 11px; color: var(--muted); pointer-events: none; }
.chart-gridline span { position: absolute; top: -8px; right: 100%; padding-right: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; min-width: 0; cursor: default; }
.chart-col .bar { width: 70%; max-width: 44px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; transition: opacity .15s; }
.chart-col:hover .bar { opacity: .8; }
.chart-col .x { position: absolute; bottom: -22px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -110%); z-index: 3; box-shadow: var(--shadow-lg); }
.hbar { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto; gap: 10px; align-items: center; padding: 7px 0; }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; }
.hbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.hbar-val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Productos ---------- */
.prod-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.cat-list li.sub { padding-left: 28px; font-size: 13.5px; }
.cat-list { list-style: none; margin: 0; padding: 6px; }
.cat-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-weight: 500; }
.cat-list li:hover { background: var(--surface-2); }
.cat-list li.active { background: var(--primary-soft); color: var(--primary); }
.cat-list .count { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.cat-list .edit { opacity: 0; }
.cat-list li:hover .edit { opacity: 1; }
.mg-pct { display: inline-block; min-width: 64px; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12.5px; text-align: right; }
.mg-pct.good { background: var(--good-soft); color: var(--good); }
.mg-pct.warn { background: var(--warn-soft); color: var(--warn); }
.mg-pct.bad { background: var(--bad-soft); color: var(--bad); }
.thumb { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; background: var(--surface-2); flex: none; }
@media (max-width: 900px) { .prod-layout { grid-template-columns: minmax(0, 1fr); } }

.qr-box { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; border: 1px solid var(--line); }
.qr-box img, .qr-box canvas { display: block; }

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .view { padding: 0; }
}

/* ---------- Utilidades nuevas ---------- */
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
.center { text-align: center; }
.btn.disabled { pointer-events: none; opacity: .5; }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.hero-sub { color: #cfc8e6; margin: -12px 0 0; font-size: 16px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 6px 0 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.g-btn { display: flex; justify-content: center; min-height: 44px; }
.entry-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.entry-links a { color: var(--ink-2); font-weight: 600; font-size: 14px; }
.link-list { display: flex; flex-direction: column; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.link-row:last-child { border-bottom: 0; }
.link-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.printer-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.printer-box h4 { font-size: 14.5px; }
.printer-box .btn { align-self: flex-start; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.steps li { padding-left: 4px; }
.steps-check { list-style: none; padding-left: 0; counter-reset: st; }
.steps-check li { position: relative; padding-left: 38px; counter-increment: st; min-height: 26px; }
.steps-check li::before { content: counter(st); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--surface-2); border: 2px solid var(--line); color: var(--muted); }
.steps-check li.ok::before { content: '✓'; background: var(--primary); border-color: var(--primary); color: #fff; }
.ind { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 1px 9px 1px 7px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; vertical-align: 1px; }
.ind::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.ind.on { color: var(--ink-2); } .ind.on::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.ind.off::before { background: var(--bad); }
.ext-live { width: 100%; height: 200px; border: 0; display: block; color-scheme: normal; }
.loyalty-box { border: 1px dashed var(--primary); background: var(--primary-soft); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.loyalty-title { font-weight: 700; color: var(--primary); }
.loyalty-box .muted { color: var(--ink-2); }
.ready-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; border-left: 4px solid var(--good); }
.ready-card .kds-items li:first-child { border-top: 0; }

/* ---------- App de mozos (celular) ---------- */
.mozo { background: var(--bg); }
.mozo-shell { min-height: 100vh; display: flex; flex-direction: column; }
.mozo-top { height: 60px; padding: 0 14px; padding-top: env(safe-area-inset-top); }
.mozo-title { min-width: 0; display: flex; flex-direction: column; }
.mozo-title small { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mozo-title h1 { font-size: 18px; }
.mozo .view { padding: 14px 14px calc(84px + env(safe-area-inset-bottom)); }
.mozo .view.has-mobile-bar { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(28, 20, 18, .06);
}
.bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 12px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.bottom-nav a svg { width: 24px; height: 24px; }
.bottom-nav a.active { color: var(--primary); background: var(--primary-soft); }
.nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-style: normal; display: grid; place-items: center; }
.mozo .pos-mobile-bar { display: flex; bottom: calc(76px + env(safe-area-inset-bottom)); }
.mozo .pos { grid-template-columns: 1fr; }
.mozo .ticket { position: static; max-height: none; }
.mozo .prod-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.mozo .clock { display: none; }
.mozo .legend { display: none; }
.mozo .salon-top { gap: 8px; }
@media (min-width: 900px) {
  .mozo .view { max-width: 980px; margin: 0 auto; width: 100%; }
  .bottom-nav { max-width: 520px; margin: 0 auto 12px; border-radius: 18px; border: 1px solid var(--line); }
}

/* ---------- Club de puntos (clientes) ---------- */
.club-page { --club: #e5484d; background: var(--bg); min-height: 100vh; }
.club-hero {
  background: radial-gradient(600px 300px at 10% 0%, rgba(255,255,255,.22), transparent 60%), var(--club);
  color: #fff; padding: 40px 16px 84px; text-align: center;
}
.club-hero-inner { max-width: 560px; margin: 0 auto; }
.club-bar { display: inline-block; color: rgba(255,255,255,.9); font-weight: 700; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; background: rgba(0,0,0,.15); padding: 6px 12px; border-radius: 999px; }
.club-hero h1 { font-size: clamp(30px, 8vw, 44px); font-weight: 800; letter-spacing: -.03em; margin: 14px 0 6px; }
.club-hero p { margin: 0; opacity: .9; font-size: 16px; }
.club-main { max-width: 520px; margin: -56px auto 0; padding: 0 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.club-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.club-card h2 { font-size: 22px; }
.club-card h3 { font-size: 16px; }
.club-card.center { align-items: center; text-align: center; }
.club-card.center p { margin: 0; }
.club-emoji { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--club) 12%, var(--surface)); color: var(--club); }
.club-emoji .club-ico { width: 34px; height: 34px; vertical-align: 0; }
.club-hero h1, .club-card h2 { text-wrap: balance; }
.points-big span, .club-history b { font-variant-numeric: tabular-nums; }
.club-alert { box-shadow: var(--shadow); }
.club-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.club-steps div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.club-steps b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--club); color: #fff; font-size: 15px; }
.club-rate { margin: 0; text-align: center; color: var(--muted); font-size: 13.5px; }
.club-tabs { display: grid; grid-template-columns: 1fr 1fr; }
.club-phone { font-size: 22px; font-weight: 700; letter-spacing: .03em; height: 56px; }
.club-pin { font-size: 26px; font-weight: 800; letter-spacing: .5em; text-align: center; height: 56px; }
.club-phone-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.club-change summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.club-change[open] summary { margin-bottom: 10px; }
.btn-club { background: var(--club); border-color: var(--club); color: #fff; }
.btn-club:hover { filter: brightness(1.08); }
.points-card { background: linear-gradient(160deg, var(--surface) 0%, var(--surface) 55%, var(--surface-2) 100%); }
.hello { font-weight: 700; font-size: 17px; }
.points-big { font-size: 18px; font-weight: 700; color: var(--muted); }
.points-big span { font-size: 64px; line-height: 1; font-weight: 800; letter-spacing: -.04em; color: var(--club); margin-right: 6px; font-variant-numeric: tabular-nums; }
.points-value { color: var(--ink-2); margin-top: -6px; }
.redeem { display: grid; grid-template-columns: 1fr auto; gap: 12px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 14px; padding: 14px; }
.redeem > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.redeem small { color: var(--muted); font-size: 12px; }
.redeem .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 26px; letter-spacing: .14em; color: var(--ink); }
.club-history { list-style: none; margin: 0; padding: 0; }
.club-history li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.club-history li:first-child { border-top: 0; }
.club-history small { display: block; color: var(--muted); font-size: 12px; }
.club-history .plus { color: var(--good); }
.club-history .minus { color: var(--bad); }
.club-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 16px 28px; }
.club-foot a { color: inherit; }
@media (max-width: 420px) {
  .redeem { grid-template-columns: 1fr; }
  .points-big span { font-size: 54px; }
}

/* ---------- Ajustes responsive ---------- */
@media (max-width: 760px) {
  .topbar h1 { font-size: 17px; }
  .topbar-actions .btn-sm { padding: 0 10px; }
  /* Botones de la pantalla en su propia fila, deslizable, para que nunca ensanchen la página */
  .topbar { flex-wrap: wrap; height: auto; min-height: 56px; row-gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .topbar-actions { order: 3; flex: 1 0 100%; margin-left: 0; flex-wrap: wrap; gap: 6px; }
  .topbar-actions:empty { display: none; }
  .topbar-actions > * { flex: 1 1 auto; }
  .card-head { flex-wrap: wrap; }
  .card-head input[type=search] { max-width: none !important; }
  .row > input[type=date] { flex: 1 1 140px; min-width: 140px; }
  .stat-value { font-size: 23px; }
  .pay-summary strong { font-size: 15px; }
  .pay-methods { grid-template-columns: repeat(2, 1fr); }
  .tbl th, .tbl td { padding: 10px; }
  .land-nav { padding: 14px 16px; }
  .land-nav .btn { padding: 0 12px; }
  .land-hero { padding: 40px 16px 32px; }
  .land-hero p { font-size: 16px; }
  .auth-card h1 { font-size: 24px; }
}
.slug-input { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.slug-input span { display: flex; align-items: center; padding: 0 4px 0 12px; color: var(--muted); font-size: 13px; background: var(--surface-2); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.slug-input input { border: 0; border-radius: 0; min-width: 0; }
.slug-input input:focus { box-shadow: none; }
.slug-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
@media (max-width: 860px) {
  .auth-main { place-items: start center; padding-top: 28px; }
  .hero-sub { margin: -6px 0 0; font-size: 14px; }
  .auth-hero .brand-lg { font-size: 20px; }
  .auth-hero .brand-lg img { width: 32px; height: 32px; }
}
@media (max-width: 760px) {
  /* Pestañas en una sola fila que se desliza con el dedo */
  .tabs.tabs-wrap { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .tabs.tabs-wrap::-webkit-scrollbar { display: none; }
  .tabs.tabs-wrap button { flex: none; }
}
.mozo .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); left: 12px; right: 12px; max-width: none; }

/* ---------- Ventas: Salón / Mostrador / Delivery ---------- */
.sales-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.mode-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 640px; }
.mode-tabs button { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-weight: 700; font-size: 15px; color: var(--ink-2); cursor: pointer; transition: background .15s; }
.mode-tabs button span { font-size: 12.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.mode-tabs button.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.mode-tabs button.active span { background: rgba(255,255,255,.18); color: inherit; }
.mode-tabs button i { position: absolute; top: -7px; right: -5px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--bad); color: #fff; font-style: normal; font-size: 12px; display: grid; place-items: center; animation: pulse 1.6s infinite; }
.sales-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.sales-kpis > div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; min-width: 0; }
.sales-kpis small { color: var(--muted); font-size: 12px; font-weight: 600; }
.sales-kpis strong { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sales-kpis em { font-style: normal; color: var(--muted); font-size: 12px; }
.sales-kpis .warn { border-color: var(--warn); background: var(--warn-soft); }
.oa-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; font-weight: 600; }
.order-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.order-card { padding: 14px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: box-shadow .15s, transform .1s; }
.order-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.order-card.is-new { border: 2px solid var(--warn); }
.oc-title { font-size: 16px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-line { font-size: 13.5px; color: var(--ink-2); }
.oc-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.oc-actions .btn:not(.btn-sm) { flex: 1; }
.online-banner { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; padding: 12px 18px; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line); }
@media (max-width: 1100px) { .sales-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .sales-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-kpis > div:last-child { grid-column: span 2; }
  .mode-tabs button { font-size: 13.5px; gap: 5px; height: 44px; }
  .mode-tabs button span { padding: 1px 6px; }
}
.mozo .sales-kpis { display: none; }

/* ---------- Productos: íconos y recetas ---------- */
.cat-ic { font-size: 16px; width: 18px; text-align: center; }
.icon-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-picker button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 19px; cursor: pointer; }
.icon-picker button.active, .icon-picker button:hover { border-color: var(--primary); background: var(--primary-soft); }
.recipe-box { border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.rec-line, .exp-line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(70px, 1fr) 34px 80px 32px; gap: 8px; align-items: center; }
.rec-line { grid-template-columns: minmax(0, 2fr) minmax(70px, 1fr) 34px 96px 90px 32px; }
.rec-waste { display: flex; flex-direction: row; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.rec-waste input { width: 52px; padding-inline: 6px; }
.rec-cost small { display: block; font-weight: 500; font-size: 11px; }
.exp-line { grid-template-columns: minmax(0, 2fr) minmax(70px, 1fr) minmax(80px, 1fr) 90px 32px; margin-bottom: 8px; }
.rec-cost, .exp-sub { text-align: right; font-weight: 600; font-size: 13px; }
.margin-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-top: 6px; }
.margin-strip > div { background: var(--surface); border-radius: 10px; padding: 8px 10px; }
.margin-strip small { display: block; color: var(--muted); font-size: 11.5px; }
.margin-strip strong { font-variant-numeric: tabular-nums; }
.margin-strip.good strong { color: var(--good); }
.margin-strip.warn strong { color: var(--warn); }
.margin-strip.bad strong { color: var(--bad); }
.margin-strip > .muted { grid-column: 1 / -1; background: none; padding: 0; }
.exp-items { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; }
.exp-items summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.exp-items[open] summary { margin-bottom: 4px; }
@media (max-width: 600px) {
  .rec-line { grid-template-columns: minmax(0, 1fr) 76px 84px 32px; }
  .rec-line > .muted, .rec-line .rec-cost { display: none; }
  .rec-waste span { display: none; }
  .rec-waste::after { content: '%'; }
  .exp-line { grid-template-columns: 1fr 1fr 32px; }
  .exp-line select { grid-column: 1 / -1; }
  .exp-line .exp-sub { display: none; }
  .margin-strip { grid-template-columns: 1fr 1fr; }
}

/* ---------- Ajustes: tienda ---------- */
.brand-uploads { display: flex; gap: 12px; align-items: flex-start; }
.brand-uploads .lbl { display: block; font-weight: 500; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
.up-box { border: 2px dashed var(--line); border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; overflow: hidden; color: var(--muted); font-weight: 600; font-size: 13px; text-align: center; transition: border-color .15s; }
.up-box:hover { border-color: var(--primary); color: var(--primary); }
.up-box.logo { width: 96px; height: 96px; }
.up-box.cover { height: 96px; width: 100%; }
.up-box img { width: 100%; height: 100%; object-fit: cover; }
.checks-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0; }
.checks-box legend { padding: 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.mode-tabs button { white-space: nowrap; }
@media (max-width: 640px) {
  .mode-tabs { gap: 6px; }
  .mode-tabs button { font-size: 13px; padding: 0 4px; }
  .sales-kpis { display: flex; overflow-x: auto; gap: 8px; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .sales-kpis::-webkit-scrollbar { display: none; }
  .sales-kpis > div { flex: none; min-width: 132px; padding: 8px 12px; }
  .sales-kpis > div:last-child { grid-column: auto; }
  .sales-kpis strong { font-size: 16px; }
}
@media (max-width: 400px) { .mode-tabs button span { display: none; } }
@media (max-width: 640px) { .row > .tabs { flex: 1 1 100%; } }

/* ---------- Lista de pedidos (mostrador / delivery) ---------- */
.order-list { overflow: hidden; }
.ol-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 210px 110px auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.ol-row:last-child { border-bottom: 0; }
.ol-row:hover { background: var(--surface-2); }
.ol-row.is-new { background: var(--warn-soft); box-shadow: inset 4px 0 0 var(--warn); }
.ol-num { font-weight: 800; font-size: 17px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ol-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ol-title { display: flex; gap: 8px; align-items: center; min-width: 0; }
.ol-title strong { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-state { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.ol-total { font-weight: 800; font-size: 16px; text-align: right; }
.ol-actions { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 860px) {
  .ol-row { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "num main total" "num state state" "num actions actions"; row-gap: 8px; }
  .ol-num { grid-area: num; align-self: start; font-size: 15px; }
  .ol-main { grid-area: main; }
  .ol-total { grid-area: total; align-self: start; }
  .ol-state { grid-area: state; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .ol-actions { grid-area: actions; justify-content: flex-start; }
}

/* ---------- Arqueos ---------- */
.count-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; }
.count-h { font-size: 14.5px; margin: 0 0 8px; }
.bills { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.bill { display: grid; grid-template-columns: 82px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; font-weight: 500; }
.bill-face { grid-row: span 2; display: grid; place-items: center; height: 40px; border-radius: 8px; background: var(--good-soft); color: var(--good); font-weight: 800; font-size: 13px; border: 1px dashed var(--good); }
.bill-face.coins { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); font-size: 11px; text-align: center; line-height: 1.1; }
.bill input { min-height: 36px; padding: 6px 10px; }
.bill-sub { font-size: 11.5px; color: var(--muted); min-height: 14px; }
.count-total { display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; margin-top: 10px; }
.count-total strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.tbl tfoot th { background: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 800; text-transform: none; letter-spacing: 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pm-title { margin: 0 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pm-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pm-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface); min-height: 56px; }
.pm-row:first-child { border-top: 0; }
.pm-row.is-off { background: var(--surface-2); }
.pm-row.is-off .pm-name strong { color: var(--muted); font-weight: 600; }
.pm-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pm-name small { font-size: 12px; }
.pm-order { display: flex; gap: 2px; }
.pm-order .btn { width: 34px; padding: 0; justify-content: center; }
/* Interruptor (sí / no) */
.sw { position: relative; display: inline-flex; flex: none; width: 46px; height: 28px; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: inherit; }
.sw span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s ease-out; }
.sw span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease-out; }
.sw input:checked + span { background: var(--good); }
.sw input:checked + span::after { transform: translateX(18px); }
.sw input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.sw input:disabled + span { opacity: .55; }
.sw:has(input:disabled) { cursor: not-allowed; }
.count-grid { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.count-grid > div { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr); gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.count-grid.with-sys > div { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); }
.count-grid > div:first-child { border-top: 0; }
.count-grid .cg-head { background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 8px 14px; }
.count-grid .cg-name { font-weight: 600; display: flex; flex-direction: column; }
.count-grid .cg-name small { font-weight: 400; font-size: 12px; }
.count-grid .r { text-align: right; }
.count-grid input { height: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.count-grid .cg-in { display: flex; gap: 6px; align-items: center; }
.count-grid .cg-in input { min-width: 0; flex: 1; }
.count-grid .cg-in .btn { flex: none; white-space: nowrap; }
.count-grid .cg-total { background: var(--surface-2); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .count-grid.with-sys .cg-head { display: none; }
  .count-grid.with-sys > div { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name name" "in in" "sys diff"; gap: 6px 10px; }
  .count-grid.with-sys .cg-row > :nth-child(1), .count-grid.with-sys .cg-total > :nth-child(1) { grid-area: name; }
  .count-grid.with-sys .cg-row > :nth-child(2), .count-grid.with-sys .cg-total > :nth-child(2) { grid-area: sys; text-align: left; font-size: 13px; color: var(--muted); }
  .count-grid.with-sys .cg-row > :nth-child(2)::before, .count-grid.with-sys .cg-total > :nth-child(2)::before { content: 'Sistema: '; }
  .count-grid.with-sys .cg-row > :nth-child(3), .count-grid.with-sys .cg-total > :nth-child(3) { grid-area: in; }
  .count-grid.with-sys .cg-row > :nth-child(4), .count-grid.with-sys .cg-total > :nth-child(4) { grid-area: diff; }
  .count-grid.with-sys .cg-total > :nth-child(3) { text-align: left; }
  .count-grid.with-sys .cg-total > :nth-child(3)::before { content: 'Contado: '; font-weight: 600; }
}
.count-cmp { margin-top: 8px; font-size: 13.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.other-m { margin-bottom: 10px; }
.count-result { padding: 14px 16px; border-radius: 12px; font-weight: 800; font-size: 17px; text-align: center; }
.count-result.ok { background: var(--good-soft); color: var(--good); }
.count-result.warn { background: var(--warn-soft); color: var(--warn); }
.count-result.bad { background: var(--bad-soft); color: var(--bad); }
.bill-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bill-chips span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .count-grid { grid-template-columns: 1fr; } }
@media (max-width: 340px) { .bills { grid-template-columns: 1fr; } }
.grid > * { min-width: 0; }

/* ---------- Vista dividida: mesas a la izquierda, pedido a la derecha ---------- */
.sales-split { display: grid; grid-template-columns: minmax(0, 1fr) clamp(380px, 34vw, 480px); gap: 18px; align-items: start; }
.split-left { min-width: 0; }
.order-panel { position: sticky; top: 82px; height: calc(100vh - 100px); overflow: hidden; display: flex; flex-direction: column; padding: 0; }
.panel-box { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.panel-head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 12px 18px; background: var(--primary); color: #fff; flex: none; }
.panel-head.delivery { background: #e0457b; }
.panel-head.mostrador { background: #2bb3a3; }
.panel-head strong { flex: 1; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-head .btn-ghost, .panel-head .icon-btn { color: #fff; }
.panel-head .btn-ghost:hover, .panel-head .icon-btn:hover { background: rgba(255,255,255,.15); }
.panel-empty { margin: auto; padding: 32px 24px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.btn-xl { min-height: 60px; padding: 14px 34px; font-size: 18px; border-radius: 14px; box-shadow: 0 8px 22px -8px var(--primary); }
.panel-empty-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: var(--primary-soft); margin-bottom: 6px; }
.pos.embedded { display: flex; flex-direction: column; gap: 0; flex: 1; min-height: 0; overflow-y: auto; }
.pos.embedded .pos-catalog { padding: 12px 14px; gap: 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.pos.embedded .cat-chips { flex-wrap: nowrap; }
.pos.embedded .chip { padding: 5px 11px; font-size: 13px; }
.pos.embedded .prod-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; max-height: 210px; overflow-y: auto; padding: 2px; }
.pos.embedded .prod { min-height: 62px; padding: 9px 10px 8px 13px; border-radius: 10px; gap: 4px; }
.pos.embedded .prod-name { font-size: 13px; }
.pos.embedded .prod-price { font-size: 13px; }
.pos.embedded .ticket { position: static; max-height: none; border: 0; border-radius: 0; box-shadow: none; flex: 1; }
.pos.embedded .ticket-head h3 { font-size: 15px; }
.pos.embedded .ticket-body { overflow: visible; }
.pos.embedded ~ .pos-mobile-bar { display: none !important; }
.tbl-node.selected { outline: 3px solid var(--accent); outline-offset: 3px; }
.ol-row.selected { background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
.sales-split .ol-row { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "num main total" "num state actions"; row-gap: 6px; }
.sales-split .ol-num { grid-area: num; align-self: start; }
.sales-split .ol-main { grid-area: main; }
.sales-split .ol-total { grid-area: total; }
.sales-split .ol-state { grid-area: state; flex-direction: row; flex-wrap: wrap; align-items: center; }
.sales-split .ol-actions { grid-area: actions; }
.sales-split .floor { min-height: 360px; }
.sales-split .tbl-node .t-name { font-size: 16px; }

/* ---------- Caja (resumen + listado de arqueos) ---------- */
.cash-strip { display: grid; grid-template-columns: minmax(200px, 1.4fr) repeat(auto-fit, minmax(130px, 1fr)); padding: 0; overflow: hidden; }
.cs-cell { padding: 14px 18px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--line); min-width: 0; }
.cs-cell:last-child { border-right: 0; }
.cs-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.cs-cell strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.cs-cell small { color: var(--muted); font-size: 12.5px; }
.cs-open { color: var(--good); }
.cash-table td, .cash-table th { padding: 10px 16px; }
.tbl .c { text-align: center; }
.diff-neg { display: inline-block; color: var(--bad); border: 1.5px solid var(--bad); border-radius: 4px; padding: 2px 8px; font-weight: 700; }
.diff-pos { color: var(--good); font-weight: 700; }
.stat-value.diff-pos-t { color: var(--good); }
.stat-value.diff-neg-t { color: var(--bad); }
@media (max-width: 1100px) { .recon-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .recon-kpis { grid-template-columns: 1fr; } }
/* Subpestañas de una sección (Ventas: ventas · arqueos de caja · conciliación) */
.subnav { display: flex; gap: 4px; padding: 5px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(28, 20, 18, .04); }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 10px 18px; color: var(--ink-2); font-size: 15px; font-weight: 600; white-space: nowrap; border-radius: 10px; transition: background-color .15s ease, color .15s ease; }
.subnav a.active { background: var(--primary-soft); color: var(--primary); }
@media (hover: hover) and (pointer: fine) { .subnav a:not(.active):hover { color: var(--ink); background: var(--surface-2); } }
@media (max-width: 600px) { .subnav { width: 100%; } .subnav a { padding: 9px 14px; font-size: 14px; } }
.big-amount input { font-size: 26px; font-weight: 800; height: 58px; }
.bill-calc { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.bill-calc summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.bill-calc[open] summary { margin-bottom: 10px; }
@media (max-width: 760px) {
  .cash-strip { grid-template-columns: 1fr 1fr; }
  .cs-cell.main { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .cs-cell { border-bottom: 1px solid var(--line); }
  .cs-cell strong { font-size: 17px; }
}

/* ---------- Permisos de usuario ---------- */
.perm-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.perm-title { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.perm-title small { font-size: 11px; letter-spacing: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.perm-list { display: flex; flex-direction: column; gap: 14px; }
.perm-head { gap: 10px; }
.perm-item.perm-ro { display: flex; cursor: default; align-items: center; padding: 6px 8px; border-color: transparent; background: transparent; }
.perm-item.perm-ro.is-off { color: var(--muted); }
.perm-list:has(.perm-ro) .perm-grid { gap: 0 12px; }
.perm-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; line-height: 1; }
.perm-ro.is-on .perm-mark { background: var(--good-soft); color: var(--good); }
.perm-ro.is-off .perm-mark { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 6px; }
.perm-item { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; font-weight: 500; }
.perm-item input { margin-top: 1px; flex: none; }
.perm-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--ink); }

/* ---------- Ajustes: menú lateral agrupado ---------- */
.cfg-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.cfg-nav { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 14px; padding: 12px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cfg-group { display: flex; flex-direction: column; gap: 2px; }
.cfg-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0 10px 4px; }
.cfg-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.cfg-nav a .ico { width: 18px; height: 18px; flex: none; opacity: .75; }
.cfg-nav a.active { background: var(--primary-soft); color: var(--primary); }
.cfg-nav a.active .ico { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .cfg-nav a:not(.active):hover { background: var(--surface-2); color: var(--ink); } }
.cfg-body { min-width: 0; }

.roles-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.roles-list { display: flex; flex-direction: column; padding: 6px; gap: 2px; }
.roles-list button { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; transition: background-color .15s ease; }
.roles-list button span { display: flex; flex-direction: column; gap: 1px; }
.roles-list button .ico { width: 16px; height: 16px; color: var(--muted); }
.roles-list button.active { background: var(--primary-soft); }
.roles-list button.active strong { color: var(--primary); }
@media (hover: hover) and (pointer: fine) { .roles-list button:not(.active):hover { background: var(--surface-2); } }
.roles-head { align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.roles-head > div:first-child { flex: 1 1 220px; min-width: 0; }
.roles-head .spacer { display: none; }
@media (max-width: 960px) {
  .cfg-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cfg-nav { position: static; flex-direction: row; gap: 4px; padding: 6px; overflow-x: auto; scrollbar-width: none; }
  .cfg-nav::-webkit-scrollbar { display: none; }
  .cfg-group { flex-direction: row; gap: 4px; }
  .cfg-group-title { display: none; }
  .cfg-group + .cfg-group { border-left: 1px solid var(--line); padding-left: 4px; }
  .cfg-nav a { white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  .roles-layout { grid-template-columns: minmax(0, 1fr); }
  .roles-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .roles-list button { flex: none; }
}

/* ---------- Productos: grupos modificadores, listas de precios, stock ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.mg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 16px; align-items: start; }
.mg-layout tr.selected td { background: var(--primary-soft); }
.mg-panel { position: sticky; top: 12px; overflow: hidden; }
.mg-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; padding: 14px; font-size: 14px; }
.mg-dl dt { color: var(--muted); }
.mg-dl dd { margin: 0; font-weight: 600; }
.mg-sub { padding: 9px 14px; background: var(--surface-2); border-block: 1px solid var(--line); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mg-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.mg-list li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.mg-list li span { flex: 1; min-width: 0; font-weight: 600; }
.mg-list li.muted { font-weight: 400; }
.mg-search { position: relative; }
.mg-search input { width: 100%; }
.mg-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; padding: 4px; }
.mg-results button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.mg-results button:hover { background: var(--surface-2); }
.mg-results [data-addall] { color: var(--primary); font-weight: 700; }
.mg-items { display: flex; flex-direction: column; gap: 6px; }
.mg-item { display: grid; grid-template-columns: minmax(0, 1fr) 110px 70px auto; gap: 8px; align-items: center; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.mg-item-name { display: flex; flex-direction: column; min-width: 0; }
.mg-item-name input { width: 100%; }
.mg-mini { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 600; }
.mg-mini input { width: 100%; padding-inline: 8px; }
.mg-move { display: flex; gap: 2px; }
.mg-assoc { max-height: 260px; overflow-y: auto; }
.mg-assoc label[hidden] { display: none; }
.pl-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pl-head { flex-wrap: wrap; gap: 10px; }
.pl-head .tabs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
.pl-in { width: 120px; text-align: right; }
.pl-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.cat-sub { padding-left: 28px !important; }
@media (max-width: 960px) {
  .mg-layout { grid-template-columns: minmax(0, 1fr); }
  .mg-panel { position: static; }
}
@media (max-width: 600px) {
  .mg-item { grid-template-columns: minmax(0, 1fr) 84px auto; }
  .mg-item .mg-mini:nth-of-type(2) { display: none; }
  .pl-in { width: 92px; }
}

/* ---------- Elegir opciones de un producto (grupos modificadores) ---------- */
.mod-pick { display: flex; flex-direction: column; gap: 18px; }
.mod-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mod-group-head strong { font-size: 15px; }
.mod-rule { font-size: 13px; color: var(--muted); white-space: nowrap; }
.mod-rule b { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-variant-numeric: tabular-nums; }
.mod-rule b.ok { background: var(--good-soft); color: var(--good); }
.mod-search { width: 100%; margin-bottom: 8px; }
.mod-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 6px; }
.mod-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; user-select: none; transition: background-color .15s ease, border-color .15s ease; }
.mod-item.on { border-color: var(--primary); background: var(--primary-soft); }
.mod-item.out { opacity: .45; cursor: default; }
.mod-item[hidden] { display: none; }
.mod-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.mod-name small { color: var(--bad); font-weight: 600; }
.mod-price { color: var(--muted); font-size: 13px; }
.mod-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; }
.mod-item.on .mod-check { background: var(--primary); border-color: var(--primary); }
@media (hover: hover) and (pointer: fine) { .mod-item:not(.out):not(.on):hover { background: var(--surface-2); } }
.mod-total { display: flex; flex-direction: column; min-width: 0; }
.mod-total small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.kds-detail { display: block; font-weight: 700; color: var(--primary); font-size: .92em; }
.line-detail { color: var(--primary) !important; font-weight: 600 !important; }

/* ---------- Ajustes → Salones y mesas: editor del plano en grilla ---------- */
.fe { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.fe-main { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fe-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fe-tabs { flex: 1 1 auto; min-width: 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.fe-tabs::-webkit-scrollbar { display: none; }
.fe-tabs button { flex: none; }
.fe-floor { position: relative; width: 100%; aspect-ratio: 16 / 9; container-type: size; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.fe-canvas {
  background-color: var(--surface);
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px), linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: calc(100% / var(--cols)) calc(100% / var(--rows));
  box-shadow: inset -1px -1px 0 var(--line);
}
.fe-canvas .tbl-node { cursor: grab; transition: box-shadow .15s ease, left .12s ease, top .12s ease; }
.fe-canvas .tbl-node.dragging { cursor: grabbing; box-shadow: var(--shadow-lg); z-index: 5; transition: box-shadow .15s ease; }
.fe-canvas .tbl-node.fe-bad { border-color: var(--bad); background: var(--bad-soft); }
.fe-canvas .tbl-node.fe-sel { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.fe-canvas.fe-dragging { cursor: grabbing; }
.fe-add {
  position: absolute; left: calc(var(--c) * 100% / var(--cols) + var(--cell) * .08); top: calc(var(--r) * 100% / var(--rows) + var(--cell) * .08);
  width: calc(100% / var(--cols) - var(--cell) * .16); height: calc(100% / var(--rows) - var(--cell) * .16);
  display: grid; place-items: center; border: 1.5px dashed var(--muted); border-radius: calc(var(--cell) * .16); background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--muted); font: inherit; font-size: clamp(14px, calc(var(--cell) * .3), 26px); cursor: pointer; padding: 0;
}
@media (hover: hover) and (pointer: fine) { .fe-add:hover { border-color: var(--primary); color: var(--primary); } }
.fe-hint { margin: 0; }
.fe-panel { position: sticky; top: 12px; overflow: hidden; }
.fe-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; background: var(--primary); color: var(--primary-ink); font-weight: 700; }
.fe-panel-head span { display: inline-flex; align-items: center; gap: 8px; }
.fe-panel-head .icon-btn { color: inherit; width: 30px; height: 30px; }
.fe-panel-body { padding: 14px; gap: 14px; }
.fe-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.fe-seg, .fe-zoom { flex-wrap: wrap; }
.fe-zoom { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fe-zoom label { justify-content: center; padding: 7px 0; gap: 5px; }
.fe-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fe-stats div { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.fe-stats strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.fe-stats small { color: var(--muted); }
.fe-danger { color: var(--bad); }
@media (max-width: 960px) {
  .fe { grid-template-columns: minmax(0, 1fr); }
  .fe-panel { position: static; }
}

/* ---------- Barra inferior del panel en celular ---------- */
.mobile-tabs { display: none; }
@media (max-width: 960px) {
  .app-page:not(.mozo) .mobile-tabs {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 20px rgba(28, 20, 18, .06);
  }
  .mobile-tabs a, .mobile-tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 12px; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; background: none; border: 0; cursor: pointer; }
  .mobile-tabs svg { width: 23px; height: 23px; }
  .mobile-tabs a.active { color: var(--primary); background: var(--primary-soft); }
  .app-page:not(.mozo) .view { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .app-page:not(.mozo) .view.has-mobile-bar { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
  .app-page:not(.mozo) .pos-mobile-bar { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .app-page:not(.mozo) .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 56px; height: auto; }
}
.pos.embedded { align-items: stretch; }
@media (max-width: 640px) {
  /* Listado de cajas como tarjetas */
  .cash-table thead { display: none; }
  .cash-table, .cash-table tbody { display: block; }
  .cash-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .cash-table td { display: flex; justify-content: space-between; align-items: center; padding: 0; border: 0; white-space: normal; grid-column: 1 / -1; text-align: right; }
  .cash-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; }
  .cash-table td.ct-date { grid-column: 1; display: block; text-align: left; }
  .cash-table td.ct-status { grid-column: 2; grid-row: 1; align-self: start; }
  /* Productos más compactos para tomar pedidos rápido */
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
  .prod { min-height: 74px; padding: 10px 10px 9px 13px; border-radius: 12px; gap: 4px; }
  .prod-name { font-size: 13.5px; }
  .prod-price { font-size: 13.5px; }
  .topbar h1 { font-size: 16.5px; }
}

/* ---------- Toma de pedido simple: buscador + accesos rápidos ---------- */
.prod::before { display: none; }
.prod { border-color: var(--line); background: var(--surface); }
.prod:hover { border-color: var(--primary); }
.panel-head, .panel-head.delivery, .panel-head.mostrador { background: var(--ink); color: var(--bg); }
.panel-head .btn-ghost, .panel-head .icon-btn { color: var(--bg); }
.pos.embedded .ticket-head h3 { display: none; }
.add-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; gap: 10px; }
.pos.embedded .add-box { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.add-title { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); }
.add-title .btn { text-transform: none; letter-spacing: 0; }
.search-wrap { position: relative; }
.search-wrap input { height: 46px; font-size: 15px; padding-left: 38px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a748a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 18px; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; max-height: 340px; overflow-y: auto; }
.sr-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.sr-item:last-child { border-bottom: 0; }
.sr-item small { display: block; color: var(--muted); font-size: 12px; }
.sr-item.active, .sr-item:hover { background: var(--primary-soft); }
.sr-item:disabled { opacity: .45; }
.sr-empty { padding: 14px; color: var(--muted); text-align: center; }
.quick-list { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.quick-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.quick-btn:active { transform: scale(.97); }
.quick-btn:disabled { opacity: .45; }
.link-btn { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--primary); cursor: pointer; }
.all-grid { display: flex; flex-direction: column; gap: 10px; }
.pending-box { margin: 10px 14px; border: 1px solid var(--warn); background: var(--warn-soft); border-radius: 12px; overflow: hidden; }
.pline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 30px 30px; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px dashed color-mix(in srgb, var(--warn) 40%, transparent); }
.pline .line-name { font-weight: 600; }
.pline .line-name small { display: block; color: var(--ink-2); font-weight: 500; font-size: 12px; }
.icon-btn.sm { width: 30px; height: 30px; font-size: 14px; }
.pending-foot { display: flex; align-items: center; gap: 8px; padding: 10px; flex-wrap: wrap; font-size: 14px; }

/* ---------- Mostrador / Delivery: tabla simple ---------- */
.ot-section { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: 4px 2px 8px; }
.ot-section:not(:first-child) { margin-top: 20px; }
.order-table td { padding: 11px 14px; }
/* N° de pedido y la etiqueta "Online" en el mismo renglón: todas las filas con la misma altura */
.order-table td { vertical-align: middle; }
.ot-id { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ot-id .src-online { margin: 0; }
.order-table tr.is-new { background: var(--warn-soft); }
.order-table tr.selected { background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
.order-table tr.closed td { color: var(--ink-2); }
.st-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.st-tag.warn { border-color: var(--warn); color: var(--warn); }
.st-tag.good { border-color: transparent; color: var(--good); }
.st-tag.bad { border-color: transparent; color: var(--bad); }
@media (max-width: 640px) {
  .order-table th:nth-child(2), .order-table td:nth-child(2) { display: none; }
  .pline { gap: 6px; padding: 8px; }
}

/* ---------- Ventana "Ver todos los productos" ---------- */
.modal-xl { max-width: 960px; }
.modal-xl .modal-body:has(> .ap-wrap) { padding: 0; display: flex; flex-direction: column; min-height: 0; flex: 1; }
.all-btn { align-self: stretch; justify-content: center; }
.ap-wrap { display: flex; flex-direction: column; min-height: 0; height: min(70vh, 620px); }
.ap-search { padding: 0 20px 12px; }
.ap { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 0; flex: 1; border-top: 1px solid var(--line); }
.ap-cats { background: var(--ink); overflow-y: auto; }
.ap-cat { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 13px 16px; border: 0; border-bottom: 1px solid rgba(255,255,255,.08); background: none; color: var(--bg); opacity: .85; font: inherit; font-weight: 700; font-size: 13.5px; text-transform: uppercase; letter-spacing: .02em; text-align: left; cursor: pointer; }
.ap-cat:hover { opacity: 1; background: rgba(255,255,255,.06); }
.ap-cat.active { opacity: 1; background: var(--primary); color: #fff; }
.ap-cat b { min-width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; display: grid; place-items: center; }
.ap-list { overflow-y: auto; }
.ap-item { display: grid; grid-template-columns: minmax(0, 1fr) auto 120px; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ap-item:hover { background: var(--surface-2); }
.ap-item.on { background: var(--primary-soft); }
.ap-item.out { opacity: .5; cursor: default; }
.ap-item .btn, .ap-item .qty { justify-self: end; }
.ap-name { min-width: 0; }
.ap-name small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-name .ap-out { color: var(--bad); }
.ap-price { font-weight: 700; }
.ap-sum { color: var(--ink-2); }
@media (max-width: 700px) {
  .ap-wrap { height: 72vh; }
  .ap { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .ap-cats { display: flex; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .ap-cat { width: auto; flex: none; border-bottom: 0; border-right: 1px solid rgba(255,255,255,.08); padding: 11px 14px; }
  .ap-item { grid-template-columns: minmax(0, 1fr) auto; padding: 11px 14px; }
  .ap-item .ap-price { grid-row: 2; }
  .ap-item .btn, .ap-item .qty { grid-row: 1 / span 2; grid-column: 2; }
  .ap-search { padding: 0 14px 10px; }
}

/* Reloj grande en Ventas (se ve de lejos, también en el celular) */
body[data-route="salon"] .topbar .clock {
  display: block; font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: .5px; line-height: 1;
  padding: 6px 14px; border-radius: 12px; background: var(--surface-2, rgba(127,127,127,.08)); border: 1px solid var(--line);
}
@media (max-width: 960px) {
  body[data-route="salon"] .topbar .clock { font-size: 22px; padding: 5px 10px; margin-left: auto; }
  body[data-route="salon"] .topbar-actions { margin-left: 8px; }
}

/* Botón de ayuda (?) en la barra lateral */
.side-help { position: relative; color: #fff; background: rgba(255,255,255,.07); }
.side-help.active, .side-help:hover { background: rgba(255,255,255,.14); }
.help-q {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; font-style: normal;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 16px;
}
.side-help .nav-count { position: absolute; top: 2px; left: 26px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ff5a1f; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--side); }
.side-help .nav-count[hidden] { display: none; }

/* Ayuda: tutoriales */
.help-search { max-width: 520px; }
.help-list { display: grid; gap: 10px; }
.help-item { padding: 0; }
.help-item summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; font-size: 15px; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after { content: '▾'; margin-left: auto; color: var(--muted); transition: transform .15s; }
.help-item[open] summary::after { transform: rotate(180deg); }
.help-ico { font-size: 22px; width: 30px; text-align: center; }
.help-item ol { margin: 0; padding: 0 22px 6px 58px; display: grid; gap: 8px; line-height: 1.5; }
.help-go { padding: 6px 18px 16px 58px; }
.help-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }

/* Chat de soporte */
.chat-card { display: flex; flex-direction: column; max-width: 760px; height: min(70vh, 640px); overflow: hidden; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; flex-direction: column; gap: 2px; }
.chat-head small { font-weight: 400; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.chat-empty { margin: auto; text-align: center; max-width: 340px; }
.chat-day { align-self: center; font-size: 12px; color: var(--muted); padding: 2px 10px; border-radius: 99px; background: var(--surface); }
.chat-msg { max-width: 78%; padding: 8px 12px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.chat-msg > div { white-space: pre-line; }
.chat-msg small { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.chat-msg time { display: block; text-align: right; font-size: 11px; color: var(--muted); margin-top: 2px; }
.chat-msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-color: transparent; border-bottom-right-radius: 4px; }
.chat-msg.me small, .chat-msg.me time { color: rgba(255,255,255,.75); }
.chat-msg.them { align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.them.staff small { color: var(--primary); }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; }
@media (max-width: 960px) {
  .chat-card { height: calc(100vh - 230px); height: calc(100dvh - 230px); }
}

/* Plataforma: bandeja de soporte */
.pf-support { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.pf-inbox { padding: 0; overflow: hidden; }
.pf-inbox button { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; cursor: pointer; }
.pf-inbox button:hover, .pf-inbox button.active { background: var(--bg); }
.pf-inbox strong { display: flex; gap: 6px; align-items: center; }
.pf-inbox small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-inbox .badge { margin-left: auto; }
.pf-support .chat-card { max-width: none; }
@media (max-width: 860px) {
  .pf-support { grid-template-columns: minmax(0, 1fr); }
}
.pf-unread { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ff5a1f; color: #fff; font-size: 11px; margin-left: 4px; }

/* Aviso por WhatsApp al cliente de la tienda online */
.wa-strip { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; padding: 10px 18px; background: #e7f8ee; color: #128c4b; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.wa-strip.done { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.btn-wa { background: #25d366; border-color: #25d366; color: #fff; font-weight: 700; }
.btn-wa:hover { background: #1ebe5b; border-color: #1ebe5b; color: #fff; }
.wa-strip.done .btn-wa { background: none; color: #128c4b; border-color: #9fdcb9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-strip:not(.done) { background: #0f3322; color: #5ee69a; } }
:root[data-theme="dark"] .wa-strip:not(.done) { background: #0f3322; color: #5ee69a; }

/* Chat: adjuntos y número de mensajes nuevos */
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ff5a1f; color: #fff; font-size: 11px; font-weight: 800; margin-left: 4px; }
.tab-count[hidden], .menu-toggle .nav-count[hidden], .mobile-tabs .nav-count[hidden] { display: none; }
.menu-toggle { position: relative; }
.menu-toggle .nav-count { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: #ff5a1f; color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.chat-form { flex-direction: column; align-items: stretch; }
.chat-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-attach { flex: none; padding: 0 12px; height: 42px; font-size: 18px; cursor: pointer; }
.chat-pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--bg); font-size: 13px; }
.chat-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pick[hidden] { display: none; }
.chat-img img { display: block; max-width: min(260px, 100%); max-height: 260px; border-radius: 10px; margin: 2px 0 4px; object-fit: cover; }
.chat-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px 0 4px; border-radius: 10px; background: rgba(127,127,127,.12); color: inherit; text-decoration: none; }
.chat-file > span:first-child { font-size: 24px; }
.chat-file b { display: block; font-size: 13.5px; overflow-wrap: anywhere; }
.chat-file small { display: block; opacity: .75; font-size: 12px; margin: 0 !important; color: inherit !important; font-weight: 400 !important; }
.mobile-tabs button { position: relative; }
.mobile-tabs button .nav-count { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ff5a1f; color: #fff; font-size: 11px; font-weight: 800; font-style: normal; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }

/* Reportes: rango por día y hora */

/* Foto del chat a pantalla completa */
.photo-viewer { position: fixed; inset: 0; z-index: 300; background: rgba(8, 6, 16, .97); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 12px 16px; }
.photo-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.pv-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; color: #fff; }
.pv-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pv-bar .btn { background: rgba(255,255,255,.12); color: #fff; border-color: transparent; }

/* Aviso de novedades */
.news h4 { margin: 0 0 8px; font-size: 15px; }
.news ul { margin: 0 0 12px; padding-left: 4px; list-style: none; display: grid; gap: 10px; line-height: 1.45; }

/* Todo un poco más chico en la PC, para que entre más en la pantalla (el celular queda igual) */
@media (min-width: 961px) {
  :root { --z: .9; }
  .app-page .shell, .app-page .modal, .app-page .toasts, .platform-page > header, .platform-page > main, .platform-page .modal, .platform-page .toasts, .photo-viewer { zoom: var(--z); }
  /* Lo que mide la altura de la ventana se compensa: si no, quedaría un hueco abajo */
  .app-page .shell { min-height: calc(100vh / var(--z)); }
  .app-page .sidebar { height: calc(100vh / var(--z)); }
  .app-page .order-panel { height: calc(100vh / var(--z) - 100px); }
  .app-page .ticket { max-height: calc(100vh / var(--z) - 106px); }
  .app-page .modal, .platform-page .modal { max-height: calc(100vh / var(--z) - 32px); }
  .photo-viewer { inset: 0; width: calc(100vw / var(--z)); height: calc(100vh / var(--z)); }
}
.auth-legal { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 18px; }
.auth-legal a { color: var(--muted); }

/* Íconos dibujados dentro de textos y botones */
.ico { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }
.panel-empty-icon .ico, .empty-icon .ico { width: 32px; height: 32px; color: var(--primary); vertical-align: 0; }
.empty-icon .ico { width: 36px; height: 36px; }
.mode-tabs button .ico { margin-right: 2px; opacity: .85; }
.sound-mute .ico { width: 17px; height: 17px; vertical-align: -0.2em; }
.sound-mute.off { color: var(--muted); }
.oa-bar .oa-mute .ico { width: 16px; height: 16px; }
/* Campos de plata y cantidades sin las flechitas de subir y bajar */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.topbar-actions .sound-mute { flex: none !important; width: auto; }

/* Filtros de fecha: nunca más chicos que la fecha que muestran */
.tbl .show-sm { display: none; }
.date-f, .row > .date-f { width: auto; min-width: 140px; }
@media (max-width: 600px) {
  .row > .date-f { flex: 1 1 140px; }
  .tbl .show-sm { display: block; }
  /* En el celular las tablas muestran solo lo esencial */
  .tbl .hide-sm { display: none; }
}
/* Ventas: resumen, barra de filtros y tabla */
.sales-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px; }
.sales-toolbar select { width: auto; }
.sales-search { position: relative; flex: 1 1 240px; min-width: 0; }
.sales-search .ico { position: absolute; z-index: 1; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.sales-search input { padding-left: 36px; }
.sales-search input::-webkit-search-cancel-button { cursor: pointer; }
.sales-tbl td { vertical-align: middle; }
.sales-tbl .cell-main { display: block; font-weight: 600; }
.sales-tbl td.wrap small:not(.show-sm) { display: block; }
.sales-tbl .nowrap { white-space: nowrap; }
.type-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.type-chip .ico { color: var(--primary); }
.type-chip.t-delivery .ico { color: #c2410c; }
.type-chip.t-mostrador .ico { color: #0f766e; }
.sales-tbl td .show-sm .badge { margin-top: 4px; }
@media (max-width: 600px) {
  .ventas-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ventas-kpis .stat { padding: 14px; }
  .ventas-kpis .stat-value { font-size: 20px; }
  .sales-tbl td.wrap small.show-sm { display: block; }
  .sales-toolbar { padding: 8px; }
  .sales-toolbar .tabs { flex: 1 1 100%; }
  .sales-toolbar .tabs button { flex: 1; }
  .sales-toolbar select { flex: 1; }
  .sales-tbl td .show-sm { display: flex; justify-content: flex-end; }
}
/* Restaurante: la leyenda de colores va al pie del plano */
.floor-legend { display: flex; justify-content: center; margin-top: 10px; }
.floor-legend .legend { flex: none; justify-content: center; }
@media (max-width: 760px) { .floor-legend .legend { flex: 1; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; } }

/* ---------- Restaurante en la PC: todo entra en la pantalla, sin que la página se desplace ----------
   Las pestañas arriba, el plano (o la lista de Mostrador / Delivery) ocupa el resto y el pedido a la derecha. */
@media (min-width: 961px) {
  body.app-page[data-route="salon"] .shell { height: calc(100vh / var(--z)); min-height: 0; }
  body.app-page[data-route="salon"] .sidebar { height: 100%; }
  body.app-page[data-route="salon"] .main { min-height: 0; height: 100%; }
  body.app-page[data-route="salon"] .view { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 24px 18px; }
  body.app-page[data-route="salon"] .view-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.app-page[data-route="salon"] .sales-split { flex: 1; min-height: 0; align-items: stretch; }
  body.app-page[data-route="salon"] .order-panel { position: static; height: auto; min-height: 0; }
  body.app-page[data-route="salon"] .split-left { display: flex; flex-direction: column; min-height: 0; }
  /* (con el pedido a la derecha o sin él: el contenido es el bloque de la izquierda o la página entera) */
  body.app-page[data-route="salon"] :is(.split-left, .view-page) > [data-body] { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
  body.app-page[data-route="salon"] :is(.split-left, .view-page) > [data-body]:has(> .floor) { overflow: hidden; }
  body.app-page[data-route="salon"] [data-body] > .floor { flex: 1; min-height: 260px; aspect-ratio: auto; }
  body.app-page[data-route="salon"] [data-body] > .floor-legend { margin-top: 8px; flex: none; }
  body.app-page[data-route="salon"] [data-body] > .salon-top { flex: none; }
  body.app-page[data-route="salon"] .view-page > :is(.sales-head, .alert) { flex: none; }
}

/* ======================================================================
   En la PC la barra va arriba (horizontal): logo, secciones y, a la derecha,
   ayuda, usuario y el reloj. Plataforma, Vista mozo y Cerrar sesión están en el menú del usuario.
   ====================================================================== */
.nav-clock { display: none; }
.user-pop { position: fixed; z-index: 220; min-width: 250px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: tip-in .12s ease-out; }
.user-pop-head { padding: 10px 12px 8px; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-pop-head small { color: var(--muted); }
.user-pop a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 600; }
.user-pop a .ico { color: var(--muted); }
.user-pop a.danger { color: var(--bad); }
.user-pop a.danger .ico { color: var(--bad); }
@media (hover: hover) and (pointer: fine) { .user-pop a:hover { background: var(--surface-2); } }
@media (min-width: 961px) {
  body.app-page .shell { flex-direction: column; }
  body.app-page .sidebar { position: sticky; top: 0; z-index: 40; width: 100%; height: 62px; flex-direction: row; align-items: center; gap: 4px; padding: 0 18px; }
  body.app-page .sidebar .brand { margin: 0 14px 0 0; padding: 0; }
  body.app-page .sidebar .brand img { width: 38px; height: 38px; }
  body.app-page .nav { flex: 0 1 auto; flex-direction: row; align-items: center; gap: 4px; width: auto; padding: 0; overflow: visible; min-height: 0; }
  body.app-page .nav a { flex: none; width: 54px; height: 44px; min-height: 0; border-radius: 12px; }
  body.app-page .nav a svg { width: 24px; height: 24px; }
  body.app-page .nav a .nav-count { top: -2px; right: 2px; }
  body.app-page .side-platform { display: none; }
  body.app-page .sidebar-foot { flex-direction: row; align-items: center; gap: 10px; width: auto; margin-left: auto; padding: 0; border-top: 0; }
  body.app-page .sidebar-foot > a.side-btn:not(.side-help) { display: none; }
  body.app-page .sidebar-foot .side-help { width: 40px; height: 40px; border-radius: 12px; }
  body.app-page .user-chip .avatar { width: 36px; height: 36px; font-size: 15px; }
  body.app-page .nav-clock { display: block; order: 3; margin-left: 4px; padding: 6px 14px; border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; font-size: 22px; font-weight: 800; letter-spacing: .5px; line-height: 1.1; font-variant-numeric: tabular-nums; }
  body.app-page .topbar .clock { display: none !important; }
  body.app-page .topbar { top: 62px; }
  body.app-page .main > .oa-bar { top: 62px; }
  body.app-page .order-panel { top: 140px; height: calc(100vh / var(--z) - 158px); }
  /* Restaurante entra en la pantalla: la barra de arriba es parte del alto */
  body.app-page[data-route="salon"] .sidebar { height: 62px; flex: none; }
  body.app-page[data-route="salon"] .main { flex: 1; height: auto; min-height: 0; }
}
/* Soporte: cerrar la conversación y encuesta con caritas */
.chat-head:has(> div) { flex-direction: row; align-items: center; gap: 10px; }
.chat-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-closed { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0; padding: 8px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; text-align: center; max-width: 90%; }
.chat-closed b { color: var(--ink); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chat-closed b i { font-style: normal; font-size: 20px; }
.chat-closed q { color: var(--ink-2); font-style: italic; }
.survey { margin: 0 14px 12px; padding: 16px; border-radius: 16px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); display: flex; flex-direction: column; gap: 4px; text-align: center; }
.survey b { font-size: 16px; }
.survey small { color: var(--ink-2); }
.survey-faces { display: flex; justify-content: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.survey-faces button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 8px 6px; border: 2px solid transparent; border-radius: 14px; background: var(--surface); cursor: pointer; font: inherit; transition: transform .12s ease-out, border-color .12s; }
.survey-faces button i { font-style: normal; font-size: 32px; line-height: 1; transition: transform .12s ease-out; }
.survey-faces button span { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.survey-faces button.active { border-color: var(--primary); }
.survey-faces button.active span { color: var(--primary); }
.survey-faces button:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) { .survey-faces button:hover i { transform: scale(1.12); } }
.survey-more { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.survey-more textarea { text-align: left; }
.survey-done { background: var(--good-soft); border-color: transparent; color: var(--good); font-weight: 600; }
.pf-sat { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.pf-sat i { grid-row: span 2; font-style: normal; font-size: 30px; }
.pf-sat small { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .survey-faces button i { transition: none; } }
@media (max-width: 600px) {
  .survey { margin: 0 10px 10px; padding: 12px 10px; }
  .survey-faces { flex-wrap: nowrap; gap: 4px; }
  .survey-faces button { flex: 1 1 0; min-width: 0; padding: 6px 2px; }
  .survey-faces button i { font-size: 28px; }
  .survey-faces button span { font-size: 10.5px; }
}

/* ---------- Gráficos de reportes (charts.js) ---------- */
/* Colores por serie en orden fijo, validados para daltonismo en claro y oscuro */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-4: #eda100; --viz-5: #e87ba4; --viz-grid: #ece9e7; --viz-base: #d6d1ce; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500; --viz-5: #d55181; --viz-grid: #2c2a29; --viz-base: #3a3735; }
}
:root[data-theme="dark"] { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500; --viz-5: #d55181; --viz-grid: #2c2a29; --viz-base: #3a3735; }
.viz { position: relative; min-width: 0; }
.viz svg { display: block; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-base { stroke: var(--viz-base); stroke-width: 1; }
.viz-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-hit { fill: transparent; outline: none; }
.viz-col { outline: none; cursor: default; }
.viz-bar { transition: opacity .15s ease; }
.viz-col:hover .viz-bar, .viz-col:focus-visible .viz-bar { opacity: .78; }
.viz-col:focus-visible .viz-hit { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.viz-bar.s1, .viz-dot.s1 { fill: var(--viz-1); } .viz-dot.s2 { fill: var(--viz-2); } .viz-dot.s3 { fill: var(--viz-3); } .viz-dot.s4 { fill: var(--viz-4); } .viz-dot.s5 { fill: var(--viz-5); }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-line.s1 { stroke: var(--viz-1); } .viz-line.s2 { stroke: var(--viz-2); } .viz-line.s3 { stroke: var(--viz-3); } .viz-line.s4 { stroke: var(--viz-4); } .viz-line.s5 { stroke: var(--viz-5); }
.viz-dot { stroke: var(--surface); stroke-width: 2; }
.viz-cross { stroke: var(--viz-base); stroke-width: 1; }
.viz-key { display: inline-block; width: 14px; height: 2.5px; border-radius: 2px; background: var(--viz-1); vertical-align: middle; }
.viz-key.s2 { background: var(--viz-2); } .viz-key.s3 { background: var(--viz-3); } .viz-key.s4 { background: var(--viz-4); } .viz-key.s5 { background: var(--viz-5); }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: 13px; color: var(--ink-2); }
.viz-legend span { display: inline-flex; align-items: center; gap: 7px; }
.viz-tip { position: absolute; z-index: 4; transform: translate(-50%, -100%); pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; min-width: 120px; }
.viz-tip-title { color: var(--muted); font-size: 11.5px; margin-bottom: 4px; white-space: nowrap; }
.viz-tip-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.viz-tip-row b { font-variant-numeric: tabular-nums; }
.viz-tip-row span { color: var(--ink-2); }
.rank-bars { display: flex; flex-direction: column; gap: 2px; }
.rank-row { display: grid; grid-template-columns: minmax(80px, 1.1fr) minmax(60px, 2fr) auto; gap: 12px; align-items: center; padding: 6px 4px; border-radius: 8px; outline: none; }
.rank-row:focus-visible, .rank-row:hover { background: var(--surface-2); }
.rank-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { height: 12px; display: block; }
.rank-track i { display: block; height: 100%; background: var(--viz-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.rank-val { text-align: right; font-size: 13px; font-weight: 600; white-space: nowrap; }
.rank-val small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }

/* ---------- Reportes ---------- */
.rep-layout { grid-template-columns: 200px minmax(0, 1fr); }
.rep-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.rep-filters .rep-range { display: contents; }
.rep-filters .rep-range[hidden] { display: none; }
.rep-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rep-field select, .rep-field input { min-width: 150px; }
.rep-field.sm select { min-width: 100px; padding-block: 6px; font-size: 13px; }
.rep-body { display: flex; flex-direction: column; gap: 16px; transition: opacity .15s ease; }
.rep-body.rep-loading { opacity: .5; }
.rep-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.rep-tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rep-tile-label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.rep-tile-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.rep-hint { color: var(--muted); cursor: help; font-size: 12px; }
.rep-delta { font-size: 12px; font-weight: 700; }
.rep-delta small { font-weight: 500; color: var(--muted); }
.rep-delta.good { color: var(--good); }
.rep-delta.bad { color: var(--bad); }
.rep-delta.muted { font-weight: 500; }
.rep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rep-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rep-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rep-card-head h3 { margin: 0; font-size: 16px; }
.rep-card-ctl { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.rep-table { max-height: 460px; overflow: auto; margin: 0 -18px -16px; border-top: 1px solid var(--line); }
.seg-mini { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; gap: 2px; }
.seg-mini button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 5px 10px; border-radius: 7px; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.seg-mini button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
@media (max-width: 960px) {
  .rep-layout { grid-template-columns: minmax(0, 1fr); }
  .rep-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .rep-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rep-tile { padding: 12px; }
  .rep-tile-value { font-size: 19px; }
  .rep-field select, .rep-field input { min-width: 0; width: 100%; }
  .rep-filters > .rep-field { flex: 1 1 140px; }
  .rep-card { padding: 14px; }
  .rep-table { margin: 0 -14px -14px; }
}
.reason-list { display: flex; flex-wrap: wrap; gap: 8px; }
.reason-list .chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Gastos ---------- */
.gx { display: flex; flex-direction: column; gap: 14px; }
.gx-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
.gx-period { display: flex; align-items: center; gap: 2px; }
.gx-period select { min-width: 260px; }
.gx-arrow { width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
@media (hover: hover) and (pointer: fine) { .gx-arrow:hover { background: var(--surface-2); color: var(--ink); } }
.gx-period-label { min-width: 190px; text-align: center; font-size: 16px; }
.gx-period-type { width: auto; min-width: 130px; }
.gx-bar input[type=date] { width: auto; }
.gx-search { width: 240px; }
.btn-on { border-color: var(--primary); color: var(--primary); }
.gx-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; margin-left: 4px; }
.gx-more { padding: 14px 16px; }
.gx-more[hidden] { display: none; }
.gx-more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.gx-more-grid .rep-field select { min-width: 0; width: 100%; }
.gx-mode { display: flex; width: 100%; }
.gx-mode button { flex: 1; padding: 8px 10px; font-size: 13.5px; }
.gx-more-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.gx-states { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.gx-state { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font: inherit; color: var(--ink); text-align: left; cursor: pointer; min-width: 0; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.gx-state-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.gx-state-label i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.gx-state.warn i { background: var(--warn); } .gx-state.bad i { background: var(--bad); } .gx-state.info i { background: var(--info); } .gx-state.good i { background: var(--good); }
.gx-state strong { font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gx-state small { color: var(--muted); font-size: 12px; }
.gx-state.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
@media (hover: hover) and (pointer: fine) { .gx-state:not(.on):hover { background: var(--surface-2); } }
.gx-list { overflow: hidden; }
.gx-tbl td small { display: block; font-size: 12px; margin-top: 2px; }
.gx-tbl td .badge + small { margin-top: 4px; }
.gx-date-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
.gx-date-cell small { color: var(--muted); font-weight: 500; }
.gx-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.gx-sort span { font-size: 10px; }
.gx-foot { padding: 10px 16px; border-top: 1px solid var(--line); }
.gx-view { display: flex; flex-direction: column; gap: 14px; }
.gx-view-amount { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.gx-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.gx-dl dt { color: var(--muted); }
.gx-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.gx-pays { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gx-pays-title { padding: 8px 12px; background: var(--surface-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gx-pays > .muted { padding: 10px 12px; }
.gx-pay { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.gx-pay small { display: block; margin-top: 2px; }
.pay-lines { display: flex; flex-direction: column; gap: 8px; }
.pay-lines[hidden] { display: none; }
.pay-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; }
.pay-rest { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pay-rest > input { flex: 1; min-width: 0; }
.pay-lines { container-type: inline-size; }
@container (max-width: 520px) { .pay-line { grid-template-columns: minmax(0, 1fr); gap: 6px; } .pay-line + .pay-line { border-top: 1px dashed var(--line); padding-top: 8px; } }
.pay-cash { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; margin: 0; }
.pay-lines-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; }
@media (max-width: 960px) {
  .gx-states { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gx-more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .gx-bar { padding: 8px; }
  .gx-period { flex: 1 1 100%; justify-content: space-between; }
  .gx-period select { min-width: 0; width: 100%; }
  .gx-period-label { min-width: 0; flex: 1; font-size: 15px; }
  .gx-period-type { flex: 1; }
  .gx-search { flex: 1 1 100%; width: 100%; order: 5; }
  .gx-states { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gx-states .gx-state:first-child { grid-column: 1 / -1; }
  .gx-state { padding: 10px 12px; }
  .gx-state strong { font-size: 16px; }
  .gx-more-grid { grid-template-columns: minmax(0, 1fr); }
  .gx-tbl th, .gx-tbl td { padding: 10px 8px; }
  .gx-tbl td .show-sm { margin-top: 4px; }
}

/* ---------- Celular: simetría ---------- */
@media (max-width: 600px) {
  /* Una tarjeta o campo que queda solo en el último renglón ocupa todo el ancho */
  .grid3 > :last-child:nth-child(odd), .rep-tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .rep-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Botones del pie de las ventanas: parejos cuando no entran en un renglón */
  .modal-foot > .btn { flex: 1 1 auto; justify-content: center; }
  .modal-foot > .spacer { display: none; }
  /* El nombre en la primera columna de las tablas pasa de renglón en vez de empujar la tabla de costado */
  .tbl td:first-child { white-space: normal; }
}

/* ---------- Ventana de producto: datos a la izquierda, receta y márgenes a la derecha ---------- */
.modal-pd { max-width: 1140px; }
.pd-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 22px; align-items: start; }
.pd-layout.single { grid-template-columns: minmax(0, 1fr); }
.pd-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pd-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.pd-checks [data-stock] { grid-column: 1 / -1; }
.pd-box { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.pd-box-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.pd-box-head strong { display: inline-flex; align-items: center; gap: 6px; }
.pd-box-head .ico { width: 16px; height: 16px; }
.pd-box > .perm-grid { padding: 10px; }
.pd-col > .margin-strip { padding-top: 0; }
.pd-col > .margin-strip > div { background: var(--surface-2); }

/* Tabla de receta */
.rc { display: flex; flex-direction: column; }
.rc-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px 74px 92px 86px 30px; gap: 8px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.rc-head { padding-block: 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.rc-head > :nth-child(5) { text-align: right; }
.rc-row select, .rc-row input { min-height: 36px; padding: 6px 10px; }
.rc-field { position: relative; }
.rc-field input { padding-right: 30px; text-align: right; }
.rc-field span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); pointer-events: none; }
.rc-gross { font-size: 13px; color: var(--ink-2); text-align: right; white-space: nowrap; }
.rc-cost { font-size: 13.5px; font-weight: 600; text-align: right; white-space: nowrap; }
.rc-total { display: flex; justify-content: space-between; align-items: center; padding: 10px 52px 10px 12px; background: var(--surface-2); font-size: 13.5px; font-weight: 600; }
.rc-empty { padding: 14px; }
@media (max-width: 960px) {
  .pd-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .pd-checks { grid-template-columns: 1fr; }
  .rc-head { display: none; }
  .rc-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 80px 30px; row-gap: 6px; padding: 10px 12px; }
  .rc-row > select { grid-column: 1 / -1; }
  .rc-gross { display: none; }
  .rc-total { padding-right: 12px; }
}

/* ---------- Grupos modificadores (pasos: datos → opciones → productos) ---------- */
.mg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.mg-head strong { font-size: 16px; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.mg-head > .row { flex: none; flex-wrap: nowrap; }
.mg-panel .mg-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mg-panel .mg-sub .btn { text-transform: none; letter-spacing: 0; font-weight: 600; }
.mg-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); }
.mg-steps { display: flex; gap: 6px; margin-bottom: 2px; }
.mg-steps > * { flex: 1; text-align: center; padding: 7px 6px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.mg-steps .on { background: var(--primary-soft); color: var(--primary); }
.mg-split { align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.mg-split span { display: flex; flex-direction: column; gap: 2px; }
.mg-split input { margin-top: 2px; }
.mg-add { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 8px; }
.mg-bulk { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; color: var(--muted); }
.mo-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 70px 62px; gap: 8px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.mo-row:last-child { border-bottom: 0; }
.mo-head { padding-block: 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mo-row input { min-height: 36px; padding: 6px 10px; }
.mo-row > input { text-align: right; }
.mo-name { display: flex; flex-direction: column; min-width: 0; }
.mo-name strong, .mo-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px 54px 30px; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.pg-row > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.pg-row .num { text-align: center; }
.pg-head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-block: 7px; }
.pg-head > :nth-child(2), .pg-head > :nth-child(3) { text-align: center; }
.pg-add { padding: 10px 12px; }
@media (max-width: 600px) {
  .mg-add { grid-template-columns: 1fr 1fr; }
  .mg-add .mg-search { grid-column: 1 / -1; }
  .mo-row { grid-template-columns: minmax(0, 1fr) 92px 54px 30px; }
  .mo-row .icon-btn[data-up] { display: none; }
  .mg-bulk { font-size: 0; }
  .mg-bulk .btn { font-size: 12.5px; }
  .pd-box-head small { display: none; }
}
.mg-panel { scroll-margin-top: 130px; }

/* Panel del grupo: cabecera con color, secciones grises con su ✎ y edición en el lugar */
.mg-layout.solo { grid-template-columns: minmax(0, 1fr); }
.mg-panel { padding: 0; }
.mg-head-strong { background: var(--primary); color: var(--primary-ink, #fff); border-bottom: 0; }
.mg-head-strong .icon-btn { color: inherit; background: rgba(0, 0, 0, .14); }
.mg-sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 8px 14px; min-height: 44px; background: var(--surface-2); border-block: 1px solid var(--line); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.mg-form { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.mg-form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.mg-edit { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.mg-addrow { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; }
.mg-plus { padding: 0; font-size: 22px; font-weight: 700; min-height: 40px; }
.mg-results button.hi { background: var(--primary-soft); }
.mi-row { display: grid; grid-template-columns: minmax(0, 1fr) 92px 112px 30px; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.mi-name { font-weight: 600; font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.mi-field { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.mi-field input { min-height: 34px; padding: 5px 8px; text-align: right; margin: 0; }
.mi-empty { padding: 12px 4px; }
.mg-list li.click { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .mg-list li.click:hover { background: var(--surface-2); } }
@media (max-width: 600px) {
  .mi-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px; row-gap: 4px; }
  .mi-name { grid-column: 1 / -1; }
}
.mg-panel { position: static; overflow: visible; }
.mg-panel > .mg-head-strong { border-radius: var(--radius) var(--radius) 0 0; }
.mg-panel > :last-child { border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Online: tienda, horarios, cupones ---------- */
.on-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.on-grid h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.on-grid h3 .ico { width: 18px; height: 18px; color: var(--muted); }
.set-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; cursor: pointer; }
.set-list .set-row + .set-row { border-top: 1px solid var(--line); }
.on-grid > section > .set-row { border: 1px solid var(--line); border-radius: 12px; }
.set-row > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-row > span:first-child b { font-weight: 600; }
.on-hours { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.on-hours > .ico { width: 22px; height: 22px; color: var(--muted); flex: none; }
.on-hours > div { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.chip-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip-check { display: inline-flex; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: background-color .15s, border-color .15s; }
.chip-check input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chip-check input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.on-from-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.on-from-bar span { display: inline-flex; align-items: center; gap: 6px; }
.on-from-bar .ico { width: 16px; height: 16px; color: var(--muted); }
.on-from-bar a { margin-left: auto; font-weight: 600; font-size: 13px; }
.on-save { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
/* Tienda: 4 tarjetas en 2 filas parejas (cada fila con la misma altura) */
.on-quad { align-items: stretch; }
.on-quad > section { height: 100%; }
.on-link { display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.on-link .qr-box { flex: none; padding: 4px; }
.on-link .qr-box canvas { display: block; }
.on-link-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.on-link-txt .mono { overflow-wrap: anywhere; font-size: 13px; }
.on-link-txt .row { margin-top: 4px; }
.on-save.in-card { border: 0; padding: 0; background: none; }
/* Horarios por día */
.hr-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; }
.hr-list.is-off { opacity: .6; }
.hr-day { display: grid; grid-template-columns: 110px 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; }
.hr-day + .hr-day { border-top: 1px solid var(--line); }
.hr-day.today { background: var(--primary-soft); }
.hr-name { display: flex; flex-direction: column; }
.hr-name small { color: var(--primary); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.hr-ranges { display: flex; flex-direction: column; gap: 6px; }
.hr-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hr-range input[type=time] { width: 128px; min-height: 36px; padding: 5px 8px; font-variant-numeric: tabular-nums; }
.hr-range > span { color: var(--muted); font-size: 13px; }
.hr-closed { font-size: 14px; }
.hr-copy:disabled { visibility: hidden; }
.hr-preview { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.hr-preview > div { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 8px 14px; font-size: 14px; color: var(--ink-2); }
.hr-preview > div + div { border-top: 1px solid var(--line); }
.hr-preview > div.today { background: var(--primary-soft); color: var(--ink); font-weight: 600; }
.hr-preview span { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.hr-preview .ico { width: 15px; height: 15px; color: var(--muted); }
@media (max-width: 960px) { .on-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .hr-day { grid-template-columns: minmax(0, 1fr) 46px; row-gap: 8px; }
  .hr-ranges { grid-column: 1 / -1; }
  .hr-copy { grid-column: 1 / -1; justify-self: start; }
  .hr-range input[type=time] { width: 104px; }
}
/* Aceptar pedido online: demora */
.eta-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.eta-opts .chip-check { display: flex; }
.eta-opts .chip-check span { flex: 1; text-align: center; padding: 10px 6px; }
.eta-preview { text-align: center; font-weight: 600; }
/* Plataforma: ingreso propio del equipo */
.pf-login { max-width: 400px; }
.pf-login h1 { margin: 14px 0 4px; }
.pf-login-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.pf-login-brand img { width: 30px; height: 30px; }
.pf-who { color: var(--muted); font-size: 13px; font-weight: 600; margin-right: 6px; }
