#clientBillingHost{min-width:0}#clientBillingHost>.card{padding:12px 16px;margin-bottom:10px}#clientBillingHost>.card h2{font-size:17px;margin:0 0 3px}#clientBillingHost>.card p{font-size:12px;margin:0 0 6px}#clientBillingHost>.card label{display:flex;align-items:center;gap:10px;max-width:460px;font-size:12px}.bw-title h2{font-size:20px!important;margin:4px 0!important}.bw-title p{font-size:12px;margin:0 0 10px;color:#526a9a}.bw-tabs{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:10px}.bw-tabs button{padding:7px 12px;min-height:34px;font-size:12px;background:#f5f8ff;color:#193b78;border:1px solid #dbe6f4}.bw-tabs button[aria-pressed=true]{border-bottom:3px solid #d6af36;background:white;color:#143898}.bw-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:10px}.bw-stats>div{display:flex;flex-direction:column;min-width:0;padding:8px 12px;border:1px solid #dae5f5;border-left:3px solid #397cf4;border-radius:9px;background:#fff}.bw-stats>div:nth-child(2){border-left-color:#c49b28}.bw-stats>div:nth-child(3){border-left-color:#24915b}.bw-stats>div:nth-child(4){border-left-color:#d6515f}.bw-stats span,.bw-stats small{font-size:11px;color:#5974a0}.bw-stats strong{font-size:18px;color:#122e66}.bw-toolbar{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-bottom:9px}.bw-toolbar button,.bw-toolbar input,.bw-toolbar select{font-size:12px;min-height:34px;padding:6px 9px}.bw-toolbar>[type=search]{flex:1;min-width:135px;width:auto}.bw-toolbar>span{font-size:11px}.bw-toolbar label{display:flex;gap:5px;align-items:center;font-size:11px}.bw-toolbar input[type=date]{width:132px}.bw-filters{position:relative}.bw-filters[open]{flex-basis:100%;display:flex;gap:8px;flex-wrap:wrap}.bw-table{overflow:auto;background:white;border:1px solid #d7e4f5;border-radius:9px}.bw-table table{width:100%;border-collapse:collapse;font-size:12px}.bw-table th{background:#edf4ff;font-size:11px;color:#214688}.bw-table td,.bw-table th{padding:7px 6px!important;line-height:1.4;vertical-align:middle}.bw-table tr{height:40px}.bw-table tbody tr:nth-child(even){background:#f7faff}.bw-table td{max-width:200px;overflow-wrap:anywhere}.bw-money{white-space:nowrap;text-align:right}.bw-table .badge{padding:3px 5px;font-size:10px;white-space:normal}.bw-link{background:none!important;border:0!important;box-shadow:none!important;color:#2357a2!important;padding:0!important;min-height:0!important;text-align:left;font-size:12px!important}.bw-actions summary{font-size:20px;cursor:pointer;list-style:none;color:#2357a2}.bw-actions[open]>div{display:flex;flex-direction:column;gap:3px}.bw-actions button{font-size:11px;padding:5px;min-height:0}.bw-footer{display:flex;gap:6px;align-items:center;flex-wrap:wrap;font-size:12px;padding:10px 0}.bw-footer>span{margin-right:auto}.bw-footer select,.bw-footer button{font-size:12px;padding:5px 9px;min-height:30px}.bw-footer [aria-current=page]{background:#14365c;color:white}#clientBillingHost [data-cb-report]:empty{display:none}@media(max-width:700px){.bw-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.bw-toolbar>[type=search]{flex-basis:100%}.bw-table table{min-width:1000px}.bw-title h2{font-size:18px!important}.bw-footer>span{flex-basis:100%}.bw-tabs button{padding:6px 9px}.bw-stats strong{font-size:16px}}
#clientBillingHost>.card{display:flex;align-items:center;gap:12px;flex-wrap:wrap}#clientBillingHost>.card h2{font-size:13px;flex:1}#clientBillingHost>.card>p{display:none}#clientBillingHost>.card>label{flex:0 1 420px}#clientBillingHost .bw-footer>.search-combobox{width:155px;flex:0 0 155px}#clientBillingHost .bw-table td,#clientBillingHost .bw-table th{font-size:12px;line-height:16px;padding:5px 6px!important;height:40px;box-sizing:border-box}#clientBillingHost .bw-table summary{padding:0;line-height:20px;min-height:0}#clientBillingHost .bw-table .badge{font-size:10px;line-height:14px}#clientBillingHost .bw-table td:first-child{white-space:nowrap}
#clientBillingHost .bw-footer>.search-combobox{width:190px;flex-basis:190px}
/* Compact period workspace; actions live in the top layer, never in row flow. */
#clientBillingHost .bw-period{display:flex;flex-wrap:wrap;align-items:end;gap:12px;padding:10px 12px;margin:12px 0;background:#f5f8ff;border:1px solid #dbe6f4;border-radius:9px}
#clientBillingHost .bw-period label{display:flex;flex-direction:column;gap:3px;font-size:12px;min-width:0}
#clientBillingHost .bw-period input,#clientBillingHost .bw-period select{height:38px;min-height:38px;padding:6px 9px;font-size:12px;width:145px}
#clientBillingHost .bw-period [data-period-year]{width:90px}#clientBillingHost .bw-period small{font-size:12px;color:#526a9a;align-self:center}
#clientBillingHost .bw-stats{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:12px 0}
#clientBillingHost .bw-stats>div{height:80px;box-sizing:border-box;justify-content:center;box-shadow:0 2px 5px #12305b08;padding:8px 12px}
#clientBillingHost .bw-stats strong{font-size:18px}#clientBillingHost .bw-classification,#clientBillingHost .bw-note{font-size:12px;margin:8px 0 12px;color:#526a9a}
#clientBillingHost .bw-toolbar button,#clientBillingHost .bw-tabs button{height:36px;min-height:36px}
#clientBillingHost .bw-toolbar input,#clientBillingHost .bw-toolbar select{height:38px;min-height:38px}
#clientBillingHost .bw-table tbody tr.bw-selected{background:#EEF5FF!important}#clientBillingHost .bw-table tr.bw-selected td:first-child{box-shadow:inset 3px 0 #1666E8}#clientBillingHost .bw-selected .bw-link{font-weight:600}
#clientBillingHost [data-row-menu]{min-height:30px;height:30px;padding:0 12px;font-size:18px;background:#f3f7ff;color:#164481;border:1px solid #d5e2f5}
.bw-actions[popover]{position:fixed;inset:auto;margin:0;width:210px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;padding:5px;box-sizing:border-box;border:1px solid #d8e3f3;border-radius:9px;background:#fff;box-shadow:0 5px 20px #0e2b5426}
.bw-actions[popover]:popover-open{display:flex;flex-direction:column;gap:2px}.bw-actions[popover] button{font-size:12px;text-align:left;min-height:36px;height:36px;padding:6px 10px;flex-shrink:0;background:#fff;color:#183e78;border:0;box-shadow:none}.bw-actions[popover] button:hover,.bw-actions[popover] button:focus-visible{background:#EEF5FF;outline:2px solid #a6c6f5;outline-offset:-2px}.bw-actions[popover] button:disabled{opacity:.5}
#clientBillingHost .bw-report-actions{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:12px 0}#clientBillingHost .bw-report-actions label{font-size:12px;min-width:240px;max-width:100%}#clientBillingHost .bw-report-actions button{min-height:38px;height:38px;padding:7px 12px;font-size:12px}#clientBillingHost .bw-report-actions select{min-height:38px;height:38px;padding:6px 9px}
@media(max-width:700px){#clientBillingHost .bw-period{gap:8px}#clientBillingHost .bw-period label{flex:1 1 42%}#clientBillingHost .bw-period input,#clientBillingHost .bw-period select,#clientBillingHost .bw-period [data-period-year]{width:100%}#clientBillingHost .bw-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#clientBillingHost .bw-stats strong{font-size:16px}#clientBillingHost .bw-stats>div{padding:8px}#clientBillingHost .bw-report-actions label{flex-basis:100%}}
#clientBillingHost>.card{padding:8px 12px!important;margin-bottom:12px!important;gap:8px!important}#clientBillingHost>.card h2{font-size:15px!important;margin:0!important}#clientBillingHost>.card .search-combobox{max-width:420px}#clientBillingHost .bw-stats strong,#clientBillingHost .bw-stats strong span{font-size:18px!important}#clientBillingHost .bw-table button{margin:0}#clientBillingHost .bw-stats{grid-template-columns:repeat(6,minmax(0,1fr))}@media(max-width:1000px){#clientBillingHost .bw-stats{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:700px){#clientBillingHost .bw-stats{grid-template-columns:repeat(2,minmax(0,1fr))}#clientBillingHost .bw-stats strong,#clientBillingHost .bw-stats strong span{font-size:16px!important}}
#clientBillingHost [data-row-menu]{height:30px!important;min-height:30px!important;padding:0 10px!important;margin:0!important;line-height:20px!important;box-sizing:border-box}
/* Keep client and period controls on one compact desktop line. */
#clientBillingHost>.card label{display:flex!important;flex-direction:row!important;align-items:center!important;margin:0!important;gap:8px!important}#clientBillingHost>.card label>.search-combobox{flex:1;min-width:0;margin:0}#clientBillingHost>.card{min-height:56px!important}#clientBillingHost .bw-title p{display:none}#clientBillingHost .bw-title h2{font-size:18px!important;margin:0 0 8px!important}#clientBillingHost .bw-period{padding:8px 10px;gap:8px;align-items:center}#clientBillingHost .bw-period label{flex-direction:row;align-items:center;gap:5px}#clientBillingHost .bw-period input,#clientBillingHost .bw-period select{width:132px}#clientBillingHost .bw-period [data-period-year]{width:78px}#clientBillingHost .bw-period small{font-size:11px}#clientBillingHost .bw-classification{margin:6px 0 10px}
@media(max-width:1100px){#clientBillingHost .bw-period small{flex-basis:100%}}@media(max-width:700px){#clientBillingHost>.card label{flex-basis:100%!important}#clientBillingHost .bw-period label{flex-direction:column;align-items:stretch}#clientBillingHost .bw-period input,#clientBillingHost .bw-period select,#clientBillingHost .bw-period [data-period-year]{width:100%}}
/* Align actions independently of global table button sizing. */
.bw-actions[popover]{width:224px;padding:4px}
#clientBillingHost .bw-actions[popover] button{display:flex;align-items:center;gap:9px;min-height:32px!important;height:32px!important;padding:5px 8px!important;margin:0!important;font-size:12px!important;line-height:20px;white-space:nowrap;border-radius:5px}
.bw-actions[popover] svg{width:17px;height:17px;flex:0 0 17px}
#clientBillingHost .bw-actions[popover] button>span{color:#344463}
#clientBillingHost .bw-actions[popover] [data-cb-edit]>svg{color:#193b78}
#clientBillingHost .bw-actions[popover] [data-cb-preview]>svg{color:#2563eb}
#clientBillingHost .bw-actions[popover] [data-cb-payment]>svg{color:#148044}
#clientBillingHost .bw-actions[popover] [data-cb-attach]>svg{color:#b7791f}
#clientBillingHost .bw-actions[popover] [data-cb-delete]>svg{color:#ae303b}
#clientBillingHost .bw-actions[popover] [data-cb-delete]{order:9;color:#ae303b;border-top:1px solid #ead8dc;margin-top:3px!important;border-radius:0 0 5px 5px}
#clientBillingHost .bw-actions[popover] [data-cb-delete]:hover{background:#fff0f2}
/* A reserved action rail keeps every invoice row readable while the menu is open. */
.bw-action-slot{margin:0 0 6px;min-width:0}
.bw-actions[popover]:popover-open{flex-direction:row;flex-wrap:wrap;gap:3px;max-width:calc(100vw - 16px)}
#clientBillingHost .bw-actions[popover] [data-cb-delete]{border-top:0;border-left:1px solid #ead8dc;margin-top:0!important;border-radius:5px}
@media(max-width:600px){#clientBillingHost .bw-actions[popover] button{flex:1 1 45%;white-space:normal;height:auto!important;min-height:32px!important}}
.bw-action-slot{scroll-margin:12px}

/* Final UX pass: retain the table and toolbar, align the header controls. */
#clientBillingHost .bw-title{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 10px;margin:0 0 4px;padding:0;min-height:0}
#clientBillingHost .bw-title h2{margin:0!important;line-height:1.25}
#clientBillingHost .bw-heading-controls{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px;margin-left:auto}
#workspace #clientBillingHost .bw-heading-controls>button{min-height:32px;padding:5px 9px;font-size:12px;margin:0}
#clientBillingHost .bw-posting-mode{display:inline-flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:6px;margin:0;padding:4px 8px;min-height:32px;white-space:nowrap;border:1px solid #d4dae2;border-radius:8px;color:#556171;background:#f1f3f5;font-size:11px;line-height:1.25;cursor:pointer;width:auto}
#clientBillingHost .bw-posting-mode[data-active=true]{background:#edf8f0;border-color:#a8d5b4;color:#23613b}
#clientBillingHost .bw-posting-mode small{font-size:10px;font-weight:700;color:inherit}
#clientBillingHost .bw-posting-mode input[role=switch]{appearance:none;position:relative;flex:none;width:30px;height:18px;min-height:18px;margin:0;padding:0;border:0;border-radius:12px;background:#9ca6b3;cursor:pointer}
#clientBillingHost .bw-posting-mode input[role=switch]::after{content:'';position:absolute;width:12px;height:12px;left:3px;top:3px;border-radius:50%;background:#fff}
#clientBillingHost .bw-posting-mode input[role=switch]:checked{background:#2c8b4e}
#clientBillingHost .bw-posting-mode input[role=switch]:checked::after{left:15px}
#clientBillingHost .bw-posting-mode input[role=switch]:focus-visible{outline:2px solid #1666e8;outline-offset:3px}
#clientBillingHost .bw-tabs{margin-bottom:4px}
#workspace #clientBillingHost .bw-tabs button{height:32px;min-height:32px;padding:4px 10px}
#clientBillingHost .bw-period{margin:4px 0;padding:4px 9px}
#clientBillingHost .bw-period .search-combobox{margin-top:0}
#workspace #clientBillingHost .bw-period input,#workspace #clientBillingHost .bw-period select{height:32px;min-height:32px;padding-top:4px;padding-bottom:4px}
#clientBillingHost .bw-period .search-combobox>input{padding-top:4px!important;padding-bottom:4px!important}
#clientBillingHost .bw-period .combobox-toggle{height:30px;min-height:30px!important;padding:5px!important}
#clientBillingHost .bw-period .ui-search-field:before{top:8px}
#clientBillingHost .bw-period .ui-search-field:after{top:22px}
#clientBillingHost .bw-stats{margin:4px 0;gap:6px}
#clientBillingHost .bw-stats>div{height:auto;min-height:54px;padding:4px 10px}
#clientBillingHost .bw-stats span,#clientBillingHost .bw-stats small{line-height:16px}
#clientBillingHost .bw-stats strong{line-height:22px}
#clientBillingHost .bw-classification,#clientBillingHost .bw-note{margin:2px 0;line-height:16px}
#clientBillingHost .bw-toolbar{gap:5px;margin:5px 0}
#workspace #clientBillingHost .bw-toolbar>button,#workspace #clientBillingHost .bw-toolbar>input{height:34px;min-height:34px;padding-top:4px;padding-bottom:4px}
#workspace #clientBillingHost .bw-toolbar>details>summary{min-height:34px;padding-top:5px;padding-bottom:5px}
#clientBillingHost .bw-invoice-table td,#clientBillingHost .bw-invoice-table th{padding-left:5px!important;padding-right:5px!important}
#clientBillingHost .bw-invoice-table [data-bw-posting]{min-width:112px}
@media(max-width:850px){#clientBillingHost .bw-heading-controls{margin-left:0}}

/* Client fiscal strip: the approved metrics/rows remain compact. */
#clientBillingHost .bw-fiscal-strip{display:grid;grid-template-columns:repeat(5,minmax(0,1fr)) minmax(0,1.7fr);gap:4px;overflow:visible}
#clientBillingHost .bw-fiscal-strip[data-metrics="7"]{grid-template-columns:repeat(5,minmax(0,1fr)) minmax(0,1.7fr) minmax(0,.9fr)}
#clientBillingHost .bw-fiscal-strip[data-metrics="8"]{grid-template-columns:repeat(5,minmax(0,1fr)) minmax(0,1.7fr) repeat(2,minmax(0,.9fr))}
#clientBillingHost .bw-fiscal-strip>div{min-width:0;padding:4px 6px;border-left-color:#397cf4}
#clientBillingHost .bw-fiscal-strip strong{line-height:22px;overflow-wrap:anywhere}
#clientBillingHost .bw-fiscal-strip>div:nth-child(n+6) strong{font-size:12px!important;line-height:17px}
#clientBillingHost .bw-fiscal-strip .bw-fiscal-pay{background:#fff3f4;border-left-color:#cb4156}
#clientBillingHost .bw-fiscal-pay strong{color:#a72840}
#clientBillingHost .bw-fiscal-strip .bw-fiscal-credit{background:#fff8e8;border-left-color:#c79620}
#clientBillingHost .bw-fiscal-credit strong{color:#8c640e}
#workspace #clientBillingHost .bw-fiscal-strip>div.bw-fiscal-credit{background:#fff8e8!important;border-color:#e5cb81!important}
#workspace #clientBillingHost .bw-fiscal-strip>div.bw-fiscal-credit strong{color:#8c640e!important}
#workspace #clientBillingHost .bw-fiscal-strip>div.bw-fiscal-pay{background:#fff3f4!important;border-color:#e4a8b3!important}
#workspace #clientBillingHost .bw-fiscal-strip>div.bw-fiscal-pay strong{color:#a72840!important}
#clientBillingHost .bw-table{min-height:0;height:auto}
.bw-treatment{max-width:580px;width:calc(100% - 32px);padding:22px;border:1px solid #c6d7ec;border-radius:10px;color:#153759}
.bw-treatment::backdrop{background:#0c294d66}.bw-treatment label{display:block;margin:12px 0}.bw-treatment label>input:not([type=checkbox]),.bw-treatment select{display:block;width:100%;margin-top:5px}.bw-treatment footer{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
@media(max-width:850px){#clientBillingHost .bw-fiscal-strip[data-metrics]{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* Only the billing surface follows its content; the shared shell stays unchanged. */
@media screen{.v5 #workspace[data-active-area="clientBilling"] .workspace-layout>.container{height:auto;max-height:100%;min-height:0;align-self:start;padding-bottom:12px}#workspace[data-active-area="clientBilling"] .workspace-layout>.container>.footer{padding:6px 0;margin:0}}
#clientBilling.panel.active,#clientBillingHost,#clientBillingHost [data-cb-content]{height:auto;min-height:0}
#clientBillingHost .bw-footer{margin:0;padding:6px 0;min-height:0;align-items:center}
#workspace #clientBillingHost .bw-footer>.search-combobox{width:140px;flex:0 0 140px}
#workspace #clientBillingHost .bw-footer>.search-combobox>input{min-height:32px;height:32px;font-size:12px;padding:4px 32px 4px 26px!important}
#workspace #clientBillingHost .bw-footer .combobox-toggle{height:30px;min-height:30px!important;width:28px;padding:5px!important}
#clientBillingHost [data-posting-load-notice]{display:flex;align-items:center;gap:8px;margin:4px 0;padding:6px 9px;border:1px solid #e0c791;border-radius:6px;background:#fff8e8;color:#795919;font-size:12px}
/* Two fixed text lines in accounting cells; full notices never enter row flow. */
#clientBillingHost .bw-posting-summary{display:flex;flex-direction:column;gap:3px;width:148px;max-width:100%;min-width:0}
#clientBillingHost .bw-posting-summary>.bw-posting-status{display:block;box-sizing:border-box;width:100%;max-width:100%;height:21px;min-height:21px;margin:0;padding:2px 5px;font-family:inherit;font-size:10px;line-height:15px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:none;transform:none}
#clientBillingHost .bw-posting-summary>button.bw-posting-status{cursor:pointer;min-height:21px!important}
#clientBillingHost .bw-posting-summary>[data-review-entry]{display:block;width:100%;height:17px;min-height:17px;line-height:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#clientBillingHost dialog.bw-posting-detail{position:fixed;inset:0;margin:auto;box-sizing:border-box;width:380px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);padding:16px;border:1px solid #d7e2ee;border-top:3px solid #c49a32;border-radius:9px;background:#fff;color:#193b65;box-shadow:0 12px 40px #142f542e;overflow:auto;font:13px/1.5 Inter,Arial,sans-serif}
#clientBillingHost dialog.bw-posting-detail::backdrop{background:#17324d26;backdrop-filter:none}
#clientBillingHost dialog.bw-posting-detail>header{display:block;margin:0;padding:0;border:0;background:none;color:#805d13;font:inherit}
#clientBillingHost dialog.bw-posting-detail[data-tone=b-danger]{border-top-color:#bd3347}
#clientBillingHost dialog.bw-posting-detail[data-tone=b-danger]>header{color:#a3263b}
#clientBillingHost dialog.bw-posting-detail>p{margin:10px 0 14px;padding:0;white-space:normal;overflow-wrap:anywhere}
#clientBillingHost dialog.bw-posting-detail>footer{display:flex;justify-content:flex-end;margin:0;padding:0}
#clientBillingHost dialog.bw-posting-detail [data-close-detail]{min-height:30px;padding:4px 12px;border:1px solid #cbd8e7;border-radius:6px;background:#f4f8ff;color:#214d80;font:inherit;box-shadow:none}
