.coPage{display:flex;flex-direction:column;gap:18px;max-width:1800px;margin:0 auto;padding:10px 0 28px;color:var(--text,#f5fbf8);animation:coEnter .22s ease-out}
.coHeader,.coDetailHead,.coDetailHeading,.coActions,.coFilters,.coTabs{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.coHeader,.coDetailHead{justify-content:space-between}.coHeader h2,.coDetailHeading h2{font-size:22px;font-weight:750;margin:0;letter-spacing:-.02em}
.coMuted{font-size:12px;color:var(--muted,#a4b4ad);line-height:1.45}
.coLoading{min-height:200px;display:flex;align-items:center;justify-content:center;color:var(--muted,#9daaa4)}
.coStats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.coMetric{display:flex;flex-direction:column;gap:4px;min-width:0}
.coStats>.coMetric{border:1px solid var(--stroke,#41564d);border-radius:14px;padding:16px 18px;background:var(--bg2,#1d3028)}
.coMetric strong{font-size:20px;font-variant-numeric:tabular-nums;overflow:hidden;text-overflow:ellipsis}
.coFilters{justify-content:space-between}.coFilters>.coInput{min-width:240px;max-width:400px;flex:1}
.coTabs{background:var(--bg2,rgba(255,255,255,.04));border-radius:12px;padding:4px;width:max-content}
.coBtn{padding:9px 13px;border:1px solid var(--stroke,rgba(255,255,255,.15));border-radius:10px;cursor:pointer;background:rgba(255,255,255,.055);color:var(--text,#fff);font:inherit;font-weight:600;font-size:13px;transition:background .16s,box-shadow .16s,transform .16s}
.coBtn:hover{background:rgba(147,201,164,.16);transform:translateY(-1px)}
.coBtn:focus-visible,.coInput:focus-visible{outline:2px solid #42bb92;outline-offset:1px}
.coBtn.primary{background:#187e60;border-color:#1d916d;color:#fff}
.coBtn.active{background:#136a52;border-color:#2da981;color:#fff}
.coBtn.danger{background:#702b36;border-color:#a8464f;color:#fff}
.coBtn.ghost{background:transparent}
.coBtn:disabled{opacity:.5;cursor:wait}
.coInput{background:var(--bg2,#1c2b25);border:1px solid var(--stroke,#526359);border-radius:10px;color:var(--text,#fff);padding:10px;font:inherit;box-sizing:border-box}
.coBoardScroll{display:grid;grid-template-columns:repeat(6,minmax(240px,1fr));gap:10px;overflow:auto;max-height:calc(100dvh - 275px);min-height:400px;scrollbar-width:thin;align-items:start}
.coColumn{border:1px solid var(--stroke,rgba(255,255,255,.13));background:var(--bg2,#1b2922);min-height:310px;border-radius:14px;overflow:hidden}
.coColumnHead{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;padding:14px 12px;border-bottom:1px solid var(--stroke,rgba(255,255,255,.1));background:var(--bg2,#1b2922);font-size:13px}
.coCount{font-size:12px;border-radius:12px;background:rgba(125,172,153,.16);padding:2px 9px}
.coColumnBody{padding:8px;display:flex;flex-direction:column;gap:9px}
.coKanbanCard{display:flex;flex-direction:column;gap:7px;text-align:left;cursor:pointer;width:100%;padding:14px;background:var(--bg,#15211c);color:var(--text,#fff);border:1px solid var(--stroke,#526259);border-radius:12px;transition:transform .14s,border .14s,box-shadow .14s}
.coKanbanCard:hover{transform:translateY(-2px);border-color:#39a77f;box-shadow:0 6px 18px rgba(0,0,0,.13)}
.coCompany{font-size:14px;word-break:break-word}.coCardSub{font-size:12px;color:var(--muted,#adbbb4)}
.coCardMoney{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:8px 0;border-top:1px solid var(--stroke,#526259);border-bottom:1px solid var(--stroke,#526259)}
.coCardMoney strong{font-size:13px}
.coCardFooter{display:flex;justify-content:space-between;gap:6px;color:var(--muted,#adc0b5);font-size:11px}
.coPill{padding:5px 10px;border-radius:18px;background:rgba(93,169,136,.16);color:#8af6bd;font-size:12px}
.coPill.overdue,.coPill.problem{background:rgba(210,87,77,.12);color:#f9a6a6}
.coPill.partial{background:rgba(214,158,68,.14);color:#ffd289}
.coDetail{max-width:1460px}
.coDetailHead{padding-bottom:14px;border-bottom:1px solid var(--stroke,#526259)}
.coDetailHeading{flex-wrap:wrap}.coDetailHeading h2{max-width:540px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.coDetailContent{min-height:500px}.coDetailGrid{display:grid;grid-template-columns:minmax(0,2fr) minmax(270px,.85fr);gap:16px}
.coDetailMain,.coDetailAside{display:flex;flex-direction:column;gap:16px;min-width:0}
.coSection{border:1px solid var(--stroke,#435148);border-radius:16px;background:var(--bg2,rgba(255,255,255,.035));padding:18px;min-width:0}
.coSection h3{margin:0 0 14px;font-size:16px;font-weight:700}
.coFinancial{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.coFinancial .coMetric{background:rgba(140,172,147,.07);padding:14px;border-radius:10px}
.coInfoGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 12px}
.coInfoGrid strong{font-size:14px;word-wrap:break-word}
.coItems{display:flex;flex-direction:column;gap:6px}
.coLine{border:1px solid var(--stroke,#526259);border-radius:8px;padding:10px;font-size:13px}
.coNoteArea{display:flex;flex-direction:column;gap:10px}
.coNote{background:rgba(132,172,154,.09);border-radius:10px;padding:10px;font-size:13px;line-height:1.45;white-space:pre-wrap}
.coNoteArea textarea{min-height:90px;resize:vertical}
.coHistory{max-width:1000px;display:flex;flex-direction:column;gap:12px}
.coEvent{border:1px solid var(--stroke,#526259);background:var(--bg2,rgba(255,255,255,.035));padding:15px;border-radius:13px}
.coEventTop{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:13px}
.coEventTop time{color:var(--muted,#afc0b6);font-size:12px}
.coEventType{font-size:12px;color:#73bf9c;margin-top:5px}
.coEvent p{white-space:pre-wrap;font-size:13px;margin:10px 0}
.coEventDiff{display:flex;gap:10px;flex-wrap:wrap}
.coEventDiff pre{overflow:auto;font-size:11px;white-space:pre-wrap;background:rgba(0,0,0,.14);padding:9px;border-radius:8px;max-width:100%}
.coOverlay{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.68);display:flex;align-items:center;justify-content:center;padding:18px;backdrop-filter:blur(6px)}
.coDialog{max-height:95dvh;overflow-y:auto;width:min(480px,100%);border:1px solid var(--stroke,#526259);background:var(--bg2,#162920);border-radius:17px;padding:22px;box-shadow:0 22px 64px rgba(0,0,0,.32)}
.coDialog h3{font-size:19px;margin:0 0 16px}.coForm{display:flex;flex-direction:column;gap:12px}
.coField{display:flex;flex-direction:column;gap:7px;font-size:13px}
.coField input,.coField textarea,.coField select{width:100%}
.coDialogActions{display:flex;justify-content:flex-end;gap:8px;padding-top:6px}
@keyframes coEnter{from{opacity:.75;transform:translateY(5px)}to{opacity:1;transform:none}}
@media(max-width:1150px){.coBoardScroll{grid-template-columns:repeat(6,250px);max-height:none}.coDetailGrid{grid-template-columns:1fr}.coFinancial{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.coHeader h2,.coDetailHeading h2{font-size:19px}.coStats{grid-template-columns:repeat(3,1fr);gap:6px}.coStats>.coMetric{padding:10px}.coStats .coMetric strong{font-size:19px}.coBoardScroll{grid-template-columns:repeat(6,82vw)}.coInfoGrid{grid-template-columns:1fr}.coDetailHead{align-items:start}.coDetailHeading h2{width:100%}.coActions{width:100%}.coActions .coBtn{flex:1}}
@media(prefers-reduced-motion:reduce){.coPage{animation:none}.coBtn,.coKanbanCard{transition:none}}
.coConfigPane{max-width:940px;display:flex;flex-direction:column;gap:18px}
.coConfigGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.coConfigParts{display:flex;flex-direction:column;gap:12px}
.coConfigPart{display:grid;grid-template-columns:1.4fr 1fr 1fr auto;gap:10px;align-items:end;background:rgba(122,177,152,.07);border:1px solid var(--stroke,rgba(255,255,255,.15));padding:14px;border-radius:12px}
.coCheckbox{display:flex;gap:10px;align-items:center;flex-direction:row-reverse;justify-content:flex-end;font-size:15px;font-weight:700}
.coCheckbox input{width:21px;height:21px;accent-color:#24a57d}
@media(max-width:800px){.coConfigGrid{grid-template-columns:1fr 1fr}.coConfigPart{grid-template-columns:1fr 1fr}}
@media(max-width:540px){.coConfigGrid,.coConfigPart{grid-template-columns:1fr}}

.coAdvance{font-size:12px;font-weight:650;color:#66daa4}
.coReceiptRow{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}

/* A fully paid obligation stays clickable but occupies only one compact row. */
.coKanbanCard.coPaidCompact{padding:9px 10px;gap:0;min-height:38px;justify-content:center}
.coPaidRow{display:flex;align-items:center;gap:7px;min-width:0;width:100%;white-space:nowrap}
.coPaidName{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:12px;font-weight:750}
.coPaidPeriod{flex:0 0 auto;color:var(--muted,#a4b4ad);font-size:10px;white-space:nowrap}
.coPaidAmount{flex:0 0 auto;font-size:11px;font-variant-numeric:tabular-nums;color:var(--text,#fff);white-space:nowrap}
.coKanbanCard.coPaidCompact:focus-visible{outline:2px solid #42bb92;outline-offset:2px}
/* Collections issue log: multiline optional reason and inline resolution. */
.coIssueRow{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
.coIssueContent{display:flex;flex-direction:column;gap:5px;flex:1 1 auto;min-width:0}
.coIssueReason{font-size:13px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}
.coIssueRow .coBtn{flex:0 0 auto}
@media(max-width:540px){.coIssueRow{align-items:flex-start;flex-wrap:wrap}.coIssueRow .coBtn{width:100%}}

/* Subtle status cues: the body remains neutral for readability. */
.coColumn[data-status="overdue"]{--co-stage-rgb:239,106,112}
.coColumn[data-status="due"]{--co-stage-rgb:235,194,91}
.coColumn[data-status="planned"]{--co-stage-rgb:109,166,241}
.coColumn[data-status="partial"]{--co-stage-rgb:174,140,233}
.coColumn[data-status="problem"]{--co-stage-rgb:244,158,91}
.coColumn[data-status="paid"]{--co-stage-rgb:98,200,142}
.coColumn[data-status] .coColumnHead{
  background:linear-gradient(90deg,rgba(var(--co-stage-rgb),.12),rgba(var(--co-stage-rgb),.035)),var(--bg2,#1b2922);
  box-shadow:inset 3px 0 0 rgb(var(--co-stage-rgb));
  border-bottom-color:rgba(var(--co-stage-rgb),.25);
}
.coColumn[data-status] .coColumnHead b{color:var(--text,#f4fbf7)}
.coColumn[data-status] .coCount{
  color:rgb(var(--co-stage-rgb));
  background:rgba(var(--co-stage-rgb),.13);
  border:1px solid rgba(var(--co-stage-rgb),.18);
  font-weight:700;
}

/* Payment receipt attachments and FX conversion: quiet, readable inline feedback. */
.coFileStatus{display:block;color:var(--muted,#a4b4ad);font-size:12px;line-height:1.45;overflow-wrap:anywhere}
.coFileStatus:not(:empty){color:#9de0bd}
.coPaymentHint{display:block;color:var(--muted,#a4b4ad);font-size:12px;line-height:1.45;margin-top:1px;overflow-wrap:anywhere}
.coPaymentHint:not(:empty){border-left:2px solid #67aa91;padding-left:9px}
/* Payment contact: single source of truth on project, shown alongside collection details. */
.coPaymentContact{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0}
.coPaymentContact strong{font-size:14px;overflow-wrap:anywhere}
.coPaymentContact .coPaymentPhone{color:var(--text,#f5fbf8);text-decoration:underline;text-underline-offset:3px;font-size:13px}
.coPaymentContact .coMuted{flex:1 1 200px}
.coPaymentContact .coBtn{font-size:12px;padding:7px 10px}
@media(max-width:640px){.coPaymentContact{align-items:flex-start;flex-direction:column}.coPaymentContact .coBtn{width:100%}}
