/* §9.B: estructura del dashboard sobre las grillas y tarjetas de Home. */
.actividad-dashboard .act-lede { font-size: var(--fs-sm); color: var(--label-color); margin-top: .35rem; }
.actividad-dashboard .act-charts { margin-top: 1.75rem; }
.actividad-dashboard .act-block { min-width: 0; }
.actividad-dashboard .stat-label-abbr { display: block; white-space: nowrap; }
.actividad-dashboard .panorama-stat[hidden] { display: none; }
/* Sin fila vacía de detalle; la grilla exterior conserva el alto común. */
.actividad-dashboard .act-highlights .panorama-stat:has(> .stat-detail[hidden]) { grid-template-rows: auto auto auto; }
.actividad-dashboard .act-highlights .panorama-stat:has(> .stat-detail[hidden]) .stat-date { grid-row: 3; }
.actividad-dashboard .chart-source-foot { padding: 0 .15rem .1rem; }
.actividad-dashboard .chart-source-foot-brand { display: block; }
.actividad-dashboard .chart-range-chip { min-width: 0; min-height: 0; font: 600 var(--fs-2xs)/1.2 var(--font-sans); }
.actividad-dashboard .macro-chart-legend { gap: 0; }
.actividad-dashboard .macro-chart-legend--center { justify-content: center; column-gap: 14px; row-gap: 8px; }
@media (min-width: 1100px) {
  .actividad-dashboard .act-highlights { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 900px) and (max-width: 1099px) {
  .actividad-dashboard .act-highlights .panorama-stat:nth-child(5) { grid-column: 1 / -1; padding-left: 0; border-top: 1px solid var(--rule); }
  .actividad-dashboard .act-highlights .panorama-stat:nth-child(5)::before { content: none; }
}
@media (max-width: 899px) {
  .actividad-dashboard .act-charts { display: block; height: auto; }
  .actividad-dashboard .act-charts > .act-block { height: auto; min-height: 0; }
  .actividad-dashboard #sectores,
  .actividad-dashboard #emaeSectorBars,
  .actividad-dashboard #emaeSectorBars .chart-widget,
  .actividad-dashboard #emaeSectorBars .chart-widget-custom-content,
  .actividad-dashboard #emaeSectorBars .emae-bars-body,
  .actividad-dashboard #emaeSectorBars .macro-chart-wrap,
  .actividad-dashboard #emaeSectorBars .macro-chart {
    height: auto; min-height: 0; align-self: start; flex: 0 0 auto;
  }
  .actividad-dashboard #emaeSectorBars .chart-widget-custom-content,
  .actividad-dashboard #emaeSectorBars .macro-chart-wrap { display: block; }
  .actividad-dashboard #emaeSectorBars .chart-widget-custom-content { width: 100%; align-self: stretch; }
  .actividad-dashboard #emaeSectorBars .emae-bars-body .macro-chart-wrap { flex: 1 1 0; min-width: 0; }
  .actividad-dashboard .act-highlights .panorama-stat:last-child { grid-column: 1 / -1; }
  .actividad-dashboard .act-highlights .panorama-stat:nth-child(odd)::before { content: none; }
  .actividad-dashboard .act-row .panorama-credit-stats > .panorama-stat:nth-child(1 of .panorama-stat:not([hidden])),
  .actividad-dashboard .act-row .panorama-credit-stats > .panorama-stat:nth-last-child(1 of .panorama-stat:not([hidden])):nth-child(even of .panorama-stat:not([hidden])) { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
  .actividad-dashboard[data-actividad-sector="panorama"] .act-charts > .act-block,
  .actividad-dashboard[data-actividad-sector="panorama"] .act-row { padding-inline: .75rem; }
}

/* Comercio conserva cuatro indicadores en la franja inicial. */
.comercio-page .act-row { margin-top: 1.5rem; }
.comercio-page .stat-detail [data-rate] { display: block; }
@media (min-width: 1100px) {
  .comercio-page .act-highlights { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .comercio-page .act-highlights .panorama-stat:last-child { grid-column: auto; }
}

/* Estilos de los indicadores de Empleo. */
.empleo-page [data-empleo-block] { margin-top: 1.5rem; }
.empleo-page [data-empleo-color] { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; }
.empleo-page .chart-widget-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
/* Registrado: Total compacto, modalidades en 2×3. */
.empleo-page [data-empleo-block="registrado"] .empleo-registrado-stack {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.empleo-page [data-empleo-block="registrado"] .empleo-registrado-modalidades {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
  min-width: 0;
}
.empleo-page [data-empleo-block="registrado"] .panorama-stat[data-stat="empleo-registrado-total"] {
  grid-column: 1 / -1;
  flex: 0 0 auto;
}
/* Las reglas de .act-row apuntan solo a hijos directos del aside; esta anula las de Home
   (:first-child sin padding-top, span en mobile) para las modalidades anidadas. */
.empleo-page [data-empleo-block="registrado"] .empleo-registrado-modalidades > .panorama-stat:not([hidden]) {
  grid-column: auto;
  padding-block: .75rem;
  border-top: 1px solid var(--rule);
  border-left: 0;
  border-right: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}
.empleo-page [data-empleo-block="registrado"] .stat-label { font-size: 13px; line-height: 1.35; margin: 0; }
.empleo-page [data-empleo-block="registrado"] .empleo-registrado-modalidades .stat-label { min-height: calc(1.35em * 2); }
.empleo-page [data-empleo-block="registrado"] .stat-value { font-size: 24px; margin-top: 6px; }
.empleo-page [data-empleo-block="registrado"] .panorama-stat[data-stat="empleo-registrado-total"] .stat-value { font-size: 28px; }
.empleo-page [data-empleo-block="registrado"] .stat-detail { font-size: 12px; margin-top: 2px; }
.empleo-page [data-empleo-block="registrado"] .stat-date { font-size: 11px; margin-top: 2px; }
/* Salarios: cinco variaciones reales. */
.empleo-page .empleo-salarios-stack {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}
.empleo-page .empleo-salarios-stack > .panorama-stat {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-width: 0;
  min-height: 0;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid var(--rule);
}
.empleo-page .empleo-salarios-stack > .panorama-stat:first-child { border-top: 0; }
.empleo-page .empleo-salarios-stack > .panorama-stat::before { content: none; }
.empleo-page .empleo-salarios-stack .stat-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}
.empleo-page .empleo-salarios-stack [data-empleo-color] {
  width: 14px;
  height: 3px;
  border-radius: 0;
  vertical-align: middle;
}
.empleo-page .empleo-salarios-stack .stat-value { font-size: 22px; margin-top: 2px; }
.empleo-page .empleo-salarios-meta { display: flex; align-items: baseline; flex-wrap: wrap; }
.empleo-page .empleo-salarios-meta .stat-detail { font-size: 12px; margin: 0; }
.empleo-page .empleo-salarios-meta .stat-date { font-size: 11px; margin: 0; }
.empleo-page .empleo-salarios-meta .stat-date::before { content: " · "; white-space: pre; }
@media (min-width: 900px) {
  .empleo-page [data-stat-layout="primary"] .empleo-registrado-stack,
  .empleo-page [data-stat-layout="primary"] .empleo-registrado-modalidades,
  .empleo-page [data-stat-layout="primary"] .empleo-salarios-stack {
    display: contents;
  }
}
@media (max-width: 899px) {
  .empleo-page [data-stat-layout="primary"] { grid-template-columns: minmax(0, 1fr); }
  .empleo-page .empleo-salarios-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    column-gap: 1rem;
  }
  .empleo-page .empleo-salarios-stack > .panorama-stat:first-child { grid-column: 1 / -1; }
  .empleo-page .empleo-salarios-stack .stat-label { white-space: normal; }
  .empleo-page .empleo-salarios-stack > .panorama-stat:not(:first-child) .stat-label { min-height: 2.7em; }
}

.activity-sector-data {
  margin-top: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.activity-sector-data summary {
  cursor: pointer;
}
.activity-sector-data table {
  width: 100%;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}
.activity-sector-data th,
.activity-sector-data td {
  padding: 0.25rem 0.125rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}
.activity-sector-data th:nth-child(2),
.activity-sector-data td:nth-child(2) {
  text-align: right;
}
.activity-sector-data th:last-child:not(:first-child),
.activity-sector-data td:last-child {
  text-align: right;
  white-space: nowrap;
}
