/* Naty Clothes · tema claro (rosa) y oscuro (ciruela). Todo con variables. */
:root, :root[data-theme="light"] {
  --bg: #FFF7F9; --surf: #FFFFFF; --surf2: #FCEEF2; --surf3: #F8E1E8;
  --text: #2A1620; --muted: #8A6B78; --line: #F1D9E1;
  --accent: #D6457F; --accent-deep: #A8346A; --accent-soft: #FBE3EC; --on-accent: #fff;
  --gold: #C08A3E;
  --ok: #1F9D66; --ok-soft: #DDF5EA; --bad: #D63A4E; --bad-soft: #FDE3E6; --warn: #C98100; --warn-soft: #FFF1D6;
  --wa: #1FA855;
  --shadow: 0 1px 2px rgba(120, 40, 80, .06), 0 6px 18px rgba(120, 40, 80, .07);
  --hero: linear-gradient(160deg, #FFE4EA 0%, #F9C9D6 100%);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #160E13; --surf: #221720; --surf2: #2B1E28; --surf3: #352633;
  --text: #F8EAF0; --muted: #B99AA9; --line: #3A2A36;
  --accent: #F0699A; --accent-deep: #D24C80; --accent-soft: #3D2232; --on-accent: #fff;
  --gold: #E2B46A;
  --ok: #3FCB8C; --ok-soft: #173326; --bad: #FF6B7D; --bad-soft: #3C1B22; --warn: #F2B544; --warn-soft: #3A2C12;
  --wa: #25C463;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px rgba(0, 0, 0, .25);
  --hero: linear-gradient(160deg, #3A1B2D 0%, #241520 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
small { font-size: .82rem; color: var(--muted); }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#app { max-width: 640px; margin: 0 auto; min-height: 100vh; }
#view { padding: calc(env(safe-area-inset-top) + 8px) 16px calc(110px + env(safe-area-inset-bottom)); }
#top:empty { display: none; }

/* ---------- Barra inferior ---------- */
#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  max-width: 640px; margin: 0 auto;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surf) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
#nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 56px; justify-content: center; color: var(--muted); }
#nav a b { font-size: .7rem; font-weight: 600; }
#nav a.on { color: var(--accent); }
#nav a.fab span {
  display: grid; place-items: center; width: 56px; height: 56px; margin-top: -26px; border-radius: 20px;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep)); color: var(--on-accent);
  box-shadow: 0 8px 20px rgba(214, 69, 127, .4);
}
#nav a.fab .ic { width: 28px; height: 28px; stroke-width: 2.4; }
#nav a.fab b { color: var(--accent); }
.nb { position: absolute; top: 2px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font: 700 .68rem/18px system-ui; font-style: normal; text-align: center; }

/* ---------- Encabezados ---------- */
.head { display: flex; align-items: center; gap: 10px; min-height: 56px; margin-bottom: 6px; }
.head-t { flex: 1; min-width: 0; }
.head h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.head p { color: var(--muted); font-size: .88rem; text-transform: capitalize; }
.head-r { display: flex; gap: 8px; }
.icbtn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surf); color: var(--text); box-shadow: var(--shadow); }
.icbtn.sm { width: 38px; height: 38px; border-radius: 12px; box-shadow: none; background: var(--surf2); }
.icbtn.sm .ic { width: 18px; height: 18px; }
.icbtn:disabled { opacity: .35; }

.hero { margin: -8px -16px 14px; padding: calc(env(safe-area-inset-top) + 14px) 16px 12px; background: var(--hero); border-radius: 0 0 28px 28px; }
.hero-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hero-top > div { flex: 1; }
.hero-top p { color: var(--accent-deep); font-weight: 600; font-size: .9rem; }
:root[data-theme="dark"] .hero-top p { color: var(--accent); }
.hero-top h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.hero-logo { width: 52px; height: 58px; filter: drop-shadow(0 6px 10px rgba(168, 52, 106, .25)); }

.sec-h { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.sec-h h2 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 750; }
.sec-h h2 .ic { color: var(--accent); width: 20px; height: 20px; }
.sec-h a { display: flex; align-items: center; color: var(--accent); font-weight: 650; font-size: .9rem; }
.sec-h a .ic { width: 18px; height: 18px; }

/* ---------- Zonas ---------- */
.zones, .filters, .chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.zones { margin: 0 -16px; padding: 2px 16px 4px; }
.zones::-webkit-scrollbar, .filters::-webkit-scrollbar { display: none; }
.chips { flex-wrap: wrap; overflow: visible; }
.filters { margin: 8px 0 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 40px; padding: 0 14px;
  border-radius: 999px; background: var(--surf); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; white-space: nowrap; color: var(--text);
}
.chip.sm { min-height: 34px; padding: 0 12px; font-size: .84rem; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.add { padding: 0 10px; color: var(--muted); }
.chip.add .ic { width: 18px; height: 18px; }
.chip.static { cursor: default; }
.chip .x { display: grid; place-items: center; margin-right: -6px; color: var(--muted); }
.chip .x .ic { width: 16px; height: 16px; }
.chip input { display: none; }
label.chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--zc); flex: none; }
.chip.on .dot { background: #fff; }
.ztag { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 650; color: var(--zc); }
.ztag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--zc); }

/* ---------- Tarjetas y listas ---------- */
.card { display: block; background: var(--surf); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); width: 100%; text-align: left; margin-bottom: 10px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.list { display: flex; flex-direction: column; }
.list > .card { margin-bottom: 8px; }
.crow { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.crow b, .due b { display: block; font-weight: 700; }
.crow small, .due small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.crow.dim, .card.dim { opacity: .55; }
.grow { flex: 1; min-width: 0; }
.grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.right b { font-variant-numeric: tabular-nums; }
.listinfo { margin: 6px 4px 8px; }
.more { display: flex; justify-content: center; align-items: center; gap: 4px; padding: 10px; color: var(--accent); font-weight: 650; }
.pick { display: flex; align-items: center; gap: 12px; min-height: 64px; color: var(--accent); font-weight: 700; border: 2px dashed color-mix(in srgb, var(--accent) 40%, transparent); box-shadow: none; background: var(--accent-soft); }
.pick b { flex: 1; }
.pic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); flex: none; }

.avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; flex: none; font-weight: 800; font-size: .95rem; color: #fff; background: var(--zc); }

.card.calm, .card.hint { display: flex; align-items: center; gap: 12px; }
.card.calm > .ic { color: var(--ok); width: 28px; height: 28px; }
.card.hint > .ic:first-child { color: var(--accent); width: 26px; height: 26px; }
.card.hint.warn > .ic:first-child { color: var(--warn); }
.card.calm b, .card.hint b { display: block; }
.card.hint > div { flex: 1; }
.card.hint > .ic:last-child { color: var(--muted); }
.card.note { display: flex; gap: 10px; align-items: flex-start; box-shadow: none; background: var(--surf2); }
.card.note .ic { width: 18px; height: 18px; color: var(--muted); margin-top: 2px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 20px; background: var(--surf); box-shadow: var(--shadow); min-width: 0; }
.kpi small { font-weight: 600; }
.kpi b { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.kpi span { font-size: .78rem; color: var(--muted); }
.kpi.big { grid-column: 1 / -1; background: linear-gradient(145deg, var(--accent), var(--accent-deep)); color: #fff; }
.kpi.big small, .kpi.big span { color: rgba(255, 255, 255, .85); }
.kpi.big b { font-size: 2.1rem; }
.kpi.bad b { color: var(--bad); }
.kpi.ok b { color: var(--ok); }

.kv3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.kv3 small { display: block; font-weight: 600; }
.kv3 b { font-size: 1.02rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Accesos */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 10px 6px; border-radius: 20px; background: var(--surf); box-shadow: var(--shadow); text-align: center; }
.tile .ic { width: 28px; height: 28px; color: var(--accent); }
.tile b { font-size: .8rem; font-weight: 650; }
.tile .nb { top: 8px; left: auto; right: 10px; margin: 0; }

/* Cobros */
.due { padding: 12px; }
.due-main { display: flex; align-items: center; gap: 12px; }
.due-main > div { flex: 1; min-width: 0; }
.due-main strong { font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.row-btns { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.row-btns.center { justify-content: center; }
.row-btns .btn.sm { flex: 1; }
.zone-h { display: flex; align-items: center; gap: 8px; margin: 18px 4px 8px; }
.zone-h h3 { font-size: 1rem; flex: 1; }
.zone-h span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.zone-h .dot { width: 12px; height: 12px; }
.total-bar { display: flex; align-items: center; justify-content: space-between; background: var(--accent-soft); box-shadow: none; }
.total-bar small { display: block; font-weight: 600; }
.total-bar b { font-size: 1.5rem; font-weight: 800; color: var(--accent-deep); }
:root[data-theme="dark"] .total-bar b { color: var(--accent); }
.total-bar span { color: var(--muted); font-weight: 600; }

.tabs { display: flex; gap: 4px; padding: 4px; margin: 10px 0 12px; border-radius: 16px; background: var(--surf2); overflow-x: auto; scrollbar-width: none; }
.tabs a { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 12px; border-radius: 12px; font-weight: 650; font-size: .88rem; color: var(--muted); white-space: nowrap; }
.tabs a.on { background: var(--surf); color: var(--text); box-shadow: var(--shadow); }
.tabs a i { font-style: normal; font-size: .72rem; min-width: 20px; height: 20px; line-height: 20px; border-radius: 10px; background: var(--surf3); text-align: center; padding: 0 5px; }
.tabs a.on i { background: var(--accent); color: #fff; }

/* Insignias */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--surf2); color: var(--muted); white-space: nowrap; }
.badge .ic { width: 12px; height: 12px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.ok-t { color: var(--ok) !important; }
.bad-t { color: var(--bad) !important; }
.warn-t { color: var(--warn) !important; }
.danger-t { color: var(--bad) !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.pad { padding: 24px 12px; }
.pad-x { padding: 0 4px 12px; }

/* Perfil del cliente */
.profile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin: -6px 0 14px; }
.profile .avatar { width: 76px; height: 76px; border-radius: 26px; font-size: 1.6rem; }
.profile h1 { font-size: 1.45rem; font-weight: 800; }
.profile p { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }

.sale .sale-h { display: flex; gap: 10px; cursor: pointer; }
.sale-h .grow b, .sale-h .grow small { display: block; }
.mini-in.on, .mini-in:not(:placeholder-shown) { border-color: var(--accent) !important; }
.bar { height: 8px; border-radius: 4px; background: var(--surf2); overflow: hidden; margin: 10px 0 6px; }
.bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-deep)); }
.bar.thin { height: 5px; margin: 5px 0 0; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 4px; }
.dots span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .7rem; font-weight: 700; background: var(--surf2); color: var(--muted); }
.dots .p { background: var(--ok); color: #fff; }
.dots .l { background: var(--bad); color: #fff; }
.dots .t { background: var(--warn); color: #fff; }
.cuotas { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.cuota { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--surf2); }
.cuota > span:first-child { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--surf); font-weight: 800; font-size: .8rem; color: var(--muted); flex: none; }
.cuota > span .ic { width: 16px; height: 16px; }
.cuota.p > span:first-child { background: var(--ok-soft); color: var(--ok); }
.cuota.l > span:first-child { background: var(--bad-soft); color: var(--bad); }
.cuota b { display: block; }

/* Filas tipo recibo */
.r-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.r-row:last-child { border-bottom: 0; }
.r-row span { color: var(--muted); }
.r-row b { font-variant-numeric: tabular-nums; text-align: right; }
.r-row.tot span { color: var(--text); font-weight: 700; }
.r-row.tot b { font-size: 1.25rem; font-weight: 800; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 16px; font-weight: 700; background: var(--surf2); color: var(--text); transition: transform .08s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; }
.btn.primary { background: linear-gradient(145deg, var(--accent), var(--accent-deep)); color: var(--on-accent); box-shadow: 0 6px 16px rgba(214, 69, 127, .28); }
.btn.soft { background: var(--accent-soft); color: var(--accent-deep); }
:root[data-theme="dark"] .btn.soft { color: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.wa { background: var(--wa); color: #fff; }
.btn.sm { min-height: 42px; padding: 0 14px; border-radius: 13px; font-size: .9rem; }
.btn.sm .ic { width: 19px; height: 19px; }
.btn.lg { min-height: 56px; font-size: 1.05rem; }
.btn.xl { min-height: 60px; font-size: 1.1rem; margin-top: 6px; }
.btn.block { display: flex; width: 100%; margin-top: 8px; }
.link { color: var(--accent); font-weight: 650; text-decoration: underline; font-size: .82rem; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field.left { text-align: left; }
.field > span { font-weight: 650; font-size: .88rem; }
.field > small { margin-top: -2px; }
input:not([type=radio]):not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surf); font-size: 16px; outline: none;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.money-in { position: relative; }
.money-in b { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.money-in input { padding-left: 30px !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; font-size: .92rem; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.card.form { box-shadow: none; border: 1px solid var(--line); }
.mini-in { width: 72px !important; min-height: 40px !important; padding: 6px 10px !important; border-radius: 999px !important; text-align: center; }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--surf2); }
.seg label, .seg button { flex: 1; }
.seg input { display: none; }
.seg span, .seg button { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 8px; border-radius: 12px; font-weight: 650; font-size: .88rem; color: var(--muted); text-align: center; }
.seg input:checked + span, .seg button.on { background: var(--surf); color: var(--accent-deep); box-shadow: var(--shadow); }
:root[data-theme="dark"] .seg input:checked + span, :root[data-theme="dark"] .seg button.on { color: var(--accent); background: var(--surf3); }
.seg.big { margin-bottom: 12px; }
.seg.big button { min-height: 52px; font-size: 1rem; }
.seg.mini { display: inline-flex; margin-top: 6px; padding: 3px; }
.seg.mini button { min-height: 30px; font-size: .76rem; padding: 0 10px; white-space: nowrap; }

.search { position: relative; margin: 10px 0 4px; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.search input { padding-left: 44px !important; border-radius: 16px !important; }

.stepper { display: flex; align-items: center; gap: 4px; background: var(--surf2); border-radius: 14px; padding: 3px; }
.stepper button { width: 38px; height: 38px; border-radius: 11px; background: var(--surf); font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.stepper b { min-width: 26px; text-align: center; font-size: 1.05rem; }
.stepper.wide input { flex: 1; min-width: 0; text-align: center; border: 0 !important; background: transparent !important; min-height: 38px !important; padding: 0 !important; font-weight: 800; box-shadow: none !important; }

/* Vender */
.step { display: flex; align-items: center; gap: 10px; margin: 18px 2px 10px; }
.step span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: .85rem; }
.step h2 { font-size: 1.05rem; }
.item { display: flex; align-items: center; gap: 10px; }
.item small { display: block; }
details.card > summary { cursor: pointer; font-weight: 650; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; min-height: 28px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; }
details.card[open] > summary { margin-bottom: 12px; }
details.card[open] > summary::after { content: "−"; }
.more-opts { box-shadow: none; border: 1px solid var(--line); }
.summary { margin: 16px 0 4px; padding: 14px 16px; border-radius: 20px; background: var(--surf); box-shadow: var(--shadow); }
.plan { margin: 10px 0; padding: 12px; border-radius: 16px; background: var(--accent-soft); }
.plan > b { display: block; font-size: 1.15rem; color: var(--accent-deep); }
:root[data-theme="dark"] .plan > b { color: var(--accent); }
.plan-dates { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; scrollbar-width: none; }
.plan-dates span { flex: none; display: flex; flex-direction: column; padding: 6px 10px; border-radius: 12px; background: var(--surf); font-size: .74rem; color: var(--muted); }
.plan-dates b { color: var(--text); font-size: .85rem; }

/* Calculadora */
.calc-box { margin: 0 0 12px; border-radius: 16px; background: var(--surf2); padding: 12px; }
.calc-box summary { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent-deep); cursor: pointer; list-style: none; min-height: 32px; }
:root[data-theme="dark"] .calc-box summary { color: var(--accent); }
.calc-box summary::-webkit-details-marker { display: none; }
.calc-box[open] summary { margin-bottom: 10px; }
.calc-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.sug { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.sug-main { display: flex; flex-direction: column; padding: 12px; border-radius: 14px; background: var(--surf); }
.sug-main b { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.sug-main span { font-size: .76rem; color: var(--muted); font-weight: 600; }

/* Inventario */
.prod { display: flex; gap: 12px; align-items: flex-start; }
.prod .grow b { display: block; }
.stock { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.stock span { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 650; }
.stock .ic { width: 15px; height: 15px; }
.stock .ok { color: var(--ok); }
.stock .warn { color: var(--warn); }
.stock .none { color: var(--muted); }
.stock .ord { color: var(--accent); }

/* Reportes */
.month-nav { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }
.month-nav b { font-size: 1.1rem; text-transform: capitalize; }
.result { text-align: center; }
.result > small { font-weight: 650; }
.result > b { display: block; font-size: 2.2rem; font-weight: 850; letter-spacing: -.03em; margin: 2px 0 8px; }
.eq { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.eq span { display: flex; flex-direction: column; font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums; }
.eq i { color: var(--muted); font-style: normal; }
.chart { padding: 12px 8px 10px; }
.bars { width: 100%; height: auto; display: block; }
.bars .grid { stroke: var(--line); stroke-width: 1; }
.bars .ax { fill: var(--muted); font-size: 10px; }
.bars .b1 { fill: var(--accent); }
.bars .b2 { fill: var(--gold); }
.bars .b3 { fill: var(--ok); }
.legend { display: flex; justify-content: center; gap: 14px; font-size: .78rem; color: var(--muted); font-weight: 600; margin-top: 4px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.l1 { background: var(--accent); } .l2 { background: var(--gold); } .l3 { background: var(--ok); }
.zrow { border-left: 5px solid var(--zc); }
.zrow-h { display: flex; align-items: center; gap: 8px; }
.zrow-h b { flex: 1; }
.zrow-g { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.zrow-g span { display: flex; flex-direction: column; font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums; }
.zrow-g small { font-size: .7rem; }
.zrow-g em { font-style: normal; }
.rank { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank:last-child { border-bottom: 0; }
.rank > span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-deep); font-weight: 800; font-size: .8rem; flex: none; }
.rank .grow b { display: block; }

/* Zonas y ajustes */
.zdot { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--zc) 18%, transparent); color: var(--zc); flex: none; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors input { display: none; }
.colors i { display: block; width: 40px; height: 40px; border-radius: 50%; background: var(--zc); border: 3px solid var(--surf); box-shadow: 0 0 0 2px transparent; }
.colors input:checked + i { box-shadow: 0 0 0 3px var(--zc); }
.set-sec { margin-top: 18px; }
.set-sec > h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 0 4px 8px; }
.set-sec > h2 .ic { color: var(--accent); width: 20px; height: 20px; }
.set-sec .card.flat .r-row span { color: var(--text); }
.set-sec .card.form > .btn.block:first-child { margin-top: 0; }
.about { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 28px 0 10px; text-align: center; }
.about img { width: 54px; height: 60px; }

/* Vacío */
.empty { text-align: center; padding: 32px 16px; }
.empty-ic { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 26px; background: var(--accent-soft); color: var(--accent); }
.empty-ic .ic { width: 36px; height: 36px; }
.empty h3 { font-size: 1.15rem; margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 16px; }

/* ---------- Hoja inferior ---------- */
#sheetWrap { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(30, 10, 20, .45); opacity: 0; transition: opacity .18s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 26px 26px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
#sheetWrap.open .sheet-bg { opacity: 1; }
#sheetWrap.open .sheet { transform: none; }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 4px; }
.sheet-body { padding: 8px 18px 8px; }
.sheet-body > h2 { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.sheet-body.center > h2 { justify-content: center; }
.sheet-body > h3 { margin: 14px 0 8px; font-size: 1rem; }
.sheet-body > p { margin-bottom: 12px; }
.sheet-body .list { margin-top: 10px; }
.confirm-ic { display: grid; place-items: center; width: 64px; height: 64px; margin: 8px auto 10px; border-radius: 22px; background: var(--accent-soft); color: var(--accent); }
.confirm-ic .ic { width: 32px; height: 32px; }
.confirm-ic.ok { background: var(--ok-soft); color: var(--ok); }
.confirm-ic.bad { background: var(--bad-soft); color: var(--bad); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; }
.pay-who { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.pay-who b, .pay-who small { display: block; }
.sheet .kv3 { background: var(--surf); border-radius: 16px; padding: 12px 6px; margin-bottom: 14px; }

.receipt { margin: 10px 0 14px; padding: 18px; border-radius: 22px; background: var(--surf); box-shadow: var(--shadow); text-align: left; }
.r-head { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 6px; }
.r-head img { width: 40px; height: 45px; }
.r-head b { color: var(--accent-deep); font-size: 1.1rem; }
:root[data-theme="dark"] .r-head b { color: var(--accent); }
.r-amt { text-align: center; font-size: 2.2rem; font-weight: 850; margin: 4px 0 10px; letter-spacing: -.02em; }

.welcome .w-logo { width: 84px; height: 94px; margin: 6px auto 8px; display: block; }
.w-icon { width: 76px; height: 76px; border-radius: 18px; margin: 6px auto 10px; display: block; }
.w-feats { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; text-align: left; }
.w-feats div { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--surf); }
.w-feats .ic { color: var(--accent); width: 26px; height: 26px; }
.steps { padding-left: 22px; margin: 8px 0 16px; line-height: 1.8; }
.steps .ic { width: 18px; height: 18px; vertical-align: -3px; }

#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 20px); opacity: 0;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 650; font-size: .92rem;
  transition: opacity .2s, transform .2s; pointer-events: none; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 420px) {
  .kpis { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
