/* ════════════════════════════════════════════════════════════════════
   NV Streaming · Balance financiero 5.5 (nv-finanzas-550.css)
   Todo por tokens del tema (10 temas). Prefijo .nvf-
   ════════════════════════════════════════════════════════════════════ */

/* La vista vieja queda oculta (sus funciones siguen funcionando) */
#page-precios.nvf-on #ci-balance-section,
#page-precios.nvf-on #account-pricing-section,
#page-precios.nvf-on #finance-stats,
#page-precios.nvf-on #tab-finanzas > .accounts-section { display: none !important; }
/* .page se centra con márgenes automáticos; con contain el ancho ya no sale del contenido */
#page-precios.nvf-on { width: 100%; box-sizing: border-box; }

.nvf {
  --nvf-r: 18px;
  --nvf-ing: var(--accent);
  --nvf-ing2: rgba(var(--nv-accent-rgb, 108,123,255), .38);
  --nvf-cost: color-mix(in srgb, var(--text) 62%, transparent); /* neutro: nunca choca con el acento del tema */
  --nvf-pos: var(--green2, #34d399);
  --nvf-neg: var(--red2, #f87171);
  --nvf-spring: cubic-bezier(.34, 1.36, .64, 1);
  --nvf-out: cubic-bezier(.22, 1, .36, 1);
  --nvf-num: var(--nv54-font-kpi, var(--nv-font-num, var(--nv-font-display, inherit)));
  display: flex; flex-direction: column; gap: 14px;
  max-width: 1320px; margin: 0 auto 28px; min-width: 0;
  width: 100%; contain: inline-size; /* su contenido (tablas, franja de días) no ensancha #main */
  font-family: var(--nv-font-ui, inherit); color: var(--text);
}
.nvf *, .nvf *::before, .nvf *::after { box-sizing: border-box; }
.nvf h2, .nvf h3, .nvf p { margin: 0; }

/* ── Encabezado ─────────────────────────────────────────────────── */
.nvf-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nvf-hd-t { min-width: 0; }
.nvf-eyebrow { font: 700 11px/1 var(--nv-font-ui, inherit); letter-spacing: .12em; text-transform: uppercase; color: var(--accent2, var(--accent)); }
.nvf-hd h2 { font: var(--nv54-w-display, 700) 26px/1.15 var(--nv-font-display, inherit); letter-spacing: var(--nv54-ls-display, -.02em); margin-top: 6px; color: var(--text); }
.nvf-hd p { color: var(--text3); font-size: 13px; margin-top: 4px; }
.nvf-hd-act { display: flex; gap: 8px; }

.nvf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 11px;
  border: 1px solid var(--border2, var(--border)); background: var(--bg3); color: var(--text);
  font: 650 12.5px/1 var(--nv-font-ui, inherit); cursor: pointer; white-space: nowrap;
  transition: background .18s, border-color .18s, transform .18s var(--nvf-spring), box-shadow .18s;
}
.nvf-btn:hover { background: var(--bg4); border-color: rgba(var(--nv-accent-rgb, 108,123,255), .45); }
.nvf-btn:active { transform: scale(.96); }
.nvf-btn.pri { background: var(--accent); border-color: transparent; color: var(--nv54-on-accent, #fff); }
.nvf-btn.pri:hover { background: var(--accent2, var(--accent)); }
.nvf-btn.sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 9px; flex-shrink: 0; }
.nvf-ib {
  width: 30px; height: 30px; flex-shrink: 0; display: inline-grid; place-items: center; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s var(--nvf-spring);
}
.nvf-ib:hover { background: var(--bg4); color: var(--text); }
.nvf-ib:active { transform: scale(.92); }
.nvf-ib.del:hover { color: var(--nvf-neg); border-color: color-mix(in srgb, var(--nvf-neg) 40%, transparent); }
.nvf-link { align-self: flex-start; background: none; border: 0; padding: 4px 0; color: var(--accent2, var(--accent)); font: 650 12.5px/1.2 var(--nv-font-ui, inherit); cursor: pointer; }
.nvf-link:hover { text-decoration: underline; }
.nvf button:focus-visible, .nvf input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Selector de período ────────────────────────────────────────── */
.nvf-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nvf-seg {
  position: relative; display: flex; gap: 2px; padding: 4px; border-radius: 14px; max-width: 100%;
  background: var(--bg2); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.nvf-seg::-webkit-scrollbar { display: none; }
.nvf-seg button {
  position: relative; z-index: 1; flex-shrink: 0; height: 32px; padding: 0 14px; border: 0; border-radius: 10px;
  background: none; color: var(--text2); font: 600 13px/1 var(--nv-font-ui, inherit); cursor: pointer; white-space: nowrap;
  transition: color .2s;
}
.nvf-seg button:hover { color: var(--text); }
.nvf-seg button[aria-selected="true"] { color: var(--nv54-on-accent, #fff); }
.nvf-seg-pill {
  position: absolute; left: 0; top: 0; z-index: 0; border-radius: 10px; background: var(--accent); opacity: 0;
  box-shadow: 0 4px 14px rgba(var(--nv-accent-rgb, 108,123,255), .35);
  transition: transform .34s var(--nvf-spring), width .34s var(--nvf-spring), opacity .2s;
}
.nvf-seg-pill.on { opacity: 1; }
.nvf-custom { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.nvf-custom[hidden], .nvf-acc-b[hidden] { display: none !important; }
.nvf-custom.in { animation: nvfIn .28s var(--nvf-out) both; }
.nvf-custom label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--text3); font-weight: 600; }
.nvf-custom input {
  height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border2, var(--border));
  background: var(--bg3); color: var(--text); font: 500 13px/1 var(--nv-font-ui, inherit); color-scheme: dark;
}

/* ── KPIs ───────────────────────────────────────────────────────── */
.nvf-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.nvf-kpi {
  position: relative; overflow: hidden; min-width: 0;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--nvf-r);
  padding: 14px 16px 13px; display: flex; flex-direction: column; gap: 8px;
  animation: nvfIn .42s var(--nvf-out) both; animation-delay: calc(var(--i, 0) * 35ms);
  transition: transform .22s var(--nvf-spring), border-color .2s, box-shadow .2s;
}
.nvf-kpi:hover { transform: translateY(-2px); border-color: var(--border2, var(--border)); box-shadow: 0 10px 26px rgba(0,0,0,.2); }
.nvf-kpi-h { display: flex; align-items: center; gap: 8px; color: var(--text2); min-width: 0; }
.nvf-kpi-ic {
  width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; flex-shrink: 0;
  background: rgba(var(--nv-accent-rgb, 108,123,255), .12); color: var(--accent2, var(--accent));
}
.nvf-kpi-t { font: 600 12.5px/1.2 var(--nv-font-ui, inherit); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvf-kpi-v {
  font: 700 25px/1.1 var(--nvf-num); letter-spacing: var(--nv54-ls-kpi, -.03em); color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.nvf-kpi-v.nvf-bump { animation: nvfBump .5s var(--nvf-out); }
.nvf-kpi-f { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nvf-kpi-s { color: var(--text3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nvf-kpi.hero {
  background: linear-gradient(150deg, rgba(var(--nv-accent-rgb, 108,123,255), .16), var(--bg2) 62%);
  border-color: rgba(var(--nv-accent-rgb, 108,123,255), .32);
}
.nvf-kpi.hero .nvf-kpi-v { color: var(--nvf-pos); }
.nvf-kpi.hero.neg .nvf-kpi-v { color: var(--nvf-neg); }
.nvf-kpi-sp { position: absolute; right: 14px; top: 46px; width: 34%; height: 30px; opacity: .9; pointer-events: none; }
.nvf-kpi-sp .l { fill: none; stroke: var(--nvf-pos); stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.nvf-kpi.hero.neg .nvf-kpi-sp .l { stroke: var(--nvf-neg); }
.nvf-kpi-sp .a { fill: var(--nvf-pos); opacity: .1; }
.nvf-kpi.hero.neg .nvf-kpi-sp .a { fill: var(--nvf-neg); }
.nvf-kpi-sp.draw .l { stroke-dasharray: 400; stroke-dashoffset: 400; animation: nvfDraw .7s var(--nvf-out) forwards; }

.nvf-delta {
  display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; height: 21px; padding: 0 7px; border-radius: 99px;
  font: 700 11px/1 var(--nv-font-ui, inherit); background: var(--bg3); color: var(--text2); font-variant-numeric: tabular-nums;
}
.nvf-delta.good { background: color-mix(in srgb, var(--nvf-pos) 14%, transparent); color: var(--nvf-pos); }
.nvf-delta.bad { background: color-mix(in srgb, var(--nvf-neg) 14%, transparent); color: var(--nvf-neg); }
.nvf-delta:empty { display: none; }

/* ── Tarjetas y rejillas ────────────────────────────────────────── */
.nvf-grid { display: grid; gap: 14px; min-width: 0; }
.nvf-g-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.nvf-g3 { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); }
.nvf-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.nvf-card {
  position: relative; min-width: 0; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--nvf-r);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  animation: nvfIn .42s var(--nvf-out) both;
}
.nvf-col .nvf-card { flex: 1 1 auto; }
.nvf-ch { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.nvf-ch > div:first-child { min-width: 0; flex: 1 1 180px; }
.nvf-card h3 { font: 700 14.5px/1.25 var(--nv-font-display, inherit); color: var(--text); letter-spacing: -.01em; }
.nvf-card small { color: var(--text3); font-size: 11.5px; line-height: 1.35; }
.nvf-ch small { display: block; margin-top: 3px; }
.nvf-p { color: var(--text2); font-size: 12.5px; line-height: 1.45; }
.nvf-p.warn { display: flex; gap: 8px; align-items: flex-start; color: var(--nvf-neg); }
.nvf-p.warn svg { flex-shrink: 0; margin-top: 1px; }
.nvf-empty { color: var(--text3); font-size: 12.5px; padding: 8px 0; list-style: none; }
.nvf-big { display: block; font: 700 28px/1.05 var(--nvf-num); letter-spacing: var(--nv54-ls-kpi, -.03em); font-variant-numeric: tabular-nums; }
.pos { color: var(--nvf-pos); }
.nvf .neg { color: var(--nvf-neg); }

.nvf-leg { display: flex; gap: 12px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-size: 11.5px; color: var(--text2); }
.nvf-leg li { display: inline-flex; align-items: center; gap: 6px; }
.nvf-leg.col { flex-direction: column; gap: 6px; }
.nvf-leg.col li { justify-content: flex-start; }
.nvf-leg.col b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); }
.nvf-leg i, .nvf-tip i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
i.ing { background: var(--nvf-ing); }
i.ing2 { background: var(--nvf-ing2); }
i.cost { background: var(--nvf-cost); }
i.cost.line { height: 3px; border-radius: 2px; width: 12px; }
i.gan { background: currentColor; }
i.meta { background: var(--text); width: 3px !important; }
i.nue { background: var(--accent2, var(--accent)); }
i.ren { background: var(--nvf-pos); }

/* ── Gráficas SVG ───────────────────────────────────────────────── */
.nvf-svgw { position: relative; min-width: 0; }
.nvf-svg { display: block; max-width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.nvf-svg .gl { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.nvf-svg .zero { stroke: var(--text3); stroke-width: 1; opacity: .5; }
.nvf-svg .ax { fill: var(--text3); font: 500 10.5px var(--nv-font-ui, inherit); font-variant-numeric: tabular-nums; }
.nvf-svg .ax.now { fill: var(--text); font-weight: 700; }
.nvf-svg .bar { fill: var(--nvf-ing); opacity: .88; transition: opacity .15s; }
.nvf-svg .bar.fut { opacity: .18; }
.nvf-svg .bar.now { opacity: 1; }
.nvf-svg:hover .bar { opacity: .45; }
.nvf-svg:hover .bar.hl { opacity: 1; }
.nvf-svg .cline { fill: none; stroke: var(--nvf-cost); stroke-width: 1.8; stroke-dasharray: 5 4; stroke-linejoin: round; }
.nvf-svg .cross { stroke: var(--text3); stroke-width: 1; stroke-dasharray: 3 3; }
.nvf-svg .hit { cursor: crosshair; }
.nvf-svg .line { fill: none; stroke: var(--nvf-pos); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.nvf-svg .line.neg { stroke: var(--nvf-neg); }
.nvf-svg .s0 { stop-color: var(--nvf-pos); stop-opacity: .26; }
.nvf-svg .s1 { stop-color: var(--nvf-pos); stop-opacity: 0; }
.nvf-svg .dot { fill: var(--nvf-pos); stroke: var(--bg2); stroke-width: 2; }
.nvf-svg .dot.neg { fill: var(--nvf-neg); }
.nvf-svg .hdot { fill: var(--text); stroke: var(--bg2); stroke-width: 2; }
.nvf-tip {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; min-width: 150px;
  background: var(--bg3); border: 1px solid var(--border2, var(--border)); border-radius: 12px;
  padding: 9px 11px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text2);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(4px) scale(.98); transition: opacity .14s, transform .18s var(--nvf-out);
}
.nvf-tip.on { opacity: 1; transform: none; }
.nvf-tip b { color: var(--text); font-size: 12.5px; }
.nvf-tip span { display: flex; align-items: center; gap: 6px; }
.nvf-tip em { margin-left: auto; padding-left: 12px; font-style: normal; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.nvf-tip span.pos em { color: var(--nvf-pos); }
.nvf-tip span.neg em { color: var(--nvf-neg); }
.nvf-tip small { font-size: 11px; }

/* Meta y proyección */
.nvf-meta-b { display: flex; align-items: center; gap: 14px; }
.nvf-meta-b small { display: block; margin-top: 4px; }
.nvf-ring { width: 76px; height: 76px; transform: rotate(-90deg); flex-shrink: 0; }
.nvf-ring circle { fill: none; stroke-width: 8; }
.nvf-ring .bg { stroke: var(--bg4, var(--border)); }
.nvf-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .9s var(--nvf-out); }
.nvf-ring .fg.done { stroke: var(--nvf-pos); }
.nvf-proy-n, .nvf-mix-n, .nvf-cart { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nvf-cart { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nvf-proy-n > div, .nvf-mix-n > div, .nvf-cart > div { background: var(--bg3); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.nvf-proy-n span, .nvf-mix-n span, .nvf-cart span { display: flex; align-items: center; gap: 6px; color: var(--text3); font-size: 11.5px; font-weight: 600; }
.nvf-proy-n b, .nvf-mix-n b, .nvf-cart b { display: block; margin-top: 4px; font: 700 18px/1.1 var(--nvf-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvf-cart b { font-size: 16px; }
.nvf-mix-n small, .nvf-cart small { display: block; margin-top: 2px; }
.nvf-pbar { position: relative; height: 10px; border-radius: 99px; background: var(--bg4, var(--bg3)); display: flex; overflow: visible; }
.nvf-pbar i { height: 100%; transition: width .8s var(--nvf-out); }
.nvf-pbar i.a { background: var(--nvf-ing); border-radius: 99px 0 0 99px; }
.nvf-pbar i.b { background: var(--nvf-ing2); border-radius: 0 99px 99px 0; }
.nvf-pbar u { position: absolute !important; top: -4px; bottom: -4px; text-decoration: none; width: 2px; border-radius: 2px; margin-left: -1px; }
.nvf-pbar u.cost { background: var(--nvf-cost); }
.nvf-pbar u.meta { background: var(--text); }
.nvf-split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--bg4, var(--bg3)); gap: 2px; }
.nvf-split i { height: 100%; transition: width .8s var(--nvf-out); }
.nvf-split i.nue { background: var(--accent2, var(--accent)); }
.nvf-split i.ren { background: var(--nvf-pos); }

/* Métodos de pago */
.nvf-met-b { display: flex; align-items: center; gap: 14px; min-width: 0; }
.nvf-donut { width: 92px; height: 92px; flex-shrink: 0; transform: rotate(-90deg); }
.nvf-donut circle { fill: none; stroke-width: 11; }
.nvf-donut .bg { stroke: var(--bg4, var(--bg3)); }
.nvf-donut .arc { transition: stroke-dasharray .8s var(--nvf-out); }
.nvf-met-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.nvf-met-l li { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto 34px; align-items: center; gap: 7px; font-size: 12px; color: var(--text2); }
.nvf-met-l i { width: 9px; height: 9px; border-radius: 3px; }
.nvf-met-l span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvf-met-l b { color: var(--text); font-variant-numeric: tabular-nums; }
.nvf-met-l small { text-align: right; }

/* ── Calendario de flujo ────────────────────────────────────────── */
.nvf-strip { contain: inline-size; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(58px, 1fr); gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.nvf-day {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; border-radius: 13px;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text2); cursor: pointer; min-width: 0;
  font-family: var(--nv-font-ui, inherit);
  animation: nvfIn .36s var(--nvf-out) both; animation-delay: calc(var(--i, 0) * 18ms);
  transition: transform .2s var(--nvf-spring), border-color .18s, background .18s;
}
.nvf-day:hover { transform: translateY(-2px); border-color: var(--border2, var(--border)); }
.nvf-day.on { border-color: var(--accent); background: rgba(var(--nv-accent-rgb, 108,123,255), .12); }
.nvf-day.hoy .nvf-day-l { color: var(--accent2, var(--accent)); }
.nvf-day.atr { border-style: dashed; }
.nvf-day-l { font: 700 12px/1 var(--nv-font-ui, inherit); color: var(--text); }
.nvf-day-s { font-size: 10.5px; color: var(--text3); }
.nvf-day-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 34px; width: 100%; margin: 3px 0 1px; }
.nvf-day-bars i { width: 9px; min-height: 2px; border-radius: 3px 3px 1px 1px; transition: height .6s var(--nvf-out); }
.nvf-day-bars i.c { background: var(--nvf-ing); }
.nvf-day-bars i.p { background: var(--nvf-cost); }
.nvf-day b { font: 700 11.5px/1 var(--nvf-num); font-variant-numeric: tabular-nums; color: var(--text3); }
.nvf-day b.pos { color: var(--nvf-pos); }
.nvf-daydet:empty { display: none; }
.nvf-daydet { border-radius: 14px; background: var(--bg3); padding: 12px; }
.nvf-daydet.on { animation: nvfIn .28s var(--nvf-out) both; }
.nvf-daydet-h { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.nvf-daydet-h b { color: var(--text); margin-right: auto; }
.nvf-daydet-h span { font-weight: 700; font-variant-numeric: tabular-nums; }
.nvf-daydet ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; }
.nvf-daydet li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "tg nm m" "tg sm m"; column-gap: 10px;
  align-items: center; padding: 7px 6px; border-radius: 9px; font-size: 12.5px;
  animation: nvfIn .3s var(--nvf-out) both; animation-delay: calc(var(--i, 0) * 16ms);
}
.nvf-daydet li:hover { background: var(--bg4, var(--bg2)); }
.nvf-daydet li .nvf-tg { grid-area: tg; }
.nvf-daydet li .nm { grid-area: nm; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvf-daydet li small { grid-area: sm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvf-daydet li b { grid-area: m; font-variant-numeric: tabular-nums; }

/* Etiquetas */
.nvf-tg { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 99px; font: 700 10.5px/1 var(--nv-font-ui, inherit); white-space: nowrap; }
.nvf-tg.c { background: rgba(var(--nv-accent-rgb, 108,123,255), .14); color: var(--accent2, var(--accent)); }
.nvf-tg.p { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text2); }
.nvf-tg.r { background: color-mix(in srgb, var(--nvf-pos) 14%, transparent); color: var(--nvf-pos); }
.nvf-tg.e { background: var(--bg4, var(--bg3)); color: var(--text3); }

/* ── Por plataforma ─────────────────────────────────────────────── */
.nvf-pl { display: flex; flex-direction: column; gap: 12px; }
.nvf-pl-r { display: grid; grid-template-columns: minmax(150px, 1.25fr) minmax(0, 1.1fr) auto; gap: 12px; align-items: center; animation: nvfIn .36s var(--nvf-out) both; animation-delay: calc(var(--i, 0) * 30ms); }
.nvf-pl-n { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.nvf-pl-n .nm { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nvf-pl-ic { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; flex-shrink: 0; overflow: hidden; background: var(--bg3); color: var(--text2); }
.nvf-pl-ic img { width: 100%; height: 100%; object-fit: cover; }
.nvf-mg { margin-left: auto; font: 700 11px/1 var(--nv-font-ui, inherit); padding: 4px 7px; border-radius: 99px; background: var(--bg3); color: var(--text3); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.nvf-mg.pos { background: color-mix(in srgb, var(--nvf-pos) 13%, transparent); }
.nvf-mg.neg { background: color-mix(in srgb, var(--nvf-neg) 13%, transparent); }
.nvf-pl-b { display: flex; flex-direction: column; gap: 3px; }
.nvf-pl-b i { display: block; height: 8px; border-radius: 99px; transition: width .8s var(--nvf-out); min-width: 2px; }
.nvf-pl-b i.ing { background: var(--nvf-ing); }
.nvf-pl-b i.cost { background: var(--nvf-cost); opacity: .85; height: 5px; }
.nvf-pl-v { display: grid; grid-template-columns: auto auto auto; gap: 10px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text2); text-align: right; }
.nvf-pl-v .c { color: var(--text3); }
.nvf-pl-v b { min-width: 58px; }

/* Alertas, cierres, reglas */
.nvf-badge { width: 30px; height: 30px; border-radius: 10px; display: inline-grid; place-items: center; flex-shrink: 0; }
.nvf-badge.bad { background: color-mix(in srgb, var(--nvf-neg) 14%, transparent); color: var(--nvf-neg); }
.nvf-badge.good { background: color-mix(in srgb, var(--nvf-pos) 14%, transparent); color: var(--nvf-pos); }
.nvf-al, .nvf-ci, .nvf-rl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nvf-al li, .nvf-rl li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 11px; background: var(--bg3); min-width: 0; animation: nvfIn .32s var(--nvf-out) both; animation-delay: calc(var(--i, 0) * 25ms); }
.nvf-al li > div, .nvf-rl li > div { min-width: 0; flex: 1; }
.nvf-al b, .nvf-rl b { display: block; font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvf-al small, .nvf-rl small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvf-al em, .nvf-rl em { font-style: normal; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.nvf-al em { color: var(--nvf-neg); }
.nvf-rl em { color: var(--text); }
.nvf-ci li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 12.5px; padding: 6px 2px; border-bottom: 1px solid var(--border); }
.nvf-ci li:last-child { border-bottom: 0; }
.nvf-ci li span { color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvf-ci li b { font-variant-numeric: tabular-nums; }
#nvf-reglas { padding: 0; gap: 0; overflow: hidden; }
.nvf-acc { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; font-family: inherit; transition: background .15s; }
.nvf-acc:hover { background: var(--bg3); }
.nvf-acc > div { flex: 1; min-width: 0; }
.nvf-acc small { display: block; margin-top: 3px; }
.nvf-count { font: 700 11px/1 var(--nv-font-ui, inherit); padding: 5px 9px; border-radius: 99px; background: rgba(var(--nv-accent-rgb, 108,123,255), .12); color: var(--accent2, var(--accent)); flex-shrink: 0; }
.nvf-chev { color: var(--text3); display: inline-grid; transition: transform .28s var(--nvf-spring); flex-shrink: 0; }
.nvf-acc[aria-expanded="true"] .nvf-chev { transform: rotate(180deg); }
.nvf-acc-b { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.nvf-acc-b.in { animation: nvfIn .3s var(--nvf-out) both; }
.nvf-acc-act { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Tabla ──────────────────────────────────────────────────────── */
.nvf-tbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nvf-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--bg3); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.nvf-tabs::-webkit-scrollbar { display: none; }
.nvf-tabs button { flex-shrink: 0; height: 30px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--text2); font: 600 12.5px/1 var(--nv-font-ui, inherit); cursor: pointer; white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s; }
.nvf-tabs button[aria-selected="true"] { background: var(--bg2); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.nvf-chips { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nvf-chips .sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.nvf-chips button { height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--border); background: none; color: var(--text2); font: 600 12px/1 var(--nv-font-ui, inherit); cursor: pointer; transition: all .18s; }
.nvf-chips button[aria-pressed="true"] { background: rgba(var(--nv-accent-rgb, 108,123,255), .14); border-color: rgba(var(--nv-accent-rgb, 108,123,255), .45); color: var(--text); }
.nvf-search { margin-left: auto; display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg3); color: var(--text3); min-width: 0; flex: 0 1 240px; transition: border-color .18s, box-shadow .18s; }
.nvf-search:focus-within { border-color: rgba(var(--nv-accent-rgb, 108,123,255), .6); box-shadow: 0 0 0 3px rgba(var(--nv-accent-rgb, 108,123,255), .15); }
.nvf-search input { border: 0; background: none; outline: none !important; color: var(--text); font: 500 13px/1 var(--nv-font-ui, inherit); width: 100%; min-width: 0; }
.nvf-tbody.nvf-fade { animation: nvfIn .3s var(--nvf-out) both; }
.nvf-tw { contain: inline-size; overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); max-height: 560px; overflow-y: auto; }
.nvf-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.nvf-t th { position: sticky; top: 0; z-index: 1; background: var(--bg3); text-align: left; padding: 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.nvf-t th button { display: inline-flex; align-items: center; gap: 4px; width: 100%; padding: 10px 12px; border: 0; background: none; color: var(--text3); font: 700 11px/1 var(--nv-font-ui, inherit); letter-spacing: .02em; cursor: pointer; }
.nvf-t th.n button { justify-content: flex-end; }
.nvf-t th button:hover { color: var(--text); }
.nvf-si { display: inline-grid; opacity: .35; transition: transform .2s, opacity .2s; }
.nvf-si.on { opacity: 1; color: var(--accent2, var(--accent)); }
.nvf-t td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text2); white-space: nowrap; }
.nvf-t tbody tr { animation: nvfRow .3s var(--nvf-out) both; animation-delay: calc(var(--i, 0) * 12ms); transition: background .12s; }
.nvf-t tbody tr:hover { background: var(--bg3); }
.nvf-t tbody tr.atr td:first-child { box-shadow: inset 3px 0 0 var(--nvf-neg); }
.nvf-t tbody tr.vacio td { text-align: center; padding: 26px; color: var(--text3); white-space: normal; }
.nvf-t td.n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.nvf-t td.n.pos { color: var(--nvf-pos); }
.nvf-t td.n.neg { color: var(--nvf-neg); }
.nvf-t tfoot td { position: sticky; bottom: 0; background: var(--bg3); font-weight: 700; color: var(--text); border-bottom: 0; }
.nvf-tp { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.nvf-tp > :first-child { flex-shrink: 0; }

/* ── Animaciones ────────────────────────────────────────────────── */
@keyframes nvfIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes nvfRow { from { opacity: 0; transform: translateY(4px); } }
@keyframes nvfBump { 0% { transform: translateY(3px); opacity: .55; } 100% { transform: none; opacity: 1; } }
@keyframes nvfDraw { to { stroke-dashoffset: 0; } }
@keyframes nvfSwap { from { opacity: .55; transform: translateY(4px) scale(.995); } }
.nvf.nvf-swap .nvf-card, .nvf.nvf-swap .nvf-kpi { animation: nvfSwap .36s var(--nvf-out) both; }
.nvf.nvf-swap .nvf-kpi { animation-delay: calc(var(--i, 0) * 25ms); }

/* ── Adaptación ─────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .nvf-g3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .nvf-g3 > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .nvf-g-main { grid-template-columns: minmax(0, 1fr); }
  .nvf-g-main > .nvf-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 860px) {
  .nvf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .nvf { gap: 12px; }
  .nvf-hd h2 { font-size: 22px; }
  .nvf-hd-act .nvf-btn { height: 34px; padding: 0 11px; }
  .nvf-seg { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .nvf-seg button { padding: 0 6px; font-size: 12.5px; }
  .nvf-kpi[data-k="pag"] { grid-column: 1 / -1; }
  .nvf-kpis { gap: 8px; }
  .nvf-kpi { padding: 12px; gap: 6px; }
  .nvf-kpi.hero { grid-column: 1 / -1; order: -1; }
  .nvf-kpi-v { font-size: 20px; }
  .nvf-kpi.hero .nvf-kpi-v { font-size: 28px; }
  .nvf-kpi-ic { width: 24px; height: 24px; }
  .nvf-kpi-t { font-size: 11.5px; }
  .nvf-kpi-f { flex-wrap: wrap; row-gap: 4px; }
  .nvf-kpi:not(.hero) .nvf-kpi-s { display: none; }
  .nvf-g3 { grid-template-columns: minmax(0, 1fr); }
  .nvf-card { padding: 14px 13px; }
  .nvf-cart { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .nvf-cart > div { padding: 8px; }
  .nvf-cart b { font-size: 14px; }
  .nvf-pl-r { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n v" "b b"; row-gap: 6px; }
  .nvf-pl-n { grid-area: n; }
  .nvf-pl-b { grid-area: b; }
  .nvf-pl-v { grid-area: v; grid-template-columns: auto auto; }
  .nvf-pl-v .c { display: none; }
  .nvf-search { flex: 1 1 100%; margin-left: 0; }
  .nvf-strip { grid-auto-columns: 64px; }
}


/* ── v5.6 · Análisis avanzado ───────────────────────────────────── */
.nvf-sec-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.nvf-sec-h small { color: var(--text3); font-size: 12px; }
.nvf-g-adv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nvf .pos { color: var(--nvf-pos); } .nvf .neg { color: var(--nvf-neg); }
.nvf-sub { display: block; font-size: 11.5px; font-weight: 700; color: var(--text3); margin-bottom: 4px; }

/* Pronóstico: rango probable */
.nvf-rng { position: relative; height: 10px; border-radius: 99px; background: var(--bg4, var(--bg3)); }
.nvf-rng i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--nvf-ing2); transition: left .6s var(--nvf-out), width .6s var(--nvf-out); }
.nvf-rng u, .nvf-rng s { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; text-decoration: none; }
.nvf-rng u { background: var(--nvf-ing); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nvf-ing) 25%, transparent); }
.nvf-rng s { background: var(--nvf-cost); }

/* Antigüedad de cobros */
.nvf-age-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--bg4, var(--bg3)); gap: 2px; }
.nvf-age-bar i { height: 100%; transition: width .7s var(--nvf-out); }
.nvf-age { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nvf-age > div { min-width: 0; background: var(--bg3); border-radius: 12px; padding: 10px 11px; }
.nvf-age span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text3); white-space: nowrap; }
.nvf-age span i { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.nvf-age b { display: block; margin-top: 4px; font: 700 16px/1.1 var(--nvf-num); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvf-age small { display: block; margin-top: 2px; }
.nvf .a1 i, .nvf i.a1 { background: color-mix(in srgb, var(--amber2, #fcd34d) 85%, transparent); }
.nvf .a2 i, .nvf i.a2 { background: color-mix(in srgb, var(--amber2, #fcd34d) 45%, var(--nvf-neg)); }
.nvf .a3 i, .nvf i.a3 { background: var(--nvf-neg); }

/* Cohortes + renovación por mes */
.nvf-coh-g { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.nvf-coh th, .nvf-unit-t th { padding: 9px 10px; font: 700 11px/1 var(--nv-font-ui, inherit); color: var(--text3); letter-spacing: .02em; }
.nvf-coh th.n, .nvf-unit-t th.n { text-align: right; }
.nvf-coh td { padding: 7px 10px; }
.nvf-coh td.hm { color: var(--text); font-weight: 700; background: rgba(var(--nv-accent-rgb, 108,123,255), var(--a, .1)); }
.nvf-coh td.fut { background: transparent; }
.nvf-coh td.vac { color: var(--text3); }
.nvf-coh tbody tr, .nvf-unit-t tbody tr { animation: nvfRow .3s var(--nvf-out) both; animation-delay: calc(var(--i, 0) * 30ms); }
.nvf-renm { display: flex; flex-direction: column; gap: 8px; }
.nvf-renm-r { display: grid; grid-template-columns: 52px minmax(0, 1fr) 40px auto; gap: 8px; align-items: center; font-size: 12px; }
.nvf-renm-r > span:first-child { color: var(--text2); font-weight: 600; }
.nvf-renm-r .bar, .nvf-ltv-r .bar { height: 8px; border-radius: 99px; background: var(--bg4, var(--bg3)); overflow: hidden; }
.nvf-renm-r .bar i, .nvf-ltv-r .bar i { display: block; height: 100%; border-radius: inherit; transition: width .7s var(--nvf-out); }
.nvf-renm-r i.g { background: var(--nvf-pos); } .nvf-renm-r i.m { background: var(--amber2, #fcd34d); } .nvf-renm-r i.b { background: var(--nvf-neg); }
.nvf-renm-r b { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.nvf-renm-r small { white-space: nowrap; }

/* Valor por cliente */
.nvf-ltvl { display: flex; flex-direction: column; gap: 8px; }
.nvf-ltv-r { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(40px, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; animation: nvfRow .3s var(--nvf-out) both; animation-delay: calc(var(--i, 0) * 30ms); }
.nvf-ltv-r .nvf-pl-ic { grid-row: 1 / span 2; }
.nvf-ltv-r .nm { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nvf-ltv-r .bar i { background: var(--pc, var(--accent)); }
.nvf-ltv-r b { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.nvf-ltv-r small { grid-column: 2 / -1; }

/* Economía por cuenta */
.nvf-unit-t td { padding: 8px 10px; }
.nvf-eq { display: inline-block; min-width: 34px; text-align: center; padding: 2px 8px; border-radius: 99px; font-weight: 700; }
.nvf-eq.ok { color: var(--nvf-pos); background: color-mix(in srgb, var(--nvf-pos) 12%, transparent); }
.nvf-eq.no { color: var(--nvf-neg); background: color-mix(in srgb, var(--nvf-neg) 12%, transparent); }

/* Meta: ritmo */
.nvf-pace { position: relative; height: 8px; border-radius: 99px; background: var(--bg4, var(--bg3)); }
.nvf-pace i { display: block; height: 100%; border-radius: inherit; background: var(--nvf-ing); transition: width .8s var(--nvf-out); }
.nvf-pace u { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--text); text-decoration: none; }
.nvf-pace-t span { font-weight: 700; }

@media (max-width: 1180px) { .nvf-g-adv { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nvf-g-adv > :first-child { grid-column: auto; } .nvf-g-adv > :last-child { grid-column: 1 / -1; } }
@media (max-width: 980px) { .nvf-coh-g { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .nvf-g-adv { grid-template-columns: minmax(0, 1fr); }
  .nvf-age { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .nvf-age > div { padding: 8px; }
  .nvf-age b { font-size: 14px; }
  .nvf-age small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nvf *, .nvf *::before, .nvf *::after { animation: none !important; transition: none !important; }
}

/* v6.2 · Moderadores: aviso en lugar de las finanzas */
#tab-finanzas[data-nvf-mod] { display: none !important; }
.nvf-mod { display: flex; align-items: center; gap: 14px; max-width: 640px; margin: 24px auto; padding: 18px 20px; border-radius: 18px;
  background: var(--bg2); border: 1px solid var(--border); color: var(--text2); animation: nvfModIn .32s cubic-bezier(.2,.8,.2,1) both; }
.nvf-mod-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; color: var(--accent2, var(--accent)); background: rgba(var(--nv-accent-rgb, 139,147,255), .10); }
.nvf-mod b { display: block; color: var(--text); font-size: 15px; margin-bottom: 3px; }
.nvf-mod small { display: block; font-size: 13px; line-height: 1.5; color: var(--text3); }
@keyframes nvfModIn { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .nvf-mod { animation: none; } }
