/* Invoicing shares the Hub's slate headers, blue controls and compact rhythm. */
#work-shell :is(#view-single-invoice,.single-invoice){min-width:0;max-width:1160px}
#work-shell .single-invoice-form{display:block;max-width:none;padding:0;border:0;background:transparent}
#work-shell .single-invoice-form button{margin:0}
#work-shell .invoice-panel{min-width:0;border:1px solid #cbd7e4;border-radius:6px;background:#fff;margin:0 0 16px;padding:16px 18px}
#work-shell .invoice-panel>h2{font-size:15px;line-height:22px;margin:-16px -18px 14px;padding:10px 18px;background:#ccddeB;border-radius:5px 5px 0 0;border-bottom:1px solid #b3c7d9;color:#243c59;font-weight:700}
#work-shell :is(.invoice-panel,.invoice-catalog-form) label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:600;color:#465871;margin:0;min-width:0}
#work-shell :is(.invoice-panel,.invoice-catalog-form) :is(input,select,textarea){box-sizing:border-box;width:100%;min-width:0;max-width:100%;border:1px solid #bfcbd9;border-radius:4px;background:#fff;color:#22364c;font-family:inherit;font-size:13px;font-weight:400;line-height:20px;box-shadow:none}
#work-shell :is(.invoice-panel,.invoice-catalog-form) :is(input,select){height:34px;min-height:34px;padding:6px 9px}
#work-shell :is(.invoice-panel,.invoice-catalog-form) input[readonly]{background:#f1f4f8;color:#64748b}
#work-shell :is(.invoice-panel,.invoice-catalog-form) :is(input,select,textarea):focus{outline:2px solid #91b6d7;outline-offset:1px}
#work-shell .invoice-client-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px 22px}
#work-shell .invoice-client-field{position:relative}
#work-shell .invoice-client-field>input[type=search]{width:100%}
#work-shell .invoice-client-matches:empty{display:none}
#work-shell .invoice-client-matches:not(:empty){position:absolute;top:100%;left:0;right:0;z-index:5;background:white;box-shadow:0 5px 14px #243c5920;border:1px solid #bfcbd9;border-radius:4px;padding:4px;max-height:260px;overflow-y:auto;display:grid;gap:2px}
#work-shell .invoice-client-matches button{width:100%;text-align:left;border:0;background:#f1f6fb;color:#264b6c;padding:9px 10px}
#work-shell .invoice-client-matches p{margin:8px;font-weight:400}
#work-shell .invoice-panel .date-entry{width:100%;margin:0;min-width:0}
#work-shell .invoice-panel .date-entry-text{width:100%;min-width:0}
#work-shell .invoice-lines-wrap{min-width:0;max-width:100%;overflow-x:auto;border:1px solid #cbd7e4;border-radius:4px}
#work-shell .invoice-lines-table{width:100%;min-width:850px;border-collapse:collapse;table-layout:fixed}
#work-shell .invoice-lines-table th{background:#eaf0f7;color:#334a65;font-size:12px;font-weight:600;padding:10px;text-align:left;border-bottom:1px solid #cbd7e4;white-space:nowrap}
#work-shell .invoice-lines-table td{padding:12px 10px;border-bottom:1px solid #e1e7ef;vertical-align:top;background:#fff}
#work-shell .invoice-lines-table tr:last-child td{border-bottom:0}
#work-shell .invoice-lines-table th:nth-child(1){width:13%}
#work-shell .invoice-lines-table th:nth-child(2){width:auto}
#work-shell .invoice-lines-table th:nth-child(3){width:13%}
#work-shell .invoice-lines-table th:nth-child(4){width:9%}
#work-shell .invoice-lines-table th:nth-child(5){width:120px}
#work-shell .invoice-lines-table th:nth-child(6){width:124px;text-align:right}
#work-shell .invoice-lines-table th:nth-child(7){width:5%}
#work-shell .invoice-lines-table :is(th,td):nth-child(5){padding-left:6px;padding-right:6px}
#work-shell .invoice-lines-table td:first-child select+select{margin-top:7px}
#work-shell .invoice-lines-table textarea{display:block;padding:7px 9px;resize:vertical;min-height:56px;line-height:20px}
#work-shell .invoice-lines-table :is(input,select,textarea){font-size:13px}
#work-shell .invoice-tax-rate{display:flex;gap:5px;align-items:center;margin-top:7px}
#work-shell .invoice-tax-rate input{flex:1;width:0}
#work-shell .invoice-tax-rate span{font-size:12px;color:#64748b}
#work-shell .invoice-line-amount{text-align:right;padding-top:20px!important;white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:600}
#work-shell .invoice-lines-table td:last-child{padding-left:2px;padding-right:8px;text-align:right}
#work-shell .invoice-lines-table td:last-child>button{height:32px;min-width:30px;padding:4px;background:#edf4fb;border:1px solid #b6ccdf;border-radius:4px;color:#2d658f;font-size:13px;line-height:20px}
#work-shell .invoice-line-tools{display:flex;gap:8px;margin-top:12px}
#work-shell .invoice-line-tools>button{background:#e5eff8;border:1px solid #a7bfd4;color:#274f72;padding:7px 12px;font-size:12px}
#work-shell .invoice-bottom-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}
#work-shell .invoice-bottom-grid .invoice-panel{margin-bottom:12px}
#work-shell .invoice-panel[data-invoice-section=tax]>p{font-size:12px;line-height:19px;color:#64748b;margin:9px 0 0}
#work-shell .invoice-summary-values{width:100%;font-size:13px;color:#465871}
#work-shell .invoice-summary-values>div{display:flex;justify-content:space-between;gap:20px;padding:6px 0;font-variant-numeric:tabular-nums}
#work-shell .invoice-summary-values strong{color:#243c59}
#work-shell .invoice-summary-values>div:last-child{font-size:17px;font-weight:700;padding-top:11px;margin-top:5px;border-top:1px solid #d6e0eb}
#work-shell .invoice-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;padding:4px 0}
#work-shell .invoice-actions button{padding:9px 16px;border-radius:4px;font-size:13px}
/* Clear is neutral; issuing uses the shared permission palette. */
#work-shell .invoice-actions>.invoice-clear-action{background:#e5eff8;border-color:#b7cde1;color:#315f86}
#work-shell .invoice-actions>.invoice-clear-action:hover:not(:disabled){background:#d7e7f5;border-color:#8eafcd}
#work-shell .invoice-actions>.invoice-clear-action:focus-visible{outline-color:#5c86ad}
#work-shell .invoice-actions>.invoice-preview-action:focus-visible{outline-color:#5c86ad}
#work-shell .single-invoice-form>p[role=status]:empty{display:none}
#work-shell .invoice-catalog-settings{width:100%;min-width:0;border:1px solid #cbd7e4;border-radius:6px;background:white;box-sizing:border-box;overflow:hidden}
#work-shell .invoice-catalog-header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:15px 18px;border-bottom:1px solid #dce4ed}
#work-shell .invoice-catalog-header h2{margin:0;color:#243c59;font-size:15px;line-height:22px}
#work-shell .invoice-catalog-header p{margin:3px 0 0;font-size:12px;color:#64748b}
#work-shell .invoice-catalog-header>button{flex:none;margin:0;min-height:34px;font-size:12px;padding:7px 12px}
#work-shell .invoice-catalog-scroll{overflow-x:auto}
#work-shell .invoice-catalog-table{width:100%;min-width:790px;border-collapse:collapse;table-layout:fixed;font-size:13px}
#work-shell .invoice-catalog-table th{background:#eaf0f7;color:#334a65;font-size:12px;text-align:left;font-weight:600;padding:11px 12px;border-bottom:1px solid #cbd7e4}
#work-shell .invoice-catalog-table td{padding:13px 12px;border-bottom:1px solid #e1e7ef;vertical-align:middle;overflow-wrap:anywhere}
#work-shell .invoice-catalog-table tr:nth-child(even) td{background:#f7f9fc}
#work-shell .invoice-catalog-table tr:last-child td{border-bottom:0}
#work-shell .invoice-catalog-table th:nth-child(1){width:14%}
#work-shell .invoice-catalog-table th:nth-child(2){width:38%}
#work-shell .invoice-catalog-table th:nth-child(3){width:15%}
#work-shell .invoice-catalog-table th:nth-child(4){width:15%}
#work-shell .invoice-catalog-table th:nth-child(5){width:18%}
#work-shell .invoice-catalog-table td:nth-child(1){font-weight:600;color:#304e6c}
#work-shell .invoice-catalog-table .invoice-description{white-space:pre-wrap;line-height:20px}
#work-shell .invoice-catalog-row-actions button{margin:3px 6px 3px 0;white-space:nowrap}
#work-shell .invoice-catalog-table td strong{display:block;font-weight:600}
#work-shell .invoice-catalog-table td p{margin:4px 0 0;font-size:12px;color:#64748b;line-height:18px}
#work-shell .invoice-catalog-table button{font-size:12px;padding:5px 10px;margin:0}
#work-shell .invoice-config-missing{color:#8a6228;font-size:12px}
#work-shell .invoice-service-status{display:inline-block;padding:3px 7px;border:1px solid #bfd5df;border-radius:4px;background:#edf5f8;color:#325d6b;white-space:nowrap;font-size:11px}
#work-shell .invoice-service-status.inactive{background:#f0f2f5;border-color:#d5dce4;color:#64748b}
#work-shell .invoice-catalog-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 22px;padding:18px;margin:0;max-width:none;border:0;background:white}
#work-shell .invoice-field-wide{grid-column:1/-1}
#work-shell .invoice-catalog-form label[hidden]{display:none}
#work-shell .invoice-catalog-footer{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid #dce4ed;margin-top:3px;padding-top:15px}
#work-shell .invoice-catalog-footer .invoice-active-toggle{display:flex;flex-direction:row;align-items:center;gap:8px;font-size:13px;font-weight:400}
#work-shell .invoice-catalog-footer input[type=checkbox]{width:16px;height:16px;min-height:16px;min-width:16px;margin:0;padding:0}
#work-shell .invoice-catalog-actions{display:flex;gap:8px}
#work-shell .invoice-catalog-actions button{margin:0;padding:7px 14px;font-size:12px}
#work-shell .invoice-catalog-actions button:first-child{background:white;border:1px solid #bfcbd9;color:#465871}
#work-shell .invoice-feedback{font-size:13px;line-height:20px;color:#465871}
.invoice-preview{width:min(950px,94vw)}
.invoice-preview table{width:100%;border-collapse:collapse}
.invoice-preview :is(th,td){padding:8px;border-bottom:1px solid #d4dee9;text-align:left;white-space:pre-wrap}
.invoice-preview section{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.invoice-preview section>p{width:100%}
.invoice-tax-warning{color:#963c20;background:#fff0d4;border:1px solid #dfbc74;padding:7px 10px;border-radius:4px}
.invoice-preview section>label{display:flex;gap:8px;align-items:center;flex-basis:100%;max-width:none;font-weight:400}
.invoice-preview input[type=checkbox]{width:16px;height:16px;min-width:16px;min-height:16px;padding:0;flex:none;box-shadow:none}
.invoice-preview>div{margin-left:auto;width:min(330px,100%)}
.invoice-number-result{display:flex;align-items:center;gap:10px}
.invoice-number-result input{max-width:260px;background:#edf2f7}
@media(max-width:700px){
 #work-shell .invoice-client-grid,#work-shell .invoice-bottom-grid,#work-shell .invoice-catalog-form{grid-template-columns:minmax(0,1fr)}
 #work-shell .invoice-panel{padding:13px}
 #work-shell .invoice-panel>h2{margin:-13px -13px 14px;padding-left:13px;padding-right:13px}
 #work-shell .invoice-catalog-header{padding:13px;align-items:flex-start;flex-wrap:wrap}
 #work-shell .invoice-catalog-form{padding:13px}
 #work-shell .invoice-catalog-footer{align-items:flex-start;flex-wrap:wrap}
 #work-shell .invoice-lines-wrap,#work-shell .invoice-catalog-scroll{max-width:100%}
 .invoice-preview{max-width:94vw;overflow-x:auto}
}

#work-shell .invoice-catalog-form textarea{padding:8px 9px;min-height:82px;resize:both;white-space:pre-wrap}
#work-shell .invoice-date-settings{margin-bottom:16px}
#work-shell .invoice-preferences-form{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;padding:15px 18px;border:0;margin:0;max-width:none;background:white}
#work-shell .invoice-preferences-form label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#465871}
#work-shell .invoice-preferences-form input{width:130px;height:34px;box-sizing:border-box}
#work-shell .invoice-preferences-form button{height:34px;margin:0;font-size:12px;padding:6px 12px}
#work-shell .invoice-preferences-form p{flex-basis:100%;font-size:12px;color:#64748b;margin:0}
#work-shell .invoice-lines-table td:last-child>button>.hub-module-icon{width:16px;height:16px;margin:0;vertical-align:middle}
#work-shell .hub-menu #single-invoice-nav:not(.active){background:transparent;border-color:transparent;color:#e6eef8;box-shadow:none}
#work-shell>aside #single-invoice-subnav{display:flex;flex-direction:column;gap:4px;margin-top:3px;margin-bottom:8px}
#work-shell>aside #single-invoice-subnav[hidden]{display:none!important}
#work-shell>aside #single-invoice-subnav button{display:block;width:100%;margin:0;text-align:left;border:1px solid transparent;border-radius:5px;background:transparent;color:#e6eef8;font-size:12px;padding:8px 9px;min-height:36px}
#work-shell>aside #single-invoice-subnav button.active{background:#365c83;border-color:#587b9d;color:white;box-shadow:inset 3px 0 #9ac5e6}
#work-shell>aside #single-invoice-subnav button:focus-visible{outline:2px solid #9ac5e6;outline-offset:2px}
#work-shell>aside #year-end-nav .year-end-module-icon{color:inherit}
@media(max-width:700px){#work-shell>aside #single-invoice-subnav button{min-height:44px}}
.invoice-task-toolbar{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin:16px 0}
.invoice-task-toolbar label{display:flex;flex-direction:column;gap:5px;font-size:12px}
.invoice-task-toolbar :is(input,select,button){min-height:34px;box-sizing:border-box;font-size:13px}
.invoice-task-toolbar select{max-width:240px}
.invoice-task-counts{display:flex;flex-wrap:wrap;gap:8px 20px;background:#eaf0f7;border:1px solid #cbd7e4;padding:12px;margin-bottom:14px;border-radius:5px;font-size:13px;color:#334a65}
.invoice-task-table-wrap{overflow:auto;border:1px solid #cbd7e4;border-radius:5px;background:white}
.invoice-task-table-wrap table{width:100%;min-width:850px;border-collapse:collapse;font-size:13px}
.invoice-task-table-wrap th{background:#eaf0f7;color:#334a65;padding:11px;text-align:left}
.invoice-task-table-wrap td{padding:12px 11px;border-top:1px solid #dce4ed}
.invoice-task-table-wrap tr:nth-child(even) td{background:#f7f9fc}
.invoice-task-table-wrap button{font-size:12px;padding:6px 10px;white-space:nowrap}
.invoice-task-detail .invoice-catalog-actions{display:flex;gap:8px;flex-wrap:wrap}
.invoice-task-detail li{margin:8px 0;line-height:20px}
#work-shell .invoice-catalog-table .invoice-catalog-row-actions>.invoice-catalog-action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;align-items:start}
#work-shell .invoice-catalog-table .invoice-catalog-row-actions>.invoice-catalog-action-grid>button{margin:0;min-width:0;min-height:28px;padding:4px 6px;line-height:18px}
#work-shell #view-task-statistics .invoice-task-heading::before{content:none;display:none}
#work-shell #view-task-statistics .invoice-task-heading{display:flex;align-items:center;gap:8px}
#work-shell #view-task-statistics .invoice-task-heading>.hub-module-icon{width:34px;height:34px;padding:6px;box-sizing:border-box;border:1px solid #9bbdde;background:#d7e7f7;border-radius:6px;margin:0}
#work-shell #task-management-subnav>button{display:grid;grid-template-columns:16px minmax(0,1fr);gap:6px;padding:8px 7px;white-space:nowrap}
#work-shell #task-management-subnav>button>.hub-module-icon{width:16px;height:16px;margin:0}

#work-shell .invoice-catalog-form .invoice-negative-toggle{grid-column:1/-1;display:flex;flex-direction:row;align-items:center;gap:8px;font-size:13px;font-weight:400}
#work-shell .invoice-catalog-form .invoice-negative-toggle input{width:16px;height:16px;min-height:16px;flex:none;padding:0;margin:0}
