/* Compras / Entradas — refino visual */
.ce-overlay{
  padding:14px !important;
  align-items:flex-start !important;
  z-index:99990 !important;
}

.ce-modal{
  width:calc(100vw - 28px) !important;
  max-width:1420px !important;
  max-height:95vh !important;
  border-radius:18px !important;
}

.ce-head{
  padding:13px 16px !important;
}

.ce-head h2{
  font-size:18px !important;
}

.ce-head p{
  font-size:12px !important;
}

.ce-body{
  padding:12px 16px !important;
}

/* Filtros em duas camadas: presets + filtros principais */
.ce-periods{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin:0 0 10px;
  align-items:center;
}

.ce-periods small{
  font-size:10px;
  font-weight:900;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-right:4px;
}

.ce-periods button{
  height:30px;
  border-radius:999px;
  border:1px solid #e3dacc;
  background:#fff;
  padding:0 11px;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
}

.ce-periods button.active,
.ce-periods button:hover{
  background:#c9a84c;
  border-color:#c9a84c;
  color:#fff;
}

.ce-filters{
  display:grid !important;
  grid-template-columns:minmax(260px,1.4fr) 130px minmax(210px,1fr) 145px 145px 95px !important;
  gap:8px 10px !important;
  align-items:end !important;
  margin-bottom:11px !important;
}

.ce-field{
  min-width:0 !important;
}

.ce-field label{
  display:block !important;
  white-space:nowrap !important;
  overflow:visible !important;
  font-size:10px !important;
  font-weight:900 !important;
  line-height:1.1 !important;
  margin-bottom:4px !important;
}

.ce-field input,
.ce-field select{
  width:100% !important;
  min-width:0 !important;
  height:35px !important;
  border-radius:10px !important;
  font-size:12.5px !important;
  padding:6px 9px !important;
  box-sizing:border-box !important;
}

.ce-filters .ce-btn,
#ceFiltrar{
  width:95px !important;
  min-width:95px !important;
  height:35px !important;
  padding:0 !important;
  font-size:12.5px !important;
}

.ce-kpis{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:8px !important;
  margin-bottom:10px !important;
}

.ce-kpi{
  padding:9px 11px !important;
  border-radius:12px !important;
}

.ce-kpi small{
  font-size:9.5px !important;
}

.ce-kpi b{
  font-size:20px !important;
}

.ce-table-wrap{
  max-height:57vh !important;
  border-radius:13px !important;
}

.ce-table{
  width:100% !important;
  min-width:1120px !important;
  font-size:11.6px !important;
}

.ce-table th{
  padding:8px 9px !important;
  font-size:9.5px !important;
  white-space:nowrap !important;
}

.ce-table td{
  padding:8px 9px !important;
  line-height:1.25 !important;
}

.ce-table td:nth-child(1){
  width:128px !important;
  white-space:nowrap !important;
}

.ce-table td:nth-child(2){
  width:68px !important;
}

.ce-table td:nth-child(3){
  width:220px !important;
}

.ce-table td:nth-child(4){
  width:310px !important;
}

.ce-table td:nth-child(5){
  min-width:330px !important;
}

.ce-doc{
  max-width:300px !important;
}

.ce-dest{
  max-width:360px !important;
  font-size:11px !important;
}

.ce-badge{
  height:20px !important;
  padding:0 7px !important;
  font-size:10.5px !important;
}

.ce-actions button{
  height:28px !important;
  padding:0 9px !important;
  font-size:11px !important;
}

.ce-foot{
  padding:10px 16px !important;
}

.ce-btn{
  height:36px !important;
  font-size:12.5px !important;
  border-radius:10px !important;
}

/* Detalhe */
#ceDetailOverlay .ce-modal{
  width:calc(100vw - 34px) !important;
  max-width:1320px !important;
}

.ce-detail-grid{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:8px !important;
}

.ce-info{
  padding:8px 10px !important;
}

.ce-info small{
  font-size:9px !important;
}

.ce-info b{
  font-size:12.5px !important;
}

.ce-items-table{
  font-size:11.5px !important;
}

.ce-items-table th,
.ce-items-table td{
  padding:7px 8px !important;
}

/* Responsivo */
@media(max-width:1150px){
  .ce-filters{
    grid-template-columns:1fr 130px 1fr !important;
  }

  .ce-filters .ce-btn,
  #ceFiltrar{
    width:100% !important;
  }
}

@media(max-width:780px){
  .ce-filters,
  .ce-kpis,
  .ce-detail-grid{
    grid-template-columns:1fr !important;
  }

  .ce-modal{
    width:calc(100vw - 16px) !important;
  }
}
