/* F05 Estructura de movilización (V360-HTML-03A). Scoped to structure classes;
   shared shell, base, dashboard, voters, registry and referrals styles are not
   changed. Source typography: headings 18/26, subtitles and legends 14/20.
   Overview geometry (V360-HTML-03A correction, Sol finding C/D) follows the
   source 1728 rhythm: KPI band top 244, chart pair top 392 height 292, ranking
   row pitch 41, plot viewport at chart-local y 80, legend at y 253, table top
   700 with 18px inset, 40px header band and alternating even-row fills. */

/* KPI band: padding, not margin, so the page-head's 16px margin cannot collapse it away. */
.structure-kpis{margin-bottom:16px;padding-top:14px;}
.structure-charts{margin:0;}
/* Card internals in border-box coordinates (source chart frame, 1728): title y16,
   subtitle y43, divider y72, plot viewport y80-240, legend text y266, card 292. */
.structure-charts .chart-card{min-height:292px;gap:0;padding:15px 18px 5px;}
.structure-charts .chart-card h3{font:600 18px/26px Inter,ui-sans-serif,system-ui,sans-serif;}
/* Subtitle sits above a source divider at chart-local y 72. */
.structure-charts .chart-card .chart-sub{margin:1px 0 0;padding-bottom:9px;border-bottom:1px solid var(--line);font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;}
/* Plot viewport: 160px tall at chart-local y 80; the SVG keeps the 520x230 aspect with uniform scale. */
.structure-grouped{display:block;width:100%;height:160px;max-height:none;margin-top:7px;}
.structure-grid{stroke:var(--line);stroke-width:1;}
.structure-grouped__label{font:400 20px/24px Inter,ui-sans-serif,system-ui,sans-serif;fill:var(--muted);}
/* Legend text at chart-local y 266, 26px below the 240 plot bottom. */
.structure-legend{display:flex;flex-wrap:wrap;gap:18px;margin-top:26px;}
/* Ranking: 14/20 label clear above its 10px track (no overlap), 11px between rows = 41px pitch. */
.structure-rank .director-rank-bars{gap:11px;margin-top:7px;}
.structure-rank .director-rank-row{gap:0;}
.structure-rank .director-rank-copy{font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;}
.structure-rank .bar-track{height:10px;}
/* At desktop the card inner width is 650px, the source track width. */
@media (min-width:1181px){
  .structure-charts .structure-rank{padding-right:10px;}
}
.structure-table{margin-top:16px;}
.structure-table .table-card__head{padding:14px 18px 10px;border-bottom:0;}
/* Inset is measured from the card's outer edge (border included): 17px margin + 1px border = 18px. */
.structure-overview-table{width:calc(100% - 34px);margin:0 17px 16px;}
.structure-overview-table th,.structure-overview-table td{padding:10px 14px;}
.structure-overview-table thead th{padding:11px 14px 12.5px;}
.structure-overview-table td{height:44px;}
.structure-overview-table tbody tr:nth-child(even){background:var(--surface-subtle);}
/* Source desktop proportions (90/250/125/135/190/165/140/245 of 1340px). Applied only where
   the table fits; intermediate widths keep the in-card horizontal scroll. */
@media (min-width:1181px){
  .structure-overview-table{table-layout:fixed;}
  .structure-overview-table th:nth-child(1){width:6.716%;}
  .structure-overview-table th:nth-child(2){width:18.657%;}
  .structure-overview-table th:nth-child(3){width:9.328%;}
  .structure-overview-table th:nth-child(4){width:10.075%;}
  .structure-overview-table th:nth-child(5){width:14.179%;}
  .structure-overview-table th:nth-child(6){width:12.313%;}
  .structure-overview-table th:nth-child(7){width:10.448%;}
  .structure-overview-table th:nth-child(8){width:18.284%;}
}
.structure-progress{width:110px;}
.structure-progress > span{display:block;height:100%;}
.structure-note{margin:14px 2px 0;}
.structure-crumbs{margin:-18px 0 14px;}
.structure-metrics{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin:0 0 16px;}
.structure-metrics .metric-card{min-height:112px;}
/* Position the table cards so their visually hidden text (sr-only) clips inside
   the card's own overflow scroll instead of extending the whole page width. */
.structure-table,.structure-children,.structure-sample{position:relative;}
.structure-children,.structure-sample{margin:0 0 16px;}
.structure-child-table,.structure-sample-table{width:calc(100% - 32px);margin:0 16px 16px;}
.structure-child-table th,.structure-child-table td,.structure-sample-table th,.structure-sample-table td{padding:10px 14px;}
.structure-child-table td,.structure-sample-table td{height:44px;}
.structure-empty{margin:0 18px 18px;}
.structure-sample .table-card__head p{margin:4px 0 0;}
.structure-not-found{margin-top:8px;}

@media (max-width:1180px){
  .structure-charts{grid-template-columns:minmax(0,1fr);}
}
@media (max-width:720px){
  .structure-kpis{padding-top:0;}
  .structure-grouped{height:auto;aspect-ratio:520 / 230;}
  .structure-charts .chart-card{min-height:0;}
  .structure-legend{gap:12px;}
  .structure-table .table-card__head{align-items:flex-start;flex-wrap:wrap;}
  .structure-overview-table,.structure-child-table,.structure-sample-table{width:100%;margin:0;}
  .structure-progress{width:100%;max-width:110px;}
  .structure-metrics{grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
  .structure-children .table-card__head,.structure-sample .table-card__head{flex-wrap:wrap;}
}
@media (max-width:420px){
  .structure-metrics{grid-template-columns:minmax(0,1fr);}
}
