#sec-settlement{
  padding:14px 16px;
}

#sec-settlement .set-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:var(--bg-1);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:12px 14px;
  margin-bottom:12px;
}

#sec-settlement .set-filters{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

#sec-settlement select,
#sec-settlement input,
#sec-settlement textarea{
  font:inherit;
  font-size:13px;
  background:var(--bg-2);
  color:var(--fg);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:6px 8px;
}

#sec-settlement input[type="checkbox"]{
  width:16px;
  height:16px;
  padding:0;
  accent-color:var(--primary);
}

#sec-settlement .set-search{
  min-width:220px;
}

#sec-settlement .set-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

#sec-settlement .set-btn{
  font:inherit;
  font-size:13px;
  cursor:pointer;
  border:1px solid var(--border);
  background:var(--bg-2);
  color:var(--fg);
  border-radius:var(--radius);
  padding:6px 12px;
}

#sec-settlement .set-btn.primary{
  background:var(--primary);
  border-color:var(--primary);
  color:var(--fg-on);
  font-weight:700;
}

#sec-settlement .set-btn.warn{
  color:var(--warn);
  border-color:rgba(245,158,11,.45);
}

#sec-settlement .set-btn.danger{
  color:var(--danger);
  border-color:rgba(239,68,68,.45);
}

#sec-settlement .set-summary{
  display:grid;
  grid-template-columns:repeat(5,minmax(130px,1fr));
  gap:8px;
  margin-bottom:12px;
}

#sec-settlement .set-kpi{
  background:var(--bg-1);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:10px 12px;
}

#sec-settlement .set-kpi span{
  display:block;
  color:var(--fg-muted);
  font-size:11px;
  margin-bottom:4px;
}

#sec-settlement .set-kpi b{
  display:block;
  color:var(--fg);
  font-size:17px;
  font-family:var(--font-mono);
}

#sec-settlement .set-panel{
  background:var(--bg-1);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  overflow:auto;
  max-height:calc(100vh - 300px);
}

#sec-settlement .set-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}

#sec-settlement .set-table th,
#sec-settlement .set-table td{
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:middle;
}

#sec-settlement .set-table th{
  color:var(--fg-muted);
  font-weight:700;
  background:var(--bg-1);
  position:sticky;
  top:0;
}

#sec-settlement .set-table td.num,
#sec-settlement .set-table th.num{
  text-align:right;
  font-family:var(--font-mono);
}

#sec-settlement .set-table tr:hover td{
  background:var(--bg-2);
}

#sec-settlement .set-status{
  display:inline-flex;
  align-items:center;
  border:1px solid var(--border);
  border-radius:999px;
  padding:2px 8px;
  font-size:11px;
  font-weight:700;
}

#sec-settlement .set-status.CONFIRMED{
  color:var(--ok);
  border-color:rgba(16,185,129,.45);
}

#sec-settlement .set-status.DRAFT{
  color:var(--warn);
  border-color:rgba(245,158,11,.45);
}

#sec-settlement .set-status.CANCELED,
#sec-settlement .set-status.CANCELLED{
  color:var(--fg-muted);
  border-color:var(--border-hi);
}

#sec-settlement .set-modalBackdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  z-index:1200;
  display:none;
}

#sec-settlement .set-modal{
  position:fixed;
  top:54px;
  right:24px;
  width:min(760px,calc(100vw - 48px));
  max-height:calc(100vh - 90px);
  overflow:auto;
  background:var(--bg-1);
  color:var(--fg);
  border:1px solid var(--border-hi);
  border-radius:var(--radius-md);
  box-shadow:var(--shadow-lg);
  z-index:1201;
  display:none;
}

#sec-settlement .set-modalHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}

#sec-settlement .set-modalHead h3{
  margin:0;
  font-size:16px;
}

#sec-settlement .set-form{
  padding:14px 16px;
}

#sec-settlement .set-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px 12px;
}

#sec-settlement .set-field{
  display:flex;
  flex-direction:column;
  gap:4px;
}

#sec-settlement .set-field.full{
  grid-column:1 / -1;
}

#sec-settlement .set-field label{
  font-size:11px;
  color:var(--fg-muted);
  font-weight:700;
}

#sec-settlement .set-field textarea{
  min-height:78px;
  resize:vertical;
}

#sec-settlement .set-projectPicker{
  position:relative;
}

#sec-settlement .set-projectResults{
  position:absolute;
  left:0;
  right:0;
  top:100%;
  max-height:300px;
  overflow:auto;
  background:var(--bg-1);
  border:1px solid var(--border-hi);
  border-radius:var(--radius);
  box-shadow:var(--shadow-md);
  z-index:1210;
  display:none;
}

#sec-settlement .set-projectOpt{
  display:block;
  width:100%;
  padding:9px 10px;
  cursor:pointer;
  text-align:left;
  background:transparent;
  color:var(--fg);
  border:0;
  border-bottom:1px solid var(--border);
}

#sec-settlement .set-projectName{
  display:block;
  font-weight:700;
  line-height:1.35;
}

#sec-settlement .set-projectMeta,
#sec-settlement .set-projectSelected,
#sec-settlement .set-projectHint,
#sec-settlement .set-projectCount{
  display:block;
  margin-top:3px;
  color:var(--fg-muted);
  font-size:12px;
}

#sec-settlement .set-projectSelected{
  min-height:16px;
  margin-top:4px;
}

#sec-settlement .set-projectHint,
#sec-settlement .set-projectCount{
  margin-top:0;
  padding:8px 10px;
  border-bottom:1px solid var(--border);
}

#sec-settlement .set-projectCount{
  font-weight:700;
  color:var(--fg);
  background:var(--bg-2);
}

#sec-settlement .set-projectOpt:hover{
  background:var(--bg-2);
}

#sec-settlement .set-formFoot{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  padding:12px 16px;
  border-top:1px solid var(--border);
}

#sec-settlement .set-billingPanel{
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  background:var(--bg-2);
  overflow:hidden;
}

#sec-settlement .set-billingHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
}

#sec-settlement .set-billingHead strong{
  font-size:13px;
}

#sec-settlement .set-billingHead span{
  font-size:11px;
  color:var(--fg-muted);
}

#sec-settlement .set-billingSummary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1px;
  background:var(--border);
}

#sec-settlement .set-billingSummary div{
  background:var(--bg-1);
  padding:8px 10px;
}

#sec-settlement .set-billingSummary span{
  display:block;
  color:var(--fg-muted);
  font-size:10px;
}

#sec-settlement .set-billingSummary b{
  display:block;
  margin-top:2px;
  font-size:13px;
  font-family:var(--font-mono);
}

#sec-settlement .set-billingForms{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  padding:12px;
}

#sec-settlement .set-billingBox{
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--bg-1);
  overflow:hidden;
}

#sec-settlement .set-billingBoxHead{
  padding:8px 10px;
  font-size:12px;
  font-weight:800;
  border-bottom:1px solid var(--border);
}

#sec-settlement .set-miniGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  padding:10px;
}

#sec-settlement .set-miniGrid label{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:11px;
  color:var(--fg-muted);
  font-weight:700;
}

#sec-settlement .set-miniGrid label.full{
  grid-column:1 / -1;
}

#sec-settlement .set-billingActions{
  display:flex;
  justify-content:flex-end;
  padding:0 10px 10px;
}

#sec-settlement .set-billingList{
  border-top:1px solid var(--border);
  max-height:180px;
  overflow:auto;
}

#sec-settlement .set-billingRow{
  display:grid;
  grid-template-columns:96px 132px minmax(360px,1fr) 56px;
  gap:8px;
  align-items:start;
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  font-size:12px;
  min-width:720px;
}

#sec-settlement .set-billingDate{
  color:var(--fg-muted);
  padding-top:3px;
}

#sec-settlement .set-billingStatus{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:22px;
  padding:2px 7px;
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--fg);
  background:var(--bg-2);
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}

#sec-settlement .set-billingStatus small{
  color:var(--fg-muted);
  font-size:10px;
  font-weight:700;
  line-height:1.2;
}

#sec-settlement .set-billingReceiptRef{
  align-items:flex-start;
  border-radius:6px;
}

#sec-settlement .set-billingAmounts{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  font-family:var(--font-mono);
  line-height:1.5;
}

#sec-settlement .set-billingAmounts span{
  display:inline-flex;
  align-items:baseline;
  gap:4px;
  white-space:nowrap;
}

#sec-settlement .set-billingAmounts label{
  color:var(--fg-muted);
  font-family:var(--font-sans);
  font-size:10px;
  font-weight:700;
}

#sec-settlement .set-billingAmounts em{
  color:var(--fg);
  font-style:normal;
  font-weight:800;
}

#sec-settlement .set-billingMain{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
  line-height:1.35;
}

#sec-settlement .set-billingMemo{
  display:block;
  grid-column:1 / -1;
  color:var(--fg-muted);
  font-size:11px;
  font-weight:500;
  white-space:normal;
  overflow-wrap:anywhere;
}

#sec-settlement .set-empty{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:180px;
  color:var(--fg-dim);
}

@media (max-width:900px){
  #sec-settlement .set-summary{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  #sec-settlement .set-grid{ grid-template-columns:1fr; }
  #sec-settlement .set-billingSummary{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  #sec-settlement .set-billingForms{ grid-template-columns:1fr; }
  #sec-settlement .set-toolbar{ align-items:stretch; flex-direction:column; }
  #sec-settlement .set-modal{ left:12px; right:12px; width:auto; }
}
