.team-finance { --cf-ink:#193347; --cf-border:#d9e5ed; --cf-soft:#eef5fa; --cf-accent:#1b6287; min-width:0; color:var(--cf-ink); }
.team-finance .cf-header,.cf-tabs,.cf-summary-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:14px; }
.team-finance .cf-header .toolbar { padding:0; margin:0; border:0; background:none; }
.cf-tabs { gap:6px; padding-bottom:8px; border-bottom:1px solid var(--cf-border); }
.cf-tabs button { min-height:40px; padding:8px 12px; }
.cf-tabs button[aria-pressed="true"] { background:var(--cf-soft); border-color:#a3c7dc; color:#124d70; font-weight:700; }
.cf-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:14px; }
.cf-metric { min-width:0; padding:17px; border:1px solid var(--cf-border); background:#fff; border-radius:10px; }
.cf-metric span { display:block; margin-bottom:7px; }
.cf-metric strong { font-size:clamp(18px,2.2vw,30px); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.cf-workbook { padding:12px; background:#fff; border:1px solid var(--cf-border); border-radius:10px; min-width:0; }
.cf-formula-bar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:10px; border:1px solid var(--cf-border); border-radius:6px; margin-bottom:10px; }
.cf-formula-bar code { flex:1; min-width:100px; overflow-wrap:anywhere; }
.cf-grid-wrap { max-width:100%; max-height:58dvh; overflow:auto; border:1px solid var(--cf-border); }
.cf-grid { width:max-content; min-width:100%; border-collapse:separate; border-spacing:0; table-layout:fixed; }
.cf-grid :is(td,th) { border:0; border-bottom:1px solid var(--cf-border); border-right:1px solid var(--cf-border); padding:0; }
.cf-grid th { background:#eaf1f6; min-width:38px; padding:6px; text-align:center; }
.cf-grid thead th { position:sticky; top:0; z-index:1; }
.cf-grid tbody th { position:sticky; left:0; z-index:1; }
.cf-grid thead th:first-child { left:0; z-index:2; }
.cf-grid td button { display:block; width:120px; min-height:35px; padding:4px 7px; border:0; border-radius:0; background:transparent; color:#193347; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cf-grid .cf-source { background:#ebf4fa; }
.cf-grid .cf-formula { background:#edf7ef; }
.cf-grid .cf-formula-error { background:#fdecea; }
.cf-grid td button[aria-pressed="true"] { outline:2px solid var(--cf-accent); outline-offset:-2px; background:#dceef9; }
.cf-dependencies { padding:12px 0; overflow-wrap:anywhere; }
.cf-parts fieldset { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:0 0 12px; padding:12px; border:1px solid #d9e5ed; border-radius:8px; }
@media (max-width: 760px) {
 .cf-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .cf-metric { padding:12px; }
 .cf-parts fieldset { grid-template-columns:minmax(0,1fr); }
 .cf-tabs button,.cf-grid td button { min-height:44px; }
}

.team-finance .cf-header .toolbar .muted { display:none; }
@media (max-width: 760px) {
 .team-finance .cf-section-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
 .team-finance .cf-section-tabs button { min-width:0; text-align:center; overflow-wrap:anywhere; }
 .team-finance .cf-sheet-tabs {
  display:flex;
  flex-wrap:nowrap;
  overflow-x:auto;
  scrollbar-width:thin;
 }
 .team-finance .cf-sheet-tabs button { flex:none; width:auto; white-space:nowrap; }
}

.team-finance .cf-tabs>button {
  width:auto;
  min-width:0;
  flex:0 0 auto;
  margin:0;
  text-align:center;
}
@media (max-width:760px) {
 .team-finance .cf-section-tabs>button { width:100%; }
}

.team-finance .cf-formula-bar input { min-width:130px; flex:1 1 220px; }
.cf-grid-edit-wrap { max-width:100%; max-height:55dvh; overflow:auto; margin-bottom:12px; }
.cf-grid-edit-wrap table { width:max-content; min-width:100%; border-spacing:0; }
.cf-grid-edit-wrap th { position:sticky; top:0; z-index:1; background:#edf4f9; }
.cf-grid-edit-wrap :is(th,td) { padding:5px; }
.cf-grid-edit-wrap :is(input,select) { box-sizing:border-box; min-width:125px; width:100%; min-height:40px; }
.cf-grid-edit-wrap :is(input,select):is([readonly],:disabled) { opacity:.75; background:#edf1f3; }
.team-finance .cf-sheet-tabs { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:thin; }
.team-finance .cf-sheet-tabs button { white-space:nowrap; }
.team-finance .cf-workbook { --cf-accent:#16664f; }
.cf-grid td[data-cf-selected] { background:#d6efe4; }
.cf-grid .cf-table-head { background:#c4e2d6; font-weight:700; }
.cf-grid .cf-table-stripe { background:#e8f5ef; }
.cf-grid .cf-table-body { background:#f6fbf8; }
.cf-grid-editor h2 { margin:0 0 12px; font-size:1.1rem; }
.cf-grid-editor .cf-grid-edit-wrap { border:1px solid var(--cf-border); }
.cf-grid-editor .cf-grid-edit-wrap tbody tr:nth-child(even) td { background:#f3f8fa; }
.cf-grid-editor .cf-grid-edit-wrap tbody th { left:0; }
.cf-grid-editor .cf-grid-edit-wrap thead th:first-child { left:0; z-index:2; }
.cf-grid-editor .cf-grid-edit-wrap :is(input,select):focus { outline:2px solid var(--cf-accent); outline-offset:-2px; }
.cf-record-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.cf-record-status { font-size:.9rem; }
.cf-row-actions { white-space:nowrap; }
.cf-grid td button { user-select:none; }

/* The workbook takes the available portal width and keeps its controls at the grid edges. */
#app>main>.content:has(.cf-workbook),
body[data-layout="erp"] #app>main>.content:has(.cf-workbook) { max-width:none; min-width:0; padding-inline:clamp(6px,1.1vw,18px); }
.team-finance:has(.cf-workbook) .heading { margin-bottom:8px; }
.cf-topbar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.team-finance .cf-topbar :is(.cf-tabs,.cf-header) { padding:0; border:0; margin:0; }
.cf-topbar .cf-autosave { margin:0 0 0 auto; padding:4px 8px; font-size:.85rem; color:#486052; }
.cf-autosave[data-state="busy"] { color:#755510; }
.cf-autosave[data-state="error"] { color:#8d2525; }
.team-finance .cf-workbook { padding:0; overflow:hidden; border-radius:6px; }
.team-finance .cf-ribbon { display:flex; flex-wrap:nowrap; gap:5px; overflow-x:auto; padding:5px 8px; margin:0; border-radius:0; }
.team-finance .cf-ribbon button { flex:none; white-space:nowrap; min-height:30px; padding:4px 9px; font-size:.84rem; }
.team-finance .cf-formula-bar { border-inline:0; border-top:0; border-radius:0; margin:0; gap:5px; padding:5px 8px; }
.team-finance .cf-formula-bar input { min-height:30px; }
.team-finance .cf-grid-wrap,
.team-finance .cf-grid-edit-wrap { min-height:0; max-height:none; flex:1 1 0; margin:0; border-inline:0; }
.team-finance .cf-grid td button { min-height:28px; }
.cf-sheet-footer { display:flex; min-width:0; max-width:100%; align-items:stretch; gap:4px; padding:3px 5px; border-bottom:1px solid var(--cf-border); background:#edf5f0; }
.team-finance .cf-sheet-footer .cf-sheet-tabs { flex:1; min-width:0; padding:0; margin:0; gap:2px; border:0; }
.team-finance .cf-sheet-footer button { min-height:32px; min-width:28px; padding:3px 8px; font-size:.84rem; }
.team-finance .cf-sheet-footer .cf-sheet-tabs button { border-radius:3px 3px 0 0; border-color:transparent; }
.team-finance .cf-sheet-footer .cf-sheet-tabs button[aria-pressed="true"] { background:white; border-bottom:2px solid var(--cf-accent); color:#165443; }
.cf-sheet-picker { display:flex; align-items:center; gap:5px; font-size:.8rem; }
.team-finance .cf-sheet-picker select { max-width:min(20vw,175px); min-height:32px; padding-block:2px; }
.team-finance .cf-workbook :is(.cf-dependencies,details) { padding:4px 8px; font-size:.85rem; }
.team-finance .cf-dependencies br { display:none; }
.cf-dependencies strong:not(:first-child) { margin-left:8px; }
.cf-grid-editor h2 { margin:4px 8px; font-size:.92rem; }
.cf-grid-editor .cf-record-toolbar { padding:4px 8px; }
.cf-record-toolbar .cf-record-status:empty,.cf-grid-editor .error:empty { display:none; }
.team-finance.cf-expanded { position:fixed; inset:0; z-index:999; padding:8px; display:flex; flex-direction:column; background:#fff; overflow:auto; }
body:has(.team-finance.cf-expanded) { overflow:hidden; }
.team-finance.cf-expanded>.heading { display:none; }
@media (max-width:760px) {
 .team-finance .cf-topbar .cf-section-tabs { display:flex; }
 .team-finance .cf-topbar .cf-section-tabs button { width:auto; }
 .cf-sheet-picker span { display:none; }
 .team-finance .cf-sheet-picker select { max-width:115px; }
 .team-finance .cf-grid td button { min-height:36px; }
}

.team-finance .cf-workbook { display:flex; flex-direction:column; block-size:var(--cf-book-height,60dvh); min-block-size:0; }
.cf-workbook > :is(.cf-formula-bar,.cf-ribbon,.cf-sheet-footer),
.cf-grid-editor > :is(h2,.cf-record-toolbar,.error) { flex:none; }
.cf-workbook > [data-cf-record], .cf-workbook .cf-grid-editor { display:flex; flex:1 1 0; flex-direction:column; min-height:0; }
.cf-workbook > :is(.cf-formula-bar,.cf-ribbon), .cf-workbook [data-cf-record] { min-width:0; }
.cf-inspector { flex:0 1 auto; min-height:0; max-height:min(16%,72px); overflow:auto; }
.cf-grid-editor .error { max-height:48px; overflow:auto; margin:2px 8px; }
.cf-sheet-footer { margin-top:auto; }
@media (max-height:740px) {
 .team-finance:has(.cf-workbook) > .heading { display:none; }
 .cf-inspector { display:none; }
}
@media (max-height:740px) {
 #app>main:has(.cf-workbook)>.content { padding-block-start:4px; }
 #app>main:has(.cf-workbook) :is(.erp-breadcrumb,.erp-page-guide) { display:none; }
 #app>main:has(.cf-workbook)>header > :is(.workspace-find,.profile) { display:none; }
 .team-finance .cf-topbar { gap:4px; }
 .team-finance .cf-topbar :is(button,input) { min-height:32px; }
}
@media (max-width:760px) {
 body[data-layout="erp"] #app>main:has(.cf-workbook)>.content { padding-block-start:5px; }
 #app>main:has(.cf-workbook) :is(.erp-breadcrumb,.erp-page-guide) { display:none; }
 .team-finance:has(.cf-workbook)>.heading { display:none; }
 .cf-inspector { max-height:32px; }
}
@media (max-height:500px) {
 body[data-layout="erp"] #app>main:has(.cf-workbook)>header { min-height:44px; padding:3px 8px; }
 #app>main>.content:has(.cf-workbook)>.notice { max-height:38px; overflow:auto; margin-block:2px; padding-block:3px; }
 .team-finance .cf-topbar { margin-bottom:3px; }
}
@media (max-height:500px) {
 .team-finance .cf-topbar :is(.cf-section-tabs,.cf-header) { flex-wrap:nowrap; }
}
@media (max-width:760px) and (max-height:500px) {
 body[data-layout="erp"] #app:has(.v3-mobile-nav)>main:has(.cf-workbook)>header { display:none; }
}
.cf-workbook .cf-resizable { min-width:0; table-layout:fixed; }
.cf-workbook .cf-resizable td { overflow:hidden; }
.cf-workbook .cf-resizable th { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding-right:10px; }
.cf-workbook .cf-resizable td button[data-action=cf-cell] { width:100%; }
.cf-workbook .cf-resizable :is(input,select)[data-col],
.cf-workbook .cf-resizable :is(input,select)[data-part] { min-width:0; }
.cf-workbook .cf-resizable .cf-row-actions { white-space:normal; }
.cf-workbook button.cf-resize-handle { position:absolute; top:0; right:0; bottom:0; width:10px; min-width:0; padding:0; min-height:0; border:0; border-radius:0; background:transparent; cursor:col-resize; touch-action:none; }
.cf-resize-handle:hover,.cf-resize-handle:focus-visible { box-shadow:inset -2px 0 var(--cf-accent); }
.cf-grid td[data-cf-mark^="yellow"] { background:#fff0a6; }
.cf-grid td[data-cf-mark^="green"] { background:#d4ebbf; }
.cf-grid td[data-cf-mark^="blue"] { background:#cfe5fb; }
.cf-grid td[data-cf-mark$="bold"] button { font-weight:750; }
.cf-grid td[data-cf-mark][data-cf-selected] { box-shadow:inset 0 0 0 2px #2a8063; }
.cf-grid-editor [data-cf-balance][data-valid="true"] { color:#186146; }
.cf-grid-editor [data-cf-balance][data-valid="false"] { color:#9a331e; font-weight:650; }
.cf-pdf-input:not([hidden]) { position:relative; display:inline-flex; align-items:center; vertical-align:middle; margin:2px; padding:4px 6px; border:1px solid var(--cf-border); border-radius:4px; cursor:pointer; }
.cf-pdf-input:focus-within { outline:2px solid var(--cf-accent); }
.cf-pdf-input input[type=file] { position:absolute; inset:0; opacity:0; min-width:0; min-height:0; cursor:pointer; }
.cf-workbook .cf-grid-editor [data-cf-error] { background:#fff0ef; outline:2px solid #ba382b; outline-offset:-2px; }
.cf-workbook .cf-grid-editor [data-cf-error]:focus { outline-color:#ba382b; }

.cf-workbook .cf-journal-layout { display:flex; flex:1 1 0; min-height:0; min-width:0; overflow:hidden; }
.cf-journal-layout>[data-cf-record],.cf-journal-layout>.cf-invoice-panel { display:flex; flex:1 1 0; flex-direction:column; min-width:0; min-height:0; }
.cf-journal-layout>.cf-invoice-panel { flex:0 0 clamp(350px,46%,690px); border-left:1px solid #b7cbd3; background:#f1f6f5; }
.cf-journal-controls,.cf-document-title,.cf-document-meta { display:flex; flex:none; align-items:center; flex-wrap:wrap; gap:7px 13px; padding:6px 9px; }
.cf-journal-controls { background:#eef5f5; border-block:1px solid #d1e0e2; }
.cf-journal-controls label { display:flex; align-items:center; gap:5px; margin:0; font-size:.84rem; }
.cf-journal-controls :is(input,select) { min-height:28px; padding:3px 6px; }
.cf-journal-controls output { font-size:.82rem; margin-left:auto; font-weight:650; color:#28534f; }
.cf-workbook .cf-journal .cf-grid-edit-wrap :is(td,th) { padding-block:2px; border-right:1px solid #d7e3e5; border-bottom:1px solid #d7e3e5; }
.cf-workbook .cf-journal .cf-grid-edit-wrap :is(input,select)[data-col] { min-height:26px; padding:2px 5px; border-color:transparent; border-radius:2px; background:transparent; }
.cf-workbook .cf-journal .cf-grid-edit-wrap :is(input,select)[data-col]:focus { background:#fff; }
.cf-workbook .cf-journal tr:focus-within td,.cf-workbook .cf-journal tr[data-cf-current-invoice] td { background:#e0f1ed; }
.cf-workbook .cf-journal tr[hidden] { display:none; }
.cf-journal input:is([data-col=amount],[data-col=vat],[data-col=paid]) { text-align:right; font-variant-numeric:tabular-nums; }
.cf-document-title { justify-content:space-between; border-bottom:1px solid #b7cbd3; }
.cf-document-title h2 { margin:2px 0; font-size:1.08rem; }
.cf-document-title small { color:#3d6867; }
.cf-document-meta { font-size:.85rem; }
.cf-cost-breakdown { font-size:.86rem; }
@media(max-width:760px) {
 .cf-journal-layout:has(.cf-invoice-panel)>[data-cf-record] { display:none; }
 .cf-journal-layout>.cf-invoice-panel { flex:1 1 0; border-left:0; }
 .cf-journal-controls output { margin-left:0; }
}
.cf-row-splits { display:block; margin:3px 1px; color:#38575c; line-height:1.35; }
.cf-journal-controls .cf-column-picker { position:relative; margin:0; padding:0; }
.cf-column-picker summary { cursor:pointer; padding:4px 8px; border:1px solid var(--cf-border); border-radius:4px; background:#fff; }
.cf-column-picker [data-cf-columns] { position:absolute; z-index:8; top:100%; right:0; min-width:180px; max-height:min(48dvh,320px); overflow:auto; background:#fff; border:1px solid var(--cf-border); border-radius:4px; padding:6px 8px; box-shadow:0 5px 14px #194e4930; }
.cf-journal td.cf-gross-column { text-align:right; padding-inline:6px; background:#e4f3ec; font-weight:650; font-variant-numeric:tabular-nums; white-space:nowrap; }
@media(max-width:760px){ .cf-column-picker [data-cf-columns] { right:auto; left:0; } }
.cf-grid td:has(.cf-cell-editor) { position:relative; overflow:visible; }
.cf-grid input.cf-cell-editor { position:absolute; inset:0; z-index:1; width:100%; height:100%; min-height:0; padding:2px 6px; border:2px solid var(--cf-accent); border-radius:0; background:#fff; outline:0; font:inherit; }
.cf-unavailable { display:none; }
.cf-workbook [data-cf-address] { min-width:54px; padding:3px 6px; font-variant-numeric:tabular-nums; background:#eef5f1; border:1px solid #c7dfd4; border-radius:3px; }
.cf-workbook [data-cf-selection-stats] { color:#275942; font-weight:650; }
body[data-layout="erp"] #app>main>.content:has(.cf-workbook) { padding-block-start:8px; }
#app>main>.content:has(.cf-workbook)>.erp-breadcrumb,
.team-finance:has(.cf-workbook)>.erp-page-guide { display:none; }
.cf-ribbon button[hidden] { display:none; }

.cf-workbook .cf-register-ribbon { flex:none; background:#f3f7f4; border-bottom:1px solid #bdcfca; }
.cf-register-ribbon .cf-formula-bar { flex-wrap:nowrap; min-width:0; }
.cf-register-ribbon .cf-formula-bar [data-cf-register-formula] { min-width:40px; flex:1 1 100px; }
.cf-workbook .cf-fx { color:#19684e; font:italic 700 1.13rem Georgia,serif; padding-inline:5px; }
.cf-workbook .cf-register-ribbon .cf-formula-bar button { min-height:28px; padding:2px 7px; white-space:nowrap; font-size:.81rem; }
.cf-register-ribbon .cf-error-slot { min-height:25px; padding:2px 8px; }
.cf-workbook .cf-register-ribbon .cf-error-slot > .error { max-height:none; margin:0; padding:2px 7px; border:0; border-left:3px solid #b93b33; border-radius:3px; background:#fff0ef; color:#9d3025; font-size:.82rem; line-height:1.35; white-space:normal; overflow-wrap:anywhere; }
.cf-workbook .cf-register-ribbon .cf-error-slot > .error:empty { display:none; }
/* Keep the native color input from inheriting the ERP form field dimensions. */
#app .team-finance .cf-formula-bar .cf-ink-picker {
 display:block; position:relative; flex:0 0 28px; width:28px; height:28px; margin:0; padding:0;
}
#app .team-finance .cf-formula-bar .cf-ink-picker input[type="color"] {
 display:block; position:absolute; inset:0; box-sizing:border-box; width:100%; height:100%;
 min-width:0; min-height:0; max-width:100%; max-height:100%; margin:0; padding:3px; border-radius:4px;
}
#app .team-finance .cf-register-ribbon .cf-formula-bar {
 align-items:center; gap:5px; padding:4px 7px;
}
#app .team-finance .cf-register-ribbon .cf-formula-bar :is([data-cf-register-formula],[data-cf-allocation-formula]) {
 height:30px; min-height:30px; margin:0; padding:3px 6px;
}
#app .team-finance .cf-journal-controls label {
 display:flex; flex-flow:row nowrap; align-items:center; gap:5px; margin:0;
}
#app .team-finance .cf-journal-controls :is(input,select) {
 height:30px; min-height:30px; max-width:100%; margin:0;
}
.cf-formula-bar .cf-column-picker { margin:0 0 0 auto; position:relative; padding:0; flex:none; }
.cf-column-picker summary { display:grid; place-items:center; width:31px; height:28px; padding:4px; list-style:none; }
.cf-column-picker summary::-webkit-details-marker { display:none; }
.cf-funnel { width:16px; height:15px; background:#245e52; clip-path:polygon(0 0,100% 0,62% 46%,62% 84%,39% 100%,39% 46%); }
.cf-formula-bar .cf-column-picker [data-cf-columns] { right:0; left:auto; }
.cf-workbook .cf-grid-edit-wrap :is(td,th) { padding:0; border-right:1px solid #d6e0dd; border-bottom:1px solid #d6e0dd; }
.cf-workbook .cf-grid-edit-wrap th { background:#eaf0ed; padding:3px 8px; font-size:.81rem; }
.cf-grid-edit-wrap th small { display:block; color:#587167; font-size:.72rem; }
.cf-workbook .cf-grid-edit-wrap :is(input,select):is([data-col],[data-part]) {
 min-height:26px; height:26px; width:100%; border:0; border-radius:0; box-shadow:none; padding:1px 6px; background:transparent;
}
.cf-workbook .cf-grid-edit-wrap :is(input,select):is([data-col],[data-part]):focus { outline:none; }
.cf-grid-edit-wrap td[data-cf-register-active] { box-shadow:inset 0 0 0 2px #20785d; }
.cf-workbook td[data-cf-custom-fill] { background:var(--cf-fill)!important; color:var(--cf-fill-ink); }
.cf-workbook td[data-cf-custom-fill] :is(button[data-action=cf-cell],input,select) { color:var(--cf-fill-ink); }
.cf-workbook td[data-cf-custom-fill] :is(select option,input:focus) { color:#142320; }
.cf-workbook .cf-sheet-tabs button { cursor:grab; }
.cf-workbook .cf-sheet-tabs button:active { cursor:grabbing; }
.cf-workbook .cf-sheet-footer { background:#e9efec; }
.cf-workbook .cf-sheet-footer .cf-sheet-tabs button { background:transparent; }
.cf-workbook .cf-sheet-footer .cf-sheet-tabs button[aria-pressed="true"] { background:#fff; }
@media(max-width:760px){
 .cf-register-ribbon .cf-formula-bar { flex-wrap:wrap; }
 .cf-register-ribbon .cf-formula-bar [data-cf-register-formula] { flex-basis:60%; }
}
.cf-error-link { cursor:pointer; }
.cf-tab-order { position:relative; flex:none; align-self:center; margin:0; }
.cf-tab-order summary { list-style:none; cursor:pointer; font-size:1.05rem; padding:2px 7px; border:1px solid var(--cf-border); background:white; }
.cf-tab-order summary::-webkit-details-marker { display:none; }
.cf-tab-order>div { position:absolute; right:0; bottom:100%; padding:4px; background:#fff; border:1px solid var(--cf-border); z-index:5; white-space:nowrap; }
.cf-topbar .cf-autosave { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:min(42vw,540px); }
.cf-workbook :is(.cf-grid-wrap,.cf-grid-edit-wrap) {
 background-color:#fff;
 background-image:linear-gradient(to right,#edf1ef 1px,transparent 1px),linear-gradient(to bottom,#edf1ef 1px,transparent 1px);
 background-size:115px 27px;
}
.cf-workbook .cf-grid-edit-wrap tbody tr:nth-child(odd) td { background-color:#fff; }
.cf-workbook .cf-grid-edit-wrap tbody tr:nth-child(even) td { background-color:#f7faf9; }
#app .team-finance .cf-register-ribbon .cf-formula-bar > button,
#app .team-finance .cf-register-ribbon .cf-column-picker summary {
 min-height:28px; height:30px; margin:0; padding-block:2px;
}
@media (max-width:760px) {
 #app .team-finance .cf-journal-controls { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,.75fr); gap:4px; padding:4px 6px; }
 #app .team-finance .cf-journal-controls label { min-width:0; width:auto; }
 #app .team-finance .cf-journal-controls label span { display:none; }
 #app .team-finance .cf-journal-controls :is(input,select) { width:100%; min-width:0; }
 #app .team-finance .cf-journal-controls output { grid-column:1/-1; margin:0; }
}

#app .team-finance .cf-column-picker [data-cf-columns] {
 width:min(250px,75vw); max-height:min(295px,45dvh); padding:7px;
 text-align:left; font-size:13px; line-height:1.3;
}
#app .team-finance [data-cf-columns] > strong { display:block; padding:4px 6px 6px; }
#app .team-finance [data-cf-columns] > :is(.cf-column-toggle,.cf-column-reset) {
 display:flex; width:100%; height:auto; min-height:27px; align-items:center; gap:8px;
 margin:0; padding:4px 6px; border:0; border-radius:4px; font:inherit; text-align:left; background:transparent; white-space:normal;
}
#app .team-finance [data-cf-columns] > button:hover { background:#eaf3ee; }
#app .team-finance .cf-column-toggle > span {
 display:grid; place-items:center; width:15px; height:15px; flex:none; font-size:11px; line-height:1;
 border:1px solid #809e91; border-radius:3px; color:transparent;
}
#app .team-finance .cf-column-toggle[aria-pressed="true"] > span { background:#21664f; border-color:#21664f; color:white; }
#app .team-finance [data-cf-columns] > .cf-column-reset { color:#205e4a; font-weight:650; }
#app .team-finance :is(.cf-journal-controls,.cf-sheet-footer) select { padding:2px 24px 2px 7px; line-height:1.25; }
#app .team-finance .cf-sheet-footer { align-items:center; }
#app .team-finance .cf-sheet-footer :is(button,select) { min-height:29px; height:29px; margin:0; font-size:.85rem; }
#app .team-finance .cf-grid-editor .cf-record-toolbar button { min-height:29px; margin:0; padding:3px 8px; font-size:.84rem; }
#app .team-finance .cf-grid-edit-wrap .cf-row-actions :is(button,.cf-pdf-input) {
 min-height:24px; margin:1px 2px; padding:2px 5px; font-size:.76rem; line-height:1.25;
}
#app .team-finance .cf-grid-edit-wrap :is(input,select):is([data-col],[data-part]):not(:focus) { background:transparent; }
.cf-quick-split { display:flex; flex-wrap:wrap; align-items:end; gap:6px 9px; margin:3px 8px; padding:4px 7px; border:1px solid #c7dcd4; border-radius:4px; background:#eef6f2; }
.cf-quick-split legend { padding-inline:4px; font-size:.83rem; font-weight:650; color:#225c48; }
#app .team-finance .cf-quick-split label { flex:1 1 118px; margin:0; font-size:.79rem; }
#app .team-finance .cf-quick-split :is(select,button) { min-height:28px; margin:0; padding:3px 6px; font-size:.82rem; }
.cf-autosave[tabindex] { cursor:pointer; text-decoration:underline; }
.cf-quick-split [data-cf-split-preview]:not(:empty) { flex:1 0 100%; color:#225c48; font-size:.77rem; }
.cf-monthly-report { min-height:0; display:flex; flex:1 1 0; flex-direction:column; }
.cf-monthly-header { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px 14px; padding:7px 10px; background:#f1f7f4; }
.cf-monthly-header h2,.cf-monthly-header p { margin:0; }
.cf-monthly-header h2 { font-size:1.05rem; }
.cf-monthly-header p,.cf-monthly-header label { font-size:.83rem; }
.cf-monthly-table table { min-width:100%; }
#app .cf-monthly-table :is(th,td) { padding:4px 9px; white-space:nowrap; }
#app .cf-monthly-table td { text-align:right; font-variant-numeric:tabular-nums; }
#app .cf-monthly-table tbody th { text-align:left; background:#f5f8f7; }
#app .cf-monthly-table .cf-monthly-section th { background:#e4efe9; color:#245844; }
#app .cf-monthly-table .cf-monthly-total { font-weight:650; }
#app .cf-monthly-table .cf-monthly-result :is(th,td) { font-weight:700; background:#dceee5; }
.cf-monthly-empty { padding:12px; }
.cf-monthly-sources { display:flex; align-items:center; flex-wrap:wrap; gap:5px; padding:4px 9px; background:#f4f7f6; border-block:1px solid #d5e1dc; }
#app .cf-monthly-sources button { margin:0; min-height:26px; padding:2px 7px; font-size:.8rem; }
.cf-monthly-table table { min-width:0; border-collapse:separate; border-spacing:0; }
#app .cf-monthly-table :is(th,td) { min-width:122px; border-right:1px solid #bdcfc7; border-bottom:1px solid #bdcfc7; }
#app .cf-monthly-table tr > th:first-child { min-width:min(245px,42vw); text-align:left; }
#app .cf-monthly-table thead th { background:#faf0c6; color:#303b24; text-align:center; vertical-align:bottom; }
#app .cf-monthly-table thead th small { color:#815b31; font-weight:500; }
#app .cf-monthly-table thead th:first-child { left:0; z-index:3; }
#app .cf-monthly-table .cf-monthly-section th { background:#dbe8e2; color:#234438; font-weight:700; }
#app .cf-monthly-table .cf-monthly-income .cf-monthly-section th { background:#dceae4; }
#app .cf-monthly-table .cf-monthly-payroll .cf-monthly-section th { background:#dce9f4; color:#274b68; }
#app .cf-monthly-table .cf-monthly-contribution :is(th,td) { background:#fff2bf; font-weight:650; }
#app .cf-monthly-table .cf-monthly-subtotal :is(th,td) { background:#e5eef4; font-weight:650; }
#app .cf-monthly-table .cf-monthly-result :is(th,td) { background:#f4d8ad; font-weight:750; }
#app .cf-monthly-table td.cf-monthly-negative { color:#9f3026; }
#app .cf-monthly-table td.cf-monthly-total { border-left:2px solid #94aa9d; font-weight:700; }
#app .cf-monthly-table td.cf-monthly-pending { background:#fff7e5; }
@media(max-width:760px) {
 #app .cf-monthly-table :is(th,td) { padding:3px 6px; font-size:.8rem; }
 #app .cf-monthly-table tr > th:first-child { max-width:42vw; white-space:normal; }
}
#app .team-finance [data-cf-sort-date] { min-height:30px; margin:0; padding:3px 8px; font-size:.84rem; white-space:nowrap; }
@media(max-width:760px) {
 #app .team-finance [data-cf-sort-date] { grid-column:1/-1; justify-self:start; }
}
.cf-excel-monthly-layout { display:flex; align-items:flex-start; gap:14px; width:max-content; padding:8px 12px 14px; }
#app .cf-monthly-table .cf-excel-main tr > :is(th,td) { padding:2px 7px; min-width:90px; border-color:#6e7974; line-height:1.32; }
#app .cf-monthly-table .cf-excel-main tr > th:first-child { min-width:310px; max-width:360px; white-space:normal; }
#app .cf-monthly-table .cf-excel-main thead th { background:#fbeb79; }
#app .cf-monthly-table .cf-excel-main thead th:first-child { background:#fff; color:#26352e; }
#app .cf-monthly-table .cf-excel-main .cf-monthly-section th { background:#d4dad7; }
#app .cf-monthly-table .cf-excel-main .cf-monthly-contribution :is(th,td) { background:#ffe47e; }
#app .cf-monthly-table .cf-excel-main .cf-monthly-subtotal :is(th,td) { background:#cfdfef; }
#app .cf-monthly-table .cf-excel-main .cf-monthly-result :is(th,td) { background:#e4994d; color:#251a0e; }
.cf-excel-panels { display:flex; flex:0 0 260px; flex-direction:column; gap:12px; margin:82px 0 0; }
.cf-excel-panels p { margin:0; padding:4px 0; font-size:.78rem; }
#app .cf-monthly-table .cf-excel-side :is(th,td) { min-width:0; padding:3px 6px; border-color:#6e7974; font-size:.82rem; }
#app .cf-monthly-table .cf-excel-side th { position:static; }
#app .cf-monthly-table .cf-excel-side tr > th:first-child { min-width:0; max-width:190px; white-space:normal; }
#app .cf-monthly-table .cf-excel-side tr:first-child th { background:#e4994d; }
#app .cf-monthly-table .cf-excel-side tr:last-child :is(th,td) { background:#cfdfef; font-weight:700; }
@media(max-width:760px) {
 .cf-excel-monthly-layout { gap:8px; padding:5px; }
 #app .cf-monthly-table .cf-excel-main tr > th:first-child { min-width:145px; max-width:180px; }
 .cf-excel-panels { margin-top:45px; flex-basis:205px; }
}
.cf-allocation-hint { margin:4px 10px 8px; font-size:.84rem; color:#41564d; }
.cf-administration-report .cf-excel-monthly-layout { width:100%; box-sizing:border-box; }
#app .cf-administration-report .cf-excel-main { width:min(100%, 640px); }
#app .cf-administration-report .cf-excel-main thead th:last-child { text-align:right; }
#app .cf-administration-report .cf-excel-main tr > :is(th,td) { padding:5px 9px; }
#app .cf-monthly-table .cf-excel-main .cf-monthly-member-name { display:block; min-width:105px; }
#app .cf-monthly-table .cf-excel-main .cf-monthly-member-share { color:#354633; font-weight:700; }
#app .cf-monthly-table .cf-excel-main .cf-monthly-work tr:first-child > :is(th,td) { background:#edf3f0; }

.cf-financial-workbook .cf-excel-monthly-layout {
 display:grid; grid-template-columns:minmax(0, 3fr) minmax(205px, 1fr);
 gap:12px; width:100%; box-sizing:border-box; padding:8px;
}
.cf-financial-workbook .cf-excel-main { width:100%; }
.cf-financial-workbook .cf-excel-panels { min-width:0; margin:0; }
#app .cf-financial-workbook .cf-excel-main thead th,
#app .cf-financial-workbook .cf-excel-main .cf-monthly-section th,
#app .cf-financial-workbook .cf-excel-side tr:first-child th { background:#173147; color:#fff; }
#app .cf-financial-workbook .cf-excel-main thead th small { color:#d7e7ef; }
#app .cf-financial-workbook .cf-excel-main .cf-monthly-income tr:not(.cf-monthly-section,.cf-monthly-contribution) > :is(th,td) { background:#e5f3ea; color:#173e2d; }
#app .cf-financial-workbook .cf-excel-main .cf-monthly-result > :is(th,td) { background:#e8edf2; }
#app .cf-financial-workbook .cf-excel-main td.cf-monthly-negative { color:#a1282b; }
#app .cf-financial-workbook .cf-excel-main td.cf-monthly-positive { color:#19643b; }
.cf-financial-workbook .cf-monthly-sources { flex-wrap:wrap; }
.cf-report-state { margin-inline-start:auto; font-weight:650; }
.cf-month-periods { display:flex; overflow:auto; padding:4px 8px; gap:3px; flex-shrink:0; }
#app .cf-month-periods button { min-width:40px; padding:2px 7px; min-height:28px; }
#app .cf-month-periods button[aria-pressed=true] { background:#173147; color:white; }
@media(max-width:850px) {
 .cf-financial-workbook .cf-excel-monthly-layout { grid-template-columns:minmax(0,1fr); width:max-content; min-width:100%; }
 .cf-financial-workbook .cf-excel-panels { width:min(82vw, 440px); }
}
@media print {
 body:has(.cf-financial-workbook) :is(#main-navigation,main>header,.cf-topbar,.cf-sheet-tabs,.cf-monthly-sources,.cf-month-periods) { display:none!important; }
 #app:has(.cf-financial-workbook) :is(main,.cf-grid-edit-wrap,.cf-workbook,.cf-journal-layout,.cf-excel-monthly-layout) {
  height:auto!important; max-height:none!important; overflow:visible!important; display:block;
 }
 #app .cf-financial-workbook :is(th,td) { position:static!important; }
}
.cf-financial-workbook .cf-report-grid { min-width:0; overflow:auto; max-height:calc(100dvh - 255px); }
#app .cf-financial-workbook .cf-report-grid thead th { position:sticky; top:0; z-index:2; }
#app .cf-financial-workbook .cf-report-grid thead th:first-child { z-index:3; }
.cf-rate-simulator { display:grid; gap:6px; margin:0; padding:7px; border:1px solid #bdcfc7; }
.cf-rate-simulator input { width:100%; }
@media(max-width:850px) {
 .cf-financial-workbook .cf-excel-monthly-layout { width:100%; min-width:0; }
 .cf-financial-workbook .cf-report-grid { max-height:62dvh; }
}
@media print {
 #app .cf-financial-workbook .cf-report-grid { overflow:visible; max-height:none; }
 .cf-rate-simulator { display:none; }
}
.cf-report-selectors { display:flex; flex-wrap:wrap; align-items:end; justify-content:flex-end; gap:8px; }
.cf-report-selectors [name=cfReportYear] { max-width:100px; }

/* Keep the sheet controls independent of the portal navigation layout. */
#app .cf-financial-workbook .cf-month-periods {
 flex:0 0 44px; box-sizing:border-box; height:44px; align-items:center; overflow-y:hidden; scrollbar-width:thin; padding:2px 8px; background:#f1f5f5; border-top:1px solid #d4dfe4;
}
#app .cf-financial-workbook .cf-month-periods button {
 flex:0 0 auto; width:auto; height:30px; min-width:42px; margin:0; text-align:center; white-space:nowrap;
}
#app .cf-financial-workbook .cf-monthly-table { flex:1 1 0; min-height:0; overflow:hidden; background:#f7f9fa; }
.cf-financial-workbook .cf-excel-monthly-layout { height:100%; min-height:0; align-items:stretch; }
.cf-financial-workbook .cf-report-grid, .cf-financial-workbook .cf-excel-panels { max-height:none; min-height:0; overflow:auto; }
.cf-financial-workbook .cf-excel-panels { align-self:stretch; }
#app .cf-financial-workbook .cf-excel-main thead th:first-child { background:#173147; color:#fff; }
#app .cf-financial-workbook .cf-excel-main thead .cf-monthly-member-share { color:#ffe3a2; }
#app .cf-financial-workbook .cf-excel-main tr > :is(th,td),
#app .cf-financial-workbook .cf-excel-side tr > :is(th,td) { border-color:#ccd7dd; }
.cf-report-menu { position:relative; z-index:6; }
.cf-report-menu > summary { cursor:pointer; border:1px solid #d1dce3; border-radius:6px; padding:4px 8px; background:white; }
.cf-report-menu-items {
 position:absolute; top:calc(100% + 4px); inset-inline-start:0; z-index:20; width:max-content; max-width:85vw;
 display:grid; gap:2px; padding:5px; background:white; border:1px solid #d1dce3; border-radius:6px; box-shadow:0 4px 14px #1b344326;
}
#app .cf-report-menu-items button { margin:0; text-align:left; }
@media(max-width:850px) {
 #app .cf-financial-workbook .cf-monthly-table { overflow:auto; }
 .cf-financial-workbook .cf-excel-monthly-layout { height:auto; }
 .cf-financial-workbook .cf-report-grid { max-height:62dvh; }
 .cf-financial-workbook .cf-excel-panels { overflow:visible; width:100%; }
}
@media print {
 #app .cf-financial-workbook .cf-monthly-table,
 #app .cf-financial-workbook .cf-excel-panels { overflow:visible; height:auto; }
}
