/* UI Refresh v10 — 계약 프로젝트 / 수금 관리 / 성과금 산정 */

.primaryActionBtn,
.secondaryActionBtn {
  border: 0;
  border-radius: 10px;
  min-height: 38px;
  padding: 0 15px;
  font-weight: 700;
  cursor: pointer;
}
.primaryActionBtn { background: #4f46e5; color: #fff; }
.primaryActionBtn:hover { background: #4338ca; }
.secondaryActionBtn { background: #f8fafc; color: #334155; border: 1px solid #dbe3ee; }

/* 계약 프로젝트 목록 */
.contractListToolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}
.contractListFilters,
.contractListActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.contractListFilters input { width: 230px; }
.contractListFilters input,
.contractListFilters select {
  min-height: 38px;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #fff;
}
.manageToolsDetails { position: relative; }
.manageToolsDetails > summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 12px;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #fff;
  color: #475569;
  font-size: 13px;
}
.manageToolsDetails > summary::-webkit-details-marker { display: none; }
.manageToolsPanel {
  position: absolute;
  right: 0;
  top: 44px;
  z-index: 30;
  width: 330px;
  padding: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15,23,42,.12);
}
.manageToolsPanel label { display:block; margin-bottom:8px; }
.manageToolsPanel input { width:100%; margin-bottom:8px; }

.contractTableWrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: auto;
  box-shadow: 0 6px 20px rgba(15,23,42,.04);
}
.contractManageTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 1050px;
  font-size: 13px;
}
.contractManageTable th {
  padding: 13px 14px;
  text-align: left;
  color: #64748b;
  font-size: 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.contractManageTable td {
  padding: 14px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}
.contractMainRow:hover { background: #fafcff; }
.contractProjectCell { min-width: 270px; }
.contractProjectCell span {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  margin-top: 4px;
}
.contractProjectLink {
  border: 0;
  padding: 0;
  background: transparent;
  color: #3730a3;
  font-weight: 700;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.contractProjectLink:hover { text-decoration: underline; }
.moneyCell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.contractMissing {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff1f2;
  color: #be123c;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.contractPaymentBadges { display:flex; gap:5px; flex-wrap:wrap; }
.paymentMiniBadge,
.collectionStatus {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  white-space: nowrap;
}
.paymentMiniBadge.done,.collectionStatus.done { background:#ecfdf5; color:#047857; }
.paymentMiniBadge.requested,.collectionStatus.requested { background:#eef2ff; color:#4338ca; }
.paymentMiniBadge.need,.collectionStatus.need,.collectionStatus.danger { background:#fff1f2; color:#be123c; }
.paymentMiniBadge.planned,.collectionStatus.planned { background:#fff7ed; color:#c2410c; }
.paymentMiniBadge.neutral,.collectionStatus.neutral { background:#f1f5f9; color:#64748b; }
.ellipsisBtn {
  width: 34px; height: 34px; border: 1px solid #e2e8f0; border-radius: 9px;
  background:#fff; color:#475569; font-size:18px; cursor:pointer;
}
.contractDetailRow td { background:#f8fafc; padding:0; }
.contractDetailPanel { padding:16px 20px 18px; }
.contractDetailFacts {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.contractDetailFacts > div {
  padding:11px 12px;
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:10px;
}
.contractDetailFacts > div.wide { grid-column:span 2; }
.contractDetailFacts span { display:block; font-size:10px; color:#94a3b8; margin-bottom:4px; }
.contractDetailFacts strong { font-size:12px; color:#334155; font-weight:600; line-height:1.45; }
.contractDetailActions { display:flex; gap:8px; margin-top:12px; }

/* 수금 관리 */
.financePaneHead {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin: 4px 0 16px;
}
.financePaneHead h3 { margin:0; font-size:20px; }
.financePaneHead p { margin:5px 0 0; color:#64748b; font-size:12px; }
.yearStepNav,
.performanceHeadActions { display:flex; align-items:center; gap:8px; }
.yearStepNav button {
  width:34px;height:34px;border:1px solid #dbe3ee;border-radius:9px;background:#fff;cursor:pointer;
}
.yearStepNav strong { min-width:72px; text-align:center; }
.collectionSummaryGrid { grid-template-columns:repeat(4,minmax(0,1fr)); }
.summarySub { color:#94a3b8; font-size:11px; margin-top:5px; }
.collectionBlue { color:#2563eb; }
.financeSectionCard {
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:18px;
  margin-top:14px;
  box-shadow:0 6px 20px rgba(15,23,42,.04);
}
.financeSectionHead {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.financeSectionHead h4 { margin:0; font-size:15px; }
.financeSectionHead p { margin:4px 0 0; color:#64748b; font-size:11px; }
.collectionActionTable { border:1px solid #e2e8f0; border-radius:12px; overflow:hidden; }
.collectionActionHead,
.collectionActionRow {
  display:grid;
  grid-template-columns: minmax(240px,1.8fr) .55fr .8fr .65fr .8fr .75fr;
  gap:12px;
  align-items:center;
  padding:11px 13px;
}
.collectionActionHead { background:#f8fafc; color:#64748b; font-size:11px; font-weight:700; }
.collectionActionRow { border-top:1px solid #eef2f7; font-size:12px; }
.collectionProjectName { font-weight:700; color:#0f172a; }
.collectionActionText { font-size:11px; font-weight:700; }
.collectionActionText.done { color:#94a3b8; }
.collectionActionText.requested { color:#4338ca; }
.collectionActionText.need,.collectionActionText.danger { color:#be123c; }
.collectionActionText.planned { color:#c2410c; }
.collectionLegend { display:flex; align-items:center; gap:6px; font-size:10px; color:#64748b; }
.collectionLegend span { width:8px;height:8px;border-radius:2px;margin-left:7px; }
.collectionLegend span.contract { background:#cbd5e1; }
.collectionLegend span.received { background:#10b981; }
.collectionLegend span.pending { background:#f59e0b; }
.mcFlowChart {
  display:grid;
  grid-template-columns:repeat(12,minmax(34px,1fr));
  gap:10px;
  height:220px;
  padding:16px 6px 4px;
  border-top:1px solid #f1f5f9;
  border-bottom:1px solid #f1f5f9;
}
.mcFlowMonth { display:flex; flex-direction:column; justify-content:flex-end; align-items:center; min-width:0; }
.mcFlowMonth strong { font-size:10px; color:#64748b; margin-top:6px; }
.mcFlowMonth.focus strong { color:#3730a3; font-weight:800; }
.mcFlowBars { height:170px; width:100%; display:flex; align-items:flex-end; justify-content:center; gap:3px; }
.mcFlowBars i { width:22%; max-width:16px; min-height:2px; border-radius:4px 4px 1px 1px; display:block; }
.mcFlowBars i.contract { background:#cbd5e1; }
.mcFlowBars i.received { background:#10b981; }
.mcFlowBars i.pending { background:#f59e0b; }
.monthlyDetailDisclosure { margin-top:12px; }
.monthlyDetailDisclosure > summary,
.performanceEvidenceDetails > summary {
  cursor:pointer;
  color:#4338ca;
  font-size:12px;
  font-weight:700;
  padding:8px 0;
}
.collectionMonthDetail { border-top:1px solid #eef2f7; }
.collectionMonthDetail > summary {
  display:grid;
  grid-template-columns:.5fr 1fr 1fr 1fr;
  gap:10px;
  padding:11px 8px;
  cursor:pointer;
  font-size:11px;
  color:#475569;
}
.collectionMonthDetailBody { padding:0 8px 10px; }
.collectionMonthlyItem {
  display:grid;
  grid-template-columns:1fr 120px 90px;
  gap:10px;
  align-items:center;
  padding:8px 10px;
  background:#f8fafc;
  border-radius:8px;
  margin-top:5px;
  font-size:11px;
}
.collectionMonthlyItem em { font-style:normal; color:#64748b; }

/* 성과금 산정 */
.performanceHeadActions select { min-height:38px; border:1px solid #dbe3ee; border-radius:9px; background:#fff; }
.perfCalcFlow {
  display:grid;
  grid-template-columns:minmax(140px,1fr) 30px minmax(140px,1fr) 30px minmax(140px,1fr) 30px minmax(90px,.7fr) 30px minmax(160px,1.15fr);
  gap:8px;
  align-items:stretch;
}
.perfCalcNode {
  border:1px solid #e2e8f0;
  border-radius:12px;
  background:#f8fafc;
  padding:13px;
  min-width:0;
}
.perfCalcNode span { display:block; color:#64748b; font-size:10px; margin-bottom:6px; }
.perfCalcNode strong { display:block; color:#0f172a; font-size:14px; word-break:break-all; }
.perfCalcNode.result { background:#eef2ff; border-color:#c7d2fe; }
.perfCalcNode.result strong { color:#4338ca; font-size:16px; }
.perfCalcOperator { display:flex; align-items:center; justify-content:center; font-weight:800; color:#94a3b8; }
.criteriaEditPanel {
  margin-top:14px;
  padding:14px;
  background:#f8fafc;
  border:1px dashed #cbd5e1;
  border-radius:12px;
}
.criteriaActions { display:flex; align-items:center; gap:8px; margin-top:10px; }
.perfPoolBreakdown {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}
.perfPoolBreakdown > div {
  border:1px solid #e2e8f0;
  border-radius:10px;
  padding:11px 12px;
}
.perfPoolBreakdown > div.primary { background:#f5f3ff; border-color:#ddd6fe; }
.perfPoolBreakdown span { display:block; color:#64748b; font-size:10px; margin-bottom:5px; }
.perfPoolBreakdown strong { font-size:13px; color:#0f172a; }
.perfPoolBreakdown .primary strong { color:#5b21b6; }
.allocationProgressWrap { margin-bottom:14px; }
.allocationProgressText { display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:12px; }
.allocationWarning { font-size:11px; font-weight:700; }
.allocationWarning.pending { color:#c2410c; }
.allocationWarning.over { color:#be123c; }
.allocationWarning.complete { color:#047857; }
.allocationProgressTrack { height:8px; border-radius:999px; background:#e2e8f0; overflow:hidden; margin-top:7px; }
.allocationProgressBar { height:100%; width:0; background:#6366f1; border-radius:inherit; transition:width .18s ease; }
.allocationProgressBar.complete { background:#10b981; }
.allocationProgressBar.over { background:#ef4444; }
.performanceSimpleTable th,
.performanceSimpleTable td { vertical-align:middle; }
.performanceSimpleTable .nameCell strong { display:block; }
.perfPosition { display:block; font-size:10px; color:#94a3b8; margin-top:2px; }
.perfScoreInput,
.perfAllocInput { display:inline-flex; align-items:center; gap:4px; }
.perfScoreInput input,
.perfAllocInput input { width:64px; }
.perfScoreInput span,
.perfAllocInput span { color:#94a3b8; font-size:10px; }
.perfAmountValue { color:#4338ca; white-space:nowrap; }
.performanceEvidenceDetails {
  margin-top:14px;
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:14px;
  padding:0 16px;
}
.performanceEvidenceBody { padding:4px 0 16px; }
.performanceEvidenceBody h4 { font-size:13px; margin:14px 0 8px; }
.perfEvidenceTable { border:1px solid #e2e8f0; border-radius:10px; overflow:hidden; }
.perfEvidenceHead,
.perfEvidenceRow {
  display:grid;
  grid-template-columns:1.2fr 1fr .8fr .8fr;
  gap:10px;
  align-items:center;
  padding:9px 11px;
  font-size:11px;
}
.perfEvidenceHead { background:#f8fafc; color:#64748b; font-weight:700; }
.perfEvidenceRow { border-top:1px solid #eef2f7; }
.perfProjectEvidence { border:1px solid #e2e8f0; border-radius:10px; margin-top:8px; overflow:hidden; }
.perfProjectEvidence > summary { display:flex; justify-content:space-between; gap:12px; cursor:pointer; padding:11px 12px; font-size:12px; font-weight:700; background:#f8fafc; }
.perfProjectEvidenceBody { padding:10px 12px 12px; }
.perfProjectEvidenceActions { display:flex; gap:7px; align-items:center; margin-bottom:8px; }
.perfProjectParticipantRow { display:grid; grid-template-columns:1fr 150px 130px; gap:10px; align-items:center; padding:7px 0; border-top:1px solid #f1f5f9; font-size:11px; }
.perfProjectParticipantRow input { width:58px; }

@media (max-width: 1200px) {
  .perfCalcFlow { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .perfCalcOperator { display:none; }
  .collectionActionHead,
  .collectionActionRow { grid-template-columns:minmax(220px,1.5fr) .5fr .8fr .7fr .8fr; }
  .collectionActionHead span:last-child,
  .collectionActionRow span:last-child { display:none; }
}

@media (max-width: 900px) {
  .contractListToolbar,
  .financePaneHead { align-items:stretch; flex-direction:column; }
  .contractListActions { justify-content:flex-end; }
  .collectionSummaryGrid,
  .perfPoolBreakdown { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .mcFlowChart { overflow-x:auto; grid-template-columns:repeat(12,58px); }
  .perfCalcFlow { grid-template-columns:1fr 1fr; }
  .contractDetailFacts { grid-template-columns:1fr 1fr; }
}
