/* =====================================
   DASHBOARD CONTABLE V2 CSS
   VISUAL = DASHBOARD GERENCIAL
   AISLADO TOTAL
   PREFIX: dbcx-
===================================== */

/* =========================
   LAYOUT
========================= */
.dbcx-layout{
  padding:20px;
  width:100%;
  box-sizing:border-box;
}

.dbcx-main{
  display:flex;
  flex-direction:column;
  gap:20px;
}

.dbcx-left,
.dbcx-right{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:20px;
}

/* =========================
   HEADER
========================= */
.dbcx-header{
  margin-bottom:20px;
}

.dbcx-header h2{
  margin:0;
  font-size:34px;
  font-weight:700;
  color:#111827;
}

/* =========================
   BOTONES
========================= */
.dbcx-btn{
  border:none;
  border-radius:10px;
  height:44px;
  padding:0 18px;
  cursor:pointer;
  font-size:14px;
  font-weight:700;
  transition:.2s ease;
  white-space:nowrap;
}

.dbcx-btn:hover{
  transform:translateY(-1px);
}

.dbcx-btn-primary{
  background:#2f56a6;
  color:#fff;
}

.dbcx-btn-light{
  background:#eef2f7;
  color:#111827;
}

.dbcx-btn-danger{
  background:#ea4335;
  color:#fff;
}

/* =========================
   FILTROS
========================= */
.dbcx-filters-box{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-bottom:18px;
}



.dbcx-select{
  width:110px;
  height:44px;
  padding:0 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  font-size:14px;
  background:#fff;
}

.dbcx-toolbar-bottom{
  display:grid;
  grid-template-columns:220px 220px 160px;
  gap:14px;
  align-items:end;
}



.dbcx-group label{
  font-size:12px;
  font-weight:600;
  color:#6b7280;
  margin-bottom:6px;
}

.dbcx-group input{
  width:100%;
  height:44px;
  padding:0 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  font-size:14px;
  background:#fff;
  box-sizing:border-box;
}

.dbcx-btn-group{
  display:flex;
  align-items:end;
}

.dbcx-btn-group .dbcx-btn{
  width:100%;
}

/* =========================
   KPI CARDS
========================= */
#dbcxCardsDashboard.dbcx-cards{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
  margin-bottom:22px;
}

.dbcx-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:18px;
  position:relative;
}

.dbcx-card::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:5px;
  border-radius:14px 0 0 14px;
}

.dbcx-card h3{
  margin:0 0 10px;
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  color:#6b7280;
  letter-spacing:.4px;
}

.dbcx-card p{
  margin:0;
  font-size:22px;
  font-weight:800;
  color:#111827;
}

.dbcx-small-kpi{
  font-size:17px !important;
  line-height:1.4;
}

/* COLORES */
.dbcx-periodo::before{ background:#34495e; }
.dbcx-ingreso::before{ background:#27ae60; }
.dbcx-egreso::before{ background:#e74c3c; }
.dbcx-utilidad::before{ background:#3498db; }
.dbcx-margen::before{ background:#8e44ad; }
.dbcx-facturas::before{ background:#16a085; }
.dbcx-viajes::before{ background:#f39c12; }
.dbcx-promedio::before{ background:#c0392b; }

/* =========================
   CARDS GENERALES
========================= */
.dbcx-table-card,
.dbcx-chart-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:16px;
}

.dbcx-table-card h2,
.dbcx-chart-card h3{
  margin:0 0 14px;
  font-size:18px;
  font-weight:700;
  color:#111827;
}

/* =========================
   TABLAS
========================= */
.dbcx-table-scroll{
  max-height:340px;
  overflow:auto;
  border-radius:10px;
}

.dbcx-table{
  width:100%;
  min-width:760px;
  border-collapse:collapse;
}

.dbcx-table th{
  position:sticky;
  top:0;
  background:#f5f7fb;
  z-index:5;
  text-align:left;
  padding:12px 14px;
  font-size:13px;
  font-weight:700;
}

.dbcx-table td{
  padding:12px 14px;
  font-size:14px;
  border-bottom:1px solid #f1f1f1;
  white-space:nowrap;
}

.dbcx-table tbody tr:hover{
  background:#fafafa;
}

/* =========================
   COLORES TEXTO
========================= */
.dbcx-green{ color:#00a63e; font-weight:700; }
.dbcx-red{ color:#e53935; font-weight:700; }
.dbcx-blue{ color:#2457ff; font-weight:700; }
.dbcx-orange{ color:#f59e0b; font-weight:700; }

/* =========================
   GRAFICAS
========================= */
.dbcx-chart-wrap{
  position:relative;
  width:100%;
  height:320px;
}

.dbcx-chart-wrap canvas{
  width:100% !important;
  height:100% !important;
}

/* =========================
   RESPONSIVE
========================= */
@media(max-width:1400px){

  .dbcx-toolbar{
    grid-template-columns:repeat(6, auto);
  }

}

@media(max-width:1200px){

  #dbcxCardsDashboard.dbcx-cards{
    grid-template-columns:repeat(2,1fr);
  }

  .dbcx-toolbar-bottom{
    grid-template-columns:1fr 1fr;
  }

}

@media(max-width:768px){

  .dbcx-layout{
    padding:14px;
  }

  .dbcx-header h2{
    font-size:28px;
  }

  #dbcxCardsDashboard.dbcx-cards{
    grid-template-columns:1fr;
  }

  .dbcx-toolbar{
    grid-template-columns:1fr;
  }

  .dbcx-toolbar-bottom{
    grid-template-columns:1fr;
  }

  .dbcx-table{
    min-width:760px;
  }

}

@media(max-width:480px){

  .dbcx-header h2{
    font-size:24px;
  }

  .dbcx-card p{
    font-size:20px;
  }

  .dbcx-chart-wrap{
    height:240px;
  }

}


/* PEGAR en dashboard-contable.css */

.dbcx-row-50{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
}

@media(max-width:1100px){
  .dbcx-row-50{
    grid-template-columns:1fr;
  }
}

/* SOLO cambiar textos de valores en tablas a negro */

.dbcx-green,
.dbcx-red,
.dbcx-blue,
.dbcx-orange{
  color:#111827 !important;
}

/* =====================================
   AJUSTE COMPACTO DASHBOARD CONTABLE
   AGREGAR AL FINAL
===================================== */

/* layout */
.dbcx-layout{
  padding:14px !important;
}

.dbcx-main,
.dbcx-left,
.dbcx-right{
  gap:14px !important;
}

/* header */
.dbcx-header{
  margin-bottom:14px !important;
}

.dbcx-header h2{
  font-size:28px !important;
}

/* botones */
.dbcx-btn{
  height:34px !important;
  padding:0 14px !important;
  font-size:12px !important;
  border-radius:9px !important;
}

/* =========================
   FILTROS COMPACTOS
========================= */
.dbcx-filters-box{
  padding:14px !important;
  gap:10px !important;
  margin-bottom:14px !important;
}

/* botones superiores en una fila */


.dbcx-toolbar > *{
  flex:none !important;
}

.dbcx-toolbar .dbcx-select{
  min-width:90px !important;
  height:34px !important;
  font-size:12px !important;
}

.dbcx-toolbar::-webkit-scrollbar{
  height:6px;
}

.dbcx-toolbar::-webkit-scrollbar-thumb{
  background:#c7cfdd;
  border-radius:20px;
}

/* fechas + limpiar */
.dbcx-toolbar-bottom{
  grid-template-columns:1fr 1fr 1fr !important;
  gap:8px !important;
}

.dbcx-group{
  display:flex;
  flex-direction:column;
}

.dbcx-group label{
  font-size:11px !important;
  margin-bottom:4px !important;
}

.dbcx-group input{
  height:34px !important;
  padding:0 10px !important;
  font-size:12px !important;
  border-radius:9px !important;
}

/* =========================
   CARDS KPI MÁS PEQUEÑAS
========================= */
#dbcxCardsDashboard.dbcx-cards{
  grid-template-columns:repeat(4,1fr) !important;
  gap:10px !important;
  margin-bottom:14px !important;
}

.dbcx-card{
  padding:12px 14px !important;
  border-radius:12px !important;
}

.dbcx-card::before{
  width:4px !important;
}

.dbcx-card h3{
  font-size:10px !important;
  margin-bottom:4px !important;
}

.dbcx-card p{
  font-size:18px !important;
  line-height:1.25 !important;
}

.dbcx-small-kpi{
  font-size:14px !important;
  line-height:1.3 !important;
}

/* =========================
   TABLAS / TARJETAS
========================= */
.dbcx-table-card,
.dbcx-chart-card{
  padding:12px !important;
  border-radius:12px !important;
}

.dbcx-table-card h2,
.dbcx-chart-card h3{
  font-size:16px !important;
  margin-bottom:10px !important;
}

.dbcx-table-scroll{
  max-height:320px !important;
}

.dbcx-table th{
  font-size:12px !important;
  padding:9px 10px !important;
}

.dbcx-table td{
  font-size:12px !important;
  padding:9px 10px !important;
}

/* charts */
.dbcx-chart-wrap{
  height:280px !important;
}

.dbcx-row-50{
  gap:14px !important;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width:1400px){

  .dbcx-toolbar{
    flex-wrap:wrap !important;
  }

  #dbcxCardsDashboard.dbcx-cards{
    grid-template-columns:repeat(2,1fr) !important;
  }
}

@media (max-width:992px){

  .dbcx-toolbar-bottom{
    grid-template-columns:1fr !important;
  }

  .dbcx-row-50{
    grid-template-columns:1fr !important;
  }
}

@media (max-width:768px){

  .dbcx-layout{
    padding:10px !important;
  }

  .dbcx-toolbar{
    display:grid !important;
    grid-template-columns:1fr !important;
  }

  #dbcxCardsDashboard.dbcx-cards{
    grid-template-columns:1fr !important;
  }

  .dbcx-header h2{
    font-size:24px !important;
  }

  .dbcx-chart-wrap{
    height:380px !important;
  }

  .dbcx-btn{
    width:100% !important;
  }
}



#dbcxFechaDesde,
#dbcxFechaHasta{
  width:150px;
}

#dbcxFiltroAnio{
  width:120px;
}

#dbcxFiltroPeriodo{
  width:170px;
}

/* ==========================================
   ESTADO DE RESULTADOS
========================================== */

.dbcx-er-grid{

  display:grid;

  grid-template-columns:
    1fr 1fr;

  gap:16px;

  margin-bottom:16px;

}

.dbcx-er-card{

  background:#fff;

  border:1px solid #e5e7eb;

  border-radius:16px;

  padding:20px;

}

.dbcx-er-card h2{

  margin-bottom:18px;

}

.dbcx-er-loading{

  text-align:center;

  color:#6b7280;

  padding:40px 0;

}

.dbcx-er-row{

  display:flex;

  justify-content:space-between;

  align-items:center;

  padding:8px 0;

}

.dbcx-er-divider{

  border-top:1px solid #e5e7eb;

  margin:10px 0;

}

.dbcx-er-total{

  font-size:16px;

  font-weight:700;

}



@media (max-width:1200px){

  .dbcx-er-grid{

    grid-template-columns:1fr;

  }

}

/* ==========================================
   ESTADO DE RESULTADOS - COMPACTO
========================================== */

.dbcx-er-card{

  font-size:13px;

}

.dbcx-er-card h2{

  font-size:16px;

  margin-bottom:12px;

}

.dbcx-er-row{

  padding:4px 0;

  font-size:13px;

}

.dbcx-er-row span{

  font-size:13px;

}

.dbcx-er-row strong{

  font-size:13px;

}

.dbcx-er-total{

  font-size:14px;

  font-weight:700;

}

.dbcx-er-divider{

  margin:6px 0;

}

/* =====================================
   FILTROS IGUALES A DASHBOARD GERENCIAL
===================================== */




.dbcx-toolbar .dbcx-btn{
  width:120px !important;
  min-width:120px !important;
}

.dbcx-toolbar .dbcx-select{
  width:120px !important;
}

.dbcx-toolbar input[type="date"]{
  width:150px !important;
}

.dbcx-toolbar label{
  font-size:11px !important;
  margin-bottom:4px !important;
}

/* Igualar alineación al Dashboard Gerencial */

.dbcx-toolbar{
  display:flex !important;
  align-items:flex-end !important;
  gap:8px !important;
  flex-wrap:nowrap !important;
}

.dbcx-toolbar > button,
.dbcx-toolbar > select{
  margin-bottom:0 !important;
}

.dbcx-toolbar .dbcx-group{
  margin:0 !important;
}

.dbcx-toolbar .dbcx-btn{
  height:34px !important;
}

.dbcx-toolbar .dbcx-select{
  height:34px !important;
}
