/* =====================================================================
   Tienda CRM — estilos
   Mobile-first: barra inferior en móvil, barra lateral en escritorio.
   ===================================================================== */
:root {
  --bg: #f4f2ed;
  --surface: #ffffff;
  --surface-2: #f9f8f5;
  --ink: #17201f;
  --ink-2: #4b5654;
  --ink-3: #848d8b;
  --line: #e4e1d9;
  --brand: #0f3d3a;
  --brand-ink: #ffffff;
  --accent: #e8a33d;
  --accent-soft: #fbefd9;
  --ok: #1f7a4d;
  --ok-soft: #e1f2e8;
  --warn: #b5651d;
  --warn-soft: #fbeadb;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23,32,31,.05), 0 6px 20px rgba(23,32,31,.06);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111615; --surface: #1a2120; --surface-2: #151b1a; --ink: #eef1f0; --ink-2: #b2bbb9; --ink-3: #7c8785;
    --line: #2a3331; --brand: #3fb5a6; --brand-ink: #06201d; --accent: #f0b456; --accent-soft: #3a2e1a;
    --ok: #4cc58a; --ok-soft: #173326; --warn: #e79a52; --warn-soft: #3a2817; --bad: #ef6b62; --bad-soft: #3c1b19;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 1.55rem; font-weight: 800; }
h2 { font-size: 1.1rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-size: .9em; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.hidden { display: none !important; }
.boot { display: grid; place-items: center; min-height: 100dvh; color: var(--ink-3); }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100dvh; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.topbar .title { display: flex; flex-direction: column; gap: 2px; }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--ink-3); font-size: .7rem; font-weight: 600; }
.bottomnav a.active { color: var(--brand); }
.bottomnav a.scan-btn .ico { background: var(--brand); color: var(--brand-ink); border-radius: 50%; width: 46px; height: 46px; display: grid; place-items: center; margin-top: -18px; box-shadow: var(--shadow); }
.ico svg { width: 22px; height: 22px; display: block; }

@media (min-width: 900px) {
  .bottomnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; width: 236px; flex-shrink: 0; background: var(--brand); color: var(--brand-ink);
    padding: 20px 14px; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  }
  .sidebar .brand { font-weight: 800; font-size: 1.1rem; padding: 4px 10px 18px; display: flex; align-items: center; gap: 10px; }
  .sidebar .brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #17201f; display: grid; place-items: center; font-weight: 800; }
  .sidebar nav { display: flex; flex-direction: column; gap: 2px; }
  .sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: inherit; opacity: .78; text-decoration: none; font-weight: 600; }
  .sidebar nav a:hover { opacity: 1; background: rgba(255,255,255,.07); }
  .sidebar nav a.active { opacity: 1; background: rgba(255,255,255,.14); }
  .sidebar .ico svg { width: 19px; height: 19px; }
  .sidebar .section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .5; padding: 16px 12px 6px; }
  .sidebar .me { margin-top: auto; padding: 12px; font-size: .85rem; opacity: .85; border-top: 1px solid rgba(255,255,255,.12); }
  .sidebar .me button { background: none; border: 0; color: inherit; text-decoration: underline; padding: 0; cursor: pointer; opacity: .8; }
  .main { padding: 28px 32px 40px; }
  .more-link { display: none !important; }
}
@media (prefers-color-scheme: dark) and (min-width: 900px) {
  .sidebar { background: #0c1211; color: var(--ink); border-right: 1px solid var(--line); }
}

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-kpi { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-kpi { grid-template-columns: repeat(4, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.kpi .value { font-size: 1.45rem; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi .sub { font-size: .78rem; color: var(--ink-3); }
.kpi.hero { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.kpi.hero .label, .kpi.hero .sub { color: inherit; opacity: .75; }
.pos { color: var(--ok); } .neg { color: var(--bad); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  padding: 10px 16px; border-radius: 11px; font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink); min-height: 42px;
  transition: transform .06s ease, background .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.btn.accent { background: var(--accent); color: #1c1407; border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 6px 11px; min-height: 34px; font-size: .85rem; border-radius: 9px; }
.btn.lg { padding: 14px 20px; min-height: 54px; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn .ico svg { width: 18px; height: 18px; }
.icon-btn { width: 38px; height: 38px; padding: 0; min-height: 0; border-radius: 10px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--ink-3); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; min-height: 44px; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); background: var(--surface); }
.input.big { font-size: 1.6rem; font-weight: 800; text-align: center; min-height: 60px; font-variant-numeric: tabular-nums; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--ink-2); font-size: .88rem; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.searchbar { position: relative; flex: 1; min-width: 180px; }
.searchbar .input { padding-left: 38px; }
.searchbar .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.searchbar .ico svg { width: 18px; height: 18px; }

/* ---------- Lists & tables ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item .main-col { flex: 1; min-width: 0; }
.list-item .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .meta { font-size: .8rem; color: var(--ink-3); }
.list-item .price { font-weight: 800; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .75rem; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); 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.accent { background: var(--accent-soft); color: var(--warn); border-color: transparent; }
.empty { text-align: center; padding: 30px 10px; color: var(--ink-3); }

/* ---------- Scanner ---------- */
.scanner { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; max-height: 52vh; width: 100%; }
.scanner .reader { width: 100%; height: 100%; }
.scanner .reader video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .overlay { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.scanner .frame { width: 90%; height: 50%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); }
.scanner .laser { position: absolute; left: 7%; right: 7%; height: 2px; background: var(--accent); top: 50%; box-shadow: 0 0 12px var(--accent); animation: laser 1.6s ease-in-out infinite alternate; }
@keyframes laser { from { transform: translateY(-50px); } to { transform: translateY(50px); } }
.scanner .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #cfd6d5; text-align: center; padding: 20px; }
.manual { display: flex; gap: 8px; margin-top: 12px; }
.manual .input { font-family: var(--mono); }

.product-hero { display: flex; flex-direction: column; gap: 4px; }
.product-hero .pname { font-size: 1.3rem; font-weight: 800; }
.product-hero .pprice { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat { background: var(--surface-2); border-radius: 11px; padding: 10px 12px; }
.stat .l { font-size: .72rem; color: var(--ink-3); font-weight: 700; }
.stat .v { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }

/* ---------- POS ---------- */
kbd { font-family: var(--mono); font-size: .68rem; font-weight: 600; padding: 1px 6px; border-radius: 6px; border: 1px solid currentColor; opacity: .55; line-height: 1.5; }
@media (pointer: coarse), (max-width: 700px) { kbd { display: none; } }
.pos-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pos-id { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.pos-code { width: 46px; height: 46px; border-radius: 13px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.pos-name { font-weight: 800; font-size: 1.25rem; line-height: 1.15; }
.cashier-chip { display: flex; align-items: center; gap: 9px; padding: 5px 14px 5px 5px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; line-height: 1.15; }
.cashier-chip:hover { border-color: var(--brand); }
.cashier-chip .av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #1c1407; display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.cashier-chip .small { font-size: .7rem; }
.pos-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pos-actions .count { background: var(--accent); color: #1c1407; border-radius: 99px; padding: 0 7px; font-size: .75rem; }
@media (max-width: 899px) { .pos-top { padding-top: 22px; } }
@media (max-width: 560px) { .pos-actions { width: 100%; } .pos-actions .btn { white-space: nowrap; } .pos-actions .btn { flex: 1; padding: 6px 8px; } .pos-actions .btn .ico { display: none; } }

.pos-layout { display: grid; gap: 14px; }
@media (min-width: 900px) {
  .pos-layout { grid-template-columns: minmax(0, 1.35fr) minmax(330px, 1fr); align-items: start; }
  .pos-side { position: sticky; top: 20px; }
  .pos-bar { display: none !important; }
}
.pos-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pos-search { display: flex; gap: 8px; }
.pos-search .input { min-height: 52px; font-size: 1.05rem; border-radius: 13px; background: var(--surface); }
.pos-search .btn { min-height: 52px; border-radius: 13px; }
.kbd-hint { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.searchbar .input:focus ~ .kbd-hint { display: none; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { --h: 165; flex-shrink: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); padding: 7px 14px; border-radius: 99px; font-weight: 700; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--bg); border-color: transparent; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
@media (max-width: 899px) { .tiles { grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-template-columns: none; grid-auto-columns: 128px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; } .tile { scroll-snap-align: start; } }
.tile {
  --h: 165; position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; text-align: left; min-height: 84px;
  padding: 11px 12px 10px 15px; border-radius: 13px; border: 1px solid var(--line); cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h) 70% 50% / .09), transparent 70%), var(--surface); transition: transform .08s ease, border-color .15s;
}
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: hsl(var(--h) 55% 48%); }
.tile:hover { border-color: hsl(var(--h) 55% 48%); }
.tile:active { transform: scale(.96); }
.tile.pop { animation: pop .3s ease; }
@keyframes pop { 40% { transform: scale(.93); } }
.tile-name { font-weight: 700; font-size: .88rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.tile-price { font-weight: 800; font-size: 1.02rem; }
.tile-stock { font-size: .66rem; font-weight: 700; color: var(--bad); }
.tile-q { position: absolute; top: 6px; right: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: .75rem; font-weight: 800; display: grid; place-items: center; }
.tile-q + .tile-name { padding-right: 22px; }

.tk { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.tk-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.tk-head .btn.sm { min-height: 32px; }
.tk-lines { padding: 0 16px; min-height: 120px; }
@media (min-width: 900px) { .tk-lines { max-height: calc(100dvh - 330px); overflow-y: auto; } }
.tk-empty { display: flex; align-items: center; gap: 14px; color: var(--ink-3); padding: 26px 4px; font-size: .9rem; }
.tk-empty .ico svg { width: 38px; height: 38px; opacity: .5; }
.tk-empty strong { color: var(--ink-2); }
.tl { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.tl:last-child { border-bottom: 0; }
.ticket-line { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ticket-line:last-child { border-bottom: 0; }
.tl.flash { animation: flash 1s ease; }
@keyframes flash { 0% { background: var(--accent-soft); box-shadow: -16px 0 0 var(--accent-soft), 16px 0 0 var(--accent-soft); } 100% { background: transparent; box-shadow: none; } }
.tl-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-meta { font-size: .78rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-amt { font-weight: 800; min-width: 74px; text-align: right; }
.tk-foot { padding: 12px 16px 16px; background: var(--surface-2); border-top: 1px solid var(--line); }
.tk-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.tk-total span:first-child { font-weight: 700; color: var(--ink-2); }
.tk-total .t { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; }
.btn.xl { min-height: 62px; font-size: 1.2rem; border-radius: 14px; }
.btn kbd { border-color: currentColor; }
@media (max-width: 899px) { .charge-btn { display: none; } .tk-total { margin-bottom: 0; } }

.pos-bar {
  position: fixed; z-index: 25; left: 10px; right: 10px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px;
  background: var(--ink); color: var(--bg); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: transform .2s ease, opacity .2s;
}
.pos-bar.empty { transform: translateY(20px); opacity: 0; pointer-events: none; }
.pos-bar .muted { color: inherit; opacity: .65; }
.pos-bar .pb-t { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.pos-bar .btn { min-width: 130px; background: var(--accent); color: #1c1407; }
@media (max-width: 899px) { .pos-layout { padding-bottom: 76px; } }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 36px; height: 36px; border: 0; background: var(--surface-2); cursor: pointer; font-weight: 800; font-size: 1.1rem; display: grid; place-items: center; }
.qty button:hover { background: var(--line); }
.qty button.del { color: var(--bad); }
.qty button .ico svg { width: 16px; height: 16px; }
.qty span { min-width: 34px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer; }
.total-box { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; }
.total-box .t { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.change-box { background: var(--ok-soft); color: var(--ok); border-radius: 11px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 1.1rem; }
.change-box.big { padding: 14px 16px; font-size: 1rem; }
.change-box.big .num { font-size: 1.8rem; letter-spacing: -0.02em; }
.change-box.short { background: var(--bad-soft); color: var(--bad); }
.quick-cash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

/* Pantalla de cobro */
.co-modal { max-width: 520px; }
.co { display: flex; flex-direction: column; gap: 14px; }
.co-total { background: var(--brand); color: var(--brand-ink); border-radius: 16px; padding: 16px 18px; text-align: center; }
.co-total .lbl { font-size: .8rem; font-weight: 700; opacity: .75; text-transform: uppercase; letter-spacing: .06em; }
.co-total .amt { font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.co-total .sub { font-size: .85rem; opacity: .75; }
.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pay-methods button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 4px 10px; border-radius: 13px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.pay-methods button .ico svg { width: 26px; height: 26px; }
.pay-methods button kbd { position: absolute; top: 5px; right: 6px; font-size: .6rem; padding: 0 4px; }
.pay-methods button.on { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.cash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 6px; }
.cash-grid .btn { padding: 6px 4px; }
.cash-grid .btn { min-height: 50px; flex-direction: column; gap: 0; font-variant-numeric: tabular-nums; line-height: 1.15; }
.cash-grid .btn small { font-weight: 600; font-size: .72rem; color: var(--ink-3); }
.co-opts { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
#co-disc .input { flex: 1; }
.cust-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }

/* Venta registrada */
.done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.done-check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; animation: pop .4s ease; }
.done-check svg { width: 34px; height: 34px; display: block; }
.done-change { width: 100%; margin-top: 6px; padding: 16px; border-radius: 16px; background: var(--ok-soft); color: var(--ok); }
.done-change.warn { background: var(--warn-soft); color: var(--warn); }
.done-change.plain { background: var(--surface-2); color: var(--ink); }
.done-change .lbl { font-weight: 700; font-size: .9rem; }
.done-change .amt { font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; }
.suggest .list-item { padding: 10px 12px; }

/* ---------- Charts ---------- */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { fill: var(--ink-3); font-size: 10px; font-family: var(--font); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.bar-list .bl-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 7px 0; }
.bar-list .bl-track { grid-column: 1 / -1; height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-list .bl-fill { height: 100%; border-radius: 99px; background: var(--brand); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,16,15,.5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.modal { background: var(--surface); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 20px; } .modal { border-radius: 20px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 420px; }
@media (min-width: 900px) { #toast-root { bottom: 24px; } }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); animation: up .2s ease; font-size: .92rem; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent), var(--bg); }
.auth .card { width: 100%; max-width: 400px; padding: 26px 22px; }
.auth .logo { width: 48px; height: 48px; border-radius: 14px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; margin-bottom: 14px; }

/* ---------- Más (menú móvil) ---------- */
.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.more-grid a { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; }

/* ---------- Impresión (tickets y etiquetas) ---------- */
#print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  @page { margin: 8mm; }
  html, body { background: #fff; color: #000; }
}
.print-ticket { width: 72mm; font-family: var(--mono); font-size: 11px; color: #000; }
.print-ticket h1 { font-size: 14px; text-align: center; margin-bottom: 4px; }
.print-ticket .c { text-align: center; }
.print-ticket table { font-size: 11px; }
.print-ticket td, .print-ticket th { padding: 2px 0; border: 0; color: #000; }
.print-ticket hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.labels-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
.shelf-label { border: 1px solid #000; border-radius: 2mm; padding: 3mm; height: 30mm; display: flex; flex-direction: column; justify-content: space-between; color: #000; font-family: var(--font); break-inside: avoid; }
.shelf-label .n { font-weight: 700; font-size: 10pt; line-height: 1.15; }
.shelf-label .p { font-weight: 800; font-size: 20pt; text-align: right; }
.shelf-label .b { font-family: var(--mono); font-size: 7pt; }

/* ---------- TPV ---------- */
.sync { position: fixed; z-index: 45; top: calc(8px + env(safe-area-inset-top)); right: 10px; font-size: .72rem; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); pointer-events: none; }
.sync:empty { display: none; }
.sync.ok { color: var(--ok); } .sync.warn { color: var(--warn); } .sync.off { color: var(--warn); background: var(--warn-soft); } .sync.bad { color: var(--bad); background: var(--bad-soft); }
@media (min-width: 900px) { .sync { top: auto; right: auto; bottom: 92px; left: 26px; } }
.note.warn { border-color: var(--accent); background: var(--accent-soft); }
.note.bad { border-color: var(--bad); background: var(--bad-soft); }
details summary { cursor: pointer; }
.print-ticket .r { text-align: right; }
.print-ticket .tot { font-size: 15px; font-weight: bold; text-align: right; margin-top: 2px; }
.print-ticket .qr { margin-top: 4px; }
.print-ticket .qr svg { display: block; margin: 0 auto 2px; }
