/* estadistica.css — ventana «Estadística» (gestor_estadistica.VentanaEstadistica) */
.modal.ancho.est-ventana { height: min(720px, calc(100vh - 24px)); height: min(720px, calc(100dvh - 24px)); max-width: min(1000px, 100%); }
.est-ventana:focus { outline: none; }
.est-ventana.est-ocupada { cursor: progress; }

/* barra: título (14 pt negrita) y aviso */
.est-cab { display: flex; align-items: flex-start; gap: 8px; padding: 10px 8px 6px 14px; }
.est-cab-textos { flex: 1 1 auto; min-width: 0; }
.est-titulo { font-size: 18px; font-weight: 700; line-height: 1.25; }
.est-aviso { overflow-wrap: anywhere; }
.est-equipo { display: block; color: var(--texto-suave); font-size: 11.5px; }
.est-equipo .est-cambiar { padding: 0 2px; min-height: 0; vertical-align: baseline; }

/* acciones: Periodo, Datos, botones */
.est-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0 14px 8px; }
.est-grupo { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.est-botones { gap: 4px; }
.est-acciones select.campo { min-width: 8.5em; }

/* cuaderno */
.est-nb { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin: 0 14px 14px; }
.est-tabs { display: flex; flex-wrap: wrap; gap: 0; }
.est-tab { border: 1px solid var(--borde); border-bottom: 0; background: var(--pulsado); color: var(--texto-suave); padding: 5px 14px;
  margin-right: -1px; cursor: pointer; border-radius: 4px 4px 0 0; white-space: nowrap; }
.est-tab:hover { background: var(--hover); }
.est-tab.activa { background: var(--superficie); color: var(--texto); position: relative; z-index: 1; }
.est-hojas { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--fondo); border: 1px solid var(--borde); }
.est-interior { display: none; }
.est-interior.visible { display: block; }
.est-sin-datos { text-align: center; padding: 30px 12px; }

/* rejilla de 4 columnas iguales (columnconfigure(i, weight=1, uniform="col")) */
.est-rejilla { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 6px; align-items: stretch; }
.est-panel { background: var(--superficie); border: 1px solid var(--borde); padding: 10px 14px; min-width: 0; }
.est-panel-titulo { font-weight: 700; margin-bottom: 6px; }

/* _kpi */
.est-kpi-valor { font-size: 24px; font-weight: 700; color: var(--acento); line-height: 1.2; }
.est-kpi-texto, .est-kpi-sub { overflow-wrap: anywhere; }
.est-kpi-sub { color: var(--texto-suave); }

/* _barras */
.est-barras { display: flex; flex-direction: column; gap: 2px; }
.est-fila-barra { display: flex; align-items: center; gap: 6px; min-width: 0; }
.est-barra-etq { flex: 0 0 min(17em, 42%); overflow: hidden; white-space: nowrap; text-overflow: clip; }
.est-barra-pista { flex: 1 1 auto; min-width: 40px; height: 10px; position: relative; }
.est-barra { display: block; width: 100%; height: 10px; }
.est-barra-fondo { fill: var(--pulsado); }
.est-barra-relleno { fill: var(--acento); }
.est-barra-min { position: absolute; left: 0; top: 0; width: 2px; height: 10px; background: var(--acento); }
.est-barra-valor { flex: 0 0 auto; text-align: right; white-space: nowrap; }
.est-vacio { color: var(--texto); }

/* _tabla (Treeview, alto hasta 12 filas) */
.est-tabla-caja { border: 1px solid var(--borde); max-height: calc(13 * 1.95em); overflow: auto; }
.est-tabla { border-collapse: collapse; width: 100%; }
.est-tabla th { position: sticky; top: 0; background: var(--fondo); color: var(--texto-suave); font-weight: 700; text-align: left; padding: 3px 6px; white-space: nowrap; }
.est-tabla td { padding: 3px 6px; border-top: 1px solid var(--borde); }
.est-tabla th:first-child, .est-tabla td:first-child { width: 30%; }

/* _pares */
.est-pares { display: flex; flex-direction: column; gap: 4px; }
.est-par { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.est-par > strong { text-align: right; }
.est-subtitulo { font-weight: 700; margin: 8px 0 2px; }
.est-grande { font-size: 32px; font-weight: 700; color: var(--acento); line-height: 1.2; }

/* Récords */
.est-record-titulo { color: var(--texto-suave); overflow-wrap: anywhere; }
.est-record-valor { font-size: 20px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.est-record-proc { color: var(--acento); }

/* Pantallas estrechas o zoom alto: 2 columnas y luego 1 (sin posiciones fijas) */
@media (max-width: 760px) {
  .est-rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .est-panel { grid-column: auto / span 1 !important; grid-row: auto !important; }
  .est-panel.s2, .est-panel.s4 { grid-column: 1 / -1 !important; }
  .est-tab { padding: 4px 10px; }
}
@media (max-width: 460px) {
  .est-rejilla { grid-template-columns: minmax(0, 1fr); }
  .est-panel { grid-column: 1 / -1 !important; }
  .est-barra-etq { flex-basis: 45%; }
  .est-tabla-caja { overflow-x: auto; }
}
