/* RedSalva BI · Análisis de atenciones por edad y sexo */
.aes-page{padding:22px 25px 30px!important;background:#f7f9fb;color:#263f58;font-family:'Poppins','Segoe UI',Arial,sans-serif}
.aes-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 15px;padding:0 2px}
.aes-heading h2{margin:0 0 4px;color:#173b60;font-size:24px;font-weight:600}
.aes-heading p{margin:0;color:#7b8ca2;font-size:12px}
.aes-tag{display:flex;align-items:center;gap:8px;padding:9px 12px;border-radius:12px;background:#eaf7f6;color:#278e91;font-size:10px;font-weight:600;white-space:nowrap}
.aes-tag svg{width:17px;height:17px}
.aes-filter-card,.aes-controls-card,.aes-panel,.aes-kpi{background:#fff;border:1px solid #dce6f2;border-radius:13px;box-shadow:0 3px 12px rgba(25,55,90,.045)}
.aes-filter-card{padding:13px 15px;margin-bottom:10px}
.aes-filter-grid{display:grid;grid-template-columns:minmax(340px,1.5fr) minmax(130px,.65fr) minmax(170px,.8fr) minmax(150px,.7fr);gap:12px;align-items:end}
.aes-field label{display:block;margin:0 0 6px;color:#173b60;font-size:11px;font-weight:600}
.aes-select{height:36px;width:100%;border:1px solid #d4e0ef;border-radius:8px;background:#fff;color:#24415f;padding:0 10px;font:inherit;font-size:11px}
.aes-horizons{display:flex;flex-wrap:nowrap;gap:4px;overflow-x:auto;padding-bottom:1px}
.aes-horizons button{height:31px;padding:0 8px;border:1px solid #d4e0ef;border-radius:8px;background:#fff;color:#34516d;font:500 9px 'Poppins',sans-serif;white-space:nowrap;cursor:pointer}
.aes-horizons button.active,.aes-horizons button:hover{background:#4bb9b5;border-color:#4bb9b5;color:#fff}
.aes-filter-note{display:flex;align-items:center;gap:6px;margin-top:8px;color:#66809c;font-size:10px}
.aes-filter-note svg{width:14px;height:14px;color:#3489d8}
.aes-controls-card{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;padding:10px 12px;margin-bottom:12px}
.aes-indicator-area{display:flex;align-items:center;gap:12px;min-width:0;flex:1}
.aes-indicator-title{display:flex;align-items:center;gap:7px;color:#173b60;font-size:11px;white-space:nowrap}
.aes-indicator-title svg{width:17px;height:17px;color:#299d9b}
.aes-indicators{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:7px;flex:1}
.aes-indicator{height:43px;display:flex;align-items:center;gap:8px;padding:5px 9px;border:1px solid #d8e3ed;border-radius:9px;background:#fff;color:#56718a;text-align:left;cursor:pointer;min-width:0}
.aes-indicator>svg:first-child{width:17px;height:17px;flex:0 0 17px}
.aes-indicator span{display:flex;flex-direction:column;min-width:0;line-height:1.2}
.aes-indicator b{font-size:10px;color:#25425f}
.aes-indicator small{font-size:8px;color:#8494a7;white-space:nowrap}
.aes-indicator .aes-radio{width:11px;height:11px;border:1px solid #b8c8d6;border-radius:50%;margin-left:auto;flex:0 0 11px}
.aes-indicator.active{background:#edf9f8;border-color:#55b9b5}
.aes-indicator.active .aes-radio{border:3px solid #43b5b2;background:#fff}
.aes-actions{display:flex;gap:6px;flex:0 0 auto}
.aes-btn{height:36px;padding:0 10px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;gap:6px;font:600 10px 'Poppins',sans-serif;white-space:nowrap;cursor:pointer}
.aes-btn svg{width:14px;height:14px}
.aes-primary{background:#4bb9b5;border:1px solid #4bb9b5;color:#fff}
.aes-primary:hover{background:#329e9c}
.aes-outline{background:#fff;border:1px solid #4bb9b5;color:#287f89}
.aes-outline:hover{background:#effafa}
.aes-loading{padding:8px 0;color:#6f8197;font-size:11px;display:flex;align-items:center;gap:8px}
.aes-loading span{width:15px;height:15px;border:2px solid #d8e7ed;border-top-color:#36aaa7;border-radius:50%;animation:aes-spin .7s linear infinite}
@keyframes aes-spin{to{transform:rotate(360deg)}}
.aes-message{margin:8px 0;padding:10px 12px;border-radius:8px;background:#fff1f0;color:#a53b35;border:1px solid #ffd7d3;font-size:11px}
.aes-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-bottom:12px}
.aes-kpi{padding:12px 14px;min-width:0}
.aes-kpi>div{display:flex;align-items:center;justify-content:space-between;color:#60758c;font-size:10px;font-weight:600}
.aes-kpi>div svg{width:19px;height:19px;color:#35aaa7}
.aes-kpi strong{display:block;margin:6px 0 1px;color:#173b60;font-size:22px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aes-kpi small{font-size:9px;color:#8794a6}
.aes-kpi small.up{color:#239b58;font-weight:600}.aes-kpi small.down{color:#d64d61;font-weight:600}
.aes-grid{display:grid;gap:11px;margin-bottom:11px}
.aes-grid-top{grid-template-columns:1.12fr .82fr 1.18fr}
.aes-grid-bottom{grid-template-columns:.9fr 1.05fr 1.35fr}
.aes-panel{padding:12px 13px;min-width:0}
.aes-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:8px}
.aes-panel h3{margin:0 0 3px;color:#173b60;font-size:12px;font-weight:600}
.aes-panel-head p,.aes-section-title p{margin:0;color:#8997a9;font-size:9px}
.aes-chart{height:205px;position:relative}
.aes-grid-bottom .aes-chart{height:210px}
.aes-legend{display:flex;gap:8px;white-space:nowrap;font-size:8px;color:#62758a}
.aes-legend span{display:flex;align-items:center;gap:4px}
.aes-legend i{width:8px;height:8px;border-radius:2px;display:inline-block}
.aes-legend .female{background:#ed79b5}.aes-legend .male{background:#69aef0}
.aes-table-wrap{width:100%;overflow:auto;max-height:245px}
.aes-table{width:100%;border-collapse:collapse;min-width:440px;font-size:9px;color:#294663}
.aes-table th{position:sticky;top:0;z-index:1;background:#f3f7fb;color:#53677f;font-size:8px;font-weight:600;text-align:left;white-space:nowrap}
.aes-table td,.aes-table th{padding:6px 6px;border-bottom:1px solid #e8eef5}
.aes-table .num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.aes-table tbody tr:hover{background:#f7fbfc}
.aes-table tfoot th{background:#eaf7f6;color:#173b60;border-top:2px solid #4bb9b5}
.aes-summary-panel .aes-table{min-width:400px}
.aes-wide-panel{margin-bottom:12px;padding:14px}
.aes-section-title{display:flex;align-items:center;gap:9px;margin-bottom:12px}
.aes-section-title h3{font-size:13px}
.aes-section-icon{width:32px;height:32px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex:0 0 32px}
.aes-section-icon svg{width:18px;height:18px}
.aes-section-icon.purple{background:#f0eafe;color:#7956c8}
.aes-section-icon.teal{background:#e5f7f5;color:#279e9a}
.aes-subgrid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1.45fr);gap:14px;align-items:start}
.aes-subgrid h4{margin:0 0 7px;color:#35516d;font-size:10px;font-weight:600}
.aes-chart-wide{height:270px}
.aes-tall{max-height:300px}
.aes-detail-table{min-width:620px}
.aes-detail-table th,.aes-detail-table td{padding:6px 5px;font-size:8px}
@media(max-width:1400px){.aes-filter-grid{grid-template-columns:minmax(290px,1.3fr) minmax(120px,.65fr) minmax(150px,.8fr) minmax(130px,.7fr)}.aes-horizons button{padding:0 6px;font-size:8px}.aes-controls-card{align-items:stretch;flex-direction:column}.aes-indicator-area{width:100%}.aes-actions{justify-content:flex-end}}
@media(max-width:1100px){.aes-grid-top,.aes-grid-bottom{grid-template-columns:repeat(2,minmax(0,1fr))}.aes-summary-panel{grid-column:1/-1}.aes-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.aes-horizon-field{grid-column:1/-1}.aes-horizons{flex-wrap:wrap;overflow:visible}}
@media(max-width:750px){.aes-page{padding:18px 13px!important}.aes-heading{align-items:flex-start;flex-direction:column}.aes-heading h2{font-size:20px}.aes-filter-grid,.aes-grid-top,.aes-grid-bottom,.aes-subgrid{grid-template-columns:1fr}.aes-horizon-field,.aes-summary-panel{grid-column:auto}.aes-indicator-area{align-items:flex-start;flex-direction:column}.aes-indicators{grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.aes-actions{width:100%;flex-wrap:wrap}.aes-actions .aes-btn{flex:1}.aes-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.aes-kpi strong{font-size:18px}.aes-chart{height:225px}.aes-chart-wide{height:260px}}


/* Distribución por sexo: comparación actual vs. periodo anterior */
.aes-grid-top{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.aes-sex-panel{min-width:0}
.aes-sex-visuals{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:start}
.aes-sex-metric{min-width:0;text-align:center;padding:5px 8px 8px;border:1px solid #edf1f6;border-radius:10px;background:#fcfdff}
.aes-sex-metric.is-single{grid-column:1/-1;max-width:460px;width:100%;justify-self:center}
.aes-sex-metric-title{font-size:11px;font-weight:650;color:#294966;margin-bottom:2px}
.aes-sex-donut{height:112px;max-width:180px;margin:0 auto;position:relative}
.aes-sex-total{font-size:10px;font-weight:650;color:#173b60;margin:2px 0 8px}
.aes-sex-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;text-align:left}
.aes-sex-stat{min-width:0;padding:6px 5px;border-radius:7px;background:#f5f8fb;display:flex;flex-direction:column;gap:2px}
.aes-sex-stat-top{display:flex;align-items:center;justify-content:space-between;gap:3px;font-size:8px;color:#647991}
.aes-sex-stat-top span{display:flex;align-items:center;gap:3px;min-width:0}
.aes-sex-stat-top i{width:7px;height:7px;border-radius:50%;flex:0 0 7px}
.aes-sex-stat-top b{font-size:9px;color:#294966}
.aes-sex-stat>strong{font-size:10px;color:#173b60;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.aes-sex-stat>small{font-size:8px;white-space:nowrap}
.aes-sex-stat .up{color:#239b58;font-weight:650}
.aes-sex-stat .down{color:#d64d61;font-weight:650}
.aes-sex-stat .neutral{color:#8794a6}
.aes-sex-previous{color:#8794a6}
.aes-sex-legend{display:flex;justify-content:center;gap:15px;margin-top:8px;color:#687d92;font-size:9px}
.aes-sex-legend span{display:flex;align-items:center;gap:4px}
.aes-sex-legend i{width:8px;height:8px;border-radius:50%;display:inline-block}
.aes-sex-legend .female{background:#ed79b5}.aes-sex-legend .male{background:#69aef0}.aes-sex-legend .unknown{background:#aab7c4}
.aes-age-sex-panel{margin-bottom:11px}
.aes-chart-age-sex{height:245px}
.aes-sex-loading{padding:35px 10px;text-align:center;color:#8794a6;font-size:10px}
@media(max-width:1100px){
 .aes-grid-top{grid-template-columns:repeat(2,minmax(0,1fr))}
 .aes-sex-visuals{grid-template-columns:1fr}
 .aes-sex-metric.is-all{max-width:460px;width:100%;justify-self:center}
}
@media(max-width:750px){
 .aes-grid-top{grid-template-columns:1fr}
 .aes-sex-visuals{grid-template-columns:1fr}
 .aes-sex-metric.is-all{max-width:none}
 .aes-sex-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
 .aes-chart-age-sex{height:225px}
}

/* Ajuste de tarjetas de distribución por sexo: evitar solapamiento de etiqueta y porcentaje */
.aes-sex-stat-top{
    flex-direction:column;
    align-items:flex-start;
    justify-content:flex-start;
    gap:3px;
}
.aes-sex-stat-top span{
    width:100%;
    white-space:normal;
    line-height:1.25;
}
.aes-sex-stat-top b{
    align-self:flex-end;
    white-space:nowrap;
    line-height:1.2;
}
.aes-sex-stat>strong{
    white-space:normal;
    overflow-wrap:anywhere;
    line-height:1.25;
    font-size:9px;
}
.aes-sex-stat>small{
    white-space:normal;
    line-height:1.25;
}


/* Evolución mensual segmentada */
.aes-grid-bottom{grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);align-items:stretch}
.aes-monthly-panel{min-width:0}
.aes-monthly-head{align-items:center}
.aes-monthly-control{display:flex;align-items:center;gap:7px;flex:0 0 auto}
.aes-monthly-control label{font-size:9px;font-weight:600;color:#536b83;white-space:nowrap}
.aes-monthly-control .aes-select{width:145px;height:32px;font-size:10px}
.aes-monthly-chart{height:270px}
@media(max-width:1100px){
 .aes-grid-bottom{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:750px){
 .aes-grid-bottom{grid-template-columns:1fr}
 .aes-monthly-head{align-items:flex-start;flex-direction:column}
 .aes-monthly-control{width:100%;justify-content:space-between}
 .aes-monthly-control .aes-select{width:min(65%,220px)}
 .aes-monthly-chart{height:245px}
}


/* Barras horizontales apiladas al 100% para especialidad y categoría */
.aes-chart-caption{margin:-3px 0 5px;color:#8997a9;font-size:9px;line-height:1.35}
.aes-chart-wide{height:285px}
.aes-wide-panel .aes-subgrid>div{min-width:0}
.aes-wide-panel .aes-subgrid h4{margin-bottom:3px}
@media(max-width:750px){
 .aes-chart-wide{height:300px}
}
