.ui-theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:34px;padding:0 9px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink);font-size:11px;flex-shrink:0}
.ui-theme-toggle svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.ui-theme-toggle:focus-visible{outline:2px solid #2ca878;outline-offset:3px}
@media(max-width:1200px){.ui-theme-toggle span{display:none}.ui-theme-toggle{width:34px;padding:0}}
@media screen{
html[data-ui-theme=dark]{color-scheme:dark;--ink:#e3eee9;--muted:#a8bcb2;--line:#344b42;--bg:#111d18;--surface:#1b2b24;--deep:#102b22;--deep2:#091e17;--mint:#213f32;--shadow:0 14px 42px #0005}
html[data-ui-theme=dark] body,html[data-ui-theme=dark] .workspace{background:var(--bg);color:var(--ink)}
html[data-ui-theme=dark] :is(.topbar,.card,.table-card,.stat-card,.modal,.modal-head,.modal-header,.modal-footer,dialog,.login-panel,.login-card,.settings-panel,.settings-card,.product-search-results,.contact-search-results,.top-stock-results,.pdc-notification-panel,.transaction-format-dialog){background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-ui-theme=dark] :is(input,select,textarea){background:#15251e!important;color:var(--ink)!important;border-color:#496153!important}
html[data-ui-theme=dark] input::placeholder,html[data-ui-theme=dark] textarea::placeholder{color:#a1b4aa!important;opacity:1}
html[data-ui-theme=dark] :is(.toolbar,.transaction-filter-note,.transaction-bulk-actions,.card-head,.modal-body,.form-section,.settings-tabs,.party-tabs){background:#1b2b24!important;border-color:var(--line)!important;color:var(--ink)!important}
html[data-ui-theme=dark] :is(.card-head h3,.stat-label,.stat-value,.page-head h1,.dashboard-topbar-greeting,.modal h2,.modal h3,dialog h2,dialog h3,.login-panel h2,.form-grid label,.settings-panel h3){color:var(--ink)!important}
html[data-ui-theme=dark] :is(.muted,.stat-foot,.card-head small,.page-head p,.company-picker>span,.party-caption,.stock-slow-note,.stock-detail-note,.stock-dialog-head small,.insight-data summary){color:var(--muted)!important}
html[data-ui-theme=dark] :is(.btn.secondary,.quick-btn,.party-tabs button,.stock-attention-link,.stock-health-legend button,.modal-close,.modal-minimize,.icon-btn,.pdc-notification-button,.dashboard-period-presets button,.stock-detail-pages button){background:#233c30!important;color:#d0e6d9!important;border-color:#486452!important}
html[data-ui-theme=dark] .party-tabs button[aria-selected=true]{background:#2c7655!important;color:#fff!important}
html[data-ui-theme=dark] :is(th,td){border-color:var(--line)!important}
html[data-ui-theme=dark] th{background:#253d31!important;color:#c4dbcd!important}
html[data-ui-theme=dark] tbody tr{background:var(--surface)!important;color:var(--ink)}
html[data-ui-theme=dark] tbody tr:nth-child(even){background:#1e3027!important}
html[data-ui-theme=dark] tbody tr:hover{background:#294737!important}
html[data-ui-theme=dark] :is(.transaction-voucher-table small,.insight-legend,.customer-ranking,.stock-health-legend,.stock-count){color:var(--ink)!important;fill:var(--ink)!important}
html[data-ui-theme=dark] .insight-svg text{fill:#b3cbbd!important}
html[data-ui-theme=dark] .insight-svg line{stroke:#3a5245!important}
html[data-ui-theme=dark] .stock-health svg text{fill:#d9eade!important}
html[data-ui-theme=dark] :is(.customer-progress,.dashboard-activity-track){background:#304b3d!important}
html[data-ui-theme=dark] .stat-card:after{background:#254638!important}
html[data-ui-theme=dark] :is(.stat-icon,.live-status){background:#254638!important;color:#9ad8b8!important}
html[data-ui-theme=dark] .stat-value.text-red,html[data-ui-theme=dark] .text-red{color:#ff8383!important}
html[data-ui-theme=dark] .product-search-results button,html[data-ui-theme=dark] .top-stock-result{background:var(--surface)!important;color:var(--ink)!important}
html[data-ui-theme=dark] #ledgerone-titlebar{background:#1b2b24!important;color:#dfede5!important}
html[data-ui-theme=dark] .dashboard-topbar-greeting strong{color:#d9eee2!important}
html[data-ui-theme=dark] .login-panel a{color:#9cddbb}
html[data-ui-theme=dark] .loader-screen{background:#111d18;color:var(--ink)}
}
@media print{.ui-theme-toggle{display:none!important}}

@media screen{
html[data-ui-theme=dark] .report-export-actions{background:#1b2b24!important;border-color:var(--line)!important}
html[data-ui-theme=dark] .report-export-actions button{background:transparent!important;color:#d0e6d9!important}
html[data-ui-theme=dark] .report-export-actions button:hover,html[data-ui-theme=dark] .report-export-actions button:focus-visible{background:#294737!important;color:#fff!important}
html[data-ui-theme=dark] :is(.row-actions button,.table-card .action-edit,.table-card .action-delete){background:#233c30!important;border-color:#486452!important;color:#d0e6d9!important}
html[data-ui-theme=dark] :is(.row-actions .action-delete,.row-actions .immediate-delete,.table-card .action-delete){color:#ff9292!important}
html[data-ui-theme=dark] .row-actions button:hover:not(:disabled){background:#2d4c3c!important;border-color:#72a08a!important}
html[data-ui-theme=dark] :is(th.generic-sort-header:hover,th.generic-sort-header.sort-asc,th.generic-sort-header.sort-desc,th.report-sort-header.active-sort,.stock-moving-table thead th){background:#2b4939!important;color:#dcf0e3!important;border-color:var(--line)!important}
html[data-ui-theme=dark] :is(.generic-sort-header,.report-sort-header)::after,html[data-ui-theme=dark] .table-sort-button span{color:#9ad6b5!important}
html[data-ui-theme=dark] .table-sort-button:hover{color:#dcf0e3!important}
html[data-ui-theme=dark] .stock-moving-table tbody td{background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-ui-theme=dark] .stock-moving-table tbody tr:nth-child(even) td{background:#1e3027!important}
html[data-ui-theme=dark] .stock-moving-table tbody tr:hover td{background:#294737!important}
html[data-ui-theme=dark] :is(.stock-moving-column-tools,.stock-moving-report-controls){background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}
}

@media screen{
html[data-ui-theme=dark] :is(.settings-menu,.settings-panel-head,.modal-foot,.opening-bill-editor,.voucher-help,.report-export-modal,.report-export-head,.report-export-foot){background:#1b2b24!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-ui-theme=dark] .settings-menu button{color:var(--ink)!important}
html[data-ui-theme=dark] .settings-menu button:hover,html[data-ui-theme=dark] .settings-menu button.active{background:#294737!important;color:#dcf0e3!important}
html[data-ui-theme=dark] :is(.settings-menu small,.settings-panel-head p,.opening-bill-head small,.opening-bill-columns,.opening-bill-summary span,.report-export-foot span){color:var(--muted)!important}
html[data-ui-theme=dark] :is(.settings-panel-head h2,.voucher-help b,.opening-bill-head b){color:var(--ink)!important}
html[data-ui-theme=dark] :is(.account-tree-action,.account-tree-toggle,.report-export-head button){background:#233c30!important;color:#d0e6d9!important;border-color:#486452!important}
html[data-ui-theme=dark] .account-list-card tbody tr td{background:#1b2b24!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-ui-theme=dark] .account-list-card tbody tr:nth-child(even) td{background:#1e3027!important}
html[data-ui-theme=dark] .account-list-card tbody tr:hover td{background:#294737!important}
html[data-ui-theme=dark] .account-list-card :is(.account-link,.account-tree-node-label b){color:#dceee3!important}
html[data-ui-theme=dark] .account-list-card :is(.account-tree-count,.account-system-badge){background:#30483b!important;color:#c7dbd0!important}
html[data-ui-theme=dark] .report-export-scroll{background:#101b16!important}
/* The preview frame follows the theme; the document retains paper colors. */
html[data-ui-theme=dark] .report-export-sheet{background:#fff!important;color:#172a22!important;--ink:#172a22;--muted:#586c61;--line:#d8e3dc;color-scheme:light}
html[data-ui-theme=dark] .report-export-sheet :is(h1,h2,h3,p,small,span,b,strong,footer){color:inherit}
html[data-ui-theme=dark] .report-export-sheet table :is(tbody tr,tbody tr:nth-child(even),tbody tr:hover,td){background:#fff!important;color:#172a22!important;border-color:#d8e3dc!important}
html[data-ui-theme=dark] .report-export-sheet table th{background:#e9f0ec!important;color:#203c2e!important;border-color:#cedcd3!important}
}

@media screen{
html[data-ui-theme=dark] :is(.report-summary,.company-card,.product-query-summary>div,.product-query-filter,.warehouse-card,.form-grid .checkbox-label,.allocation-row,.allocation-empty,.financial-report-head,.statement-total,.ageing-cards>div,.party-profile>div,.reconciliation-meta>div,.reconciliation-summary>div,.reconcile-balance-strip,.reconcile-section,.reconcile-section-head,.reconcile-footer-status,.billing-facts>div,.company-logo-editor,.billing-console,.billing-module-summary,.subscription-create-note,.available-plan-card,.available-plan-empty,.user-summary>div,.user-toolbar,.custom-access-panel,.permission-grid label,.permission-matrix,.permission-section>header,.permission-search,.approval-search,.session-summary>div,.sessions-card code,.po-receipt-history-head,.po-receipt-history-row,.module-assignment,.module-store-card,.year-close-card,.year-close-head,.year-close-confirm,.factory-reset-card,.factory-confirm-check,.stock-lookup-item,.stock-warehouse-balance,.invoice-tax-toggle,.invoice-total-summary,.outstanding-chart,.outstanding-pie>div,.reconcile-review-tools,.reconcile-direction,.temporary-check-card,.report-warehouse-picker>summary,.report-warehouse-picker>div,.import-section,.import-preview,.backup-card,.company-import-card,.premium-order-price,.premium-confirm,.guided-form-step,.bank-line-one-step .one-step-title,.reconcile-count,.reconcile-search-shell,.billing-company-card,.billing-company-card>header,.billing-company-card>footer,.billing-price-card,.billing-addon-card,.billing-company-metrics,.billing-member-list,.refund-bill-summary,.client-portal-modal,.client-portal-tabs,.client-summary-grid article,.client-portal-card,.client-service,.premium-module-picker .module-price,.report-date,.inventory-ageing-meta>div,.server-overview article,.server-meta>div,.package-price-chart>div,.extra-user-price-chart>div,.custom-tax-builder,.custom-tax-preset,.custom-tax-fields label,.note-format-selector,.note-format-selector label,.visual-canvas,.invoice-element-tools,.rich-text-area-tools,.invoice-data-palette,.billing-plain-summary>div,.billing-help-card,.referral-report-filter,.referral-picker summary,.referral-picker-options,.petty-cash-summary>div,.petty-float-row,.cash-count-summary>div,.petty-history-meta>div,.stock-moving-column-tools summary,.stock-moving-column-menu){background:#1b2b24!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-ui-theme=dark] :is(.permission-select-all,.permission-clear-all,.icon-action,.premium-icon,.premium-confirm-cancel,.client-quick-actions button,.client-action-grid>button,.invoice-rich-toolbar button,.invoice-token-list button,.stock-lookup-bar,.statement-tree-toggle){background:#233c30!important;color:#d0e6d9!important;border-color:#486452!important}
html[data-ui-theme=dark] :is(.permission-grid,.custom-access-panel,.billing-company-card,.custom-tax-preset,.client-portal-card,.year-close-card,.factory-reset-card,.module-store-card,.guided-form-step) :is(h2,h3,h4,b,strong,label){color:var(--ink)!important}
html[data-ui-theme=dark] :is(.permission-grid,.custom-access-panel,.billing-company-card,.custom-tax-preset,.client-portal-card,.year-close-card,.module-store-card) :is(p,small){color:var(--muted)!important}
html[data-ui-theme=dark] :is(.allocation-row.selected,.module-assignment.selected,.permission-matrix-row:hover>div,.permission-matrix-row label.dependency-auto,.reconcile-steps .active,.billing-menu button.active,.billing-menu button:hover,.client-action-grid>button:hover){background:#294737!important;color:#dcf0e3!important;border-color:#486452!important}
html[data-ui-theme=dark] :is(.voucher-ledger-posting tfoot th,.financial-table tbody td,.ledger-tree-entry td,.outstanding-tree-document td,.ledger-report-group td,.statement-parent-account td,.inventory-value-total-row td,.petty-cash-table tfoot th,.pdc-register-table tfoot th){background:#1e3027!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-ui-theme=dark] :is(.form-error,.delete-warning,.factory-reset-warning,.btn.danger,.premium-icon.danger,.opening-bill-remove,.line-remove){background:#452a2b!important;color:#ffb3ae!important;border-color:#7e4947!important}
html[data-ui-theme=dark] :is(.subscription-warning,.year-close-warning,.trial-control-alert,.billing-attention,.price-approval-box,.permission-dependency-note,.subscription-change-pending){background:#3e3824!important;color:#f1dca0!important;border-color:#6b5b34!important}
html[data-ui-theme=dark] :is(.reconcile-empty-success,.resolved-line,.billing-clear){background:#234333!important;color:#bce8ca!important;border-color:#426b50!important}
html[data-ui-theme=dark] .badge{background:#284437!important;color:#d3eadc!important}
html[data-ui-theme=dark] :is(.badge.void,.badge.inactive,.badge.adverse,.badge.rejected,.badge.suspended,.badge.past_due){background:#452a2b!important;color:#ffb3ae!important}
html[data-ui-theme=dark] :is(.badge.pending,.badge.pending_user,.badge.pending_approval,.badge.pending_payment,.badge.partially_received,.badge.pending_price_approval){background:#3e3824!important;color:#f1dca0!important}
}

@media screen{
html[data-ui-theme=dark] #content .account-list-card tbody tr td{background:#1b2b24!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-ui-theme=dark] #content .account-list-card tbody tr:nth-child(even) td{background:#1e3027!important}
html[data-ui-theme=dark] #content .account-list-card tbody tr:hover td{background:#294737!important}
html[data-ui-theme=dark] #content .account-list-card :is(.account-link,.account-tree-node-label b){color:#dceee3!important}
/* Keep the long account tree on the page's vertical scroll chain. */
#content .account-list-card .table-wrap{height:auto!important;max-height:none!important;overflow-x:auto!important;overflow-y:auto!important;overscroll-behavior:auto!important;touch-action:pan-x pan-y}
}

@media screen{
html[data-ui-theme=dark] .account-list-card.account-list-card tbody tr:nth-child(odd) td{background:#1b2b24!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-ui-theme=dark] .account-list-card.account-list-card tbody tr:nth-child(even) td{background:#1e3027!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-ui-theme=dark] .account-list-card.account-list-card tbody tr:hover td{background:#294737!important}
}

@media screen{
html[data-ui-theme=dark] .account-list-card.account-list-card tbody tr:nth-child(n) td{border-color:#344b42!important}
html[data-ui-theme=dark] .account-list-card.account-list-card .role-chip{background:#30483b!important;color:#c7dbd0!important;border-color:#486452!important}
html[data-ui-theme=dark] .account-list-card.account-list-card .account-link{border-color:#628471!important;text-decoration-color:#628471!important}
html[data-ui-theme=dark] .account-list-card.account-list-card .table-wrap{scrollbar-color:#527060 #15251e;}
html[data-ui-theme=dark] .account-list-card .table-wrap::-webkit-scrollbar-track{background:#15251e}
html[data-ui-theme=dark] .account-list-card .table-wrap::-webkit-scrollbar-thumb{background:#527060;border:2px solid #15251e;border-radius:8px}
}

@media screen{
html[data-ui-theme=dark] #content .account-list-card tbody tr[data-tree-depth]:nth-child(odd) td{background-color:#1b2b24!important;color:var(--ink)!important;border-color:#344b42!important}
html[data-ui-theme=dark] #content .account-list-card tbody tr[data-tree-depth]:nth-child(even) td{background-color:#1e3027!important;color:var(--ink)!important;border-color:#344b42!important}
html[data-ui-theme=dark] #content .account-list-card tbody tr[data-tree-depth]:hover td{background-color:#294737!important}
}

@media screen{
html[data-ui-theme=dark] :is(.account-link,.party-link,.contact-link,.ledger-link,#content table a):not(:where(.report-export-sheet *,.print-document *,.voucher-print *,.invoice-design-paper *)){color:#9edfc1!important;text-decoration-color:#6eaa8d!important}
html[data-ui-theme=dark] .statement-account-name .account-link{color:#9edfc1!important}
html[data-ui-theme=dark] :is(.account-link,.party-link,.contact-link,.ledger-link,#content table a):not(:where(.report-export-sheet *,.print-document *,.voucher-print *,.invoice-design-paper *)):is(:hover,:focus-visible){color:#dcffea!important;text-decoration-color:#dcffea!important}
html[data-ui-theme=dark] .outstanding-tree-table tr.credit-overdue-row :is(.account-link,.amount){color:#ffaaa3!important}
}

@media screen{
html[data-ui-theme=dark] #content :is(.statement-section h4,.ageing-cards .ageing-card,.ageing-cards>div,.ageing-bucket-note,.inventory-ageing-meta>div){background:#233c30!important;color:#dceee3!important;border-color:#486452!important}
html[data-ui-theme=dark] #content .ageing-cards .ageing-card:is(:hover,.active){background:#2d4d3b!important;border-color:#75b797!important;box-shadow:none}
html[data-ui-theme=dark] #content :is(.inventory-ageing-meta b,.ageing-cards strong,.ageing-cards b){color:#e3eee9!important}
html[data-ui-theme=dark] #content :is(.ageing-cards small,.inventory-ageing-meta small,.financial-report-head.compact-report-title p span+span,.financial-report-foot){color:#b5cdbf!important;border-color:#486452!important}
html[data-ui-theme=dark] #content :is(.financial-tree-controls button,.ledger-report-toggle,.statement-tree-toggle){background:#294737!important;color:#d5f1e0!important;border-color:#628873!important}
html[data-ui-theme=dark] #content :is(.financial-tree-controls button,.ledger-report-toggle,.statement-tree-toggle):is(:hover,:focus-visible){background:#38654c!important;color:#fff!important}
html[data-ui-theme=dark] #content :is(.statement-amount-table .statement-account-header td,.inventory-ageing-table tfoot th,.financial-table thead tr:first-child th){background:#253d31!important;color:#dceee3!important;border-color:#486452!important}
html[data-ui-theme=dark] #content .financial-table tr.trial-control-row :is(td,.amount){background:#452a2b!important;color:#ffb3ae!important;border-color:#7e4947!important}
html[data-ui-theme=dark] #content :is(.statement-less-amount,.statement-deduction-value,.statement-deduction strong){color:#ffaaa3!important}
}

@media screen{
html[data-ui-theme=dark] .modal .voucher-ledger-posting{background:#1b2b24!important;border-color:#344b42!important}
html[data-ui-theme=dark] .modal .voucher-ledger-posting-head{background:#233c30!important;border-color:#344b42!important;color:#e3eee9!important}
html[data-ui-theme=dark] .modal .voucher-ledger-posting-head b{color:#e3eee9!important}
html[data-ui-theme=dark] .modal .voucher-ledger-posting-head small{color:#b5cdbf!important}
html[data-ui-theme=dark] .modal .voucher-ledger-posting tfoot .ledger-posting-difference th{background:#1e3027!important;color:#e3eee9!important;border-color:#344b42!important}
}

@media screen{
html[data-ui-theme=dark] .petty-cash-tabs{background:#15251e!important;border-color:#486452!important}
html[data-ui-theme=dark] .petty-cash-tabs .report-tab{background:transparent!important;color:#bfd7ca!important;box-shadow:none!important}
html[data-ui-theme=dark] .petty-cash-tabs .report-tab:hover{background:#233c30!important;color:#e3eee9!important}
html[data-ui-theme=dark] .petty-cash-tabs .report-tab.active{background:#2d5943!important;color:#eafff1!important;box-shadow:inset 0 0 0 1px #56846b!important}
}

@media screen{
/* Column sizing follows current form fields, independent of theme. */
#modalRoot:is(.mode-simple,.mode-purchase) .voucher-lines{max-width:100%;overflow-x:auto!important}
#modalRoot:is(.mode-simple,.mode-purchase) .voucher-lines table{width:100%!important;min-width:1050px!important;table-layout:fixed!important}
#modalRoot:is(.mode-simple,.mode-purchase) .voucher-lines .line-number-col{width:38px!important}
#modalRoot:is(.mode-simple,.mode-purchase) .voucher-lines .ledger-col{width:150px!important}
#modalRoot:is(.mode-simple,.mode-purchase) .voucher-lines .codes-col{width:125px!important}
#modalRoot:is(.mode-simple,.mode-purchase) .voucher-lines .product-col{width:220px!important}
#modalRoot:is(.mode-simple,.mode-purchase) .voucher-lines .qty-col{width:75px!important}
#modalRoot:is(.mode-simple,.mode-purchase) .voucher-lines .price-col{width:95px!important}
#modalRoot:is(.mode-simple,.mode-purchase) .voucher-lines .discount-col{width:100px!important}
#modalRoot:is(.mode-simple,.mode-purchase) .voucher-lines .free-qty-col{width:60px!important}
#modalRoot:is(.mode-simple,.mode-purchase) .voucher-lines .total-col{width:110px!important}
#modalRoot:is(.mode-simple,.mode-purchase) .voucher-lines .remove-col{width:42px!important}
#modalRoot.stock-count-adjustment.stock-count-adjustment .table-wrap{overflow-x:auto!important;border-color:var(--line)!important}
#modalRoot.stock-count-adjustment.stock-count-adjustment table{min-width:960px!important}
#modalRoot.stock-count-adjustment.stock-count-adjustment :is(th,td):nth-child(1){width:32%!important}
#modalRoot.stock-count-adjustment.stock-count-adjustment :is(th,td):nth-child(2){width:9%!important}
#modalRoot.stock-count-adjustment.stock-count-adjustment :is(th,td):nth-child(3){width:10%!important}
#modalRoot.stock-count-adjustment.stock-count-adjustment :is(th,td):nth-child(4){width:12%!important}
#modalRoot.stock-count-adjustment.stock-count-adjustment :is(th,td):nth-child(5){width:10%!important}
#modalRoot.stock-count-adjustment.stock-count-adjustment :is(th,td):nth-child(6){width:10%!important}
#modalRoot.stock-count-adjustment.stock-count-adjustment :is(th,td):nth-child(7){width:12%!important}
#modalRoot.stock-count-adjustment.stock-count-adjustment :is(th,td):nth-child(8){width:5%!important}
html[data-ui-theme=dark] #modalRoot :is(.voucher-help,.adjustment-value-summary,.stock-count-adjustment .muted){background:#233c30!important;color:#bfd7ca!important;border-color:#486452!important}
html[data-ui-theme=dark] #modalRoot.stock-count-adjustment :is(.muted,.adjustment-value-summary){background:#233c30!important;color:#bfd7ca!important;border-color:#486452!important}
html[data-ui-theme=dark] #modalRoot.stock-count-adjustment :is(.adjustment-total-value,.adjustment-current,.adjustment-delta,.adjustment-new,.adjustment-notes){color:#d9eee2!important}
html[data-ui-theme=dark] #modalRoot.stock-count-adjustment .table-wrap{background:#1b2b24!important}
html[data-ui-theme=dark] #modalRoot :is(.line-number,.optional-label,.field-optional){background:#294737!important;color:#c6e6d5!important;border-color:#486452!important}
html[data-ui-theme=dark] #modalRoot .form-grid label small{color:#b5cdbf!important;background:transparent!important}
html[data-ui-theme=dark] #modalRoot :is(.voucher-totals,.voucher-totals small,.voucher-totals span){color:#bfd7ca!important}
}

@media screen{
html[data-ui-theme=dark] :is(.product-search-results,.contact-search-results,.top-stock-results) :is(button.keyboard-active,button.selected,[role=option][aria-selected=true],button:hover,button:focus-visible){background:#32694e!important;color:#f0fff5!important;border-color:#7bcda0!important;box-shadow:inset 3px 0 0 #8de4b2!important;outline:none}
html[data-ui-theme=dark] :is(.product-search-results,.contact-search-results) :is(button.keyboard-active,button.selected,button:hover,button:focus-visible) :is(b,small,.product-result-stock,.product-unit-price,.product-price){color:#e0f9e9!important}
html[data-ui-theme=dark] .product-search-results :is(.product-result-stock,.product-unit-price,.product-price){color:#a5ddbd!important}
html[data-ui-theme=dark] .modal .delete-warning{background:#252e27!important;border:1px solid #78504b!important;border-left:3px solid #e98d83!important;border-radius:10px;padding:16px;gap:14px}
html[data-ui-theme=dark] .modal .delete-warning>div{background:#503532!important;color:#ffc0b7!important;border-radius:8px}
html[data-ui-theme=dark] .modal .delete-warning h3{color:#f2eee8!important;margin-bottom:7px}
html[data-ui-theme=dark] .modal .delete-warning p{color:#c6d1c9!important;line-height:1.6}
html[data-ui-theme=dark] .modal .delete-warning p:last-child{color:#e7c5b9!important}
}
@media screen and (min-width:1200px){
#modalRoot:is(.mode-simple,.mode-purchase,.mode-journal) .voucher-lines:has(.product-combobox:focus-within){overflow:visible!important;max-height:none!important}
}

@media screen{
html[data-ui-theme=dark] :is(.product-search-results,.contact-search-results,.top-stock-results) em{color:#aadfbe!important;font-style:normal}
html[data-ui-theme=dark] :is(.product-search-results,.top-stock-results) :is(button.keyboard-active,button:hover,button:focus-visible) em{color:#f0fff5!important}
html[data-ui-theme=dark] :is(.product-stock-badge,.top-stock-qty){background:#2b493a!important;color:#e3f4e9!important;border-color:#628873!important}
html[data-ui-theme=dark] :is(.product-stock-badge,.top-stock-qty) :is(small,span){color:#d5ebdf!important}
html[data-ui-theme=dark] .product-search-results button :is(.product-result-placeholder,.product-image-placeholder){background:#30483b!important;color:#c3dacd!important}
}


/* Invoice advances and PDC dropdown surfaces follow the selected screen theme. */
@media screen{
html[data-ui-theme=dark] .customer-advances-apply{background:#182b22!important;border-color:#3d5849!important;color:#e3eee9!important}
html[data-ui-theme=dark] .customer-advance-row{background:#20382b!important;border-color:#42604e!important;color:#e3eee9!important}
html[data-ui-theme=dark] .customer-advance-row.advance-selected,html[data-ui-theme=dark] .customer-advance-row-readonly{background:#294a37!important;border-color:#6aab83!important}
html[data-ui-theme=dark] :is(.customer-advances-apply .allocation-title,.customer-advance-choice b,.customer-advance-value b,.customer-advance-row-readonly b){color:#e3eee9!important}
html[data-ui-theme=dark] :is(.customer-advances-apply small,.customer-advances-balance){color:#b6cdbf!important}
html[data-ui-theme=dark] .customer-advance-choice input{accent-color:#63bb8a}
html[data-ui-theme=dark] :is(.pdc-notification-head,.pdc-notification-item){background:#1b2b24!important;color:#e3eee9!important;border-color:#344b42!important}
html[data-ui-theme=dark] .pdc-notification-item:hover,html[data-ui-theme=dark] .pdc-notification-item:focus-visible{background:#294737!important}
html[data-ui-theme=dark] :is(.pdc-notification-item strong,.pdc-notification-item .amount,.pdc-notification-head b){color:#e3eee9!important}
html[data-ui-theme=dark] :is(.pdc-notification-meta,.pdc-notification-head span,.pdc-notification-empty){color:#b6cdbf!important}
html[data-ui-theme=dark] .pdc-notification-footer{background:#233c30!important;color:#b7e7cb!important;border-color:#344b42!important}
html[data-ui-theme=dark] .pdc-notification-footer:hover{background:#294737!important}
html[data-ui-theme=dark] .pdc-due-label{background:#284e3b!important;color:#b7e7cb!important}
html[data-ui-theme=dark] .pdc-due-label.overdue{background:#53392c!important;color:#ffd2b2!important}
html[data-ui-theme=dark] .pdc-notification-count{border-color:#1b2b24!important}
}

/* Billing console and role permission surfaces in dark mode. */
@media screen{
html[data-ui-theme=dark] .billing-console{--billing-line:#3d5749;--billing-soft:#233b2f}
html[data-ui-theme=dark] :is(.billing-menu,.billing-panel-heading,.billing-user-company,.billing-user-company>header,.billing-free-banner,.billing-free-date){background:#1b2f25!important;background-image:none!important;color:#e3eee9!important;border-color:#3d5749!important}
html[data-ui-theme=dark] .billing-console .billing-menu button{background:transparent!important;color:#d2e6da!important}
html[data-ui-theme=dark] .billing-console .billing-menu button.active,html[data-ui-theme=dark] .billing-console .billing-menu button:hover{background:#2a4b38!important;border-color:#527b62!important;color:#f0fff6!important}
html[data-ui-theme=dark] .billing-console .billing-menu button :is(span,svg){color:inherit!important}
html[data-ui-theme=dark] :is(.billing-panel-heading h2,.billing-panel-heading h3,.billing-user-company>header h3){color:#e3eee9!important}
html[data-ui-theme=dark] :is(.billing-menu button small,.billing-menu button.active small,.billing-panel-heading p,.billing-user-company small){color:#b4cbbd!important}
html[data-ui-theme=dark] :is(.billing-user-company>header>b,.billing-company-mark,.billing-invoice-icon){background:#294536!important;color:#d8f3e4!important;border-color:#527b62!important}
html[data-ui-theme=dark] :is(.permission-sticky-guide,.permission-matrix-head,.role-profile-presets,.permission-section,.permission-section>header,.permission-matrix,.permission-child-row,.permission-child-row .permission-main-toggle){background:#1d3227!important;background-image:none!important;color:#e3eee9!important;border-color:#3d5749!important}
html[data-ui-theme=dark] :is(.permission-matrix-row,.permission-matrix-row>label){background:#1b2b24!important;color:#e3eee9!important;border-color:#3d5749!important}
html[data-ui-theme=dark] .permission-matrix-row>label:has(input:checked){background:#284b38!important;color:#dcf5e5!important}
html[data-ui-theme=dark] .permission-matrix-row:hover>label{background:#263f31!important}
html[data-ui-theme=dark] :is(.permission-section>header b,.permission-sticky-guide b,.permission-sticky-guide span,.permission-main-toggle b,.role-profile-presets b){color:#e3eee9!important}
html[data-ui-theme=dark] :is(.permission-section>header small,.permission-section>header>span,.permission-main-toggle small,.role-profile-presets small){color:#b4cbbd!important}
html[data-ui-theme=dark] .role-profile-presets button{background:#233b2f!important;color:#e3eee9!important;border-color:#466652!important}
html[data-ui-theme=dark] .role-profile-presets button.active{background:#2d533d!important}
}

/* Dark financial-report party selector, including ageing multi-select. */
@media screen{
html[data-ui-theme=dark] :is(.ageing-party-picker,.ageing-party-options){background:#1b2f25!important;color:#e3eee9!important;border-color:#466452!important;box-shadow:0 8px 24px #0004}
html[data-ui-theme=dark] .ageing-party-picker summary{background:#20382b!important;color:#d9eee2!important;border-color:#466452!important}
html[data-ui-theme=dark] .ageing-party-options .ageing-party-option{background:#233c2f!important;color:#e3eee9!important;border-color:#3d5949!important}
html[data-ui-theme=dark] .ageing-party-options .ageing-party-option:hover{background:#2b4b39!important}
html[data-ui-theme=dark] .ageing-party-options .ageing-party-option:has(input:checked){background:#315b41!important;color:#f0fff6!important}
html[data-ui-theme=dark] .ageing-party-options .ageing-party-option span{color:inherit!important}
html[data-ui-theme=dark] .ageing-party-options input{accent-color:#60bd8b}
html[data-ui-theme=dark] .ageing-party-options .muted{color:#b3cbbd!important}
}

/* Settled ageing invoices remain in the same table with zero outstanding. */
@media screen{
.financial-table .ageing-settled-row td{background:#edf5ff!important;color:#294f78!important}
.financial-table .ageing-settled-row td:first-child{border-left:3px solid #699cd2}
.financial-table .ageing-settled-row .account-link{color:#295f93!important}
.ageing-settled-badge{display:inline-block;margin-left:5px;padding:2px 5px;border-radius:4px;background:#d7e8fb;color:#245680;font-size:10px;font-weight:600}
.ageing-settled-invoices[aria-pressed=true]{box-shadow:inset 0 0 0 2px #699cd2!important}
html[data-ui-theme=dark] .financial-table .ageing-settled-row td{background:#183448!important;color:#d2e9fb!important}
html[data-ui-theme=dark] .financial-table .ageing-settled-row .account-link{color:#a8d5fb!important}
html[data-ui-theme=dark] .ageing-settled-badge{background:#284f6b;color:#d2e9fb}
}

/* Compact payment detail summary and invoice allocation list. */
.payment-detail-view .payment-detail-container{display:block!important}
.payment-detail-summary,.payment-detail-allocations{border:1px solid #d5e4de;border-radius:12px;overflow:hidden;margin-bottom:16px;background:#fff}
.payment-detail-summary-head{display:flex;justify-content:space-between;gap:20px;padding:18px 20px;background:#f0f7f4;border-bottom:1px solid #d5e4de}
.payment-detail-summary-head h3{margin:5px 0 0;font-size:18px;color:inherit}
.payment-detail-summary-head small,.payment-detail-field small,.payment-detail-narration small{display:block;font-size:11px;color:#648077}
.payment-detail-amount{text-align:right;flex-shrink:0}.payment-detail-amount strong{display:block;font-size:25px;line-height:1.3;margin-top:4px;font-variant-numeric:tabular-nums;color:#174e3d}
.payment-detail-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 24px;padding:18px 20px}.payment-detail-field strong{display:block;margin-top:5px;font-size:13px;overflow-wrap:anywhere}
.payment-detail-narration{padding:12px 20px;border-top:1px solid #e1ebe6}.payment-detail-narration p{margin:5px 0 0;font-size:12px;white-space:pre-wrap}
.payment-allocation-head{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #d5e4de}.payment-allocation-head h3{font-size:14px;margin:0}.payment-allocation-head small{color:#648077;font-size:11px}
.payment-detail-view .payment-allocation-table{width:100%;border-collapse:collapse;margin:0}.payment-detail-view .payment-allocation-table th,.payment-detail-view .payment-allocation-table td{padding:10px 14px;font-size:12px}.payment-detail-view .payment-allocation-table tfoot th{background:#f0f7f4;border-top:1px solid #d5e4de}.payment-invoice-reference{display:block;font-size:10px;color:#648077;margin-top:3px}.payment-detail-empty{padding:16px;font-size:12px;color:#648077}
.payment-ledger-details{border:1px solid #d5e4de;border-radius:9px;margin:10px 0}.payment-ledger-details>summary{padding:12px 16px;font-size:12px;font-weight:600;cursor:pointer}.payment-detail-view .payment-ledger-details .voucher-lines{display:block!important}.payment-detail-view .payment-ledger-details .report-summary{display:flex!important}
html[data-ui-theme=dark] .payment-detail-summary,html[data-ui-theme=dark] .payment-detail-allocations{background:#192e25;border-color:#3b574a;color:#e0eee8}
html[data-ui-theme=dark] .payment-detail-summary-head,html[data-ui-theme=dark] .payment-detail-view .payment-allocation-table tfoot th{background:#223e31;border-color:#3b574a;color:#e0eee8}
html[data-ui-theme=dark] .payment-detail-amount strong{color:#a5dfc5}
html[data-ui-theme=dark] .payment-detail-summary-head small,html[data-ui-theme=dark] .payment-detail-field small,html[data-ui-theme=dark] .payment-detail-narration small,html[data-ui-theme=dark] .payment-allocation-head small,html[data-ui-theme=dark] .payment-invoice-reference,html[data-ui-theme=dark] .payment-detail-empty{color:#aac3b7}
html[data-ui-theme=dark] .payment-detail-narration,html[data-ui-theme=dark] .payment-allocation-head,html[data-ui-theme=dark] .payment-ledger-details{border-color:#3b574a}
@media(max-width:600px){.payment-detail-meta{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:14px}.payment-detail-summary-head{padding:14px;gap:10px}.payment-detail-summary-head h3{font-size:15px}.payment-detail-amount strong{font-size:20px}.payment-detail-view .payment-allocation-table{min-width:440px}}

/* Invoice write-off: match the active ERP theme, including top-layer ledger choices. */
@media screen{
html[data-ui-theme=dark] .invoice-writeoff-summary{background:#213b30!important;border-color:var(--line)!important}
html[data-ui-theme=dark] .invoice-writeoff-summary strong{color:var(--ink)!important}
html[data-ui-theme=dark] .invoice-writeoff-summary small{color:var(--muted)!important}
html[data-ui-theme=dark] .writeoff-ledger-search button{background:#294638!important;color:var(--ink)!important;border:1px solid var(--line)!important}
html[data-ui-theme=dark] .writeoff-ledger-results{background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important;box-shadow:var(--shadow)}
html[data-ui-theme=dark] .writeoff-ledger-results button{background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-ui-theme=dark] .writeoff-ledger-results button:is(:hover,:focus,.keyboard-active){background:#2b5141!important;color:#edfff6!important;outline:2px solid #69b99b;outline-offset:-2px}
html[data-ui-theme=dark] .writeoff-ledger-results>.muted{color:var(--muted)!important}
}
.writeoff-ledger-search button::before{content:none!important;display:none!important}

/* Clear is an icon-only control; do not decorate it as an accounting action. */
.writeoff-ledger-search button{display:inline-flex!important;align-items:center!important;justify-content:center!important;flex-direction:row!important;gap:0!important;line-height:1!important;min-width:36px;white-space:nowrap}
.writeoff-ledger-search button>.lo-icon,.writeoff-ledger-search button>svg{display:none!important}

/* Preserve price-exception emphasis with readable dark-theme contrast. */
@media screen{
html[data-ui-theme=dark] input.line-price.price-overridden{background:#3b321e!important;color:#f5ead0!important;border-color:#d2a648!important;box-shadow:0 0 0 2px #d2a64822}
html[data-ui-theme=dark] input.line-price.price-overridden:focus{background:#423820!important;color:#fff1d1!important;box-shadow:0 0 0 3px #d2a64840}
}
