/* =========================================================
   HISTORIAL — RESUMEN 9 MESES (grid premium)
   Sustituye DataTable por grid visual coherente con rankings
   ========================================================= */

.his-9m-grid-wrap{
  width: 100%;
  min-width: 0;
}

.his-9m-grid-shell{
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.012), rgba(255,255,255,.006));
  overflow: hidden;
}

/* Header + filas comparten mismas columnas:
   1 columna categoría + 9 meses */
.his-9m-grid-head,
.his-9m-grid-row{
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) repeat(9, minmax(78px, 1fr));
  gap: 0;
  align-items: stretch;
  min-width: 0;
}

.his-9m-grid-head{
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.012);
}

.his-9m-hcell{
  min-width: 0;
  padding: 10px 8px;
  color: rgba(255,255,255,.68);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .35px;
  text-transform: uppercase;
  border-right: 1px solid rgba(255,255,255,.04);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.his-9m-hcell:last-child{
  border-right: none;
}

.his-9m-col-cat{
  justify-content: flex-start;
  padding-left: 12px;
}

.his-9m-col-month{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mes actual (header) */
.his-9m-hcell.is-current{
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.02);
}

/* Body */
.his-9m-grid-body{
  display: flex;
  flex-direction: column;
}

.his-9m-grid-row{
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.his-9m-grid-row:last-child{
  border-bottom: none;
}

.his-9m-cell{
  min-width: 0;
  min-height: 44px;
  padding: 8px 8px;
  border-right: 1px solid rgba(255,255,255,.035);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.his-9m-cell:last-child{
  border-right: none;
}

/* Columna categoría */
.his-9m-cell-cat{
  justify-content: flex-start;
  padding-left: 12px;
  color: rgba(255,255,255,.86);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1px;
}

/* Celdas de valor */
.his-9m-cell-val{
  color: rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 900;
  transition: background .15s ease, box-shadow .15s ease;
}

.his-9m-cell-num{
  position: relative;
  z-index: 2;
}

/* Hover por celda */
.his-9m-cell-val:hover{
  background: rgba(255,255,255,.018);
}

/* Mes actual (celdas) */
.his-9m-cell-val.is-current{
  background: rgba(255,255,255,.015);
}

/* Tinte por fila (partidos/eventos/jugadores) */
.his-9m-grid-row.row-partidos .his-9m-cell-val::before,
.his-9m-grid-row.row-eventos  .his-9m-cell-val::before,
.his-9m-grid-row.row-jugadores .his-9m-cell-val::before{
  content: "";
  position: absolute;
  inset: 4px 6px;
  border-radius: 8px;
  opacity: .14;
  pointer-events: none;
}

.his-9m-grid-row.row-partidos .his-9m-cell-val::before{
  background: linear-gradient(180deg, rgba(66,165,245,.55), rgba(66,165,245,.15));
}

.his-9m-grid-row.row-eventos .his-9m-cell-val::before{
  background: linear-gradient(180deg, rgba(236,64,122,.55), rgba(236,64,122,.15));
}

.his-9m-grid-row.row-jugadores .his-9m-cell-val::before{
  background: linear-gradient(180deg, rgba(102,187,106,.55), rgba(102,187,106,.15));
}

/* Zebra muy suave por filas */
.his-9m-grid-row:nth-child(odd){
  background: rgba(255,255,255,.004);
}

/* Wrapper con scroll horizontal si hiciera falta */
.costes-summary9-tablewrap{
  overflow-x: auto;
  overflow-y: hidden;
}

.costes-summary9-tablewrap .his-9m-grid-wrap{
  min-width: 860px; /* fuerza layout limpio en pantallas más estrechas */
}

/* Scrollbar suave */
.costes-summary9-tablewrap::-webkit-scrollbar{
  height: 8px;
}
.costes-summary9-tablewrap::-webkit-scrollbar-track{
  background: transparent;
}
.costes-summary9-tablewrap::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.08);
  border-radius: 999px;
}
.costes-summary9-tablewrap::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.13);
}

/* Responsive */
@media (max-width: 992px){
  .his-9m-grid-head,
  .his-9m-grid-row{
    grid-template-columns: minmax(120px, 1.15fr) repeat(9, minmax(72px, 1fr));
  }

  .his-9m-cell{
    min-height: 40px;
    padding: 7px 6px;
  }

  .his-9m-cell-cat{
    font-size: 11px;
  }

  .his-9m-cell-val{
    font-size: 11px;
  }

  .costes-summary9-tablewrap .his-9m-grid-wrap{
    min-width: 800px;
  }
}

@media (max-width: 768px){
  .his-9m-hcell{
    font-size: 9px;
    padding: 8px 6px;
  }

  .his-9m-cell{
    min-height: 38px;
  }

  .his-9m-cell-cat{
    font-size: 11px;
    padding-left: 10px;
  }

  .his-9m-cell-val{
    font-size: 10px;
  }
}