*{box-sizing:border-box}body{margin:0;font:13px 'Segoe UI','Microsoft YaHei',sans-serif;color:#1c2733;background:#f4f6f9}button,input,select,textarea{font:inherit}button{cursor:pointer;padding:7px 13px;border:1px solid #c9d4e3;border-radius:5px;background:white;color:#24384d}button:hover{background:#eef3fb}button:disabled{opacity:.5;cursor:wait}.primary{background:#2456a6;color:white;border-color:#2456a6}.primary:hover{background:#2d69c4}.danger{color:#b3261e;border-color:#e4b5b2}.ghost{background:transparent;color:#e8eefc;border-color:#526174}header{height:48px;background:#1f2d3d;color:#e8eefc;display:flex;align-items:center;padding:0 20px;gap:16px}header b{font-size:15px}.subbrand{color:#a3b4ca;font-size:12px}.spacer{flex:1}#shell{display:flex;height:calc(100vh - 48px)}[hidden]{display:none!important}aside{width:185px;flex-shrink:0;background:#182230;color:#b9c7db;position:relative;padding:20px 0}aside small{display:block;padding:0 18px 12px;color:#7d92ae}aside button{display:block;width:100%;border:0;border-left:3px solid transparent;border-radius:0;background:none;color:#c3d0e2;text-align:left;padding:12px 18px}aside button:hover{background:#223349;color:white}aside button.active{background:#24406b;border-left-color:#4f8bff;color:white}aside hr{border:0;border-top:1px solid #304055;margin:22px 16px}.aside-foot{position:absolute;bottom:24px;left:20px;font-size:11px;line-height:1.9;color:#8fa1b8}.aside-foot span{color:#637891}main{flex:1;min-width:0;overflow:auto;padding:24px}#pagehead{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}#breadcrumb{font-size:11px;color:#7b8b9f;margin-bottom:7px}h1{font-size:23px;font-weight:600;margin:0}h2{font-size:15px;margin:0 0 15px}.card{background:white;border:1px solid #dfe6ef;border-radius:7px;padding:16px;margin-bottom:16px}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.toolbar label{display:flex;align-items:center;gap:7px}input,select,textarea{border:1px solid #c9d4e3;border-radius:4px;padding:7px 9px;background:white;color:#24384d}input[type=month]{width:150px}input[type=number]{width:110px}textarea{width:100%;min-height:65px}.muted{color:#718096;font-size:12px}.hint{color:#63758a;line-height:1.8;margin:12px 0 0}.metrics{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:18px}.metric{flex:1;min-width:170px;background:white;border:1px solid #dfe6ef;border-radius:7px;padding:16px}.metric span{display:block;color:#6e8095;font-size:12px}.metric b{display:block;font-size:24px;margin-top:10px;font-weight:600;color:#214a79}.table-wrap{overflow:auto;background:white;border:1px solid #dfe6ef;border-radius:6px;max-height:66vh}table{border-collapse:separate;border-spacing:0;width:100%;white-space:nowrap;font-size:12px}th,td{border-bottom:1px solid #e2e8f1;border-right:1px solid #e2e8f1;padding:9px 11px;text-align:left}th{background:#eef3fb;color:#354b65;position:sticky;top:0;z-index:2;font-weight:600}td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}tr:nth-child(even) td{background:#fafcfe}tr:hover td{background:#f0f6ff}.group-row td{background:#e8eef7!important;font-weight:600;color:#29486b}.total-row td{font-weight:700;background:#eef3fb!important}.grand td{font-weight:700;color:#b3261e;background:#fff5f3!important}.fixed{position:sticky;left:0;z-index:1;background:white;min-width:180px}.fixed.th{z-index:3}.adjust{background:#fff7db!important}.adjust input{width:105px;background:#fffaf0;border-color:#ecdca3;text-align:right;padding:5px}.note input{width:150px}.money-negative{color:#ba3026}.pill{display:inline-block;padding:3px 9px;border-radius:10px;background:#eef3fb;color:#466482;font-size:11px}.saved{color:#2b7764;background:#e8f6f0}.dirty{color:#9a650d;background:#fff1d5;padding:5px 9px;border-radius:5px}.empty{text-align:center;padding:60px 20px;color:#718096}.empty b{display:block;font-size:17px;margin-bottom:10px;color:#40546d}#message{padding:12px 16px;margin-bottom:16px;background:#eef7f3;color:#28634c;border:1px solid #c7e2d6;border-radius:6px}#message.error,.error{color:#ac332c}#message.error{background:#fff1ef;border-color:#edc5bf}.tabs{display:flex;gap:6px;margin-bottom:14px}.tabs button.active{background:#2456a6;color:white}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:18px}.rule{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:12px 0;border-bottom:1px solid #edf0f5}.rule input{width:100px}.help-list{line-height:2;color:#4b6179}.pager{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-top:12px}.link{border:0;padding:0;background:none;color:#2456a6;text-decoration:underline}.upload-zone{padding:28px;border:1px dashed #a9bad1;border-radius:7px;background:#fafcfe;margin:16px 0}.settings-table input{width:145px}.settings-table input.code{width:80px}.settings-table select{width:125px}.settings-table input[type=checkbox]{width:auto}#login{height:calc(100vh - 48px);display:grid;place-items:center}#login form{width:390px;background:white;padding:38px;border:1px solid #dce4ef;border-radius:10px;box-shadow:0 10px 35px #172a4010}#login small{letter-spacing:1.2px;color:#69819e;font-size:10px}#login h1{margin-top:18px}#login p{color:#7c8a9a;line-height:1.7}#login label{display:block;margin:25px 0 16px}#login input{display:block;width:100%;margin-top:10px}#login button{width:100%}dialog{border:1px solid #c9d4e3;border-radius:8px;width:850px;max-width:95vw;max-height:85vh;padding:20px}dialog::backdrop{background:#10203366}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}#detailbody{overflow:auto;max-height:65vh}#detailbody td{white-space:normal;word-break:break-word}.statusline{display:flex;gap:12px;margin-top:15px}.caption{padding:12px 0;color:#6c7e91}.annual .fixed{min-width:200px}@media(max-width:900px){aside{width:145px}main{padding:14px}.grid2{grid-template-columns:1fr}.metrics{gap:8px}.metric{min-width:140px;padding:12px}.metric b{font-size:20px}}@media(max-width:600px){#shell{display:block;height:auto}aside{width:100%;display:flex;flex-wrap:wrap;padding:8px;gap:3px}aside small,aside hr,.aside-foot{display:none}aside button{width:auto;padding:8px;border-radius:4px}.subbrand{display:none}header{padding:0 12px}h1{font-size:20px}.table-wrap{max-height:70vh}}

.pull-toolbar{margin-bottom:12px} #upload-options:empty{display:none}

.edit-menu{position:relative}.edit-menu summary{cursor:pointer;padding:9px 15px;border:1px solid #bbc9d6;border-radius:5px;background:white}.edit-menu>div{position:absolute;z-index:20;top:40px;min-width:140px;background:white;padding:8px;box-shadow:0 4px 16px #0002;display:grid;gap:5px}.pull-cell{min-width:130px;background:#fff5cc!important}#saved-pull .toolbar{flex-wrap:wrap;gap:12px}#saved-pull input[type=text]{width:150px}

/* Compact report rows; zero amounts remain numeric in storage. */
th,td{padding:5px 9px;line-height:1.3}.adjust input,.note input{padding:3px 5px;height:25px}.group-row td{padding-top:5px;padding-bottom:5px}

.allocation-title{text-align:center;font-size:20px;font-weight:700;background:white;padding:9px;border:1px solid #b5c1cb;border-bottom:0;color:#000}.allocation{border-radius:0;max-height:70vh}.allocation table{font-size:13px}.allocation th{background:#1f4e78;color:white;text-align:center}.allocation td{padding:7px 6px;background:white;border-color:#b8bec4}.allocation .allocation-subtotal td{background:#d9eaf7!important;font-weight:700}.allocation td:nth-child(6){text-align:right;min-width:150px}.allocation th:nth-child(n+7){min-width:145px}.allocation th:nth-child(2){min-width:170px}

#pagehead{gap:18px;flex-wrap:wrap}#monthly-actions{flex:1;margin:0;padding:0;min-width:500px}#monthly-actions input[type=checkbox]{margin:0}#pagehead #save-state{font-size:11px}.commission-grid td{padding:3px 8px;height:25px}.commission-grid .adjust input,.commission-grid .note input{display:block;border:0;border-radius:0;box-shadow:none;background:transparent;padding:0 2px;height:20px;min-height:0;line-height:20px;outline:0}.commission-grid .adjust input{appearance:textfield;-moz-appearance:textfield}.commission-grid .adjust input::-webkit-inner-spin-button,.commission-grid .adjust input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.commission-grid .adjust input:focus,.commission-grid .note input:focus{outline:1px solid #7b9fc2;background:#fffdf2}.commission-grid .group-row td{height:24px;padding-top:3px;padding-bottom:3px}@media(max-width:1000px){#monthly-actions{flex-basis:100%;min-width:0;order:3}}

/* Compact commission columns with a wider notes column and right margin. */
.commission-grid{width:calc(100% - 24px);max-width:1535px}.commission-grid table{table-layout:fixed;width:1535px}.commission-grid th{white-space:normal;overflow-wrap:break-word}.commission-grid .adjust input{width:100%;min-width:0}.commission-grid .note input{width:100%;min-width:0}.commission-grid .fixed{min-width:0}
.commission-grid th:nth-child(1){width:190px}
.commission-grid th:nth-child(2){width:125px}
.commission-grid th:nth-child(3){width:125px}
.commission-grid th:nth-child(4){width:55px}
.commission-grid th:nth-child(5){width:130px}
.commission-grid th:nth-child(6){width:55px}
.commission-grid th:nth-child(7){width:140px}
.commission-grid th:nth-child(8){width:55px}
.commission-grid th:nth-child(9){width:100px}
.commission-grid th:nth-child(10){width:110px}
.commission-grid th:nth-child(11){width:110px}
.commission-grid th:nth-child(12){width:110px}
.commission-grid th:nth-child(13){width:230px}

/* Annual report: reserve name/total widths and distribute months evenly. */
th{text-align:center}.annual table{table-layout:fixed;width:100%;min-width:1300px}.annual th:first-child{width:15%}.annual th:last-child{width:9%}.annual th:not(:first-child):not(:last-child){width:6.333333%}.annual .fixed{min-width:0}.annual th{text-align:center}.annual td{padding-left:7px;padding-right:7px}

/* V19: compact settings, month import and rule history. */
#groups-actions{margin-left:auto;gap:10px}.compact-groups th,.compact-groups td{padding:3px 6px;height:25px}.compact-groups input:not([type=checkbox]){border:0;background:transparent;padding:1px 3px;height:21px;width:100%;min-width:0;box-shadow:none;border-radius:0}.compact-groups input:focus{outline:1px solid #8caed4}.compact-groups input.code{width:65px}.compact-groups table{table-layout:fixed}.compact-groups th:first-child{width:75px}.compact-groups th:last-child{width:55px}.compact-groups .link{font-size:11px}.compact-groups .table-wrap{max-height:72vh}
.annual .annual-department td{background:white!important;text-align:center;font-weight:700;color:#29486b}.section-title{margin-top:22px}.report-basis{margin:0 0 14px;background:white;border:1px solid #dfe6ef;padding:9px 12px;border-radius:5px}.report-basis summary{cursor:pointer;color:#315d88}.report-basis .help-list{padding:12px 0}.pull-pagehead>div:first-child{display:none}.pull-pagehead{margin-bottom:8px!important;min-height:34px}#pull-pagination{margin-left:auto}#pull-pagination button{padding:4px 10px}#pull-pagination select{width:90px}.pull-grid{height:65vh;max-height:none}.pull-grid table{table-layout:fixed;width:max-content}.pull-grid th{width:145px;min-width:145px;height:30px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pull-grid td{height:28px;padding:3px 6px;max-width:145px;overflow:hidden;text-overflow:ellipsis;line-height:21px}.pull-grid td input{min-width:0;width:100%;height:21px;padding:0;border-radius:0}.pull-grid .virtual-spacer td{line-height:0;background:white!important}.pull-grid tr{height:28px}.pull-grid .virtual-spacer{height:auto}.compact-groups th:nth-child(2){width:32%}

.monthly-metrics{width:50%;min-width:680px;gap:10px}.monthly-metrics .metric{padding:14px 16px}.monthly-metrics .metric b{font-size:23px}@media(max-width:1000px){.monthly-metrics{width:100%;min-width:0}}

/* V20 compact rule rows */
.rules-grid .rule{padding:5px 0;gap:12px;min-height:38px}.rules-grid .rule input{padding:4px 7px;width:100px}.rules-grid .rule input[type=checkbox]{width:auto}.rules-grid .section-title{margin:15px 0 10px}.rules-grid .rule>div{display:flex;gap:14px;flex-wrap:wrap}.rules-grid .help-list{line-height:1.8}

/* V21: full-width summary with half-height cards */
.monthly-metrics{width:100%;min-width:0;gap:14px}.monthly-metrics .metric{padding:6px 16px;min-height:0}.monthly-metrics .metric span{line-height:15px}.monthly-metrics .metric b{font-size:20px;line-height:24px;margin-top:2px}

.commission-grid input[data-adj]:disabled{opacity:1;color:inherit;background:transparent;cursor:default}.adjusted-status{margin:0 0 12px;color:#287761}

/* V30 invoice summary: exact column widths, names from saved groups. */
.pull-grid th{text-align:center}.pull-grid .pull-center{text-align:center}.pull-grid .pull-amount{text-align:right}
.summary-pull table{width:1215px;min-width:1215px}
.summary-pull th{box-sizing:border-box;min-width:0}
.summary-pull th:nth-child(1){width:145px}
.summary-pull th:nth-child(2){width:100px}
.summary-pull th:nth-child(3){width:320px}
.summary-pull th:nth-child(4),.summary-pull th:nth-child(6){width:100px}
.summary-pull th:nth-child(5),.summary-pull th:nth-child(7){width:150px}
.summary-pull th:nth-child(8){width:150px}
.summary-pull td:nth-child(3),.summary-pull td:nth-child(5),.summary-pull td:nth-child(7){text-align:left}

/* V34 repack: one compact Pull action row, then filters and grid. */
.pull-layout{padding-top:12px}
.pull-layout #pagehead{display:none}
.pull-layout .pull-toolbar{gap:8px;margin-bottom:8px;min-height:32px}
.pull-layout .pull-toolbar>button,.pull-layout .edit-menu summary{padding:6px 11px;line-height:18px}
.pull-layout .pull-toolbar #message{flex:1;min-width:180px;margin:0;padding:5px 9px;border:0;background:transparent;font-size:12px;line-height:20px}
.pull-layout .pull-toolbar #message.error{background:#fff1ef;border-radius:4px}
.pull-layout #pull-pagination{margin-left:auto;gap:8px;flex-wrap:nowrap}
.pull-layout #pull-pagination select{padding:5px 8px;width:80px}
.pull-layout #saved-pull>.card.toolbar{padding:10px 12px;margin-bottom:8px;gap:10px}
.pull-layout #saved-pull>.toolbar label{gap:6px;min-width:0}
.pull-layout #saved-pull input[data-pull-filter]{width:clamp(110px,10vw,180px);padding:6px 8px}
.pull-layout .pull-grid{height:calc(100vh - 180px);min-height:280px}
@media(max-width:900px){.pull-layout .pull-toolbar #message{order:3;flex-basis:100%;padding:2px 0}.pull-layout #saved-pull input[data-pull-filter]{width:130px}.pull-layout .pull-grid{height:65vh}}

.pull-grid tr[data-select-pull]{cursor:pointer}.pull-grid tr.selected-pull td{background:#dceaff!important;border-bottom-color:#8eb1e1}.pull-grid tr.selected-pull td:first-child{box-shadow:inset 3px 0 #2456a6}

.enriched-pull table{width:1505px;min-width:1505px}.enriched-pull th:nth-child(9),.enriched-pull th:nth-child(10){width:145px}

.enriched-pull th:nth-child(3),.enriched-pull th:nth-child(4){width:145px}.enriched-pull th:nth-child(5){width:320px}.enriched-pull th:nth-child(6),.enriched-pull th:nth-child(8){width:100px}.enriched-pull th:nth-child(7),.enriched-pull th:nth-child(9),.enriched-pull th:nth-child(10){width:150px}.enriched-pull td:nth-child(3),.enriched-pull td:nth-child(4),.enriched-pull td:nth-child(3) input,.enriched-pull td:nth-child(4) input{text-align:center}

/* V37 compact monthly overview and identifier columns. */
.enriched-pull table{width:1415px;min-width:1415px}
.enriched-pull th:nth-child(3),.enriched-pull th:nth-child(4){width:100px;text-align:center}
.monthly-overview{display:flex;align-items:center;gap:14px;margin-bottom:14px;position:relative}
.monthly-overview .monthly-metrics{flex:0 0 50%;width:50%;min-width:0;gap:10px;margin:0}
.monthly-overview .metric{min-width:0;padding:6px 10px}
.monthly-overview .metric b{font-size:20px;white-space:nowrap}
.monthly-status{flex:1;min-width:180px;color:#287761;font-size:12px;line-height:1.6}
.monthly-status b,.monthly-status span{display:block}
.monthly-overview .report-basis{flex:0 0 auto;margin:0 0 0 auto;padding:8px 10px}
.monthly-overview .report-basis[open]{position:absolute;right:0;top:0;z-index:10;width:min(900px,100%);max-height:65vh;overflow:auto;box-shadow:0 6px 20px #172a4026}
@media(max-width:1100px){.monthly-overview{flex-wrap:wrap}.monthly-overview .monthly-metrics{flex-basis:100%;width:100%}}
@media(max-width:600px){.monthly-overview .metric{flex-basis:40%}.monthly-overview .metric b{font-size:18px}}

/* V41 responsive commission table. */
.commission-grid{width:calc(100% - 24px);max-width:none}.commission-grid table{width:100%;min-width:1300px}
.commission-grid th:nth-child(1){width:12%}.commission-grid th:nth-child(2){width:8%}.commission-grid th:nth-child(3){width:8%}.commission-grid th:nth-child(4){width:3.5%}.commission-grid th:nth-child(5){width:8.5%}.commission-grid th:nth-child(6){width:3.5%}.commission-grid th:nth-child(7){width:9%}.commission-grid th:nth-child(8){width:3.5%}.commission-grid th:nth-child(9){width:7%}.commission-grid th:nth-child(10){width:7%}.commission-grid th:nth-child(11){width:7%}.commission-grid th:nth-child(12){width:7%}.commission-grid th:nth-child(13){width:16%}

/* V42 shared monthly page width: header, overview and table align. */
.monthly-layout #pagehead,.monthly-layout>#message,.monthly-layout>#content{width:100%;max-width:1800px}
.monthly-layout .commission-grid{width:100%;max-width:none}
.monthly-layout #pagehead{margin-bottom:12px}
.monthly-layout .monthly-overview{margin-bottom:12px}
.monthly-layout .tabs{margin-bottom:10px}

.monthly-layout .allocation-title,.monthly-layout .allocation{width:calc(100% - 24px);margin-left:12px;margin-right:12px}

/* V40 annual table inset, matching the requested red-frame area. */
.annual-layout #content{width:91%;margin-left:3.3%;margin-right:5.7%}
@media(max-width:1100px){.annual-layout #content{width:100%;margin-left:0;margin-right:0}}

/* Apply annual width directly, including when an older script is cached. */
#content:has(> .annual){width:91%;margin-left:3.3%;margin-right:5.7%}
@media(max-width:1100px){#content:has(> .annual){width:100%;margin-left:0;margin-right:0}}

/* Visible build label below the application name. */
header .brand{display:flex;flex-direction:column;justify-content:center;gap:2px}header .brand b{line-height:18px}header .app-version{font-size:10px;line-height:12px;color:#a3b4ca;font-weight:400}
