/* IDSAL · Resumen modular (propuesta 05)
   Estructura del Resumen: KPI → Atención + Proyección → Grupos + Avisos de datos.
   Solo estilos de los bloques .mod-* ; el resto del panel sigue en idsal-theme.css / idsal-refinement.css. */

.mod-kpis,.mod-main,.mod-groups{display:grid;gap:16px;margin-bottom:18px}
.mod-kpis>*,.mod-main>*,.mod-groups>*{min-width:0}
.mod-kpis{grid-template-columns:1.25fr 1fr 1fr 1fr}
.mod-main{grid-template-columns:minmax(0,2fr) minmax(0,1fr);align-items:stretch}
.mod-main.mod-single{grid-template-columns:minmax(0,1fr)}
.mod-groups{grid-template-columns:repeat(3,minmax(0,1fr))}
.mod-main>.upanel,.mod-groups>.upanel{margin:0!important;height:100%}

/* Barras de progreso (comparten forma en todo el bloque) */
.mod-bar{height:5px;border-radius:99px;background:var(--s2,#EEE9FF);overflow:hidden}
.mod-bar>i{display:block;height:100%;border-radius:99px;background:var(--mod-c,#27ae60);transform-origin:left}
.mod-g{--mod-c:#247A52;--mod-t:var(--green-text,#247A52)}.mod-y{--mod-c:#9A6700;--mod-t:var(--amber-text,#9A6700)}.mod-r{--mod-c:#B42318;--mod-t:var(--red-text,#B42318)}

/* KPI */
.mod-hero{background:#26164A;color:#FBFAF7;border-radius:16px;padding:1.15rem 1.3rem;display:flex;flex-direction:column;justify-content:space-between;gap:.7rem;min-height:128px;box-shadow:0 8px 22px -12px #26164A80}
.mod-hero-label{font-size:.72rem;font-weight:600;letter-spacing:.05em;color:#D9D0EA}
.mod-hero-num{display:flex;align-items:center;gap:.6rem;font-size:36px;font-weight:800;line-height:1.1;letter-spacing:-.035em;font-variant-numeric:tabular-nums}
.mod-dot{width:11px;height:11px;border-radius:50%;background:#C9F04A;flex:none}
.mod-hero .mod-bar{background:rgba(251,250,247,.22)}
.mod-hero .mod-bar>i{background:#C9F04A}
.mod-stat{background:var(--surface,#fff);border:1px solid var(--border);border-radius:16px;padding:1.15rem 1.3rem;display:flex;flex-direction:column;justify-content:space-between;gap:.7rem;min-height:128px;box-shadow:var(--idsal-panel-shadow,0 1px 2px rgba(38,22,74,.06))}
.mod-stat-label{font-size:.82rem;font-weight:600;color:var(--text)}
.mod-stat-num{font-size:32px;font-weight:750;line-height:1.2;letter-spacing:-.025em;color:var(--mod-t);font-variant-numeric:tabular-nums}
.mod-stat-num span{display:inline-block;font-size:12px;line-height:1.5;letter-spacing:0;font-weight:500;color:var(--muted);margin-left:.45rem}

/* Paneles con título */
.mod-title{font-weight:700;font-size:16px;line-height:1.4;letter-spacing:-.015em;color:var(--text)}
.mod-sub{font-size:13px;line-height:1.55;color:var(--muted);margin-top:.15rem}
.mod-foot{font-size:12px;line-height:1.55;color:var(--muted);margin-top:auto;padding-top:14px;border-top:1px solid var(--border)}

/* Proyección */
.mod-proj{display:flex;flex-direction:column;gap:.85rem;padding:1.1rem 1.2rem}
.mod-proj-top{display:flex;justify-content:space-between;align-items:baseline;font-size:.84rem;margin-bottom:.35rem;color:var(--text)}
.mod-proj-top b{font-size:1.3rem;font-weight:800;color:var(--mod-t);font-variant-numeric:tabular-nums}

/* Grupos METAS / IAAPS */
.mod-group{display:flex;flex-direction:column;gap:.7rem;padding:1.1rem 1.2rem}
.mod-group .mod-title{border-left:4px solid #3B5BA5;padding-left:.6rem}
.mod-g-i .mod-title{border-left-color:#147775}
.mod-counts{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem;margin:.2rem 0 .4rem}
.mod-counts b{display:block;font-size:24px;font-weight:750;line-height:1.25;font-variant-numeric:tabular-nums}
.mod-counts span{font-size:12px;line-height:1.5;color:var(--muted)}
.mod-counts .g b{color:var(--green-text,#247A52)}.mod-counts .y b{color:var(--amber-text,#9A6700)}.mod-counts .r b{color:var(--red-text,#B42318)}
.mod-cta{margin-top:auto;border:0;border-radius:99px;min-height:44px;padding:.6rem 1rem;font:inherit;font-size:.86rem;font-weight:700;color:#fff;background:#3B5BA5;cursor:pointer}
.mod-g-i .mod-cta{background:#147775}
.mod-cta{transition:filter 150ms ease,box-shadow 150ms ease}
.mod-cta:hover{filter:brightness(1.05);box-shadow:0 4px 10px -5px #26164A40}
.mod-cta:focus-visible{outline:3px solid var(--idsal-focus,#7C5CFF);outline-offset:2px}

/* Avisos de datos */
.mod-aviso{display:flex;flex-direction:column;gap:.6rem;padding:1.1rem 1.2rem;background:var(--tint-amber,#FFF4D6)!important;border:1px solid rgba(154,103,0,.35)!important}
.mod-aviso.mod-alto{border-color:rgba(180,35,24,.4)!important}
.mod-aviso.mod-ok{background:var(--tint-green,#E4F5EA)!important;border-color:rgba(36,122,82,.35)!important}
.mod-aviso-head{display:flex;justify-content:space-between;align-items:flex-start;gap:.6rem}
.mod-chip{font-size:.72rem;font-weight:700;padding:.18rem .6rem;border-radius:99px;background:var(--surface,#fff);color:var(--text);border:1px solid var(--border);white-space:nowrap}
.mod-aviso-list{margin:0;padding-left:1.1rem;font-size:.84rem;line-height:1.45;color:var(--text)}
.mod-aviso-list li+li{margin-top:.35rem}
.mod-aviso-list .mod-more{list-style:none;margin-left:-1.1rem;color:var(--muted);font-weight:600}
.mod-cta-light{background:var(--surface,#fff);color:var(--text);border:1px solid var(--border)}

/* Filas de «Requieren atención» dentro del módulo */
.mod-main>.overview-attention{display:flex;flex-direction:column}
.mod-main>.overview-attention>div:first-child{align-items:flex-start!important}
.mod-main>.overview-attention>div:first-child>div:last-child{max-width:48ch}
.mod-main .overview-attention-row{padding:16px!important}
.mod-main .overview-attention-row>span:last-child{font-weight:650!important}
.mod-main>.upanel,.mod-groups>.mod-group{border-color:var(--idsal-module-line,var(--border))!important;box-shadow:var(--idsal-panel-shadow)!important}
html[data-theme="dark"] .mod-g{--mod-c:#83CBA5}
html[data-theme="dark"] .mod-y{--mod-c:#E0B45A}
html[data-theme="dark"] .mod-r{--mod-c:#EFABA1}

/* Entrada breve (solo si el usuario no pidió menos movimiento) */
@keyframes mod-in{from{opacity:.85;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes mod-bar{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@media(prefers-reduced-motion:no-preference){
  .mod-kpis>*,.mod-main>*,.mod-groups>*{animation:mod-in 320ms cubic-bezier(.2,.7,.2,1) backwards}
  .mod-main>*:nth-child(2),.mod-groups>*:nth-child(2){animation-delay:40ms}
  .mod-groups>*:nth-child(3){animation-delay:80ms}
  .mod-bar>i{animation:mod-bar 520ms cubic-bezier(.2,.7,.2,1) 120ms backwards}
}

@media(max-width:1100px){
  .mod-main,.mod-groups{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:760px){
  .mod-kpis{grid-template-columns:repeat(3,minmax(0,1fr));gap:.6rem}
  .mod-hero{grid-column:1/-1;min-height:112px}
  .mod-hero-num{font-size:32px}
  .mod-stat{min-height:104px;padding:.85rem .8rem}
  .mod-stat-label{font-size:.78rem}
  .mod-stat-num{font-size:28px}
  .mod-stat-num span{display:block;margin:.25rem 0 0;font-size:12px}
}
@media(prefers-reduced-motion:reduce){.mod-cta{transition:none}}


/* Barra lateral (propuesta 05): rótulo GESTIÓN real y tarjeta flotante en escritorio */
.nav-section-label{font-size:.68rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);padding:.2rem 1rem .7rem}
@media(min-width:1200px){
  .app:not(.nav-hidden){grid-template-columns:248px minmax(0,1fr)!important}
  .app:not(.nav-hidden) aside{margin:12px 0 12px 12px;top:80px;height:calc(100dvh - 92px);border:1px solid var(--border);border-radius:18px;box-shadow:0 10px 30px -22px rgba(38,22,74,.45)!important}
  .app:not(.nav-hidden) aside .sidebar-brand-footer{border-bottom-left-radius:18px;border-bottom-right-radius:18px}
}
@media(min-width:861px) and (max-width:1199px){
  aside:not(:hover) .nav-section-label{display:none}
}


/* Puntaje: estados semánticos (verde / ámbar / rojo / sin datos) con los colores de texto del tema, legibles en claro y oscuro */
.score-state.score-st-g{color:var(--green-text,#247A52)!important}
.score-state.score-st-y{color:var(--amber-text,#9A6700)!important}
.score-state.score-st-r{color:var(--red-text,#B42318)!important}
.score-state.score-st-n{color:var(--muted)!important}

/* Modo oscuro: las tarjetas de resumen (Puntaje, Calendario) heredaban fondo blanco fijo con texto claro (ilegible) */
html[data-theme="dark"] .ptile{background:var(--surface)!important;border-color:var(--border)!important}
html[data-theme="dark"] .ptile .pico{background:rgba(255,255,255,.08)!important;color:#CFC6E2!important}

/* Respuesta al presionar (plan 001): se hunde al instante al tocar (100 ms) y vuelve con la transición propia del elemento al soltar */
:root{--ease-press:cubic-bezier(0.23,1,0.32,1)}
.btn,.hbtn,.nitem,.mc-tab,.mc-item,.mod-cta,.idsal-cta,.cal-ctl button,.kcard,.overview-attention-row,summary.indicator-section-heading{-webkit-tap-highlight-color:transparent}
.btn:not(:disabled):active,.hbtn:active,.nitem:active,.mc-tab:active,.mc-item:active,.mod-cta:active,.idsal-cta:active,.cal-ctl button:active{transform:scale(.97)!important;transition:transform 100ms var(--ease-press)!important}
.kcard:active,.overview-attention-row:active,summary.indicator-section-heading:active{transform:scale(.985)!important;transition:transform 100ms var(--ease-press)!important}
@media(prefers-reduced-motion:reduce){
  .btn:not(:disabled):active,.hbtn:active,.nitem:active,.mc-tab:active,.mc-item:active,.mod-cta:active,.idsal-cta:active,.cal-ctl button:active,
  .kcard:active,.overview-attention-row:active,summary.indicator-section-heading:active{transform:none!important;opacity:.82;transition:opacity 100ms ease!important}
}
