/* Shared interface colors. Screen-only rules keep paper documents in their original palette. */
.theme-toggle{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 42px;inline-size:42px;min-block-size:40px;padding:9px;border:1px solid #dce7e3;border-radius:11px;background:#f6faf8;color:#35665b;cursor:pointer;isolation:isolate}
.theme-toggle:hover{background:#eaf5f1;border-color:#9bcbbf;color:#117e70}
.theme-toggle:focus-visible{outline:3px solid #8ccfc3;outline-offset:3px}
.theme-toggle svg,.theme-toggle-icon{display:block;width:19px;height:19px;flex:none}
.theme-toggle [data-theme-icon="sun"]{display:none}
.theme-toggle [hidden]{display:none!important}
.theme-toggle:disabled{cursor:progress}

@media screen{
html[data-theme="dark"]{
  color-scheme:dark;
  --canvas:#0f202a;--sidebar:#10242e;--ink:#e5eef2;--muted:#a0b3bd;--line:#2b424e;
  --primary:#68d3b8;--primary-dark:#9ae6d1;
  --theme-surface:#172c37;--theme-raised:#1d3541;--theme-soft:#142832;--theme-hover:#203d46;
  --theme-border:#2b424e;--theme-border-strong:#3f5b66;--theme-text:#c4d3db;--theme-muted:#9bb0bb;
  --theme-green:#86ddc4;--theme-green-bg:#193f3a;--theme-green-border:#2b5f54;
  --theme-blue:#9ebff2;--theme-blue-bg:#20374f;--theme-blue-border:#354f70;
  --theme-amber:#ecc081;--theme-amber-bg:#3e3427;--theme-amber-border:#665035;
  --theme-red:#f0a4ac;--theme-red-bg:#412c35;--theme-red-border:#6b414c;
  --theme-purple:#c1afea;--theme-purple-bg:#322f48;--theme-purple-border:#514968;
  --bs-body-color:var(--ink);--bs-body-color-rgb:229,238,242;--bs-body-bg:var(--canvas);--bs-body-bg-rgb:15,32,42;
  --bs-emphasis-color:#f0f6f8;--bs-emphasis-color-rgb:240,246,248;
  --bs-secondary-color:var(--theme-muted);--bs-secondary-color-rgb:155,176,187;
  --bs-secondary-bg:var(--theme-raised);--bs-secondary-bg-rgb:29,53,65;
  --bs-tertiary-color:#8ea4af;--bs-tertiary-bg:var(--theme-soft);--bs-tertiary-bg-rgb:20,40,50;
  --bs-border-color:var(--line);--bs-border-color-translucent:rgba(163,191,204,.18);
  --bs-link-color:var(--primary);--bs-link-color-rgb:104,211,184;--bs-link-hover-color:var(--primary-dark);--bs-link-hover-color-rgb:154,230,209;
  --bs-primary-text-emphasis:#9ae6d1;--bs-primary-bg-subtle:#193f3a;--bs-primary-border-subtle:#2b5f54;
  --bs-success-text-emphasis:#9ce0b9;--bs-success-bg-subtle:#1c3c31;--bs-success-border-subtle:#315c46;
  --bs-danger-text-emphasis:#f0a4ac;--bs-danger-bg-subtle:#412c35;--bs-danger-border-subtle:#6b414c;
  --bs-warning-text-emphasis:#ecc081;--bs-warning-bg-subtle:#3e3427;--bs-warning-border-subtle:#665035;
  --bs-info-text-emphasis:#9ebff2;--bs-info-bg-subtle:#20374f;--bs-info-border-subtle:#354f70;
}
html[data-theme="dark"] body{background:var(--canvas);color:var(--ink)}
html[data-theme="dark"] .theme-toggle [data-theme-icon="moon"]{display:none}
html[data-theme="dark"] .theme-toggle [data-theme-icon="sun"]{display:block}
html[data-theme="dark"] :is(.topbar,.panel-card,.metric-card,.card,.pagination-top,.settings-studio,.settings-preview-window,.settings-preview-panes,.settings-demo-topbar,.settings-demo-account,.billing-card,.permission-card,.rates-latest-card,.support-welcome,.deadline-card,.detail-waiting,.dc-file-card){background:var(--theme-surface);border-color:var(--line);color:var(--ink);box-shadow:0 3px 18px #07121a12}
html[data-theme="dark"] :is(.skip-link,.dropdown-menu,.language-options,.global-search-panel,.customs-suggestions,.select2-dropdown,.modal-content,.swal2-popup,.dc-context,.dc-start-menu,.dc-detail-panel){background:var(--theme-raised);border-color:var(--theme-border-strong);color:var(--ink);box-shadow:0 18px 54px #030b1352}
html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6){color:var(--ink)}
html[data-theme="dark"] :is(.text-muted,.text-secondary){color:var(--theme-muted)!important}
html[data-theme="dark"] .text-dark{color:var(--ink)!important}
html[data-theme="dark"] .text-primary{color:var(--primary)!important}
html[data-theme="dark"] .text-success{color:var(--theme-green)!important}
html[data-theme="dark"] .text-danger{color:var(--theme-red)!important}
html[data-theme="dark"] .bg-white{background-color:var(--theme-surface)!important}
html[data-theme="dark"] .bg-light{background-color:var(--theme-soft)!important}
html[data-theme="dark"] .border{border-color:var(--line)!important}
html[data-theme="dark"] :is(.topbar-label strong,.global-search-input input,.account-toggle,.language-toggle,.global-search-result,.language-option,.account-dropdown .dropdown-item){color:var(--theme-text)}
html[data-theme="dark"] :is(.page-heading p,.eyebrow,.today,.topbar-label,.page-size-label,.card-heading p,.metric-top,.metric-bottom,.card-foot,.app-footer,.status-text,.empty-state p,.form-text,.form-save-hint,.chart-card p,.chart-message,.search-field svg,.back-link,.form-loading){color:var(--theme-muted)}
html[data-theme="dark"] :is(.card-heading,.card-foot,.metric-bottom,.app-footer,.list-toolbar,.pagination-bar,.detailed-filters,.detail-tabs,.form-section,.detail-info-section,.detail-print,.export-toolbar,.delete-actions-top,.profile-session,.quick-links a,.network-counts,.network-counts a:last-child,.related-card a,.analysis-update,.analysis-door-card footer,.movement-link-detail+.movement-link-detail){border-color:var(--line)}
html[data-theme="dark"] :is(.today-card .card-heading,.today-card .card-foot,.company-billing-active>.panel-card>.card-heading,.company-billing-active [data-company-section="billing"],.billing-card-heading){background:var(--theme-surface);border-color:var(--line)}
html[data-theme="dark"] :is(.theme-toggle,.global-search-input,.account-toggle,.language-toggle){background:var(--theme-soft);border-color:var(--theme-border);color:var(--theme-text)}
html[data-theme="dark"] :is(.theme-toggle:hover,.language-toggle:hover,.language-picker[open] .language-toggle,.account-toggle:hover,.global-search-input:focus-within){background:var(--theme-hover);border-color:#4f897c;color:var(--theme-green)}
html[data-theme="dark"] :is(.global-search-input kbd,.account-toggle .account-chevron){background:var(--theme-raised);border-color:var(--theme-border-strong);color:var(--theme-muted)}
html[data-theme="dark"] :is(.account-toggle small,.account-menu-heading,.account-dropdown .account-menu-heading,.language-heading,.language-code,.global-search-status,.global-search-group,.global-search-result small,.global-search-foot){color:var(--theme-muted)}
html[data-theme="dark"] :is(.global-search-status,.global-search-foot,.account-dropdown .dropdown-divider){border-color:var(--line)}
html[data-theme="dark"] .global-search-foot{background:var(--theme-soft)}
html[data-theme="dark"] :is(.global-search-result:hover,.global-search-result.selected,.language-option:hover,.language-option.is-selected,.account-dropdown .dropdown-item:hover,.account-dropdown .dropdown-item:focus,.dropdown-item:hover,.dropdown-item:focus){background:var(--theme-hover);color:var(--theme-green)}
html[data-theme="dark"] :is(.account-toggle:hover .account-chevron,.account-toggle:focus-visible .account-chevron){background:var(--theme-green-bg);border-color:var(--theme-green-border);color:var(--theme-green)}
html[data-theme="dark"] .account-toggle[aria-expanded="true"] .account-chevron{background:#267b6b;border-color:#369c86;color:#fff}
html[data-theme="dark"] :is(.sidebar-user,.truva-promo){background:linear-gradient(135deg,#1d3943,#162e3a);border-color:#34525c}
html[data-theme="dark"] :is(.sidebar-search,.sidebar-foot.sidebar-credit){background:#0c202a}
html[data-theme="dark"] .sidebar{border-inline-end:1px solid #233b46}
html[data-theme="dark"] :is(.sidebar .nav-section,.sidebar-user-caption){color:#91b4c1}
html[data-theme="dark"] :is(.sidebar-credit p,.sidebar-user-info small,.sidebar-search input::placeholder){color:#9eb5c0}

/* Table density and layout stay unchanged; only surfaces and semantic tones change. */
html[data-theme="dark"] .table{--bs-table-color:var(--theme-text);--bs-table-bg:transparent;--bs-table-border-color:var(--line);--bs-table-striped-color:var(--theme-text);--bs-table-striped-bg:#ffffff04;--bs-table-hover-color:var(--ink);--bs-table-hover-bg:#70c9b90a;--bs-table-active-color:var(--ink);--bs-table-active-bg:#70c9b916}
html[data-theme="dark"] :is(.warehouse-table thead,.warehouse-table th,.today-card .warehouse-table th,.settings-demo-table th,.skeleton-table>div:first-child){background:var(--theme-soft);border-color:var(--line);color:var(--theme-muted)}
html[data-theme="dark"] :is(.warehouse-table td,.warehouse-table td:first-child,.warehouse-table td strong,.settings-demo-table,.settings-demo-table strong){color:var(--theme-text);border-color:var(--line)}
html[data-theme="dark"] :is(.warehouse-table td small,.today-card .warehouse-table small,.warehouse-table .portal-waiting-copy time){color:var(--theme-muted)}
html[data-theme="dark"] .warehouse-table tbody tr:hover{background:var(--theme-hover)}
html[data-theme="dark"] .today-card .warehouse-table td.today-empty{background:linear-gradient(var(--theme-surface),var(--theme-soft));color:var(--theme-muted)}
html[data-theme="dark"] :is(.today-card .today-count,.today-period,.metric-card>strong,.network-card h2,.network-counts strong,.quick-links strong,.container-metrics strong,.container-scan-info strong){color:var(--ink)}
html[data-theme="dark"] :is(.today-heading #today-date,.today-empty,.network-card p,.network-card .eyebrow,.network-counts span,.quick-links small,.container-metrics span,.container-scan-info){color:var(--theme-muted);border-color:var(--line)}
html[data-theme="dark"] :is(.table-scroll-top,.table-density-choices,.vehicle-view-switch){background:var(--theme-soft);border-color:var(--line);scrollbar-color:#4c6975 var(--theme-soft)}
html[data-theme="dark"] :is(.table-responsive,.sidebar-nav,.dc-desktop,.document-viewer-stage){scrollbar-color:#4c6975 transparent}
html[data-theme="dark"] :is(.table-density-label,.table-density-choices button,.vehicle-view-switch button){color:var(--theme-muted)}
html[data-theme="dark"] :is(.table-density-choices button[aria-pressed="true"],.vehicle-view-switch button.active){background:var(--theme-raised);border-color:var(--theme-border-strong);color:var(--theme-green);box-shadow:0 1px 5px #07141d33}
html[data-theme="dark"] .table-density-choices button:not([aria-pressed="true"]):hover{background:var(--theme-hover);color:var(--theme-green)}
html[data-theme="dark"] :is(.btn-white,.page-button,.row-action,.btn-clear-filters,.quick-icon,.settings-demo-edit){background:var(--theme-surface);border-color:var(--theme-border-strong);color:var(--theme-text);box-shadow:none}
html[data-theme="dark"] :is(.btn-white:hover,.row-action:hover,.pagination-bar .page-button:hover:not(:disabled)){background:var(--theme-hover);border-color:#4c8e80;color:var(--theme-green)}
html[data-theme="dark"] .btn-primary{background:#187f73;border-color:#278f81;color:#fff;--bs-btn-disabled-bg:#24564f;--bs-btn-disabled-border-color:#315f58;--bs-btn-disabled-color:#c4dad5}
html[data-theme="dark"] :is(.btn-primary:hover,.btn-primary:active,.btn-primary:focus){background:#219486!important;border-color:#34a291!important;color:#fff}
html[data-theme="dark"] :is(.page-button.active,.pagination-bar .page-button.active:disabled){background:#267f70;border-color:#3c9f8a;color:#fff}
html[data-theme="dark"] :is(.btn-link,.icon-button,.sort-button span){color:var(--theme-muted)}
html[data-theme="dark"] .sort-button.sorted{color:var(--theme-green)}
html[data-theme="dark"] :is(.row-actions .document-link,.row-actions .row-action.company-contacts-link,.row-actions .document-preview-button,.btn-excel,.copy-file-button,.detail-copy-value>.detail-copy-button,.movement-order-fetch.btn,.password-create-button,.company-quick-add,.qr-state-action,.topbar-logout){background:var(--theme-green-bg);border-color:var(--theme-green-border);color:var(--theme-green);box-shadow:none}
html[data-theme="dark"] :is(.row-actions .document-link:hover,.row-actions .company-contacts-link:hover,.row-actions .document-preview-button:hover,.btn-excel:hover,.copy-file-button:hover,.detail-copy-value>.detail-copy-button:hover,.movement-order-fetch.btn:hover,.password-create-button:hover,.company-quick-add:hover:enabled,.qr-state-action:hover,.topbar-logout:hover){background:#24584c;border-color:#4b937e;color:#c0f3df}
html[data-theme="dark"] :is(.row-actions .document-link-etiket,.movement-order-last.btn){background:var(--theme-blue-bg);border-color:var(--theme-blue-border);color:var(--theme-blue)}
html[data-theme="dark"] :is(.row-actions .document-link-etiket:hover,.movement-order-last.btn:hover){background:#2b4867;border-color:#537aaa;color:#c1d7fc}
html[data-theme="dark"] :is(.btn-clear-filters:hover,.row-action.danger:hover,.record-delete-action:hover,.account-dropdown .account-signout:hover,.account-dropdown .account-signout:focus,.photo-delete-button,.btn-missing-location){background:var(--theme-red-bg);border-color:var(--theme-red-border);color:var(--theme-red);box-shadow:none}
html[data-theme="dark"] :is(.btn-clear-filters:hover svg,.record-delete-action,.account-dropdown .account-signout){color:var(--theme-red)}
html[data-theme="dark"] :is(.photo-delete-button:hover:not(:disabled),.btn-missing-location:hover){background:#58333f;border-color:#985562;color:#ffc5cc}
html[data-theme="dark"] :is(.btn-missing-location.active,.btn-missing-location[aria-pressed="true"]){background:#9b4456;border-color:#bd6072;color:white}

/* Status chips preserve the meaning of their colors. */
html[data-theme="dark"] :is(.teal,.status-pill,.subtle-badge,.badge-location,.record-chip,.title-count,.profile-role,.search-result-icon,.account-dropdown .account-menu-icon,.form-section-icon,.record-actions-icon,.movement-link-title-icon,.movement-link-detail-icon,.permission-symbol,.billing-card-icon,.settings-section-icon,.monthly-kpi-icon,.monthly-leader-icon,.analysis-stat>span,.analysis-badge.normal,.analysis-auto-icon,.document-viewer-symbol,.qr-sync-symbol,.qr-sync-metric-icon,.support-hero-icon,.support-icon,.rates-source-icon,.inspector-symbol,.customs-suggestion-icon,.logout-symbol,.modal-parent-label,.timeline-dot,.document-index-state.ready,.vehicle-kind.arrival,.settings-demo-status){background:var(--theme-green-bg);color:var(--theme-green);border-color:var(--theme-green-border)}
html[data-theme="dark"] :is(.blue,.status-pill.entry,.today-card[data-today="entries"] .metric-icon,.timeline-entry .timeline-dot,.document-hit-icon.file-tile-image){background:var(--theme-blue-bg);color:var(--theme-blue);border-color:var(--theme-blue-border)}
html[data-theme="dark"] :is(.orange,.status-pill.exit,.today-card[data-today="exits"] .metric-icon,.timeline-exit .timeline-dot,.analysis-stat.busy>span,.analysis-badge.busy,.vehicle-kind.dispatch,.dispatch .vehicle-timeline-marker,.settings-demo-status.is-waiting,.detail-remaining-note,.caps-lock-warning,.billing-geo-error,.monthly-kpi:nth-child(2) .monthly-kpi-icon,.monthly-kpi:nth-child(4) .monthly-kpi-icon){background:var(--theme-amber-bg);color:var(--theme-amber);border-color:var(--theme-amber-border)}
html[data-theme="dark"] :is(.violet,.timeline-deduction .timeline-dot,.document-hit-icon.file-tile-text){background:var(--theme-purple-bg);color:var(--theme-purple);border-color:var(--theme-purple-border)}
html[data-theme="dark"] :is(.badge-location-missing,.analysis-stat.critical>span,.analysis-badge.critical,.account-dropdown .account-signout .account-menu-icon,.delete-dialog-symbol,.movement-unlink-dialog .movement-link-title-icon,.document-index-state.issue,.document-hit-icon.file-tile-pdf){background:var(--theme-red-bg);color:var(--theme-red);border-color:var(--theme-red-border);box-shadow:none}
html[data-theme="dark"] :is(.badge-location-missing svg,.caps-lock-warning svg){color:currentColor}
html[data-theme="dark"] :is(.status-pill.inactive,.badge-note-empty,.analysis-badge:not(.normal):not(.busy):not(.critical),.movement-count.is-empty,.document-index-state:not(.ready):not(.issue),.document-source-tag,.vehicle-note-group>h2>span,.settings-demo-location,.permission-tags>span,.country-chip){background:var(--theme-soft);color:var(--theme-muted);border-color:var(--line)}
html[data-theme="dark"] :is(.badge-missing,.warehouse-character-count.is-at-limit,.quick-company-length.is-at-limit){color:var(--theme-amber);background:var(--theme-amber-bg);border-color:var(--theme-amber-border)}
html[data-theme="dark"] :is(.badge-note-empty svg,.empty-state h3){color:var(--theme-text)}

/* Inputs, popup editors and searchable selects share one surface treatment. */
html[data-theme="dark"] :is(.form-control,.form-select,.grouped-form .form-control,.grouped-form .form-select,.warehouse-create .form-section .form-control,.warehouse-create .form-section .form-select,.billing-card .form-control,.billing-card .form-select,.contact-dialog-grid .form-control,.login-form-card .login-input-wrap .form-control,.settings-demo-input,.select2-container--default .select2-selection--single,.select2-container--default .select2-selection--multiple,.select2-search--dropdown .select2-search__field){background-color:var(--theme-soft);border-color:var(--theme-border-strong);color:var(--ink)}
html[data-theme="dark"] :is(.form-control:focus,.form-select:focus,.grouped-form .form-control:focus,.contact-dialog-grid .form-control:focus,.login-form-card .login-input-wrap .form-control:focus,.select2-container--focus .select2-selection--single,.select2-container--open .select2-selection--single){background-color:#17313a;border-color:#57ad98;box-shadow:0 0 0 3px #63d0b41a;color:var(--ink)}
html[data-theme="dark"] :is(.form-control::placeholder,.global-search-input input::placeholder,.search-command-input input::placeholder,.vehicle-search-input input::placeholder,.select2-container--default .select2-selection--single .select2-selection__placeholder,.select2-container--default .select2-selection--multiple .select2-search__field::placeholder){color:#91a8b3;opacity:1}
html[data-theme="dark"] :is(.form-control:disabled,.form-control[readonly],.form-select:disabled,.grouped-form [readonly],.grouped-form .form-select:disabled,.warehouse-create .warehouse-file-number-control .form-control,.select2-container--default.select2-container--disabled .select2-selection--single){background:var(--canvas);color:var(--theme-muted);border-color:var(--line)}
html[data-theme="dark"] :is(.form-label,.grouped-form .form-label,.billing-card .form-label,.contact-dialog-grid .form-label,.quick-company-grid .form-label,.movement-link-form .form-label,.login-form-card .form-label,.dc-dialog label){color:var(--theme-text)}
html[data-theme="dark"] :is(.form-check-input,.input-group-text){background-color:var(--theme-soft);border-color:var(--theme-border-strong);color:var(--theme-text)}
html[data-theme="dark"] .form-check-input:checked{background-color:#238b79;border-color:#4cb29a}
html[data-theme="dark"] .form-check-input:focus{box-shadow:0 0 0 3px #63d0b41a}
html[data-theme="dark"] :is(.form-control.is-invalid,.form-select.is-invalid,.warehouse-create .select2-selection[aria-invalid="true"]){border-color:#cf7b89}
html[data-theme="dark"] :is(.invalid-feedback,.warehouse-create .invalid-feedback,.quick-company-dialog .invalid-feedback){color:var(--theme-red)}
html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered{color:var(--ink)}
html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b{border-top-color:var(--theme-muted)}
html[data-theme="dark"] .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-top-color:transparent;border-bottom-color:var(--theme-muted)}
html[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"]{background:var(--theme-green-bg);color:var(--theme-green)}
html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected]{background:#267f70;color:white}
html[data-theme="dark"] .select2-container--default .select2-results__option[aria-disabled="true"]{color:#758f9c}
html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice{background:var(--theme-green-bg);border-color:var(--theme-green-border);color:var(--theme-green)}
html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:var(--theme-green);border-color:var(--theme-green-border)}
html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-search__field{color:var(--ink)}
html[data-theme="dark"] :is(.form-actions,.warehouse-create .form-actions,.record-actions-footer,.document-viewer-toolbar,.document-viewer-footer,.document-archive-toolbar,.export-toolbar,.detail-modal .modal-header,.detail-modal .modal-footer,.attachment-upload-modal .modal-header,.attachment-upload-modal .modal-footer,.contact-dialog .swal2-title,.contact-dialog .swal2-actions,.quick-company-dialog .swal2-actions,.dc-detail-panel>header){background:var(--theme-soft);border-color:var(--line)}
html[data-theme="dark"] :is(.warehouse-create .form-section,.warehouse-create .form-section:last-child,.quick-company-contact,.quick-company-password-help,.record-actions-card,.detail-photo-card,.photo-grid figure,.document-viewer .modal-content,.attachment-upload-modal .modal-content,.contact-dialog-grid .form-control,.user-photo-editor,.profile-password-note){border-color:var(--line)}
html[data-theme="dark"] :is(.warehouse-create .form-section,.quick-company-contact-toggle,.company-billing-active [data-company-section="billing"]){background:var(--theme-surface);color:var(--theme-text)}
html[data-theme="dark"] :is(.quick-company-contact-toggle:hover,.quick-company-chevron,.quick-company-optional-badge,.quick-company-password-help,.password-strength .password-strength-bar>span){background:var(--theme-raised)}
html[data-theme="dark"] .password-strength .password-strength-bar>span{background:var(--theme-raised)!important}
html[data-theme="dark"] :is(.password-strength li.is-met,.password-strength[data-level="3"] .password-strength-label,.user-photo-status:not(.is-error)){color:var(--theme-green)}
html[data-theme="dark"] .password-strength[data-level="1"] .password-strength-label{color:var(--theme-red)}
html[data-theme="dark"] .password-strength[data-level="2"] .password-strength-label{color:var(--theme-amber)}
html[data-theme="dark"] :is(.password-strength,.quick-company-optional,.quick-company-length,.quick-company-dialog .password-create-tools [role="status"],.contact-dialog-hint,.quick-company-password-help,.user-photo-controls p,.user-photo-controls small){color:var(--theme-muted)}
html[data-theme="dark"] :is(.account-password-toggle,.login-input-wrap .password-toggle,.dc-password-toggle){color:var(--theme-muted)}
html[data-theme="dark"] :is(.account-password-toggle:hover,.account-password-toggle[aria-pressed="true"],.login-input-wrap .password-toggle:hover,.dc-password-toggle:hover,.dc-password-toggle[aria-pressed="true"]){background:var(--theme-green-bg);color:var(--theme-green)}
html[data-theme="dark"] .customs-suggestion{color:var(--theme-text)}
html[data-theme="dark"] :is(.customs-suggestion:hover,.customs-suggestion[aria-selected="true"]){background:var(--theme-hover);color:var(--theme-green)}
html[data-theme="dark"] .customs-suggestion mark{color:var(--theme-green)}
html[data-theme="dark"] .customs-suggestions-heading{border-color:var(--line);color:var(--theme-muted)}

/* Popups stay legible without recoloring their image or document content. */
html[data-theme="dark"] :is(.swal2-title,.delete-dialog .swal2-title,.movement-link-dialog .swal2-title,.contact-dialog .swal2-title,.dc-dialog .swal2-title,.qr-sync-heading h2,.quick-company-heading,.quick-company-section-title,.document-viewer-heading h2,.document-viewer-message h3,.attachment-upload-heading h2){color:var(--ink)}
html[data-theme="dark"] :is(.swal2-html-container,.delete-dialog .swal2-html-container,.logout-dialog .swal2-html-container,.movement-link-dialog .swal2-html-container,.dc-dialog .swal2-html-container,.delete-dialog-description,.document-viewer-message){color:var(--theme-text)}
html[data-theme="dark"] :is(.delete-dialog.swal2-popup,.movement-link-dialog.swal2-popup){background:var(--theme-raised);border-color:var(--theme-border-strong)}
html[data-theme="dark"] :is(.contact-dialog,.dc-dialog,.quick-company-dialog){border-color:var(--theme-border-strong)!important}
html[data-theme="dark"] :is(.swal2-footer,.swal2-actions,.modal-header,.modal-footer,.document-viewer-toolbar,.document-viewer-footer,.contact-dialog .swal2-actions,.dc-dialog .swal2-actions){border-color:var(--line)}
html[data-theme="dark"] :is(.swal2-close,.contact-dialog .swal2-close,.dc-dialog .swal2-close,.quick-company-dialog .swal2-close,.movement-link-dialog .swal2-close){background:var(--theme-soft);border-color:var(--line);color:var(--theme-muted)}
html[data-theme="dark"] :is(.swal2-close:hover,.contact-dialog .swal2-close:hover,.dc-dialog .swal2-close:hover,.delete-dialog .swal2-close:hover,.qr-confirm-dialog .swal2-close:hover){background:var(--theme-hover);color:var(--ink)}
html[data-theme="dark"] :is(.swal2-validation-message,.contact-dialog .swal2-validation-message,.movement-link-dialog .swal2-validation-message,.quick-company-dialog .swal2-validation-message,.warehouse-create #form-error){background:var(--theme-red-bg);border-color:var(--theme-red-border);color:var(--theme-red)}
html[data-theme="dark"] .dc-password-dialog .swal2-validation-message{background:var(--theme-red-bg)!important;color:var(--theme-red)!important;border-color:var(--theme-red-border)}
html[data-theme="dark"] :is(.qr-confirm-record,.delete-dialog-record,.logout-countdown,.logout-user,.contact-company-context,.movement-link-dialog .movement-link-context,.qr-sync-info,.dc-move-preview,.dc-folder-dialog-card,.dc-password-subject,.dc-password-hint){background:var(--theme-soft);border-color:var(--line);color:var(--theme-text)}
html[data-theme="dark"] :is(.delete-dialog-record strong,.movement-link-detail strong,.logout-clock strong,.qr-confirm-record>svg,.qr-sync-metrics strong){color:var(--ink)}
html[data-theme="dark"] :is(.delete-dialog-record>span,.logout-countdown small,.movement-link-detail-label,.qr-sync-heading div>span,.document-viewer-heading small,.document-viewer-footer,.attachment-upload-heading small){color:var(--theme-muted)}
html[data-theme="dark"] :is(.document-viewer-stage,.document-inspector .document-viewer-stage,.detail-photo-card>a,.photo-load-frame,.photo-grid img,.palette-thumbnail.photo-placeholder){background:var(--canvas)}
html[data-theme="dark"] .document-viewer-text{background:var(--theme-soft);color:var(--theme-text)}
html[data-theme="dark"] :is(.document-archive-toolbar label,.document-archive-toolbar [data-archive-count]){color:var(--theme-green);background:transparent;border-color:var(--line)}
html[data-theme="dark"] :is(.document-archive-toolbar small,.photo-missing){color:var(--theme-muted)}
html[data-theme="dark"] .document-archive-toolbar .document-archive-download:disabled{background:var(--theme-raised);border-color:var(--line);color:var(--theme-muted)}
html[data-theme="dark"] .photo-viewer .modal-content{background:#101d25;color:#eaf2f5}
html[data-theme="dark"] .modal-backdrop{background:#040d15}
html[data-theme="dark"] .modal-backdrop.show{opacity:.65}
html[data-theme="dark"] .btn-close{--bs-btn-close-color:#d9e7ec;--bs-btn-close-opacity:.8}
html[data-theme="dark"] #toast-container>div{border:1px solid var(--theme-border-strong);box-shadow:0 10px 30px #020a1455;color:#eef6f8;opacity:1}
html[data-theme="dark"] #toast-container>.toast-success{background-color:#245649;border-color:#3a806a}
html[data-theme="dark"] #toast-container>.toast-error{background-color:#693d49;border-color:#995463}
html[data-theme="dark"] #toast-container>.toast-warning{background-color:#5e4b2f;border-color:#8b6b3d}
html[data-theme="dark"] #toast-container>.toast-info{background-color:#2b4b62;border-color:#476f8d}
html[data-theme="dark"] .table-cell-tooltip{--bs-tooltip-bg:#dbece9;--bs-tooltip-color:#15342f}

/* Overview, details, history and analysis. */
html[data-theme="dark"] :is(.network-card,.editor-help,.profile-password-note,.user-photo-editor,.detail-qr-access,.preview-banner,.support-hours,.rates-sync,.record-detail-action,.search-focus,.monthly-day-filter){background:linear-gradient(125deg,#17332f,#182f39);border-color:var(--theme-green-border);color:var(--theme-text)}
html[data-theme="dark"] :is(.editor-help h3,.record-actions-heading h3,.detail-qr-access h2,.user-photo-controls h3,.support-welcome h1,.support-card h2,.support-email h2,.support-phone,.rates-source,.rates-latest h2,.rates-latest-date strong,.settings-page-heading h1,.settings-section-heading h2,.billing-card-heading,.permission-card-content strong){color:var(--ink)}
html[data-theme="dark"] :is(.editor-help p,.record-actions-heading p,.record-detail-action small,.detail-qr-access p,.detail-metrics span,.detail-info-section dt,.detail-note,.detail-photo-card p,.detail-photo-card footer,.detail-file-link span,.profile-session,.support-welcome p,.support-description,.support-hours span,.support-email p,.rates-currencies,.rates-note,.rates-latest-quotes span,.rates-latest-date){color:var(--theme-muted)}
html[data-theme="dark"] :is(.detail-metrics>div:last-child strong,.detail-file-link,.support-hours strong,.support-email-address,.rates-latest-quotes strong,.record-detail-action,.movement-related-link,.movement-count,.container-scan-info strong){color:var(--theme-green)}
html[data-theme="dark"] :is(.detail-tabs .nav-link,.movement-tabs .nav-link){color:var(--theme-muted)}
html[data-theme="dark"] .detail-tabs .nav-link.active{color:var(--theme-green);border-bottom-color:var(--theme-green);background:linear-gradient(0deg,#224d423f,transparent)}
html[data-theme="dark"] :is(.movement-count,.movement-link-icon,.movement-tabs .detail-tab-count,#palette-detail .detail-tab-count){background:var(--theme-soft);border-color:var(--line);color:var(--theme-muted)}
html[data-theme="dark"] :is(.movement-tabs .nav-link.active .detail-tab-count,#palette-detail .nav-link.active .detail-tab-count){background:var(--theme-green-bg);border-color:var(--theme-green-border);color:var(--theme-green)}
html[data-theme="dark"] :is(.movement-tabs .detail-tab-count.is-empty,#palette-detail .detail-tab-count.is-empty){background:var(--theme-soft);border-color:var(--line);color:var(--theme-muted)}
html[data-theme="dark"] :is(.movement-related-link:hover,.record-detail-action:hover){background:var(--theme-hover);border-color:var(--theme-green-border);color:var(--theme-green)}
html[data-theme="dark"] :is(.movement-frame,body.movement-embedded){background:var(--canvas)}
html[data-theme="dark"] .movement-embedded .page-heading .movement-back{background:var(--theme-green-bg);border-color:var(--theme-green-border);color:var(--theme-green)}
html[data-theme="dark"] :is(.profile-avatar,.user-photo-preview,.user-list-photo,.timeline-actor-photo){border-color:var(--theme-raised);background:var(--theme-soft);box-shadow:0 0 0 1px var(--line)}
html[data-theme="dark"] :is(.timeline-event-body,.vehicle-event,.dispatch .vehicle-event,.vehicle-note-card){background:var(--theme-soft);border-color:var(--line)}
html[data-theme="dark"] :is(.timeline-event p,.timeline-event time,.timeline-event footer span,.timeline-actor-copy small,.timeline-order){color:var(--theme-muted)}
html[data-theme="dark"] .timeline-actor-copy strong{color:var(--theme-text)}
html[data-theme="dark"] :is(.timeline-event:not(:last-child):before,.vehicle-day-heading::after,.vehicle-timeline-item:not(:last-child)::after,.help-divider){background:var(--line)}
html[data-theme="dark"] :is(.analysis-door-card,.analysis-door-card.normal,.analysis-door-card.busy,.analysis-door-card.critical){background:var(--theme-surface);border-color:var(--line);color:var(--ink);box-shadow:none}
html[data-theme="dark"] .analysis-door-card.busy{background:#2b2b28}
html[data-theme="dark"] .analysis-door-card.critical{background:#302832}
html[data-theme="dark"] .analysis-door-card:hover{border-color:#528f7e;box-shadow:0 5px 18px #050e1626}
html[data-theme="dark"] .analysis-door-card header>span:first-child>svg{background:var(--theme-soft);color:var(--theme-muted)}
html[data-theme="dark"] .analysis-door-card.normal header>span:first-child>svg{background:var(--theme-green-bg);color:var(--theme-green)}
html[data-theme="dark"] .analysis-door-card.busy header>span:first-child>svg{background:var(--theme-amber-bg);color:var(--theme-amber)}
html[data-theme="dark"] .analysis-door-card.critical header>span:first-child>svg{background:var(--theme-red-bg);color:var(--theme-red)}
html[data-theme="dark"] :is(.analysis-stat small,.analysis-today,.analysis-legend,.analysis-door-count span,.analysis-door-split,.analysis-door-card footer span,.analysis-charts p,.analysis-chart-empty,.analysis-definitions,.analysis-auto-copy small,.analysis-update-compact #analysis-updated){color:var(--theme-muted)}
html[data-theme="dark"] :is(.analysis-today strong,.analysis-door-split b,.analysis-door-card footer b,.analysis-auto-copy strong){color:var(--theme-text)}
html[data-theme="dark"] :is(.analysis-door-link,.analysis-door-card footer svg){color:var(--theme-green)}
html[data-theme="dark"] .analysis-update .analysis-auto-control{background:var(--theme-green-bg);border-color:var(--theme-green-border)}
html[data-theme="dark"] .analysis-update .analysis-auto-control:hover{background:#204b40;border-color:#47856f}
html[data-theme="dark"] .analysis-update .analysis-auto-control.is-paused{background:var(--theme-soft);border-color:var(--line)}
html[data-theme="dark"] .analysis-auto-control.is-paused .analysis-auto-icon{background:var(--theme-raised);color:var(--theme-muted)}
html[data-theme="dark"] .analysis-auto-control.is-paused .analysis-auto-copy strong{color:var(--theme-muted)}
html[data-theme="dark"] .analysis-auto-switch{background:#4c636c}
html[data-theme="dark"] #analysis-modal .modal-header{background:var(--theme-soft);border-color:var(--line)}
html[data-theme="dark"] :is(.detailed-filters summary,.vehicle-filter-disclosure.detailed-filters>summary){background:var(--theme-green-bg);border-color:var(--theme-green-border);color:var(--theme-green)}
html[data-theme="dark"] .detailed-filters summary:hover{background:#255043}

/* Document search and the vehicle workspace. */
html[data-theme="dark"] :is(.search-command-input,.vehicle-search-input,.index-details,.inspector-context,.inspector-tools>span,.vehicle-filter-chips button,.vehicle-quick-metric,.vehicle-event-note,.vehicle-group-empty,.rates-base,.rates-currency,.rates-latest-heading small){background:var(--theme-soft);border-color:var(--line);color:var(--theme-text)}
html[data-theme="dark"] :is(.search-scopes button,.feature-tabs button,.search-readiness,.readiness-other,.index-details p,.document-hit-meta,.document-hit-snippet,.inspector-header small,.document-context-label,.vehicle-identity-caption,.vehicle-last,.vehicle-match-note,.vehicle-timeline-time,.vehicle-event-meta dt,.vehicle-event-meta dd,.vehicle-event-footer>span,.vehicle-notes-heading,.vehicle-note-meta,.vehicle-note-card>small,.vehicle-note-card>p,.rates-base){color:var(--theme-muted)}
html[data-theme="dark"] :is(.search-scopes button:hover,.feature-tabs button:not(.active):hover,.document-search-hit:hover){background:var(--theme-hover)}
html[data-theme="dark"] :is(.search-scopes button.active,.document-search-hit.is-selected,.document-select-button,.vehicle-filter-disclosure .filter-count){background:var(--theme-green-bg);border-color:var(--theme-green-border);color:var(--theme-green);box-shadow:none}
html[data-theme="dark"] .feature-tabs button.active{background:#267f70;color:white}
html[data-theme="dark"] .feature-tabs button.active:hover{background:#339582}
html[data-theme="dark"] :is(.document-select-button:hover,.is-selected .document-select-button,.is-selected .document-select-button:hover){background:#267f70;border-color:#3a9a83;color:#fff}
html[data-theme="dark"] .document-hit-snippet mark{background:#665031;color:#ffe0a6}
html[data-theme="dark"] :is(.document-hit-icon,.skeleton-row,.vehicle-document-row){border-color:var(--line)}
html[data-theme="dark"] .document-hit-icon{background:var(--theme-raised);color:var(--theme-text)}
html[data-theme="dark"] .document-hit-icon.file-tile-sheet{background:var(--theme-green-bg);color:var(--theme-green);border-color:var(--theme-green-border)}
html[data-theme="dark"] .document-selected-check{border-color:var(--theme-green-bg);background:#26836c}
html[data-theme="dark"] .vehicle-identity-plate{background:var(--theme-raised);border-color:var(--theme-border-strong);box-shadow:inset 0 0 0 3px var(--theme-surface),0 3px 8px #07121d2b;color:var(--ink)}
html[data-theme="dark"] :is(.vehicle-plate-symbol,.vehicle-quick-metric.arrival,.vehicle-timeline-marker){background:var(--theme-green-bg);border-color:var(--theme-green-border);color:var(--theme-green)}
html[data-theme="dark"] .vehicle-quick-metric.dispatch{background:var(--theme-amber-bg)}
html[data-theme="dark"] :is(.vehicle-quick-metric.arrival svg,.vehicle-plate-link){color:var(--theme-green)}
html[data-theme="dark"] .vehicle-quick-metric.dispatch svg{color:var(--theme-amber)}
html[data-theme="dark"] :is(.vehicle-quick-metric>span,.vehicle-day-heading,.vehicle-event-name,.vehicle-note-group>h2){color:var(--theme-text)}

/* The settings preview uses the same palette as the real workspace. */
html[data-theme="dark"] :is(.settings-page-heading p,.settings-section-heading p,.settings-preview-note,.settings-feedback,.settings-demo-caption,.settings-demo-heading p,.settings-demo-form-footer>span,.settings-demo-user span){color:var(--theme-muted)}
html[data-theme="dark"] :is(.settings-size-switch,.settings-demo-user,.settings-demo-input){background:var(--theme-soft);border-color:var(--line)}
html[data-theme="dark"] .settings-size-copy{color:var(--theme-text)}
html[data-theme="dark"] .settings-size-copy small{color:var(--theme-muted)}
html[data-theme="dark"] .settings-size-option:hover input:not(:checked)+.settings-size-copy{background:var(--theme-hover)}
html[data-theme="dark"] .settings-size-option input:checked+.settings-size-copy{color:white}
html[data-theme="dark"] .settings-size-option input:checked+.settings-size-copy small{color:#d0f0e5}
html[data-theme="dark"] .settings-size-indicator{background:#267f70;box-shadow:0 4px 14px #071e1833}
html[data-theme="dark"] .settings-preview-stage{background:linear-gradient(135deg,#11282c,#162d39);border-color:var(--line)}
html[data-theme="dark"] :is(.settings-preview-heading h3,.settings-demo-brand strong,.settings-demo-heading h4,.settings-demo-user strong){color:var(--ink)}
html[data-theme="dark"] .settings-live-dot{background:#5ad0a9;box-shadow:0 0 0 4px #224d403f}
html[data-theme="dark"] .settings-preview-tabs button{color:var(--theme-muted)}
html[data-theme="dark"] .settings-preview-tabs button:hover{background:var(--theme-hover);color:var(--theme-green)}
html[data-theme="dark"] .settings-preview-tabs button[aria-selected="true"]{background:var(--theme-raised);color:var(--theme-green);box-shadow:0 1px 5px #06121c3b}
html[data-theme="dark"] :is(.settings-preview-size,.settings-demo-brand>span,.settings-demo-account-items .is-current){background:var(--theme-green-bg);color:var(--theme-green);border-color:var(--theme-green-border)}
html[data-theme="dark"] :is(.settings-demo-topbar,.settings-demo-table-scroll,.settings-demo-table td,.settings-demo-form-footer,.settings-demo-account-items){border-color:var(--line)}
html[data-theme="dark"] :is(.settings-demo-form label,.settings-demo-account-items>span){color:var(--theme-text)}
html[data-theme="dark"] .settings-feedback-icon{background:var(--theme-soft)}
html[data-theme="dark"] .settings-feedback.is-saved{color:var(--theme-green)}
html[data-theme="dark"] .settings-feedback.is-saved .settings-feedback-icon{background:var(--theme-green-bg)}
html[data-theme="dark"] .settings-feedback.is-warning{color:var(--theme-amber)}
html[data-theme="dark"] .settings-feedback.is-warning .settings-feedback-icon{background:var(--theme-amber-bg)}

/* Document-center desktop and its file-management dialogs. Folder artwork is preserved. */
html[data-theme="dark"] :is(.dc-storage,.dc-storage-stats>div,.dc-start-user){background:linear-gradient(130deg,#19362f,#1a313c);border-color:var(--line)}
html[data-theme="dark"] :is(.dc-desktop-shell,.dc-pathbar,.dc-uploads,.dc-view-toggle,.dc-detail-body dl,.dc-folder-dialog-card,.dc-folder-picker>div+div,#dc-folder-contents,.dc-child-folder,.dc-detail-panel){border-color:var(--line)}
html[data-theme="dark"] :is(.dc-desktop-toolbar,.dc-desktop-status,.dc-card-top,.dc-selection,.dc-drop,.dc-child-folder,.dc-inline-name,.dc-explorer-window,.dc-explorer-title,.dc-explorer-window>.dc-layout){background:var(--theme-soft);border-color:var(--line);color:var(--theme-text)}
html[data-theme="dark"] .dc-desktop{background:radial-gradient(ellipse at 90% 10%,#27534740,transparent 60%),radial-gradient(ellipse at 5% 95%,#274c6040,transparent 60%),#142a34}
html[data-theme="dark"] :is(.dc-shortcuts button,.dc-root,.dc-folder,.dc-manage,.dc-context>button,.dc-context>.dc-context-action,.dc-start-menu button,.dc-child-folder>button,.dc-explorer-navigation button,.dc-explorer-title button,.dc-detail-panel,.dc-taskbar button){color:var(--theme-text)}
html[data-theme="dark"] :is(.dc-shortcuts button:hover,.dc-root:hover,.dc-folder:hover,.dc-context>button:hover,.dc-context>.dc-context-action:hover,.dc-start-menu button:hover,.dc-child-folder:hover,.dc-item-menu:hover,.dc-item-menu:focus-visible,.dc-explorer-navigation button:hover,.dc-explorer-title button:hover,.dc-desktop>article:hover){background:var(--theme-hover);border-color:var(--theme-green-border);color:var(--theme-green)}
html[data-theme="dark"] :is(.dc-shortcuts button.active,.dc-root.active,.dc-folder.active,.dc-view-toggle button.active,.dc-file-card.selected,.warehouse-table tr.dc-row-selected>td,.dc-explorer-table tr.dc-folder-selected>td){background:var(--theme-green-bg);color:var(--theme-green);border-color:var(--theme-green-border);box-shadow:none}
html[data-theme="dark"] .dc-desktop-file.selected{background:var(--theme-green-bg)!important;border-color:#54927e!important}
html[data-theme="dark"] :is(.dc-drop.is-dragging,.dc-drop-target){background:#244f42!important;border-color:#69b397}
html[data-theme="dark"] :is(.dc-drop-icon,.dc-detail-symbol,.dc-detail-panel header button){background:var(--theme-green-bg);color:var(--theme-green)}
html[data-theme="dark"] :is(.dc-storage strong,.dc-drop strong,.dc-desktop>article strong,.dc-detail-panel h2,.dc-storage-columns h3,.dc-storage-row strong,.dc-folder-dialog-card strong,.dc-password-subject strong,.dc-start-menu strong,.dc-start-menu .dc-start-user strong,.dc-desktop-location nav strong,.dc-explorer-title strong){color:var(--ink)}
html[data-theme="dark"] :is(.dc-sidebar-heading,.dc-folder small,.dc-storage span,.dc-storage small,.dc-file-title small,.dc-card-body p,.dc-desktop>article small,.dc-context-title,.dc-detail-panel header small,.dc-detail-body dt,.dc-storage-stats small,.dc-storage-row small,.dc-folder-dialog-card small,.dc-dialog-help,.dc-password-rule,.dc-password-hint,.dc-start-user span,.dc-start-menu .dc-start-heading,.dc-child-folder small,.dc-explorer-help,.dc-taskbar-clock [data-clock-date]){color:var(--theme-muted)}
html[data-theme="dark"] :is(.dc-storage-stats strong,.dc-storage-row b,.dc-desktop-location nav button,.dc-pathbar nav button){color:var(--theme-green)}
html[data-theme="dark"] .dc-storage-track{background:var(--theme-soft)}
html[data-theme="dark"] :is(.dc-fullscreen .dc-taskbar,.dc-fullscreen>.dc-desktop-location){background:#16313ee8;border-color:var(--theme-border-strong)}
html[data-theme="dark"] .dc-taskbar button{background:#25424ec4;border-color:var(--theme-border-strong)}
html[data-theme="dark"] .dc-fullscreen .dc-desktop{background:none}
html[data-theme="dark"] :is(.dc-fullscreen .dc-desktop>article strong,.dc-fullscreen .dc-desktop>article small){color:white}
html[data-theme="dark"] .dc-explorer-window .dc-main{background:var(--theme-surface)}
html[data-theme="dark"] .dc-explorer-window .dc-desktop{background:var(--theme-soft)}
html[data-theme="dark"] :is(.dc-explorer-window .dc-desktop>article strong,.dc-explorer-window .dc-desktop>article small){color:var(--theme-text)}
html[data-theme="dark"] .dc-explorer-table tr[tabindex]:hover>td{background:var(--theme-hover)}
html[data-theme="dark"] .dc-explorer-title [data-explorer-close]:hover{background:#a74b5b;color:white}
html[data-theme="dark"] :is(.dc-context>.dc-context-action.danger,.dc-context>.dc-context-action.text-danger,.dc-dialog .swal2-deny){color:var(--theme-red)}
html[data-theme="dark"] .dc-dialog .swal2-deny{background:var(--theme-red-bg);border-color:var(--theme-red-border)}

/* Period warnings, reports and other operation-specific summaries. */
html[data-theme="dark"] :is(.deadline-card,.deadline-badge,.deadline-progress){--tone:var(--theme-amber);--tint:var(--theme-amber-bg)}
html[data-theme="dark"] :is(.deadline-card,.deadline-badge,.deadline-progress).is-penalty{--tone:var(--theme-red);--tint:var(--theme-red-bg)}
html[data-theme="dark"] :is(.deadline-card,.deadline-badge,.deadline-progress).is-today{--tone:#edac79;--tint:#443024}
html[data-theme="dark"] :is(.deadline-card,.deadline-badge,.deadline-progress).is-upcoming{--tone:var(--theme-green);--tint:var(--theme-green-bg)}
html[data-theme="dark"] .portal-deadlines .is-today{--tone:var(--theme-red);--tint:var(--theme-red-bg)}
html[data-theme="dark"] .portal-deadlines .is-critical{--tone:#edac79;--tint:#443024}
html[data-theme="dark"] .portal-deadlines .is-upcoming{--tone:var(--theme-amber);--tint:var(--theme-amber-bg)}
html[data-theme="dark"] .detail-waiting{--waiting-color:var(--theme-green);--waiting-tint:var(--theme-green-bg)}
html[data-theme="dark"] .detail-waiting.is-warning{--waiting-color:var(--theme-amber);--waiting-tint:var(--theme-amber-bg)}
html[data-theme="dark"] .detail-waiting.is-overdue{--waiting-color:var(--theme-red);--waiting-tint:var(--theme-red-bg)}
html[data-theme="dark"] .detail-waiting:is(.is-missing,.is-future){--waiting-color:var(--theme-muted);--waiting-tint:var(--theme-soft)}
html[data-theme="dark"] .detail-waiting.is-dual .waiting-dial-elapsed{--waiting-color:var(--theme-green)}
html[data-theme="dark"] .warehouse-table .portal-waiting{--period-color:var(--theme-green);--period-track:var(--theme-green-bg)}
html[data-theme="dark"] .warehouse-table .portal-waiting.is-upcoming{--period-color:var(--theme-amber);--period-track:var(--theme-amber-bg)}
html[data-theme="dark"] .warehouse-table .portal-waiting.is-critical{--period-color:#edac79;--period-track:#443024}
html[data-theme="dark"] .warehouse-table .portal-waiting.is-overdue{--period-color:var(--theme-red);--period-track:var(--theme-red-bg)}
html[data-theme="dark"] .warehouse-table .portal-waiting:is(.is-missing,.is-future){--period-color:var(--theme-muted);--period-track:var(--theme-soft)}
html[data-theme="dark"] :is(.deadline-note,.deadline-card-copy small,.deadline-filters label,.deadline-list-toolbar>span,.waiting-ring span,.waiting-dates>span,.waiting-summary small,.waiting-title,.exit-qr-summary span,.exit-qr-progress p,.exit-qr-filters label,.exit-qr-list-heading,.monthly-period label,.monthly-period>span,.monthly-kpi>span:not(.monthly-kpi-icon),.monthly-kpi small,.monthly-definition,.monthly-leader small,.monthly-data-table){color:var(--theme-muted)}
html[data-theme="dark"] :is(.deadline-note,.exit-qr-card-toggle,.exit-qr-chips>span,.monthly-rank,.monthly-rank-bar,.monthly-list>header>span){background:var(--theme-soft)}
html[data-theme="dark"] :is(.waiting-heading h2,.waiting-dates strong,.exit-qr-summary strong,.exit-qr-card-toggle,.exit-qr-chips b,.monthly-kpi strong,.monthly-leader strong,.monthly-rank-name){color:var(--theme-text)}
html[data-theme="dark"] :is(.deadline-list-toolbar button.selected,.monthly-day-link:hover){background:var(--theme-green-bg);border-color:var(--theme-green-border);color:var(--theme-green)}
html[data-theme="dark"] :is(.deadline-progress progress::-webkit-progress-bar,.exit-qr-progress .progress){background:var(--theme-raised)}
html[data-theme="dark"] :is(.exit-qr-row,.exit-qr-number){background:var(--theme-amber-bg);border-color:var(--theme-amber-border);color:var(--theme-amber)}
html[data-theme="dark"] :is(.exit-qr-row.is-scanned,.is-scanned .exit-qr-number){background:var(--theme-green-bg);border-color:var(--theme-green-border);color:var(--theme-green)}
html[data-theme="dark"] :is(.exit-qr-state,.exit-qr-card-title small){color:var(--theme-amber)}
html[data-theme="dark"] :is(.is-scanned .exit-qr-state,.is-complete .exit-qr-card-title small,.monthly-rank-name strong,.monthly-leader div>span,.monthly-day-link){color:var(--theme-green)}
html[data-theme="dark"] #monthly-report header h2{color:var(--ink)}
html[data-theme="dark"] #monthly-report header p{color:var(--theme-muted)}
html[data-theme="dark"] #exchange-rates-page .rates-date{color:var(--theme-muted)}
html[data-theme="dark"] #exchange-rates-page :is(.rates-number:nth-child(5),.rates-number:nth-child(6)){color:var(--theme-green)}
html[data-theme="dark"] :is(.rates-status-panel,.rates-latest-date,.monthly-leader,.monthly-day-filter,.support-contact,.exit-qr-chips>span,.billing-extras,.billing-group-title,.qr-sync-form>.d-flex){border-color:var(--line)}
html[data-theme="dark"] :is(.login-form-wrap,.ordino-pending){background:var(--canvas)}
html[data-theme="dark"] :is(.login-intro,.login-help,.login-copyright,.login-credit,.login-footer .login-copyright,.ordino-pending>p){color:var(--theme-muted)}
html[data-theme="dark"] .ordino-pending-icon{background:var(--theme-green-bg);color:var(--theme-green)}
html[data-theme="dark"] .ordino-pending-icon>span{background:var(--theme-amber-bg);border-color:var(--canvas);color:var(--theme-amber)}
html[data-theme="dark"] .ordino-pending-note{background:var(--theme-soft);border-color:var(--line);color:var(--theme-text)}
html[data-theme="dark"] .ordino-pending h1{color:var(--ink)}

/* The loading treatment remains quiet against the darker canvas. */
html[data-theme="dark"] .skeleton{background:linear-gradient(90deg,#203943 25%,#2c4d55 50%,#203943 75%);background-size:200% 100%}
html[data-theme="dark"] :is(.skeleton-block,#staff-dashboard .dash-skeleton,#staff-dashboard .chart-skeleton-ring){background:#223c45}
html[data-theme="dark"] :is(.skeleton-block::after,#staff-dashboard .dash-skeleton::after){background:linear-gradient(90deg,transparent,#71b19b1a,transparent)}
html[data-theme="dark"] #staff-dashboard .dash-skeleton-subline{background:#1d3540}
html[data-theme="dark"] #staff-dashboard .chart-skeleton-ring::before{background:var(--theme-surface)}
html[data-theme="dark"] #staff-dashboard .chart-skeleton-bars{border-color:var(--line);background:repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),#2b424e66 calc(25% - 1px),#2b424e66 25%)}
html[data-theme="dark"] #staff-dashboard .dashboard-load-status{background:var(--theme-soft);border-color:var(--line);color:var(--theme-muted)}
html[data-theme="dark"] #staff-dashboard .dashboard-load-status[data-state="ready"]{background:var(--theme-green-bg);color:var(--theme-green);border-color:transparent}
html[data-theme="dark"] #staff-dashboard .dashboard-load-status:is([data-state="stale"],[data-state="error"]){background:var(--theme-amber-bg);color:var(--theme-amber);border-color:var(--theme-amber-border)}
html[data-theme="dark"] #staff-dashboard #chart-updated.is-stale{color:var(--theme-amber)!important}
html[data-theme="dark"] .photo-load-spinner::after{border-color:#355b56;border-top-color:#69d2b8}
html[data-theme="dark"] .save-feedback{background:var(--theme-green-bg);border-color:var(--theme-green-border);color:var(--theme-green);box-shadow:none}
html[data-theme="dark"] .save-feedback>button{color:var(--theme-green)}
html[data-theme="dark"] .save-feedback>button:hover{background:#285545}
html[data-theme="dark"] .warehouse-table tr.record-saved>td{animation-name:record-saved-dark}
@keyframes record-saved-dark{0%,60%{background-color:#24503f;box-shadow:inset 0 0 0 9999px #24503f}100%{background-color:transparent;box-shadow:inset 0 0 0 9999px transparent}}

/* Small contextual details and embedded page states. */
html[data-theme="dark"] :is(.error-card,.error-symbol){background:var(--theme-surface);border-color:var(--line);box-shadow:0 12px 36px #030e1724}
html[data-theme="dark"] .error-art{background:radial-gradient(circle at 35% 30%,#20483e66,transparent 65%),var(--theme-soft)}
html[data-theme="dark"] .error-orbit{border-color:var(--theme-green-border);box-shadow:0 0 0 35px #28534330,0 0 0 70px #28534318}
html[data-theme="dark"] :is(.error-code,.error-content h1){color:var(--ink)}
html[data-theme="dark"] :is(.error-symbol,.error-eyebrow){color:var(--theme-green)}
html[data-theme="dark"] :is(.error-description,.error-reference){color:var(--theme-muted);border-color:var(--line)}
html[data-theme="dark"] .error-hint{background:var(--theme-soft);border-color:var(--line);color:var(--theme-text)}
html[data-theme="dark"] :is(.empty-icon,.company-quick-add-icon,.contact-dialog-icon,.quick-company-symbol){background:var(--theme-green-bg);border-color:var(--theme-green-border);color:var(--theme-green)}
html[data-theme="dark"] :is(.contact-dialog .swal2-title small,.quick-company-optional-badge,.password-create-tools [role="status"],.form-section-heading p,.permission-card-content p,.billing-label-icon,.warehouse-file-number .form-text,.document-archive-toolbar small,.dc-history-item p,.dc-history-item small,.dc-selection small,.dc-drop span:not(.dc-drop-icon),.exit-qr-code>span,.exit-qr-chips>span){color:var(--theme-muted)}
html[data-theme="dark"] :is(.billing-card-body>div:focus-within .billing-label-icon,.warehouse-create .warehouse-quantity-heading h4,.qr-sync-metrics>div>span:not(.qr-sync-metric-icon)){color:var(--theme-text)}
html[data-theme="dark"] :is(.qr-sync-metrics>div,.inspector-context,.dc-explorer-window iframe){background:var(--theme-surface);border-color:var(--line)}
html[data-theme="dark"] :is(.deadline-filters,.vehicle-match-note,.vehicle-document-row,.settings-demo-table-scroll,.detail-photo-card,.support-contact,.dc-context-title,.dc-history-item,.dc-dialog .dc-options,.dc-child-folder,.dc-explorer-help,.quick-company-section+.quick-company-section,.quick-company-contact-fields,.billing-extras,.permission-card){border-color:var(--line)}
html[data-theme="dark"] .permission-card.is-selected{border-color:#559e89;box-shadow:0 0 0 1px #559e8940}
html[data-theme="dark"] :is(.login-input-wrap .password-toggle[aria-pressed="true"],.login-input-wrap:focus-within .login-input-icon,.billing-extras summary,.billing-group-title,.dc-password-dialog label){color:var(--theme-green)}
html[data-theme="dark"] .login-submit.is-loading:disabled{background:#187f73;border-color:#278f81;color:white}
html[data-theme="dark"] .deadline-card:is(:hover,.selected){border-color:var(--tone)}
html[data-theme="dark"] .exit-qr-card-toggle:hover{background:var(--theme-hover)}
html[data-theme="dark"] .movement-unlink-hint{background:var(--theme-red-bg);border-color:var(--theme-red-border);color:var(--theme-red)}
}
@media screen and (prefers-reduced-motion:reduce){html[data-theme="dark"] .warehouse-table tr.record-saved>td{animation:none;background:#24503f;box-shadow:inset 0 0 0 9999px #24503f}}
@media print{.theme-toggle{display:none!important}}
