/* v1.5.4. Dark mode overrides for the legacy backoffice.
 * Kept in one final cascade layer until the screen-specific styles are
 * converted to semantic tokens. This covers every existing section. */
html[data-theme="dark"] {
  color-scheme:dark;
  --ink:#eeedf8;--accent:#b7a5ff;--line:#38415b;--card:#22283c;--muted:#aaaec5;
  --ui-control-border:#4b536d;--ui-control-text:#eef0fa;
  --ui-control-focus:#b6a2ff;--ui-control-surface:#22283c;
  background:#121623;color:#eef0fa;
}
html[data-theme="dark"] body{color:#eef0fa;background:#121623}
html[data-theme="dark"] .workspace{background:radial-gradient(ellipse at 92% 1%,#342038 0,transparent 37%),#161a29;color:#eef0fa}
html[data-theme="dark"] .sidebar{background:#101425;color:#edf0fa}
html[data-theme="dark"] .sidebar-brand{color:#fff}
html[data-theme="dark"] :is(.page-title,.section-title,.editor-heading,.variant-title,.inbox-title,.finance-metric strong,.task-card-title,.order-total,.inventory-detail strong,.user-row strong){color:#f1f2fc}
html[data-theme="dark"] :is(.page-subtitle,.muted,.editor-hint,.footnote,.eyebrow,.workspace-footer,.inbox-contact,.inbox-date,.inbox-message,.dashboard-metric-label,.task-card-description,.task-deadline,.finance-metric small,.finance-entry,.customer-order small,.customer-stat small,.matrix-change-count,.matrix-reserved,.matrix-row-title small,.kanban-rule,.kanban-date,.kanban-id,.board-hint,.dashboard-line small,.dashboard-line-static small,.order-task-meta,.stock-choice-preview,.archive-order-link,.editor-feedback){color:#afb3c9}
html[data-theme="dark"] .app-layout .editor-label{color:#dfe2f5}
html[data-theme="dark"] :is(.topline,.sidebar-bottom){border-color:#39425a}
html[data-theme="dark"] :is(.login-screen){background:#141827;color:#f4f2fa}
html[data-theme="dark"] :is(.login-panel,.dashboard-panel,.dashboard-metric,.finance-panel,.finance-metric,.inventory-list,.inventory-detail,.variant-card,.task-card,.task-editor,.customer-order,.customer-stat,.status-settings-card,.dictionary-section,.staff-notify-card,.staff-notify-panel .staff-notify-card,.order-item-row,.order-final-state,.order-task-card,.order-task-form,.order-toast,.inbox-card,.user-list,.tasks-filters,.inline-editor,.stock-adjust,.movement-list,.order-modal,.order-modal-top,.finance-table-wrap,.settlement-card,.finance-category-editor,.notice,.status-flag,.staff-recipient,.matrix-save-controls,.matrix-advanced,.feature-card,.dashboard-line,.dashboard-line-static,.stock-matrix-scroll,.chat-bubble,.order-tasks-below){background:#21273a;color:#f0f0f9;border-color:#41475f}
html[data-theme="dark"] :is(.app-layout,.login-screen) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not(.matrix-input),select,textarea){background:#1b2032;color:#f0f2fd;border-color:#4a536d}
html[data-theme="dark"] :is(.app-layout,.login-screen) :is(input,textarea)::placeholder{color:#9b9eb6}
html[data-theme="dark"] .app-layout :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea):disabled{background:#25293b;color:#9297ab}
html[data-theme="dark"] :is(.app-layout,.login-screen) :is(input:not([type="checkbox"]):not([type="radio"]), select,textarea):focus-visible{border-color:#b9a7ff;outline:2px solid #604b98}
html[data-theme="dark"] :is(.secondary-btn,.mini-btn,.theme-toggle,.danger-btn,.mode-button,.order-modal-close,.sound-toggle,.archive-order-link){background:#293147;color:#e9eaf8;border-color:#4a536d}
html[data-theme="dark"] :is(.secondary-btn,.mini-btn,.theme-toggle,.danger-btn,.mode-button,.order-modal-close,.sound-toggle):hover{background:#363d55}
html[data-theme="dark"] :is(.primary-button,.nav-item.active){background:#ff98cb;color:#21152c;border-color:#ff98cb}
html[data-theme="dark"] .primary-button:hover{background:#ffb4dc}
html[data-theme="dark"] .nav-item:not(.active){color:#d2d4e3}
html[data-theme="dark"] .nav-item:not(.active):hover{background:#293248}
html[data-theme="dark"] :is(.mode-group,.kanban-column,.order-tabs,.order-tab,.task-tag,.role-chip,.finance-state,.inbox-source,.staff-pending,.status-flags,.feature-tag,.matrix-row-title,.customer-stats){background:#2c3349;color:#d7dcf6;border-color:#464e67}
html[data-theme="dark"] :is(.mode-button.active,.order-tab.active,.kanban-count){background:#46506b;color:#f7f4ff}
html[data-theme="dark"] .kanban-heading{color:#eef0fa}
html[data-theme="dark"] .kanban-card{background:#22283c;color:#edf0fb;border-color:#434a61;box-shadow:none}
html[data-theme="dark"] .kanban-card:hover{background:#30354d}
html[data-theme="dark"] .kanban-column.drop-target .kanban-dropzone{background:#4a3c68;border-color:#9d81dd}
html[data-theme="dark"] .status-flag{color:#d8dbeb}
html[data-theme="dark"] .stock-matrix :is(th,td){border-color:#3d445b;color:#eef1f9}
html[data-theme="dark"] .stock-matrix thead th{background:#373b54}
html[data-theme="dark"] .stock-matrix :is(thead th:first-child,th:first-child){background:#30374f}
html[data-theme="dark"] .stock-matrix tbody tr:nth-child(even) td{background:#272d42}
html[data-theme="dark"] .stock-matrix tbody tr:nth-child(odd) td{background:#21273a}
html[data-theme="dark"] .stock-matrix .matrix-input{background:#1a2030;color:#eef1ff;border-color:#515974}
html[data-theme="dark"] .stock-matrix .matrix-input.matrix-dirty{background:#4d4228;color:#fff1b1;border-color:#9d823b}
html[data-theme="dark"] .finance-table th{background:#333a53;color:#d4d8ed;border-color:#424b64}
html[data-theme="dark"] .finance-table td{background:#22283c;color:#eceefa;border-color:#3f475e}
html[data-theme="dark"] .finance-table tbody tr:hover td{background:#30384d}
html[data-theme="dark"] :is(.finance-order-check,.dictionary-entry,.task-category-entry,.order-task-card,.staff-recipient,.staff-pending,.finance-entry,.user-row,.stock-row,.movement-list p,.staff-notify-card,.order-modal-top,.order-status-panel,.order-history){border-color:#414961}
html[data-theme="dark"] :is(.order-final-state strong,.dashboard-metric-value,.dashboard-line,.dashboard-line-static,.kanban-client,.kanban-total,.customer-order strong,.customer-stat strong,.task-tag,.inbox-message){color:#e9edfa}
html[data-theme="dark"] .telegram-chat-messages{background:#171c2b;border-color:#434b63}
html[data-theme="dark"] .chat-bubble{background:#293148;color:#f0f0f9;border-color:#46516a}
html[data-theme="dark"] .chat-out{background:#1e463f}
html[data-theme="dark"] :is(.login-panel,.login-screen label,.order-modal-top){color:#f1f0fd}
html[data-theme="dark"] .order-modal-backdrop{background:rgba(2,4,11,.78)}
html[data-theme="dark"] .inbox-card{box-shadow:0 4px 25px #0004}
html[data-theme="dark"] .inbox-card .inbox-message{color:#e8e9f3}
html[data-theme="dark"] .dictionary-entry small{color:#a9acc3}
html[data-theme="dark"] .dashboard-line:hover,html[data-theme="dark"] .dashboard-metric:hover{background:#343c55}
html[data-theme="dark"] .finance-category-editor summary{color:#c5b4ff}
html[data-theme="dark"] :is(.danger-btn,.danger-text,.editor-feedback.error){color:#ff8ea8}
html[data-theme="dark"] .settlement-summary{background:#254338;color:#b2e9c4}
html[data-theme="dark"] :is(.order-tab:hover,.matrix-remove-color){background:#37304d}
html[data-theme="dark"] :is(.editor-feedback,.task-deadline.overdue){color:#ffbaaf}
