/* Mistone Gece. Theme changes presentation only; original documents and images stay intact. */
.theme-picker-form{min-width:0;max-width:100%;margin:0}
.transfer-phone-theme{display:flex;justify-content:flex-end;margin:0 0 20px}
.theme-picker{display:inline-flex;align-items:center;flex-wrap:nowrap;gap:3px;max-width:100%;min-width:0;margin:0;padding:4px;border:1px solid #dbe5de;border-radius:11px;background:#f3f7f4;vertical-align:middle}
.theme-picker legend{float:none;width:auto;margin:0;padding:0;font-size:0}
.theme-picker-option{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:34px;padding:6px 9px;border:1px solid transparent;border-radius:7px;background:transparent;color:#5c7164;font:inherit;font-size:12px;font-weight:600;line-height:1.35;white-space:nowrap;cursor:pointer}
.theme-picker .theme-picker-option{font-family:inherit;font-size:12px;font-weight:600;line-height:1.35}
.topbar>.theme-picker-form{flex:0 0 auto}
.theme-picker-option svg{width:15px;height:15px;flex:none}
.theme-picker-option:hover{background:#e6eee8;color:#2b513c}
.theme-picker-option[aria-pressed="true"]{background:#fff;border-color:#d5e1d8;color:#245c49;box-shadow:0 1px 4px #1e39250a}
.theme-picker-option:focus-visible{outline:3px solid #88ad99;outline-offset:2px}
.theme-picker-option:disabled{cursor:wait;opacity:.7}
.theme-picker-floating{position:fixed;top:16px;right:18px;z-index:1050}
.theme-picker-status:not([hidden]){display:block;max-width:23rem;margin:7px 0 0;color:#9c4b37;font-size:12px;line-height:1.6}
.theme-picker-status[hidden]{display:none!important}
.theme-picker-floating+main .login-wrap{padding-top:84px;padding-bottom:28px}
@media(min-width:992px){.topbar:has(.theme-picker-form) .sender{flex:1 1 150px;min-width:0;max-width:300px}}
@media(max-width:600px){.theme-picker{gap:2px;padding:3px}.theme-picker .theme-picker-option{min-height:34px;padding:6px 7px;font-size:11px;gap:4px}.theme-picker-floating{top:12px;right:12px}}

@media screen and (forced-colors:none){
html[data-theme="dark"]{
    color-scheme:dark;
    --ink:#e3ece5;--green:#a3ceb0;--sage:#91b79c;--pale:#263c2e;--bg:#101814;--line:#34483b;
    --theme-page:#101814;--theme-sidebar:#142019;--theme-surface:#1b2921;--theme-raised:#223329;
    --theme-input:#223329;--theme-hover:#293e30;--theme-muted:#a4b5a8;--theme-text:#e3ece5;
    --theme-accent:#a3ceb0;--theme-button-bg:#306e50;--theme-button-ink:#f1f8f3;
    --theme-positive:#8bd3aa;--theme-positive-bg:#203b2b;--theme-positive-line:#3c6249;
    --theme-warning:#e2bd78;--theme-warning-bg:#392f20;--theme-warning-line:#665338;
    --theme-danger:#f0a0aa;--theme-danger-bg:#3b242b;--theme-danger-line:#69414c;
    --theme-info:#a2c9df;--theme-info-bg:#20333d;--theme-info-line:#3d5b6a;
    --bs-body-color:#e3ece5;--bs-body-color-rgb:227,236,229;--bs-body-bg:#101814;--bs-body-bg-rgb:16,24,20;
    --bs-emphasis-color:#eff6f0;--bs-emphasis-color-rgb:239,246,240;
    --bs-secondary-color:#a4b5a8;--bs-secondary-color-rgb:164,181,168;--bs-secondary-bg:#223329;--bs-secondary-bg-rgb:34,51,41;
    --bs-tertiary-color:#92a698;--bs-tertiary-color-rgb:146,166,152;--bs-tertiary-bg:#1b2921;--bs-tertiary-bg-rgb:27,41,33;
    --bs-border-color:#34483b;--bs-border-color-translucent:rgba(145,183,156,.19);
    --bs-link-color:#a3ceb0;--bs-link-color-rgb:163,206,176;--bs-link-hover-color:#c5e5ce;--bs-link-hover-color-rgb:197,229,206;
    --bs-primary:#91b79c;--bs-primary-rgb:145,183,156;--bs-primary-text-emphasis:#bbdec5;--bs-primary-bg-subtle:#203b2b;--bs-primary-border-subtle:#3c6249;
    --bs-success-text-emphasis:#8bd3aa;--bs-success-bg-subtle:#203b2b;--bs-success-border-subtle:#3c6249;
    --bs-warning-text-emphasis:#e2bd78;--bs-warning-bg-subtle:#392f20;--bs-warning-border-subtle:#665338;
    --bs-danger-text-emphasis:#f0a0aa;--bs-danger-bg-subtle:#3b242b;--bs-danger-border-subtle:#69414c;
    --bs-info-text-emphasis:#a2c9df;--bs-info-bg-subtle:#20333d;--bs-info-border-subtle:#3d5b6a;
    background:#101814;scrollbar-color:#526c5a #142019;
}
html[data-theme="dark"] body{background:var(--theme-page);color:var(--theme-text)}
html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6){color:var(--theme-text)}
html[data-theme="dark"] :is(.muted,.page-heading p,.form-text,.sender,.top-user,.test-company-selector label,.status-list dt,.approval-record,.workflow-message,.workflow-steps div>span,.workflow-steps .next){color:var(--theme-muted)}
html[data-theme="dark"] :is(.eyebrow,.workflow-environment,.status-list dd a,.invoice-identifiers summary){color:var(--theme-accent)}
html[data-theme="dark"] :is(.sidebar,.topbar){background:var(--theme-sidebar);border-color:var(--line)}
html[data-theme="dark"] .app-shell .sidebar{background:var(--theme-sidebar)!important}
html[data-theme="dark"] :is(.sidebar nav a,.sidebar .navigation-label,.navigation-group summary){color:#b7c9bd}
html[data-theme="dark"] :is(.sidebar nav a:hover,.sidebar nav a:focus-visible,.sidebar nav a[aria-current="page"],.navigation-group summary:hover){background:var(--pale);color:#c5e5ce}
html[data-theme="dark"] :is(.sidebar small,.sidebar nav small,.navigation-group summary:after){color:#94aa9b}
html[data-theme="dark"] .sidebar nav a[aria-current="page"]{box-shadow:inset 3px 0 0 var(--sage)}
html[data-theme="dark"] .app-shell:has(.cash-dashboard) .sidebar nav a[aria-current="page"]{background:var(--pale);color:#c5e5ce;box-shadow:inset 3px 0 0 var(--sage)}
html[data-theme="dark"] .app-shell:has(.cash-dashboard) .topbar{background:var(--theme-sidebar)}
html[data-theme="dark"] .app-shell:has(.cash-dashboard) .topbar .test-banner{background:#254d37;color:#d8f0df}
html[data-theme="dark"] :is(.brand img,.login-logo){background:#f7faf7;border-radius:9px;padding:5px;box-sizing:content-box}
html[data-theme="dark"] :is(.test-banner,.workflow-steps .current .step-number,.export-steps .active b){background:#254d37;color:#d8f0df;border-color:#4b7057}
html[data-theme="dark"] :is(.page-card,.summary-card,.invoice-workflow,.login-card,.purchase-card,.purchase-source-panel,.purchase-secondary-panel,.user-role-card,.account-picker-popup){background:var(--theme-surface);color:var(--theme-text);border-color:var(--line);box-shadow:0 4px 18px #0000000c}
html[data-theme="dark"] :is(.summary-card span,.summary-card small,.export-section-title p,.export-subline,.export-group-heading,.export-source-summary,.export-total span,.export-preview-heading p,.export-hash,.export-luca-step p){color:var(--theme-muted)}
html[data-theme="dark"] :is(.summary-card strong,.export-total strong,.export-preview-total strong,.export-group-heading h3){color:var(--theme-accent)}
html[data-theme="dark"] :is(.tabs a,.purchase-detail-nav a,.logout){background:var(--theme-surface);color:var(--theme-accent);border-color:var(--line)}
html[data-theme="dark"] :is(.tabs a:hover,.purchase-detail-nav a:hover,.logout:hover){background:var(--theme-hover);color:#d3ecda}
html[data-theme="dark"] .tabs .active{background:var(--theme-button-bg);color:var(--theme-button-ink);border-color:var(--theme-button-bg)}
html[data-theme="dark"] :is(.notice,.tone-neutral,.workflow-steps li,.export-notes,.export-luca-step,.export-group,.export-split-panel,.sales-draft-editor .sales-draft-line,.cost-sale-lines article,.cost-allocation-row,.chart-preview,.user-hint,.batch-common,.receipt-confirm){background:var(--theme-raised);color:var(--theme-text);border-color:var(--line)}
html[data-theme="dark"] :is(.workflow-steps .current,.export-steps .active,.export-confirmation:has(.form-check-input:checked)){background:var(--pale);border-color:#597a62;color:#c5e5ce}
html[data-theme="dark"] :is(.step-number,.export-steps b){border-color:#526b5b;color:var(--theme-muted)}
html[data-theme="dark"] .export-steps li{background:var(--theme-surface);color:var(--theme-muted);border-color:var(--line)}
html[data-theme="dark"] :is(.workflow-steps .done .step-number,.export-steps .done b,.export-section-number){background:var(--pale);color:var(--theme-accent);border-color:var(--line)}
html[data-theme="dark"] :is(.invoice-identifiers,.approval-record,.export-source-summary,.export-preview-heading,.export-preview-total,.purchase-source-body,.purchase-file-actions,.purchase-pagination,.purchase-list-note,.account-picker-manage,.luca-connection-body,.transfer-phone-footer,.ledger-balance-meta,.ledger-excluded-note){border-color:var(--line)}

/* Bootstrap and native controls share one surface; readonly/disabled remain distinct. */
html[data-theme="dark"] :is(.form-control,.form-select,.input-group-text,input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),textarea,select){background-color:var(--theme-input);color:var(--theme-text);border-color:#49604f;caret-color:#d8efdf}
html[data-theme="dark"] :is(.form-control,.form-select,textarea,input)::placeholder{color:#a0b2a5;opacity:1}
html[data-theme="dark"] :is(.form-control:focus,.form-select:focus,input:focus,textarea:focus,select:focus){background-color:#263c2e;color:#eff7f1;border-color:#91b79c;box-shadow:0 0 0 3px #91b79c26}
html[data-theme="dark"] :is(.form-control[readonly],.form-control:disabled,.form-select:disabled,input:disabled,textarea:disabled,select:disabled){background-color:#19271e;color:#91a596;border-color:#34483b;opacity:1}
html[data-theme="dark"] .purchasing-page .form-control:read-only{background-color:#19271e;color:#a4b5a8;border-color:#34483b}
html[data-theme="dark"] :is(.form-control,.form-select).is-invalid{border-color:#b76574}
html[data-theme="dark"] :is(input,textarea,select):-webkit-autofill{box-shadow:0 0 0 1000px #223329 inset;-webkit-text-fill-color:#e3ece5;caret-color:#e3ece5}
html[data-theme="dark"] select:not([multiple]):not([size]){--bs-form-select-bg-img:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23b8cdbf' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e")}
html[data-theme="dark"] :is(.form-label,.purchase-field label,.purchasing-page .form-label,.export-editor .form-label,.sales-draft-editor .form-label,.user-form-grid label,.user-password-page label,.income-fields label,.batch-common label,.batch-table details label,.supplier-payment-terms-form label){color:#c0d2c5}
html[data-theme="dark"] :is(.form-check,.export-editor .export-confirmation,.sales-draft-editor .form-check,.user-active-switch,.user-role-active .user-active-switch){background:#223329;border-color:#3e5847;color:#c7dbcd}
html[data-theme="dark"] :is(.form-check-label,.form-check>.form-check-label,.export-editor .export-confirmation .form-check-label,.user-active-switch,.user-toggle b,.batch-confirm){color:#c7dbcd}
html[data-theme="dark"] :is(.form-check-input,input[type="checkbox"],input[type="radio"]){background-color:#18271e;border-color:#789a82;accent-color:#679978}
html[data-theme="dark"] :is(.form-check-input:checked,.form-check-input:indeterminate){background-color:#477756;border-color:#8eb49a}
html[data-theme="dark"] .form-check-input:disabled{background-color:#26372b;opacity:.5}
html[data-theme="dark"] :is(.form-check-input:focus-visible,.user-toggle input:focus-visible+span){outline:3px solid #91b79c;outline-offset:3px;box-shadow:none}
html[data-theme="dark"] .user-toggle span{background:#475d4d}
html[data-theme="dark"] .user-toggle input:checked+span{background:#477756}
html[data-theme="dark"] .user-toggle span:after{background:#e4f0e6}
html[data-theme="dark"] :is(.btn-mistone,.btn-primary,.btn-success,.transfer-camera-button){--bs-btn-bg:#306e50;--bs-btn-border-color:#306e50;--bs-btn-color:#f1f8f3;--bs-btn-hover-bg:#3b805e;--bs-btn-hover-border-color:#3b805e;--bs-btn-hover-color:#fff;--bs-btn-active-bg:#254f3b;--bs-btn-active-color:#fff;--bs-btn-disabled-bg:#294b38;--bs-btn-disabled-color:#acbdb0;background:#306e50;color:#f1f8f3;border-color:#457c5d}
html[data-theme="dark"] :is(.btn-mistone:hover,.btn-primary:hover,.btn-success:hover,.transfer-camera-button:hover){background:#3b805e;color:#fff;border-color:#5a9872}
html[data-theme="dark"] :is(.btn-outline-secondary,.btn-outline-primary,.btn-light,.transfer-gallery-button){--bs-btn-color:#bdd8c6;--bs-btn-border-color:#526c5b;--bs-btn-hover-bg:#293e30;--bs-btn-hover-color:#e3f1e7;--bs-btn-active-bg:#304b39;--bs-btn-active-color:#f0f7f2;--bs-btn-disabled-color:#81998a;--bs-btn-disabled-border-color:#3f5547;background:transparent;color:#bdd8c6;border-color:#526c5b}
html[data-theme="dark"] :is(.btn-outline-secondary:hover,.btn-outline-primary:hover,.btn-light:hover,.transfer-gallery-button:hover){background:#293e30;color:#e3f1e7;border-color:#789982}
html[data-theme="dark"] .btn-outline-success{--bs-btn-color:#8bd3aa;--bs-btn-border-color:#4b7759;--bs-btn-hover-bg:#203b2b;--bs-btn-hover-color:#c2ebd1;--bs-btn-active-bg:#2d513b;--bs-btn-active-color:#e7f6ed;color:#8bd3aa;border-color:#4b7759}
html[data-theme="dark"] .btn-outline-warning{--bs-btn-color:#e2bd78;--bs-btn-border-color:#806b45;--bs-btn-hover-bg:#392f20;--bs-btn-hover-color:#f3dbaa;color:#e2bd78;border-color:#806b45}
html[data-theme="dark"] .btn-outline-info{--bs-btn-color:#a2c9df;--bs-btn-border-color:#517386;--bs-btn-hover-bg:#20333d;--bs-btn-hover-color:#d5ebf5;color:#a2c9df;border-color:#517386}
html[data-theme="dark"] :is(.btn-outline-danger,.receipt-delete-link,.ledger-remove-action){--bs-btn-color:#f0a0aa;--bs-btn-border-color:#69414c;--bs-btn-hover-bg:#3b242b;--bs-btn-hover-color:#ffd9de;color:var(--theme-danger);border-color:var(--theme-danger-line)}
html[data-theme="dark"] :is(.receipt-delete-link:hover,.btn-outline-danger:hover){background:var(--theme-danger-bg);color:#ffd9de}
html[data-theme="dark"] :is(.btn-link,.export-block-label){color:var(--theme-accent)}
html[data-theme="dark"] :is(.btn-close){filter:invert(1) grayscale(100%) brightness(1.5)}
html[data-theme="dark"] .btn-close:focus-visible{outline:3px solid #91b79c;outline-offset:3px;box-shadow:none}
html[data-theme="dark"] input[type="file"]::file-selector-button{background:#2b4434;color:#d7e9dc;border-color:#47634f}

/* Tables keep their original layout, row visibility, and sticky balance column. */
html[data-theme="dark"] :is(.table,.purchase-table,.ledger-table,.batch-table,.user-table){--bs-table-color:#e3ece5;--bs-table-bg:transparent;--bs-table-border-color:#34483b;--bs-table-striped-color:#e3ece5;--bs-table-striped-bg:#213126;--bs-table-hover-color:#eef6f0;--bs-table-hover-bg:#273b2d;color:var(--theme-text);border-color:var(--line)}
html[data-theme="dark"] :is(.table,.purchase-table,.ledger-table,.batch-table,.user-table)>thead>tr>th,
html[data-theme="dark"] :is(.chart-table,.income-table) th{background:#213127;color:#b2c9b9;border-color:var(--line)}
html[data-theme="dark"] :is(.table,.purchase-table,.ledger-table,.batch-table,.user-table)>tbody>tr>:is(td,th),
html[data-theme="dark"] :is(.chart-table,.income-table) td{color:var(--theme-text);border-color:var(--line);background-color:transparent}
html[data-theme="dark"] :is(.purchase-table,.table,.ledger-table)>tbody>tr:hover{background:#23362a}
html[data-theme="dark"] :is(.customer-account-table,.purchase-invoice-table,.purchase-supplier-table,.ledger-table)>tbody>tr{border-color:var(--line)}
html[data-theme="dark"] .supplier-list-page .purchase-supplier-table>tbody>tr{background:var(--theme-surface)}
html[data-theme="dark"] :is(.purchase-table,.customer-account-table,.ledger-table) :is(.purchase-supplier-identity,.purchase-row-actions,.customer-account-balance,.customer-account-actions,.ledger-reference,.ledger-balance-cell){border-color:var(--line)!important}
html[data-theme="dark"] .ledger-table .ledger-balance-cell{background:#253a2b;color:#b9dfc4;box-shadow:-3px 0 6px #0000001a}
html[data-theme="dark"] .ledger-table thead .ledger-balance-cell{background:#2b4433;color:#c6e6cf}
html[data-theme="dark"] :is(.cost-journal tfoot,.export-block-picker,.export-block-picker thead){background:#213127;color:var(--theme-text);border-color:var(--line)}
html[data-theme="dark"] :is(.purchase-table-scroll,.ledger-table-wrap,.accounting-preferences .table-responsive,.user-table-scroll,.batch-table-scroll){border-color:var(--line);scrollbar-color:#526c5a #142019}
html[data-theme="dark"] :is(.purchase-invoice-table,.purchase-supplier-table,.customer-account-table,.ledger-table) [data-label]:before{color:#a0b9a8}

/* Counterparties, incoming invoices and accounting choices. */
html[data-theme="dark"] .purchasing-page{--purchase-ink:#e3ece5;--purchase-muted:#a4b5a8;--purchase-line:#34483b;--purchase-soft:#223329;color:#e3ece5}
html[data-theme="dark"] :is(.purchase-document-link,.purchase-supplier-name,.purchase-text-link,.purchase-open-link,.purchase-detail-nav a,.purchase-secondary-panel>summary,.purchase-source-panel>summary,.account-picker-option,.account-picker-manage,.customer-sync-coverage summary,.customer-sync-issues summary,.cost-sale-lines span,.chart-status strong,.income-summary strong,.income-advanced summary,.user-role-card a,.user-table strong){color:var(--theme-accent)}
html[data-theme="dark"] :is(.purchase-document-link:hover,.purchase-supplier-name:hover,.purchase-text-link:hover,.purchase-open-link:hover,.purchase-file-link:hover){color:#cbe9d4}
html[data-theme="dark"] :is(.purchase-file-link,.purchase-account-code,.purchase-unset,.purchase-amount small,.purchase-provider-status,.purchase-section-note,.purchase-table-hint,.purchase-list-note,.ledger-section-note,.ledger-balance-caption,.ledger-balance-heading,.ledger-balance-value small,.ledger-balance-meta dt,.supplier-payment-terms p,.supplier-payment-terms-input>span,.user-form-grid small,.user-table small,.user-role-card p,.user-role-active small,.user-permission-table th small,.cost-sale-lines small,.cost-accounting .purchase-meta,.cost-table-hint,.chart-status span,.chart-status small,.chart-empty,.account-picker-empty,.income-details span,.income-summary small,.income-fields small,.income-table small,.income-empty){color:var(--theme-muted)}
html[data-theme="dark"] :is(.purchase-pagination strong,.purchase-empty strong,.receipt-empty h3,.transfer-empty h3,.transfer-photo-body strong,.transfer-instructions,.receipt-delete-amount,.batch-amount,.ledger-balance-meta dd){color:#ccdfd1}
html[data-theme="dark"] :is(.purchase-count,.purchase-empty-icon,.purchase-status,.export-pill,.chart-badge,.user-badge,.transfer-count,.transfer-connection,.batch-state){background:#293e30;color:#bdd8c6;border-color:#3f5a48}
html[data-theme="dark"] :is(.purchase-empty,.receipt-camera,.receipt-delete-photo,.customer-sync-progress,.chart-message,.chart-preview,.ledger-balance-card,.luca-connection-counts>div,.transfer-qr-placeholder,.transfer-photo,.transfer-photo img,.transfer-phone-photo,.transfer-phone-photo img,.transfer-phone-status,.transfer-phone-summary h2 span,.batch-merchant img){background:#213429;color:#c4dbc9;border-color:#3c5745;box-shadow:none}
html[data-theme="dark"] .ledger-balance-card{background:linear-gradient(135deg,#223a2b,#1b2921)}
html[data-theme="dark"] :is(.ledger-balance-value,.supplier-payment-terms-value,.purchase-payable .purchase-amount,.chart-status strong,.chart-message){color:var(--theme-positive)}
html[data-theme="dark"] :is(.purchase-amount-summary>div,.purchase-amount-summary>div:last-child){background:#213429;border-color:#3c5745}
html[data-theme="dark"] :is(.purchase-amount-summary dt,.purchase-amount-summary dd small){color:var(--theme-muted)}
html[data-theme="dark"] .purchase-amount-summary dd{color:#c2dfca}
html[data-theme="dark"] .account-search-input{background:var(--theme-input);border-color:#49604f}
html[data-theme="dark"] .account-search-input input{background:transparent}
html[data-theme="dark"] :is(.account-search-input svg,.account-search-bar [data-account-count]){color:var(--theme-muted)}
html[data-theme="dark"] :is(.account-search-bar>label,.account-search-input button){color:#c0d2c5}
html[data-theme="dark"] .account-search-empty{background:var(--theme-raised);color:var(--theme-muted)}
html[data-theme="dark"] .account-search-input:focus-within{outline-color:#91b79c}
html[data-theme="dark"] .sales-draft-editor .sales-draft-line>.col-12{color:var(--theme-accent)}
html[data-theme="dark"] :is(.account-picker-option:hover,.account-picker-option[aria-selected="true"]){background:#2b4433;color:#d1ebd9}
html[data-theme="dark"] :is(.account-picker-caption,.account-picker-manage){color:#a3ceb0}
html[data-theme="dark"] .customer-country-flag{border-color:#526b5b}
html[data-theme="dark"] :is(.chart-badge[data-active="false"],.ledger-row-excluded .ledger-description,.ledger-balance-cell small,.ledger-excluded-note,.ledger-balance-unknown,.account-picker-caption.is-warning){color:var(--theme-warning)}

/* Semantic colours remain meaningful instead of inverting the original palette. */
html[data-theme="dark"] :is(.tone-ready,.purchase-status.is-ready,.export-pill.ready,.user-badge.is-active,.income-status[data-status="Received"],.batch-table tr[data-state="saved"] .batch-state){background:var(--theme-positive-bg);color:var(--theme-positive);border-color:var(--theme-positive-line)}
html[data-theme="dark"] :is(.tone-warning,.preview-label,.export-pill.attention,.export-issues,.customer-sync-warning,.purchase-status.is-warning,.purchasing-page .tone-warning,.ledger-balance-card.is-partial,.chart-badge[data-active="false"],.income-status:not([data-status="Received"]):not([data-status="Cancelled"]),.batch-table tr[data-state="warning"] .batch-state,.transfer-phone-status[data-error="true"]){background:var(--theme-warning-bg);color:var(--theme-warning);border-color:var(--theme-warning-line)}
html[data-theme="dark"] :is(.export-warnings,.purchase-status.is-neutral,.user-badge,.income-status[data-status="Cancelled"]){background:#29382e;color:#b0c3b5;border-color:#415747}
html[data-theme="dark"] :is(.tone-pending){background:var(--theme-info-bg);color:var(--theme-info);border-color:var(--theme-info-line)}
html[data-theme="dark"] .ledger-row-excluded .ledger-balance-cell{color:var(--theme-muted)}
html[data-theme="dark"] :is(.user-badge.is-inactive,.chart-message.is-error){background:var(--theme-danger-bg);color:var(--theme-danger);border-color:var(--theme-danger-line)}
html[data-theme="dark"] :is(.text-danger,.validation-summary-errors,.field-validation-error,.purchasing-page .validation-summary-errors,.purchasing-page .field-validation-error){color:#f0a0aa!important}
html[data-theme="dark"] :is(.text-success){color:#8bd3aa!important}
html[data-theme="dark"] :is(.text-warning){color:#e2bd78!important}
html[data-theme="dark"] :is(.alert-success){--bs-alert-color:#8bd3aa;--bs-alert-bg:#203b2b;--bs-alert-border-color:#3c6249;--bs-alert-link-color:#c0e8d0}
html[data-theme="dark"] :is(.alert-warning){--bs-alert-color:#e2bd78;--bs-alert-bg:#392f20;--bs-alert-border-color:#665338;--bs-alert-link-color:#f0d59f}
html[data-theme="dark"] :is(.alert-danger){--bs-alert-color:#f0a0aa;--bs-alert-bg:#3b242b;--bs-alert-border-color:#69414c;--bs-alert-link-color:#ffd8de}
html[data-theme="dark"] :is(.alert-info){--bs-alert-color:#a2c9df;--bs-alert-bg:#20333d;--bs-alert-border-color:#3d5b6a;--bs-alert-link-color:#d0e7f2}

/* Receipt photographs, QR and CAPTCHA keep their source pixels; only their surrounding UI changes. */
html[data-theme="dark"] :is(.receipt-camera,.receipt-status,.receipt-empty,.receipt-camera small,.transfer-step,.transfer-help,.transfer-label,.transfer-phone-label,.transfer-phone-intro,.transfer-phone-summary>span,.transfer-phone-photo small,.transfer-phone-footer,.transfer-photo-body small,.batch-table small,.batch-common label,.batch-table details label){color:var(--theme-muted)}
html[data-theme="dark"] :is(#receipt-canvas,.transfer-photo img,.receipt-delete-photo){background:#17241c}
html[data-theme="dark"] :is(.transfer-phone-body){background:var(--theme-page);color:var(--theme-text)}
html[data-theme="dark"] :is(.transfer-brand,.transfer-brand span){color:var(--theme-accent)}
html[data-theme="dark"] :is(.transfer-phone-photo[data-state="sent"] small,.transfer-photo[data-saved="true"] .transfer-photo-body small){color:var(--theme-positive)}
html[data-theme="dark"] :is(.transfer-phone-photo[data-state="failed"] small,.batch-table details p,.batch-table details a,.batch-table summary){color:var(--theme-warning)}
html[data-theme="dark"] .batch-table .batch-missing{background:#352f21;border-color:#806b45}
html[data-theme="dark"] .batch-table tr[data-state="saved"]{background:#20352a}
html[data-theme="dark"] .transfer-phone-photo button{background:var(--theme-warning-bg);border-color:var(--theme-warning-line);color:var(--theme-warning)}
html[data-theme="dark"] .transfer-photo-body .receipt-delete-link,html[data-theme="dark"] .batch-table a.receipt-delete-link{border-color:var(--theme-danger-line);color:var(--theme-danger)}
html[data-theme="dark"] :is(.incoming-sync,.luca-connection,.login-captcha-loading){background:var(--theme-surface);color:#bdd8c6;border-color:var(--line)}
html[data-theme="dark"] :is(.incoming-sync a,.incoming-sync-icon){color:var(--theme-accent)}
html[data-theme="dark"] .incoming-sync-icon{background:#2a4433}
html[data-theme="dark"] :is(.incoming-sync-copy small,.luca-connection [data-luca-state],.luca-connection-counts dt){color:var(--theme-muted)}
html[data-theme="dark"] :is(.incoming-sync[data-state="Failed"],.incoming-sync[data-state="Review"]){background:var(--theme-warning-bg);border-color:var(--theme-warning-line);color:var(--theme-warning)}
html[data-theme="dark"] .luca-connection-dot{background:#81988a}
html[data-theme="dark"] .luca-connection[data-state="Connected"] .luca-connection-dot{background:#8bd3aa}
html[data-theme="dark"] :is(.luca-connection[data-state="NeedsSelection"],.luca-connection[data-state="NeedsLogin"]) .luca-connection-dot{background:#e2bd78}

/* The animated mark already has its own white-to-alpha mask. Do not filter documents or CAPTCHA. */
html[data-theme="dark"] .page-loading{background:rgba(16,24,20,.9)}
html[data-theme="dark"] .page-loading:before{background:radial-gradient(ellipse at 50% 46%,rgba(53,82,59,.32),transparent 57%),radial-gradient(ellipse at 88% 8%,rgba(63,93,68,.13),transparent 50%),radial-gradient(ellipse at 8% 88%,rgba(101,91,57,.08),transparent 52%)}
html[data-theme="dark"] .page-loading-signature{mix-blend-mode:normal}
html[data-theme="dark"] .page-loading-aura{background:radial-gradient(ellipse,rgba(145,183,156,.15),rgba(84,118,91,.035) 55%,transparent 73%)}
html[data-theme="dark"] .page-loading-vein{stroke:#91b79c}
html[data-theme="dark"] .page-loading-vein-two{stroke:#b5b098}
html[data-theme="dark"] :is(.page-loading-wordmark,.page-loading-wordmark span,.page-loading-slow){color:#a4b5a8}
html[data-theme="dark"] .page-loading-message{color:#d8e9dc}
html[data-theme="dark"] .page-loading-thread{background:#34483b}
html[data-theme="dark"] .page-loading-thread span{background:linear-gradient(90deg,transparent,#a3ceb0,transparent)}
html[data-theme="dark"] .page-loading-shadow{background:radial-gradient(ellipse,rgba(0,0,0,.3),transparent 70%)}
html[data-theme="dark"] .theme-picker{background:#18271e;border-color:#3b5343}
html[data-theme="dark"] .theme-picker-option{color:#9fb5a7}
html[data-theme="dark"] .theme-picker-option:hover{background:#293e30;color:#d5e9dc}
html[data-theme="dark"] .theme-picker-option[aria-pressed="true"]{background:#2d4936;border-color:#547a5e;color:#d7efdf;box-shadow:none}
html[data-theme="dark"] .theme-picker-status:not([hidden]){color:#f0b2a1}
html[data-theme="dark"] :is(.modal-content,.dropdown-menu,.popover){background:var(--theme-surface);color:var(--theme-text);border-color:var(--line);--bs-dropdown-bg:#1b2921;--bs-dropdown-color:#e3ece5;--bs-dropdown-link-color:#e3ece5;--bs-dropdown-link-hover-bg:#293e30;--bs-dropdown-link-hover-color:#eff8f2}
html[data-theme="dark"] :is(.modal-header,.modal-footer){border-color:var(--line)}
html[data-theme="dark"] :is(pre,code){color:#c5dccc}
html[data-theme="dark"] pre{background:#142019;border-color:var(--line)}
html[data-theme="dark"] :is(.bg-white,.bg-light){background-color:var(--theme-surface)!important}
html[data-theme="dark"] :is(.text-dark,.text-body){color:var(--theme-text)!important}
html[data-theme="dark"] .text-muted{color:var(--theme-muted)!important}
html[data-theme="dark"] :is(.border,.border-top,.border-bottom,.border-start,.border-end){border-color:var(--line)!important}
html[data-theme="dark"] hr{border-color:#68836e;opacity:.45}
@media(max-width:940px){html[data-theme="dark"] :is(.customer-account-table,.purchase-invoice-table,.purchase-supplier-table,.ledger-table)>tbody>tr{background:var(--theme-surface)}html[data-theme="dark"] .ledger-table .ledger-balance-cell{background:transparent;box-shadow:none}}
}

@media print{
    .theme-picker,.theme-picker-floating,.theme-picker-status{display:none!important}
    html[data-theme="dark"]{color-scheme:light!important;background:#fff!important;--ink:#1c3040;--green:#245c49;--sage:#88ad99;--pale:#e8f2ec;--bg:#fff;--line:#c7d5cb;--bs-body-color:#1c3040;--bs-body-color-rgb:28,48,64;--bs-body-bg:#fff;--bs-body-bg-rgb:255,255,255;--bs-emphasis-color:#111;--bs-emphasis-color-rgb:17,17,17;--bs-secondary-color:#52675a;--bs-tertiary-color:#52675a;--bs-secondary-bg:#f3f6f3;--bs-tertiary-bg:#f7f9f7;--bs-border-color:#c7d5cb;--bs-table-color:#1c3040;--bs-table-bg:#fff}
    html[data-theme="dark"] body{background:#fff!important;color:#1c3040!important}
    html[data-theme="dark"] :is(.page-card,.summary-card,.purchase-card,.invoice-workflow,.export-group,.sales-draft-line,.cost-allocation-row,.ledger-balance-card,.login-card){background:#fff!important;color:#1c3040!important;box-shadow:none!important}
    html[data-theme="dark"] :is(.table,.purchase-table,.ledger-table,.user-table,.batch-table){--bs-table-color:#1c3040;--bs-table-bg:#fff;--bs-table-border-color:#c7d5cb;color:#1c3040!important;background:#fff!important}
}
