/* Color belongs to the icon surface; report headers and document colors remain intact. */
.vertex-desktop :where(.btn:has(>svg),.icon-button){--workspace-icon-bg:#deebfb;--workspace-icon-ink:#214f86;--workspace-icon-border:#a4bfdf}
.vertex-desktop [data-vx*="customer"],.vertex-desktop [data-vx*="receipt"],.vertex-desktop [data-page="customers"]{--workspace-icon-bg:#dcecff;--workspace-icon-ink:#165291;--workspace-icon-border:#9dbfe5}
.vertex-desktop [data-vx*="supplier"],.vertex-desktop [data-vx*="purchase"],.vertex-desktop [data-page="suppliers"]{--workspace-icon-bg:#fff0d0;--workspace-icon-ink:#714c09;--workspace-icon-border:#dabe83}
.vertex-desktop [data-vx*="item"],.vertex-desktop [data-vx*="stock"],.vertex-desktop [data-vx*="warehouse"]{--workspace-icon-bg:#def0e2;--workspace-icon-ink:#25633a;--workspace-icon-border:#a0c9ae}
.vertex-desktop [data-vx*="financial"],.vertex-desktop [data-vx*="account"],.vertex-desktop [data-vx*="chart"]{--workspace-icon-bg:#eee4fb;--workspace-icon-ink:#634087;--workspace-icon-border:#c3a9de}
.vertex-desktop [data-vx*="sale"],.vertex-desktop [data-vx*="transfer"]{--workspace-icon-bg:#d8f0f0;--workspace-icon-ink:#205e65;--workspace-icon-border:#92c5cb}
.vertex-desktop [data-vx*="payment"],.vertex-desktop [data-vx*="logout"],.vertex-desktop [data-vx*="exit"]{--workspace-icon-bg:#ffe2e3;--workspace-icon-ink:#943238;--workspace-icon-border:#dfaaad}
.vertex-desktop [data-vx*="whatsapp"]{--workspace-icon-bg:#d7f4df;--workspace-icon-ink:#176b34;--workspace-icon-border:#98d3aa}
.vertex-desktop .btn>svg{box-sizing:border-box;background:var(--workspace-icon-bg,#deebfb);color:var(--workspace-icon-ink,#214f86);border:1px solid var(--workspace-icon-border,#a4bfdf);border-radius:3px;padding:2px}
.vertex-desktop #desktopToolbar .vx-shortcut>.btn>svg{width:25px!important;height:19px!important;fill:none!important;stroke:var(--workspace-icon-ink,#214f86)!important;background:var(--workspace-icon-bg,#deebfb)!important;border-color:var(--workspace-icon-border,#a4bfdf)!important}
.vertex-desktop #desktopToolbar .vx-shortcut>.btn>svg.vx-whatsapp-icon{stroke:none!important}
.vertex-desktop .icon-button:not(.modal-close):not(.vx-window-close){background:var(--workspace-icon-bg,#deebfb);color:var(--workspace-icon-ink,#214f86);border-color:var(--workspace-icon-border,#a4bfdf)}
.vertex-desktop .btn:has(>svg):hover>svg{filter:brightness(.95);border-color:var(--workspace-icon-ink,#214f86)}
.vertex-desktop #desktopToolbar .vx-shortcut>.btn:focus-visible,.vertex-desktop .btn:has(>svg):focus-visible,.vertex-desktop .icon-button:focus-visible{outline:2px solid #1f5f99!important;outline-offset:1px!important}
.ve-resize:focus-visible{outline:2px solid #125e9f;background:#b6d7f1;outline-offset:-1px}
.ve-grid-options small{display:block;max-width:250px;line-height:1.6;color:#34495e}
@media print{.workspace-empty,.ve-resize,.ve-grid-options{display:none!important}}

/* Only query forms are compacted. Document entry, master cards and report cells
   deliberately have no selector here. Side panels keep their own full-width fields. */
@media screen{
 .vertex-desktop :where(#homePeriodFilter,#itemReportFilter,#vxReportFilter,#vxFinancialFilter,#vxTaxFilter,#ceReportFilter,#listDates,#monthlyLedgerFilter,#supplierStatementFilter,#itemCardFilter,#accountCardFilter,#customerStatementFilter,#desktopAccountForm,.report-controls){box-sizing:border-box;min-width:0;max-width:100%}
 .vertex-desktop :where(#homePeriodFilter,#vxReportFilter,#vxFinancialFilter,#vxTaxFilter,#ceReportFilter,#monthlyLedgerFilter,#supplierStatementFilter,#itemCardFilter,#accountCardFilter,#customerStatementFilter,#desktopAccountForm){display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px 10px}
 .vertex-desktop :where(#itemReportFilter,#listDates,.report-controls)>.form-grid{display:flex!important;flex-wrap:wrap!important;align-items:flex-end;gap:8px 10px!important;width:100%;margin-bottom:8px}
 .vertex-desktop :where(#homePeriodFilter,#itemReportFilter,#vxReportFilter,#vxFinancialFilter,#vxTaxFilter,#ceReportFilter,#listDates,#monthlyLedgerFilter,#supplierStatementFilter,#itemCardFilter,#accountCardFilter,#customerStatementFilter,#desktopAccountForm,.report-controls) :is(.form-group,.form-grid>label),
 .vertex-desktop :where(#vxReportFilter,#vxFinancialFilter,#monthlyLedgerFilter)>label:has(input:not([type=checkbox]):not([type=radio])){--query-width:240px;display:flex;flex-direction:column;align-items:stretch;gap:4px;flex:0 1 var(--query-width);width:var(--query-width);max-width:100%;min-width:0;margin:0}
 .vertex-desktop :where(#homePeriodFilter,#itemReportFilter,#vxReportFilter,#vxFinancialFilter,#vxTaxFilter,#ceReportFilter,#listDates,#monthlyLedgerFilter,#supplierStatementFilter,#itemCardFilter,#accountCardFilter,#customerStatementFilter,#desktopAccountForm,.report-controls) :is(.form-group,.form-grid>label):has(select){--query-width:200px}
 .vertex-desktop :where(#homePeriodFilter,#itemReportFilter,#vxReportFilter,#vxFinancialFilter,#vxTaxFilter,#ceReportFilter,#listDates,#monthlyLedgerFilter,#supplierStatementFilter,#itemCardFilter,#accountCardFilter,#customerStatementFilter,#desktopAccountForm,.report-controls) :is(.form-group,.form-grid>label):has(input:is([type=date],[type=month])),
 .vertex-desktop #monthlyLedgerFilter>label:has(input[type=date]){--query-width:145px}
 .vertex-desktop :where(#vxReportFilter,#ceReportFilter) .form-group:has(input[type=number]){--query-width:110px}
 .vertex-desktop :where(#homePeriodFilter,#itemReportFilter,#vxReportFilter,#vxFinancialFilter,#vxTaxFilter,#ceReportFilter,#listDates,#monthlyLedgerFilter,#supplierStatementFilter,#itemCardFilter,#accountCardFilter,#customerStatementFilter,#desktopAccountForm,.report-controls) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=button]):not([type=submit]),select,.master-combo){box-sizing:border-box;width:100%;max-width:100%;min-width:0}
 .vertex-desktop :where(#homePeriodFilter,#itemReportFilter,#vxReportFilter,#vxFinancialFilter,#vxTaxFilter,#ceReportFilter,#listDates,#monthlyLedgerFilter,#supplierStatementFilter,#itemCardFilter,#accountCardFilter,#customerStatementFilter,#desktopAccountForm,.report-controls) :is(input[type=date],input[type=month]){height:28px;min-height:28px;padding-inline:4px}
 .vertex-desktop :where(#itemReportFilter,#vxReportFilter,#vxFinancialFilter,#vxTaxFilter,#ceReportFilter,#listDates,#monthlyLedgerFilter,#supplierStatementFilter,#itemCardFilter,#accountCardFilter,#customerStatementFilter,#desktopAccountForm,.report-controls) :is(select,input[type=search],input[type=text],input[type=number]){height:28px;min-height:28px}
 .vertex-desktop :where(#vxReportFilter,#vxFinancialFilter,#ceReportFilter)>label:has(input:is([type=checkbox],[type=radio])){display:flex;align-items:center;gap:4px;max-width:100%;min-height:28px}
 .vertex-desktop :where(#listDates,#itemReportFilter,.report-controls){padding:8px!important}

 /* Classic report/tree sidebars were only 118–133px, too narrow for dates and
    account names. New sales/customer panels already provide the intended size. */
 .vertex-desktop .vp-workspace:not(.cd-workspace):not(.sales-register-workspace):has(>.vp-sidebar :is(input,select)){grid-template-columns:minmax(0,1fr) 245px;gap:10px}
 .vertex-desktop .vp-sidebar:has(:is(input,select)){box-sizing:border-box;min-width:0;padding:8px;gap:8px}
 .vertex-desktop .vp-sidebar :is(#itemReportFilter,#vxReportFilter,#vxFinancialFilter,#vxTaxFilter,#ceReportFilter,#listDates,#monthlyLedgerFilter,#supplierStatementFilter,#itemCardFilter,#accountCardFilter,#customerStatementFilter,#desktopAccountForm,.report-controls),
 .vertex-desktop .vp-sidebar :is(#itemReportFilter,#listDates,.report-controls)>.form-grid{flex-direction:column!important;align-items:stretch!important;gap:8px!important}
 .vertex-desktop .vp-sidebar :is(.form-group,.form-grid>label),.vertex-desktop .vp-sidebar form>label:has(input:not([type=checkbox]):not([type=radio])){flex:0 0 auto!important;width:100%!important;max-width:100%;min-width:0;align-items:stretch!important}
 .vertex-desktop .vp-sidebar :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,.master-combo),
 .vertex-desktop :is(.sales-register-side,.cd-sidebar,.cw-filters,.irv-sidebar) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,.master-combo){box-sizing:border-box;width:100%!important;max-width:100%;min-width:0}
 .vertex-desktop .vp-sidebar:not(.cd-sidebar) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select){height:28px!important;min-height:28px!important}
 .vertex-desktop .irv-workspace{grid-template-columns:minmax(0,1fr) 245px;gap:10px}
 .vertex-desktop .vx-report-tools{box-sizing:border-box;width:245px;padding:8px;gap:8px}
 .vertex-desktop .vx-report-tools input[type=search]{box-sizing:border-box;width:100%;min-width:0;height:28px}
 .vertex-desktop .vx-report-tools+.vx-records-grid{margin-right:255px}
}
@media screen and (max-width:800px){
 .vertex-desktop .vp-workspace:not(.cd-workspace):not(.sales-register-workspace):has(>.vp-sidebar :is(input,select)),.vertex-desktop .irv-workspace{grid-template-columns:minmax(0,1fr);height:auto;min-height:0}
 .vertex-desktop .vp-workspace:not(.cd-workspace):not(.sales-register-workspace)>.vp-sidebar:has(:is(input,select)){grid-row:1;position:static;max-height:none}
 .vertex-desktop .vx-report-tools{float:none;position:static;width:100%;flex-direction:row;flex-wrap:wrap;align-items:flex-end}
 .vertex-desktop .vx-report-tools .form-group{width:min(240px,100%);max-width:100%}
 .vertex-desktop .vx-report-tools+.vx-records-grid{margin-right:0}
}
@media screen and (max-width:480px){
 .vertex-desktop :is(.sales-register-side,.cd-sidebar) :is(form,.form-grid),.vertex-desktop .irv-sidebar{grid-template-columns:minmax(0,1fr)!important}
}
/* Shared report navigation and Gregorian date popup. */
.wu-report-navigation{display:flex;align-items:center;gap:4px;position:sticky;top:0;z-index:4;background:#edf3fa;padding:4px;border:1px solid #b4c5d8;flex-wrap:wrap}.wu-report-navigation .btn{padding:3px 8px;min-height:26px}.wu-report-navigation output{font-size:12px;margin-inline-start:8px}.wu-current-row>td{outline:1px solid #2e78b7;outline-offset:-1px;background-color:#e1efff!important}.wu-calendar{position:fixed;z-index:2147483000;direction:rtl;width:280px;box-sizing:border-box;padding:10px;background:white;border:1px solid #8196aa;box-shadow:0 4px 18px #0004;border-radius:5px;font-family:Arial,sans-serif}.wu-calendar-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.wu-calendar button{cursor:pointer;border:1px solid #bdcad6;background:#f0f5fa;border-radius:3px;min-height:28px}.wu-calendar button:disabled{opacity:.4;cursor:default}.wu-calendar-days{display:grid;grid-template-columns:repeat(7,1fr);gap:3px;text-align:center;margin-bottom:8px}.wu-calendar [aria-current=date]{background:#1769aa;color:white}.wu-calendar .wu-today{margin-inline-end:8px;background:#e0f2e2}.wu-calendar button:focus-visible{outline:2px solid #1769aa;outline-offset:2px}@media print{.wu-report-navigation,.wu-calendar{display:none!important}.wu-current-row>td{outline:none;background-color:inherit!important}}
/* Viewport dock: visible at the report bottom while scrolling, not over headers. */
/* Session drafts have their own lane beside reminders; geometry adjusts only
   when a visible reminder panel or report dock occupies that space. */
#documentDrafts{left:var(--wu-drafts-left,144px)!important;bottom:var(--wu-drafts-bottom,32px)!important;box-sizing:border-box;max-width:min(480px,calc(100vw - 156px))!important;max-height:30vh!important}
.wu-report-navigation{z-index:1400!important}
.wu-report-navigation{position:fixed!important;top:auto;z-index:1400;box-sizing:border-box;box-shadow:0 -2px 5px #0002;max-height:76px;overflow:auto}.wu-report-navigation[hidden]{display:none!important}#content table[data-workspace-navigation],#modalBody table[data-workspace-navigation]{scroll-margin-bottom:80px}#content:has(table[data-workspace-navigation]),#modalBody:has(table[data-workspace-navigation]){padding-bottom:80px}

/* The saved-drafts caption is absolute; keep its explanation below the 30px title bar. */
body.vertex-desktop #modal #modalBody>.pd-drafts-window{padding-top:40px!important}

/* The item list's dock is clipped to its table wrapper, not the whole content.
   Reserve space in that same scrolling box so its final row remains clickable. */
@media screen {
 #content:has(#itemReportFilter) #reportResults .table-wrap:has(table[data-workspace-navigation]){padding-bottom:80px!important;scroll-padding-bottom:80px}
 #content:has(#itemReportFilter) #reportResults tr[data-open-item]{scroll-margin-bottom:80px}
}

/* Background tools remain available outside a document, below its controls. */
@media screen {
 body.vertex-desktop:has(#modalBackdrop:not(.hidden)) :is(.mr-reminders,#documentDrafts){z-index:400!important}
}
