/* NUTRILAB · Panel · Contabilidad (13-oct-2026) · assets/js/contabilidad.js
   Tokens de panel-v3 (--nl3-*) y panel-v4 (--nl4-*); prefijo #nlConta para ganar a Tailwind. Mismo aspecto que el Lab:
   fondo liso, líneas finas, sin tarjetas rellenas. Quitar su <link> en index.html lo deshace. */

#nlConta { --c-ing: #7aa2ff; --c-gas: rgba(255,255,255,.34); --c-ben: #4ade80; --c-neg: var(--nl3-bad, #f87171);
  display: flex; flex-direction: column; gap: 22px; color: var(--nl4-text, #fff); font-family: var(--nl4-sans, Inter, sans-serif); padding-bottom: 48px; }
#nlConta h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
#nlConta h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0; }
#nlConta h3 { margin: 22px 0 10px; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--nl4-text-3); }
#nlConta small { display: block; font-size: 11.5px; font-weight: 400; color: var(--nl4-text-3); margin-top: 2px; }
#nlConta button { font-family: inherit; cursor: pointer; transition: background-color var(--nl3-ui, 180ms) var(--nl3-out, ease), color var(--nl3-ui, 180ms) var(--nl3-out, ease),
  border-color var(--nl3-ui, 180ms) var(--nl3-out, ease), transform var(--nl3-press, 120ms) var(--nl3-out, ease); }
#nlConta button:active:not(:disabled) { transform: scale(.97); }
#nlConta button:focus-visible, #nlConta input:focus-visible, #nlConta select:focus-visible, #nlConta g.mes:focus-visible { outline: 2px solid var(--nl4-accent, #7aa2ff); outline-offset: 2px; }
#nlConta .nl-conta-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Cabecera */
#nlConta .nl-conta-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
#nlConta .nl-conta-volver { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 14px; padding: 0; border: 0; background: none; font-size: 12px; color: var(--nl4-text-2); }
#nlConta .nl-conta-volver:hover { color: var(--nl4-text); }
#nlConta .nl-conta-volver .material-symbols-outlined { font-size: 16px; }
#nlConta .nl-conta-kicker { margin: 0 0 4px; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--nl4-text-3); }
#nlConta .nl-conta-lead { margin: 6px 0 0; font-size: 13px; color: var(--nl4-text-2); max-width: 60ch; }
#nlConta .nl-conta-lead2 { margin: 0; font-size: 13px; color: var(--nl4-text-2); max-width: 70ch; }
#nlConta .nl-conta-seg { display: inline-flex; flex-wrap: wrap; padding: 3px; border: 1px solid var(--nl4-line); border-radius: var(--nl4-r, 12px); background: var(--nl4-s1); }
#nlConta .nl-conta-seg button { padding: 6px 12px; border: 0; border-radius: 9px; background: none; color: var(--nl4-text-2); font-size: 12px; font-weight: 500; }
#nlConta .nl-conta-seg button.on { background: var(--nl4-s2); color: var(--nl4-text); box-shadow: inset 0 0 0 1px var(--nl4-line-2); }

/* Pestañas internas */
#nlConta .nl-conta-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--nl4-line); overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; touch-action: pan-x; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
#nlConta .nl-conta-tabs::-webkit-scrollbar { display: none; }
#nlConta .nl-conta-tabs button { flex: none; padding: 10px 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--nl4-text-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
#nlConta .nl-conta-tabs button:hover { color: var(--nl4-text); }
#nlConta .nl-conta-tabs button.on { color: var(--nl4-text); border-bottom-color: var(--nl4-text); }
#nlConta .nl-conta-tabs button:active:not(:disabled) { transform: none; }
#nlConta .nl-conta-cuerpo { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
#nlConta .nl-conta-periodo { margin: 0 0 -8px; font-size: 12px; color: var(--nl4-text-3); }
#nlConta .nl-conta-periodo::first-letter { text-transform: uppercase; }

/* KPIs */
#nlConta .nl-conta-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--nl4-line); border-bottom: 1px solid var(--nl4-line); }
#nlConta .nl-conta-kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#nlConta .nl-conta-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 0; margin-bottom: 14px; }
#nlConta .nl-conta-kpi { padding: 18px 16px 18px 0; min-width: 0; }
#nlConta .nl-conta-kpi + .nl-conta-kpi { padding-left: 16px; border-left: 1px solid var(--nl4-line); }
#nlConta .nl-conta-etq { margin: 0 0 10px; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--nl4-text-3); }
#nlConta .nl-conta-valor { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
#nlConta .nl-conta-sub { margin: 8px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--nl4-text-2); }
#nlConta .nl-conta-kpi.neg .nl-conta-valor { color: var(--c-neg); }
#nlConta .nl-conta-kpi.warn .nl-conta-valor { color: var(--nl3-warn, #f5b454); }
@media (max-width: 1180px) {
  #nlConta .nl-conta-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #nlConta .nl-conta-kpis .nl-conta-kpi:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
  #nlConta .nl-conta-kpis .nl-conta-kpi:nth-child(n + 4) { border-top: 1px solid var(--nl4-line); }
  #nlConta .nl-conta-kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #nlConta .nl-conta-kpis-4 .nl-conta-kpi:nth-child(3n + 1) { padding-left: 16px; border-left: 1px solid var(--nl4-line); }
  #nlConta .nl-conta-kpis-4 .nl-conta-kpi:nth-child(2n + 1) { padding-left: 0; border-left: 0; }
  #nlConta .nl-conta-kpis-4 .nl-conta-kpi:nth-child(n + 3) { border-top: 1px solid var(--nl4-line); }
}
@media (max-width: 640px) {
  #nlConta .nl-conta-kpis, #nlConta .nl-conta-kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #nlConta .nl-conta-kpis .nl-conta-kpi { padding-left: 12px; border-left: 1px solid var(--nl4-line); }
  #nlConta .nl-conta-kpis .nl-conta-kpi:nth-child(2n + 1) { padding-left: 0; border-left: 0; }
  #nlConta .nl-conta-kpis .nl-conta-kpi:nth-child(n + 3) { border-top: 1px solid var(--nl4-line); }
  #nlConta .nl-conta-valor { font-size: 19px; }
}
#nlConta .nl-conta-skel { background: linear-gradient(90deg, var(--nl4-s1), var(--nl4-s2), var(--nl4-s1)); background-size: 200% 100%; animation: nlContaSkel 1.4s linear infinite; min-height: 96px; border-radius: 8px; }
#nlConta .nl-conta-kpis .nl-conta-skel { margin: 12px 8px; }
#nlConta .nl-conta-skel-graf { height: 240px; }
@keyframes nlContaSkel { to { background-position: -200% 0; } }

/* Secciones */
#nlConta .nl-conta-sec { border-top: 1px solid var(--nl4-line); padding-top: 20px; min-width: 0; }
#nlConta .nl-conta-sh { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
#nlConta .nl-conta-mini { font-size: 11px; color: var(--nl4-text-3); }
#nlConta .nl-conta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; row-gap: 22px; }
@media (max-width: 960px) { #nlConta .nl-conta-grid { grid-template-columns: 1fr; } }
#nlConta .nl-conta-vacio { margin: 0; font-size: 13px; color: var(--nl4-text-2); }
#nlConta .nl-conta-nota { margin: 12px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--nl4-text-3); max-width: 80ch; }
#nlConta .nl-conta-aviso { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border: 1px solid rgba(245,180,84,.32); border-radius: var(--nl4-r, 12px); font-size: 13px; line-height: 1.5; color: var(--nl4-text-2); }
#nlConta .nl-conta-aviso .material-symbols-outlined { color: var(--nl3-warn, #f5b454); font-size: 20px; }
#nlConta .nl-conta-ok { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 13px; color: var(--nl4-text-2); }
#nlConta .nl-conta-ok .material-symbols-outlined { color: var(--nl3-ok, #4ade80); font-size: 20px; }

/* Botones */
#nlConta .nl-conta-acc { display: flex; flex-wrap: wrap; gap: 10px; }
#nlConta .nl-conta-acc.c { justify-content: center; }
#nlConta .nl-conta-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: 0; border-radius: 10px; background: #f2f2f2; color: #050506; font-size: 13px; font-weight: 600; white-space: nowrap; }
#nlConta .nl-conta-btn:hover { background: #fff; }
#nlConta .nl-conta-btn.sec { background: none; color: var(--nl4-text); box-shadow: inset 0 0 0 1px var(--nl4-line-2); }
#nlConta .nl-conta-btn.sec:hover { background: var(--nl4-s2); }
#nlConta .nl-conta-btn .material-symbols-outlined { font-size: 18px; }
#nlConta .nl-conta-btn:disabled { opacity: .45; cursor: default; }
#nlConta .nl-conta-link { padding: 0; border: 0; background: none; color: var(--nl4-accent, #7aa2ff); font-size: 12.5px; font-weight: 500; }
#nlConta .nl-conta-link:hover { text-decoration: underline; }
#nlConta .nl-conta-link.peligro { color: var(--c-neg); }

/* Chips de nivel */
#nlConta .nl-conta-chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--nl4-line-2); font-size: 11px; font-weight: 600; color: var(--nl4-text-2); white-space: nowrap; }
#nlConta .nl-conta-chip.n-bajo { border-color: rgba(74,222,128,.4); color: var(--nl3-ok, #4ade80); }
#nlConta .nl-conta-chip.n-moderado { border-color: rgba(245,180,84,.45); color: var(--nl3-warn, #f5b454); }
#nlConta .nl-conta-chip.n-alto, #nlConta .nl-conta-chip.n-critico { border-color: rgba(248,113,113,.5); color: var(--c-neg); }
#nlConta .nl-conta-chip.n-critico { background: rgba(248,113,113,.12); }

/* Gráfica */
#nlConta .nl-conta-ley { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; font-size: 12px; color: var(--nl4-text-2); }
#nlConta .nl-conta-ley i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
#nlConta .nl-conta-ley i.ing { background: var(--c-ing); }
#nlConta .nl-conta-ley i.gas { background: var(--c-gas); }
#nlConta .nl-conta-ley i.ben { height: 2px; vertical-align: 3px; background: var(--c-ben); }
#nlConta .nl-conta-graf { position: relative; }
#nlConta .nl-conta-graf svg { display: block; width: 100%; height: auto; overflow: visible; }
#nlConta .nl-conta-graf .rej { stroke: var(--nl4-line); stroke-width: 1; }
#nlConta .nl-conta-graf .cero { stroke: var(--nl4-line-2); stroke-width: 1; }
#nlConta .nl-conta-graf .eje { fill: var(--nl4-text-3); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
#nlConta .nl-conta-graf rect.ing { fill: var(--c-ing); }
#nlConta .nl-conta-graf rect.gas { fill: var(--c-gas); }
#nlConta .nl-conta-graf rect.hit { fill: transparent; }
#nlConta .nl-conta-graf g.mes { outline: none; }
#nlConta .nl-conta-graf g.mes:hover rect.hit, #nlConta .nl-conta-graf g.mes:focus rect.hit { fill: rgba(255,255,255,.04); }
#nlConta .nl-conta-graf g.curso rect.ing, #nlConta .nl-conta-graf g.curso rect.gas { opacity: .55; }
#nlConta .nl-conta-graf polyline.ben { fill: none; stroke: var(--c-ben); stroke-width: 2; stroke-linejoin: round; pointer-events: none; }
#nlConta .nl-conta-graf circle.benp { fill: var(--nl4-bg, #050506); stroke: var(--c-ben); stroke-width: 2; pointer-events: none; }
#nlConta .nl-conta-tip { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--nl4-line-2); background: var(--nl4-s2); font-size: 12px; color: var(--nl4-text-2); pointer-events: none; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
#nlConta .nl-conta-tip[hidden] { display: none; }
#nlConta .nl-conta-tip b { color: var(--nl4-text); font-weight: 600; }
#nlConta .nl-conta-tip b::first-letter { text-transform: uppercase; }

/* Riesgo */
#nlConta .nl-conta-medidor { height: 8px; border-radius: 4px; background: var(--nl4-s2); overflow: hidden; }
#nlConta .nl-conta-medidor > span { display: block; height: 100%; border-radius: 4px; background: var(--nl3-ok, #4ade80); transition: width var(--nl3-enter, 260ms) var(--nl3-out, ease); }
#nlConta .nl-conta-medidor > span.n-moderado { background: var(--nl3-warn, #f5b454); }
#nlConta .nl-conta-medidor > span.n-alto, #nlConta .nl-conta-medidor > span.n-critico { background: var(--c-neg); }
#nlConta .nl-conta-factores, #nlConta .nl-conta-pts-l, #nlConta .nl-conta-recs { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#nlConta .nl-conta-factores li { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--nl4-r, 12px); border: 1px solid var(--nl4-line); }
#nlConta .nl-conta-factores li > .material-symbols-outlined { font-size: 20px; margin-top: 1px; color: var(--nl4-text-3); }
#nlConta .nl-conta-factores li.alta { border-color: rgba(248,113,113,.32); }
#nlConta .nl-conta-factores li.alta > .material-symbols-outlined { color: var(--c-neg); }
#nlConta .nl-conta-factores li.media > .material-symbols-outlined { color: var(--nl3-warn, #f5b454); }
#nlConta .nl-conta-ft { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.4; }
#nlConta .nl-conta-fd { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--nl4-text-2); }
#nlConta .nl-conta-pts { display: inline-block; margin-right: 8px; font-size: 10.5px; font-weight: 700; color: var(--nl4-text-3); font-variant-numeric: tabular-nums; }
#nlConta .alta .nl-conta-pts { color: var(--c-neg); }
#nlConta .media .nl-conta-pts { color: var(--nl3-warn, #f5b454); }
#nlConta .nl-conta-pts-l li { padding: 10px 0; border-top: 1px solid var(--nl4-line); }
#nlConta .nl-conta-pts-l li:first-child { border-top: 0; padding-top: 0; }
#nlConta .nl-conta-recs li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--nl4-line); }
#nlConta .nl-conta-recs li:first-child { border-top: 0; }
#nlConta .nl-conta-prio { flex: none; width: 52px; height: fit-content; padding: 3px 0; border-radius: 6px; text-align: center; font-size: 10.5px; font-weight: 700; background: var(--nl4-s2); color: var(--nl4-text-2); }
#nlConta .nl-conta-prio.p-alta { background: var(--nl4-text); color: #050506; }

/* Listas tipo «dato: valor» */
#nlConta .nl-conta-lista { list-style: none; margin: 0; padding: 0; }
#nlConta .nl-conta-lista li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-top: 1px solid var(--nl4-line); }
#nlConta .nl-conta-lista li:first-child { border-top: 0; padding-top: 0; }
#nlConta .nl-conta-dt { font-size: 13px; color: var(--nl4-text-2); min-width: 0; }
#nlConta .nl-conta-dd { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Barras horizontales */
#nlConta .nl-conta-barras { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
#nlConta .nl-conta-barras li { display: grid; grid-template-columns: minmax(0, 38%) 1fr auto; align-items: center; gap: 12px; font-size: 12.5px; }
#nlConta .nl-conta-bt { color: var(--nl4-text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#nlConta .nl-conta-bp { height: 8px; border-radius: 4px; background: var(--nl4-s2); overflow: hidden; }
#nlConta .nl-conta-bp > span { display: block; height: 100%; border-radius: 4px; background: var(--nl4-text); }
#nlConta .nl-conta-bn { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 84px; }
#nlConta .nl-conta-bn small { display: inline; margin-left: 6px; }

/* Tablas */
#nlConta .nl-conta-tabla-w { overflow-x: auto; margin: 0 -2px; -webkit-overflow-scrolling: touch; }
#nlConta .nl-conta-tabla { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#nlConta .nl-conta-tabla th, #nlConta .nl-conta-tabla td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--nl4-line); text-align: left; vertical-align: top; }
#nlConta .nl-conta-tabla thead th { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--nl4-text-3); white-space: nowrap; }
#nlConta .nl-conta-tabla tbody th { font-weight: 500; color: var(--nl4-text); }
#nlConta .nl-conta-tabla tbody th::first-letter { text-transform: uppercase; }
#nlConta .nl-conta-tabla small { display: block; }
#nlConta .nl-conta-tabla.num td, #nlConta .nl-conta-tabla .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
#nlConta .nl-conta-tabla.num thead th:not(:first-child) { text-align: right; }
#nlConta .nl-conta-tabla td.neg { color: var(--c-neg); }
#nlConta .nl-conta-tabla td.b { font-weight: 600; }
#nlConta .nl-conta-tabla tfoot th, #nlConta .nl-conta-tabla tfoot td { font-weight: 700; border-bottom: 0; }
#nlConta .nl-conta-tabla tbody tr:hover td, #nlConta .nl-conta-tabla tbody tr:hover th { background: rgba(255,255,255,.02); }
#nlConta .nl-conta-tabla .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: nowrap; }
#nlConta .nl-conta-fact td { color: var(--nl4-text-2); }
#nlConta .nl-conta-fact td.b, #nlConta .nl-conta-fact td:nth-child(3) { color: var(--nl4-text); }
#nlConta .nl-conta-fact { min-width: 860px; }
#nlConta .nl-conta-est { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--nl4-line-2); font-size: 11px; font-weight: 600; white-space: nowrap; }
#nlConta .nl-conta-est.e-pagada { border-color: rgba(74,222,128,.4); color: var(--nl3-ok, #4ade80); }
#nlConta .nl-conta-est.e-pendiente { border-color: rgba(245,180,84,.45); color: var(--nl3-warn, #f5b454); }
#nlConta .nl-conta-est.e-fallida { border-color: rgba(248,113,113,.5); color: var(--c-neg); }
#nlConta .nl-conta-est.e-omitido, #nlConta .nl-conta-est.e-anulada { color: var(--nl4-text-3); }

/* Filtros y campos */
#nlConta .nl-conta-filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
#nlConta .nl-conta-campo { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--nl4-text-3); min-width: 0; }
#nlConta .nl-conta-campo > span em { font-style: normal; font-weight: 400; }
#nlConta .nl-conta-campo small { font-size: 11.5px; letter-spacing: 0; line-height: 1.45; }
#nlConta .nl-conta-campo input, #nlConta .nl-conta-campo select { height: 38px; padding: 0 12px; border: 1px solid var(--nl4-line-2); border-radius: var(--nl3-r-ctl, 10px); background: var(--nl4-s1);
  color: var(--nl4-text); font: 500 14px/1 var(--nl4-sans, Inter, sans-serif); letter-spacing: 0; color-scheme: dark; min-width: 0; }
#nlConta .nl-conta-campo input:focus, #nlConta .nl-conta-campo select:focus { border-color: var(--nl4-accent, #7aa2ff); outline: none; }
#nlConta .nl-conta-q { position: relative; flex: 1 1 240px; }
#nlConta .nl-conta-q .material-symbols-outlined { position: absolute; left: 11px; bottom: 9px; font-size: 19px; color: var(--nl4-text-3); pointer-events: none; }
#nlConta .nl-conta-q input { padding-left: 38px; }
#nlConta .nl-conta-filtros > .nl-conta-link { margin-bottom: 11px; }
@media (max-width: 640px) { #nlConta .nl-conta-filtros .nl-conta-campo:not(.nl-conta-q) { flex: 1 1 calc(50% - 6px); } }

/* Gastos */
#nlConta .nl-conta-gastos, #nlConta .nl-conta-infs { list-style: none; margin: 0; padding: 0; }
#nlConta .nl-conta-gasto, #nlConta .nl-conta-inf { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 4px; border: 0; border-top: 1px solid var(--nl4-line); background: none; color: inherit; text-align: left; }
#nlConta li:first-child > .nl-conta-gasto, #nlConta li:first-child > .nl-conta-inf { border-top: 0; }
#nlConta .nl-conta-gasto:hover, #nlConta .nl-conta-inf:hover, #nlConta .nl-conta-inf.on { background: rgba(255,255,255,.03); }
#nlConta .nl-conta-gasto:active:not(:disabled), #nlConta .nl-conta-inf:active:not(:disabled) { transform: none; }
#nlConta .nl-conta-gt { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; }
#nlConta .nl-conta-gi { text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
#nlConta .nl-conta-gasto > .material-symbols-outlined { font-size: 18px; color: var(--nl4-text-3); }

/* Diálogo de gasto */
#nlConta .nl-conta-dlg { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--nl4-line-2); border-radius: var(--nl3-r-sheet, 24px);
  background: var(--nl4-s1, #0e0e10); color: var(--nl4-text); overflow: auto; }
#nlConta .nl-conta-dlg::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
#nlConta .nl-conta-dlg[open] { animation: nlContaDlg var(--nl3-enter, 260ms) var(--nl3-out, ease); }
@keyframes nlContaDlg { from { opacity: 0; transform: translateY(8px) scale(.98); } }
#nlConta .nl-conta-dlg form { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
#nlConta .nl-conta-dh { display: flex; align-items: center; justify-content: space-between; }
#nlConta .nl-conta-dh h2 { font-size: 17px; }
#nlConta .nl-conta-x { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: none; color: var(--nl4-text-2); }
#nlConta .nl-conta-x:hover { background: var(--nl4-s2); color: var(--nl4-text); }
#nlConta .nl-conta-plant > div { display: flex; flex-wrap: wrap; gap: 6px; }
#nlConta .nl-conta-plant .nl-conta-etq { margin-bottom: 8px; }
#nlConta .nl-conta-pchip { padding: 5px 10px; border: 1px solid var(--nl4-line-2); border-radius: 999px; background: none; color: var(--nl4-text-2); font-size: 12px; }
#nlConta .nl-conta-pchip:hover { color: var(--nl4-text); background: var(--nl4-s2); }
#nlConta .nl-conta-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { #nlConta .nl-conta-dos { grid-template-columns: 1fr; } }
#nlConta .nl-conta-campo[hidden] { display: none; }
/* «Gasto deducible»: interruptor propio de la app (31-oct-2026), el mismo dibujo que el interruptor de IA del Dashboard (.nl-ios), a tamaño de formulario.
   Sigue siendo un <input type="checkbox">: el teclado, el lector de pantalla y el formulario funcionan como antes. */
#nlConta .nl-conta-check { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 46px; padding: 4px 0; border-top: 1px solid var(--nl4-line); border-bottom: 1px solid var(--nl4-line);
  font-size: 13.5px; color: var(--nl4-text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
#nlConta .nl-conta-check input { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 44px; height: 26px; margin: 0; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); transition: background-color 220ms cubic-bezier(.2,.8,.2,1); touch-action: manipulation; }
#nlConta .nl-conta-check input::before { content: ""; position: absolute; inset: -10px -6px; }
#nlConta .nl-conta-check input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 999px; background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.4), 0 0 0 .5px rgba(0,0,0,.08); transition: transform 260ms cubic-bezier(.3,1.3,.5,1), width 160ms cubic-bezier(.2,.8,.2,1); }
#nlConta .nl-conta-check input:checked { background: #34c759; }
#nlConta .nl-conta-check input:checked::after { transform: translateX(18px); }
#nlConta .nl-conta-check input:active::after { width: 27px; }
#nlConta .nl-conta-check input:checked:active::after { transform: translateX(13px); }
#nlConta .nl-conta-check input:focus-visible { outline: 2px solid #5ea2ff; outline-offset: 3px; }
#nlConta .nl-conta-err { margin: 0; font-size: 12.5px; color: var(--c-neg); }
#nlConta .nl-conta-dpie { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
#nlConta .nl-conta-dpie > span { flex: 1; }

/* Informes IA */
#nlConta .nl-conta-tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
#nlConta .nl-conta-tipo { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--nl4-line-2); border-radius: var(--nl4-r, 12px); background: none; color: inherit; text-align: left; }
#nlConta .nl-conta-tipo:hover:not(:disabled) { background: var(--nl4-s1); border-color: rgba(255,255,255,.22); }
#nlConta .nl-conta-tipo:disabled { opacity: .5; cursor: default; }
#nlConta .nl-conta-tipo[aria-busy="true"] { opacity: 1; border-color: var(--nl4-accent, #7aa2ff); }
#nlConta .nl-conta-tipo[aria-busy="true"] .material-symbols-outlined { animation: nlContaGira 1s linear infinite; color: var(--nl4-accent, #7aa2ff); }
@keyframes nlContaGira { to { transform: rotate(360deg); } }
#nlConta .nl-conta-tipo .material-symbols-outlined { font-size: 22px; color: var(--nl4-text-2); }
#nlConta .nl-conta-tipo b { display: block; font-size: 13.5px; font-weight: 600; }
#nlConta .nl-conta-informe { padding: 22px 0 4px; border-top: 1px solid var(--nl4-line-2); }
#nlConta .nl-conta-ih { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
#nlConta .nl-conta-ih h2 { font-size: 19px; letter-spacing: -.01em; }
#nlConta .nl-conta-ia { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#nlConta .nl-conta-resumen { margin: 16px 0 6px; padding: 4px 0 4px 16px; border-left: 2px solid var(--nl4-line-2); font-family: var(--nl4-serif, Georgia, serif); font-size: 17px; line-height: 1.55; max-width: 75ch; }

/* Ajustes */
#nlConta .nl-conta-ajustes { display: flex; flex-direction: column; gap: 18px; max-width: 520px; }

@media (prefers-reduced-motion: reduce) {
  #nlConta *, #nlConta .nl-conta-dlg[open] { animation: none !important; transition: none !important; }
}

/* Diálogo de gasto en iPhone (31-oct-2026): más pequeño y siempre dentro del área segura.
   El panel usa viewport-fit=cover: sin esto el diálogo (alto = pantalla − 32 px) se metía bajo la muesca y la barra de inicio.
   Cabecera y botones quedan fijos y lo de en medio se desplaza si no cabe. 16 px en los campos: el iPhone no hace zoom al escribir. */
@media (max-width: 640px) {
  #nlConta .nl-conta-dlg { width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); border-radius: 20px; overflow: hidden; }
  #nlConta .nl-conta-dlg[open] { display: flex; flex-direction: column; }
  #nlConta .nl-conta-dlg form { gap: 10px; padding: 0 16px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  #nlConta .nl-conta-dh { position: sticky; top: 0; z-index: 2; padding: 14px 0 8px; background: var(--nl4-s1, #0e0e10); }
  #nlConta .nl-conta-dh h2 { font-size: 16px; }
  #nlConta .nl-conta-plant .nl-conta-etq { margin-bottom: 6px; }
  #nlConta .nl-conta-plant > div { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #nlConta .nl-conta-plant > div::-webkit-scrollbar { display: none; }
  #nlConta .nl-conta-pchip { flex: none; white-space: nowrap; }
  #nlConta .nl-conta-dos { grid-template-columns: 1fr 1fr; gap: 10px; }
  #nlConta .nl-conta-dlg .nl-conta-campo { gap: 5px; }
  #nlConta .nl-conta-dlg .nl-conta-campo input, #nlConta .nl-conta-dlg .nl-conta-campo select { height: 40px; padding: 0 10px; font-size: 16px; }
  #nlConta .nl-conta-dpie { position: sticky; bottom: 0; z-index: 2; margin-top: 0; padding: 10px 0 12px; background: var(--nl4-s1, #0e0e10); border-top: 1px solid var(--nl4-line); }
  #nlConta .nl-conta-dpie .nl-conta-btn { min-height: 40px; }
}
@media (max-width: 359px) { #nlConta .nl-conta-dos { grid-template-columns: 1fr; } }

/* Imprimir un informe: solo el informe */
@media print {
  body * { visibility: hidden !important; }
  #nlConta .nl-conta-informe, #nlConta .nl-conta-informe * { visibility: visible !important; color: #000 !important; }
  #nlConta .nl-conta-informe { position: absolute; left: 0; top: 0; width: 100%; border: 0; }
  #nlConta .nl-conta-ia button { display: none !important; }
}

#nlConta .nl-conta-fbtns { display: inline-flex; gap: 4px; }
#nlConta .nl-conta-ic { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--nl4-text-2); box-shadow: inset 0 0 0 1px var(--nl4-line-2); cursor: pointer; transition: background-color 150ms ease, color 150ms ease; }
#nlConta .nl-conta-ic:hover { background: var(--nl4-s2); color: var(--nl4-text); }
#nlConta .nl-conta-ic:active { transform: scale(.94); }
#nlConta .nl-conta-ic .material-symbols-outlined { font-size: 18px; }

/* Botón «Análisis de reseñas» (13-oct-2026): abre la página de reseñas (encuesta-panel.js) */
#nlConta .nl-conta-resenas { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; padding: 8px 12px; border: 1px solid var(--nl4-line-2, rgba(255,255,255,.16)); border-radius: 9px; background: var(--nl4-s1, transparent); color: var(--nl4-text, #fff); font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1;   /* 15-nov-2026: antes el atajo `font` de esta regla era no válido y el navegador lo ignoraba (salía a 16 px) */ cursor: pointer; transition: background-color 180ms ease, transform 120ms ease; }
#nlConta .nl-conta-resenas:hover { background: var(--nl4-s2, rgba(255,255,255,.08)); }
#nlConta .nl-conta-resenas:active { transform: scale(.97); }
#nlConta .nl-conta-resenas:focus-visible { outline: 2px solid var(--nl4-accent, #7aa2ff); outline-offset: 2px; }
#nlConta .nl-conta-resenas .material-symbols-outlined { font-size: 16px; }

/* Gasto de IA mes a mes (15-oct-2026) */
#nlConta .nl-conta-iam { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
#nlConta .nl-conta-iam li { display: grid; grid-template-columns: minmax(0, 30%) 1fr 84px 76px; align-items: center; gap: 12px; font-size: 12.5px; }
#nlConta .nl-conta-iam .nl-conta-bn { text-align: right; font-variant-numeric: tabular-nums; }
#nlConta .nl-conta-dif { text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--nl4-text-3); }
#nlConta .nl-conta-dif.sube { color: #fbbf24; }
#nlConta .nl-conta-dif.baja { color: #4ade80; }
#nlConta .nl-conta-cero { opacity: .35; }
#nlConta .nl-conta-tabla tfoot th, #nlConta .nl-conta-tabla tfoot td { font-weight: 600; border-bottom: 0; }
@media (max-width: 640px) { #nlConta .nl-conta-iam li { grid-template-columns: 1fr 70px 60px; } #nlConta .nl-conta-iam .nl-conta-bp { grid-column: 1 / -1; order: 5; } }
