/* =====================================================================
   Berry · Estilos
   Diseño editorial, claro y de alto contraste. Sin dependencias.
   ===================================================================== */

:root {
  --ink: #14110f;
  --ink-2: #3d3833;
  --muted: #6f675f;
  --line: #e4ded6;
  --line-strong: #cfc7bc;
  --paper: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f3efe9;
  --berry: #a3123f;
  --berry-ink: #ffffff;
  --berry-soft: #fbe9ef;
  --ok: #157347;     --ok-soft: #e3f3ea;
  --warn: #9a5b00;   --warn-soft: #fdf1dc;
  --bad: #b42318;    --bad-soft: #fde8e6;
  --info: #1d4ed8;   --info-soft: #e5edfd;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(20, 17, 15, .06), 0 4px 16px rgba(20, 17, 15, .06);
  --shadow-lg: 0 20px 60px rgba(20, 17, 15, .22);
  --sidebar: 236px;
  --sidebar-mini: 68px;
  --topbar: 60px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--berry) 55%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100dvh; transition: grid-template-columns .2s; }
.app.mini { grid-template-columns: var(--sidebar-mini) 1fr; }

.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto; overflow-x: hidden;
  background: var(--ink); color: #efe9e1; display: flex; flex-direction: column; padding: 14px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%; background: var(--berry); flex: none;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 20px; color: #fff;
}
.brand-name { font-family: var(--font-display); font-size: 22px; letter-spacing: .01em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #9a9187; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm);
  text-decoration: none; color: #d8d1c7; white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: #fff; color: var(--ink); font-weight: 600; }
.nav svg { width: 20px; height: 20px; flex: none; }
.nav a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* atajo de teclado de cada pantalla (#/atajos): tenue, más visible al pasar el mouse */
.nav-kbd { margin-left: auto; padding-left: 8px; font: 600 10px/1 ui-monospace, monospace; color: #8f867b; opacity: .75; }
.nav-kbd:empty { display: none; }
.nav a:hover .nav-kbd { opacity: 1; color: #d8d1c7; }
.nav a.active .nav-kbd { color: var(--muted); }
.app.mini .nav-kbd { display: none; }
@media (hover: none) and (pointer: coarse) { .nav-kbd { display: none; } }
/* pantalla Atajos de teclado */
.sc-row td { padding-top: 8px; padding-bottom: 8px; }
.sc-row .sc-name { display: flex; align-items: center; gap: 10px; }
.sc-row .sc-name svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.sc-combo { white-space: nowrap; }
.sc-combo kbd { font-size: 12px; padding: 3px 7px; }
.sc-section td { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 14px; }
.sc-capture { border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 22px 12px; text-align: center; min-height: 86px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; outline: none; cursor: pointer; }
.sc-capture:focus { border-color: var(--berry); }
.sc-capture kbd { font-size: 18px; padding: 6px 12px; }
.user-chip .meta { min-width: 0; overflow: hidden; }
.user-chip .meta b, .user-chip .meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); }
.app.mini .brand-name, .app.mini .nav-section, .app.mini .nav a span, .app.mini .user-chip .meta { display: none; }
.app.mini .nav a { justify-content: center; }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; background: none; border: 0; width: 100%; text-align: left; color: inherit; }
.user-chip:hover { background: rgba(255,255,255,.07); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #3a332d; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; color: #fff; }
.user-chip .meta { min-width: 0; }
.user-chip .meta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .meta small { color: #a79e93; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-family: var(--font-display); font-weight: 600; font-size: 22px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.content { padding: 24px; max-width: 1360px; width: 100%; margin: 0 auto; }

.bottom-nav { display: none; }

@media (max-width: 900px) {
  .app, .app.mini { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .app.drawer-open .sidebar { transform: none; }
  .app.drawer-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .app.mini .brand-name, .app.mini .nav-section, .app.mini .nav a span, .app.mini .user-chip .meta { display: initial; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
    font-size: 11px; text-decoration: none; color: var(--muted); background: none; border: 0; border-radius: 8px;
  }
  .bottom-nav a.active { color: var(--berry); font-weight: 600; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 901px) { .show-mobile { display: none !important; } }

/* ---------- Tipografía y utilidades ---------- */
h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: .93em; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: 18px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat .value { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 13px; color: var(--muted); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #2b2622; }
.btn.accent { background: var(--berry); color: var(--berry-ink); border-color: var(--berry); }
.btn.accent:hover { background: #8a0f35; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.block { width: 100%; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 12px; color: var(--muted); }
.field .error { font-size: 12px; color: var(--bad); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,17,15,.08); outline: none; }
.input.invalid { border-color: var(--bad); background: var(--bad-soft); }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; height: 42px; }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-prefix .input { padding-left: 28px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-left: 38px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; flex-wrap: wrap; }
fieldset { border: 0; padding: 0; margin: 0; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; }
.table th.num { text-align: right; }
.table tfoot th { position: static; color: var(--ink); font-size: 14px; text-transform: none; letter-spacing: 0; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }

/* Listas tipo tarjeta (móvil) */
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.berry { background: var(--berry-soft); color: var(--berry); }
.badge.outline { background: transparent; border-color: var(--line-strong); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.stock-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stock-pill b { font-weight: 700; }
.stock-pill.neg { background: var(--bad-soft); color: var(--bad); }
.stock-pill.low { background: var(--warn-soft); color: var(--warn); }
.stock-pill.zero { color: var(--muted); }

/* ---------- Productos ---------- */
.thumb { width: 44px; height: 44px; border-radius: 8px; background: var(--surface-2); object-fit: cover; flex: none; display: grid; place-items: center; color: var(--line-strong); overflow: hidden; }
.thumb svg { width: 22px; height: 22px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 280px; }
.toolbar select.input { width: auto; min-width: 150px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 600; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .form-layout { grid-template-columns: 1fr; } }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 18px; z-index: 5; }
@media (max-width: 900px) { .sticky-actions { bottom: calc(64px + env(safe-area-inset-bottom)); } }

.barcode-row { display: grid; grid-template-columns: minmax(0,1fr) 130px 80px auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.barcode-row:last-child { border-bottom: 0; }
@media (max-width: 640px) { .barcode-row { grid-template-columns: 1fr 1fr; } .barcode-row .input-group { grid-column: 1 / -1; } }
.barcode-preview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; display: flex; justify-content: center; }
.barcode-preview svg { max-width: 100%; height: auto; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.gallery-item { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid var(--line); background: var(--surface-2); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item.primary { border-color: var(--berry); }
.gallery-item .tag { position: absolute; left: 6px; top: 6px; }
.gallery-item .ops { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.55)); opacity: 0; transition: opacity .15s; }
.gallery-item:hover .ops, .gallery-item:focus-within .ops { opacity: 1; }
@media (hover: none) { .gallery-item .ops { opacity: 1; } }
.gallery-item .ops button { background: rgba(255,255,255,.92); border: 0; border-radius: 6px; padding: 4px 6px; cursor: pointer; font-size: 12px; font-weight: 600; }
.image-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.image-actions .btn { height: auto; padding: 10px 6px; flex-direction: column; gap: 4px; font-size: 12px; white-space: normal; text-align: center; }
.image-actions .btn svg { width: 22px; height: 22px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pick-grid button { border: 2px solid var(--line); border-radius: var(--radius-sm); background: #fff; padding: 0; cursor: pointer; overflow: hidden; aspect-ratio: 1; position: relative; }
.pick-grid button:hover { border-color: var(--ink); }
.pick-grid img { width: 100%; height: 100%; object-fit: contain; }
.pick-grid small { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.9); font-size: 11px; padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Árbol de categorías ---------- */
.tree-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tree-item.child { padding-left: 42px; background: #fdfcfa; }
.tree-item.child::before { content: "└"; color: var(--line-strong); margin-left: -20px; }

/* ---------- Modal, toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,17,15,.45); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: rise .18s ease; }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 640px) {
  .modal-backdrop { place-items: end stretch; padding: 0; }
  .modal, .modal.wide { width: 100%; border-radius: 16px 16px 0 0; max-height: 92dvh; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
@media (max-width: 900px) { .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); left: 16px; right: 16px; } }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); animation: rise .2s; font-weight: 500; }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; margin: 0 auto 10px; color: var(--line-strong); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), #fff, var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-weight: 500; font-size: 14px; }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--ink); color: #f5efe7; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: var(--berry); right: -160px; bottom: -200px; opacity: .9; }
.login-art h1 { font-family: var(--font-display); font-size: clamp(34px, 4vw, 54px); line-height: 1.05; margin: 0; max-width: 12ch; position: relative; z-index: 1; font-weight: 600; }
.login-art p { color: #bdb3a8; max-width: 38ch; position: relative; z-index: 1; }
.login-form { display: grid; place-items: center; padding: 32px 20px; }
.login-form form { width: min(380px, 100%); }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------- Escáner ---------- */
.scanner { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 28% 10%; border: 3px solid rgba(255,255,255,.9); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); }
.scanner .laser { position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; background: var(--berry); box-shadow: 0 0 12px var(--berry); animation: laser 1.6s ease-in-out infinite alternate; }
@keyframes laser { from { top: 32%; } to { top: 68%; } }

/* ---------- Etiquetas (impresión) ---------- */
.labels-sheet { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 4mm; }
.lbl-card { border: 1px dashed #bbb; padding: 3mm; text-align: center; break-inside: avoid; background: #fff; display: flex; flex-direction: column; gap: 1mm; justify-content: center; }
.lbl-card .lname { font-size: 10pt; font-weight: 600; line-height: 1.15; max-height: 2.4em; overflow: hidden; }
.lbl-card .lprice { font-family: var(--font-display); font-size: 16pt; font-weight: 700; }
.lbl-card svg { width: 100%; height: auto; max-height: 22mm; }
.lbl-card .lold { font-size: .6em; color: #666; font-weight: 500; }
.lbl-card .ldate { font-size: 7pt; color: #555; }
.labels-sheet.thermal { display: flex; flex-wrap: wrap; gap: 3mm; }
.labels-sheet.thermal .lbl-card { padding: 1.5mm 2mm; gap: .5mm; overflow: hidden; border-style: solid; }
.labels-sheet.thermal .lname { font-size: 8pt; }
.labels-sheet.thermal .lprice { font-size: 14pt; line-height: 1; }
.labels-sheet.thermal svg { max-height: 45%; }
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .bottom-nav, .no-print, .toasts { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .lbl-card { border-color: transparent; }
  @page { margin: 8mm; }
}

/* ---------- Ajustes de grilla en pantallas chicas ---------- */
.form-layout > *, .grid > * { min-width: 0; }
#page-actions { flex-wrap: nowrap; }
@media (max-width: 900px) {
  .toolbar .spacer { display: none; }
  .toolbar select.input { flex: 1 1 140px; min-width: 0; }
  .topbar h1 { font-size: 19px; min-width: 0; }
  .card { padding: 14px; }
  .card.flush { padding: 0; }
}

/* =====================================================================
   Etapa 3 · POS, caja, cuentas corrientes, stock
   ===================================================================== */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.pos-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; position: relative; }
.pos-search { display: flex; gap: 8px; }
.pos-search .input { height: 54px; font-size: 18px; }
.pos-search .btn { height: 54px; width: 54px; padding: 0; }
.pos-results { position: absolute; top: 62px; left: 0; right: 0; z-index: 15; max-height: 420px; overflow-y: auto; box-shadow: var(--shadow-lg); }
.pos-hit { width: 100%; border: 0; background: none; cursor: pointer; font: inherit; }
.pos-hit:focus { background: var(--surface-2); outline: none; }
.pos-cart .table td { padding: 8px 10px; }
.pos-cart tr.sel td { background: #fff8e8; }
.pos-cart .qty { display: inline-flex; align-items: center; gap: 2px; }
.pos-cart .qty .input { width: 58px; height: 34px; text-align: center; padding: 0 4px; }
.pos-cart .pos-price, .pos-cart .pos-disc { height: 34px; text-align: right; width: 100px; padding: 0 6px; }
.pos-cart .pos-disc { width: 64px; }
.pos-side { position: sticky; top: calc(var(--topbar) + 16px); }
.pos-side .field > label { font-size: 12px; }
.pos-cust { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); }
.pos-totals { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.pos-total { font-family: var(--font-display); font-size: 30px; align-items: baseline; }
.pos-total b { font-variant-numeric: tabular-nums; }
.pos-pay { height: 58px; font-size: 19px; margin-top: 14px; }
.pos-mobilebar { display: none; }
@media (max-width: 1000px) {
  .pos { grid-template-columns: 1fr; }
  .pos-side { position: static; }
  .pos-side .pos-pay { display: none; }
  .pos-mobilebar { display: flex; position: fixed; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 30; background: var(--ink); color: #fff; padding: 10px 14px; align-items: center; justify-content: space-between; }
  .pos-mobilebar b { display: block; font-family: var(--font-display); font-size: 24px; }
  .pos-mobilebar small { color: #bdb3a8; }
  .pos-mobilebar .btn { height: 46px; }
  .content:has(.pos) { padding-bottom: 170px; }
}
@media (min-width: 901px) and (max-width: 1000px) { .pos-mobilebar { display: flex !important; bottom: 0; } }

.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.pay-method { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font: inherit; text-align: left; min-height: 64px; }
.pay-method:hover { border-color: var(--ink); }
.pay-row.card { padding: 12px; background: var(--surface-2); }
.pay-split { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0; }
.pay-split > .btn { font-weight: 600; }
.pay-methods.splitting .pay-method { border-color: var(--berry); border-style: dashed; }
.pay-amount { height: 42px; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.pay-summary { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.pay-final { font-size: 22px; padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.pay-final b { font-variant-numeric: tabular-nums; }
.pay-plans { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.plan-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 120px; padding: 8px 12px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font: inherit; text-align: left; }
.plan-opt:hover { border-color: var(--ink); }
.plan-opt.on { border-color: var(--berry); box-shadow: 0 0 0 2px var(--berry) inset; background: var(--surface-2); }
.plan-opt .plan-tot { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

.picker { position: relative; }
.picker-results { position: absolute; z-index: 30; left: 0; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; }
.picker-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 12px; cursor: pointer; text-align: left; font: inherit; border-bottom: 1px solid var(--line); }
.picker-item:last-child { border-bottom: 0; }
.picker-item:hover, .picker-item.active { background: var(--surface-2); }
.lines-table .input { height: 36px; width: 110px; text-align: right; }

.money-pos { color: var(--bad); }
.money-neg { color: var(--ok); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpis .card { padding: 14px 16px; }
.kpis .stat .value { font-size: 26px; }
.status-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.collect-card { display: flex; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.collect-card:last-child { border-bottom: 0; }
.collect-card .amount { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--bad); white-space: nowrap; }
tr.done td { opacity: .55; }

/* ---------- Etapa 5: asistente de facturación ARCA ---------- */
.arca { max-width: 920px; }
.arca-step { padding: 0; }
.arca-step > details > summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; }
.arca-step > details > summary::-webkit-details-marker { display: none; }
.arca-step > details > summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.arca-step > details[open] > summary::after { transform: rotate(-135deg); }
.arca-step > details > summary h2 { margin: 0; font-size: 17px; }
.arca-num { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--berry-soft); color: var(--berry-ink); border: 2px solid var(--berry); }
.arca-num svg { width: 18px; height: 18px; }
.arca-step.done .arca-num { background: var(--ok); border-color: var(--ok); color: #fff; }
.arca-body { padding: 0 18px 18px 62px; min-width: 0; }
.arca-body > p:first-child { margin-top: 0; }
.arca-sub { margin: 14px 0 8px; font-weight: 600; }
.arca-sub:first-child { margin-top: 0; }
.arca-guide { margin: 8px 0 12px; padding: 12px 14px 12px 34px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.arca-guide li { margin: 4px 0; line-height: 1.5; }
.arca-test { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.arca-test li { padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.arca-test li > svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.arca-test li.ok { background: var(--ok-soft, #e8f5ee); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.arca-test li.ok > svg { color: var(--ok); }
.arca-test li.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.arca-test li.bad > svg { color: var(--bad); }
.arca textarea.mono { width: 100%; font-family: var(--mono); font-size: 12px; }
@media (max-width: 640px) {
  .arca-step > details > summary { padding: 12px 14px; }
  .arca-body { padding: 0 14px 14px; }
}
.arca .alert svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* ---------- Etapa 6: ítem varios y devoluciones en el POS ---------- */
.pos-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; }
.pos-cart tr.pos-ret-head td { background: var(--bad-soft); color: var(--bad); }
.pos-cart tr.pos-ret-head svg { width: 16px; height: 16px; vertical-align: -3px; }
.pos-cart tr.pos-ret td { color: var(--bad); background: color-mix(in srgb, var(--bad-soft) 45%, transparent); }
.pos-ret-sum { color: var(--bad); font-weight: 600; }
.modal-body { min-width: 0; }
.modal-body .table-wrap { max-width: 100%; overflow-x: auto; }

/* Reportes del dueño */
.profit-bar { height: 4px; background: var(--surface-2); border-radius: 2px; margin-top: 5px; max-width: 220px; overflow: hidden; }
.profit-bar span { display: block; height: 100%; border-radius: 2px; }
.today .list-item .num { text-align: right; }
@media (max-width: 760px) { .today .kpis { grid-template-columns: 1fr 1fr; } .today .kpis .stat .value { font-size: 21px; } }

/* Sin conexión */
.netbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 20px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; border-bottom: 1px solid var(--line); }
.netbar.off { background: var(--bad-soft); color: var(--bad); }
.netbar svg { width: 16px; height: 16px; }
.pos-tools .btn.danger { border-color: var(--bad); color: var(--bad); }

/* Mercado Pago QR */
.mp-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.mp-qr-code { background: #fff; padding: 14px; border-radius: 14px; border: 1px solid var(--line); line-height: 0; }
.mp-qr-code svg { width: min(260px, 70vw); height: auto; }
.mp-qr-amount { font-family: var(--font-display); font-size: 30px; font-weight: 700; }
.mp-status { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--muted); max-width: 340px; }

/* Conteo de inventario */
.count-head { padding: 12px 16px; }
.count-last { border: 2px solid var(--ok); }
.count-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.count-kpis .card { padding: 10px 12px; }
.count-kpis .stat .value { font-size: 22px; }
.count-big { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1; min-width: 70px; text-align: right; }
#off-warn .alert svg { width: 16px; height: 16px; vertical-align: -3px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.card.dropping{outline:2px dashed var(--berry, #c2185b);outline-offset:-6px;background:var(--surface-2)}
.paste-zone:focus{outline:2px solid var(--berry, #c2185b);outline-offset:2px}

/* ---------- Promociones, vendedores y hoja de preparación ---------- */
.pos-promo { color: var(--ok); }
.pos-promo svg { width: 13px; height: 13px; vertical-align: -2px; }
.pick-bar { position: sticky; top: 8px; z-index: 4; display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--berry, #c2185b); border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.pick-bar #pickn, .pick-bar #seln { flex: 1; font-weight: 600; }
.seller-days { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.seller-day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.seller-day span { width: 100%; max-width: 22px; background: var(--berry, #c2185b); border-radius: 4px 4px 0 0; }
.seller-day small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.picking { display: flex; flex-direction: column; gap: 16px; max-width: 1000px; margin: 0 auto; }
.pick-page { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.pick-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 8px; }
.pick-head h2 { margin: 0 0 4px; font-size: 20px; }
.pick-note { margin-top: 6px; padding: 6px 8px; background: #fff7d6; border-radius: 6px; font-size: 13px; }
.pick-code svg { max-width: 180px; height: auto; }
.pick-table td, .pick-table th { color: #111; }
.pick-table td { vertical-align: top; }
.pick-qty { font-size: 18px; font-weight: 800; white-space: nowrap; }
.pick-qty small { font-size: 11px; font-weight: 400; }
.pick-box { display: inline-block; width: 18px; height: 18px; border: 2px solid #111; border-radius: 4px; }
.pick-chip { display: inline-block; margin: 0 6px 2px 0; padding: 1px 6px; border: 1px solid #bbb; border-radius: 10px; white-space: nowrap; }
.pick-table tr.short td { background: #fff1f1; }
.pick-warn { color: #c62828; font-weight: 700; }
.pick-foot { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 18px; }
@media print {
  .picking { max-width: none; gap: 0; }
  .pick-page { border: 0; border-radius: 0; padding: 0; page-break-after: always; break-after: page; }
  .pick-page:last-child { page-break-after: auto; break-after: auto; }
  .pick-table th, .pick-table td { padding: 5px 6px; font-size: 12px; }
  .pick-table tr { break-inside: avoid; }
}

/* Créditos personales */
.credit-sim { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: var(--bg-soft, rgba(0,0,0,.03)); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.credit-sim > div { display: flex; flex-direction: column; gap: 2px; }
.credit-sim .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.credit-sim b { font-size: 20px; font-family: var(--font-display); }
.list-pop { margin-top: 6px; }
.pos-credit { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 600px) { .credit-sim { grid-template-columns: 1fr; } }

/* ---------- Tienda online · Diseño ---------- */
.design { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 44%); gap: 18px; align-items: start; }
.design-edit { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.design-edit .card h2 { margin: 0 0 4px; font-size: 18px; }
.design-edit .card > p.muted { margin: 0 0 12px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.preset { display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, transform .15s; }
.preset:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.preset.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.pr-mock { position: relative; display: block; height: 74px; border-radius: 8px; background: var(--b); overflow: hidden; border: 1px solid rgba(0,0,0,.06); }
.pr-mock i { position: absolute; display: block; font-style: normal; }
.pr-head { left: 0; right: 0; top: 0; height: 12px; background: var(--h); border-bottom: 1px solid rgba(0,0,0,.06); }
.pr-hero { left: 6px; right: 6px; top: 17px; height: 24px; border-radius: var(--r); background: linear-gradient(120deg, var(--p), var(--a)); font-size: 12px; font-weight: 700; padding: 4px 7px; line-height: 1.2; }
.pr-cards { left: 6px; right: 6px; top: 46px; height: 22px; display: flex !important; gap: 4px; position: absolute; }
.pr-cards i { position: static; flex: 1; border-radius: calc(var(--r) / 1.5); background: rgba(255,255,255,.9); border: 1px solid rgba(0,0,0,.07); }
.pr-btn { right: 9px; bottom: 9px; width: 18px; height: 8px; border-radius: 99px; background: var(--p); }
.pr-name { font-size: 14px; font-weight: 700; text-align: center; }
.colors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.color-pick { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.color-pick:hover { border-color: var(--line-strong); }
.color-pick input { width: 46px; height: 46px; border: 0; padding: 0; background: none; cursor: pointer; flex: none; border-radius: 8px; }
.color-pick input::-webkit-color-swatch-wrapper { padding: 0; }
.color-pick input::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.12); border-radius: 8px; }
.color-pick span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.color-pick small { color: var(--muted); font-size: 12px; }
.color-pick code { font-size: 12px; color: var(--ink-2); }
.seg { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { flex: 1; min-width: 0; border: 0; background: none; padding: 9px 8px; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--surface-2); }
.seg button.on { background: var(--ink); color: #fff; font-weight: 600; }
.seg.sm button { padding: 6px 10px; font-size: 13px; }
.seg svg { width: 16px; height: 16px; }
.logo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.logo-box { width: 220px; height: 110px; border-radius: var(--radius-sm); display: grid; place-items: center; padding: 12px; text-align: center;
  background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; border: 1px dashed var(--line-strong); }
.logo-box img { max-width: 100%; max-height: 86px; object-fit: contain; }
label.btn.loading { opacity: .55; pointer-events: none; }
.sl-item { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.sl-img { position: relative; height: 92px; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: var(--surface-2); display: grid; place-items: center; align-content: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; border: 1px dashed transparent; }
.sl-img.empty { border-color: var(--line-strong); }
.sl-img:hover { color: var(--ink); }
.sl-img img { width: 100%; height: 100%; object-fit: cover; }
.sl-img svg { width: 24px; height: 24px; }
.sl-img.loading { opacity: .5; pointer-events: none; }
.sl-fields { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sl-fields .grid { gap: 8px; }
.sl-fields .input { height: 38px; }
.sl-acts { display: flex; flex-direction: column; gap: 2px; }
.sl-none { display: flex; gap: 8px; align-items: center; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); }
.sl-none svg { width: 20px; height: 20px; }
.sec-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.sec-t { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.sec-t:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.sec-t input { width: 18px; height: 18px; accent-color: var(--ink); margin-top: 1px; flex: none; }
.sec-t span { display: flex; flex-direction: column; line-height: 1.3; }
.sec-t small { color: var(--muted); }
.design-save { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.design-save #dirty { margin-right: auto; }
.warn-txt { color: var(--warn) !important; font-weight: 600; }
.design-preview { position: sticky; top: calc(var(--topbar) + 12px); display: flex; flex-direction: column; gap: 8px; }
.pv-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pv-box { position: relative; height: calc(100dvh - var(--topbar) - 120px); min-height: 420px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface-2); box-shadow: var(--shadow); }
.pv-box iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; }
.pv-box.phone { display: grid; justify-items: center; background: linear-gradient(160deg, var(--surface-2), var(--line)); }
.pv-box.phone iframe { position: relative; top: 10px; left: auto; transform-origin: top center; border-radius: 26px; box-shadow: 0 0 0 8px #14110f, var(--shadow-lg); }
@media (max-width: 1150px) {
  .design { grid-template-columns: 1fr; }
  .design-preview { position: static; order: -1; }
  .pv-box { height: 460px; }
}
@media (max-width: 620px) {
  .colors, .sec-toggles { grid-template-columns: 1fr; }
  .sl-item { grid-template-columns: 1fr auto; }
  .sl-img { grid-column: 1 / -1; height: 120px; }
  .sl-acts { flex-direction: row; grid-column: 1 / -1; justify-content: flex-end; }
  .sl-fields { grid-column: 1 / -1; }
}

.fav-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow-y: auto; }
.fav-list .chip { text-decoration: none; font-weight: 500; }

/* Contabilidad */
.nowrap { white-space: nowrap; }
.alert > svg { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }
.card-title { margin: 0 0 10px; }
.acc-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.acc-period { display: flex; align-items: center; gap: 4px; }
.acc-period .input { width: auto; min-width: 150px; }
.acc-alerts { display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
.acc-alert { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 12px; padding: 10px 16px; font-size: 14px; }
.acc-alert + .acc-alert { border-top: 1px solid var(--line); }
.acc-alert > svg { width: 20px; height: 20px; }
.acc-alert.bad > svg { color: var(--bad); }
.acc-alert.warn > svg { color: var(--warn); }
.acc-alert.info > svg { color: var(--info); }
.acc-line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.acc-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-line.total { border-bottom: 0; border-top: 2px solid var(--line-strong); margin-top: 4px; padding-top: 10px; font-size: 15px; }
.acc-help summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.acc-help ol { margin: 12px 0 0; padding-left: 22px; line-height: 1.7; font-size: 14px; }
.acc-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; cursor: default; }
summary.acc-sec-head { cursor: pointer; }
.acc-sec-head h3 { margin: 0; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.acc-note { margin: 0; padding: 10px 16px 14px; }
.acc-pvnum { display: grid; grid-template-columns: 5fr auto 8fr; align-items: center; gap: 4px; }
.acc-party { position: relative; }
.acc-sugg { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; }
.acc-sugg button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 8px 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.acc-sugg button:hover { background: var(--surface-2); }
.acc-rates { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 14px; }
.acc-rates-head, .acc-rate { display: grid; grid-template-columns: 60px 1fr 1fr; gap: 10px; align-items: center; }
.acc-rates-head { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-bottom: 4px; }
.acc-rate { padding: 4px 0; }
.acc-rate > span:first-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.acc-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; margin: 4px 0 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.acc-total b { font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; }
.acc-pay { align-items: end; }
.acc-pay .check { padding-bottom: 10px; }
.acc-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acc-book td { vertical-align: top; }
@media (max-width: 700px) {
  .acc-top { flex-direction: column; align-items: stretch; }
  .acc-top { min-width: 0; max-width: 100%; }
  .acc-top .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; min-width: 0; max-width: 100%; }
  .acc-top .chip { white-space: nowrap; }
  .acc-period { justify-content: center; }
  .acc-alert { grid-template-columns: 22px 1fr; }
  .acc-alert .btn { grid-column: 2; justify-self: start; }
}

/* ---------- Contabilidad integral ---------- */
.acc-month { display: inline-flex; align-items: center; gap: 4px; }
.acc-month[hidden], #acc-branch-box[hidden] { display: none; }
.acc-period { flex-wrap: wrap; gap: 8px; }
.acc-branch { min-width: 190px; }
.amt-neg { color: var(--bad); }
.amt-pos { color: var(--ok); }
.acc-journal td svg { width: 16px; height: 16px; vertical-align: -3px; }
.acc-range .seg button, .acc-seg button { flex: none; padding: 9px 12px; }
.bad-text { color: var(--bad); }
.ok-text { color: var(--ok); }
.link { color: var(--info); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.input-suffix { position: relative; }
.input-suffix > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-suffix .input { padding-right: 28px; }
.acc-range { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.acc-range-nav { display: flex; align-items: center; gap: 6px; }
.acc-range-nav b { min-width: 150px; text-align: center; text-transform: capitalize; }
.acc-range-dates { display: flex; align-items: center; gap: 6px; }
.acc-range-dates .input { width: auto; }
.acc-qr { padding: 12px; margin-bottom: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.acc-qr .input-group .input { flex: 1; }
.acc-qr #qr-msg { margin-top: 6px; }
.acc-tpls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.acc-tpls .chip svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.acc-tpls .chip.done { opacity: .6; }
.acc-alloc { display: flex; flex-direction: column; gap: 8px; }
.acc-alloc-rows { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.acc-alloc-row { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; align-items: center; }
.acc-alloc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acc-alloc-foot span:last-child { margin-left: auto; }
.acc-drop { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); transition: border-color .15s, background .15s; }
.acc-drop > svg { width: 26px; height: 26px; color: var(--muted); flex: none; }
.acc-drop.over { border-color: var(--info); background: color-mix(in srgb, var(--info) 8%, transparent); }
.acc-drop-name { margin-top: 4px; color: var(--ok); }
.acc-pay .acc-cash { grid-column: 1 / -1; padding-bottom: 4px; }
.acc-pays { margin: 4px 0 14px; padding: 4px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.acc-pays .acc-sec-head { padding: 8px 0; }
.acc-payrow { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto auto; gap: 8px; align-items: center; margin-top: 10px; }
.table.compact td, .table.compact th { padding-top: 6px; padding-bottom: 6px; }
.acc-journal td { vertical-align: top; }
.acc-byacc summary { cursor: pointer; }
.acc-byacc .acc-line:first-of-type { margin-top: 8px; }
.acc-pl td, .acc-pl th { white-space: nowrap; }
.acc-pl .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 220px; white-space: normal; }
.acc-pl-sec td { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 14px; background: var(--surface); }
.acc-pl-sub td { font-weight: 700; border-top: 1px solid var(--line-strong); }
.acc-pl-res td { font-weight: 800; font-size: 15px; background: var(--surface-2); border-top: 2px solid var(--line-strong); }
.acc-pl-res td.sticky { background: var(--surface-2); }
.acc-alert.ok > svg { color: var(--ok); }
.card-title > svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }
@media (max-width: 700px) {
  .acc-payrow { grid-template-columns: 1fr 1fr; }
  .acc-alloc-row { grid-template-columns: 1fr 90px auto; }
  .acc-range-nav b { min-width: 0; }
  .acc-pl .sticky { min-width: 150px; }
  .acc-branch { min-width: 0; width: 100%; }
}

/* ---------- Cartel de consulta de precios (QR) ---------- */
.price-poster { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 22px; }
.price-poster .pp-title { font-family: var(--font-display); font-size: 40px; font-weight: 800; line-height: 1; }
.price-poster .pp-sub { font-size: 17px; max-width: 30ch; color: var(--muted); }
.price-poster .pp-qr svg { width: 260px; height: 260px; display: block; }
.price-poster .pp-steps { text-align: left; margin: 4px 0; padding-left: 22px; font-size: 15px; }
.price-poster .pp-name { font-weight: 700; font-size: 20px; }
.price-poster .pp-url { font-size: 11px; color: var(--muted); word-break: break-all; }
@media print {
  .price-poster { border: 0; box-shadow: none; min-height: 250mm; justify-content: center; gap: 8mm; }
  .price-poster .pp-title { font-size: 54pt; }
  .price-poster .pp-sub { font-size: 20pt; color: #000; }
  .price-poster .pp-qr svg { width: 120mm; height: 120mm; }
  .price-poster .pp-steps { font-size: 16pt; }
  .price-poster .pp-name { font-size: 22pt; }
  .grid:has(> .price-poster) { display: block; }
}

/* ---------- Lector de remitos (pantalla completa) ---------- */
body.sheet-open { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 90; background: var(--paper); overflow-y: auto; animation: fade .15s; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 19px; }
.sheet-body { max-width: 1240px; margin: 0 auto; padding: 16px; }
.remito-src h3 { display: flex; align-items: center; gap: 8px; }
.remito-src h3 svg { width: 18px; height: 18px; }
.remito-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.remito-thumb { position: relative; width: 78px; height: 100px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.remito-thumb img { width: 100%; height: 100%; object-fit: cover; }
.remito-thumb .pdf { display: grid; place-items: center; height: 100%; font-weight: 700; color: var(--bad); text-align: center; padding: 4px; }
.remito-thumb .pdf small { display: block; font-weight: 400; color: var(--muted); font-size: 10px; word-break: break-all; }
.remito-thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.remito-thumb button svg { width: 12px; height: 12px; }
.remito-rows { display: flex; flex-direction: column; gap: 8px; }
.remito-row { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(240px, 1.3fr) minmax(330px, 1.2fr); gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--radius); }
.remito-row.pending { border-left-color: var(--bad); }
.remito-row.new { border-left-color: var(--info); }
.remito-row.skip { border-left-color: var(--line-strong); opacity: .6; }
.remito-row:has(.badge.warn) { border-left-color: var(--warn); }
.rr-src .rr-desc { margin-top: 4px; word-break: break-word; }
.rr-cands { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rr-cands .chip { font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.rr-ops { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rr-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-content: start; }
.rr-nums label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.rr-nums .input { text-align: right; padding-left: 6px; padding-right: 6px; }
.rr-calc { grid-column: 1 / -1; text-align: right; }
.remito-row.match { background: var(--ok-soft); }
.rr-have { color: var(--ok); margin-top: 2px; }
.rr-bc { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); }
.rr-bc .input { padding: 6px 8px; font-size: 14px; }
.remito-rule { border-left: 4px solid var(--berry); }
.rr-sel { float: right; margin: -2px -4px 0 6px; padding: 4px; cursor: pointer; }
.rr-sel input { width: 18px; height: 18px; cursor: pointer; }
.remito-bulk { position: sticky; top: 68px; z-index: 1; border-left: 4px solid var(--info); box-shadow: var(--shadow); }
.remito-resume { border-left: 4px solid var(--warn); background: var(--warn-soft); }
@media (max-width: 1000px) {
  .remito-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Carga rápida de productos ---------- */
.quick-scan { display: flex; gap: 8px; align-items: center; }
.quick-scan .input { font-size: 18px; padding: 12px 14px 12px 40px; }
.quick-table td { vertical-align: top; }
.quick-table .input { min-width: 0; }
.quick-table tr.err td { background: var(--bad-soft); }
.quick-table tr.exists td { background: var(--info-soft); }
.quick-table tr.exists td:first-child { box-shadow: inset 4px 0 0 var(--info); }
.quick-table .quick-exists { color: var(--info); line-height: 1.35; }
.quick-table .quick-exists a { color: inherit; }
.quick-table .quick-add { border-color: var(--info); font-weight: 700; background: #fff; }
.quick-table .qc-sup { width: 130px; }
.quick-table input[data-f="code"] { min-width: 140px; }
.quick-table input[data-f="supplier_code"] { min-width: 100px; }
.quick-table input[data-f="name"], .quick-table .quick-exists { min-width: 230px; }
.quick-dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; border: 1px solid var(--line-strong); background: var(--surface); }
.quick-dot.exists { background: var(--info-soft); border-color: var(--info); }
.quick-table .qc-code { width: 150px; } .quick-table .qc-num { width: 105px; } .quick-table .qc-cat { width: 170px; }

/* ---------- Carga rápida de fotos (#/productos/fotos) ---------- */
.ph-work { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 14px; align-items: start; }
.ph-work.ph-busy { opacity: .55; pointer-events: none; }
.ph-product h2 { font-size: 20px; line-height: 1.25; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ph-actions .btn { flex: 1 1 auto; justify-content: center; }
.ph-drop { border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 18px; display: flex; gap: 10px; align-items: center; color: var(--muted, #666); background: var(--surface-2); }
.ph-drop svg { width: 28px; height: 28px; flex: none; }
.ph-drop:focus { outline: 2px solid var(--berry, #c2185b); outline-offset: 2px; }
.ph-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ph-num { position: absolute; top: 4px; left: 4px; z-index: 1; background: var(--ink, #222); color: #fff; font-weight: 700; font-size: 13px; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; }
.ph-bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.ph-bar > div { height: 100%; width: 0; background: var(--ok, #2e7d32); transition: width .3s; }
.ph-found { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ph-found-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ph-found-item img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 6px; }
kbd { font: 600 11px/1 ui-monospace, monospace; padding: 2px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface, #fff); }
@media (max-width: 900px) {
  .ph-work { grid-template-columns: 1fr; }
  .ph-product .ph-drop { display: none; }
}

/* ---------- Ayudas al cargar productos (v16) ---------- */
#assist-msg .alert, #dup-msg .alert { margin-top: 6px; padding: 8px 10px; font-size: 13px; }
.dup-alert a { font-weight: 600; }
tr.tpl-wh td:first-child { box-shadow: inset 3px 0 0 var(--berry, #c2185b); }
.var-table td { vertical-align: top; }
.var-table input[data-vf="name"] { min-width: 120px; }
.var-thumb { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 4px; border: 1px solid var(--line); flex: none; }
.quick-thumb { width: 28px; height: 28px; object-fit: contain; background: #fff; border-radius: 4px; border: 1px solid var(--line); vertical-align: middle; margin-right: 4px; }
.quick-table tr.similar td { background: var(--warn-soft); }
.pi-table td { vertical-align: top; }
.pi-table .pi-name { min-width: 220px; }
.pi-up { color: var(--bad); } .pi-down { color: var(--ok); }
.pi-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.pi-bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.pi-bar > div { height: 100%; width: 0; background: var(--ok, #2e7d32); transition: width .3s; }
.quick-table td:nth-child(2) { min-width: 230px; }
.quick-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; margin-top: 2px; }

/* ---------- Notificaciones internas (campanita) y pedido de reposición ---------- */
.bell { position: relative; }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--berry); color: var(--berry-ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; pointer-events: none; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 6px); width: min(380px, calc(100vw - 20px)); max-height: min(520px, 75dvh); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 60; overflow: hidden; }
.bell-head, .bell-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bell-foot { border-bottom: 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.bell-list { overflow-y: auto; }
.bell-item { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; cursor: pointer; font: inherit; }
.bell-item:hover { background: var(--surface-2); }
.bell-item.unread { background: var(--berry-soft); }
.bell-item.unread b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--berry); margin-right: 6px; vertical-align: middle; }
.bell-ico { flex: none; color: var(--muted); padding-top: 2px; }
.big-scan { height: 56px; font-size: 16px; width: 100%; justify-content: center; }
.rp-list .rp-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.rp-list .rp-line:last-child { border-bottom: 0; }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper .input { width: 58px; text-align: center; padding-left: 4px; padding-right: 4px; }
.text-bad { color: var(--bad); }
.scan-feed { min-height: 44px; }
.scan-last { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); font-weight: 600; }

/* Pagos informados por clientes (#/pagos-informados) */
.pr-list { display: grid; gap: 12px; }
.pr-card { display: flex; gap: 14px; align-items: flex-start; }
.pr-thumb { flex: none; width: 110px; height: 140px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--surface-2, #f6f5f3); color: var(--muted); text-decoration: none; }
.pr-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pr-thumb span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
@media (max-width: 600px) { .pr-thumb { width: 72px; height: 96px; } }

/* ---------- Boletas de compra (#/boletas) ---------- */
.bol-drop { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--surface-2); }
.bol-drop > svg { width: 30px; height: 30px; flex: none; color: var(--muted); }
.bol-drop.dropping { border-color: var(--ink); background: var(--surface); }
.bol-drop:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.bol-drop > .grow { flex: 1 1 260px; min-width: 0; }
.bol-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.bol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.bol-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.bol-card:hover { border-color: var(--line-strong); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.bol-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.bol-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.bol-pdf { display: grid; place-items: center; gap: 4px; color: var(--muted); }
.bol-pdf svg { width: 34px; height: 34px; }
.bol-pages { position: absolute; right: 6px; bottom: 6px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.bol-info { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; min-width: 0; }
.bol-sup { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bol-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.bol-mini { flex: none; width: 96px; display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
.bol-mini img, .bol-mini .bol-pdf { width: 96px; height: 120px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.bol-mini span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bol-seg button { white-space: normal; }
.bol-detail { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
.bol-view { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: auto; max-height: 70vh; display: grid; place-items: center; }
.bol-view img { display: block; max-width: 100%; height: auto; }
.bol-view iframe { width: 100%; height: 68vh; border: 0; background: #fff; }
@media (max-width: 700px) { .bol-drop { display: none; } }
@media (max-width: 900px) {
  .bol-detail { grid-template-columns: 1fr; }
  .bol-view { max-height: 55vh; }
  .bol-view iframe { height: 55vh; }
  .bol-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Transferencias entre depósitos (#/transferencias) — tarjetas grandes y botones +/− */
.text-ok { color: var(--ok); }
.link-btn { background: none; border: 0; padding: 4px 2px; color: var(--info); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn.danger { color: var(--bad); }
.tr-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 16px; border-radius: var(--radius); background: var(--berry); color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.tr-hero:hover { background: #8a0f35; }
.tr-hero b { display: block; font-size: 19px; }
.tr-hero span span { display: block; opacity: .9; font-size: 14px; }
.tr-hero > svg { width: 26px; height: 26px; flex: none; }
.tr-hero-ico { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.tr-hero-ico svg { width: 28px; height: 28px; }
.tr-list { display: grid; gap: 8px; }
.tr-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; text-align: left; width: 100%; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.tr-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.tr-item-route { font-size: 16px; }
.tr-mini-arrow { color: var(--berry); font-weight: 700; margin: 0 8px; }
.tr-item-meta { grid-column: 1; font-size: 13px; color: var(--muted); }
.tr-item-st { grid-column: 2; grid-row: 1 / span 2; }
.tr-step { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin: 0 0 10px; }
.tr-num { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 14px; flex: none; }
.tr-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin-bottom: 14px; }
.tr-wh { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 18px 14px; min-height: 150px; text-align: center; background: var(--surface); border: 2px solid var(--line-strong); border-radius: 14px; cursor: pointer; }
.tr-wh[disabled] { cursor: default; opacity: 1; }
.tr-wh:not([disabled]):hover { border-color: var(--ink); box-shadow: var(--shadow); }
.tr-wh.from { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); }
.tr-wh.to { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok-soft) 60%, var(--surface)); }
.tr-wh.empty { border-style: dashed; border-color: var(--berry); background: var(--berry-soft); animation: tr-pulse 1.6s ease-in-out infinite; }
@keyframes tr-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--berry) 18%, transparent); } }
.tr-wh-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tr-wh-ico { width: 52px; height: 52px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; }
.tr-wh-ico svg { width: 28px; height: 28px; }
.tr-wh.from .tr-wh-ico { color: var(--warn); }
.tr-wh.to .tr-wh-ico { color: var(--ok); }
.tr-wh.empty .tr-wh-ico { color: var(--berry); }
.tr-wh-name { font-size: 20px; line-height: 1.2; }
.tr-wh-type { font-size: 13px; color: var(--muted); }
.tr-wh-change { position: absolute; top: 8px; right: 10px; font-size: 12px; font-weight: 600; color: var(--info); }
.tr-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--berry); }
.tr-arrow svg { width: 56px; height: 28px; }
.tr-arrow .btn svg { width: 16px; height: 16px; }
.tr-wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tr-wh-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: center; font-size: 16px; }
.tr-wh-tile:hover { border-color: var(--ink); }
.tr-wh-tile.active { border-color: var(--berry); background: var(--berry-soft); }
.tr-lines { display: grid; gap: 8px; }
.tr-line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line-strong); border-radius: var(--radius); }
.tr-line.zero { opacity: .55; }
.tr-line.warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn-soft) 45%, var(--surface)); }
.tr-line.ok { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 55%, var(--surface)); }
.tr-line.ok.warn { border-left-color: var(--warn); }
.tr-line.flash { animation: tr-flash 1s ease-out; }
@keyframes tr-flash { 0% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 55%, transparent); } 100% { box-shadow: none; } }
.tr-line-info { flex: 1; min-width: 0; }
.tr-line-name { display: block; font-size: 16px; line-height: 1.25; }
.tr-line-stock { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.tr-line-alert { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--warn); display: flex; align-items: center; gap: 4px; }
.tr-line-alert svg { width: 15px; height: 15px; }
.tr-qty { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.tr-qty-links { display: flex; gap: 10px; }
.stepper.big .btn { width: 46px; height: 46px; }
.stepper.big .btn svg { width: 20px; height: 20px; }
.stepper.big .input { width: 72px; height: 46px; font-size: 20px; font-weight: 700; }
.tr-big-q { font-size: 24px; font-weight: 700; min-width: 56px; text-align: right; }
.tr-check { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; flex: none; }
.tr-check svg { width: 22px; height: 22px; }
.tr-line.ok .tr-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.tr-bar { display: flex; align-items: center; gap: 14px; }
.tr-total { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.tr-total b { font-size: 17px; }
.tr-total span { font-size: 13px; color: var(--muted); }
.tr-go { height: 52px; font-size: 16px; padding: 0 22px; }
.tr-sum-head { font-size: 15px; }
.tr-sum { border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 42vh; overflow: auto; }
.tr-sum-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tr-sum-row:last-child { border-bottom: 0; }
.tr-sum-row.warn { background: var(--warn-soft); }
.tr-sum-row svg { width: 16px; height: 16px; color: var(--warn); }
.tr-sum-q { min-width: 48px; text-align: right; font-weight: 700; font-size: 16px; }
.tr-timeline { display: flex; gap: 8px; margin-bottom: 14px; }
.tr-tl { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); color: var(--muted); }
.tr-tl-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-strong); font-weight: 700; flex: none; }
.tr-tl-dot svg { width: 18px; height: 18px; }
.tr-tl-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.tr-tl-text span { font-size: 12px; }
.tr-tl.done { background: var(--ok-soft); color: var(--ok); }
.tr-tl.done .tr-tl-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tr-tl.now { background: var(--warn-soft); color: var(--warn); }
.tr-tl.now .tr-tl-dot { border-color: var(--warn); color: var(--warn); }
.tr-action-card { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 14px; border-radius: var(--radius); border: 2px solid var(--berry); background: var(--berry-soft); }
.tr-action-card.recv { border-color: var(--ok); background: var(--ok-soft); }
.tr-progress { display: flex; align-items: center; gap: 10px; }
.tr-progress-bar { flex: 1; height: 10px; border-radius: 99px; background: rgba(0,0,0,.08); overflow: hidden; }
.tr-progress-bar span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .25s; }
@media (max-width: 700px) {
  .tr-route { grid-template-columns: 1fr; gap: 6px; }
  .tr-wh { min-height: 0; flex-direction: row; justify-content: flex-start; text-align: left; padding: 12px 14px; gap: 12px; }
  .tr-wh-label { position: absolute; top: 6px; left: 78px; font-size: 10px; }
  .tr-wh-name { font-size: 17px; margin-top: 10px; }
  .tr-wh-type { display: none; }
  .tr-wh-ico { width: 46px; height: 46px; }
  .tr-arrow { flex-direction: row; }
  .tr-arrow svg { transform: rotate(90deg); width: 34px; height: 22px; }
  .tr-line { flex-wrap: wrap; }
  .tr-qty { width: 100%; flex-direction: row; justify-content: space-between; }
  .tr-line.recv { flex-wrap: nowrap; gap: 8px; }
  .tr-line.recv .tr-qty { width: auto; }
  .tr-line.recv .stepper.big .btn { width: 38px; }
  .tr-line.recv .stepper.big .input { width: 52px; font-size: 18px; }
  .tr-line.recv .tr-check { width: 34px; height: 34px; }
  .tr-timeline { gap: 4px; }
  .tr-tl { flex-direction: column; text-align: center; gap: 4px; padding: 8px 4px; }
  .tr-tl-text span { display: none; }
  .tr-action-card { flex-direction: column; align-items: stretch; }
  .tr-go { padding: 0 14px; }
}
@media print { .tr-hero, .tr-action-card, .tr-check, .stepper, .tr-wh-change, .tr-arrow .btn { display: none !important; } }

/* ===== Historial de movimientos de mercadería (#/historial-stock) — línea de tiempo por día ===== */
.center { text-align: center; }
.mh-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 14px; border-radius: var(--radius); background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.mh-hero b { display: block; font-size: 19px; }
.mh-hero span span { display: block; opacity: .85; font-size: 14px; }
.mh-filters { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; max-width: 100%; overflow: hidden; gap: 10px; margin-bottom: 18px; padding: 14px 16px; }
.mh-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mh-dates { display: inline-flex; align-items: center; gap: 8px; }
.mh-dates[hidden] { display: none; }
.mh-dates .input { width: auto; }
.mh-selects .search { flex: 1 1 260px; }
.mh-selects select.input { width: auto; flex: 0 1 220px; }
.mh-chip { display: inline-flex; align-items: center; gap: 6px; }
.mh-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.chip.active .mh-dot { box-shadow: 0 0 0 2px #fff; }
.mh-day { margin-bottom: 22px; }
.mh-day-title { font-family: var(--font-display); font-size: 19px; margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; }
.mh-timeline { position: relative; display: grid; gap: 8px; padding-left: 22px; }
.mh-timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.mh-ev { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mh-ev::before { content: ""; position: absolute; left: -20px; top: 24px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.mh-ev.open { border-color: var(--ink); box-shadow: var(--shadow); }
.mh-ev.open::before { background: var(--ink); border-color: var(--ink); }
.mh-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; width: 100%; padding: 12px 14px; background: none; border: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.mh-head:hover .mh-title { text-decoration: underline; text-underline-offset: 3px; }
.mh-ico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.mh-ico svg { width: 22px; height: 22px; }
.mh-body { display: grid; gap: 2px; min-width: 0; }
.mh-title { font-weight: 700; font-size: 15.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.mh-route { font-size: 15px; }
.mh-in { color: var(--ok); font-weight: 600; }
.mh-out { color: var(--warn); font-weight: 600; }
.mh-note { font-size: 13.5px; color: var(--ink-2); font-style: italic; }
.mh-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.mh-meta svg { width: 14px; height: 14px; }
.mh-meta b { color: var(--ink-2); }
.mh-chev svg { width: 20px; height: 20px; color: var(--muted); transition: transform .15s; transform: rotate(90deg); }
.mh-ev.open .mh-chev svg { transform: rotate(-90deg); }
.mh-detail { padding: 4px 14px 14px; border-top: 1px dashed var(--line); }
.mh-people { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 0 6px; font-size: 14px; }
.mh-table { margin-top: 6px; }
.mh-table td, .mh-table th { padding-top: 8px; padding-bottom: 8px; }
.mh-qty { display: inline-block; min-width: 54px; padding: 3px 10px; border-radius: 999px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.mh-qty.up { background: var(--ok-soft); color: var(--ok); }
.mh-qty.down { background: var(--warn-soft); color: var(--warn); }
.mh-diff td { background: var(--bad-soft); }
.mh-diff-note { color: var(--bad); font-weight: 600; }
.mh-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.k-ok { background: var(--ok-soft); color: var(--ok); }
.k-warn { background: var(--warn-soft); color: var(--warn); }
.k-bad { background: var(--bad-soft); color: var(--bad); }
.k-info { background: var(--info-soft); color: var(--info); }
.k-berry { background: var(--berry-soft); color: var(--berry); }
.k-muted { background: var(--surface-2); color: var(--muted); }
.mh-dot.k-ok { color: var(--ok); } .mh-dot.k-warn { color: var(--warn); } .mh-dot.k-bad { color: var(--bad); }
.mh-dot.k-info { color: var(--info); } .mh-dot.k-berry { color: var(--berry); } .mh-dot.k-muted { color: var(--muted); }
@media (max-width: 900px) {
  .mh-hero { padding: 14px 16px; }
  .mh-hero b { font-size: 17px; }
  .mh-hero .tr-hero-ico { display: none; }
  .mh-filters { padding: 12px; }
  .mh-filters .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; max-width: 100%; }
  .mh-selects { display: grid; grid-template-columns: minmax(0, 1fr); }
  .mh-selects .search, .mh-selects select.input { width: 100%; min-width: 0; }
  .mh-dates { width: 100%; } .mh-dates .input { flex: 1; min-width: 0; }
  .mh-filters .chip { white-space: nowrap; }
  .mh-timeline { padding-left: 16px; }
  .mh-timeline::before { left: 4px; }
  .mh-ev::before { left: -17px; }
  .mh-head { gap: 10px; padding: 12px; }
  .mh-ico { width: 36px; height: 36px; }
}

/* ---------- Estadísticas (#/estadisticas) ---------- */
.st-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; }
.st-range { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-range .input { width: auto; }
.st-delta { display: inline-block; font-weight: 700; font-size: 12px; padding: 1px 6px; border-radius: 999px; margin-right: 4px; }
.st-delta.up { color: var(--ok); background: var(--ok-soft); }
.st-delta.down { color: var(--bad); background: var(--bad-soft); }
.st-h { font-family: var(--font-display); font-size: 20px; margin: 4px 0 10px; }
.st-h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
.st-hls { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.st-hl { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.st-hl .label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.st-hl-ic { flex: 0 0 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--berry-soft); color: var(--berry); }
.st-hl-ic svg { width: 20px; height: 20px; }
.st-hl-v { font-weight: 700; font-size: 16px; line-height: 1.25; margin: 2px 0; overflow-wrap: anywhere; }
.st-card-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.st-card-h h3 { margin: 0; font-size: 16px; }
.st-svg { width: 100%; height: auto; display: block; overflow: visible; }
.st-svg .st-grid { stroke: var(--line); stroke-width: 1; }
.st-svg .st-base { stroke: var(--line-strong); stroke-width: 1; }
.st-svg .st-axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.st-svg .st-hit { fill: transparent; }
.st-svg .st-mark { fill: #d98aa3; transition: fill .12s; }
.st-svg .st-bar.hi .st-mark { fill: var(--berry); }
.st-svg .st-bar:hover .st-mark { fill: #7d0d30; }
.st-svg .st-bar:hover .st-hit { fill: rgba(20, 17, 15, .04); }
.st-tip { position: fixed; z-index: 1000; pointer-events: none; max-width: 300px; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.35; padding: 7px 10px; border-radius: 8px; box-shadow: var(--shadow-lg); }
.st-rank { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.st-rank li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 6px; border-radius: var(--radius-sm); }
.st-rank li.clickable { cursor: pointer; }
.st-rank li.clickable:hover { background: var(--paper); }
.st-pos { flex: 0 0 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.st-rank li:first-child .st-pos, .st-rank li.hi .st-pos { background: var(--berry); border-color: var(--berry); color: #fff; }
.st-rk-body { flex: 1; min-width: 0; }
.st-rk-top { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; }
.st-rk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-rk-val { white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-rk-bar { height: 6px; background: var(--paper); border-radius: 999px; margin: 4px 0 2px; overflow: hidden; }
.st-rk-bar span { display: block; height: 100%; background: #d98aa3; border-radius: 999px; }
.st-rank li:first-child .st-rk-bar span, .st-rank li.hi .st-rk-bar span { background: var(--berry); }
.st-heat { display: grid; gap: 3px; overflow-x: auto; }
.st-heat-h, .st-heat-d { font-size: 11px; color: var(--muted); text-align: center; align-self: center; }
.st-heat-d { text-align: left; font-weight: 600; }
.st-heat-c { height: 26px; border-radius: 4px; background: var(--paper); border: 1px solid var(--line); }
.st-heat-c[style*="rgba"] { border-color: transparent; }
.st-heat-c:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.st-heat-legend { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 10px; }
.st-heat-legend i { width: 22px; height: 12px; border-radius: 3px; display: inline-block; }
@media (max-width: 700px) {
  .st-filters { flex-direction: column; align-items: stretch; }
  .st-filters > * { min-width: 0; max-width: 100%; }
  .st-filters .chip { padding: 5px 10px; }
  .st-range { display: grid; grid-template-columns: auto 1fr; }
  .st-range .input { min-width: 0; width: 100%; }
  .st-range select.input { grid-column: 1 / -1; }
  .st-filters { min-width: 0; }
  .st-heat-c { height: 20px; }
}

/* Registro de clientes por QR (#/registro-qr): vista previa en un celular */
.sq-preview { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.sq-phone { width: 375px; max-width: 100%; height: 700px; margin: 0 auto; border: 10px solid #1d1b1a; border-radius: 38px; overflow: hidden; background: #fff; box-shadow: 0 14px 40px rgba(0,0,0,.18); }
.sq-phone iframe { width: 100%; height: 100%; border: 0; display: block; }
@media print { .grid:has(.price-poster) { display: block; } }

/* ===== Personal: fichaje de empleados (#/personal, #/mi-asistencia y /fichar/) ===== */
.att-tabs { overflow-x: auto; flex-wrap: nowrap; }
.att-tabs button { flex: 1 0 auto; }
.att-punch { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.att-punch.working { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.att-punch-top { display: flex; align-items: flex-start; gap: 12px; }
.att-punch-top > div:first-child { flex: 1; min-width: 0; }
.att-hello { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.15; }
.att-clock { font-family: var(--font-display); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.att-big { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 88px; border: 0; border-radius: 20px; font-size: 24px; font-weight: 800; letter-spacing: .01em; color: #fff; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.12); transition: transform .08s; }
.att-big:active { transform: scale(.98); }
.att-big:disabled { opacity: .85; cursor: progress; }
.att-big.in { background: var(--ok); }
.att-big.out { background: var(--bad); }
.att-big svg { width: 30px; height: 30px; }
.att-big .spinner { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
.att-big #att-busy { font-size: 18px; font-weight: 650; }
.att-msg { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; }
.att-msg svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.att-today { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.att-shifts { display: flex; flex-wrap: wrap; gap: 6px; }
.att-shift { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.att-shift.in { background: var(--ok-soft); color: var(--ok); }
.att-shift.out { background: var(--info-soft); color: var(--info); }
.att-shift.open { background: var(--bad-soft); color: var(--bad); }
.att-shift.manual { outline: 1px dashed var(--line-strong); }
.att-month-nav { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 18px 0 10px; }
.att-month-nav.left { justify-content: flex-start; margin-top: 4px; flex-wrap: wrap; }
.att-month-nav h2 { margin: 0; font-family: var(--font-display); font-size: 22px; text-transform: capitalize; min-width: 150px; text-align: center; }
.att-month-nav.left h2 { text-align: left; min-width: 0; }
.att-kpis .stat .value { font-size: 24px; }
.att-of { font-size: 16px; color: var(--muted); font-weight: 500; }
.att-meet { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 650; margin-top: 2px; }
.att-meet svg { width: 15px; height: 15px; flex: none; }
.att-meet.ok { color: var(--ok); } .att-meet.bad { color: var(--bad); } .att-meet.warn { color: var(--warn); }
.att-pres-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, var(--line)); }
.att-pres-bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, var(--line)); }
.att-days { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.att-day { display: flex; gap: 12px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--surface); min-height: 48px; }
.att-day:first-child { border-top: 0; }
.att-day.off { background: var(--surface-2); }
.att-day.is-today { box-shadow: inset 3px 0 0 var(--berry); }
.att-day.clickable { cursor: pointer; }
.att-day.clickable:hover { background: color-mix(in srgb, var(--berry) 5%, var(--surface)); }
.att-day-d { width: 38px; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.att-day-d b { font-size: 18px; font-variant-numeric: tabular-nums; }
.att-day-d span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.att-day-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.att-day-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.att-late { color: var(--warn); display: inline-flex; gap: 4px; align-items: center; }
.att-late svg { width: 13px; height: 13px; }
.att-abs-list { display: flex; flex-direction: column; gap: 8px; }
.att-abs { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.att-abs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.att-abs-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.att-files { display: flex; flex-wrap: wrap; gap: 6px; }
.att-files .chip { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; font-weight: 500; }
.att-files .chip svg { width: 14px; height: 14px; }
.att-file-pick { display: block; border: 2px dashed var(--line-strong); border-radius: 14px; padding: 18px; text-align: center; cursor: pointer; }
.att-file-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.att-file-pick span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.att-file-pick svg { width: 28px; height: 28px; color: var(--berry); }
.att-dows, .att-emp-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.att-dows .chip { min-width: 52px; text-align: center; }
.att-cred { display: flex; justify-content: center; gap: 28px; padding: 14px; background: var(--surface-2); border-radius: var(--radius); }
.att-cred div { display: flex; flex-direction: column; gap: 2px; }
.att-cred b { font-size: 30px; letter-spacing: .08em; }
.att-cert-prev { display: flex; gap: 8px; flex-wrap: wrap; }
.att-cert-prev img { max-height: 220px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.att-start ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.att-sum td { vertical-align: top; }
.att-poster .pp-qr svg { width: 100%; height: auto; max-width: 260px; }
@media (max-width: 640px) {
  .att-tabs button span { display: none; }
  .att-big { min-height: 96px; font-size: 22px; }
  .att-abs { flex-direction: column; }
}

/* ===== Personal: sueldos ===== */
.att-slip td { padding: 7px 6px; }
.att-slip .att-slip-total td { border-top: 2px solid var(--line); }
.att-slip-total-box { background: var(--bg-soft, rgba(0,0,0,.03)); display: flex; flex-direction: column; gap: 6px; }
.pr-item .input { min-width: 0; }
@media (max-width: 640px) { .pr-item { flex-wrap: wrap; } .pr-item [data-k="concept"] { flex-basis: 100%; order: -1; } }
.pr-pair { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 6px; }
.pr-pair.wide { grid-template-columns: 150px minmax(0, 1fr); }

/* ===== Personal: horarios por día ===== */
.sch-week { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sch-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px 150px; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); }
.sch-row:first-child { border-top: 0; }
.sch-row.off { background: var(--bg-soft, rgba(0,0,0,.03)); }
.sch-day { min-width: 0; justify-content: center; }
.sch-blocks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.sch-block { display: inline-flex; align-items: center; gap: 6px; }
.sch-time { width: 124px; padding-left: 8px; padding-right: 4px; }
.sch-h { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.sch-copy { text-align: right; }
.sch-foot { margin-top: 6px; }
.sch-special { grid-template-columns: 150px minmax(0, 1fr) 170px 40px; }
.att-plan .badge { font-size: 11px; }
@media (max-width: 760px) {
  .sch-row, .sch-special { grid-template-columns: 56px minmax(0, 1fr); }
  .sch-h, .sch-copy { grid-column: 2; text-align: left; }
  .sch-h:empty, .sch-copy:empty { display: none; }
  .sch-time { width: 108px; }
  .sch-special .sch-date { grid-column: 1 / -1; }
  .sch-special .sch-note { grid-column: 1 / 3; }
}

/* ---------- Mercado Pago: aviso de pago y movimientos ---------- */
.mp-stack { position: fixed; top: 64px; right: 16px; z-index: 260; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
@media (max-width: 900px) { .mp-stack { top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; width: auto; } }
.mp-card { pointer-events: auto; cursor: pointer; background: #fff; color: #1a1a1a; border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 40, 80, .22), 0 2px 6px rgba(0, 0, 0, .08); border: 1px solid #d9eefa;
  transform: translateX(24px); opacity: 0; transition: transform .25s ease, opacity .25s ease; }
.mp-card.in { transform: none; opacity: 1; }
.mp-card.out { transform: translateX(24px); opacity: 0; }
.mp-card-head { display: flex; align-items: center; gap: 8px; background: #009ee3; color: #fff; padding: 8px 10px 8px 12px; font-size: 13px; font-weight: 600; }
.mp-card-head svg { width: 20px; height: 20px; flex: none; }
.mp-card-time { font-weight: 400; opacity: .85; margin-left: auto; }
.mp-card-x { background: none; border: 0; color: #fff; padding: 2px; cursor: pointer; display: grid; place-items: center; opacity: .85; }
.mp-card-x svg { width: 16px; height: 16px; }
.mp-card-body { padding: 12px 14px 14px; }
.mp-card-label { font-size: 13px; color: #555; }
.mp-card-amount { font-size: 26px; font-weight: 700; letter-spacing: -.5px; color: #00a650; line-height: 1.15; }
.mp-card-detail { font-size: 14px; color: #333; margin-top: 2px; }
.bell-ico.mp { background: #009ee3; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; }
.bell-ico.mp svg { width: 22px; height: 22px; }
.mp-kind { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #e6f6fd; color: #0077b0; white-space: nowrap; }
.mp-kind.k-transferencia, .mp-kind.k-transferencia_mp { background: #e6f7ee; color: #00804a; }
.mp-kind.k-point { background: #f1ecfd; color: #5b3cc4; }
.mp-kind.k-link { background: #fff4e0; color: #9a5b00; }
.mp-amount { font-weight: 700; color: #00a650; white-space: nowrap; }
.mp-amount.off { color: var(--muted, #777); text-decoration: line-through; font-weight: 500; }
.mp-row { cursor: pointer; }
.mp-row:hover { background: var(--surface-2); }
.mp-row.unchecked td:first-child { box-shadow: inset 3px 0 0 #009ee3; }
.mp-head { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #009ee3, #0077c8); color: #fff; border-radius: var(--radius); padding: 16px 18px; }
.mp-head svg { width: 38px; height: 38px; flex: none; }
.mp-head .btn { background: #fff; color: #0077c8; border-color: #fff; }
.mp-head .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.mp-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.mp-dl dt { color: var(--muted, #777); }
.mp-dl dd { margin: 0; word-break: break-word; }

.mp-head .btn svg { width: 16px; height: 16px; }
.mp-head { flex-wrap: wrap; }
@media (max-width: 700px) {
  .mp-head > svg { width: 30px; height: 30px; }
  .mp-head > .grow { flex: 1 1 calc(100% - 50px); }
  .mp-head > .row { width: 100%; justify-content: flex-start !important; }
}

/* ---------- Envíos y repartos (#/repartos, #/reparto) ---------- */
.dv-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; flex: none; }
.dv-ghead { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dv-zsel { min-width: 120px; padding: 4px 8px; font-size: 13px; height: auto; }
.dv-routes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.dv-route { text-align: left; cursor: pointer; font: inherit; color: inherit; border: 1px solid var(--line); }
.dv-route:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.dv-prog { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.dv-prog span { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }
.dv-stops { display: grid; gap: 8px; }
.dv-stop { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.dv-stop.entregado { background: var(--ok-soft); border-color: transparent; }
.dv-stop.no_entregado { background: var(--bad-soft); border-color: transparent; }
.dv-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--ink); color: #fff; font-size: 14px; }
.dv-stop.entregado .dv-num, .dv-mstop.entregado .dv-num { background: var(--ok); }
.dv-stop.no_entregado .dv-num, .dv-mstop.no_entregado .dv-num { background: var(--bad); }
.dv-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 46%; }
.dv-notify { display: grid; gap: 6px; }
.dv-notify .btn.done { opacity: .5; }
.dv-addlist { display: grid; gap: 4px; max-height: 60vh; overflow: auto; }
.dv-addrow { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.dv-day { display: inline-flex; gap: 4px; align-items: center; }
.dv-day input { margin: 0; }
.dv-oinfo { padding: 10px 14px; }
.dv-tl { list-style: none; margin: 10px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.dv-tl li { position: relative; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dv-tl li::before { content: ''; position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.dv-tl li.st::before { background: var(--berry); }
/* Mi reparto (celular) */
.dv-mroute { max-width: 640px; margin-left: auto; margin-right: auto; }
.dv-mstop { margin-bottom: 10px; display: grid; gap: 8px; }
.dv-mstop.entregado, .dv-mstop.no_entregado { opacity: .75; }
.dv-mhead { display: flex; gap: 10px; align-items: center; }
.dv-addr { display: flex; gap: 8px; align-items: flex-start; font-size: 16px; font-weight: 600; color: var(--info); text-decoration: none; }
.dv-addr svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.dv-note { background: var(--surface-2); padding: 6px 10px; border-radius: var(--radius-sm); }
.dv-collect { background: var(--warn-soft); color: var(--warn); padding: 8px 12px; border-radius: var(--radius-sm); display: flex; gap: 8px; align-items: center; font-size: 15px; }
.dv-collect svg { width: 18px; height: 18px; }
.dv-mbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.dv-mbtns .btn { flex: 1 1 auto; justify-content: center; }
.dv-mbtns .btn.big { flex: 1 1 45%; min-height: 48px; font-size: 16px; }
@media (max-width: 720px) {
  .dv-stop { flex-wrap: wrap; }
  .dv-acts { max-width: none; width: 100%; justify-content: flex-start; padding-left: 38px; }
}

/* ===== Registro de acciones de usuarios (#/registro-acciones) — usa la línea de tiempo mh-* del historial ===== */
.au-hero { background: linear-gradient(120deg, var(--ink), #3b2a4a); }
.au-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 700; text-align: center; }
.chip.active .au-count { background: rgba(255, 255, 255, .25); color: inherit; }
.au-alerts { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.au-text { font-size: 14.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.au-target { font-weight: 600; color: var(--ink-2); }
.au-ev.au-alert { border-left: 4px solid var(--bad); }
.au-table { margin-top: 8px; font-size: 14px; }
.au-table td:first-child { color: var(--muted); width: 38%; }
.au-old { color: var(--bad); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
.au-new { color: var(--ok); font-weight: 600; }
@media (max-width: 900px) {
  .au-alerts { width: 100%; }
  .au-table td:first-child { width: auto; }
}

/* objetivos de vendedores (#/vendedores?tab=objetivos y Mi objetivo) */
.goal-bar { position: relative; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: visible; margin-top: 5px; }
.goal-bar.big { height: 16px; margin: 10px 0 4px; }
.goal-bar > span { display: block; height: 100%; border-radius: 99px; transition: width .3s; }
.goal-bar > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--muted); border-radius: 2px; opacity: .7; }
.goal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 10px; }
.goal-big { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.goal-pct { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1; }
.goal-next { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; }
.goal-next svg { width: 16px; height: 16px; vertical-align: -3px; }
.goal-me { background: var(--berry-soft); }
