.ce-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.55);
  z-index:99950;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.ce-modal{
  width:min(1180px,calc(100vw - 34px));
  max-height:92vh;
  background:#fff;
  border-radius:18px;
  box-shadow:0 28px 80px rgba(0,0,0,.28);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.ce-head{
  padding:15px 18px;
  border-bottom:1px solid #e7dfd4;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
}

.ce-head h2{
  margin:0;
  font-size:19px;
}

.ce-head p{
  margin:3px 0 0;
  color:#64748b;
  font-size:12px;
}

.ce-close{
  width:36px;
  height:36px;
  border:0;
  background:#fff;
  font-size:24px;
  cursor:pointer;
}

.ce-body{
  padding:14px 16px;
  overflow:auto;
}

.ce-filters{
  display:grid;
  grid-template-columns:1.4fr .85fr 1fr .9fr .9fr auto;
  gap:8px;
  align-items:end;
  margin-bottom:12px;
}

.ce-field label{
  display:block;
  font-size:10.5px;
  font-weight:900;
  margin-bottom:3px;
  color:#0f172a;
}

.ce-field input,
.ce-field select{
  width:100%;
  height:36px;
  border:1.5px solid #e3dacc;
  border-radius:10px;
  padding:7px 10px;
  background:#faf9f7;
  font-size:13px;
}

.ce-btn{
  height:36px;
  border-radius:10px;
  border:1px solid #e7dfd4;
  background:#fff;
  padding:0 12px;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}

.ce-btn.gold{
  background:#c9a84c;
  border-color:#c9a84c;
  color:#fff;
}

.ce-btn.green{
  background:#16a34a;
  border-color:#16a34a;
  color:#fff;
}

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

.ce-kpi{
  border:1px solid #e7dfd4;
  border-radius:14px;
  padding:11px 13px;
  background:#fff;
}

.ce-kpi small{
  display:block;
  color:#94a3b8;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.ce-kpi b{
  display:block;
  font-size:22px;
  margin-top:4px;
}

.ce-table-wrap{
  border:1px solid #e7dfd4;
  border-radius:14px;
  overflow:auto;
  max-height:52vh;
}

.ce-table{
  width:100%;
  border-collapse:collapse;
  font-size:12.5px;
  min-width:1020px;
}

.ce-table th{
  position:sticky;
  top:0;
  z-index:2;
  background:#faf9f7;
  text-align:left;
  color:#475569;
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.06em;
  padding:10px 11px;
  border-bottom:1px solid #e7dfd4;
}

.ce-table td{
  padding:10px 11px;
  border-bottom:1px solid #eee4d9;
  vertical-align:top;
}

.ce-doc{
  max-width:260px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ce-dest{
  max-width:260px;
  color:#475569;
  font-size:11.5px;
}

.ce-badge{
  display:inline-flex;
  align-items:center;
  height:22px;
  padding:0 8px;
  border-radius:999px;
  background:#dcfce7;
  color:#166534;
  font-weight:900;
  font-size:11px;
}

.ce-actions{
  display:flex;
  gap:6px;
}

.ce-actions button{
  height:30px;
  border:0;
  border-radius:9px;
  padding:0 9px;
  font-weight:900;
  cursor:pointer;
  font-size:11.5px;
}

.ce-detail{
  background:#2563eb;
  color:#fff;
}

.ce-print{
  background:#c9a84c;
  color:#fff;
}

.ce-foot{
  padding:12px 16px;
  border-top:1px solid #e7dfd4;
  display:flex;
  justify-content:flex-end;
  gap:8px;
}

.ce-detail-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px;
}

.ce-info{
  border:1px solid #e7dfd4;
  border-radius:12px;
  padding:9px 11px;
  background:#fff;
}

.ce-info small{
  display:block;
  color:#94a3b8;
  font-size:9.5px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.ce-info b{
  display:block;
  margin-top:3px;
  font-size:13px;
  word-break:break-word;
}

.ce-items-table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

.ce-items-table th,
.ce-items-table td{
  border-bottom:1px solid #e7dfd4;
  padding:8px;
  text-align:left;
}

.ce-items-table th{
  background:#faf9f7;
  font-size:10px;
  color:#475569;
  text-transform:uppercase;
}

.ce-num{
  text-align:right!important;
}

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

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