/* Diseño B v2 (el jefe lo eligió el 21 oct): Finanzas, hoja de gasto, gastos fijos, menú de abajo y Mis clientes.
   Solo lo visual: se carga DESPUÉS de panel.css y pisa sus reglas. Doble bisel (bandeja + núcleo), sombras suaves, íconos propios, números tabulares.
   Claro y oscuro siguen al sistema, igual que el resto del panel. */
:root {
  --canvas: #f4f4f2; --card: #fff; --shell: rgb(10 10 10 / .045); --hair: rgb(10 10 10 / .07); --hi: rgb(255 255 255 / .95); --lift: 0 10px 28px -14px rgb(20 24 40 / .16);
  --mint: #0a7650; --mintbg: #e3f3ec; --coral: #b5380a; --coralbg: #fdebe1; --amber: #8a5206; --amberbg: #faefd3; --blue: #1d4ed8; --bluebg: #e6edfd; --pink: #be185d; --pinkbg: #fbe7f0;
}
@media (prefers-color-scheme: dark) {
  :root { --canvas: #050505; --card: #151515; --shell: rgb(255 255 255 / .05); --hair: rgb(255 255 255 / .08); --hi: rgb(255 255 255 / .07); --lift: 0 10px 28px -14px rgb(0 0 0 / .7);
    --mint: #4ade9a; --mintbg: #0f2a1f; --coral: #fb9a5c; --coralbg: #2e1a0f; --amber: #f5c542; --amberbg: #2b2408; --blue: #8fb0ff; --bluebg: #14213f; --pink: #f58cbd; --pinkbg: #32111f; }
}
body[data-v="finanzas"], body[data-v="clientes"] { background: var(--canvas); }
.fi { width: 22px; height: 22px; flex: none; display: block; }
.tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; flex: none; background: var(--soft-2); color: var(--ink); }
.t-blue { background: var(--bluebg); color: var(--blue); } .t-amber { background: var(--amberbg); color: var(--amber); } .t-mint { background: var(--mintbg); color: var(--mint); } .t-pink { background: var(--pinkbg); color: var(--pink); } .t-coral { background: var(--coralbg); color: var(--coral); }

/* ---- Menú de abajo: píldora flotante (celular). En escritorio sigue siendo el menú lateral ---- */
@media (max-width: 899px) {
  .nav { left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); padding: 6px; border: 0; border-radius: 30px; background: color-mix(in srgb, var(--card) 82%, transparent);
    box-shadow: 0 0 0 1px var(--hair), 0 18px 40px -12px rgb(0 0 0 / .28), inset 0 1px 0 var(--hi); }
  .nav-ind { border-radius: 22px; }
  .vista { padding-bottom: calc(124px + env(safe-area-inset-bottom)); }
  .con-fab .vista { padding-bottom: calc(184px + env(safe-area-inset-bottom)); }
  .fab-asis { bottom: calc(100px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(108px + env(safe-area-inset-bottom)); }
  .save-bar, .asis-form { bottom: calc(92px + env(safe-area-inset-bottom)); }
}

/* ---- Finanzas ---- */
.mes .btn-icon { width: 48px; height: 48px; background: var(--card); box-shadow: 0 0 0 1px var(--hair); }
.heroN.gan { gap: 2px; padding: 24px 22px 22px; border-radius: 32px; box-shadow: var(--lift); }
.heroN.gan > small { font-size: .88rem; font-weight: 700; opacity: .66; }
.heroN.gan .gan-n { margin: 6px 0 2px; font: 800 clamp(2.4rem, 12vw, 3.2rem)/1.05 var(--display); letter-spacing: -.05em; }
.heroN.gan .gan-sub { font-size: .82rem; font-weight: 600; opacity: .62; margin-bottom: 14px; }
.heroN.gan .par { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.heroN.gan .mini { padding: 12px 14px; border-radius: 20px; background: color-mix(in srgb, var(--on-ink) 11%, transparent); color: inherit; }
.heroN.gan .mini small { color: inherit; opacity: .66; }
.heroN.gan .mini b { font: 800 clamp(1.1rem, 5.4vw, 1.3rem)/1.1 var(--display); letter-spacing: -.03em; }
.heroN.gan .mini .up { color: #5eeaa8; } .heroN.gan .mini .dn { color: #ffab72; }
@media (prefers-color-scheme: dark) { .heroN.gan .mini .up { color: #0a7650; } .heroN.gan .mini .dn { color: #b5380a; } }
.heroN.gan .mini span { color: inherit; opacity: .62; }
.vs-fila { display: flex; margin: 14px 0 24px; }
.vs-fila .vs { margin: 0; padding: 7px 13px 7px 10px; border-radius: 99px; background: var(--mintbg); color: var(--mint); }
.vs-fila .vs.baja { background: var(--coralbg); color: var(--coral); }
.sec2 { margin-bottom: 30px; }
.sec2 > h2 { font-size: 1.25rem; margin-left: 4px; letter-spacing: -.02em; }
.sec2 > .sub { margin-left: 4px; }
.graf { padding: 16px 14px 12px; border: 0; border-radius: 24px; background: var(--card); box-shadow: inset 0 1px 0 var(--hi), var(--lift), 0 0 0 6px var(--shell), 0 0 0 7px var(--hair); margin: 7px; }
.bars i { background: color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 4px 4px 3px 3px; }
.bars i.top { background: var(--ink); }
.desglose { padding: 16px 18px; border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--hair), var(--lift); }
.desglose p:last-child { border-top: 0; padding-top: 0; font-weight: 700; }
.desglose p:last-child:not([data-por-cobrar]) { font-weight: 600; }

/* Lo más vendido: tarjetas con foto, se deslizan de lado */
.top-l { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 14px; scroll-snap-type: x proximity; scrollbar-width: none; }
.top-l::-webkit-scrollbar { display: none; }
.top-l .top { position: relative; flex: none; width: 152px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px 10px 14px; border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--hair), var(--lift); scroll-snap-align: start; align-items: start; }
.top-img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 18px; background: var(--soft-2); }
.top-r { position: absolute; top: 16px; left: 16px; width: 28px; height: 28px; font-size: .8rem; background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgb(0 0 0 / .25); }
.top-l .top:first-child .top-r { background: var(--ink); color: var(--on-ink); }
.top-t { padding: 0 4px; gap: 3px; }
.top-t > b { font-size: .92rem; font-weight: 800; }
.top-b { display: block; }
.top-b i { display: none; }
.top-b span { font-size: .82rem; }

/* Gastos: filas con ícono propio dentro de una bandeja de doble bisel */
.gasto-l { border: 0; border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--hair), var(--lift); }
.gasto { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 2px 14px; min-height: 68px; padding: 12px 16px; }
.gasto .tile { grid-row: 1 / span 2; }
.gasto b { grid-column: 2; align-self: end; } .gasto small { grid-column: 2; align-self: start; }
.gasto strong { grid-column: 3; }
.gasto + .gasto { border-top: 0; box-shadow: inset 0 1px 0 var(--hair); }
.gasto-t { background: transparent; box-shadow: inset 0 1px 0 var(--hair); }
.catgasto-l { gap: 0; border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--hair), var(--lift); overflow: hidden; }
.catgasto { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 2px 14px; padding: 12px 16px; border-radius: 0; background: transparent; }
.catgasto + .catgasto { box-shadow: inset 0 1px 0 var(--hair); }
.catgasto .tile { grid-row: 1 / span 2; }
.catgasto b { grid-column: 2; align-self: end; } .catgasto strong { grid-column: 3; grid-row: 1 / span 2; } .catgasto small { grid-column: 2; align-self: start; }
.catgasto-b { display: none; }
.anillo { display: grid; place-items: center; padding: 6px 0 2px; }
.anillo svg { width: 156px; height: 156px; }
.fijo-pend { grid-template-columns: 44px minmax(0, 1fr) auto; border-radius: 28px; padding: 14px 14px 14px 14px; box-shadow: var(--lift); }
.fijo-pend .tile { background: color-mix(in srgb, var(--on-ink) 14%, transparent); color: var(--on-ink); }
.fijo-pend .btn { border-radius: 99px; }

/* ---- Hoja de gasto ---- */
.sheet-in { border-radius: 34px 34px 0 0; box-shadow: inset 0 1px 0 var(--hi), var(--shadow); }
.sheet-in::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 5px; background: var(--soft-2); }
@media (min-width: 760px) { .sheet-in { border-radius: 30px; } .sheet-in::before { display: none; } }
.sheet-head { border-bottom: 0; padding-top: 18px; }
.gasto-monto .monto-fila { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 20px; border-radius: 26px; background: var(--soft); }
.gasto-monto .monto-fila .mon { order: 2; background: var(--bg); border-radius: 99px; padding: 4px; }
.gasto-monto .monto-fila .mon-b { min-width: 56px; min-height: 44px; border-radius: 99px; }
.gasto-monto .monto-fila input#g-monto { order: 1; flex: 1; min-width: 0; width: 100%; min-height: 56px; padding: 0; border: 0; background: transparent; box-shadow: none; font: 800 2.4rem/1 var(--display); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.gasto-monto .monto-fila input#g-monto::placeholder { color: var(--muted); }
.gasto-monto .monto-fila input#g-monto:focus { outline: none; box-shadow: none; }
.gasto-monto .monto-fila:focus-within { box-shadow: 0 0 0 2px var(--ink); }
[data-g-equiv] { padding-left: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.catchips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.catchip { flex-direction: column; justify-content: center; gap: 6px; min-height: 80px; padding: 10px 2px 9px; border-radius: 20px; background: var(--soft); font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.15; color: var(--ink); overflow-wrap: anywhere; }
.catchip .tile { width: 40px; height: 40px; border-radius: 13px; }
.catchip[aria-pressed="true"] { background: var(--soft); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.gasto-fecha input[type="date"], #g-fecha { border-radius: 20px; border: 0; background: var(--soft); min-height: 56px; padding: 0 18px; font-weight: 700; }
.sheet-in .switch { padding: 0 4px; }

/* ---- Mis clientes (mismo estilo) ---- */
.cifra { padding: 14px 14px 12px; border-radius: 22px; background: var(--card); box-shadow: 0 0 0 1px var(--hair), var(--lift); }
.cifra b { font: 800 1.45rem/1.1 var(--display); letter-spacing: -.04em; }
.cifra span { font-size: .8rem; }
.clist { gap: 0; padding: 0 14px; border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--hair), var(--lift); }
.cli { border: 0; border-radius: 0; background: transparent; padding: 12px 0; }
.cli + .cli { box-shadow: inset 0 1px 0 var(--hair); }
.av.vip { background: var(--amberbg); color: var(--amber); }
.cli-wa { background: var(--mintbg); color: var(--mint); }
.big-wa { border-radius: 24px; background: var(--mintbg); color: var(--mint); min-height: 64px; }
.big-wa small { color: var(--muted); opacity: 1; }
.stat3 { padding: 14px 8px; border-radius: 22px; background: var(--card); box-shadow: 0 0 0 1px var(--hair), var(--lift); }
.stat3 b { letter-spacing: -.03em; }
.ped { border: 0; border-radius: 22px; background: var(--card); box-shadow: 0 0 0 1px var(--hair), var(--lift); }
.notas { background: var(--card); box-shadow: 0 0 0 1px var(--hair), var(--lift); }
.pro { display: none; }   /* Etiquetas y notas son para todos los planes (decisión del jefe, 21 oct): sin la marca «Pro» */
.fchip { background: var(--card); box-shadow: 0 0 0 1px var(--hair); }
.fchip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.cn, .chip-n { font-weight: 800; }

@media (prefers-reduced-motion: reduce) { .top-l { scroll-behavior: auto; } }

/* ---- Mis clientes: «Agregar cliente», su hoja y la marca «Agregado a mano» (azul, para no confundirla con VIP) ---- */
.head:has([data-cli-nuevo]) { display: block; }
[data-cli-nuevo] { width: 100%; min-height: 56px; margin-top: 16px; gap: 10px; font-size: 1rem; box-shadow: var(--lift); }
.cli-mano { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 99px; background: var(--bluebg); color: var(--blue); font-size: .78rem; font-weight: 800; }
.cli:has(.cli-mano) .av, .cf:has(.cf-mano) .av.lg { background: var(--bluebg); color: var(--blue); }
.cf-mano { gap: 10px; padding: 16px; border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--hair), var(--lift); }
.cf-mano .chip { background: var(--bluebg); color: var(--blue); font-weight: 800; }
.cf-acc { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-in [data-cli-form] .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), [data-cli-form] .field textarea, [data-cli-form] .cedula-fila select { min-height: 56px; padding: 0 18px; border: 0; border-radius: 20px; background: var(--soft); font-weight: 600; box-shadow: none; }
[data-cli-form] .field textarea { padding: 14px 18px; min-height: 96px; }
.sheet-in [data-cli-form] .field input:focus, [data-cli-form] .field textarea:focus, [data-cli-form] .cedula-fila select:focus { outline: none; box-shadow: 0 0 0 2px var(--ink); }
[data-cli-form] .cedula-fila { grid-template-columns: 88px minmax(0, 1fr); }
[data-cli-form] .etq-op { min-height: 44px; background: var(--soft); box-shadow: none; }
[data-cli-form] .etq-op[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.sheet-in [data-cli-form] .cn-otra .btn { border-radius: 99px; }
