/* ==========================================================
   Joyas & Brillo — sistema visual "Claro elegante"
   ========================================================== */
:root {
    color-scheme: only light;
    --bg: #faf7f2;
    --surface: #ffffff;
    --ink: #1c1917;
    --ink-2: #44403c;
    --muted: #8a847b;
    --line: #ece6db;
    --line-2: #f3eee5;
    --gold: #b48a3c;
    --gold-2: #d9b968;
    --gold-3: #f6ecd0;
    --gold-ink: #6f5116;
    --green: #2f7d62;
    --green-bg: #e7f4ee;
    --red: #b42318;
    --red-bg: #fdeceb;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(28,25,23,.04), 0 8px 24px rgba(28,25,23,.06);
    --shadow-lg: 0 20px 60px rgba(28,25,23,.22);
    --serif: 'Cormorant Garamond', Georgia, serif;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
body.no-scroll { overflow: hidden; }
button { font-family: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }
h1, h2, h3, h4, p { margin: 0; }
.material-icons-outlined { font-size: 22px; line-height: 1; vertical-align: middle; font-feature-settings: 'liga'; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }

#vista-admin { display: none; }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent;
    font-weight: 600; font-size: 14.5px; text-decoration: none; transition: transform .12s, box-shadow .2s, background .2s;
    background: var(--ink); color: #fff;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn .material-icons-outlined { font-size: 20px; }
.btn.block { width: 100%; }
.btn.gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #2b1e05; box-shadow: 0 6px 16px rgba(180,138,60,.28); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.soft { background: var(--line-2); color: var(--ink); }
.btn.danger-ghost { background: var(--surface); color: var(--red); border-color: #f3cfcb; }
.btn.wa { background: #1fa855; color: #fff; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 13px; border-radius: 12px; }

.icon-btn {
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
    background: var(--surface); display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-2); flex: 0 0 auto; transition: background .2s;
}
.icon-btn:hover { background: var(--line-2); }

/* ---------- Formularios ---------- */
label.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 6px 2px; letter-spacing: .2px; }
.lbl .opt { font-weight: 500; color: #b0a99d; }
.field { margin-bottom: 14px; }
.field input, .field select, input.input, select.input {
    width: 100%; height: 48px; padding: 0 14px; border-radius: 14px;
    border: 1px solid var(--line); background: #fff; color: var(--ink); outline: none;
    transition: border-color .2s, box-shadow .2s; appearance: none; -webkit-appearance: none;
}
.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238a847b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.field input:focus, .field select:focus, input.input:focus {
    border-color: var(--gold); box-shadow: 0 0 0 4px rgba(180,138,60,.15);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: var(--red); font-size: 13px; font-weight: 500; margin-bottom: 12px; display: none; }

.searchbox { position: relative; flex: 1; min-width: 0; }
.searchbox .material-icons-outlined { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox input {
    width: 100%; height: 50px; padding: 0 16px 0 46px; border-radius: 16px;
    border: 1px solid var(--line); background: #fff; outline: none; box-shadow: var(--shadow);
}
.searchbox input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(180,138,60,.15); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 18px 6px; margin: 0 -18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
    padding: 9px 16px; border-radius: 50px; font-weight: 500; font-size: 13.5px; transition: all .2s;
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Vista pública ---------- */
.pub-bar {
    position: sticky; top: 0; z-index: 40; background: rgba(250,247,242,.85);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-2);
}
.pub-bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.mini-brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: .3px; }
.mini-brand img { width: 32px; height: 32px; border-radius: 8px; mix-blend-mode: multiply; }

.hero { text-align: center; padding: 34px 0 20px; }
.hero img { width: 150px; height: 150px; object-fit: contain; mix-blend-mode: multiply; margin: -10px auto -6px; display: block; }
.hero h1 { font-family: var(--serif); font-size: clamp(38px, 9vw, 58px); font-weight: 600; line-height: 1; letter-spacing: .5px; }
.hero p { color: var(--muted); margin-top: 10px; font-size: 15px; }
.hero .ornament { width: 54px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 16px auto 0; }

.pub-tools { max-width: 640px; margin: 8px auto 4px; }
.pub-tools .chips { margin-top: 10px; }

.catalogo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 6px 0 20px; }
@media (min-width: 640px) { .catalogo { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (min-width: 960px) { .catalogo { grid-template-columns: repeat(4, 1fr); } }
.grupo-titulo { grid-column: 1 / -1; font-family: var(--serif); font-size: 28px; font-weight: 600; margin-top: 14px; display: flex; align-items: center; gap: 14px; }
.grupo-titulo::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.producto { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow); padding: 0; text-align: left; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; animation: aparece .4s both; }
.producto:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(28,25,23,.12); }
.producto .foto { position: relative; aspect-ratio: 4 / 5; background: #f3eee5; overflow: hidden; }
.producto .foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.producto:hover .foto img { transform: scale(1.04); }
.producto .cuerpo { padding: 12px 14px 14px; }
.producto .cuerpo .t { font-weight: 600; font-size: 15px; }
.producto .cuerpo .m { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.producto .cuerpo .p { font-weight: 700; margin-top: 8px; font-size: 16px; color: var(--gold-ink); font-variant-numeric: tabular-nums; }
.tag { position: absolute; left: 10px; top: 10px; background: rgba(28,25,23,.78); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; backdrop-filter: blur(4px); }
.tag.rojo { background: rgba(180,35,24,.9); }
.tag.n { left: auto; right: 10px; top: auto; bottom: 10px; background: rgba(255,255,255,.9); color: var(--ink); }

.vacio { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 44px 16px; font-size: 14.5px; }
.vacio .material-icons-outlined { font-size: 40px; color: #d6cdbd; display: block; margin: 0 auto 8px; }

.skeleton { background: linear-gradient(90deg, #f1ebdf 25%, #f8f4ec 50%, #f1ebdf 75%); background-size: 200% 100%; animation: brillo 1.3s infinite; border-radius: var(--radius); aspect-ratio: 4 / 5.6; }
@keyframes brillo { to { background-position: -200% 0; } }
@keyframes aparece { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.pub-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0 110px; }
.fab-wa {
    position: fixed; right: 18px; bottom: calc(18px + var(--safe-b)); z-index: 45;
    width: 56px; height: 56px; border-radius: 50%; background: #1fa855; color: #fff; border: none;
    display: flex; align-items: center; justify-content: center; text-decoration: none;
    box-shadow: 0 10px 26px rgba(31,168,85,.4);
}
.fab-wa svg { width: 28px; height: 28px; fill: #fff; }
.volver-panel { display: none; }
body.preview .volver-panel { display: inline-flex; }
body.preview .acceso-btn { display: none; }

/* ---------- Panel admin ---------- */
.adm-bar { position: sticky; top: 0; z-index: 40; background: rgba(250,247,242,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.adm-bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.adm-actions { display: flex; gap: 8px; }

main.adm { padding-bottom: calc(120px + var(--safe-b)); }
.seccion { display: none; animation: aparece .35s both; }
.seccion.on { display: block; }
.page-title { font-family: var(--serif); font-size: 36px; font-weight: 600; line-height: 1.05; margin: 8px 0 4px; }
.page-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.dock {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); z-index: 50;
    display: flex; gap: 4px; padding: 6px; background: rgba(28,25,23,.94); border-radius: 26px;
    box-shadow: 0 14px 40px rgba(0,0,0,.28); backdrop-filter: blur(12px); width: min(92vw, 420px);
}
.dock button {
    flex: 1; border: none; background: transparent; color: rgba(255,255,255,.55); padding: 9px 6px 8px;
    border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 600; transition: all .25s;
}
.dock button .material-icons-outlined { font-size: 23px; }
.dock button.on { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #2b1e05; }

/* Inicio */
.saldo-hero {
    background: radial-gradient(120% 140% at 90% 0%, #4a3813 0%, #1f1a12 60%);
    color: #fff; border-radius: 24px; padding: 22px 22px 20px; position: relative; overflow: hidden;
    box-shadow: 0 18px 40px rgba(31,26,18,.3);
}
.saldo-hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; border: 1px solid rgba(217,185,104,.25); }
.saldo-hero small { color: var(--gold-2); font-weight: 600; letter-spacing: 1.5px; font-size: 11px; }
.saldo-hero .monto { font-family: var(--serif); font-size: 48px; font-weight: 600; line-height: 1.05; margin: 6px 0 2px; font-variant-numeric: lining-nums; }
.saldo-hero .sub { color: rgba(255,255,255,.65); font-size: 13.5px; }
.saldo-hero .btn { margin-top: 16px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 6px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .material-icons-outlined { color: var(--gold); font-size: 22px; }
.stat b { display: block; font-size: 21px; font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }

.acciones-rapidas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 6px; }
.accion { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow); }
.accion .material-icons-outlined { color: var(--gold); font-size: 26px; }

.bloque { margin-top: 22px; }
.bloque-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.bloque-head h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.bloque-head button { border: none; background: none; color: var(--gold-ink); font-weight: 600; font-size: 13px; padding: 4px; }
.cols { display: grid; gap: 0 22px; }
@media (min-width: 860px) { .cols { grid-template-columns: 1fr 1fr; } }

.lista { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%;
    border: none; border-bottom: 1px solid var(--line-2); background: transparent; text-align: left;
}
.item:last-child { border-bottom: none; }
button.item:hover { background: #fdfbf7; }
.item .cuerpo { flex: 1; min-width: 0; }
.item .t { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { color: var(--muted); font-size: 12.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .v { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.v.deuda { color: var(--red); }
.v.pago { color: var(--green); }
.v.cero { color: var(--muted); font-weight: 500; font-size: 13px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--gold-3); color: var(--gold-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.miniatura { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #f3eee5; flex: 0 0 auto; }
.dot { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.dot.pago { background: var(--green-bg); color: var(--green); }
.dot.deuda { background: var(--red-bg); color: var(--red); }
.dot .material-icons-outlined { font-size: 18px; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .btn { flex: 0 0 auto; }
.resumen { color: var(--muted); font-size: 13px; margin: 4px 2px 10px; }

/* Inventario admin */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.tile .foto { position: relative; aspect-ratio: 1; background: #f3eee5; border: none; padding: 0; display: block; width: 100%; }
.tile .foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .cuerpo { padding: 10px 12px 12px; }
.tile .t { font-weight: 600; font-size: 14px; }
.tile .s { color: var(--muted); font-size: 12px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .pie { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 6px; }
.tile .pie b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.qty { display: flex; align-items: center; background: var(--line-2); border-radius: 50px; }
.qty button { width: 30px; height: 30px; border: none; background: transparent; font-size: 18px; font-weight: 600; border-radius: 50%; }
.qty span { min-width: 20px; text-align: center; font-weight: 700; font-size: 14px; }

/* ---------- Modales / hojas ---------- */
.overlay {
    display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(28,25,23,.5);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    align-items: center; justify-content: center; padding: 18px;
}
.overlay.open { display: flex; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sube { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet {
    background: var(--bg); border-radius: 26px; width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto;
    padding: 24px 22px 22px; position: relative; box-shadow: var(--shadow-lg); animation: sube .28s both;
    overscroll-behavior: contain;
}
.sheet.ancho { max-width: 560px; }
.sheet h3.titulo { font-family: var(--serif); font-size: 28px; font-weight: 600; margin: 0 40px 16px 0; line-height: 1.1; }
.cerrar { position: absolute; top: 16px; right: 16px; z-index: 6; width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.cerrar .material-icons-outlined { font-size: 20px; }
@media (max-width: 640px) {
    .overlay { align-items: flex-end; padding: 0; }
    .sheet { max-width: none; border-radius: 28px 28px 0 0; max-height: 94vh; padding-bottom: calc(24px + var(--safe-b)); }
    .sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: #d9d2c4; margin: -12px auto 14px; }
}

/* Fotos del formulario */
.fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 480px) { .fotos { grid-template-columns: repeat(4, 1fr); } }
.fotos .ft { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #f3eee5; }
.fotos .ft img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fotos .ft button { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(28,25,23,.75); color: #fff; padding: 0; font-size: 13px; line-height: 1; }
.fotos .ft .portada { position: absolute; left: 5px; bottom: 5px; background: var(--gold-2); color: #2b1e05; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.fotos .agregar { aspect-ratio: 1; border: 1.5px dashed #d3c9b6; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 600; background: transparent; }
.fotos .agregar .material-icons-outlined { font-size: 28px; color: var(--gold); }

/* Detalle de producto */
.carrusel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 20px; background: #f3eee5; scrollbar-width: none; }
.carrusel::-webkit-scrollbar { display: none; }
.carrusel img { flex: 0 0 100%; width: 100%; min-width: 0; max-width: 100%; height: auto; aspect-ratio: 1 / 1; scroll-snap-align: center; object-fit: cover; display: block; }
.dots { text-align: center; margin: 10px 0 4px; min-height: 8px; }
.dots i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #d6cdbd; margin: 0 3px; transition: all .2s; }
.dots i.on { background: var(--gold); width: 18px; border-radius: 4px; }
.det-precio { font-family: var(--serif); font-size: 38px; font-weight: 600; color: var(--gold-ink); margin: 4px 0 12px; }
.ficha { display: grid; gap: 0; margin-bottom: 18px; background: var(--surface); border-radius: 16px; border: 1px solid var(--line-2); overflow: hidden; }
.ficha div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.ficha div:last-child { border-bottom: none; }
.ficha span { color: var(--muted); }
.ficha b { font-weight: 600; text-align: right; }

/* Cuenta del cliente */
.cli-head { display: flex; align-items: center; gap: 14px; margin: 0 44px 14px 0; }
.cli-head h3 { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.05; overflow-wrap: anywhere; }
.cli-head p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.cli-btns { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.cli-btns::-webkit-scrollbar { display: none; }
.cli-btns .btn { flex: 0 0 auto; }
.saldo-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; box-shadow: var(--shadow); }
.saldo-card small { color: var(--muted); font-size: 12px; font-weight: 600; }
.saldo-card .monto { font-family: var(--serif); font-size: 40px; font-weight: 600; line-height: 1; margin-top: 4px; color: var(--red); }
.saldo-card .monto.cero { color: var(--green); }
.saldo-card .detalle { text-align: right; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--line-2); border-radius: 14px; padding: 4px; margin: 16px 0 14px; }
.seg button { border: none; background: transparent; height: 40px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--muted); transition: all .2s; }
.seg button.on { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); color: var(--ink); }
.seg button.on.abono { color: var(--green); }
.seg button.on.cargo { color: var(--red); }
.check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; margin-bottom: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.link-sm { border: none; background: none; color: var(--gold-ink); font-weight: 600; font-size: 12.5px; padding: 0; }
.hist-titulo { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 22px 0 8px; }
.hist-lista { max-height: 300px; overflow-y: auto; }

#confirm-modal { z-index: 2000; }
#confirm-modal .sheet { max-width: 380px; text-align: center; padding-top: 28px; }
#confirm-modal .sheet::before { display: none; }
#confirm-msg { font-size: 15.5px; font-weight: 500; line-height: 1.45; }
.confirm-btns { display: flex; gap: 10px; margin-top: 20px; }
.confirm-btns .btn { flex: 1; }
@media (max-width: 640px) { #confirm-modal { align-items: center; padding: 18px; } #confirm-modal .sheet { border-radius: 26px; } }

#toast {
    position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 3000;
    background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 50px; font-size: 14px; font-weight: 500;
    opacity: 0; pointer-events: none; transition: .25s; max-width: 90vw; text-align: center; box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--red); }

/* ---------- Cobranza por zonas ---------- */
.semana-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.semana-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.semana-top small { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 1px; }
.semana-top b { display: block; font-family: var(--serif); font-size: 34px; font-weight: 600; color: var(--green); line-height: 1.1; }
.seg-mini { display: flex; background: var(--line-2); border-radius: 12px; padding: 3px; }
.seg-mini button { border: none; background: transparent; padding: 7px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg-mini button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.progreso { height: 8px; border-radius: 8px; background: var(--line-2); overflow: hidden; margin: 12px 0 8px; }
.progreso i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--gold-2), var(--green)); transition: width .5s; }
.progreso.mini { height: 6px; margin: 6px 0 4px; }
.sem-detalle { font-size: 13px; color: var(--ink-2); }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.warn { background: #fff4e0; color: #b45309; }
.pill.gris { background: var(--line-2); color: var(--muted); }
.zona-tag { display: inline-block; font-size: 11.5px; color: var(--gold-ink); background: var(--gold-3); padding: 2px 9px; border-radius: 20px; font-weight: 600; }
.etiquetas { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.zona-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 18px 4px 8px; }
.zona-head b { font-family: var(--serif); font-size: 23px; font-weight: 600; }
.zona-head span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.zona-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.zona-row .input { flex: 1; min-width: 0; height: 44px; }
.zona-row small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.zona-row .zona-nombre { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zona-row .zona-nombre + .input { flex: 0 0 46%; }
.hint { color: var(--muted); font-size: 13px; margin: -6px 0 14px; line-height: 1.45; }

.pill.aplaza { background: #ede9fe; color: #6d28d9; }
.dot.aplaza { background: #ede9fe; color: #6d28d9; }
.dot.devol { background: #e0f2fe; color: #0369a1; }
.v.devol { color: #0369a1; font-weight: 700; }
.devol-info { background: #e0f2fe; border: 1px solid #bae6fd; border-radius: 14px; padding: 14px 16px; font-size: 13.5px; line-height: 1.5; color: #0c4a6e; }
.devol-info p { margin: 0 0 6px; }
.devol-info p:last-child { margin-bottom: 0; }
.ct-box { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 4px 16px; }
.ct-linea { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; gap: 10px; }
.ct-linea:last-child { border-bottom: none; }
.ct-linea.total { font-size: 16px; font-weight: 700; }
.ct-linea.total b { color: var(--gold-ink); font-size: 19px; }
.v.aplaza { color: #6d28d9; }
.zona-tag.dia { background: var(--line-2); color: var(--ink-2); }
.zona-tag.vend { background: #e0ecff; color: #1d4ed8; }
.seg { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.seg button.on.aplazo { color: #6d28d9; }
.ruta-hoy { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: linear-gradient(135deg, #fffaf0, #fdf0cf); border: 1px solid var(--gold-2); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.ruta-hoy small { display: block; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--gold-ink); }
.ruta-hoy b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.1; margin: 2px 0; }
.ruta-hoy span { font-size: 13px; color: var(--ink-2); }

.dock-badge { position: absolute; top: 3px; right: calc(50% - 22px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; align-items: center; justify-content: center; border: 2px solid rgba(28,25,23,.94); box-sizing: content-box; }
.aprobar-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--gold-3); border: 1px solid var(--gold-2); border-radius: 14px; padding: 10px 12px; font-size: 13px; font-weight: 500; margin-bottom: 12px; }

.grupo-pend { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--gold-3); border-bottom: 1px solid var(--line-2); }
.grupo-pend b { display: block; font-size: 14px; }
.grupo-pend span { font-size: 12px; color: var(--gold-ink); }

/* ---------- Descubrimiento de productos ---------- */
.icon-btn.grande { width: 50px; height: 50px; border-radius: 16px; position: relative; box-shadow: var(--shadow); }
.badge-filtros { display: none; position: absolute; top: 7px; right: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; }
.badge-filtros.on { display: block; }
.barra-resultados { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 14px; color: var(--muted); font-size: 13.5px; }
.barra-resultados select { border: none; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 13.5px; padding: 6px 0 6px 6px; outline: none; max-width: 190px; }
.wrapchips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.solo-escritorio { display: none; }
@media (min-width: 640px) { .solo-escritorio { display: inline; } }
.fab-wa .material-icons-outlined { font-size: 28px; }
.limpiar-btn { margin-top: 14px; }
.vacio .btn { margin: 12px 4px 0; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.sheet .chips.wrapchips .chip { margin: 0; }

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