/* ===== Catálogo Zapatería ===== */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --ink: #16263a;
  --muted: #5e6275;
  --line: #d9e5ee;
  --primary: #1a91da;
  --primary-ink: #ffffff;
  --primary-text: #0b6aa6;
  --primary-soft: #e2f1fb;
  --accent: #f2a41b;
  --accent-ink: #1a1c2e;
  --wa: #1d9f50;
  --wa-ink: #ffffff;
  --ok: #17803d;
  --ok-soft: #e3f5e9;
  --danger: #c4302b;
  --danger-soft: #fdeceb;
  --warn-soft: #fff4dc;
  --warn-ink: #7a4b00;
  --img-bg: #ffffff;
  --radius: 14px;
  --radius-sm: 9px;
  --font-head: "Familjen Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
}
img { max-width: 100%; display: block; }
a { color: var(--primary-text); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1.5px solid transparent; border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-outline { border-color: var(--primary); color: var(--primary-text); background: transparent; }
.btn-outline:hover { background: var(--primary-soft); filter: none; }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-line { background: transparent; border: 1.5px dashed var(--line); color: var(--ink); min-height: 38px; font-weight: 600; }
.btn-line:hover { border-color: var(--primary); color: var(--primary-text); filter: none; }
.btn-wa { background: var(--wa); color: var(--wa-ink); width: 100%; margin-top: auto; padding: 0 10px; font-size: .95rem; white-space: nowrap; }
.btn-block { width: 100%; }

/* ---------- Catálogo: encabezado ---------- */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.head-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; min-width: 0; }
.brand-text { display: grid; min-width: 0; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.25rem, 3vw, 1.6rem); color: var(--ink); letter-spacing: -.01em; }
.brand-tag { color: var(--muted); font-size: .92rem; }
.logo { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; flex: none; }
.logo-ph {
  display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink);
  font-family: var(--font-head); font-weight: 700; font-size: 1.6rem;
}

/* ---------- Filtros ---------- */
.filters {
  display: grid; gap: 10px;
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(140px, 1fr)) auto;
  margin: 24px 0 8px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.filters select, .search {
  min-height: 46px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
}
.filters select { padding: 0 12px; min-width: 0; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; min-height: 44px; color: var(--ink); }
.search:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
@media (max-width: 1240px) {
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
  .filters .search { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search { grid-column: 1 / -1; }
  .filters .btn { grid-column: 1 / -1; }
}
@media (max-width: 480px) { .filters { grid-template-columns: 1fr; } }

.count { color: var(--muted); margin: 14px 2px 18px; }
.count strong { color: var(--ink); }
.count a { margin-left: 10px; font-weight: 600; }

/* ---------- Tarjetas ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); padding-bottom: 48px; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.card-img { position: relative; aspect-ratio: 1 / 1; background: var(--img-bg); display: grid; place-items: center; }
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.noimg { font-size: 4rem; opacity: .35; }
.ribbon {
  position: absolute; top: 12px; left: 12px;
  background: var(--ink); color: var(--surface);
  font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px; flex: 1; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-text); }
.badge-soft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.card-brand { margin: 4px 0 0; color: var(--muted); font-size: .88rem; font-weight: 600; }
.card-title { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.card-meta, .stock, .colors, .desc { margin: 0; color: var(--muted); font-size: .9rem; }
.price { margin: 4px 0 0; font-family: var(--font-head); font-size: 1.55rem; font-weight: 700; color: var(--primary-text); letter-spacing: -.01em; }
.stock-out { color: var(--danger); font-weight: 600; }

/* Talles: el elemento protagonista */
.sizes { border: 0; padding: 0; margin: 8px 0 2px; }
.sizes legend { font-size: .88rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; padding: 0; }
.size-list { display: flex; flex-wrap: wrap; gap: 6px; }
.size { position: relative; }
.size input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.size span {
  display: grid; place-items: center; min-width: 44px; height: 40px; padding: 0 8px;
  border: 1.5px solid var(--line); border-radius: 8px;
  font-family: var(--font-head); font-weight: 700; font-size: .98rem;
  background: var(--surface); transition: background .12s, border-color .12s;
}
.size:hover span { border-color: var(--primary); }
.size input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.size input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.size-out span { color: var(--muted); text-decoration: line-through; opacity: .55; }
.size-out input { cursor: not-allowed; }
.size-out:hover span { border-color: var(--line); }

.pay { display: grid; gap: 4px; margin: 8px 0 12px; font-size: .88rem; color: var(--muted); }
.pay select { min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); width: 100%; }
.card-body > .btn-wa { margin-top: auto; }
.sizes + .btn-wa, .desc + .btn-wa, .colors + .btn-wa, .stock + .btn-wa { margin-top: 14px; }

.empty { text-align: center; padding: 64px 16px 80px; color: var(--muted); }
.empty-ico { font-size: 3.5rem; }
.empty p { margin: 8px 0 18px; }

.site-foot { border-top: 1px solid var(--line); padding: 24px 0 32px; text-align: center; color: var(--muted); font-size: .92rem; }
.site-foot p { margin: 2px 0; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #2aa3ea 0%, #1286cf 100%); }
.login-card {
  width: min(400px, 100%); background: var(--surface); border-radius: var(--radius);
  padding: 32px 28px; box-shadow: 0 20px 50px rgba(6, 50, 90, .28);
}
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .logo { width: 44px; height: 44px; }
.login-name { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.name-2 { color: var(--accent); }
.login-sub { color: var(--muted); margin: 8px 0 22px; }
.login-back { display: block; text-align: center; margin-top: 22px; color: var(--muted); text-decoration: none; }
.login-back:hover { color: var(--ink); }

/* ---------- Formularios ---------- */
.stack { display: grid; gap: 14px; }
.fld { display: grid; gap: 6px; min-width: 0; }
.fld > span { font-size: .9rem; font-weight: 700; color: var(--ink); }
.fld input, .fld select, .fld textarea, .rows input {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
.fld textarea { resize: vertical; }
.fld input[readonly] { background: var(--surface-2); color: var(--muted); }
.fld input[type="file"] { border: 0; padding: 0; min-height: 0; background: transparent; }
.hint { color: var(--muted); font-size: .85rem; margin: 0; font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.photo {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.photo img { width: 88px; height: 88px; object-fit: contain; background: var(--img-bg); border-radius: 8px; }
.photo img[hidden] { display: none; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 14px; font-weight: 500; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-warn { background: var(--warn-soft); color: var(--warn-ink); }
.alert-warn a { color: inherit; font-weight: 700; }

/* ---------- Panel ---------- */
.adm-head { background: var(--primary); color: var(--primary-ink); }
.adm-head-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; flex-wrap: wrap; }
.adm-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.adm-brand .logo { width: 44px; height: 44px; background: #fff; }
.adm-brand .logo-ph { background: var(--accent); color: var(--accent-ink); }
.adm-name { font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; }
.adm-brand small { opacity: .75; }
.adm-nav { display: flex; align-items: center; gap: 16px; }
.adm-nav a { color: inherit; text-decoration: none; font-weight: 600; }
.adm-nav a:hover { text-decoration: underline; }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; min-height: 40px; }
.adm-main { padding: 22px 0 60px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 12px 16px; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-color: var(--accent); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search-sm { min-height: 44px; flex: 1; max-width: 340px; background: var(--surface); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tbl { width: 100%; border-collapse: collapse; min-width: 860px; }
.tbl th { text-align: left; font-size: .88rem; color: var(--ink); background: var(--primary-soft); padding: 12px; font-weight: 700; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; font-size: .95rem; }
.tbl tr[hidden] { display: none; }
.tbl-empty { text-align: center; color: var(--muted); padding: 36px 12px !important; }
.thumb { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: var(--img-bg); display: grid; place-items: center; }
.thumb-ph { font-size: 1.4rem; background: var(--surface-2); }
.t-name { display: block; font-weight: 600; }
.t-sub { color: var(--muted); font-size: .85rem; }
.t-out { color: var(--danger); font-weight: 700; }
.nowrap { white-space: nowrap; }
.ta-r { text-align: right !important; }
.pill { border: 0; border-radius: 999px; padding: 4px 12px; font-size: .82rem; font-weight: 700; cursor: pointer; }
.pill-on { background: #1f9d55; color: #fff; }
.pill-off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.actions form { margin: 0; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--primary-text); cursor: pointer;
}
.icon-btn:hover { background: var(--primary-soft); }
.icon-danger { color: var(--danger); }
.icon-danger:hover { background: var(--danger-soft); }

/* Configuración */
.cfg-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel h2 { font-size: 1.2rem; margin-bottom: 14px; }
.panel > .hint { margin: -6px 0 14px; }

/* ---------- Diálogo de producto ---------- */
.dlg {
  width: min(720px, 100% - 24px); max-height: calc(100vh - 32px);
  padding: 0; border: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
.dlg::backdrop { background: rgba(8, 30, 50, .55); }
.dlg-form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 1.3rem; }
.dlg-x { border: 0; background: transparent; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--muted); width: 40px; height: 40px; border-radius: 8px; }
.dlg-x:hover { background: var(--surface-2); color: var(--ink); }
.dlg-body { overflow-y: auto; padding: 18px 22px; display: grid; gap: 18px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid-form { grid-template-columns: 1fr; } }

.block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin: 0; display: grid; gap: 10px; }
.block legend { font-weight: 700; padding: 0 6px; font-size: .95rem; }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); }
.chip-btn { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.chip-btn:hover { border-color: var(--primary); color: var(--primary-text); }
.rows { display: grid; gap: 8px; }
.rows:empty { display: none; }
.rows-sizes { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row input { min-height: 40px; flex: 1; min-width: 70px; }
.rows-sizes .row input.sz { flex: 0 0 76px; font-weight: 700; }
.row .in { flex: 0 0 90px; }
.row .x { color: var(--muted); font-size: .9rem; }
.row .ia { flex: 1 1 160px; }
.inst-info { flex-basis: 100%; font-size: .84rem; color: var(--warn-ink); padding-left: 2px; }
.inst-info:empty { display: none; }
.inst-info.ok { color: var(--ok); }
.row-x { width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; cursor: pointer; border-radius: 8px; flex: none; }
.row-x:hover { background: var(--danger-soft); color: var(--danger); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Marcas ---------- */
.brand-strip {
  display: flex; gap: 12px; overflow-x: auto; padding: 22px 2px 4px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.brand-tile {
  flex: 0 0 auto; width: 124px; height: 92px; border-radius: 14px; overflow: hidden;
  display: grid; place-items: center; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.brand-tile img { width: 100%; height: 100%; object-fit: cover; }
.brand-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20, 22, 60, .14); }
.brand-tile.is-on { outline: 3px solid var(--accent); outline-offset: 3px; }
.brand-strip:has(.is-on) .brand-tile:not(.is-on) { opacity: .55; }
.brand-strip:has(.is-on) .brand-tile:not(.is-on):hover { opacity: 1; }
.brand-tile-txt { font-family: var(--font-head); font-weight: 700; text-align: center; padding: 8px; font-size: .95rem; }
.brand-strip + .filters { margin-top: 16px; }
@media (max-width: 560px) { .brand-tile { width: 104px; height: 78px; } }

.card-brand { display: flex; align-items: center; gap: 8px; }
.card-brand img { width: 64px; height: 32px; border-radius: 6px; object-fit: cover; }

.tab-intro { margin: -6px 0 16px; }
.brand-admin { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
.brand-new { border-style: dashed; }
.brand-item { position: relative; }
.brand-item-top { display: flex; gap: 14px; align-items: center; }
.brand-item-info { display: grid; gap: 4px; flex: 1; min-width: 0; }
.brand-logo-lg { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; }
.brand-logo-ph { display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); font-family: var(--font-head); font-weight: 700; font-size: 2rem; }
.brand-item-actions { display: flex; gap: 8px; padding-right: 50px; }
.brand-del { position: absolute; right: 22px; bottom: 22px; margin: 0; }
@media (prefers-reduced-motion: reduce) { .brand-tile:hover { transform: none; } }

/* ---------- Versión GitHub Pages ---------- */
[hidden] { display: none !important; }
button.brand-tile { padding: 0; cursor: pointer; font: inherit; }
.login-card { width: min(460px, 100%); }
.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
#dlgMsgs:empty, #msgs:empty, #gateMsgs:empty { display: none; }
.login-card { width: min(400px, 100%); }
.login-ico svg, .logo-ph svg { display: block; }
.noimg, .empty-ico, .thumb-ph { color: var(--muted); }
.noimg { opacity: .5; }
.empty-ico { display: flex; justify-content: center; }
#banners .alert { margin-bottom: 10px; }
#banners:empty { display: none; }

/* ---------- Ventana de confirmación ---------- */
.btn-danger { background: var(--danger); color: #fff; }
.dlg-sm { width: min(420px, 100% - 24px); }
.confirm-body { padding: 26px 24px 18px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.confirm-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); margin-bottom: 4px; }
.confirm-ico.is-danger { background: var(--danger-soft); color: var(--danger); }
.confirm-body h2 { font-size: 1.25rem; }
.confirm-body p { margin: 0; color: var(--muted); }
.dlg-sm .dlg-foot { justify-content: center; }
.dlg-sm .dlg-foot .btn { min-width: 130px; }
.dlg-msgs { padding: 0 22px; }
.dlg-msgs .alert { margin: 10px 0 0; }
.dlg-msgs:empty { display: none; }

/* =================================================================
   Vender, ventas y compras
   ================================================================= */
html { color-scheme: light; }
.tabs { overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; }
kbd { font: 600 .72rem/1 var(--font-body); padding: 3px 6px; border-radius: 5px; border: 1px solid currentColor; opacity: .75; margin-left: 4px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.btn-xl { min-height: 58px; font-size: 1.2rem; }
.btn-void { color: var(--danger); }
.link-btn { border: 0; background: none; color: var(--primary-text); font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }

.pos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.pos-main { display: grid; gap: 12px; min-width: 0; }
.pos-search { position: relative; display: flex; gap: 10px; }
.scan {
  flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 58px;
  background: var(--surface); border: 2px solid var(--primary); border-radius: var(--radius); color: var(--primary-text);
}
.scan input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 1.1rem; min-height: 54px; color: var(--ink); }
.scan:focus-within { box-shadow: 0 0 0 4px var(--primary-soft); }
.btn-cam { min-height: 58px; gap: 6px; }
.pick-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; max-height: 420px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 34px rgba(20, 50, 80, .16);
}
.pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; color: var(--ink); }
.pick:last-child { border-bottom: 0; }
.pick:hover, .pick.is-sel { background: var(--primary-soft); }
.pick-img { width: 44px; height: 44px; border-radius: 8px; object-fit: contain; background: #fff; flex: none; display: grid; place-items: center; }
.pick-ph { background: var(--surface-2); color: var(--muted); }
.pick-txt { display: grid; flex: 1; min-width: 0; }
.pick-txt small, .pick-right small { color: var(--muted); font-size: .82rem; }
.pick-right { display: grid; text-align: right; }
.pick-empty { padding: 14px; color: var(--muted); }
.pos-flash { min-height: 22px; font-weight: 600; font-size: .95rem; }
.pos-flash.is-ok { color: var(--ok); }
.pos-flash.is-error { color: var(--danger); }

.cart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-head, .cart-row { display: grid; grid-template-columns: minmax(0, 1fr) 132px 150px; gap: 12px; align-items: center; padding: 10px 14px; }
.cart-head { background: var(--primary-soft); font-weight: 700; font-size: .86rem; }
.cart-row { border-top: 1px solid var(--line); }
.cart-prod { display: grid; min-width: 0; }
.cart-prod strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-prod small { color: var(--muted); font-size: .84rem; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; width: max-content; }
.qty button { width: 38px; height: 40px; border: 0; background: var(--surface-2); font-size: 1.2rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.qty button:hover { background: var(--primary-soft); }
.qty input { width: 48px; height: 40px; border: 0; text-align: center; font-weight: 700; font-size: 1rem; }
.cart-sub { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.cart-empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.pos-keys { margin: 0; color: var(--muted); font-size: .84rem; }

.pos-side {
  position: sticky; top: 16px; display: grid; gap: 14px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(20, 60, 100, .07);
}
.pos-label { font-size: .82rem; font-weight: 700; color: var(--muted); display: block; margin-bottom: 4px; }
.client-btn { width: 100%; text-align: left; min-height: 42px; padding: 0 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 600; cursor: pointer; color: var(--ink); }
.client-btn:hover { border-color: var(--primary); }
.client-form { display: grid; gap: 8px; margin-top: 8px; }
.client-fields { display: grid; gap: 8px; }
.client-fields input { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.client-form .btn { justify-self: start; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { min-height: 38px; border: 0; background: var(--surface); font-weight: 600; cursor: pointer; color: var(--ink); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--primary); color: var(--primary-ink); }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 4px; border-top: 1px solid var(--line); }
.pos-total span { font-weight: 700; color: var(--muted); }
.pos-total strong { font-family: var(--font-head); font-size: 2.1rem; color: var(--ink); letter-spacing: -.02em; }
.pos-iva { color: var(--muted); font-size: .84rem; margin-top: -8px; min-height: 1em; }
.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pay-methods button { min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 700; cursor: pointer; color: var(--ink); }
.pay-methods button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.paid-input { font-size: 1.3rem !important; font-weight: 700; min-height: 52px !important; }
.quick-cash { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick-cash:empty { display: none; }
.quick-cash button { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-weight: 700; cursor: pointer; color: var(--ink); }
.quick-cash button:hover { border-color: var(--primary); color: var(--primary-text); }
.pos-change { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ok-soft); }
.pos-change span { font-weight: 700; color: var(--ok); }
.pos-change strong { font-family: var(--font-head); font-size: 1.6rem; color: var(--ok); }
.pos-change strong.is-neg { color: var(--danger); font-size: 1.2rem; }
.save-state { font-size: .86rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 1.2em; }
.save-state.is-ok { color: var(--ok); }
.save-state.is-error { color: var(--danger); font-weight: 600; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.size-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.size-opt { display: grid; gap: 2px; min-width: 70px; padding: 10px 8px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; color: var(--ink); }
.size-opt strong { font-family: var(--font-head); font-size: 1.35rem; }
.size-opt small { color: var(--muted); font-size: .78rem; }
.size-opt:hover:not([disabled]), .size-opt:focus-visible { border-color: var(--primary); background: var(--primary-soft); }
.size-opt[disabled] { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.confirm-ico.is-ok { background: var(--ok-soft); color: var(--ok); }
.done-change { margin-top: 8px; padding: 12px 22px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); display: grid; }
.done-change span { font-weight: 700; }
.done-change strong { font-family: var(--font-head); font-size: 2.2rem; }
.cam-reader { width: 100%; min-height: 240px; border-radius: 12px; overflow: hidden; background: #0d1b26; }
.cam-reader video { width: 100% !important; }

.hist-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hist-head h2 { margin: 0; }
.hist-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fld-inline { grid-template-columns: auto; }
.fld-inline input { min-height: 42px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpis:empty { display: none; }
.kpi { display: grid; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi span { font-size: .84rem; font-weight: 700; color: var(--muted); }
.kpi strong { font-family: var(--font-head); font-size: 1.45rem; }
.kpi small { color: var(--muted); font-size: .8rem; }
.tbl tr.is-void td { color: var(--muted); }
.tbl tr.is-void td strong { text-decoration: line-through; }
.tbl .t-sub { display: block; }

[data-pane="compras"] { display: grid; gap: 20px; }
[data-pane="compras"][hidden] { display: none; }
.grid-buy { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 14px; }
.buy-search { margin-bottom: 12px; }
.buy-search .scan { min-height: 50px; border-width: 1.5px; }
.buy-search .scan input { min-height: 46px; font-size: 1rem; }
.tbl-buy { min-width: 680px; }
.in-sm, .in-md { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; }
.in-sm { width: 90px; }
.in-md { width: 140px; }
.buy-foot { display: flex; justify-content: flex-end; align-items: center; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.buy-foot strong { font-family: var(--font-head); font-size: 1.4rem; margin-left: 6px; }

@media (max-width: 960px) {
  .pos { grid-template-columns: 1fr; }
  .pos-side { position: static; }
}
@media (max-width: 560px) {
  .adm-main { padding-top: 14px; }
  .btn-cam span { display: none; }
  .btn-cam { padding: 0 14px; }
  .cart-head { display: none; }
  .cart-row { grid-template-columns: 1fr auto; grid-template-areas: "prod prod" "qty sub"; row-gap: 8px; }
  .cart-prod { grid-area: prod; }
  .qty { grid-area: qty; }
  .cart-sub { grid-area: sub; }
  .pos-total strong { font-size: 1.8rem; }
  .pos-keys { display: none; }
  .adm-head-in { padding: 12px 16px; }
  .adm-name { font-size: 1.15rem; }
}
.transfer-box { gap: 10px; margin-bottom: 4px; }
.transfer-box .fld input { min-height: 42px; }

/* Comprobante, PDF y WhatsApp */
.pos-doc { display: grid; gap: 6px; margin-bottom: 12px; }
.seg.seg-2 { grid-template-columns: 1fr 1fr; }
.done-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; width: 100%; }
#doneDlg .dlg-foot { flex-direction: column; align-items: stretch; gap: 10px; }
#doneDlg .dlg-foot .btn { min-width: 0; }
.btn-wa-sm { background: #1f9d55; color: #fff; }
.actions .btn-sm + .btn-sm { margin-left: 0; }
@media (max-width: 480px) { .done-actions { grid-template-columns: 1fr; } }
.btn-mail { background: #16263a; color: #fff; }
.done-mail { margin: 4px 0 0; font-size: .92rem; color: var(--muted); }
.done-mail.is-ok { color: var(--ok); font-weight: 600; }
.done-mail.is-warn { color: #b45309; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Botones de comprobante y anular */
.btn-print { background: #6b7280; color: #fff; }
.btn-pdf { background: #dc2626; color: #fff; }
.icon-void { border: 1.5px solid var(--danger); }
.actions { align-items: center; }

/* Compras: que no se salga de la pantalla */
[data-pane="compras"] { grid-template-columns: minmax(0, 1fr); }
[data-pane="compras"] .panel { min-width: 0; }
@media (max-width: 640px) {
  .panel { padding: 16px; }
  .grid-buy { grid-template-columns: 1fr 1fr; }
  .buy-foot { justify-content: space-between; }
  .buy-foot .btn { width: 100%; }
  /* Productos de la compra como tarjetas */
  .tbl-buy { min-width: 0; }
  .tbl-buy thead { display: none; }
  .tbl-buy tbody tr[data-b] { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; border-top: 1px solid var(--line); position: relative; }
  .tbl-buy tbody tr[data-b]:first-child { border-top: 0; }
  .tbl-buy tbody tr[data-b] td { border: 0; padding: 0; display: grid; gap: 4px; }
  .tbl-buy td[data-label]::before { content: attr(data-label); font-size: .78rem; font-weight: 700; color: var(--muted); }
  .tbl-buy td.b-name { grid-column: 1 / -1; padding-right: 40px; }
  .tbl-buy td.b-sub { grid-column: 1 / -1; text-align: left; font-weight: 700; }
  .tbl-buy td.b-x { position: absolute; top: 8px; right: 8px; }
  .tbl-buy input { width: 100%; }
}
@media (max-width: 380px) { .grid-buy { grid-template-columns: 1fr; } }
.grid-buy .fld input, .grid-buy .fld select { min-width: 0; width: 100%; }
@media (max-width: 640px) { .tbl-buy td.b-sub { text-align: left !important; justify-items: start; } }

.sifen-tag { display: block; width: fit-content; margin-top: 4px; font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.sifen-tag.is-ok { background: #1f9d55; color: #fff; }
.sifen-tag.is-wait { background: #fff4dc; color: #7a4b00; }
.sifen-tag.is-bad { background: #dc2626; color: #fff; }

/* Pie de listas: anuladas y paginación */
.list-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.check-sm { font-size: .9rem; font-weight: 600; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.pager-info { color: var(--muted); font-size: .9rem; }
.pager-btns { display: flex; gap: 6px; }
.pager-btns button { min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; }
.pager-btns button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-text); }
.pager-btns button.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.pager-btns button:disabled { opacity: .4; cursor: default; }
.sifen-why { display: block; max-width: 220px; margin-top: 3px; font-size: .74rem; color: var(--danger); white-space: normal; line-height: 1.3; }

/* ---------- Caja ---------- */
.caja-warn { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 14px; border-radius: var(--radius); background: #fff4dc; color: #7a4b00; border: 1px solid #f3d9a4; }
.caja-card { margin-bottom: 18px; }
.caja-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.caja-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; padding: 6px 12px; border-radius: 999px; font-size: .9rem; margin-bottom: 8px; }
.caja-top .caja-status { margin-bottom: 0; }
.caja-status .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.caja-status.is-open { background: #e3f5e9; color: #17803d; }
.caja-status.is-closed { background: #fdeceb; color: #c4302b; }
.caja-form { max-width: 420px; margin-top: 10px; }
.caja-big { font-size: 1.4rem !important; font-weight: 800; min-height: 52px !important; }
.kpis-6 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 0; }
.kpi-main { background: var(--primary); border-color: var(--primary); }
.kpi-main span, .kpi-main small, .kpi-main strong { color: #fff; }
.caja-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 18px; align-items: start; }
.mov-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; }
.mov-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .92rem; }
.mov-ingreso { color: var(--ok); font-weight: 800; }
.mov-retiro { color: var(--danger); font-weight: 800; }
.mov-list small { color: var(--muted); }
.caja-diff { font-weight: 800; font-size: 1.05rem; min-height: 1.4em; }
.caja-diff.is-ok { color: var(--ok); }
.caja-diff.is-plus { color: #0b6aa6; }
.caja-diff.is-minus { color: var(--danger); }
.diff-tag { display: inline-block; font-weight: 800; font-size: .8rem; padding: 2px 9px; border-radius: 999px; }
.diff-tag.is-ok { background: #1f9d55; color: #fff; }
.diff-tag.is-plus { background: #e3f2fc; color: #0b6aa6; }
.diff-tag.is-minus { background: #dc2626; color: #fff; }

/* ---------- Reportes ---------- */
.rep-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rep-head .fld { min-width: 170px; }
.rep-actions { display: flex; gap: 8px; margin-left: auto; }
.rep-period { margin: 0 0 12px; }
.rep-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); margin-top: 18px; align-items: start; }
.rep-wide { grid-column: 1 / -1; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 120px) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; }
.bar-l { color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-t { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-f { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.bar-v { font-weight: 700; white-space: nowrap; }
.tbl-sm td, .tbl-sm th { padding: 7px 8px; font-size: .9rem; }
.tbl-sm { min-width: 0; }
@media (max-width: 560px) {
  .rep-grid { grid-template-columns: minmax(0, 1fr); }
  .rep-actions { width: 100%; margin-left: 0; }
  .rep-actions .btn { flex: 1; }
  .bar-row { grid-template-columns: 60px 1fr auto; }
}
.kpis-6 .kpi strong { font-size: 1.2rem; white-space: nowrap; }

/* ---------- Caja: dos cajas, recaudado y reporte diario ---------- */
[data-pane="caja"] { display: grid; gap: 18px; }
[data-pane="caja"][hidden] { display: none; }
#cajaBox { display: grid; gap: 18px; }
.cj-two { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); align-items: stretch; }
.cj-card { display: grid; gap: 12px; align-content: start; }
.cj-head { display: flex; gap: 12px; align-items: center; }
.cj-head h2 { margin: 0; font-size: 1.25rem; }
.cj-head .hint { margin: 0; }
.cj-ico { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--primary-text); background: var(--surface); flex: none; }
.cj-date { max-width: 190px; }
.cj-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-open { background: #1f9d55; color: #fff; }
.btn-close { background: #dc2626; color: #fff; }
.cj-btns .btn:disabled { opacity: .45; cursor: not-allowed; }
.cj-state { margin: 0; font-weight: 700; }
.cj-state.is-open strong { color: #17803d; }
.cj-mini { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .9rem; color: var(--muted); }
.cj-mini strong { color: var(--ink); }
.cj-exp { flex-basis: 100%; font-size: 1rem; }
.cj-exp strong { color: var(--primary-text); font-size: 1.15rem; }
.cj-inline { display: grid; gap: 10px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }

.rc-card { display: grid; gap: 14px; }
.rc-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rc-title h2 { margin: 0; font-size: 1.35rem; }
.rc-tag { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; font-weight: 800; color: var(--muted); background: var(--surface-2); }
.rc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rc-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.rc-head { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: .88rem; margin-bottom: 4px; color: var(--ink); }
.rc-head svg { width: 18px; height: 18px; }
.rc-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: .95rem; color: var(--muted); }
.rc-row:first-of-type { border-top: 0; }
.rc-row strong { font-family: var(--font-head); font-size: 1.05rem; white-space: nowrap; }
.is-in { color: #17803d; }
.is-out { color: #dc2626; }
.is-bal { color: #1a6fd8; }
td.is-in, td.is-out, td.is-bal { font-weight: 700; }
.rc-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border: 1px solid #cfe3f5; border-radius: var(--radius); background: #f4f9fe; font-weight: 700; }
.rc-total strong { font-family: var(--font-head); font-size: 1.5rem; color: #1a6fd8; }

.mv-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.mv-form .fld > span { display: block; margin-bottom: 0; }
.mv-submit { display: flex; }
.mv-empty { margin-top: 12px; }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.tbl-diario th.th-group { text-align: center; border-left: 1px solid var(--line); }
.tbl-diario tfoot td { border-top: 2px solid var(--line); background: var(--surface-2); }
@media (max-width: 560px) {
  .rc-cols { grid-template-columns: 1fr; }
  .cj-two { grid-template-columns: minmax(0, 1fr); }
}
[data-pane="caja"], #cajaBox { grid-template-columns: minmax(0, 1fr); }
[data-pane="caja"] .panel, .cj-two > * { min-width: 0; }
@media (max-width: 400px) { .cj-two { grid-template-columns: minmax(0, 1fr); } .rc-row strong { font-size: .98rem; } }
.rc-total strong { white-space: nowrap; }
@media (max-width: 560px) { .rc-total { gap: 10px; } .rc-total strong { font-size: 1.2rem; } .cj-btns .btn { flex: 1 1 140px; } }

/* ---------- Reporte diario de caja ---------- */
.cj-report { display: grid; gap: 16px; }
.cj-rep-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.cj-rep-head h2 { margin: 0 0 4px; }
.cj-rep-head .hint .is-in, .cj-rep-head .hint .is-out { font-weight: 800; }
.cj-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.cj-search .fld { width: 170px; }
.cj-quick { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.cj-quick button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; cursor: pointer; color: var(--ink); }
.cj-quick button:hover { border-color: var(--primary); color: var(--primary-text); }
.cj-quick button.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.cj-insight { margin: 10px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: #fff8e8; border: 1px solid #f3dfae; color: #6b4600; font-weight: 600; }
.cj-charts { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.ch-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.ch-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ch-head h3 { margin: 0; font-size: 1.02rem; }
.ch-legend { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.ch-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.ch-in { background: #1f9d55; }
.ch-out { background: #e5484d; }
.ch-legend .ch-wk { background: #fff1d6; border: 1px solid #f0c983; }
.ch-scroll { overflow-x: auto; padding-bottom: 4px; }
.ch-days { display: flex; align-items: stretch; gap: 4px; height: 220px; min-width: 100%; }
.ch-col { flex: 1 0 22px; display: flex; flex-direction: column; border-radius: 6px; padding: 4px 2px 0; }
.ch-col.is-weekend { background: #fff6e3; }
.ch-col.is-today .ch-lbl { color: var(--primary-text); font-weight: 800; }
.ch-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.ch-bar { width: 42%; max-width: 14px; border-radius: 3px 3px 0 0; min-height: 0; }
.ch-lbl { display: grid; text-align: center; font-size: .72rem; font-weight: 700; color: var(--ink); padding: 3px 0; line-height: 1.1; }
.ch-lbl small { font-size: .64rem; color: var(--muted); font-weight: 600; }
.wk-list { display: grid; gap: 8px; }
.wk-row { display: grid; grid-template-columns: 82px 1fr auto; gap: 8px; align-items: center; font-size: .86rem; padding: 4px 6px; border-radius: 8px; }
.wk-row.is-weekend { background: #fff6e3; }
.wk-lbl { font-weight: 700; }
.wk-track { display: grid; gap: 3px; }
.wk-bar { display: block; height: 9px; border-radius: 999px; }
.wk-val { font-size: .78rem; font-weight: 700; white-space: nowrap; }
.tbl-diario tr.is-weekend td { background: #fffaf0; }
@media (max-width: 900px) { .cj-charts { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .cj-search .fld { width: calc(50% - 6px); }
  .cj-search .btn { width: 100%; }
  .wk-row { grid-template-columns: 70px 1fr auto; }
}
.ch-bars { height: 100%; min-height: 0; }

/* Reporte diario: una tabla por caja */
.dia-tables { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.dia-box { min-width: 0; }
.dia-title { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1.05rem; }
.dia-ico { width: 12px; height: 12px; border-radius: 3px; }
.dia-ico.is-ef { background: #1f9d55; }
.dia-ico.is-tr { background: var(--primary); }
.tbl-dia { min-width: 420px; }
.tbl-dia tr.is-weekend td { background: #fffaf0; }
.tbl-dia tfoot td { border-top: 2px solid var(--line); background: var(--surface-2); }
.dia-grand { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid #cfe3f5; border-radius: var(--radius); background: #f4f9fe; font-weight: 700; }
.dia-grand:empty { display: none; }
.dia-grand strong { font-family: var(--font-head); font-size: 1.4rem; color: #1a6fd8; white-space: nowrap; }
.dia-tables { grid-template-columns: minmax(0, 1fr); }
.tbl-dia { min-width: 0; }
.tbl-dia th:first-child, .tbl-dia td:first-child { width: 38%; }
@media (max-width: 560px) { .tbl-dia { min-width: 480px; } }
.tbl-dia { table-layout: fixed; }
.tbl-dia th:first-child, .tbl-dia td:first-child { width: 34%; }

.panel-danger { border-color: #f3c4c2; }
.panel-danger h2 { color: var(--danger); }
.cj-calc { margin: -4px 0 0; }
.cj-calc strong { color: var(--primary-text); }
.cj-saldo { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: #f4f9fe; border: 1px solid #cfe3f5; font-weight: 700; }
.cj-saldo strong { font-family: var(--font-head); font-size: 1.5rem; color: #1a6fd8; white-space: nowrap; }

/* ---------- Catálogo en celular: 2 productos por fila ---------- */
@media (max-width: 640px) {
  .catalog #results .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .catalog .card-img img { padding: 8px; }
  .catalog .card-body { padding: 12px 10px; gap: 4px; }
  .catalog .card-title { font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; }
  .catalog .card-brand { font-size: .8rem; }
  .catalog .card-brand img { width: 44px; height: 22px; }
  .catalog .card-meta, .catalog .stock, .catalog .colors, .catalog .desc { font-size: .8rem; }
  .catalog .price { font-size: 1.2rem; }
  .catalog .badge { font-size: .7rem; padding: 2px 7px; }
  .catalog .sizes legend { font-size: .8rem; }
  .catalog .size-list { gap: 4px; }
  .catalog .size span { min-width: 34px; height: 34px; padding: 0 5px; font-size: .85rem; }
  .catalog .pay { font-size: .8rem; }
  .catalog .pay select { min-height: 38px; padding: 0 6px; font-size: .82rem; }
  .catalog .btn-wa { font-size: .85rem; padding-left: 8px; padding-right: 8px; white-space: normal; text-align: center; line-height: 1.2; }
}