/* Dagda Capital · Contabilidad y BI (Iteración 5, bloque 5b). Sobre los tokens de diseño existentes. */

/* Estados financieros */
.estado-table td, .estado-table th { white-space: nowrap; }
.estado-table td:first-child { white-space: normal; min-width: 220px; }
.estado-table td:first-child, .estado-table th:first-child { position: sticky; left: 0; background: var(--c-panel); z-index: 1; }
.estado-table tr.sub td { font-weight: 700; border-top: 1px solid var(--c-line); }
.estado-table tr.total td { font-weight: 800; background: var(--c-sunken); border-top: 2px solid var(--c-text); }
.estado-table tr.total td:first-child { background: var(--c-sunken); }
.estado-table tr.cab td { padding-top: 14px; color: var(--c-text-2); }
.estado-table tr.muted td { color: var(--c-text-3); font-size: 12px; }
.estado-table td.neg { color: var(--c-neg); }

/* Cuadres mayor vs auxiliar */
.cuadre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cuadre h4 { font-size: 13.5px; margin: 6px 0 8px; }
.cuadre dl { display: grid; gap: 4px; }
.cuadre dl > div { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.cuadre dt { color: var(--c-text-3); }
.cuadre dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.conc-table tr.sub td { font-weight: 700; border-top: 1px solid var(--c-line); }
.conc-table tr.total td { font-weight: 800; background: var(--c-sunken); }
.conc-table td:last-child { white-space: nowrap; }

.asiento-lineas td { padding: 4px 6px; }
.asiento-lineas .select, .asiento-lineas .input { width: 100%; }
.asiento-lineas td:first-child { min-width: 240px; }
.asiento-lineas tfoot td { font-weight: 700; }
.table tr.grupo-ini td { border-top: 1px solid var(--c-line); }

/* BI */
.bi-paneles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bi-panel .bi-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 16px 8px; }
.bi-kpis > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r-md); background: var(--c-sunken); min-width: 0; }
.bi-kpis span { font-size: 11.5px; color: var(--c-text-3); font-weight: 600; }
.bi-kpis b { font-size: 17px; font-variant-numeric: tabular-nums; }
.bi-kpis .delta { font-size: 11.5px; }
.cohorte-cell { display: inline-block; min-width: 48px; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--c-neg) var(--a, 0%), transparent); }
.comp-table td.mejor { color: var(--c-pos); }
.comp-table td.peor { color: var(--c-neg); }
.reporte-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.reporte-form .checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }

@media (max-width: 1100px) {
  .bi-paneles { grid-template-columns: minmax(0, 1fr); }
  .reporte-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .bi-panel .bi-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reporte-form { grid-template-columns: minmax(0, 1fr); }
  .estado-table td:first-child { min-width: 160px; }
}

/* Segmentados largos (dimensiones, períodos) en pantallas angostas: pasan a varias líneas */
@media (max-width: 760px) {
  #main .seg { display: flex; flex-wrap: wrap; height: auto; max-width: 100%; row-gap: 2px; }
}
