/* SiVendo — interfaz móvil, botones grandes, pocos pasos.
   Paleta tomada del logo: azul bolsa, verde "Si", cielo, amarillo y rosa. */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/nunito-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/nunito-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/nunito-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 900; font-display: swap; src: url("/fonts/nunito-latin-900-normal.woff2") format("woff2"); }

:root {
    --sv-brand: #0B5BD3;      /* azul SiVendo (se puede cambiar por negocio) */
    --sv-brand-dark: #0847A8;
    --sv-blue: #0B5BD3;
    --sv-green: #00C4A7;      /* verde del "Si" */
    --sv-green-dark: #00A38B;
    --sv-sky: #30BCFE;
    --sv-accent: #FEC939;     /* amarillo */
    --sv-pink: #F7509F;       /* rosa */
    --sv-ok: #00A38B;
    --sv-bad: #E8367F;
    --sv-bg: #F4F7FB;
    --sv-card: #ffffff;
    --sv-text: #14213D;
    --sv-muted: #64708A;
    --sv-radius: 18px;
    --sv-nav-h: 68px;
}

html, body { background: var(--sv-bg); color: var(--sv-text); }
body {
    font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    padding-bottom: calc(var(--sv-nav-h) + env(safe-area-inset-bottom) + 16px);
    -webkit-tap-highlight-color: transparent;
}
.text-muted { color: var(--sv-muted) !important; }
.app { max-width: 640px; margin: 0 auto; padding: 0 14px; }

/* Barra superior */
.topbar {
    position: sticky; top: 0; z-index: 1020;
    background: #fff; color: var(--sv-text);
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
    box-shadow: 0 1px 0 #e6ebf3, 0 4px 14px rgba(11,91,211,.06);
}
.topbar::after { /* franja de colores del logo */
    content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
    background: linear-gradient(90deg, var(--sv-green) 0 25%, var(--sv-sky) 25% 50%, var(--sv-accent) 50% 75%, var(--sv-pink) 75% 100%);
}
.topbar .inner { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.topbar .brand-logo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #fff; border: 2px solid #e6ebf3; }
.topbar .brand-mark { height: 38px; width: auto; }
.topbar .title { font-weight: 800; font-size: 1.1rem; line-height: 1.1; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar a, .topbar button { color: var(--sv-brand); }
.topbar .back { font-size: 1.6rem; text-decoration: none; margin-right: 2px; }
.cash-pill { font-size: .78rem; background: #e6f8f4; color: var(--sv-green-dark) !important; border-radius: 99px; padding: 5px 11px; text-decoration: none; white-space: nowrap; font-weight: 700; }
.cash-pill.closed { background: var(--sv-accent); color: var(--sv-text) !important; }

/* Navegación inferior */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030;
    background: #fff; border-top: 1px solid #e7e2dc;
    height: calc(var(--sv-nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex; justify-content: space-around; align-items: center;
}
.bottom-nav a {
    flex: 1; text-align: center; color: var(--sv-muted); text-decoration: none;
    font-size: .72rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bottom-nav a i { font-size: 1.45rem; line-height: 1; }
.bottom-nav a.active { color: var(--sv-brand); }
.bottom-nav .sell {
    margin-top: -30px;
}
.bottom-nav .sell span.circle {
    width: 64px; height: 64px; border-radius: 50%; color: #fff;
    background: linear-gradient(135deg, var(--sv-sky), var(--sv-brand));
    display: flex; align-items: center; justify-content: center; font-size: 1.9rem;
    box-shadow: 0 6px 16px rgba(11,91,211,.35); border: 4px solid #fff;
}
.bottom-nav .sell.active { color: var(--sv-brand); }

/* Tarjetas */
.card-sv { background: var(--sv-card); border-radius: var(--sv-radius); padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); border: 0; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sv-muted); font-weight: 700; margin: 22px 4px 8px; }
.big-number { font-size: 2.2rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.mid-number { font-size: 1.35rem; font-weight: 800; }
.hero {
    background: linear-gradient(135deg, var(--sv-brand) 0%, var(--sv-brand-dark) 55%, color-mix(in srgb, var(--sv-brand) 60%, var(--sv-sky)) 100%);
    color: #fff; border-radius: 22px; padding: 18px; position: relative; overflow: hidden;
}
.hero::after { /* destello del logo */
    content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%;
    background: radial-gradient(circle, rgba(48,188,254,.45), transparent 70%);
}
.hero > * { position: relative; z-index: 1; }
.hero .label { opacity: .85; font-size: .9rem; }

/* Botones gigantes Vendí / Gasté */
.mega-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mega-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 112px; border-radius: 22px; font-size: 1.35rem; font-weight: 800; text-decoration: none;
    border: 0; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.mega-btn i { font-size: 2.3rem; }
.mega-btn.sold { background: linear-gradient(135deg, var(--sv-green), var(--sv-green-dark)); }
.mega-btn.spent { background: linear-gradient(135deg, var(--sv-pink), #D9327A); }
.mega-btn:active { transform: scale(.97); }

.btn { border-radius: 14px; font-weight: 700; }
.btn-lg { padding: 14px 18px; font-size: 1.1rem; }
.btn-brand { background: var(--sv-brand); color: #fff; border: 0; }
.btn-brand:hover, .btn-brand:focus, .btn-brand:active { background: var(--sv-brand-dark) !important; color: #fff !important; }
.btn-soft { background: #EAF0F9; color: var(--sv-text); border: 0; }
.btn-soft:hover { background: #dde6f4; }
.btn-wa { background: #25D366; color: #fff; border: 0; }
.btn-wa:hover { background: #1ebe5b; color: #fff; }

.form-control, .form-select { border-radius: 14px; padding: 12px 14px; font-size: 1.05rem; border-color: #d5deeb; }
.form-control:focus, .form-select:focus { border-color: var(--sv-brand); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--sv-brand) 18%, transparent); }
.form-control.money { font-size: 1.8rem; font-weight: 800; text-align: center; }
.form-label { font-weight: 700; font-size: .92rem; margin-bottom: 4px; }

/* Chips de selección (métodos de pago, categorías) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { display: none; }
.chip span {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 99px;
    background: #fff; border: 2px solid #d9e2ef; font-weight: 700; font-size: .95rem; cursor: pointer; user-select: none;
}
.chip input:checked + span { border-color: var(--sv-brand); background: var(--sv-brand); color: #fff; }
.chip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip-grid .chip span { width: 100%; flex-direction: column; justify-content: center; border-radius: 16px; min-height: 78px; text-align: center; font-size: .85rem; }
.chip-grid .chip span i { font-size: 1.5rem; }

/* Listas */
.list-sv { background: #fff; border-radius: var(--sv-radius); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.list-sv .item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #eef2f8; color: inherit; text-decoration: none; }
.list-sv .item:last-child { border-bottom: 0; }
.list-sv .item .grow { flex: 1; min-width: 0; }
.list-sv .item .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-sv .item .s { font-size: .85rem; color: var(--sv-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: #EAF0F9; display: flex; align-items: center; justify-content: center; color: #9fb0c9; font-size: 1.4rem; flex-shrink: 0; }
.icon-circle { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; background: #EAF0F9; color: var(--sv-brand); }

/* Punto de venta */
.pos-search { position: sticky; top: 64px; z-index: 5; background: var(--sv-bg); padding: 10px 0; }
.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 520px) { .pos-grid { grid-template-columns: repeat(4, 1fr); } }
.pos-item { background: #fff; border-radius: 16px; overflow: hidden; border: 3px solid transparent; position: relative; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.pos-item.in-cart { border-color: var(--sv-brand); }
.pos-item .img { aspect-ratio: 1; background: #EAF0F9 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: #9fb0c9; font-size: 2rem; }
.pos-item .info { padding: 6px 8px; }
.pos-item .price { font-weight: 800; }
.pos-item .nm { font-size: .74rem; color: var(--sv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-item .badge-qty { position: absolute; top: 6px; right: 6px; background: var(--sv-brand); color: #fff; border-radius: 99px; min-width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; }
.cart-bar {
    position: fixed; left: 0; right: 0; bottom: calc(var(--sv-nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 1025;
    max-width: 612px; margin: 0 auto; padding: 0 14px;
}
.cart-bar button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; font-size: 1.15rem; border-radius: 18px; box-shadow: 0 8px 20px rgba(0,0,0,.2); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { padding: 14px 0; font-size: 1.5rem; font-weight: 800; border-radius: 14px; border: 0; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.keypad button:active { background: #EAF0F9; }

.offcanvas-bottom.sheet { height: auto; max-height: 92vh; border-radius: 22px 22px 0 0; }
.sheet .offcanvas-body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }

/* Semáforo */
.light { width: 18px; height: 18px; border-radius: 50%; display: inline-block; vertical-align: middle; }
.light.green { background: var(--sv-green); } .light.yellow { background: var(--sv-accent); } .light.red { background: var(--sv-pink); } .light.gray { background: #bbb; }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 110px; }
.bars .bar { flex: 1; background: var(--sv-brand); border-radius: 6px 6px 2px 2px; min-height: 3px; opacity: .85; position: relative; }
.bars .bar { background: linear-gradient(180deg, var(--sv-sky), var(--sv-brand)); }
.bars .bar.zero { background: #e1e8f2; }
.bars-labels { display: flex; gap: 4px; font-size: .65rem; color: var(--sv-muted); }
.bars-labels span { flex: 1; text-align: center; }

.progress { height: 14px; border-radius: 99px; background: rgba(255,255,255,.3); }
.progress-bar { background: linear-gradient(90deg, var(--sv-green), var(--sv-accent)); border-radius: 99px; }

.alert { border-radius: 16px; border: 0; font-weight: 600; }
.alert-success { background: #E3F8F3; color: #00705F; }
.alert-danger { background: #FDE8F1; color: #B0215E; }
.alert-warning { background: #FFF6DA; color: #7A5A00; }
.badge-status { font-size: .72rem; padding: 4px 8px; border-radius: 99px; font-weight: 700; }
.st-pagada { background: #E3F8F3; color: #00705F; }
.st-fiado { background: #FFF3CF; color: #8A6100; }
.st-apartado { background: #E2EEFF; color: #0847A8; }
.st-cancelada { background: #eee; color: #777; }

.empty { text-align: center; padding: 34px 16px; color: var(--sv-muted); }
.empty i { font-size: 2.6rem; display: block; margin-bottom: 8px; }

.fab {
    background: linear-gradient(135deg, var(--sv-sky), var(--sv-brand));
    position: fixed; right: 18px; bottom: calc(var(--sv-nav-h) + env(safe-area-inset-bottom) + 18px); z-index: 1025;
    width: 60px; height: 60px; border-radius: 50%; color: #fff; font-size: 1.8rem;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(0,0,0,.25); text-decoration: none;
}

.photo-drop {
    border: 3px dashed #c9d6ea; border-radius: 20px; background: #fff; aspect-ratio: 4/3; display: flex; flex-direction: column;
    align-items: center; justify-content: center; color: var(--sv-muted); cursor: pointer; overflow: hidden; position: relative;
}
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-drop i { font-size: 3rem; }

.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.menu-grid a { background: #fff; border-radius: 18px; padding: 16px 6px; text-align: center; text-decoration: none; color: var(--sv-text); font-weight: 700; font-size: .85rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.menu-grid a i { display: block; font-size: 1.8rem; color: var(--sv-brand); margin-bottom: 6px; }
.menu-grid a:nth-child(4n+2) i { color: var(--sv-green-dark); }
.menu-grid a:nth-child(4n+3) i { color: var(--sv-pink); }
.menu-grid a:nth-child(4n) i { color: #E0A800; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; padding: 20px 0; position: relative; z-index: 1; }
.auth-logo { width: min(240px, 62vw); height: auto; display: block; margin: 0 auto 4px; }
.guest-body { background: #fff; }
.leaf { position: fixed; z-index: 0; width: min(34vw, 190px); pointer-events: none; opacity: .95; }
.leaf.tl { top: 0; left: 0; } .leaf.tr { top: 0; right: 0; } .leaf.bl { bottom: 0; left: 0; } .leaf.br { bottom: 0; right: 0; }
.tagline { color: var(--sv-muted); font-weight: 700; }
.tagline b { color: var(--sv-green-dark); }

/* Etiquetas para imprimir */
.labels-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.label-tag { border: 1px dashed #999; border-radius: 8px; padding: 8px; text-align: center; background: #fff; break-inside: avoid; }
.label-tag .lb-biz { color: #0B5BD3; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.label-tag .lb-price { font-size: 26px; font-weight: 900; line-height: 1.1; }
.label-tag .lb-meta { font-size: 10px; }
.label-tag .lb-qr { width: 70px; height: 70px; margin: 4px auto 0; }
.label-tag .lb-qr img, .label-tag .lb-qr svg { width: 100%; height: 100%; }
@media print {
    .no-print, .topbar, .bottom-nav { display: none !important; }
    body { background: #fff; padding: 0; }
    .app { max-width: none; padding: 0; }
    .labels-sheet { grid-template-columns: repeat(4, 1fr); }
}

/* Tipografía redondeada como el logo */
h1, h2, h3, h4, h5, .big-number, .mid-number, .mega-btn, .btn, .topbar .title { font-weight: 900; }
.big-number, .mid-number { font-variant-numeric: tabular-nums; }
.text-brand { color: var(--sv-brand) !important; }
.text-green { color: var(--sv-green-dark) !important; }
.guest-body .card-sv { box-shadow: 0 10px 30px rgba(11,91,211,.10); border: 1px solid #eef2f8; }

/* ============================================================
   Componentes nuevos: moneda, reportes, equipo, ayuda
   ============================================================ */
.money-row { display: flex; gap: 8px; align-items: stretch; }
.money-row .form-control { flex: 1; min-width: 0; }
.cur-toggle { display: flex; background: #EAF0F9; border-radius: 14px; padding: 4px; flex-shrink: 0; }
.cur-toggle input { display: none; }
.cur-toggle span { display: flex; align-items: center; height: 100%; padding: 0 12px; border-radius: 10px; font-weight: 800; font-size: .85rem; color: var(--sv-muted); cursor: pointer; }
.cur-toggle input:checked + span { background: #fff; color: var(--sv-brand); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.cur-toggle input[value=USD]:checked + span { color: #1D6F42; }
.conv { color: #1D6F42; }

.chip-sm span { padding: 6px 11px; font-size: .85rem; }
.report-types small { font-size: .7rem; line-height: 1.2; margin-top: 2px; }
.quick-reports { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.quick-report { flex: 0 0 150px; scroll-snap-align: start; background: #fff; border-radius: 16px; padding: 12px; text-decoration: none; color: var(--sv-text); font-weight: 800; font-size: .85rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 6px; }
.quick-report i { font-size: 1.4rem; color: var(--sv-brand); }
.quick-report:nth-child(3n+2) i { color: var(--sv-green-dark); }
.quick-report:nth-child(3n) i { color: var(--sv-pink); }
.saved-chip { display: inline-flex; align-items: center; background: #fff; border: 2px solid #d9e2ef; border-radius: 99px; overflow: hidden; }
.saved-chip a { padding: 7px 4px 7px 12px; font-weight: 700; text-decoration: none; color: var(--sv-text); font-size: .9rem; }
.saved-chip a i { color: #E0A800; }
.saved-chip button { border: 0; background: none; padding: 6px 10px 6px 4px; color: var(--sv-muted); }
.totals-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.report-table-wrap { overflow: hidden; }
.report-table { font-size: .92rem; }
.report-table th { background: #F4F7FB; color: var(--sv-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; border-bottom: 0; padding: 10px 12px; }
.report-table td { padding: 10px 12px; vertical-align: middle; border-color: #eef2f8; }
.report-table tfoot td { background: #F4F7FB; }
.report-table tr.clickable { cursor: pointer; }
.report-table tr.clickable:hover td { background: #F8FAFD; }
.print-only { display: none; }

.faq .accordion-item { border: 0; border-radius: 14px !important; margin-bottom: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.faq .accordion-button { font-weight: 800; font-size: .98rem; border-radius: 14px !important; }
.faq .accordion-button:not(.collapsed) { background: #E2EEFF; color: var(--sv-brand); box-shadow: none; }
.faq .accordion-button:focus { box-shadow: none; }
.faq .accordion-body { color: #3b4763; }

/* Menú lateral (solo pantallas grandes) */
.sidebar { display: none; }

/* ============================================================
   Diseño adaptable: celular chico → celular → tableta → computadora
   ============================================================ */

/* Celulares muy chicos (≤ 359px) */
@media (max-width: 359.98px) {
    body { font-size: 16px; }
    .app { padding: 0 10px; }
    .pos-grid { grid-template-columns: repeat(2, 1fr); }
    .chip-grid { grid-template-columns: repeat(2, 1fr); }
    .menu-grid { grid-template-columns: repeat(2, 1fr); }
    .mega-btn { min-height: 92px; font-size: 1.15rem; }
    .big-number { font-size: 1.85rem; }
    .bottom-nav a { font-size: .65rem; }
    .cash-pill { display: none; }
}

/* Celular: la tabla del reporte se vuelve tarjetas para no tener que deslizar */
@media (max-width: 767.98px) {
    .report-table thead { display: none; }
    .report-table, .report-table tbody, .report-table tfoot, .report-table tr, .report-table td { display: block; width: 100%; }
    .report-table tr { padding: 10px 14px; border-bottom: 1px solid #eef2f8; }
    .report-table td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right !important; }
    .report-table td::before { content: attr(data-label); color: var(--sv-muted); font-size: .8rem; font-weight: 700; text-align: left; }
    .report-table td:empty { display: none; }
    .report-table tfoot tr { background: #F4F7FB; }
}

/* Celular grande / horizontal */
@media (min-width: 576px) {
    .app { max-width: 720px; }
    .topbar .inner { max-width: 720px; }
    .pos-grid { grid-template-columns: repeat(4, 1fr); }
    .totals-grid { grid-template-columns: repeat(3, 1fr); }
    .menu-grid { grid-template-columns: repeat(4, 1fr); }
    .quick-report { flex-basis: 170px; }
}

/* Tableta */
@media (min-width: 768px) {
    body { font-size: 17.5px; }
    .app { max-width: 960px; padding: 0 22px; }
    .topbar .inner { max-width: 960px; }
    .pos-grid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
    .menu-grid { grid-template-columns: repeat(5, 1fr); }
    .layout-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
    .totals-grid { grid-template-columns: repeat(4, 1fr); }
    .report-table-wrap { overflow-x: auto; }
    .mega-btn { min-height: 130px; }
    .labels-sheet { grid-template-columns: repeat(4, 1fr); }
    .sheet.offcanvas-bottom { max-width: 640px; margin: 0 auto; }
    .cart-bar { max-width: 560px; }
}

/* Tableta horizontal y computadora: menú lateral */
@media (min-width: 992px) {
    :root { --sv-side: 248px; }
    body.with-nav { padding-bottom: 32px; padding-left: var(--sv-side); }
    .bottom-nav { display: none; }
    .sidebar {
        display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: var(--sv-side); z-index: 1035;
        background: #fff; border-right: 1px solid #e6ebf3; padding: 18px 14px; overflow-y: auto;
    }
    .sidebar-brand img { width: 150px; display: block; margin: 0 auto 14px; }
    .sidebar-biz { display: flex; gap: 10px; align-items: center; background: #F4F7FB; border-radius: 14px; padding: 10px; margin-bottom: 12px; min-width: 0; }
    .sidebar-biz > div { min-width: 0; }
    .sidebar-biz img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
    .sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
    .sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--sv-text); text-decoration: none; font-weight: 700; font-size: .95rem; }
    .sidebar-nav a i { font-size: 1.15rem; color: var(--sv-muted); width: 22px; text-align: center; }
    .sidebar-nav a:hover { background: #F4F7FB; }
    .sidebar-nav a.active { background: #E2EEFF; color: var(--sv-brand); }
    .sidebar-nav a.active i { color: var(--sv-brand); }
    .topbar .brand-mark, .topbar .brand-logo { display: none; }
    .topbar .inner, .app { max-width: 1180px; }
    .app { padding: 0 28px; }
    .pos-search { top: 62px; }
    .pos-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .menu-grid { grid-template-columns: repeat(6, 1fr); }
    .chip-grid { grid-template-columns: repeat(4, 1fr); }
    .report-types { grid-template-columns: repeat(4, 1fr); }
    .totals-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
    .dash { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
    .dash-side .dash-first, .dash-side > .section-title:first-child { margin-top: 0; }
    .cart-bar { left: auto; right: 28px; bottom: 24px; width: 400px; padding: 0; margin: 0; }
    .fab { bottom: 28px; right: 28px; }
    /* Hojas de cobro y venta rápida como panel a la derecha */
    .offcanvas-bottom.sheet {
        top: 0; bottom: 0; left: auto; right: 0; width: 460px; max-width: 100%; height: 100vh; max-height: none;
        border-radius: 22px 0 0 22px; margin: 0; transform: translateX(100%); border-top: 0; border-left: 1px solid #e6ebf3;
    }
    .offcanvas-bottom.sheet.showing, .offcanvas-bottom.sheet.show:not(.hiding) { transform: none; }
    .offcanvas-bottom.sheet .offcanvas-body { overflow-y: auto; }
    .card-sv:hover { box-shadow: 0 1px 3px rgba(0,0,0,.06); }
    .list-sv a.item:hover, a.card-sv:hover { background: #FBFCFE; }
    .leaf { width: 220px; }
}

@media (min-width: 1400px) {
    .topbar .inner, .app { max-width: 1320px; }
}

/* Impresión de reportes */
@media print {
    .sidebar, .no-print, .cart-bar, .fab { display: none !important; }
    body.with-nav { padding-left: 0; }
    .print-only { display: block; }
    .report-table thead { display: table-header-group !important; }
    .report-table, .report-table tbody, .report-table tfoot { display: table-row-group; }
    .report-table { display: table !important; font-size: 11px; }
    .report-table tr { display: table-row !important; }
    .report-table td, .report-table th { display: table-cell !important; padding: 4px 6px; }
    .report-table td::before { display: none; }
    .card-sv { box-shadow: none; border: 1px solid #ddd; }
    .totals-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   QR: cobrar, redes sociales, cartel y página pública
   ============================================================ */
[data-qr] svg { width: 100%; height: auto; display: block; }
.qr-thumb { width: 76px; height: 76px; flex-shrink: 0; background: #fff; border: 1px solid #e6ebf3; border-radius: 12px; padding: 6px; display: flex; align-items: center; justify-content: center; }
.qr-thumb img, .qr-thumb > div { width: 100%; height: 100%; object-fit: contain; }
.qr-live { width: 180px; }
.qr-big { width: min(78vw, 320px); }
.qr-big img, .qr-big svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.charge-amount { font-size: 2.4rem; font-weight: 900; color: var(--sv-brand); line-height: 1.1; }
.charge-data .data-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef2f8; }
.charge-data .data-row span { color: var(--sv-muted); font-size: .85rem; min-width: 64px; }
.charge-data .data-row b { flex: 1; word-break: break-all; }
.qr-fullscreen { position: fixed; inset: 0; z-index: 2000; background: var(--net, var(--sv-brand)); color: #fff; display: flex; align-items: center; justify-content: center; padding: 20px; }
.qr-fullscreen[hidden] { display: none; }
.fs-inner { text-align: center; width: 100%; max-width: 560px; }
.fs-biz { font-weight: 900; font-size: 1.3rem; opacity: .9; }
.fs-amount { font-weight: 900; font-size: clamp(2rem, 9vw, 3.4rem); line-height: 1.1; margin: 6px 0 14px; }
.fs-qr { background: #fff; border-radius: 24px; padding: 18px; width: min(86vw, 70vh, 520px); margin: 0 auto; }
.fs-qr img, .fs-qr svg { width: 100%; height: auto; display: block; }
.fs-hint { margin-top: 14px; font-weight: 700; opacity: .95; }

.social-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.social-mini { flex: 0 0 112px; scroll-snap-align: start; background: #fff; border-radius: 16px; padding: 10px; text-decoration: none; color: var(--sv-text); box-shadow: 0 1px 3px rgba(0,0,0,.06); border-top: 4px solid var(--net); text-align: center; }
.social-mini .sm-qr { width: 88px; margin: 0 auto 6px; }
.social-mini span { font-size: .78rem; font-weight: 800; white-space: nowrap; }
.social-mini span i { color: var(--net); }
.social-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.social-card { background: #fff; border: 0; border-radius: 18px; padding: 14px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.06); border-top: 5px solid var(--net, var(--sv-brand)); color: var(--sv-text); }
.social-card .sc-head { font-weight: 900; margin-bottom: 8px; }
.social-card .sc-head i { color: var(--net, var(--sv-brand)); }
.social-card .sc-qr { width: 100%; max-width: 220px; margin: 0 auto; }
.social-card .sc-handle { font-size: .8rem; color: var(--sv-muted); margin-top: 6px; }
.social-card.all { background: linear-gradient(180deg, #E2EEFF, #fff 40%); }
@media (min-width: 768px) { .social-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .social-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 992px) {
    .charge-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
    .qr-big { width: 340px; }
}

/* Cartel imprimible (tamaño carta) */
.poster { background: #fff; border-radius: 22px; padding: 28px; box-shadow: 0 1px 3px rgba(0,0,0,.08); max-width: 820px; margin: 0 auto; border-top: 10px solid var(--brand); }
.poster-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.poster-logo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid #eef2f8; }
.poster-name { font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 900; line-height: 1.05; color: var(--brand); }
.poster-sub { font-size: 1.1rem; font-weight: 700; color: var(--sv-muted); }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.poster-qr { border: 2px solid #eef2f8; border-top: 6px solid var(--net, var(--brand)); border-radius: 16px; padding: 12px; text-align: center; break-inside: avoid; }
.poster-qr.main { border-top-color: var(--brand); background: #F8FAFD; }
.poster-qr.pay { border-top-color: var(--sv-green); }
.pq-title { font-weight: 900; font-size: 1rem; margin-bottom: 8px; }
.pq-title i { color: var(--net, var(--brand)); }
.poster-qr.pay .pq-title i { color: var(--sv-green-dark); }
.pq-code { width: 100%; max-width: 170px; margin: 0 auto; }
.pq-code img { width: 100%; display: block; }
.pq-handle { font-size: .85rem; color: var(--sv-muted); margin-top: 6px; word-break: break-all; }
.poster-foot { display: flex; gap: 14px; align-items: center; margin-top: 22px; padding-top: 14px; border-top: 2px dashed #e6ebf3; font-weight: 800; }
@media print {
    @page { size: letter; margin: 12mm; }
    .poster { box-shadow: none; max-width: none; border-radius: 0; padding: 0; border-top-width: 14px; }
    .poster-grid { grid-template-columns: repeat(3, 1fr); }
    .qr-fullscreen { display: none !important; }
}

/* Página pública del negocio */
.public-page { background: linear-gradient(180deg, color-mix(in srgb, var(--sv-brand) 12%, #fff), #F4F7FB 320px); padding: 0; min-height: 100vh; }
.public-wrap { max-width: 480px; margin: 0 auto; padding: 84px 18px 30px; text-align: center; }
.public-card { background: #fff; border-radius: 26px; padding: 30px 22px; box-shadow: 0 10px 30px rgba(11,91,211,.10); }
.public-logo { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.12); margin: -80px auto 12px; display: block; background: #fff; }
.public-logo.initial { display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 900; color: #fff; background: var(--sv-brand); }
.public-name { font-weight: 900; font-size: 1.8rem; margin-bottom: 4px; }
.public-link { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-radius: 16px; background: #fff; border: 2px solid #eef2f8; text-decoration: none; color: var(--sv-text); font-weight: 800; font-size: 1.05rem; transition: transform .1s; }
.public-link > i:first-child { font-size: 1.5rem; color: var(--net); }
.public-link:hover { border-color: var(--net); transform: translateY(-1px); }
.public-made { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: .8rem; color: var(--sv-muted); text-decoration: none; font-weight: 700; }
.public-made img { height: 22px; }

/* ============================================================
   Vende más: tienda, en vivo, voz, escáner, remate, lealtad…
   ============================================================ */
.tag-remate { position: absolute; top: 6px; left: 6px; background: var(--sv-pink); color: #fff; font-size: .68rem; font-weight: 900; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; z-index: 2; }
.pos-item { position: relative; }
.peek { border: 0; background: #EAF0F9; color: var(--sv-muted); border-radius: 99px; font-size: .75rem; font-weight: 800; padding: 2px 9px; }
.peek.on { background: var(--sv-accent); color: var(--sv-text); }

.scan-box { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 1; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 18%; border: 4px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.voice-orb { width: 110px; height: 110px; border-radius: 50%; border: 0; color: #fff; font-size: 2.8rem; background: linear-gradient(135deg, var(--sv-sky), var(--sv-brand)); box-shadow: 0 10px 26px rgba(11,91,211,.35); }
.voice-orb.on { background: linear-gradient(135deg, var(--sv-pink), #D9327A); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(247,80,159,.55); } 70% { box-shadow: 0 0 0 26px rgba(247,80,159,0); } 100% { box-shadow: 0 0 0 0 rgba(247,80,159,0); } }
.voice-heard { min-height: 1.5em; font-style: italic; color: var(--sv-muted); }

/* En vivo */
.live-dot { width: 14px; height: 14px; border-radius: 50%; background: #E8367F; flex-shrink: 0; animation: pulse 1.2s infinite; }
.live-head { position: sticky; top: 62px; z-index: 6; }
.live-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 576px) { .live-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 992px) { .live-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } .live-head { top: 66px; } }
.live-tile { position: relative; border: 3px solid transparent; background: #fff; border-radius: 16px; padding: 0; overflow: hidden; text-align: left; box-shadow: 0 1px 3px rgba(0,0,0,.06); color: var(--sv-text); }
.live-tile .lt-num { position: absolute; top: 6px; left: 6px; z-index: 2; background: var(--sv-brand); color: #fff; font-weight: 900; font-size: 1.35rem; min-width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 0 6px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.live-tile .lt-img { aspect-ratio: 1; background: #EAF0F9 center/cover no-repeat; }
.live-tile .lt-info { padding: 6px 8px; font-size: .78rem; }
.live-tile .lt-info span { color: var(--sv-muted); }
.live-tile.claimed { border-color: var(--sv-green); }
.live-tile.claimed .lt-num { background: var(--sv-green-dark); }
.live-tile.claimed .lt-img { opacity: .45; }
.live-tile.gone { opacity: .35; }

/* Mini tienda pública */
.store-page { padding-bottom: 90px; background: #F4F7FB; }
.store-head { background: linear-gradient(135deg, var(--sv-brand), var(--sv-brand-dark)); color: #fff; padding: 18px 0 16px; }
.store-inner { max-width: 1100px; margin: 0 auto; padding: 0 14px; display: block; }
.store-head .store-inner { display: flex; align-items: center; gap: 14px; }
.store-logo { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; background: #fff; flex-shrink: 0; }
.store-name { font-weight: 900; font-size: 1.5rem; margin: 0; }
.store-today { font-size: .9rem; opacity: .95; margin-top: 2px; }
.store-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 576px) { .store-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .store-grid { grid-template-columns: repeat(4, 1fr); } }
.store-item { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); display: flex; flex-direction: column; }
.store-item .img { position: relative; aspect-ratio: 4/5; background: #EAF0F9 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: #9fb0c9; font-size: 2rem; }
.store-item .info { padding: 10px; display: flex; flex-direction: column; flex: 1; }
.store-item .nm { font-size: .85rem; color: var(--sv-muted); margin-bottom: 2px; }
.store-item .price { font-size: 1.15rem; font-weight: 900; }
.store-item .btn { margin-top: auto !important; }
.store-bag { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); box-shadow: 0 -4px 18px rgba(0,0,0,.08); z-index: 50; }
.store-bag .btn { max-width: 560px; margin: 0 auto; display: block; }
.list-sv .item.today { background: #E2EEFF; }

/* Hoy estoy en: calendario */
.week-cal { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.wc-day { flex: 0 0 120px; scroll-snap-align: start; background: #fff; border-radius: 16px; padding: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.wc-day.today { background: linear-gradient(160deg, var(--sv-brand), var(--sv-brand-dark)); color: #fff; }
.wc-day.rest { opacity: .7; }
.wc-name { font-weight: 900; text-transform: capitalize; }
.wc-date { font-size: 1.6rem; font-weight: 900; line-height: 1; margin-bottom: 6px; }
.wc-market { display: block; width: 100%; text-align: left; border: 0; border-radius: 10px; background: #E3F8F3; color: #00705F; font-weight: 800; font-size: .78rem; padding: 6px 8px; margin-bottom: 4px; }
.wc-market small { display: block; font-weight: 700; opacity: .8; }
.wc-day.today .wc-market { background: rgba(255,255,255,.2); color: #fff; }
.wc-rest { font-size: .8rem; color: var(--sv-muted); }
.wc-day.today .wc-rest { color: rgba(255,255,255,.8); }
@media (min-width: 992px) { .week-cal { display: grid; grid-template-columns: repeat(7, 1fr); overflow: visible; } .wc-day { flex: none; } }
#custList .item.sent { opacity: .55; }

/* Tarjeta de lealtad */
.stamps { display: grid; grid-template-columns: repeat(var(--cols, 5), 1fr); gap: 8px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #c9d6ea; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #9fb0c9; font-size: .95rem; background: #fff; }
.stamp.on { border: 0; background: var(--sv-pink); color: #fff; font-size: 1.1rem; }
.stamp.gift { border-color: var(--sv-accent); color: #E0A800; font-size: 1.2rem; }
.stamp.gift.on { background: var(--sv-accent); color: var(--sv-text); }
.loyalty-card { background: linear-gradient(140deg, var(--sv-brand), var(--sv-brand-dark) 60%, #2BC4F0); color: #fff; border-radius: 24px; padding: 22px; text-align: left; box-shadow: 0 14px 30px rgba(11,91,211,.25); }
.loyalty-card .stamps { margin: 16px 0; }
.loyalty-card .stamp { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); color: rgba(255,255,255,.8); }
.loyalty-card .stamp.on { background: #fff; color: var(--sv-pink); }
.loyalty-card .stamp.gift.on { background: var(--sv-accent); color: var(--sv-text); }
.lc-head { display: flex; align-items: center; gap: 12px; }
.lc-head img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.lc-biz { font-weight: 900; font-size: 1.15rem; }
.lc-title { font-size: .8rem; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.lc-name { font-weight: 900; font-size: 1.6rem; margin-top: 14px; }
.lc-msg { background: rgba(255,255,255,.15); border-radius: 14px; padding: 10px 12px; font-size: .95rem; }

/* Análisis */
.supplier-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 768px) { .supplier-grid { grid-template-columns: repeat(2, 1fr); } }
.supplier-grid .best { border: 2px solid var(--sv-green); }
.badges-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 768px) { .badges-grid { grid-template-columns: repeat(3, 1fr); } }
.badge-card { background: #fff; border-radius: 18px; padding: 14px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.badge-card .bc-icon { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; background: #EAF0F9; color: #9fb0c9; }
.badge-card.done .bc-icon { background: linear-gradient(135deg, var(--sv-accent), #FFB000); color: #fff; box-shadow: 0 4px 12px rgba(254,201,57,.5); }
.streak-chip { display: flex; align-items: center; gap: 8px; background: #FFF6DA; color: #7A5A00; font-weight: 800; border-radius: 14px; padding: 10px 14px; text-decoration: none; }
.streak-chip span { font-size: 1.3rem; }
.bar-h { height: 10px; background: #eef2f8; border-radius: 99px; overflow: hidden; }
.bar-h span { display: block; height: 100%; background: linear-gradient(90deg, var(--sv-sky), var(--sv-brand)); border-radius: 99px; }
.icon-circle.on { background: var(--sv-green); color: #fff; }
.card-sv.working { border: 2px solid var(--sv-green); }
@media print {
    .income-doc { border: 0 !important; padding: 0 !important; }
    .store-bag { display: none; }
}
