/* Public and Finance billing views share the supplied management mockup tokens. */

.cp-modal label { font-size:12px; font-weight:600; color:var(--ink-mid); }
.cp-modal input:not([type=checkbox]),.cp-modal select,.cp-modal textarea,.cp-account input,.cp-search { width:100%; padding:8px 10px; border:1px solid var(--border-dark); border-radius:var(--radius-sm); background:var(--surface); color:var(--ink); font:inherit; font-size:13px; }

.cp-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }

.cp-amount { font-size:28px; font-weight:700; line-height:1.3; letter-spacing:-.5px; color:var(--ink); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }

.cp-info { padding:16px 18px; border:1px solid var(--border); border-radius:var(--radius); color:var(--ink-light); font-size:13px; line-height:1.65; }
.cp-info strong { color:var(--ink-mid); }
.cp-info p { margin:4px 0 0; }

.cp-rfi-total { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:16px 0; }
.cp-lines { border-top:1px solid var(--border); margin-top:4px; }
.cp-line { display:flex; justify-content:space-between; gap:22px; padding:10px 0; border-bottom:1px solid var(--border); }
.cp-line > div { min-width:0; overflow-wrap:anywhere; }
.cp-line strong { white-space:nowrap; font-variant-numeric:tabular-nums; }
.cp-match { margin:14px 0; padding:10px 12px; background:var(--orange-pale); border-radius:var(--radius-sm); color:var(--orange-dark); font-size:13px; }
.cp-profile-page { max-width:680px; margin:36px auto; padding:0 24px; font-size:14px; line-height:1.5; }
.cp-profile-page .ui-crumbs { margin-bottom:6px; color:var(--ink-light); font-size:12px; }
.cp-profile-page .ui-pagebar { margin-bottom:24px; }
.cp-profile-card { padding:0; overflow:hidden; }
.cp-profile-body { padding:24px; }
.cp-profile-body h2 { margin-bottom:24px; }
.cp-profile-body .field { margin-bottom:20px; }
.cp-profile-body .field:last-child { margin-bottom:0; }
.cp-profile-body label { display:block; margin-bottom:7px; font-size:12px; font-weight:600; }
.cp-profile-body input { width:100%; padding:10px 12px; border:1px solid var(--border-dark); border-radius:var(--radius-sm); background:white; color:var(--ink); font:inherit; font-size:13px; }
.cp-profile-body input:focus { outline:2px solid var(--orange); outline-offset:2px; }
.cp-profile-body .ui-small { margin:8px 0 0; }
@media(max-width:580px) { .cp-profile-page { margin:24px auto; padding:0 16px; } .cp-profile-body { padding:20px; } .cp-profile-body .ui-grid { grid-template-columns:1fr; gap:0; } }
.cp-modal { width:min(560px,calc(100vw - 32px)); font-size:14px; }
.cp-modal.cp-modal-wide { width:min(700px,calc(100vw - 32px)); }
.cb-batch-table .ui-text-button { display:block; margin-top:6px; }
@media(max-width:580px) {
  .cp-modal .cb-batch-table { display:block; min-width:0; }
  .cb-batch-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
  .cb-batch-table tbody { display:block; border-bottom:1px solid var(--border); }
  .cb-batch-table tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:8px; }
  .cp-modal .cb-batch-table td { display:block; border:0; padding:8px; text-align:left; min-width:0; white-space:normal; }
  .cb-batch-table td[data-label]::before { content:attr(data-label); display:block; margin-bottom:5px; color:var(--ink-light); font-size:10px; font-weight:600; text-transform:uppercase; }
  .cb-batch-table td[data-label=Client], .cb-batch-table td[colspan] { grid-column:1/-1; }
}
.cp-modal label { display:block; margin-bottom:5px; }
.cp-modal .cp-form-field { margin-bottom:16px; }
.cp-modal .ui-grid { gap:12px; }
.cp-modal textarea { min-height:84px; resize:vertical; }
.cp-modal .cp-checkbox { display:flex; gap:9px; align-items:flex-start; font-size:13px; line-height:1.5; }
.cp-checkbox input { flex:0 0 auto; margin:3px 0 0; accent-color:var(--orange); }
.cp-modal input:focus,.cp-modal select:focus,.cp-modal textarea:focus,.cp-search:focus { outline:2px solid var(--orange); outline-offset:1px; }
.cp-modal .cp-info { margin-bottom:16px; }
.cp-modal .cp-edit-line { display:grid; grid-template-columns:1fr 135px 28px; gap:8px; margin-bottom:10px; align-items:end; }
.cp-edit-line textarea { grid-column:1/-1; min-height:50px; }
.cp-modal .cp-remove { border:0; background:none; font-size:20px; cursor:pointer; color:var(--ink-light); padding:4px; }
.cp-modal .cp-remove:hover { color:var(--red); }
.cp-search { max-width:300px; margin-bottom:12px; }

.cp-content a.btn-ghost,.cp-modal a.btn-ghost { display:inline-flex; text-decoration:none; align-items:center; justify-content:center; }
.cp-content .ui-table td { max-width:340px; overflow-wrap:anywhere; }
.cp-content .ui-table .ui-small { white-space:normal; }

@media (max-width:580px) {

  .cp-rfi-total { align-items:flex-start; flex-direction:column; }
  .cp-actions { width:100%; }
  .cp-actions .btn-ghost,.cp-actions .btn-primary { flex:1; text-align:center; }
  .cp-modal .ui-grid { grid-template-columns:1fr; }
  .cp-modal .cp-edit-line { grid-template-columns:1fr 100px 24px; }
  .cp-modal .ui-modal-footer { flex-wrap:wrap; }

  .cp-content .ui-card-head { flex-wrap:wrap; }
}

.cp-modal-wide .ui-facts { grid-template-columns:195px minmax(0,1fr); }
@media(max-width:580px) { .cp-modal-wide .ui-facts { grid-template-columns:1fr; gap:3px; } .cp-modal-wide .ui-facts dd { margin-bottom:9px; } }

@media(max-width:760px) {
  .cp-staff-shell .header { display:grid; grid-template-columns:auto 1fr; height:auto; min-height:56px; padding:6px 16px; gap:6px 12px; }
  .cp-staff-shell .header-right { display:contents; }
  .cp-staff-shell .header-user { grid-column:2; grid-row:1; justify-self:end; }

}

.ui-cardbar > .styled-dropdown { width:150px; }
.cp-dropzone { display:flex; flex-direction:column; align-items:center; gap:10px; padding:22px 18px; border:1.5px dashed var(--border-dark); border-radius:var(--radius-sm); background:var(--surface-warm); text-align:center; transition:background .15s,border-color .15s; }
.cp-dropzone svg { color:var(--orange); }
.cp-dropzone { width:100%; color:var(--ink); font:inherit; cursor:pointer; }
.cp-dropzone:focus-visible { outline:2px solid var(--orange); outline-offset:3px; }
.cp-dropzone:disabled { cursor:wait; opacity:.8; }
.cp-dropzone strong { max-width:100%; overflow-wrap:anywhere; font-size:13px; }
.cp-dropzone-active { border-color:var(--orange); background:var(--orange-pale); }
.cp-dropzone-filled { border-color:var(--green); background:var(--green-pale); }
.cp-dropzone-filled svg { color:var(--green); }
@media(max-width:580px) { .cp-dropzone { padding:18px 12px; } }
/* Keep dialog actions visible while longer review forms scroll. */
.cp-modal { display:flex; flex-direction:column; max-height:calc(100dvh - 120px); }
.cp-modal > form { display:flex; flex:1 1 auto; flex-direction:column; min-height:0; overflow:hidden; }
.cp-modal .ui-modal-header,.cp-modal .ui-modal-footer { flex-shrink:0; }
.cp-modal .ui-modal-body { min-height:0; overflow-y:auto; }
@media(max-width:760px) { .cp-modal { max-height:calc(100dvh - 40px); } }
.cp-responsive-table { min-width:780px; }
@media(max-width:580px) {
  .cp-content .cp-responsive-table { min-width:0; display:block; }
  .cp-responsive-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
  .cp-responsive-table tbody { display:block; }
  .cp-responsive-table tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:8px; border-bottom:1px solid var(--border); }
  .cp-responsive-table tr:last-child { border-bottom:0; }
  .cp-content .cp-responsive-table td { display:block; border:0; padding:8px; text-align:left!important; max-width:none; min-width:0; white-space:normal; }
  .cp-responsive-table td[data-label]::before { content:attr(data-label); display:block; margin-bottom:5px; color:var(--ink-light); font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.4px; }
  .cp-responsive-table td[data-label=Actions] { grid-column:1/-1; display:flex; gap:8px; }
  .cp-responsive-table td[data-label=Actions]::before { display:none; }
  .cp-responsive-table td[data-label=Actions] button { flex:1; }
  .cp-responsive-table td[colspan] { grid-column:1/-1; }
}

/* Customer-only compositions. Shared ui-* components live in portal.css. */
.cp-account { position:relative; margin-bottom:6px; padding-bottom:10px; border-bottom:1px solid var(--border); }
.cp-account-btn,.cp-account-label { display:flex; align-items:center; gap:10px; width:100%; padding:8px 10px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); color:var(--ink); font:inherit; font-weight:600; text-align:left; }
.cp-account-btn { cursor:pointer; }
.cp-account-btn:hover { background:var(--surface-warm); }
.cp-account-label { border-color:transparent; }
.cp-avatar { display:grid; place-items:center; flex:none; width:28px; height:28px; border-radius:var(--radius-sm); background:var(--orange-pale); color:var(--orange-dark); font-size:11px; font-weight:700; }
.cp-account-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cp-nav-count { margin-left:auto; min-width:18px; padding:0 6px; border-radius:99px; background:var(--amber-pale); color:var(--amber); font-size:11px; font-weight:700; line-height:18px; text-align:center; }

.cp-loading { margin-bottom:16px; color:var(--ink-light); font-size:12px; }
.cp-split { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:16px; }
.cp-split > .ui-card { display:flex; flex-direction:column; }
.cp-sum { flex:1; margin:0 -18px; }
.cp-sum-row { display:flex; align-items:center; gap:14px; width:100%; padding:13px 18px; border:0; border-top:1px solid var(--border); background:none; color:var(--ink); font:inherit; text-align:left; text-decoration:none; }
.cp-sum-row > div { flex:1; min-width:0; }
.cp-sum-row strong { font-size:15px; font-variant-numeric:tabular-nums; white-space:nowrap; }
:is(button, a).cp-sum-row { cursor:pointer; }
:is(button, a).cp-sum-row:hover { background:var(--surface-warm); }
.cp-sum-go { color:var(--ink-faint); font-size:16px; width:10px; }
.cp-sum-total { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin:0 -18px -18px; padding:16px 18px; border-top:1px solid var(--border-dark); border-radius:0 0 var(--radius) var(--radius); background:var(--surface-warm); }
.cp-track { list-style:none; margin:0; padding:0; }
.cp-track + .cp-track { margin-top:20px; padding-top:20px; border-top:1px solid var(--border); }
.cp-track li { position:relative; padding:0 0 18px 28px; }
.cp-track li:last-child { padding-bottom:0; }
.cp-track li::before { content:""; position:absolute; left:0; top:3px; width:14px; height:14px; border:2px solid var(--border-dark); border-radius:50%; background:var(--surface); }
.cp-track li::after { content:""; position:absolute; left:6px; top:19px; bottom:-1px; width:2px; background:var(--border); }
.cp-track li:last-child::after { display:none; }
.cp-track li.done::before { border-color:var(--green); background:var(--green); }
.cp-track li.done::after { background:var(--green); }
.cp-track li.current::before { border-color:var(--orange); box-shadow:0 0 0 3px var(--orange-pale); }
.cp-track li.todo { color:var(--ink-light); }
.cp-track strong { display:block; font-weight:600; }
.cp-track .ui-actions { margin-top:10px; }
.cp-selected-row td { background:var(--surface-warm); }
.cp-history-table { min-width:800px; table-layout:fixed; }
.cp-history-period { width:24%; }
.cp-history-amount { width:18%; }
.cp-history-status { width:22%; }
.cp-history-table .ui-num { overflow-wrap:anywhere; }
.cp-history-hint { margin:0 0 14px; }
.cp-year-row { cursor:pointer; }
.cp-year-toggle { padding:0; border:0; background:none; color:var(--ink); font:inherit; font-weight:600; cursor:pointer; }
.cp-year-row:hover .cp-year-toggle { color:var(--orange); }
.cp-history-table .cp-year-row:focus-within td { background:var(--surface-warm); }
.cp-year-toggle:focus-visible { outline:2px solid var(--orange); outline-offset:3px; }
.cp-year-month > td:first-child { padding-left:28px; }
.cp-performance-table { --table-min-width:800px; min-width:800px; }
.cp-performance-table th:first-child { width:46%; }
.cp-performance-table th:not(:first-child) { width:18%; }
.cp-adsales-table { min-width:880px; font-size:13px; }
.cp-adsales-table .order-regelitem-cell { min-width:200px; }
.cp-adsales-table .order-regelitem-order { padding:0; border:0; border-radius:0; background:none; color:var(--ink); font-weight:400; }
.cp-adsales-table .order-regelitem-extra { color:var(--ink-light); font-size:12px; }
.cp-portal .ui-table .ui-sort { letter-spacing:inherit; text-transform:inherit; }
.cp-portal .ui-table td:first-child { max-width:340px; overflow-wrap:anywhere; }
.cp-entity { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:20px 40px; margin:10px 0 18px; padding-bottom:18px; border-bottom:1px solid var(--border); }
.cp-entity h2 { margin:2px 0; font-size:18px; overflow-wrap:anywhere; }
.cp-detail-metrics { display:flex; flex-wrap:wrap; gap:16px 36px; }
.cp-detail-metrics > div { display:flex; flex-direction:column; gap:3px; }
.cp-detail-metrics strong { font-size:20px; font-variant-numeric:tabular-nums; }
.cp-overlap { margin-bottom:12px; }
.cp-pending h2 { margin-top:14px; }
.cp-rfi { margin-bottom:8px; padding:0; overflow:hidden; }
.cp-rfi-row { display:flex; align-items:center; flex-wrap:wrap; gap:14px; padding:14px 18px; }
.cp-rfi-toggle { display:flex; align-items:center; gap:12px; flex:1 1 220px; min-width:0; padding:0; border:0; background:none; color:var(--ink); font:inherit; cursor:pointer; text-align:left; }
.cp-chev { flex:none; color:var(--ink-light); font-size:11px; transition:transform .15s; }
.cp-rfi[data-open=true] .cp-chev { transform:rotate(90deg); }
.cp-rfi-amount { min-width:120px; text-align:right; font-size:15px; font-weight:700; font-variant-numeric:tabular-nums; }
.cp-rfi-status { min-width:190px; }
.cp-rfi-row .ui-actions { min-width:214px; justify-content:flex-end; }
.cp-rfi-body { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,3fr); gap:24px; padding:18px; border-top:1px solid var(--border); background:var(--surface-warm); }
.cp-rfi-body h3 { margin:0 0 8px; color:var(--ink-light); font-size:11px; font-weight:600; letter-spacing:.4px; text-transform:uppercase; }
.cp-rfi-body .ui-table-wrap { margin:0; }
.cp-rfi-body .ui-table { min-width:520px; font-size:13px; }
.cp-line-total { border-bottom:0; }
.cp-hint { padding:12px 14px; border:1px dashed var(--border-dark); border-radius:var(--radius-sm); background:var(--surface); color:var(--ink-light); font-size:13px; }
.cp-block { display:block; }
@media (max-width:1000px) { .cp-split,.cp-rfi-body { grid-template-columns:1fr; } }
@media (max-width:900px) {
  .cp-account { flex:1 0 100%; margin:0; padding-bottom:8px; }
  .cp-nav-count { margin-left:8px; }
}
@media (max-width:580px) {
  .cp-rfi-amount,.cp-rfi-status { min-width:0; text-align:left; }
  .cp-rfi-row .ui-actions { width:100%; min-width:0; }
  .cp-rfi-row .ui-actions > * { flex:1; text-align:center; }
  .ui-pagination { flex-wrap:wrap; }
}
/* Compatibility for staff tables that have not adopted portal.css yet. */
