/* ==================================================
   DASHBOARD PROYECCIONES
   NUEVO LAYOUT:
   cards
   tablas lado a lado
   gráficas abajo
================================================== */

/* =========================
   LAYOUT
========================= */
.dpr-layout{
  width:100%;
  padding:20px;
  box-sizing:border-box;
}

.dpr-header{
  margin-bottom:20px;
}

.dpr-header h2{
  margin:0;
  font-size:34px;
  font-weight:700;
  color:#111827;
}

/* =========================
   FILTROS
========================= */
.dpr-filters-box{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-bottom:20px;
}



.dpr-toolbar-bottom{
  display:grid;
  grid-template-columns:220px 220px 160px;
  gap:14px;
}

.dpr-group{
  display:flex;
  flex-direction:column;
}

.dpr-group label{
  font-size:12px;
  font-weight:600;
  color:#6b7280;
  margin-bottom:6px;
}

.dpr-group input,
.dpr-select{
  width:100%;
  height:44px;
  border:1px solid #d1d5db;
  border-radius:10px;
  padding:0 12px;
  font-size:14px;
  background:#fff;
  box-sizing:border-box;
}

/* =========================
   BOTONES
========================= */
.dpr-btn{
  height:44px;
  border:none;
  border-radius:10px;
  padding:0 18px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition:.2s;
}

.dpr-btn:hover{
  transform:translateY(-1px);
}

.dpr-btn-primary{
  background:#2f56a6;
  color:#fff;
}

.dpr-btn-light{
  background:#eef2f7;
  color:#111827;
}

.dpr-btn-danger{
  background:#ea4335;
  color:#fff;
}

/* =========================
   CARDS KPI
========================= */
.dpr-cards{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
  margin-bottom:20px;
}

.dpr-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:18px;
  position:relative;
  min-height:110px;
}

.dpr-card::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:5px;
  border-radius:14px 0 0 14px;
}

.dpr-card h3{
  margin:0 0 12px;
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  color:#6b7280;
  letter-spacing:.4px;
}

.dpr-card p{
  margin:0;
  font-size:22px;
  font-weight:800;
  color:#111827;
  line-height:1.3;
}

.dpr-kpi-mes::before{background:#34495e;}
.dpr-kpi-3m::before{background:#27ae60;}
.dpr-kpi-6m::before{background:#e74c3c;}
.dpr-kpi-facturas::before{background:#3498db;}
.dpr-kpi-clientes::before{background:#8e44ad;}
.dpr-kpi-ticket::before{background:#f39c12;}

/* =========================
   GRID PRINCIPAL
========================= */
.dpr-main{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
  margin-bottom:20px;
  align-items:start;
}

.dpr-left,
.dpr-right{
  display:flex;
  flex-direction:column;
  gap:20px;
  min-width:0;
}

/* =========================
   BLOQUES
========================= */
.dpr-chart-card,
.dpr-table-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:16px;
  box-sizing:border-box;
  overflow:hidden;
}

.dpr-card-header h3{
  margin:0 0 14px;
  font-size:18px;
  font-weight:700;
  color:#111827;
}

/* =========================
   TABLAS
========================= */
.dpr-table-scroll{
  width:100%;
  overflow:auto;
  max-height:420px;
  border-radius:10px;
}

.dpr-table{
  width:100%;
  min-width:780px;
  border-collapse:collapse;
}

.dpr-table th{
  position:sticky;
  top:0;
  background:#f5f7fb;
  z-index:5;
  text-align:left;
  padding:12px 14px;
  font-size:13px;
  font-weight:700;
  color:#111827;
  white-space:nowrap;
}

.dpr-table td{
  padding:12px 14px;
  font-size:14px;
  border-bottom:1px solid #f1f1f1;
  white-space:nowrap;
  color:#111827;
}

.dpr-table tbody tr:hover{
  background:#fafafa;
}

.dpr-empty-row{
  text-align:center;
  color:#6b7280;
  font-weight:600;
  padding:20px !important;
}

/* =========================
   CHARTS
========================= */
.dpr-chart-wrap{
  position:relative;
  width:100%;
  height:320px;
}

.dpr-chart-wrap canvas{
  width:100% !important;
  height:100% !important;
}

.dpr-right .dpr-chart-wrap{
  height:280px;
}

/* =========================
   RESPONSIVE
========================= */
@media(max-width:1400px){

  .dpr-toolbar{
    grid-template-columns:repeat(6,1fr);
  }

  .dpr-cards{
    grid-template-columns:repeat(3,1fr);
  }
}

@media(max-width:1200px){

  .dpr-main{
    grid-template-columns:1fr;
  }

  .dpr-cards{
    grid-template-columns:repeat(2,1fr);
  }
}

@media(max-width:900px){

  .dpr-toolbar{
    grid-template-columns:repeat(3,1fr);
  }

  .dpr-toolbar-bottom{
    grid-template-columns:1fr;
  }

  .dpr-cards{
    grid-template-columns:1fr;
  }
}

@media(max-width:768px){

  .dpr-layout{
    padding:14px;
  }

  .dpr-header h2{
    font-size:28px;
  }

  .dpr-toolbar{
    grid-template-columns:1fr;
  }

  .dpr-table{
    min-width:760px;
  }

  .dpr-chart-wrap{
    height:250px;
  }

  .dpr-right .dpr-chart-wrap{
    height:250px;
  }
}

@media(max-width:480px){

  .dpr-header h2{
    font-size:24px;
  }

  .dpr-card p{
    font-size:18px;
  }
}

/* ==================================================
   AJUSTE SOLICITADO:
   TABLAS UNA DEBAJO DE LA OTRA
   (después de cards)
================================================== */

/* =========================
   CONTENEDOR GENERAL TABLAS
========================= */
.dpr-main{
  display:flex;
  flex-direction:column;
  gap:20px;
  margin-bottom:20px;
}

/* =========================
   COLUMNAS FULL WIDTH
========================= */
.dpr-left,
.dpr-right{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:20px;
}

/* =========================
   TARJETAS TABLA / CHART
========================= */
.dpr-table-card,
.dpr-chart-card{
  width:100%;
}

/* =========================
   TABLAS GRANDES
========================= */
.dpr-table-scroll{
  width:100%;
  overflow-x:auto;
  overflow-y:auto;
  max-height:420px;
  border-radius:10px;
}

.dpr-table{
  width:100%;
  min-width:1100px;
  border-collapse:collapse;
}

/* =========================
   GRÁFICAS
========================= */
.dpr-chart-wrap{
  position:relative;
  width:100%;
  height:320px;
}

.dpr-chart-wrap canvas{
  width:100% !important;
  height:100% !important;
}

/* =========================
   RESPONSIVE
========================= */
@media(max-width:768px){

  .dpr-main{
    gap:16px;
  }

  .dpr-table{
    min-width:760px;
  }

  .dpr-chart-wrap{
    height:250px;
  }
}

/* =====================================
   AJUSTE COMPACTO DASHBOARD PROYECCIONES
   AGREGAR AL FINAL
===================================== */

/* layout */
.dpr-layout{
  padding:14px !important;
}

.dpr-header{
  margin-bottom:14px !important;
}

.dpr-header h2{
  font-size:28px !important;
}

/* botones */
.dpr-btn{
  height:34px !important;
  padding:0 14px !important;
  font-size:12px !important;
  border-radius:9px !important;
}

/* =========================
   FILTROS COMPACTOS
========================= */
.dpr-filters-box{
  padding:14px !important;
  gap:10px !important;
  margin-bottom:14px !important;
}

/* botones periodo en una fila */


.dpr-toolbar > *{
  flex:none !important;
}

.dpr-toolbar::-webkit-scrollbar{
  height:6px;
}

.dpr-toolbar::-webkit-scrollbar-thumb{
  background:#c7cfdd;
  border-radius:20px;
}

/* fechas abajo */
.dpr-toolbar-bottom{
  grid-template-columns:1fr 1fr 1fr !important;
  gap:8px !important;
}

.dpr-group label{
  font-size:11px !important;
  margin-bottom:4px !important;
}

.dpr-group input,
.dpr-select{
  height:34px !important;
  padding:0 10px !important;
  font-size:12px !important;
  border-radius:9px !important;
}

/* =========================
   KPI CARDS
========================= */
.dpr-cards{
  grid-template-columns:repeat(4,1fr) !important;
  gap:10px !important;
  margin-bottom:14px !important;
}

.dpr-card{
  min-height:84px !important;
  padding:12px 14px !important;
  border-radius:12px !important;
}

.dpr-card::before{
  width:4px !important;
}

.dpr-card h3{
  font-size:10px !important;
  margin-bottom:4px !important;
}

.dpr-card p{
  font-size:18px !important;
  line-height:1.25 !important;
}

/* =========================
   TABLAS / CHARTS
========================= */
.dpr-main,
.dpr-left,
.dpr-right{
  gap:14px !important;
}

.dpr-table-card,
.dpr-chart-card{
  padding:12px !important;
  border-radius:12px !important;
}

.dpr-card-header h3{
  font-size:16px !important;
  margin-bottom:10px !important;
}

.dpr-table-scroll{
  max-height:320px !important;
}

.dpr-table th{
  font-size:12px !important;
  padding:9px 10px !important;
}

.dpr-table td{
  font-size:12px !important;
  padding:9px 10px !important;
}

.dpr-chart-wrap{
  height:260px !important;
}

.dpr-right .dpr-chart-wrap{
  height:240px !important;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width:1400px){

  .dpr-toolbar{
    flex-wrap:wrap !important;
  }

  .dpr-cards{
    grid-template-columns:repeat(2,1fr) !important;
  }
}

@media (max-width:992px){

  .dpr-toolbar-bottom{
    grid-template-columns:1fr !important;
  }

  .dpr-cards{
    grid-template-columns:1fr !important;
  }
}

@media (max-width:768px){

  .dpr-layout{
    padding:10px !important;
  }

  .dpr-header h2{
    font-size:24px !important;
  }

  .dpr-toolbar{
    display:grid !important;
    grid-template-columns:1fr !important;
  }

  .dpr-btn{
    width:100% !important;
  }

  .dpr-chart-wrap,
  .dpr-right .dpr-chart-wrap{
    height:220px !important;
  }
}

/* =====================================
   FILTROS IGUAL GERENCIAL / CONTABLE
===================================== */


.dpr-toolbar .dpr-group{
  width:auto !important;
  margin:0 !important;
}

.dpr-toolbar .dpr-btn{
  width:120px !important;
  min-width:120px !important;
}

.dpr-toolbar .dpr-select{
  width:120px !important;
}

.dpr-toolbar input[type="date"]{
  width:150px !important;
}

.dpr-toolbar label{
  font-size:11px !important;
  margin-bottom:4px !important;
}




.dpr-toolbar .dpr-group{
  flex:none !important;
  width:auto !important;
}

.dpr-toolbar{
  display:flex !important;
  align-items:flex-end !important;
  gap:8px !important;
  flex-wrap:nowrap !important;
}

.dpr-filters-box{
  background:#fff !important;
  border:1px solid #e5e7eb !important;
  border-radius:14px !important;
  padding:14px !important;
  margin-bottom:20px !important;
  display:block !important;
}

.dpr-toolbar{
  width:100% !important;
}

.dpr-cards{
  margin-top:0 !important;
}