
/* =========================================================
   MSM CONTROL ENTERPRISE · PLANTILLA PROFESIONAL V7.2
   FASE 2: Header compacto + lanzador de módulos + contraste
   ========================================================= */

/* Header más compacto */
body header .container.nav{
  min-height:64px!important;
  padding:9px 20px!important;
}
body header .brand h1{
  font-size:21px!important;
}
body header .brand small{
  font-size:9px!important;
  margin-top:3px!important;
}
body .session-line{
  min-height:27px!important;
  padding:6px 20px!important;
  display:flex!important;
  align-items:center!important;
}
body .session-line small{
  font-size:9px!important;
}

/* Botón lanzador de módulos */
.msm-module-launcher{
  position:relative;
  display:inline-flex;
  align-items:center;
}
.msm-module-button{
  display:inline-flex!important;
  align-items:center!important;
  gap:7px!important;
  padding:9px 12px!important;
  color:#fff!important;
  background:rgba(255,255,255,.08)!important;
  border:1px solid rgba(255,255,255,.16)!important;
  border-radius:10px!important;
  font-size:12px!important;
  font-weight:800!important;
  cursor:pointer!important;
}
.msm-module-button:hover,
.msm-module-button.open{
  background:rgba(255,255,255,.16)!important;
}
.msm-module-menu{
  position:absolute;
  top:calc(100% + 9px);
  left:0;
  width:270px;
  display:none;
  padding:8px;
  background:#fff;
  border:1px solid #d9e3ec;
  border-radius:14px;
  box-shadow:0 18px 44px rgba(17,45,73,.18);
  z-index:3000;
}
.msm-module-menu.open{display:block}
.msm-module-menu-title{
  padding:7px 9px 6px;
  color:#6b8194;
  font-size:9px;
  letter-spacing:1.3px;
  font-weight:900;
  text-transform:uppercase;
}
.msm-module-item{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  width:100%!important;
  padding:10px 11px!important;
  border-radius:9px!important;
  color:#173652!important;
  background:transparent!important;
  border:0!important;
  text-decoration:none!important;
  font-size:12px!important;
  font-weight:750!important;
}
.msm-module-item:hover{
  background:#edf5fc!important;
  color:#0c65bd!important;
}
.msm-module-icon{
  width:22px;
  height:22px;
  border-radius:7px;
  display:grid;
  place-items:center;
  background:#e8f2fb;
  color:#0d70cb;
  font-size:12px;
  flex:0 0 22px;
}

/* Contraste automático para encabezados oscuros */
.msm-dark-surface,
.msm-dark-surface *{
  border-color:rgba(255,255,255,.08);
}
.msm-dark-surface h1,
.msm-dark-surface h2,
.msm-dark-surface h3{
  color:#fff!important;
}
.msm-dark-surface p,
.msm-dark-surface small,
.msm-dark-surface .subtitle,
.msm-dark-surface [class*="sub"],
.msm-dark-surface [class*="description"]{
  color:rgba(255,255,255,.76)!important;
}
.msm-dark-surface .eyebrow,
.msm-dark-surface [class*="kicker"],
.msm-dark-surface [class*="eyebrow"]{
  color:#58aef5!important;
}

/* Cabeceras de módulo más consistentes */
main.container section:first-of-type{
  scroll-margin-top:100px;
}
main.container h1{
  letter-spacing:-.5px;
}
main.container h2{
  letter-spacing:-.2px;
}

/* Tarjetas KPI */
main.container [class*="kpi"],
main.container [class*="metric"],
main.container [class*="stat"]{
  border-radius:14px;
}

/* Botones de acción */
main.container a[class*="btn"],
main.container button{
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease;
}
main.container a[class*="btn"]:hover,
main.container button:hover{
  box-shadow:0 5px 14px rgba(22,67,105,.10);
}

/* Mejor separación del contenido */
main.container{
  padding-top:18px!important;
}

/* Móvil */
@media(max-width:980px){
  body header .container.nav{
    min-height:60px!important;
  }
  .msm-module-launcher{
    width:100%;
  }
  .msm-module-button{
    width:100%!important;
    justify-content:center!important;
  }
  .msm-module-menu{
    position:static;
    width:100%;
    margin-top:6px;
    box-shadow:none;
  }
}

/* V7.2.1 - ajustes de menú */
.msm-module-menu{
  top:calc(100% + 12px)!important;
  max-height:min(520px,calc(100vh - 130px));
  overflow:auto;
}
.msm-module-item-active{
  background:#e7f2fd!important;
  color:#0b65be!important;
}
.msm-module-item-active .msm-module-icon{
  background:#0f6fe8!important;
  color:#fff!important;
}
