/* =========================================================
   COSTES - Mes Actual
   Misma familia visual que los grids cdet del otro bloque
   ========================================================= */

/* =========================================================
   CONTENEDOR GENERAL
   ========================================================= */

.costes-month{
  margin-top: 19px;
  border-radius: 16px;
  border: 1px solid rgba(130, 155, 178, 0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018) 0%, rgba(255,255,255,0.008) 100%),
    #0d1318;
  box-shadow: 0 12px 28px rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
  overflow: hidden;
  min-height: 366px;
}

/* =========================================================
   HEADER
   ========================================================= */

.costes-month-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 10px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.018) 0%, rgba(255,255,255,0.00) 100%);
  border-bottom: 1px solid rgba(130, 155, 178, 0.18);
}

.costes-month-title{
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.92);
  font-weight: 900;
  letter-spacing: 0.2px;
  font-size: 13px;
}

.costes-month-icon{
  height: 18px;
  width: 18px;
  opacity: 0.95;
}

/* =========================================================
   BODY
   ========================================================= */

.costes-month-body{
  padding: 12px;
  min-height: 0;
}

.costes-month-row{
  --bs-gutter-y: 1rem;
}

/* =========================================================
   CARDS INTERNAS
   ========================================================= */

.costes-month-card{
  border-radius: 16px;
  border: 1px solid rgba(130, 155, 178, 0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.015) 0%, rgba(255,255,255,0.008) 100%),
    #101820;
  box-shadow: 0 12px 28px rgba(0,0,0,0.22);
  overflow: hidden;

  height: 44vh;
  min-height: 327px;

  display: flex;
  flex-direction: column;
  min-width: 0;
}

.costes-month-cardhead{
  padding: 10px 10px 8px 10px;
  border-bottom: 1px solid rgba(130, 155, 178, 0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.018) 0%, rgba(255,255,255,0.00) 100%);
}

.costes-month-cardtitle{
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.90);
  font-weight: 900;
  letter-spacing: 0.2px;
  font-size: 12px;
}

.costes-month-cardicon{
  height: 16px;
  width: 16px;
  opacity: 0.95;
  filter: none;
}

.costes-month-cardbody{
  padding: 10px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* =========================================================
   PANEL INTERIOR
   ========================================================= */

.costes-month-panel{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(130, 155, 178, 0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.015) 0%, rgba(255,255,255,0.008) 100%),
    #101820;
  box-shadow: none;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* =========================================================
   EMPTY
   ========================================================= */

.costes-month-empty{
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
}

.costes-month-emptyimg{
  max-height: 100%;
  max-width: 100%;
  opacity: 0.9;
}

/* =========================================================
   WRAPPERS TABLAS / GRIDS
   ========================================================= */

.costes-month-tablewrap{
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cmonth-dt-scope,
.cmonth-grid-scope{
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cmonth-grid-scope > div{
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* =========================================================
   GRID CUSTOM · HEADER FIJO + BODY SCROLL
   ========================================================= */

.cmonth-table{
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #101820;
  border: 1px solid rgba(130, 155, 178, 0.18);
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.cmonth-head,
.cmonth-row{
  box-sizing: border-box;
  display: grid;
  align-items: center;
  column-gap: 12px;
  grid-template-columns: var(--cmonth-cols);
  width: 100%;
  min-width: 0;
}

.cmonth-head > *,
.cmonth-row > *{
  min-width: 0;
  max-width: 100%;
}

.cmonth-head{
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 12px;
  padding-right: 22px;
  background: #15202a;
  border-bottom: 1px solid rgba(130, 155, 178, 0.18);
  position: relative;
  z-index: 2;
}

.cmonth-body{
  flex: 1 1 auto;
  min-height: 0;
  height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}

.cmonth-body::-webkit-scrollbar{
  width: 10px;
  height: 10px;
}

.cmonth-body::-webkit-scrollbar-track{
  background: transparent;
}

.cmonth-body::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.16);
  border-radius: 999px;
}

.cmonth-body::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,0.24);
}

.cmonth-row{
  min-height: 44px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(130, 155, 178, 0.10);
  transition: background 120ms ease;
}

.cmonth-row:nth-child(odd){
  background: rgba(255,255,255,0.012);
}

.cmonth-row:hover{
  background: rgba(55,242,166,0.05);
}

.cmonth-row--total{
  background: rgba(255,255,255,0.04);
  font-weight: 900;
}

/* =========================================================
   HEADER CELLS
   ========================================================= */

.cmonth-hcell{
  min-width: 0;
  max-width: 100%;
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: 0.45px;
  color: rgba(255,255,255,0.58);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmonth-hcell--center{
  text-align: center;
}

.cmonth-hcell--right{
  text-align: right;
}

/* =========================================================
   BODY CELLS
   ========================================================= */

.cmonth-cell{
  min-width: 0;
  max-width: 100%;
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmonth-cell--date{
  min-width: 0;
}

.cmonth-cell--num,
.cmonth-cell--money{
  text-align: right;
}

.cmonth-cell--money{
  color: #37f2a6;
  font-weight: 800;
}

/* =========================================================
   BADGES / PILLS
   ========================================================= */

.cmonth-pill-wrap{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
}

.cmonth-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.90);
}

.cmonth-pill--kms{
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.90);
}

.cmonth-pill--money{
  background: rgba(55,242,166,0.12);
  border-color: rgba(55,242,166,0.28);
  color: #37f2a6;
  box-shadow:
    inset 0 0 0 1px rgba(55,242,166,0.05),
    0 0 14px rgba(55,242,166,0.10);
}

.cmonth-num-wrap{
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
}

.cmonth-num-badge{
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: rgba(255,255,255,0.96);
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 4px 12px rgba(0,0,0,0.18);
  flex: 0 0 auto;
}

.cmonth-num-badge--empty{
  opacity: 0;
}

/* =========================================================
   EMPTY DEL GRID
   ========================================================= */

.cmonth-body--empty{
  display: flex;
  align-items: center;
  justify-content: center;
}

.cmonth-empty{
  color: rgba(255,255,255,0.58);
  font-weight: 700;
  font-size: 12px;
}

/* =========================================================
   COLUMNAS
   ========================================================= */

.cmonth-grid-scope--km{
  --cmonth-cols:
    minmax(0, 1fr)
    74px
    94px
    102px;
}

.cmonth-grid-scope--tk{
  --cmonth-cols:
    minmax(0, 1fr)
    84px
    110px;
}

/* =========================================================
   DATATABLE
   ========================================================= */

.costes-month-tablewrap .dash-table-container,
.costes-month-tablewrap .dash-spreadsheet-container,
.costes-month-tablewrap .dash-spreadsheet-inner{
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
}

.costes-month-tablewrap .dash-spreadsheet-container{
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: hidden !important;
}

.costes-month-tablewrap .dash-spreadsheet-inner{
  overflow: auto !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}

.costes-month-tablewrap .dash-spreadsheet-inner::-webkit-scrollbar{
  width: 10px;
  height: 10px;
}

.costes-month-tablewrap .dash-spreadsheet-inner::-webkit-scrollbar-track{
  background: transparent;
}

.costes-month-tablewrap .dash-spreadsheet-inner::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.16);
  border-radius: 999px;
}

.costes-month-tablewrap .dash-spreadsheet-inner::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,0.24);
}

.costes-month-tablewrap .dash-header{
  background: #15202a !important;
  border-bottom: 1px solid rgba(130, 155, 178, 0.18) !important;
}

.costes-month-tablewrap .dash-header div{
  color: rgba(255,255,255,0.58) !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.45px !important;
  text-transform: uppercase !important;
}

.costes-month-tablewrap .dash-cell{
  background: transparent !important;
  border: none !important;
  color: rgba(255,255,255,0.92) !important;
  font-size: 12px !important;
}

/* =========================================================
   GRÁFICO
   ========================================================= */

.costes-month-panel--graph{
  overflow: hidden;
}

.costes-month-graphwrap{
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 470px;
  margin: 0 auto;
  overflow: hidden;
}

.costes-month-graph{
  width: 100% !important;
  height: clamp(205px, 24vh, 250px) !important;
  max-height: 250px !important;
}

/* =========================================================
   MINI CARDS
   ========================================================= */

/* =========================================================
   MINI CARDS RESUMEN
   ========================================================= */

.costes-month-minirow{
  flex: 0 0 48px;
  display: flex;
  gap: 10px;
  margin-top: 8px;
  position: relative;
  z-index: 2;
}

.costes-mini-pill-resumen{
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 0 12px;
  border-radius: 999px;

  border: 1px solid rgba(55,242,166,0.22);
  background:
    linear-gradient(180deg, rgba(55,242,166,0.10) 0%, rgba(55,242,166,0.05) 100%),
    rgba(255,255,255,0.03);

  color: rgba(255,255,255,0.94);

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 6px 16px rgba(0,0,0,0.18),
    0 0 14px rgba(55,242,166,0.08);

  overflow: hidden;
}

.costes-mini-pill--first{
  margin-left: 6px;
}

.costes-mini-pill--last{
  margin-right: 6px;
}

.costes-mini-pill-resumen__left{
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.costes-mini-pill-resumen__icon{
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.96;
}

.costes-mini-pill-resumen__right{
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.costes-mini-pill-resumen__count{
  color: rgba(255,255,255,0.96);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.costes-mini-pill-resumen__amount{
  color: #37f2a6;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 768px){
  .costes-month-minirow{
    gap: 6px;
    margin-top: 6px;
  }

  .costes-mini-pill-resumen{
    min-height: 40px;
    height: 40px;
    padding: 0 10px;
  }

  .costes-mini-pill-resumen__count,
  .costes-mini-pill-resumen__amount{
    font-size: 12px;
  }

  .costes-mini-pill--first{
    margin-left: 4px;
  }

  .costes-mini-pill--last{
    margin-right: 4px;
  }
}

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

@media (min-width: 1600px){
  .costes-month-graphwrap{
    max-width: 560px;
  }

  .costes-month-graph{
    height: 280px !important;
    max-height: 280px !important;
  }
}

@media (max-width: 1250px){
  .cmonth-head,
  .cmonth-row{
    column-gap: 10px;
  }

  .cmonth-head{
    padding: 9px 10px;
    padding-right: 20px;
  }

  .cmonth-row{
    padding: 9px 10px;
  }

  .cmonth-cell{
    font-size: 11.5px;
  }

  .cmonth-hcell{
    font-size: 10.5px;
    letter-spacing: 0.25px;
  }

  .cmonth-grid-scope--km{
    --cmonth-cols:
      minmax(0, 1fr)
      66px
      86px
      94px;
  }

  .cmonth-grid-scope--tk{
    --cmonth-cols:
      minmax(0, 1fr)
      76px
      100px;
  }

  .costes-month-graphwrap{
    max-width: 430px;
  }

  .costes-month-graph{
    height: clamp(185px, 22vh, 220px) !important;
    max-height: 220px !important;
  }
}

@media (max-width: 992px){
  .costes-month{
    min-height: 391px;
  }

  .costes-month-card{
    height: auto;
    min-height: 347px;
  }

  .cmonth-head{
    padding: 8px 9px;
    padding-right: 19px;
  }

  .cmonth-row{
    padding: 8px 9px;
  }

  .cmonth-grid-scope--km{
    --cmonth-cols:
      minmax(0, 1fr)
      58px
      78px
      90px;
  }

  .cmonth-grid-scope--tk{
    --cmonth-cols:
      minmax(0, 1fr)
      66px
      92px;
  }

  .costes-month-graphwrap{
    max-width: 380px;
  }

  .costes-month-graph{
    height: 195px !important;
    max-height: 195px !important;
  }
}

@media (max-width: 768px){
  .costes-month{
    min-height: 366px;
  }

  .costes-month-card{
    min-height: 326px;
  }

  .costes-month-graphwrap{
    max-width: 320px;
  }

  .costes-month-graph{
    height: 175px !important;
    max-height: 175px !important;
  }

  .costes-month-minirow{
    gap: 4px;
    margin-top: 6px;
  }
}

@media (max-width: 680px){
  .costes-month{
    min-height: 340px;
  }

  .costes-month-card{
    min-height: 306px;
  }

  .costes-month-graphwrap{
    max-width: 290px;
  }

  .costes-month-graph{
    height: 160px !important;
    max-height: 160px !important;
  }
}