/* Página de control: amplía el ancho de la app para que entre la tabla. */
main.control { max-width: 960px; }
.control [hidden] { display: none !important; }
a.icon-btn { text-decoration: none; }
h2 { margin-top: 24px; }

.panel { background: var(--panel); border: 1px solid var(--borde); border-radius: 12px; padding: 16px; }

.filtros { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.filtros label { flex: 1 1 220px; }
.filtros .btn { width: auto; padding: 12px 18px; font-size: .95rem; }

/* Totales */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 8px 0; }
.tile { background: var(--panel); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 14px; }
.tile .valor { font-size: 1.8rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .etiqueta { color: var(--suave); font-size: .85rem; font-weight: 600; }
.tile .sub { color: var(--suave); font-size: .8rem; }

/* Tabla departamento × tipo */
.tabla-scroll { overflow-x: auto; border: 1px solid var(--borde); border-radius: 12px; background: var(--panel); }
.matriz { border-collapse: collapse; width: 100%; font-size: .9rem; }
.matriz th, .matriz td { padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.matriz thead th { font-size: .8rem; color: var(--suave); font-weight: 700; position: sticky; top: 0; background: var(--panel); }
.matriz th[scope=row] { text-align: left; font-weight: 600; position: sticky; left: 0; background: var(--panel); }
.matriz thead th:first-child { left: 0; z-index: 1; }
.matriz th[scope=row] small { display: block; color: var(--suave); font-weight: 400; }
.matriz td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.matriz td.cero { color: var(--suave); font-weight: 400; }
.matriz td.total { font-weight: 700; border-left: 1px solid var(--borde); }
.matriz td.fecha { color: var(--suave); font-size: .8rem; }
.matriz tbody tr.fila-depto { cursor: pointer; }
.matriz tbody tr.fila-depto:hover th[scope=row] { color: var(--acento); }
.matriz tfoot td, .matriz tfoot th { font-weight: 700; border-bottom: 0; }
.estado-vacio { color: var(--error); font-weight: 600; font-size: .8rem; }

/* Detalle de un departamento */
.detalle td { position: sticky; left: 0; text-align: left; background: var(--fondo); padding: 8px 12px 12px; white-space: normal; }
.detalle ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.detalle li { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; font-size: .85rem; }
.detalle li .cuando { color: var(--suave); font-variant-numeric: tabular-nums; min-width: 120px; }
.detalle li a { color: var(--acento); font-weight: 600; }
