/* =========================================================
   HISTORIAL RESUMEN · NUEVAS SECCIONES
   Adaptado a las clases reales del layout actual
   Look tipo Costes/Tickets con acento verde
   ========================================================= */

:root{
  --his-insights-top-h: 344px;
  --his-insights-bottom-h: 300px;

  --hisg-bg-1: #0d1318;
  --hisg-bg-2: #101820;
  --hisg-bg-3: #151f28;

  --hisg-line: rgba(130,155,178,0.18);
  --hisg-line-soft: rgba(130,155,178,0.10);

  --hisg-text: rgba(255,255,255,0.92);
  --hisg-text-soft: rgba(255,255,255,0.74);
  --hisg-text-dim: rgba(255,255,255,0.58);

  --hisg-green: #37f2a6;
  --hisg-green-soft: rgba(55,242,166,0.08);
  --hisg-green-soft-2: rgba(55,242,166,0.04);
  --hisg-green-line: rgba(55,242,166,0.20);
  --hisg-hover: rgba(55,242,166,0.05);

  --hisg-radius-xl: 18px;
  --hisg-radius-lg: 14px;
  --hisg-radius-md: 12px;

  --hisg-shadow-block: 0 12px 28px rgba(0,0,0,0.22);
}

/* =========================================================
   BODY GENERAL DE LA TAB RESUMEN
   ========================================================= */

.his-summary-body{
  padding: 20px 10px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  margin-top:-9px;
}

/* =========================================================
   SECCIONES GRANDES
   ========================================================= */

.his-section{
  border-radius: var(--hisg-radius-xl);
  border: 1px solid var(--hisg-line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018) 0%, rgba(255,255,255,0.008) 100%),
    var(--hisg-bg-1);
  box-shadow: var(--hisg-shadow-block);
  overflow: hidden;
  min-height: 0;
}

.his-section-head{
  padding: 12px 14px;
  border-bottom: 1px solid var(--hisg-line);
  background:
    linear-gradient(180deg, rgba(55,242,166,0.05) 0%, rgba(55,242,166,0.015) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.his-section-title{
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--hisg-text);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.1px;
}

.his-section-icon{
  width: 15px;
  height: 15px;
  opacity: 0.95;
  object-fit: contain;
  flex: 0 0 15px;
}

.his-section-head-right{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.his-section-headtext{
  color: var(--hisg-text-dim);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.his-section-body{
  padding: 10px;
  min-height: 0;
}

/* =========================================================
   SUBPANELES INTERNOS
   ========================================================= */

.his-subpanel{
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;

  border-radius: var(--hisg-radius-lg);
  border: 1px solid var(--hisg-line);
  background:
    linear-gradient(180deg, rgba(55,242,166,0.025) 0%, rgba(255,255,255,0.008) 100%),
    var(--hisg-bg-2);
  box-shadow: none;
  overflow: hidden;
}

.his-subpanel-title{
  margin-bottom: 0;
  flex: 0 0 auto;

  padding: 10px 12px 8px 12px;
  border-bottom: 1px solid var(--hisg-line-soft);
  background:
    linear-gradient(180deg, rgba(55,242,166,0.04) 0%, rgba(255,255,255,0.00) 100%);

  color: var(--hisg-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1px;
}

/* el div de contenido del subpanel debe poder encogerse */
.his-subpanel > div:last-child{
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

/* =========================================================
   WRAP ÚLTIMOS 9 MESES
   ========================================================= */

.his-summary9-tablewrap{
  border-radius: var(--hisg-radius-lg);
  border: 1px solid var(--hisg-line);
  background:
    linear-gradient(180deg, rgba(55,242,166,0.025) 0%, rgba(255,255,255,0.008) 100%),
    var(--hisg-bg-2);
  box-shadow: none;
  overflow: hidden;
  min-height: 0;
  padding: 10px;
}

.his-9m-grid-wrap{
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: hidden;
}

/* =========================================================
   WRAPS DE CONTENIDO DINÁMICO
   ========================================================= */

.his-last-slot,
#his-dist-edades,
#his-dist-ligas,
#his-dist-weekdays,
#his-top-equipos{
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
}

#his-dist-edades,
#his-dist-ligas,
#his-dist-weekdays{
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 10px;
  overflow: hidden;
}

#his-dist-edades > *,
#his-dist-ligas > *,
#his-dist-weekdays > *{
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
}

#his-top-equipos{
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow: hidden;
}

/* =========================================================
   INSIGHTS WRAP
   ========================================================= */

.his-insights-wrap{
  margin-top: 0;
  min-height: 0;
}

.his-insights-wrap .row{
  align-items: stretch;
}

/* =========================================================
   FILA SUPERIOR INSIGHTS
   ========================================================= */

.his-insights-wrap .his-insights-row-top{
  align-items: stretch;
}

.his-insights-wrap .his-insights-row-top > [class*="col-"]{
  display: flex;
  min-height: 0;
}

.his-insights-wrap .his-insights-row-top > [class*="col-"] > .his-subpanel{
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: var(--his-insights-top-h);
}

.his-insights-wrap .his-insights-row-top #his-dist-edades,
.his-insights-wrap .his-insights-row-top #his-dist-ligas{
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

/* =========================================================
   FILA INFERIOR INSIGHTS
   ========================================================= */

.his-insights-wrap .his-insights-row-bottom{
  align-items: stretch;
}

.his-insights-wrap .his-insights-row-bottom > [class*="col-"]{
  display: flex;
  min-height: 0;
}

.his-insights-wrap .his-insights-row-bottom > [class*="col-"] > .his-subpanel{
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: var(--his-insights-bottom-h);
}

/* =========================================================
   TOP EQUIPOS — contenedor
   ========================================================= */

.his-insights-wrap .his-insights-row-bottom #his-top-equipos{
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.his-insights-wrap .his-insights-row-bottom #his-top-equipos .his-mini-team-grid{
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.his-insights-wrap .his-insights-row-bottom #his-top-equipos .his-mini-team-card{
  width: 100%;
}

/* =========================================================
   DÍAS SEMANA — contenedor
   ========================================================= */

.his-insights-wrap .his-insights-row-bottom #his-dist-weekdays{
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

.his-insights-wrap .his-insights-row-bottom #his-dist-weekdays > *{
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
}

/* =========================================================
   DONUT base (plotly)
   ========================================================= */

.his-donut-graph{
  width: 100%;
  height: 220px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.his-donut-graph .js-plotly-plot,
.his-donut-graph .plot-container{
  height: 100% !important;
}

.his-donut-graph .js-plotly-plot,
.his-donut-graph .plot-container,
.his-donut-graph .svg-container{
  background: transparent !important;
}

/* =========================================================
   FIX DONUT DÍAS
   ========================================================= */

#his-dist-weekdays .his-rank-combo{
  overflow: hidden;
}

#his-dist-weekdays .his-rank-combo-grid{
  min-width: 0;
  min-height: 0;
  width: 100%;
}

#his-dist-weekdays .his-generic-rank-wrap{
  min-width: 0;
  min-height: 0;
  width: 100%;
}

#his-dist-weekdays .his-rank-combo-donut{
  min-width: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#his-dist-weekdays .his-rank-combo-donut .his-donut-graph{
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

#his-dist-weekdays .his-rank-combo-donut .js-plotly-plot,
#his-dist-weekdays .his-rank-combo-donut .plot-container,
#his-dist-weekdays .his-rank-combo-donut .svg-container{
  width: 100% !important;
  max-width: 100% !important;
}

/* =========================================================
   TOP EQUIPOS — Ranking estilo ladder
   ========================================================= */

.his-team-rank-wrap{
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.his-team-rank-head{
  display: grid;
  grid-template-columns:
    62px
    minmax(0, 1.45fr)
    78px
    minmax(110px, .85fr)
    minmax(150px, 1.15fr);
  gap: 8px;
  align-items: center;
  padding: 0 4px 8px 0;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex: 0 0 auto;
}

.his-team-rank-hcell{
  color: var(--hisg-text-dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .35px;
  text-transform: uppercase;
}

.his-team-rank-body{
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.his-team-rank-row{
  display: grid;
  grid-template-columns:
    62px
    minmax(0, 1.45fr)
    78px
    minmax(110px, .85fr)
    minmax(150px, 1.15fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.06);
  background:
    linear-gradient(180deg, rgba(55,242,166,.035), rgba(255,255,255,.010)),
    linear-gradient(180deg, rgba(255,255,255,.015), rgba(255,255,255,.010));
  border-radius: 10px;
  padding: 5px 8px;
  min-height: 40px;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.his-team-rank-row:hover{
  background:
    linear-gradient(180deg, rgba(55,242,166,.06), rgba(255,255,255,.014)),
    linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.014));
  border-color: var(--hisg-green-line);
  transform: translateY(-1px);
}

.his-team-rank-row.is-rank-1{
  border-color: rgba(241,196,15,.34);
  background:
    linear-gradient(180deg, rgba(241,196,15,.16), rgba(241,196,15,.07)),
    linear-gradient(180deg, rgba(55,242,166,.03), rgba(255,255,255,.010));
  box-shadow: inset 0 0 0 1px rgba(241,196,15,.08);
}
.his-team-rank-row.is-rank-2{
  border-color: rgba(189,195,199,.24);
  background:
    linear-gradient(180deg, rgba(189,195,199,.12), rgba(189,195,199,.05)),
    linear-gradient(180deg, rgba(55,242,166,.03), rgba(255,255,255,.010));
  box-shadow: inset 0 0 0 1px rgba(189,195,199,.05);
}
.his-team-rank-row.is-rank-3{
  border-color: rgba(205,127,50,.28);
  background:
    linear-gradient(180deg, rgba(205,127,50,.13), rgba(205,127,50,.05)),
    linear-gradient(180deg, rgba(55,242,166,.03), rgba(255,255,255,.010));
  box-shadow: inset 0 0 0 1px rgba(205,127,50,.05);
}

.his-team-rank-cell{
  min-width: 0;
  display: flex;
  align-items: center;
}

.his-team-rank-col-rank{ justify-content: center; }
.his-team-rank-col-count{ justify-content: center; }
.his-team-rank-col-edad,
.his-team-rank-col-liga{ min-width: 0; }

.his-team-rank-badge{
  width: 28px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  color: rgba(255,255,255,.90);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.his-team-rank-badge.rank-1{
  color: #1a1400;
  border-color: rgba(241,196,15,.50);
  background: linear-gradient(180deg, rgba(241,196,15,.92), rgba(224,176,16,.88));
}
.his-team-rank-badge.rank-2{
  color: #11161b;
  border-color: rgba(189,195,199,.42);
  background: linear-gradient(180deg, rgba(205,212,218,.90), rgba(168,176,183,.85));
}
.his-team-rank-badge.rank-3{
  color: #1a120d;
  border-color: rgba(205,127,50,.45);
  background: linear-gradient(180deg, rgba(205,127,50,.88), rgba(177,105,36,.84));
}

.his-team-rank-teamwrap{
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.his-team-rank-teamname{
  min-width: 0;
  color: rgba(255,255,255,.86);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.his-team-rank-count{
  color: rgba(255,255,255,.90);
  font-size: 13px;
  font-weight: 900;
  min-width: 0;
}

.his-team-rank-chip{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
}

.his-team-rank-chip-icon{
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 1px rgba(0,0,0,.18));
}

.his-team-rank-chip-text{
  min-width: 0;
  max-width: 100%;
  color: rgba(255,255,255,.72);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

/* =========================================================
   RANKINGS GENÉRICOS (Edades / Ligas / Días)
   ========================================================= */

.his-generic-rank-wrap{
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.his-generic-rank-head{
  display: grid;
  grid-template-columns: 56px minmax(0, 1.35fr) 76px minmax(0, .9fr);
  gap: 8px;
  align-items: center;
  padding: 0 4px 8px 0;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex: 0 0 auto;
}

.his-generic-rank-hcell{
  color: var(--hisg-text-dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .35px;
  text-transform: uppercase;
}

.his-generic-rank-body{
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.his-generic-rank-row{
  display: grid;
  grid-template-columns: 56px minmax(0, 1.35fr) 76px minmax(0, .9fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.06);
  background:
    linear-gradient(180deg, rgba(55,242,166,.03), rgba(255,255,255,.010)),
    linear-gradient(180deg, rgba(255,255,255,.015), rgba(255,255,255,.010));
  border-radius: 10px;
  padding: 5px 8px;
  min-height: 38px;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.his-generic-rank-row:hover{
  background:
    linear-gradient(180deg, rgba(55,242,166,.06), rgba(255,255,255,.014)),
    linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.014));
  border-color: var(--hisg-green-line);
  transform: translateY(-1px);
}

.his-generic-rank-row.is-rank-1{
  border-color: rgba(241,196,15,.34);
  background:
    linear-gradient(180deg, rgba(241,196,15,.16), rgba(241,196,15,.07)),
    linear-gradient(180deg, rgba(55,242,166,.03), rgba(255,255,255,.010));
  box-shadow: inset 0 0 0 1px rgba(241,196,15,.08);
}
.his-generic-rank-row.is-rank-2{
  border-color: rgba(189,195,199,.24);
  background:
    linear-gradient(180deg, rgba(189,195,199,.12), rgba(189,195,199,.05)),
    linear-gradient(180deg, rgba(55,242,166,.03), rgba(255,255,255,.010));
  box-shadow: inset 0 0 0 1px rgba(189,195,199,.05);
}
.his-generic-rank-row.is-rank-3{
  border-color: rgba(205,127,50,.28);
  background:
    linear-gradient(180deg, rgba(205,127,50,.13), rgba(205,127,50,.05)),
    linear-gradient(180deg, rgba(55,242,166,.03), rgba(255,255,255,.010));
  box-shadow: inset 0 0 0 1px rgba(205,127,50,.05);
}

.his-generic-rank-cell{
  min-width: 0;
  display: flex;
  align-items: center;
}

.his-generic-rank-col-rank{ justify-content: center; }
.his-generic-rank-col-total{ justify-content: center; }

.his-generic-rank-badge{
  width: 26px;
  height: 20px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  color: rgba(255,255,255,.90);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}

.his-generic-rank-badge.rank-1{
  color: #1a1400;
  border-color: rgba(241,196,15,.50);
  background: linear-gradient(180deg, rgba(241,196,15,.92), rgba(224,176,16,.88));
}
.his-generic-rank-badge.rank-2{
  color: #11161b;
  border-color: rgba(189,195,199,.42);
  background: linear-gradient(180deg, rgba(205,212,218,.90), rgba(168,176,183,.85));
}
.his-generic-rank-badge.rank-3{
  color: #1a120d;
  border-color: rgba(205,127,50,.45);
  background: linear-gradient(180deg, rgba(205,127,50,.88), rgba(177,105,36,.84));
}

.his-generic-rank-namewrap{
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: 100%;
}

.his-generic-rank-dot{
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex: 0 0 7px;
  opacity: .9;
}

.his-generic-rank-nameicon{
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 1px rgba(0,0,0,.18));
}

.his-generic-rank-nametext{
  min-width: 0;
  color: rgba(255,255,255,.86);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.his-generic-rank-total{
  color: rgba(255,255,255,.90);
  font-size: 12px;
  font-weight: 900;
}

.his-generic-rank-chip{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
}

.his-generic-rank-chip-icon{
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  object-fit: contain;
  display: block;
}

.his-generic-rank-chip-text{
  min-width: 0;
  max-width: 100%;
  color: rgba(255,255,255,.72);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

/* Variantes de columnas */
.his-generic-rank-wrap--edades .his-generic-rank-head,
.his-generic-rank-wrap--edades .his-generic-rank-row{
  grid-template-columns: 56px minmax(0, 1.35fr) 76px 0px;
}
.his-generic-rank-wrap--edades .his-generic-rank-col-extra{
  display: none !important;
}

.his-generic-rank-wrap--weekdays .his-generic-rank-head,
.his-generic-rank-wrap--weekdays .his-generic-rank-row{
  grid-template-columns: 56px minmax(0, 1.35fr) 86px 0px;
}
.his-generic-rank-wrap--weekdays .his-generic-rank-col-extra{
  display: none !important;
}

/* Scrollbars genéricos */
.his-generic-rank-body::-webkit-scrollbar{
  width: 8px;
}
.his-generic-rank-body::-webkit-scrollbar-track{
  background: transparent;
}
.his-generic-rank-body::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.08);
  border-radius: 999px;
}
.his-generic-rank-body::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.13);
}

/* =========================================================
   COMBO RANKING + DONUT (Edades / Ligas / Días)
   ========================================================= */

.his-rank-combo{
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 10px;
  align-items: stretch;
  overflow: hidden;
}

.his-rank-combo-grid{
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  overflow: hidden;
}

.his-rank-combo-grid > *{
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.his-rank-combo-donut{
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  position: relative;
  padding: 2px;
  justify-self: stretch;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: none;
  overflow: hidden;
}

.his-rank-combo-donut::before{
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(55,242,166,.05), rgba(255,255,255,0) 70%);
  pointer-events: none;
}

.his-rank-combo-donut .his-donut-graph{
  width: 100%;
  height: 100%;
  min-height: 165px;
  max-height: 205px;
}

.his-rank-combo-donut.is-small .his-donut-graph{
  min-height: 155px;
  max-height: 190px;
}

.his-rank-combo--edades{
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
}

.his-rank-combo--ligas{
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
}

/* =========================================================
   FIXES IMPORTANTES DE SCROLL EN EDADES / LIGAS / DÍAS
   ========================================================= */

#his-dist-edades,
#his-dist-ligas,
#his-dist-weekdays{
  min-height: 0;
}

#his-dist-edades .his-rank-combo,
#his-dist-ligas .his-rank-combo,
#his-dist-weekdays .his-rank-combo{
  min-height: 0;
  height: 100%;
}

#his-dist-edades .his-rank-combo-grid,
#his-dist-ligas .his-rank-combo-grid,
#his-dist-weekdays .his-rank-combo-grid{
  min-height: 0;
  height: 100%;
}

#his-dist-edades .his-generic-rank-wrap,
#his-dist-ligas .his-generic-rank-wrap,
#his-dist-weekdays .his-generic-rank-wrap{
  min-height: 0;
  height: 100%;
}

#his-dist-edades .his-generic-rank-body,
#his-dist-ligas .his-generic-rank-body,
#his-dist-weekdays .his-generic-rank-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* antes edades quedaba visible y por eso empujaba el panel */
#his-dist-edades .his-rank-combo .his-generic-rank-body{
  max-height: none;
  overflow-y: auto;
}

/* ligas mantiene scroll interno */
#his-dist-ligas .his-rank-combo .his-generic-rank-body{
  max-height: none;
  overflow-y: auto;
}

/* Días */
#his-dist-weekdays .his-rank-combo{
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 10px;
  align-items: stretch;
  height: 100%;
}

#his-dist-weekdays .his-rank-combo-grid,
#his-dist-weekdays .his-generic-rank-wrap{
  height: 100%;
}

#his-dist-weekdays .his-rank-combo-donut{
  max-width: none;
}

#his-dist-weekdays .his-rank-combo-donut .his-donut-graph{
  min-height: 160px;
  max-height: 190px;
}

/* =========================================================
   Scrollbars suaves
   ========================================================= */

.his-insights-wrap #his-top-equipos .his-team-rank-body::-webkit-scrollbar,
.his-insights-wrap #his-top-equipos .his-mini-team-grid::-webkit-scrollbar{
  width: 8px;
}
.his-insights-wrap #his-top-equipos .his-team-rank-body::-webkit-scrollbar-track,
.his-insights-wrap #his-top-equipos .his-mini-team-grid::-webkit-scrollbar-track{
  background: transparent;
}
.his-insights-wrap #his-top-equipos .his-team-rank-body::-webkit-scrollbar-thumb,
.his-insights-wrap #his-top-equipos .his-mini-team-grid::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.08);
  border-radius: 999px;
}
.his-insights-wrap #his-top-equipos .his-team-rank-body::-webkit-scrollbar-thumb:hover,
.his-insights-wrap #his-top-equipos .his-mini-team-grid::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.13);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px){
  .his-team-rank-head,
  .his-team-rank-row{
    grid-template-columns:
      54px
      minmax(0, 1.35fr)
      66px
      minmax(95px, .75fr)
      minmax(120px, 1.0fr);
    gap: 6px;
  }

  .his-team-rank-row{
    padding: 5px 7px;
    min-height: 38px;
  }

  .his-rank-combo,
  .his-rank-combo--edades,
  .his-rank-combo--ligas,
  #his-dist-weekdays .his-rank-combo{
    grid-template-columns: minmax(0, 68fr) minmax(0, 32fr);
    gap: 9px;
  }

  .his-rank-combo-donut .his-donut-graph{
    max-height: 190px;
  }

  :root{
    --his-insights-top-h: 332px;
    --his-insights-bottom-h: 292px;
  }
}

@media (max-width: 1100px){
  .his-rank-combo{
    grid-template-columns: 1fr !important;
    gap: 10px;
    height: auto;
  }

  .his-rank-combo-grid{
    height: auto;
  }

  .his-rank-combo-donut,
  .his-rank-combo-donut.is-small{
    max-width: none;
    width: 100%;
    justify-self: stretch;
    align-self: stretch;
  }

  .his-rank-combo-donut .his-donut-graph,
  .his-rank-combo-donut.is-small .his-donut-graph{
    height: 220px;
    max-height: none;
  }

  #his-dist-edades .his-rank-combo .his-generic-rank-body,
  #his-dist-ligas .his-rank-combo .his-generic-rank-body,
  #his-dist-weekdays .his-rank-combo .his-generic-rank-body{
    max-height: none;
    overflow: visible;
  }

  .his-insights-wrap .his-insights-row-bottom > [class*="col-"] > .his-subpanel{
    height: auto;
    min-height: 0;
  }

  .his-insights-wrap .his-insights-row-bottom #his-top-equipos{
    overflow: visible;
  }

  .his-insights-wrap .his-insights-row-bottom #his-top-equipos .his-mini-team-grid{
    overflow: visible;
  }

  .his-insights-wrap .his-insights-row-bottom #his-dist-weekdays{
    overflow: visible;
  }

  .his-insights-wrap .his-insights-row-top > [class*="col-"] > .his-subpanel{
    height: auto;
  }

  .his-insights-wrap .his-insights-row-top #his-dist-ligas,
  .his-insights-wrap .his-insights-row-top #his-dist-edades{
    overflow: visible;
  }
}

@media (max-width: 768px){
  .his-section-head{
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .his-section-headtext{
    text-align: left;
  }

  .his-team-rank-head{
    grid-template-columns: 48px minmax(0, 1fr) 58px;
  }

  .his-team-rank-row{
    grid-template-columns: 48px minmax(0, 1fr) 58px;
  }

  .his-team-rank-col-edad,
  .his-team-rank-col-liga{
    display: none !important;
  }

  .his-team-rank-teamname{
    font-size: 11px;
  }

  .his-team-rank-count{
    font-size: 12px;
  }

  .his-team-rank-badge{
    width: 24px;
    height: 20px;
    font-size: 11px;
  }

  .his-generic-rank-head,
  .his-generic-rank-row{
    grid-template-columns: 48px minmax(0, 1fr) 62px;
  }

  .his-generic-rank-col-extra{
    display: none !important;
  }

  .his-generic-rank-badge{
    width: 24px;
    height: 20px;
    font-size: 10px;
  }

  .his-generic-rank-nametext{
    font-size: 11px;
  }

  .his-generic-rank-total{
    font-size: 11px;
  }
}