/*
 * OPERACIONES / EQUIPOS CRA
 * CASCADA CANONICA TEST - G4G2C2 2026-08-18
 *
 * Orden funcional deliberado:
 * estructura base -> layout compacto -> popover de miembros
 * -> estructura KPI -> acabado KPI -> ranking G1-G5.
 *
 * Un selector repetido entre estas capas no implica por sí solo
 * redundancia. No fusionar ni reordenar reglas sin comprobar
 * la cascada efectiva.
 *
 * G4G2C2 documenta únicamente el contrato existente.
 */.ops-groups-panel{
  margin:0 0 18px;
  padding:18px;
  border:1px solid rgba(120,160,195,.22);
  border-radius:18px;
  background:linear-gradient(145deg,#0a2943,#061a2d);
  box-shadow:0 14px 34px rgba(0,0,0,.16);
}

.ops-groups-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:14px;
}

.ops-groups-kicker{
  display:block;
  margin-bottom:4px;
  color:#55d7e9;
  font-size:11px;
  font-weight:900;
  letter-spacing:.12em;
}

.ops-groups-title{
  margin:0;
  color:#f2f8fd;
  font-size:22px;
}

.ops-groups-subtitle{
  margin:6px 0 0;
  color:#91abc3;
  font-size:12px;
  line-height:1.45;
}

.ops-groups-state{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 11px;
  border:1px solid rgba(245,196,71,.4);
  border-radius:999px;
  background:rgba(245,196,71,.09);
  color:#ffd86c;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
}

.ops-groups-summary{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:14px;
}

.ops-groups-summary span{
  padding:6px 9px;
  border:1px solid rgba(120,160,195,.16);
  border-radius:8px;
  background:rgba(3,22,39,.5);
  color:#91abc3;
  font-size:11px;
}

.ops-groups-summary b{
  color:#eef7ff;
}

.ops-groups-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:11px;
}

.ops-group-card{
  overflow:hidden;
  border:1px solid rgba(116,159,196,.18);
  border-radius:14px;
  background:rgba(3,21,37,.7);
}

.ops-group-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:11px;
  border-bottom:1px solid rgba(116,159,196,.13);
}

.ops-group-badge{
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  border:1px solid rgba(76,202,224,.38);
  border-radius:11px;
  background:rgba(30,138,163,.13);
  color:#65dded;
  font-weight:950;
}

.ops-group-headtext{
  flex:1;
  min-width:0;
}

.ops-group-headtext strong{
  display:block;
  color:#f1f7fc;
  font-size:13px;
}

.ops-group-headtext small{
  color:#748fa9;
  font-size:9px;
}

.ops-group-count{
  color:#9ab5cd;
  font-size:11px;
  font-weight:800;
}

.ops-group-members{
  display:grid;
  gap:5px;
  padding:9px;
}

.ops-group-member{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  padding:6px 7px;
  border:1px solid rgba(112,151,185,.1);
  border-radius:7px;
  background:rgba(7,31,51,.52);
}

.ops-group-member-code{
  overflow:hidden;
  color:#dae9f5;
  font-size:10px;
  font-weight:800;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.ops-group-role{
  flex:0 0 auto;
  padding:3px 5px;
  border-radius:5px;
  background:rgba(58,163,190,.13);
  color:#83ddeb;
  font-size:8px;
  font-weight:900;
}

.ops-group-role[data-role="REFUERZO"]{
  background:rgba(205,160,65,.14);
  color:#f1c968;
}

.ops-groups-unassigned{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:11px;
  padding:10px 11px;
  border:1px dashed rgba(126,158,190,.22);
  border-radius:11px;
  background:rgba(3,21,37,.4);
}

.ops-groups-unassigned-label{
  color:#819ab2;
  font-size:9px;
  font-weight:900;
}

.ops-groups-unassigned-list{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}

.ops-groups-unassigned-member{
  padding:5px 8px;
  border:1px solid rgba(132,162,191,.15);
  border-radius:7px;
  color:#dce9f4;
  font-size:10px;
  font-weight:800;
}

.ops-groups-warning{
  margin-top:11px;
  padding:8px 10px;
  border-left:3px solid rgba(241,192,69,.65);
  border-radius:6px;
  background:rgba(151,108,18,.08);
  color:#cdb778;
  font-size:10px;
}

.ops-groups-loading{
  padding:18px;
  color:#809bb4;
  font-size:12px;
}

.ops-groups-error{
  padding:15px;
  color:#efaaaa;
  font-size:12px;
}

@media(max-width:1550px){
  .ops-groups-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:1180px){
  .ops-groups-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:720px){
  .ops-groups-grid{
    grid-template-columns:1fr;
  }

  .ops-groups-head,
  .ops-groups-unassigned{
    align-items:flex-start;
    flex-direction:column;
  }
}

/*
 * LAYOUT COMPACTO
 * Ajustes de densidad sobre la estructura base.
 * Mantener esta capa despues del layout base.
 */

.ops-groups-panel{
  margin-bottom:14px;
  padding:12px 14px;
}

.ops-groups-head{
  margin-bottom:8px;
}

.ops-groups-kicker{
  margin-bottom:2px;
  font-size:9px;
}

.ops-groups-title{
  font-size:18px;
}

.ops-groups-subtitle{
  margin-top:3px;
  font-size:10px;
}

.ops-groups-state{
  min-height:26px;
  padding:0 9px;
  font-size:9px;
}

.ops-groups-summary{
  gap:5px;
  margin-bottom:8px;
}

.ops-groups-summary span{
  padding:4px 7px;
  font-size:9px;
}

.ops-groups-grid{
  gap:7px;
}

.ops-group-card-head{
  padding:7px 8px;
}

.ops-group-badge{
  width:28px;
  height:28px;
  border-radius:8px;
  font-size:11px;
}

.ops-group-headtext strong{
  font-size:11px;
}

.ops-group-headtext small{
  font-size:8px;
}

.ops-group-count{
  font-size:9px;
}

.ops-group-members{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:4px;
  padding:6px;
}

.ops-group-member{
  min-height:22px;
  padding:3px 5px;
}

.ops-group-member-code{
  font-size:9px;
}

.ops-group-role{
  padding:2px 4px;
  font-size:7px;
}

/* TITULAR ya está implícito; resaltamos sólo el refuerzo */
.ops-group-role:not([data-role="REFUERZO"]){
  display:none;
}

.ops-groups-unassigned{
  gap:9px;
  margin-top:7px;
  padding:7px 9px;
}

.ops-groups-unassigned-label{
  font-size:8px;
}

.ops-groups-unassigned-member{
  padding:4px 7px;
  font-size:9px;
}

.ops-groups-warning{
  margin-top:7px;
  padding:6px 8px;
  font-size:9px;
}

@media(max-width:900px){
  .ops-group-members{
    grid-template-columns:1fr;
  }
}


/*
 * DETALLE DE MIEMBROS / POPOVER
 * Posicionamiento, apertura y contenido del detalle.
 * El z-index del popover pertenece a esta capa.
 */

.ops-groups-grid{
  grid-template-columns:repeat(5,minmax(0,1fr));
}

.ops-group-card{
  overflow:visible;
}

.ops-group-card-head{
  position:relative;
}

.ops-group-detail-wrap{
  position:relative;
  flex:0 0 auto;
}

.ops-group-info{
  display:grid;
  place-items:center;
  width:26px;
  height:26px;
  padding:0;
  border:1px solid rgba(90,198,222,.28);
  border-radius:8px;
  background:rgba(32,111,139,.12);
  color:#65dceb;
  font-size:14px;
  cursor:pointer;
}

.ops-group-info:hover,
.ops-group-info:focus-visible{
  border-color:rgba(90,213,235,.62);
  background:rgba(37,139,167,.22);
  outline:none;
}

.ops-group-detail{
  position:absolute;
  z-index:60;
  top:32px;
  right:0;
  display:none;
  width:220px;
  padding:10px;
  border:1px solid rgba(95,157,195,.34);
  border-radius:10px;
  background:#061a2c;
  box-shadow:0 16px 38px rgba(0,0,0,.42);
}

.ops-group-detail-wrap:hover .ops-group-detail,
.ops-group-detail-wrap:focus-within .ops-group-detail,
.ops-group-detail-wrap.is-open .ops-group-detail{
  display:block;
}

.ops-group-detail-title{
  margin-bottom:8px;
  color:#f0f7fc;
  font-size:11px;
  font-weight:900;
}

.ops-group-detail-section{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin-top:6px;
}

.ops-group-detail-section b{
  flex:0 0 100%;
  color:#7e9bb4;
  font-size:8px;
  text-transform:uppercase;
}

.ops-group-detail-section span{
  padding:4px 6px;
  border:1px solid rgba(109,150,183,.15);
  border-radius:6px;
  color:#d8e8f3;
  font-size:8px;
  font-weight:800;
}

.ops-group-detail-section span.is-refuerzo{
  color:#f0ca69;
}

.ops-group-kpi-placeholder{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:9px 10px;
  border-top:1px solid rgba(116,159,196,.10);
  color:#6f8da7;
  font-size:9px;
}

.ops-group-kpi-placeholder b{
  color:#8fa8bd;
  font-size:8px;
  font-weight:800;
}

.ops-group-members{
  display:none !important;
}

.ops-groups-unassigned{
  padding:6px 9px;
}

.ops-groups-warning{
  margin-top:6px;
}

@media(max-width:1550px){
  .ops-groups-grid{
    grid-template-columns:repeat(5,minmax(0,1fr));
  }
}

@media(max-width:1180px){
  .ops-groups-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:720px){
  .ops-groups-grid{
    grid-template-columns:1fr;
  }
}


/*
 * KPI DE GRUPO - ESTRUCTURA
 * Grid y estructura interna del preview KPI.
 */

.ops-group-kpi-placeholder.is-loaded{
  display:block;
  padding:7px 8px 6px;
}

.ops-group-kpi-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:5px;
}

.ops-group-kpi{
  min-width:0;
  padding:5px 6px;
  border:1px solid rgba(105,153,190,.12);
  border-radius:7px;
  background:rgba(7,31,51,.48);
}

.ops-group-kpi span{
  display:block;
  overflow:hidden;
  margin-bottom:2px;
  color:#6f91ac;
  font-size:7px;
  font-weight:800;
  text-overflow:ellipsis;
  text-transform:uppercase;
  white-space:nowrap;
}

.ops-group-kpi b{
  display:block;
  overflow:hidden;
  color:#eef7ff;
  font-size:11px;
  font-weight:900;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.ops-group-kpi:nth-child(4),
.ops-group-kpi:nth-child(5){
  grid-column:span 1;
}

.ops-group-kpi-foot{
  margin-top:5px;
  color:#708da6;
  font-size:7px;
  font-weight:700;
}

.ops-group-kpi-foot[data-complete="0"]{
  color:#d5aa55;
}

@media(max-width:1180px){
  .ops-group-kpi-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:720px){
  .ops-group-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

/*
 * KPI DE GRUPO - ACABADO VISUAL
 * Tipografia, espaciado y presentacion final.
 */

/* Texto descriptivo eliminado visualmente */
.ops-groups-title,
.ops-groups-subtitle,
.ops-groups-warning{
  display:none !important;
}

/* Cabecera mínima: EQUIPOS CRA + estado */
.ops-groups-head{
  align-items:center;
  margin-bottom:7px;
}

.ops-groups-kicker{
  margin:0;
  font-size:10px;
}

/* Más espacio útil para las tarjetas */
.ops-groups-grid{
  gap:9px;
}

.ops-group-card-head{
  padding:9px 9px;
}

.ops-group-badge{
  width:31px;
  height:31px;
  font-size:12px;
}

.ops-group-headtext strong{
  font-size:12px;
}

.ops-group-headtext small{
  margin-top:2px;
  font-size:8px;
}

/* KPI: 3 arriba + 2 abajo a ancho completo */
.ops-group-kpi-placeholder.is-loaded{
  padding:9px;
}

.ops-group-kpi-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:6px;
}

.ops-group-kpi:nth-child(1),
.ops-group-kpi:nth-child(2),
.ops-group-kpi:nth-child(3){
  grid-column:span 2;
}

.ops-group-kpi:nth-child(4),
.ops-group-kpi:nth-child(5){
  grid-column:span 3;
}

.ops-group-kpi{
  padding:8px 7px;
  border-radius:8px;
}

.ops-group-kpi span{
  margin-bottom:4px;
  font-size:8px;
}

.ops-group-kpi b{
  font-size:14px;
  line-height:1.05;
}

.ops-group-kpi-foot{
  margin-top:7px;
  font-size:7px;
}

/* Formación sigue visible pero compacta */
.ops-groups-unassigned{
  margin-top:8px;
}

/* Recuperamos también el espacio inferior del aviso eliminado */
.ops-groups-panel{
  padding-bottom:12px;
}

@media(max-width:1180px){
  .ops-group-kpi b{
    font-size:13px;
  }
}

@media(max-width:720px){
  .ops-group-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .ops-group-kpi:nth-child(n){
    grid-column:span 1;
  }
}



/*
 * RANKING G1-G5 - CAPA VISUAL FINAL
 * Presentacion/ranking de las cinco tarjetas.
 * Mantener esta capa despues de las anteriores.
 */

.ops-group-card{
  transition:
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}

.ops-group-card.ops-rank-1{
  border-color:rgba(34,197,94,.74);
  background:
    linear-gradient(
      155deg,
      rgba(34,197,94,.14),
      rgba(3,21,37,.76) 46%
    );
  box-shadow:
    inset 0 2px 0 rgba(34,197,94,.52);
}

.ops-group-card.ops-rank-2{
  border-color:rgba(56,189,248,.72);
  background:
    linear-gradient(
      155deg,
      rgba(56,189,248,.13),
      rgba(3,21,37,.76) 46%
    );
  box-shadow:
    inset 0 2px 0 rgba(56,189,248,.48);
}

.ops-group-card.ops-rank-3{
  border-color:rgba(250,204,21,.72);
  background:
    linear-gradient(
      155deg,
      rgba(250,204,21,.12),
      rgba(3,21,37,.76) 46%
    );
  box-shadow:
    inset 0 2px 0 rgba(250,204,21,.46);
}

.ops-group-card.ops-rank-4{
  border-color:rgba(249,115,22,.74);
  background:
    linear-gradient(
      155deg,
      rgba(249,115,22,.13),
      rgba(3,21,37,.76) 46%
    );
  box-shadow:
    inset 0 2px 0 rgba(249,115,22,.48);
}

.ops-group-card.ops-rank-5{
  border-color:rgba(244,63,94,.74);
  background:
    linear-gradient(
      155deg,
      rgba(244,63,94,.14),
      rgba(3,21,37,.76) 46%
    );
  box-shadow:
    inset 0 2px 0 rgba(244,63,94,.50);
}

.ops-group-card.ops-rank-none{
  border-color:rgba(116,159,196,.18);
  opacity:.84;
}

.ops-group-kpi-grid{
  grid-template-columns:
    repeat(6,minmax(0,1fr));
}

.ops-group-kpi:nth-child(n){
  grid-column:span 2;
}

.ops-group-kpi small{
  display:block;
  overflow:hidden;
  margin-top:4px;
  color:#7895ad;
  font-size:7px;
  font-weight:700;
  line-height:1.25;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.ops-group-kpi-foot{
  min-height:10px;
  margin-top:7px;
  color:#819db4;
  font-size:7px;
  font-weight:800;
}

.ops-rank-1 .ops-group-kpi-foot{color:#7ddd9a}
.ops-rank-2 .ops-group-kpi-foot{color:#83d5f6}
.ops-rank-3 .ops-group-kpi-foot{color:#ead66a}
.ops-rank-4 .ops-group-kpi-foot{color:#e9a06e}
.ops-rank-5 .ops-group-kpi-foot{color:#ee8b9d}

@media(max-width:720px){
  .ops-group-kpi-grid{
    grid-template-columns:
      repeat(2,minmax(0,1fr));
  }

  .ops-group-kpi:nth-child(n){
    grid-column:span 1;
  }
}

/* ==================================================================
   G4H2_HISTORICAL_GROUPS_CSS_V1_20260818
   ================================================================== */

.ops-group-card-head{
  gap:6px;
}

.ops-group-headtext{
  min-width:0;
}

.ops-group-history{
  display:flex;
  flex:0 1 auto;
  align-items:center;
  gap:4px;
  margin-left:auto;
  max-width:45%;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:none;
  white-space:nowrap;
}

.ops-group-history::-webkit-scrollbar{
  display:none;
}

.ops-group-history-current,
.ops-group-history-btn{
  box-sizing:border-box;
  min-width:0;
  height:23px;
  padding:0 7px;
  border-radius:999px;
  font-size:9px;
  font-weight:800;
  line-height:21px;
  white-space:nowrap;
}

.ops-group-history-current{
  display:inline-flex;
  align-items:center;
  border:1px solid rgba(34,211,238,.55);
  background:rgba(6,182,212,.12);
}

.ops-group-history-btn{
  flex:0 0 auto;
  border:1px solid rgba(148,163,184,.26);
  background:rgba(15,23,42,.54);
  color:inherit;
  cursor:pointer;
}

.ops-group-history-btn:hover,
.ops-group-history-btn:focus-visible{
  border-color:rgba(56,189,248,.68);
  background:rgba(14,116,144,.15);
  outline:none;
}

.ops-group-detail-wrap{
  flex:0 0 auto;
}

.ops-groups-history-summary{
  border-color:rgba(34,211,238,.28)!important;
}

.ops-groups-history-gap{
  border-color:rgba(250,204,21,.38)!important;
}

@media(max-width:900px){
  .ops-group-history{
    max-width:38%;
  }

  .ops-group-history-current,
  .ops-group-history-btn{
    padding:0 5px;
    font-size:8px;
  }
}


/* ==================================================================
   G4H2D_SEGMENT_RANGE_LABEL_CSS_V1_20260818
   ================================================================== */

.ops-group-history-current,
.ops-group-history-btn{
  min-width:max-content;
  padding-left:6px;
  padding-right:6px;
  letter-spacing:-.02em;
}


/* G4H3B2_GROUP_ACTIVITY_TREND_CSS_V1_20260818 */

.ops-groups-trend-row{
  width:100%;
  min-width:0;
  margin-top:12px;
}

.ops-groups-trend-row .kpi-trend-module__grid{
  grid-template-columns:minmax(0,1fr);
}

.ops-groups-trend-row .kpi-trend-module__kpis{
  display:none;
}

.ops-groups-trend-row .kpi-trend-module__panel{
  min-width:0;
}

.ops-groups-trend-row .kpi-trend-module__svg-wrap{
  min-height:300px;
}

.ops-groups-trend-row .kpi-trend-persistent-dot{
  pointer-events:none;
  opacity:.9;
}

