/**
 * WMS tema — bygger på Bootstrap 5.3 data-bs-theme.
 * Ljust är standard; mörkt tvingar app-ytor som hårdkodats till ljusa bakgrunder
 * (modul-CSS / inline styles laddas ofta efter denna fil → !important krävs).
 */

:root,
[data-bs-theme="light"] {
  color-scheme: light;
  --wms-page-bg: #f4f7f6;
  --wms-surface: #ffffff;
  --wms-surface-2: #f8fafc;
  --wms-border: rgba(10, 47, 75, 0.12);
  --wms-text: #212529;
  --wms-muted: #6c757d;
  --wms-brand: #0a2f4b;
  --wms-teal: #18a0a8;
}

[data-bs-theme="dark"] {
  color-scheme: dark;
  --wms-page-bg: #0f1720;
  --wms-surface: #1a2332;
  --wms-surface-2: #141c28;
  --wms-border: rgba(255, 255, 255, 0.12);
  --wms-text: #e8eef5;
  --wms-muted: #9aabbc;
  --wms-brand: #7eb6d8;
  --wms-teal: #3ec4cc;

  /* Inventering — sheet tabs + Kassaredovisning weekend/holiday rows */
  --inv-tabs-bg: var(--wms-surface-2);
  --inv-tabs-link: var(--wms-muted);
  --inv-tabs-link-hover: var(--wms-text);
  --inv-tabs-active-bg: var(--wms-brand);
  --inv-tabs-active-color: #0f1720;
  --inv-tabs-active-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  --inv-cash-weekend-bg: rgba(255, 255, 255, 0.04);
  --inv-cash-weekend-input-bg: var(--wms-surface-2);
  --inv-cash-weekend-input-border: var(--wms-border);
  --inv-cash-weekend-label: var(--wms-muted);
  --inv-cash-holiday-bg: rgba(220, 53, 69, 0.16);
  --inv-cash-holiday-input-bg: rgba(220, 53, 69, 0.12);
  --inv-cash-holiday-input-border: rgba(255, 138, 149, 0.4);
  --inv-cash-holiday-label: #ffb3bc;
  --inv-cash-weekend-holiday-bg: rgba(220, 53, 69, 0.22);
  --inv-cash-today-label: var(--wms-brand);
  --inv-cash-today-weekend-bg: rgba(62, 196, 204, 0.12);
  --inv-cash-today-holiday-bg: rgba(220, 53, 69, 0.18);

  --bs-body-bg: var(--wms-page-bg);
  --bs-body-color: var(--wms-text);
  --bs-secondary-bg: var(--wms-surface-2);
  --bs-tertiary-bg: var(--wms-surface);
  --bs-emphasis-color: #f8fafc;
  --bs-secondary-color: var(--wms-muted);
  --bs-border-color: var(--wms-border);
  --bs-heading-color: var(--wms-text);
  --bs-link-color: var(--wms-teal);
  --bs-link-hover-color: #6ad4da;
  --bs-card-bg: var(--wms-surface);
  --bs-card-color: var(--wms-text);
  --bs-card-border-color: var(--wms-border);
  --bs-card-cap-bg: var(--wms-surface-2);
  --bs-modal-bg: var(--wms-surface);
  --bs-modal-color: var(--wms-text);
  --bs-modal-border-color: var(--wms-border);
  --bs-modal-header-border-color: var(--wms-border);
  --bs-modal-footer-border-color: var(--wms-border);
  --bs-dropdown-bg: var(--wms-surface);
  --bs-dropdown-color: var(--wms-text);
  --bs-dropdown-link-color: var(--wms-text);
  --bs-dropdown-link-hover-color: var(--wms-text);
  --bs-dropdown-link-hover-bg: rgba(255, 255, 255, 0.06);
  --bs-dropdown-border-color: var(--wms-border);
  --bs-list-group-bg: var(--wms-surface);
  --bs-list-group-color: var(--wms-text);
  --bs-list-group-border-color: var(--wms-border);
  --bs-offcanvas-bg: var(--wms-surface);
  --bs-offcanvas-color: var(--wms-text);
  --bs-accordion-bg: var(--wms-surface);
  --bs-accordion-color: var(--wms-text);
  --bs-accordion-border-color: var(--wms-border);
  --bs-accordion-btn-bg: var(--wms-surface);
  --bs-accordion-btn-color: var(--wms-text);
  --bs-accordion-active-bg: var(--wms-surface-2);
  --bs-accordion-active-color: var(--wms-text);
  --bs-table-bg: transparent;
  --bs-table-color: var(--wms-text);
  --bs-table-border-color: var(--wms-border);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-striped-color: var(--wms-text);
  /* Shared teal row hover (Ärenden / Delar / inventering / Bootstrap .table-hover) */
  --wms-table-row-hover-bg: rgba(62, 196, 204, 0.12);
  --bs-table-hover-bg: var(--wms-table-row-hover-bg);
  --bs-table-hover-color: var(--wms-text);
  --bs-table-active-bg: rgba(255, 255, 255, 0.07);
  --bs-table-active-color: var(--wms-text);
  --bs-form-control-bg: var(--wms-surface-2);
  --bs-form-control-disabled-bg: #0c121a;
}

/* —— Sidytor —— */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] body.bg-light,
[data-bs-theme="dark"] .main-content,
[data-bs-theme="dark"] main,
[data-bs-theme="dark"] .wo-module-page,
[data-bs-theme="dark"] .container--work-order,
[data-bs-theme="dark"] .ts-module-wrap,
[data-bs-theme="dark"] .vs-hub-page {
  background-color: var(--wms-page-bg) !important;
  color: var(--wms-text);
}

/* —— Generella ytor / Bootstrap —— */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card-body,
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer,
[data-bs-theme="dark"] .settings-card,
[data-bs-theme="dark"] .settings-card-header,
[data-bs-theme="dark"] .settings-card-body,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-body,
[data-bs-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .app-modal,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .list-group-item,
[data-bs-theme="dark"] .offcanvas,
[data-bs-theme="dark"] .offcanvas-header,
[data-bs-theme="dark"] .offcanvas-body,
[data-bs-theme="dark"] .accordion-item,
[data-bs-theme="dark"] .accordion-button,
[data-bs-theme="dark"] .accordion-body,
[data-bs-theme="dark"] .popover,
[data-bs-theme="dark"] .toast,
[data-bs-theme="dark"] .toast-header,
[data-bs-theme="dark"] .toast-body {
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .settings-card-header,
[data-bs-theme="dark"] .toast-header {
  background-color: var(--wms-surface-2) !important;
}

[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-body,
[data-bs-theme="dark"] .bg-body-tertiary,
[data-bs-theme="dark"] .bg-body-secondary,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light > th,
[data-bs-theme="dark"] .table-light > td,
[data-bs-theme="dark"] tr.table-light > th,
[data-bs-theme="dark"] tr.table-light > td,
[data-bs-theme="dark"] thead.table-light > tr > th,
[data-bs-theme="dark"] thead.table-light > tr > td {
  --bs-table-bg: var(--wms-surface-2);
  --bs-table-color: var(--wms-text);
  --bs-table-striped-bg: var(--wms-surface-2);
  --bs-table-striped-color: var(--wms-text);
  --bs-table-hover-bg: var(--wms-table-row-hover-bg, rgba(62, 196, 204, 0.12));
  --bs-table-hover-color: var(--wms-text);
  --bs-table-border-color: var(--wms-border);
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .table > :not(caption) > * > * {
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
  background-color: transparent;
}

[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table thead td {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] textarea.form-control,
[data-bs-theme="dark"] .input-group-text {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: var(--wms-muted);
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .form-text,
[data-bs-theme="dark"] .text-secondary {
  color: var(--wms-muted) !important;
}

[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .modal-title {
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .alert-light,
[data-bs-theme="dark"] .alert-secondary {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-dark,
[data-bs-theme="dark"] .btn-light {
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
  background-color: transparent !important;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-dark:hover,
[data-bs-theme="dark"] .btn-light:hover {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: var(--wms-muted);
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .shadow,
[data-bs-theme="dark"] .shadow-sm,
[data-bs-theme="dark"] .shadow-lg {
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.45) !important;
}

[data-bs-theme="dark"] .wms-reg-plate-mini {
  color: #1a1a1a;
  background: #fff;
}

[data-bs-theme="dark"] .pagination .page-link {
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .pagination .page-item.active .page-link {
  background-color: var(--wms-teal) !important;
  border-color: var(--wms-teal) !important;
  color: #fff !important;
}

[data-bs-theme="dark"] .progress {
  background-color: var(--wms-surface-2) !important;
}

/* —— Systemadministration —— */
[data-bs-theme="dark"] .admin-page-header {
  border-bottom-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .admin-tab-bar {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .admin-tab {
  color: var(--wms-muted) !important;
}

[data-bs-theme="dark"] .admin-tab:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .admin-tab--active {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
  box-shadow: 0 -1px 0 var(--wms-surface) !important;
}

[data-bs-theme="dark"] .admin-tab-panels,
[data-bs-theme="dark"] .admin-tab-panels--single {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

[data-bs-theme="dark"] .admin-section-card {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .admin-section-card__title {
  color: var(--wms-text) !important;
  border-bottom-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .admin-inactive-user-card,
[data-bs-theme="dark"] .stats-card {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .stats-card .k {
  color: var(--wms-muted) !important;
}

[data-bs-theme="dark"] .admin-tab-users .admin-section-card--matrix {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
  box-shadow: none !important;
}

[data-bs-theme="dark"] .admin-tab-users .admin-matrix-wrap,
[data-bs-theme="dark"] .admin-presentation-wrap .wo-image-item {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .admin-matrix-table thead th,
[data-bs-theme="dark"] .admin-matrix-table thead .admin-matrix-sticky-col {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .admin-matrix-table .admin-matrix-sticky-col,
[data-bs-theme="dark"] .admin-matrix-table .admin-user-row-head td,
[data-bs-theme="dark"] .admin-matrix-table .admin-user-row-head .admin-matrix-sticky-col {
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .admin-matrix-table .admin-user-row-perms td,
[data-bs-theme="dark"] .admin-matrix-table .admin-user-row-perms .admin-matrix-sticky-col {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-bottom-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .admin-matrix-table tbody tr.table-secondary .admin-matrix-sticky-col {
  background-color: #2a3444 !important;
}

[data-bs-theme="dark"] .admin-users-unit-table .admin-users-row-clickable:hover > *,
[data-bs-theme="dark"] #koncernerTable .admin-users-row-clickable:hover > *,
[data-bs-theme="dark"] #bolagTable .admin-users-row-clickable:hover > * {
  background-color: rgba(62, 196, 204, 0.12) !important;
}

/* —— Verksamhetsstöd hub —— */
[data-bs-theme="dark"] .vs-hub-card,
[data-bs-theme="dark"] .vs-hub-card:hover {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35) !important;
}

[data-bs-theme="dark"] .vs-hub-card h2 {
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .vs-hub-card-icon {
  background: rgba(62, 196, 204, 0.15) !important;
  color: var(--wms-teal) !important;
}

[data-bs-theme="dark"] .vs-hub-card-link {
  color: var(--wms-teal) !important;
}

[data-bs-theme="dark"] .vs-chef-filter-menu,
[data-bs-theme="dark"] .vs-chef-filter-sort-btn {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .vs-chef-filter-item {
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .vs-chef-filter-item:hover,
[data-bs-theme="dark"] .vs-chef-filter-item.active,
[data-bs-theme="dark"] .vs-chef-filter-sort-btn:hover {
  background: rgba(62, 196, 204, 0.12) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .vs-chef-th:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .vs-chef-th--active {
  background-color: rgba(62, 196, 204, 0.15) !important;
  color: var(--wms-text) !important;
}

/* —— Däckhotell —— */
[data-bs-theme="dark"] .tire-card,
[data-bs-theme="dark"] .ts-status-item,
[data-bs-theme="dark"] .ts-modal-section,
[data-bs-theme="dark"] .ts-cust-ac,
[data-bs-theme="dark"] .ts-cust-ac-item {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .ts-status-item {
  background: var(--wms-surface-2) !important;
}

[data-bs-theme="dark"] .ts-status-label,
[data-bs-theme="dark"] .ts-cust-ac-meta,
[data-bs-theme="dark"] .ts-cust-ac-empty {
  color: var(--wms-muted) !important;
}

[data-bs-theme="dark"] .ts-status-value {
  color: var(--wms-text) !important;
}

/* Senaste händelser — module CSS hardcodes light cards; align with theme tokens */
[data-bs-theme="dark"] .ts-event-item {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .ts-event-item.ts-event-item--clickable:hover {
  background: var(--wms-surface-2) !important;
  border-color: rgba(62, 196, 204, 0.35) !important;
}

[data-bs-theme="dark"] .ts-event-item .text-muted {
  color: var(--wms-muted) !important;
}

[data-bs-theme="dark"] .ts-event-item .text-dark,
[data-bs-theme="dark"] .ts-event-text {
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .ts-event-item .badge.text-bg-light,
[data-bs-theme="dark"] .ts-event-item .badge.text-dark {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .ts-event-change-wrap {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .ts-event-change-title {
  color: var(--wms-text) !important;
  border-bottom-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .ts-event-change-table th {
  background: var(--wms-surface) !important;
  color: var(--wms-muted) !important;
}

[data-bs-theme="dark"] .ts-event-change-table td {
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .ts-event-change-table .ts-event-col-old {
  background: rgba(220, 53, 69, 0.18) !important;
  color: #f1aeb5 !important;
}

[data-bs-theme="dark"] .ts-event-change-table .ts-event-col-new {
  background: rgba(25, 135, 84, 0.2) !important;
  color: #a3cfbb !important;
}

[data-bs-theme="dark"] .ts-modal-section .ts-modal-section-h {
  background: var(--wms-surface-2) !important;
  border-bottom-color: var(--wms-border) !important;
  color: var(--wms-muted) !important;
}

[data-bs-theme="dark"] .ts-cust-ac-item:hover,
[data-bs-theme="dark"] .ts-cust-ac-item.is-active {
  background: rgba(62, 196, 204, 0.12) !important;
}

[data-bs-theme="dark"] .ts-filter-toggle,
[data-bs-theme="dark"] .ts-filter-toggle:hover,
[data-bs-theme="dark"] .ts-filter-toggle:focus,
[data-bs-theme="dark"] .ts-filter-toggle:active,
[data-bs-theme="dark"] .ts-filter-toggle.show {
  color: var(--wms-text) !important;
  background-color: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .ts-depth-mini-table td.ts-depth-mini-td {
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .ts-search-filter-sticky .input-group,
[data-bs-theme="dark"] .ts-search-filter-sticky .form-control,
[data-bs-theme="dark"] .ts-search-filter-sticky .input-group-text {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple,
[data-bs-theme="dark"] .select2-dropdown,
[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option--disabled {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-muted) !important;
}

/* —— Mina inställningar: notisområden (details.notification-group) —— */
[data-bs-theme="dark"] .notification-group {
  background: var(--wms-surface) !important;
  background-color: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .notification-group-summary {
  background: var(--wms-surface-2) !important;
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .notification-group[open] > .notification-group-summary {
  border-bottom-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .notification-group-text .fw-bold,
[data-bs-theme="dark"] .notification-group-text > .fw-bold {
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .notification-group-chevron {
  color: var(--wms-muted) !important;
}

[data-bs-theme="dark"] .notification-group-icon {
  background: rgba(24, 160, 168, 0.22) !important;
  color: #7dd3d8 !important;
}

[data-bs-theme="dark"] .notification-settings-table th {
  color: var(--wms-muted) !important;
}

/* —— Navbar notisdropdown (“Dina notiser”) —— */
[data-bs-theme="dark"] .wms-notif-dropdown-menu,
[data-bs-theme="dark"] .wms-notif-dropdown-menu #notif-content {
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .wms-notif-header {
  background-color: var(--wms-surface-2) !important;
  border-bottom-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .wms-notif-header-title {
  color: var(--wms-muted) !important;
}

[data-bs-theme="dark"] .wms-notif-mark-all {
  color: var(--wms-teal) !important;
}

[data-bs-theme="dark"] .wms-notif-mark-all:hover,
[data-bs-theme="dark"] .wms-notif-mark-all:focus {
  color: #6ad4da !important;
  filter: none;
}

[data-bs-theme="dark"] .wms-notif-item--read {
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .wms-notif-item--unread {
  /* Slightly elevated vs surface so unread rows remain distinct */
  background-color: rgba(62, 196, 204, 0.14) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .notification-item {
  border-bottom-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .wms-notif-user,
[data-bs-theme="dark"] .wms-notif-news-title,
[data-bs-theme="dark"] .wms-notif-tag {
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .notif-text-container {
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .wms-notif-time,
[data-bs-theme="dark"] .wms-notif-header-sep {
  color: var(--wms-muted) !important;
}

[data-bs-theme="dark"] .wms-notif-unread-dot {
  color: var(--wms-teal) !important;
}

[data-bs-theme="dark"] .wms-notif-inline-link {
  color: var(--wms-teal) !important;
}

[data-bs-theme="dark"] .wms-notif-inline-link:hover,
[data-bs-theme="dark"] .wms-notif-inline-link:focus {
  color: #6ad4da !important;
  filter: none;
}

[data-bs-theme="dark"] .settings-card .form-switch .form-check-label,
[data-bs-theme="dark"] .settings-card .form-check-label {
  color: var(--wms-text) !important;
}

/* —— Mina inställningar (modules/user/index.php — page <style> loads after this file) —— */
[data-bs-theme="dark"] .settings-card h2,
[data-bs-theme="dark"] .settings-card h4,
[data-bs-theme="dark"] .settings-card h5 {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .settings-card .form-control,
[data-bs-theme="dark"] .settings-card .form-select {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .settings-card .form-control:disabled,
[data-bs-theme="dark"] .settings-card .form-control.bg-light,
[data-bs-theme="dark"] .settings-card .bg-light {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .notification-group-title {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .notification-group-icon {
  background: rgba(62, 196, 204, 0.18) !important;
  color: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .wms-nav-menu-pin.badge.text-bg-light {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}

/* —— Övriga vanliga modulytor —— */
[data-bs-theme="dark"] .stats-card,
[data-bs-theme="dark"] .unit-info-card,
[data-bs-theme="dark"] .settings-section,
[data-bs-theme="dark"] .wo-card,
[data-bs-theme="dark"] .wo-panel,
[data-bs-theme="dark"] .panel,
[data-bs-theme="dark"] .content-panel,
[data-bs-theme="dark"] .module-panel {
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}

/* —— Enhetlig sidhuvud (Ärenden m.fl.) —— */
.wms-page-hero {
  background: var(--wms-surface, #fff);
  border: 1px solid var(--wms-border, #e9ecef);
  border-radius: 0.5rem;
  padding: 0.75rem 0.9rem;
  color: var(--wms-text, inherit);
}
.wms-page-hero__heading {
  font-family: 'Patua One', cursive;
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--wms-brand, #0a2f4b);
  margin: 0;
}
.wms-page-hero__heading > i {
  color: var(--wms-muted, #6c757d);
}
.wms-page-hero__unit {
  font-weight: 300;
  font-size: 0.8em;
  color: var(--wms-muted, #667);
}
[data-bs-theme="dark"] .wms-page-hero {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wms-page-hero__heading {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wms-page-hero__heading > i,
[data-bs-theme="dark"] .wms-page-hero__unit {
  color: var(--wms-muted) !important;
}

/* —— Månadsslut (modul-CSS laddas efter → !important) —— */
[data-bs-theme="dark"] .vs-cl-toolbar,
[data-bs-theme="dark"] .vs-cl-table-wrap,
[data-bs-theme="dark"] .vs-cl-summary-card,
[data-bs-theme="dark"] .vs-cl-card,
[data-bs-theme="dark"] .vs-cl-empty,
[data-bs-theme="dark"] .vs-cl-chip {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-cl-filters,
[data-bs-theme="dark"] .vs-cl-progress-bar,
[data-bs-theme="dark"] .vs-cl-card-moment {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-cl-table thead th {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .vs-cl-table tbody td,
[data-bs-theme="dark"] .vs-cl-summary-card--open .vs-cl-summary-card__value {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-cl-unit-name,
[data-bs-theme="dark"] .vs-cl-moment-meta strong,
[data-bs-theme="dark"] .vs-cl-card-moment-title,
[data-bs-theme="dark"] .vs-cl-toggle,
[data-bs-theme="dark"] .vs-cl-advanced-toggle,
[data-bs-theme="dark"] .vs-cl-empty h2 {
  color: var(--wms-brand) !important;
}
[data-bs-theme="dark"] .vs-cl-summary-card__label,
[data-bs-theme="dark"] .vs-cl-progress-label,
[data-bs-theme="dark"] .vs-cl-unit-meta,
[data-bs-theme="dark"] .vs-cl-moment-meta,
[data-bs-theme="dark"] .vs-cl-moment--na {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .vs-cl-chip.is-active {
  background: var(--wms-brand) !important;
  border-color: var(--wms-brand) !important;
  color: #fff !important;
}
[data-bs-theme="dark"] .vs-cl-chip--overdue.is-active {
  background: #b02a37 !important;
  border-color: #b02a37 !important;
}
[data-bs-theme="dark"] .vs-cl-chip .vs-cl-chip-count {
  background: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .vs-cl-table tbody tr.vs-cl-row--overdue {
  background: rgba(220, 53, 69, 0.12) !important;
}
[data-bs-theme="dark"] .vs-cl-table tbody tr.vs-cl-row--complete {
  background: rgba(25, 135, 84, 0.12) !important;
}
[data-bs-theme="dark"] .vs-cl-unit-link:hover,
[data-bs-theme="dark"] .vs-cl-unit-link:focus-visible {
  color: var(--wms-brand) !important;
  background: rgba(62, 196, 204, 0.12) !important;
}

/* —— Däckhotell sticky sök —— */
[data-bs-theme="dark"] .ts-search-filter-sticky {
  background-color: var(--wms-page-bg) !important;
  border-bottom-color: var(--wms-border) !important;
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.45);
}

/* —— Ärenden sök —— */
[data-bs-theme="dark"] .search-container {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
}

/* Tema-väljare */
.wms-theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
}
.wms-theme-choice {
  position: relative;
  margin: 0;
}
.wms-theme-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.wms-theme-choice-card {
  display: block;
  border: 1px solid var(--wms-border, #dee2e6);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--wms-surface, #fff);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wms-theme-choice input:checked + .wms-theme-choice-card {
  border-color: var(--wms-teal, #18a0a8);
  box-shadow: 0 0 0 0.2rem rgba(24, 160, 168, 0.2);
}
.wms-theme-choice-card .wms-theme-choice-title {
  display: block;
  font-weight: 700;
  color: var(--wms-brand, #0a2f4b);
}
.wms-theme-choice-card .wms-theme-choice-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--wms-muted, #6c757d);
  margin-top: 0.2rem;
}
[data-bs-theme="dark"] .wms-theme-choice-card {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wms-theme-choice-card .wms-theme-choice-title {
  color: var(--wms-text);
}
[data-bs-theme="dark"] .wms-theme-choice-card .wms-theme-choice-hint {
  color: var(--wms-muted);
}

/* —— Min enhet (modules/user/unit.php — inline styles; !important beats page <style>) —— */
[data-bs-theme="dark"] .unit-card {
  background: var(--wms-surface) !important;
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
  box-shadow: none;
}
[data-bs-theme="dark"] .unit-card h2,
[data-bs-theme="dark"] .unit-card h3,
[data-bs-theme="dark"] .unit-card .fw-semibold {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .unit-info-label {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .unit-feature-item {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .unit-feature-icon {
  background: rgba(62, 196, 204, 0.18) !important;
  color: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .unit-feature-name {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .unit-feature-key {
  color: var(--wms-muted) !important;
}

/* —— Global sök (“Sök i WMS”) — inline #fff/#0A2F4B i global_search_modal.php —— */
[data-bs-theme="dark"] .wms-gs-panel {
  background: var(--wms-surface) !important;
  color: var(--wms-text) !important;
  border: 1px solid var(--wms-border) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55) !important;
}
[data-bs-theme="dark"] .wms-gs-panel-title {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wms-gs-input-icon {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .wms-gs-input,
[data-bs-theme="dark"] .wms-gs-input.form-control {
  background: var(--wms-surface-2) !important;
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .wms-gs-input::placeholder {
  color: var(--wms-muted) !important;
  opacity: 1;
}
[data-bs-theme="dark"] .wms-gs-input:focus {
  border-color: var(--wms-teal) !important;
  box-shadow: 0 0 0 0.2rem rgba(62, 196, 204, 0.25) !important;
}
[data-bs-theme="dark"] .wms-gs-group-label,
[data-bs-theme="dark"] #wmsGlobalSearchHint,
[data-bs-theme="dark"] #wmsGlobalSearchEmpty,
[data-bs-theme="dark"] .wms-gs-loading,
[data-bs-theme="dark"] .wms-gs-item-sub {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .wms-gs-item {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wms-gs-item:hover,
[data-bs-theme="dark"] .wms-gs-item:focus,
[data-bs-theme="dark"] .wms-gs-item.is-active {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wms-gs-panel .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.75;
}
[data-bs-theme="dark"] .wms-gs-panel .btn-close:hover {
  opacity: 1;
}

/* —— Dagens läge (modul-CSS kan laddas efter → !important) —— */
[data-bs-theme="dark"] .vs-dl-card,
[data-bs-theme="dark"] .vs-dl-compliance,
[data-bs-theme="dark"] .vs-dl-attention {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}
[data-bs-theme="dark"] .vs-dl-chip {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-dl-card-head,
[data-bs-theme="dark"] .vs-dl-card-head h2,
[data-bs-theme="dark"] .vs-dl-compliance-head,
[data-bs-theme="dark"] .vs-dl-attention-main,
[data-bs-theme="dark"] .vs-dl-link,
[data-bs-theme="dark"] .vs-dl-trend-pct,
[data-bs-theme="dark"] .vs-dl-week-chip {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-dl-link:hover,
[data-bs-theme="dark"] .vs-dl-link:focus,
[data-bs-theme="dark"] .vs-dl-more,
[data-bs-theme="dark"] .vs-dl-attention-cta {
  color: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .vs-dl-more:hover,
[data-bs-theme="dark"] .vs-dl-more:focus {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-dl-list li,
[data-bs-theme="dark"] .vs-dl-compliance-item {
  border-top-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .vs-dl-trend,
[data-bs-theme="dark"] .vs-dl-week-chip {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .vs-dl-week-label {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .vs-dl-trend-bar {
  background: rgba(255, 255, 255, 0.08) !important;
}
[data-bs-theme="dark"] .vs-dl-attention-ok,
[data-bs-theme="dark"] .vs-dl-trend-ok,
[data-bs-theme="dark"] .vs-dl-week-ok {
  background: rgba(25, 135, 84, 0.18) !important;
  border-color: rgba(62, 196, 204, 0.45) !important;
}
[data-bs-theme="dark"] .vs-dl-attention-warning,
[data-bs-theme="dark"] .vs-dl-trend-warning,
[data-bs-theme="dark"] .vs-dl-week-warning {
  background: rgba(240, 173, 78, 0.18) !important;
  border-color: rgba(240, 173, 78, 0.45) !important;
}
[data-bs-theme="dark"] .vs-dl-attention-danger,
[data-bs-theme="dark"] .vs-dl-trend-danger,
[data-bs-theme="dark"] .vs-dl-week-danger {
  background: rgba(220, 53, 69, 0.18) !important;
  border-color: rgba(220, 53, 69, 0.4) !important;
}
[data-bs-theme="dark"] .vs-dl-chip.is-active {
  background: var(--wms-brand) !important;
  border-color: var(--wms-brand) !important;
  color: #fff !important;
}
[data-bs-theme="dark"] .vs-dl-row:hover,
[data-bs-theme="dark"] .vs-dl-row:focus {
  background-color: rgba(62, 196, 204, 0.12) !important;
}
[data-bs-theme="dark"] .vs-dl-compliance-item.is-overdue .vs-dl-link {
  color: #f1aeb5 !important;
}

/* —— Navbar dash alerts / floating clock panel —— */
[data-bs-theme="dark"] .wms-global-clock-bar {
  background: rgba(26, 35, 50, 0.97) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45) !important;
}
[data-bs-theme="dark"] .wms-global-clock-alerts {
  border-top-color: var(--wms-border) !important;
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .wms-dash-alert-group > summary,
[data-bs-theme="dark"] .wms-dash-alert-chevron,
[data-bs-theme="dark"] .wms-dash-alert-modal-section-title,
[data-bs-theme="dark"] .wms-dash-alert-modal .modal-title,
[data-bs-theme="dark"] .wms-dash-alert-modal .table a,
[data-bs-theme="dark"] .wms-global-clock-value,
[data-bs-theme="dark"] .wms-global-clock-minimize-btn {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wms-dash-alert-table > :not(caption) > * > *,
[data-bs-theme="dark"] .wms-dash-alert-modal-section + .wms-dash-alert-modal-section {
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .wms-dash-alert-table thead th {
  color: var(--wms-muted) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}
[data-bs-theme="dark"] .wms-dash-alert-table tbody tr.wms-dash-alert-row:hover > *,
[data-bs-theme="dark"] .wms-global-clock-minimize-btn:hover,
[data-bs-theme="dark"] .wms-global-clock-minimize-btn:focus-visible {
  background-color: rgba(62, 196, 204, 0.12) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wms-dash-alert-table a:hover,
[data-bs-theme="dark"] .wms-dash-alert-table a:focus-visible {
  color: var(--wms-teal) !important;
}

/* —— Region compliance / KPI —— */
[data-bs-theme="dark"] .vs-rc-summary,
[data-bs-theme="dark"] .vs-rk-summary,
[data-bs-theme="dark"] .vs-rc-chip,
[data-bs-theme="dark"] .vs-rk-chip {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-rc-summary--ok,
[data-bs-theme="dark"] .vs-rk-summary--ok {
  background: rgba(25, 135, 84, 0.18) !important;
  border-color: rgba(62, 196, 204, 0.45) !important;
}
[data-bs-theme="dark"] .vs-rc-summary--warning,
[data-bs-theme="dark"] .vs-rk-summary--warning {
  background: rgba(240, 173, 78, 0.18) !important;
  border-color: rgba(240, 173, 78, 0.45) !important;
}
[data-bs-theme="dark"] .vs-rc-summary--danger,
[data-bs-theme="dark"] .vs-rk-summary--danger {
  background: rgba(220, 53, 69, 0.18) !important;
  border-color: rgba(220, 53, 69, 0.4) !important;
}
[data-bs-theme="dark"] .vs-rc-chip.is-active,
[data-bs-theme="dark"] .vs-rk-chip.is-active {
  background: rgba(62, 196, 204, 0.15) !important;
  border-color: rgba(62, 196, 204, 0.45) !important;
  color: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .vs-rc-chip-count,
[data-bs-theme="dark"] .vs-rk-chip-count {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .vs-rc-table thead th,
[data-bs-theme="dark"] .vs-rk-table thead th {
  background: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-rc-link,
[data-bs-theme="dark"] .vs-rk-link {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-rc-link:hover,
[data-bs-theme="dark"] .vs-rc-link:focus,
[data-bs-theme="dark"] .vs-rk-link:hover,
[data-bs-theme="dark"] .vs-rk-link:focus {
  color: var(--wms-teal) !important;
}

/* —— VS deadlines / CRM / nycklar / lånebilar / utbetalning —— */
[data-bs-theme="dark"] .vs-deadline-shell,
[data-bs-theme="dark"] .vs-deadline-item,
[data-bs-theme="dark"] .vs-scope-box,
[data-bs-theme="dark"] .vs-crm-panel,
[data-bs-theme="dark"] .vs-lnb-view .vs-lnb-actionbar,
[data-bs-theme="dark"] .vs-lnb-sign-card,
[data-bs-theme="dark"] .vs-lnb-damage-pad {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-deadline-editor {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-uo-table thead th,
[data-bs-theme="dark"] .vs-utb-table thead th,
[data-bs-theme="dark"] .vs-nyk-table thead th,
[data-bs-theme="dark"] .vs-lnb-table thead th,
[data-bs-theme="dark"] .vs-statistik-page .table thead th,
[data-bs-theme="dark"] .vs-statistik-page .vs-stat-th-sort {
  background: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
}
/* Statistik KPI amounts: avoid navy-on-navy in dark theme */
[data-bs-theme="dark"] .vs-stat-kpi {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-stat-kpi-value,
[data-bs-theme="dark"] .vs-stat-kpi-val,
[data-bs-theme="dark"] .vr-stat-page .vs-stat-kpi-value {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-uo-th-sort:hover,
[data-bs-theme="dark"] .vs-uo-th-sort:focus-visible,
[data-bs-theme="dark"] .vs-utb-th-sort:hover,
[data-bs-theme="dark"] .vs-utb-th-sort:focus-visible,
[data-bs-theme="dark"] .vs-nyk-th-sort:hover,
[data-bs-theme="dark"] .vs-nyk-th-sort:focus-visible,
[data-bs-theme="dark"] .vs-lnb-th-sort:hover,
[data-bs-theme="dark"] .vs-lnb-th-sort:focus-visible,
[data-bs-theme="dark"] .vs-utb-table tbody tr:hover {
  background: rgba(62, 196, 204, 0.1) !important;
}
[data-bs-theme="dark"] .vs-deadline-tabs .nav-link,
[data-bs-theme="dark"] .vs-scope-summary,
[data-bs-theme="dark"] .vs-lnb-th-sort,
[data-bs-theme="dark"] .vs-nyk-th-sort,
[data-bs-theme="dark"] .vs-uo-th-sort,
[data-bs-theme="dark"] .vs-utb-th-sort,
[data-bs-theme="dark"] .vs-utb-page .nav-tabs .nav-link,
[data-bs-theme="dark"] .vs-utb-page .nav-tabs .nav-link.active {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-utb-page .nav-tabs .nav-link.active {
  border-bottom-color: var(--wms-surface) !important;
}
[data-bs-theme="dark"] .vs-deadline-tabs .nav-link:hover,
[data-bs-theme="dark"] .vs-deadline-item:hover,
[data-bs-theme="dark"] .vs-deadline-item:focus-visible {
  background: rgba(62, 196, 204, 0.12) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-teal) !important;
}

/* —— Lön / inventering / verksamhetsrapport / semester —— */
[data-bs-theme="dark"] .lon-page-header,
[data-bs-theme="dark"] .lon-panel,
[data-bs-theme="dark"] .lon-scope-box,
[data-bs-theme="dark"] .inv-page-header,
[data-bs-theme="dark"] .inv-panel,
[data-bs-theme="dark"] .inv-auto-drum-card,
[data-bs-theme="dark"] .inv-planogram-shelf,
[data-bs-theme="dark"] .vr-page-header,
[data-bs-theme="dark"] .vr-panel,
[data-bs-theme="dark"] .sp-panel,
[data-bs-theme="dark"] .sp-cell-tip {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .lon-page-header h1,
[data-bs-theme="dark"] .inv-page-header h1,
[data-bs-theme="dark"] .vr-page-header h1,
[data-bs-theme="dark"] .sp-page-header h1,
[data-bs-theme="dark"] .lon-sheet-tabs .nav-link,
[data-bs-theme="dark"] .vr-sheet-tabs .nav-link,
[data-bs-theme="dark"] .lon-meta-grid label,
[data-bs-theme="dark"] .lon-comments-list .lon-comment-name,
[data-bs-theme="dark"] .sp-cell-tip,
[data-bs-theme="dark"] .sp-cell-tip-title {
  color: var(--wms-text) !important;
}
/* Inventering sheet tabs — readable active/inactive on dark surfaces */
[data-bs-theme="dark"] .inv-sheet-tabs {
  background: var(--inv-tabs-bg) !important;
}
[data-bs-theme="dark"] .inv-sheet-tabs .nav-link {
  color: var(--inv-tabs-link) !important;
  background: transparent !important;
}
[data-bs-theme="dark"] .inv-sheet-tabs .nav-link:hover,
[data-bs-theme="dark"] .inv-sheet-tabs .nav-link:focus {
  color: var(--inv-tabs-link-hover) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}
[data-bs-theme="dark"] .inv-sheet-tabs .nav-link.active {
  background: var(--inv-tabs-active-bg) !important;
  color: var(--inv-tabs-active-color) !important;
  box-shadow: var(--inv-tabs-active-shadow) !important;
}
/* Kassaredovisning — weekend / red-day rows (no bright white cells/inputs) */
[data-bs-theme="dark"] .inv-table tr.inv-cash-weekend td {
  background-color: var(--inv-cash-weekend-bg) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .inv-table tr.inv-cash-weekend .form-control {
  background-color: var(--inv-cash-weekend-input-bg) !important;
  color: var(--wms-text) !important;
  border-color: var(--inv-cash-weekend-input-border) !important;
}
[data-bs-theme="dark"] .inv-table tr.inv-cash-weekend td.fw-bold,
[data-bs-theme="dark"] .inv-table tr.inv-cash-weekend td.inv-cash-weekday-col {
  color: var(--inv-cash-weekend-label) !important;
}
[data-bs-theme="dark"] .inv-table tr.inv-cash-holiday td {
  background-color: var(--inv-cash-holiday-bg) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .inv-table tr.inv-cash-holiday .form-control {
  background-color: var(--inv-cash-holiday-input-bg) !important;
  color: var(--wms-text) !important;
  border-color: var(--inv-cash-holiday-input-border) !important;
}
[data-bs-theme="dark"] .inv-table tr.inv-cash-holiday td.fw-bold,
[data-bs-theme="dark"] .inv-table tr.inv-cash-holiday td.inv-cash-weekday-col {
  color: var(--inv-cash-holiday-label) !important;
}
[data-bs-theme="dark"] .inv-table tr.inv-cash-weekend.inv-cash-holiday td {
  background-color: var(--inv-cash-weekend-holiday-bg) !important;
}
[data-bs-theme="dark"] .inv-table tr.inv-cash-today td.fw-bold,
[data-bs-theme="dark"] .inv-table tr.inv-cash-today td.inv-cash-weekday-col {
  color: var(--inv-cash-today-label) !important;
}
[data-bs-theme="dark"] .inv-table tr.inv-cash-today .form-control {
  border-color: rgba(62, 196, 204, 0.55) !important;
}
[data-bs-theme="dark"] .inv-table tr.inv-cash-today.inv-cash-weekend td {
  background-color: var(--inv-cash-today-weekend-bg) !important;
}
[data-bs-theme="dark"] .inv-table tr.inv-cash-today.inv-cash-holiday td {
  background-color: var(--inv-cash-today-holiday-bg) !important;
}
/* Semesterplanering timeline toolbar — year switcher / scroll+zoom hints */
[data-bs-theme="dark"] .sp-grid-toolbar {
  background: color-mix(in srgb, var(--wms-surface-2) 94%, transparent) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .sp-year-select {
  color: var(--wms-text) !important;
  background-color: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .sp-year-nav-hint,
[data-bs-theme="dark"] .sp-zoom-hint-desktop,
[data-bs-theme="dark"] .sp-zoom-hint-mobile {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .sp-zoom-level.badge,
[data-bs-theme="dark"] .sp-zoom-level {
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}
/* Semesterplanering resource sidebar — override hardcoded light list backgrounds */
[data-bs-theme="dark"] .sp-grid-side,
[data-bs-theme="dark"] .sp-grid-table-side,
[data-bs-theme="dark"] .sp-col-resource,
[data-bs-theme="dark"] .sp-grid-table thead .sp-col-resource,
[data-bs-theme="dark"] .sp-grid-table tbody tr .sp-col-resource {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .sp-resource-full-name,
[data-bs-theme="dark"] .sp-resource-signature,
[data-bs-theme="dark"] .sp-resource-label,
[data-bs-theme="dark"] .sp-resource-name {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .sp-grid-table tbody tr.sp-resource-row.sp-row-sync-hover > td.sp-col-resource,
[data-bs-theme="dark"] .sp-grid-side tbody tr.sp-resource-row:active > td.sp-col-resource {
  background-color: rgba(62, 196, 204, 0.16) !important;
}
[data-bs-theme="dark"] .sp-grid-table tbody tr.sp-resource-row.sp-row-sync-selected > td.sp-col-resource {
  background-color: rgba(62, 196, 204, 0.22) !important;
}
[data-bs-theme="dark"] .lon-hint,
[data-bs-theme="dark"] .vr-hint,
[data-bs-theme="dark"] .lon-instructions,
[data-bs-theme="dark"] .lon-comments-list .lon-comments-empty {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .lon-table tfoot td,
[data-bs-theme="dark"] .lon-table tbody td.lon-calc,
[data-bs-theme="dark"] .lon-table tfoot td.lon-calc,
[data-bs-theme="dark"] .lon-day-grid td:first-child,
[data-bs-theme="dark"] .lon-comments-list .lon-comment-item,
[data-bs-theme="dark"] .lon-year-header td,
[data-bs-theme="dark"] #vrSessionsTable tr.vr-year-header td,
[data-bs-theme="dark"] .inv-sessions-table tr.inv-year-header td,
[data-bs-theme="dark"] .inv-sessions-table tr.inv-year-header:hover td,
[data-bs-theme="dark"] .inv-table tfoot td,
[data-bs-theme="dark"] .inv-table .inv-calc,
[data-bs-theme="dark"] .vs-stat-year-group-row > td,
[data-bs-theme="dark"] .vs-stat-th-sort:hover,
[data-bs-theme="dark"] .vs-stat-th-sort:focus-visible {
  background: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-top-color: var(--wms-border);
}
[data-bs-theme="dark"] .lon-comments-list .lon-comment-text {
  color: var(--wms-text) !important;
}

/* —— Utrustning / arbetsorder / kontoplan / bolagskarta —— */
[data-bs-theme="dark"] .equipment-card,
[data-bs-theme="dark"] body.equipment-floorplan-fullscreen #equipmentFloorplanStage,
[data-bs-theme="dark"] .equipment-floorplan-sidebar,
[data-bs-theme="dark"] .equipment-floorplan-main,
[data-bs-theme="dark"] .equipment-floorplan-inspector,
[data-bs-theme="dark"] .wo-plan-order-card,
[data-bs-theme="dark"] .wo-plan-month-cell,
[data-bs-theme="dark"] .wo-plan-week-slot,
[data-bs-theme="dark"] .wo-plan-day-h-head,
[data-bs-theme="dark"] .wo-resource-card,
[data-bs-theme="dark"] .wo-plan-mobile-sheet__panel,
[data-bs-theme="dark"] .wo-plan-mobile-day-card,
[data-bs-theme="dark"] .wo-plan-mobile-res-tabs__btn,
[data-bs-theme="dark"] .wo-plan-mobile-tabs,
[data-bs-theme="dark"] .wo-plan-alloc-hover-tooltip,
[data-bs-theme="dark"] .wo-plan-context-menu,
[data-bs-theme="dark"] .kp-page .kp-toolbar,
[data-bs-theme="dark"] .kp-page .kp-toolbar .card-body,
[data-bs-theme="dark"] .kp-actions-cell,
[data-bs-theme="dark"] .org-map-node-card {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wo-plan-day-name-spacer,
[data-bs-theme="dark"] .wo-plan-week-table th {
  background: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] body.wo-edit-embed {
  background: var(--wms-surface) !important;
  color: var(--wms-text) !important;
}

/* —— Chat / hover / pickers (style.css hardcodes) —— */
[data-bs-theme="dark"] .wms-profile-hover-card,
[data-bs-theme="dark"] .wms-chat-widget-panel,
[data-bs-theme="dark"] .wms-chat-group-members-popover,
[data-bs-theme="dark"] .wms-chat-hide-confirm,
[data-bs-theme="dark"] .wms-chat-pending-file,
[data-bs-theme="dark"] .chat-read-receipts-popover,
[data-bs-theme="dark"] .wms-chat-recipient-box,
[data-bs-theme="dark"] .wms-user-picker-box,
[data-bs-theme="dark"] .wms-user-picker-list,
[data-bs-theme="dark"] .wms-info-help-modal {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wms-info-help-modal-title {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wms-info-help-modal-header,
[data-bs-theme="dark"] .wms-info-help-modal-footer {
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .wms-info-help-popover .popover-header {
  background: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wms-chat-max-frame {
  background: var(--wms-page-bg) !important;
}
[data-bs-theme="dark"] .wms-chat-group-member-row,
[data-bs-theme="dark"] .wms-chat-recipient-chip {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .wms-chat-group-members-inline,
[data-bs-theme="dark"] .wms-chat-thread-action-btn {
  color: var(--wms-muted) !important;
}

/* —— Shared dark table-row hover (Ärenden / Delar teal tint) ——
   Paint tr and td/th (Bootstrap 5 colors cells). Reusable for .table-hover
   and module tables that hard-code light hover backgrounds. */
[data-bs-theme="dark"] .table.table-hover > tbody > tr:hover > *,
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > *,
[data-bs-theme="dark"] .glas-table tbody tr.glas_table_row:hover,
[data-bs-theme="dark"] .glas-table tbody tr.glas_table_row:hover > td,
[data-bs-theme="dark"] .cases-table tbody tr.table_row:hover,
[data-bs-theme="dark"] .cases-table tbody tr.table_row:hover > td,
[data-bs-theme="dark"] .inventory-table tbody tr:hover,
[data-bs-theme="dark"] .inventory-table tbody tr.inventory-row:hover > td,
[data-bs-theme="dark"] .inv-stock-table tbody tr.inv-stock-row:hover,
[data-bs-theme="dark"] .inv-stock-table tbody tr.inv-stock-row:hover > td,
[data-bs-theme="dark"] .inv-stock-table tbody tr.inv-stock-row.inv-stock-row-active:hover > td,
[data-bs-theme="dark"] .inv-sessions-table tbody tr.inv-session-row:hover,
[data-bs-theme="dark"] .inv-sessions-table tbody tr.inv-session-row:hover > td,
[data-bs-theme="dark"] .inv-table.table-hover > tbody > tr:hover > td {
  background-color: var(--wms-table-row-hover-bg, rgba(62, 196, 204, 0.12)) !important;
  color: var(--wms-text) !important;
}

/* Locked inventering session rows: keep a soft danger tint on hover */
[data-bs-theme="dark"] .inv-sessions-table tbody tr.inv-session-row--locked:hover,
[data-bs-theme="dark"] .inv-sessions-table tbody tr.inv-session-row--locked:hover > td {
  background-color: rgba(220, 53, 69, 0.14) !important;
  color: var(--wms-text) !important;
}

/* —— Glas reply / misc module shells —— */
[data-bs-theme="dark"] .glas-rr-card,
[data-bs-theme="dark"] .glas-rr-input,
[data-bs-theme="dark"] .glas-rr-note,
[data-bs-theme="dark"] .settings-section,
[data-bs-theme="dark"] .unit-info-card,
[data-bs-theme="dark"] .content-card,
[data-bs-theme="dark"] .module-card,
[data-bs-theme="dark"] .filter-bar,
[data-bs-theme="dark"] .toolbar-card,
[data-bs-theme="dark"] .sticky-toolbar,
[data-bs-theme="dark"] .table-wrap,
[data-bs-theme="dark"] .table-responsive.border.rounded.bg-white,
[data-bs-theme="dark"] .border.rounded.bg-white {
  background: var(--wms-surface) !important;
  background-color: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .glas-rr-meta,
[data-bs-theme="dark"] .glas-rr-notes {
  background: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .glas-rr-title,
[data-bs-theme="dark"] .glas-rr-meta-value,
[data-bs-theme="dark"] .glas-rr-note-author {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .glas-rr-lead,
[data-bs-theme="dark"] .glas-rr-meta-label,
[data-bs-theme="dark"] .glas-rr-note-time,
[data-bs-theme="dark"] .glas-rr-optional {
  color: var(--wms-muted) !important;
}

/* —— Dashboard (Nav / Lista / Favoriter) ——
   Inline styles in modules/dashboard/index.php hardcode #fff tiles and a
   light segment pill; override with tokens so dark theme has readable contrast. */
[data-bs-theme="dark"] body.wms-page-dashboard {
  background-color: var(--wms-page-bg) !important;
  color: var(--wms-text);
}

[data-bs-theme="dark"] .spoke-node,
[data-bs-theme="dark"] .dashboard-module-btn,
[data-bs-theme="dark"] .dashboard-favorite-btn,
[data-bs-theme="dark"] .wms-favorite-link {
  background: var(--wms-surface) !important;
  color: var(--wms-text) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .dashboard-module-btn:hover {
  color: var(--wms-teal) !important;
  border-color: #3ad8e0 !important;
  box-shadow: 0 6px 20px rgba(62, 196, 204, 0.28) !important;
}

[data-bs-theme="dark"] .spoke-node-wrap:hover .spoke-node,
[data-bs-theme="dark"] .spoke-node-wrap:focus-within .spoke-node {
  color: var(--wms-teal) !important;
  border-color: #3ad8e0 !important;
  box-shadow: 0 0 25px rgba(62, 196, 204, 0.45) !important;
}

[data-bs-theme="dark"] .spoke-node-wrap:hover .spoke-node i,
[data-bs-theme="dark"] .spoke-node-wrap:focus-within .spoke-node i {
  color: var(--wms-teal) !important;
}

/* Slightly stronger accent borders/icons on dark surfaces */
[data-bs-theme="dark"] .dashboard-favorite-btn,
[data-bs-theme="dark"] .wms-favorite-link {
  border-color: #e8b84a !important;
}

[data-bs-theme="dark"] .dashboard-favorite-btn:hover,
[data-bs-theme="dark"] .wms-favorite-link:hover {
  border-color: #f5c84a !important;
  color: var(--wms-text) !important;
  box-shadow: 0 6px 16px rgba(245, 179, 1, 0.28) !important;
}

[data-bs-theme="dark"] .dashboard-favorite-btn i,
[data-bs-theme="dark"] .wms-favorite-link i {
  color: #f5c84a !important;
}

[data-bs-theme="dark"] .spoke-line {
  background-color: rgba(255, 255, 255, 0.18) !important;
}

[data-bs-theme="dark"] .spoke-node-star,
[data-bs-theme="dark"] .wms-hub-edit-toggle,
[data-bs-theme="dark"] .wms-dash-remove {
  background: var(--wms-surface) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45) !important;
}

[data-bs-theme="dark"] .spoke-node-star {
  color: rgba(255, 255, 255, 0.35) !important;
}

[data-bs-theme="dark"] .spoke-node-star.is-favorited,
[data-bs-theme="dark"] .spoke-node-star:hover,
[data-bs-theme="dark"] .spoke-node-star:focus-visible,
[data-bs-theme="dark"] .dashboard-module-star.is-favorited,
[data-bs-theme="dark"] .dashboard-module-star:hover,
[data-bs-theme="dark"] .dashboard-module-star:focus-visible {
  color: #f5c84a !important;
}

[data-bs-theme="dark"] .dashboard-module-star {
  color: rgba(255, 255, 255, 0.35) !important;
}

[data-bs-theme="dark"] .dashboard-module-star:hover,
[data-bs-theme="dark"] .dashboard-module-star:focus-visible {
  background: rgba(245, 179, 1, 0.16) !important;
}

[data-bs-theme="dark"] .wms-hub-edit-toggle {
  color: var(--wms-brand) !important;
}

[data-bs-theme="dark"] .wms-hub-edit-toggle:hover,
[data-bs-theme="dark"] .wms-hub-edit-toggle:focus-visible {
  color: var(--wms-teal) !important;
}

[data-bs-theme="dark"] .wms-hub-edit-toggle.is-saving,
[data-bs-theme="dark"] body.wms-dashboard-editing .wms-hub-edit-toggle {
  color: #75b798 !important;
  background: rgba(25, 135, 84, 0.22) !important;
}

[data-bs-theme="dark"] .wms-dash-remove {
  color: #f1aeb5 !important;
}

[data-bs-theme="dark"] .dashboard-view-segment {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .dashboard-view-seg-btn {
  color: var(--wms-muted) !important;
}

[data-bs-theme="dark"] .dashboard-view-segment:has(.dashboard-view-seg-hub input:checked)::after {
  background-color: rgba(62, 196, 204, 0.28) !important;
}

[data-bs-theme="dark"] .dashboard-view-segment:has(.dashboard-view-seg-list input:checked)::after {
  background-color: rgba(126, 182, 216, 0.28) !important;
}

[data-bs-theme="dark"] .dashboard-view-segment:has(.dashboard-view-seg-favorites input:checked)::after {
  background-color: rgba(245, 179, 1, 0.28) !important;
}

[data-bs-theme="dark"] .dashboard-view-seg-hub:has(input:checked) {
  color: #6ad4da !important;
}

[data-bs-theme="dark"] .dashboard-view-seg-list:has(input:checked) {
  color: #9ec5e0 !important;
}

[data-bs-theme="dark"] .dashboard-view-seg-favorites:has(input:checked) {
  color: #f5c84a !important;
}

[data-bs-theme="dark"] .dashboard-view-seg-btn:has(input:focus-visible) {
  box-shadow: 0 0 0 2px rgba(62, 196, 204, 0.45) !important;
}

[data-bs-theme="dark"] .dashboard-favorites-list-header {
  border-top-color: var(--wms-border) !important;
}

[data-bs-theme="dark"] .spoke-node-wrap.wms-drag-slot .spoke-node {
  box-shadow: 0 0 0 3px rgba(62, 196, 204, 0.45), 0 4px 15px rgba(0, 0, 0, 0.35) !important;
  border-color: var(--wms-teal) !important;
}

/* Keep QR / plate / print surfaces readable (do not invert) */
[data-bs-theme="dark"] .vs-lnb-sign-qr__img-wrap,
[data-bs-theme="dark"] .vs-nfc-qr img,
[data-bs-theme="dark"] .wms-reg-plate-mini {
  background: #fff !important;
  color: #1a1a1a;
}

/* —— Zeekr leveransverktyg (kanban) —— */
[data-bs-theme="dark"] .zeekr-page-main,
[data-bs-theme="dark"] .car-card {
  --zeekr-col-bg: var(--wms-surface);
  --zeekr-col-lane: var(--wms-surface-2);
  --zeekr-col-border: var(--wms-teal);
  --zeekr-col-title: var(--wms-text);
  --zeekr-card-bg: #132a3f;
  --zeekr-card-bg-unknown: #1a3348;
  --zeekr-card-text: var(--wms-text);
  /* Lighter than global --wms-muted so icons/labels read on navy cards */
  --zeekr-card-muted: #c5d4e3;
  --zeekr-icon-active: #5dde7a;
  --zeekr-countdown-ok: #5dde7a;
  --zeekr-countdown-soon: #ffb020;
  --zeekr-countdown-due: #ff6b7a;
  --zeekr-countdown-unknown: #ffc107;
}
[data-bs-theme="dark"] .zeekr-page-main {
  background-color: var(--wms-page-bg) !important;
  color: var(--wms-text);
}
[data-bs-theme="dark"] .zeekr-page-main .top-btn-container {
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .kanban-titles,
[data-bs-theme="dark"] .kanban-titles h4,
[data-bs-theme="dark"] .kanban-titles__heading {
  background-color: var(--zeekr-col-bg) !important;
  background: var(--zeekr-col-bg) !important;
  color: var(--wms-text) !important;
}
/* Animated status GIFs have opaque white frames — use static Flaticon icons in dark theme */
[data-bs-theme="dark"] .kanban-titles__gif {
  display: none !important;
}
[data-bs-theme="dark"] .kanban-titles__icon {
  display: inline-block !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .kanban-column {
  background-color: var(--zeekr-col-lane) !important;
  border-color: var(--zeekr-col-border) !important;
}
[data-bs-theme="dark"] .car-card {
  background-color: var(--zeekr-card-bg) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .car-card-unknown-delivery {
  background-color: var(--zeekr-card-bg-unknown) !important;
}
[data-bs-theme="dark"] .car-card .car-info-text:not(.car-countdown) {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .car-card .car-info-label {
  color: var(--zeekr-card-muted) !important;
}
[data-bs-theme="dark"] .car-card .car-countdown--ok { color: var(--zeekr-countdown-ok) !important; }
[data-bs-theme="dark"] .car-card .car-countdown--soon { color: var(--zeekr-countdown-soon) !important; }
[data-bs-theme="dark"] .car-card .car-countdown--due { color: var(--zeekr-countdown-due) !important; }
[data-bs-theme="dark"] .car-card .car-countdown--unknown,
[data-bs-theme="dark"] .unknown-delivery-chip {
  color: var(--zeekr-countdown-unknown) !important;
}
[data-bs-theme="dark"] .unknown-delivery-chip {
  border-color: rgba(255, 193, 7, 0.55);
}
[data-bs-theme="dark"] .car-card-icon {
  color: var(--zeekr-card-text);
}
[data-bs-theme="dark"] .car-card .copy-vin-btn,
[data-bs-theme="dark"] .car-card .vin-copy-button {
  color: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .wms-zeekr-log-action {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .reg-plate,
[data-bs-theme="dark"] .wms-zeekr-log-reg {
  background: #fff !important;
  background-color: #fff !important;
  color: #1a1a1a !important;
  border-color: #0A2F4B !important;
}

/* —— Zeekr calendar (raise contrast on dark navy cells) —— */
[data-bs-theme="dark"] .zeekr-cal-wrap .unified-sticky-header,
[data-bs-theme="dark"] .zeekr-page-main .unified-sticky-header {
  background: var(--wms-surface) !important;
  border-bottom-color: var(--wms-border) !important;
  color: var(--wms-text);
}
[data-bs-theme="dark"] .zeekr-cal-hint {
  color: #c5d4e3 !important;
}
[data-bs-theme="dark"] .zeekr-cal-grid {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}
[data-bs-theme="dark"] .zeekr-cal-dow-sun {
  color: #ff8a95 !important;
}
[data-bs-theme="dark"] .zeekr-cal-week-num {
  background-color: var(--wms-surface) !important;
  color: #e8eef5 !important;
}
[data-bs-theme="dark"] .zeekr-cal-day {
  color: var(--wms-text);
}
[data-bs-theme="dark"] .zeekr-cal-day.bg-white {
  background-color: #152233 !important;
}
[data-bs-theme="dark"] .zeekr-cal-day.bg-light,
[data-bs-theme="dark"] .zeekr-cal-day--weekend {
  background-color: #121c2a !important;
}
[data-bs-theme="dark"] .zeekr-cal-day--other {
  background-color: #0c121a !important;
  opacity: 1 !important;
}
[data-bs-theme="dark"] .zeekr-cal-day-num {
  color: #e8eef5 !important;
  font-weight: 700;
}
[data-bs-theme="dark"] .zeekr-cal-day-num--today {
  color: #3ec4cc !important;
}
[data-bs-theme="dark"] .zeekr-cal-day-num--red {
  color: #ffd0d4 !important;
  background-color: rgba(220, 53, 69, 0.42) !important;
  border-color: rgba(255, 138, 149, 0.65) !important;
  box-shadow: none !important;
}
[data-bs-theme="dark"] .zeekr-cal-day--other .zeekr-cal-day-num {
  color: #a8b8c8 !important;
  font-weight: 600;
}
[data-bs-theme="dark"] .zeekr-cal-day--other .zeekr-cal-day-num--red {
  color: #ffd0d4 !important;
  background-color: rgba(220, 53, 69, 0.32) !important;
}
[data-bs-theme="dark"] .zeekr-cal-block-btn {
  color: #c5d4e3 !important;
  opacity: 0.9;
}
[data-bs-theme="dark"] .zeekr-cal-block-btn:hover,
[data-bs-theme="dark"] .zeekr-cal-block-btn:focus {
  color: #ff8a95 !important;
  opacity: 1;
}
[data-bs-theme="dark"] .zeekr-cal-day-blocked .zeekr-cal-block-btn {
  color: #ff8a95 !important;
  opacity: 1;
}
[data-bs-theme="dark"] .zeekr-cal-day-blocked {
  background-color: #1a2030 !important;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 107, 122, 0.16),
    rgba(255, 107, 122, 0.16) 8px,
    rgba(255, 107, 122, 0.28) 8px,
    rgba(255, 107, 122, 0.28) 16px
  ) !important;
}
[data-bs-theme="dark"] .zeekr-cal-day-blocked .zeekr-cal-blocked-badge {
  color: #ffe3e6 !important;
  background: rgba(110, 28, 36, 0.92) !important;
  border-color: rgba(255, 138, 149, 0.5) !important;
}
/* Keep Swedish plate chrome readable.
   Must beat [data-bs-theme="dark"] .border.rounded.bg-white (surface remap),
   which matches calendar plates (zeekr-cal-reg + border + rounded + bg-white). */
[data-bs-theme="dark"] .zeekr-cal-reg,
[data-bs-theme="dark"] .zeekr-cal-reg.bg-white,
[data-bs-theme="dark"] .zeekr-cal-reg.border.rounded.bg-white {
  background: #fff !important;
  background-color: #fff !important;
  color: #1a1a1a !important;
  border-color: #adb5bd !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45) !important;
}
[data-bs-theme="dark"] .zeekr-cal-reg-text,
[data-bs-theme="dark"] .zeekr-cal-reg .zeekr-cal-reg-text {
  color: #1a1a1a !important;
}
[data-bs-theme="dark"] .zeekr-cal-reg-text.is-saknas,
[data-bs-theme="dark"] .zeekr-cal-reg .zeekr-cal-reg-text.is-saknas {
  color: #4a5560 !important;
}
[data-bs-theme="dark"] .zeekr-cal-event-time {
  color: #c5d4e3 !important;
}
[data-bs-theme="dark"] .zeekr-cal-day-blocked .zeekr-cal-reg {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.55) !important;
}

/* —— Zeekr leveransöversikt (delivery_overview.php) —— */
[data-bs-theme="dark"] .zeekr-overview-card,
[data-bs-theme="dark"] .zeekr-overview-table-outer {
  background: var(--wms-surface) !important;
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
  box-shadow: none;
}
[data-bs-theme="dark"] .zeekr-overview-card .form-check-label,
[data-bs-theme="dark"] .zeekr-overview-card .form-label,
[data-bs-theme="dark"] .table-zeekr-overview,
[data-bs-theme="dark"] .table-zeekr-overview tbody td {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .table-zeekr-overview thead th {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
[data-bs-theme="dark"] .table-zeekr-overview thead th .th-icon {
  color: var(--wms-brand) !important;
}
[data-bs-theme="dark"] .table-zeekr-overview thead th small {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .table-zeekr-overview.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: rgba(255, 255, 255, 0.03);
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .table-zeekr-overview.table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: rgba(62, 196, 204, 0.12);
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .zeekr-overview-row--alert td {
  background-color: rgba(220, 53, 69, 0.22) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .zeekr-overview-row--past td {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .zeekr-overview-days-past {
  color: #ff8a95 !important;
}
[data-bs-theme="dark"] .zeekr-ov-icon-ok { color: #5dde7a !important; }
[data-bs-theme="dark"] .zeekr-ov-icon-warn { color: #ffb020 !important; }
[data-bs-theme="dark"] .zeekr-ov-icon-bad { color: #ff6b7a !important; }
[data-bs-theme="dark"] .zeekr-ov-icon-muted { color: #9aabbc !important; }
[data-bs-theme="dark"] .zeekr-ov-icon-teal { color: #3ec4cc !important; }
[data-bs-theme="dark"] .th-sortable--active .th-sortable-link,
[data-bs-theme="dark"] .zeekr-ov-copy-vin:hover,
[data-bs-theme="dark"] .zeekr-ov-copy-vin:focus,
[data-bs-theme="dark"] .zeekr-ov-copy-vin:active {
  color: var(--wms-brand) !important;
}
[data-bs-theme="dark"] .zeekr-ov-copy-vin {
  color: var(--wms-teal) !important;
}

/* —— Zeekr arkiv (archive.php) —— */
[data-bs-theme="dark"] .zeekr-archive-panel {
  background: var(--wms-surface) !important;
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
  box-shadow: none;
}
[data-bs-theme="dark"] .table-zeekr-archive,
[data-bs-theme="dark"] .table-zeekr-archive tbody td {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .table-zeekr-archive.table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: rgba(62, 196, 204, 0.12);
  background-color: rgba(62, 196, 204, 0.12) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .zeekr-archive-panel .btn-restore {
  color: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .zeekr-archive-panel .btn-restore:hover {
  color: var(--wms-brand) !important;
}
[data-bs-theme="dark"] .unit-badge {
  background-color: rgba(62, 196, 204, 0.18) !important;
  color: var(--wms-teal) !important;
}

/* —— Rutiner (modul inline-CSS hårdkodar ljusa paneler/kort) —— */
[data-bs-theme="dark"] .vs-rutiner-panel {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-rutiner-point-row,
[data-bs-theme="dark"] .vs-rutiner-card,
[data-bs-theme="dark"] .vs-rutiner-user-checklist,
[data-bs-theme="dark"] .vs-rutiner-progress-wrap {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .vs-rutiner-point-row.is-child {
  border-left-color: rgba(62, 196, 204, 0.45) !important;
}
[data-bs-theme="dark"] .vs-rutiner-point-row.is-heading {
  background: transparent !important;
  border-bottom-color: var(--wms-brand) !important;
}
[data-bs-theme="dark"] .vs-rutiner-point-row.is-heading-editor {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .vs-rutiner-point-row.sortable-ghost {
  background: rgba(62, 196, 204, 0.12) !important;
}
[data-bs-theme="dark"] .vs-rutiner-heading-title,
[data-bs-theme="dark"] .vs-rutiner-empty h2,
[data-bs-theme="dark"] .vs-rutiner-summary strong,
[data-bs-theme="dark"] #vsRutinerEditModal .nav-tabs .nav-link.active {
  color: var(--wms-brand) !important;
}
[data-bs-theme="dark"] .vs-rutiner-summary,
[data-bs-theme="dark"] .vs-rutiner-empty,
[data-bs-theme="dark"] .vs-rutiner-list-meta,
[data-bs-theme="dark"] .vs-rutiner-check-legend,
[data-bs-theme="dark"] .vs-rutiner-point-drag-handle,
[data-bs-theme="dark"] #vsRutinerEditModal .nav-tabs .nav-link {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .vs-rutiner-empty-icon {
  background: var(--wms-surface) !important;
  color: var(--wms-brand) !important;
}
[data-bs-theme="dark"] .vs-rutiner-list-reason {
  color: #ffb020 !important;
}
[data-bs-theme="dark"] .vs-rutiner-list-reason.is-overdue {
  color: #ff6b7a !important;
}
[data-bs-theme="dark"] .vs-rutiner-check-btn {
  background: var(--wms-surface-2) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .vs-rutiner-check-btn.state-completed {
  border-color: #5dde7a !important;
  background: rgba(25, 135, 84, 0.28) !important;
  color: #5dde7a !important;
}
[data-bs-theme="dark"] .vs-rutiner-check-btn.state-skipped {
  border-color: #ff6b7a !important;
  background: rgba(220, 53, 69, 0.28) !important;
  color: #ff6b7a !important;
}
[data-bs-theme="dark"] .vs-rutiner-check-btn:focus {
  outline-color: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .vs-rutiner-check-legend .lg-ok {
  color: #5dde7a !important;
}
[data-bs-theme="dark"] .vs-rutiner-check-legend .lg-skip {
  color: #ff6b7a !important;
}
[data-bs-theme="dark"] .vs-rutiner-progress-bar {
  background: rgba(255, 255, 255, 0.12) !important;
}
[data-bs-theme="dark"] .vs-rutiner-filter-chip.is-active {
  background: var(--wms-brand) !important;
  border-color: var(--wms-brand) !important;
  color: #fff !important;
}
[data-bs-theme="dark"] .vs-rutiner-filter-chip .vs-rutiner-chip-count {
  background: rgba(255, 255, 255, 0.12) !important;
}
[data-bs-theme="dark"] .vs-rutiner-card:focus-visible,
[data-bs-theme="dark"] #vsRutinerListBody .vs-rutiner-list-row:focus-visible {
  outline-color: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .vs-rutiner-panel .input-group-text.bg-white {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .vs-rutiner-tread-wheel {
  background: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
  box-shadow: inset 5px 0 0 var(--wms-teal) !important;
}
[data-bs-theme="dark"] .vs-rutiner-tread-wheel-title {
  color: var(--wms-brand) !important;
}
[data-bs-theme="dark"] .vs-rutiner-tread-wheel .input-group-text {
  background: var(--wms-surface) !important;
  color: var(--wms-muted) !important;
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] #vsRutinerPreviewFrame {
  background: var(--wms-surface) !important;
}

/* —— Nyheter (modul inline-CSS hårdkodar vit kort + mörk text) —— */
[data-bs-theme="dark"] .news-card {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .news-card:hover {
  border-color: rgba(62, 196, 204, 0.35) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35) !important;
}
[data-bs-theme="dark"] .news-card h2,
[data-bs-theme="dark"] .news-card a.stretched-link {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .news-card .text-secondary,
[data-bs-theme="dark"] .news-byline .text-muted {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .news-byline .text-dark {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .news-body-full {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .news-body-full table td,
[data-bs-theme="dark"] .news-body-full table th {
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .news-body-full table th {
  background: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .news-body-full pre,
[data-bs-theme="dark"] .news-body-full code {
  background: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .news-body-full blockquote {
  color: var(--wms-muted) !important;
  background: var(--wms-surface-2) !important;
  border-left-color: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .news-comment-nested {
  border-left-color: rgba(62, 196, 204, 0.4) !important;
}
[data-bs-theme="dark"] .news-new-badge {
  background: var(--wms-teal) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important;
}
[data-bs-theme="dark"] .news-admin-panel {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-teal) !important;
  color: var(--wms-text) !important;
}

/* —— Delar & Arbeten (inventory) ——
   Inline styles in modules/inventory/index.php hardcode white wrap + light
   zebra/hover (#f7fbff / #e9f5ff). Global dark table text then becomes
   unreadable on those light rows — override with surface tokens. */
[data-bs-theme="dark"] .inventory-page .search-container,
[data-bs-theme="dark"] .inventory-table-wrap {
  background: var(--wms-surface) !important;
  background-color: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

[data-bs-theme="dark"] .inventory-page .category-header,
[data-bs-theme="dark"] .inventory-table-wrap + .category-header,
[data-bs-theme="dark"] .category-header + .inventory-table-wrap {
  color: var(--wms-muted) !important;
}

[data-bs-theme="dark"] .inventory-table tbody tr:nth-child(odd),
[data-bs-theme="dark"] .inventory-table tbody tr:nth-child(odd) > td {
  background-color: var(--wms-surface) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .inventory-table tbody tr:nth-child(even),
[data-bs-theme="dark"] .inventory-table tbody tr:nth-child(even) > td {
  background-color: var(--wms-surface-2) !important;
  color: var(--wms-text) !important;
}

/* inventory-table row hover: see shared --wms-table-row-hover-bg block above */

[data-bs-theme="dark"] .inventory-table .btn.btn-light.border {
  background-color: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .inventory-table .btn.btn-light.border:hover {
  background-color: rgba(62, 196, 204, 0.14) !important;
  color: var(--wms-text) !important;
}

[data-bs-theme="dark"] .inventory-table thead.table-light th {
  background: linear-gradient(180deg, #0A2F4B 0%, #114367 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* —— Modulbehörighet: edit-user + Behörighet-modal (access control) ——
   Shared .edit-user-perm-* cards/segments. Inline modal <style> sets light
   hex accents; dark needs stronger colors (modal <style> wins → !important). */
[data-bs-theme="dark"] #editUserModal .edit-user-perm-row,
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-row,
[data-bs-theme="dark"] #wmsAccessControlModal .eu-module-row {
  background: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] #editUserModal .edit-user-perm-row .edit-user-perm-module-label,
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-row .edit-user-perm-module-label,
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-module-label .wms-user-chip-name,
[data-bs-theme="dark"] #wmsAccessControlModal .eu-module-label {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] #editUserModal .edit-user-perm-row.is-readonly .edit-user-perm-module-label,
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-module-label .wms-user-chip-title {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] #editUserModal .edit-user-perm-segment,
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-segment {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] #editUserModal .edit-user-perm-seg-btn,
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-seg-btn {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] #editUserModal .edit-user-perm-segment:has(.edit-user-perm-seg-none input:checked)::after,
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-segment:has(.edit-user-perm-seg-none input:checked)::after {
  background-color: rgba(241, 174, 181, 0.28) !important;
}
[data-bs-theme="dark"] #editUserModal .edit-user-perm-segment:has(.edit-user-perm-seg-access input:checked)::after,
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-segment:has(.edit-user-perm-seg-access input:checked)::after {
  background-color: rgba(126, 182, 216, 0.35) !important;
}
[data-bs-theme="dark"] #editUserModal .edit-user-perm-segment:has(.edit-user-perm-seg-edit input:checked)::after,
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-segment:has(.edit-user-perm-seg-edit input:checked)::after {
  background-color: rgba(117, 183, 152, 0.35) !important;
}
[data-bs-theme="dark"] #editUserModal .edit-user-perm-seg-none:has(input:checked),
[data-bs-theme="dark"] #editUserModal .edit-user-perm-seg-none.is-active,
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-seg-none:has(input:checked),
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-seg-none.is-active {
  color: #f1aeb5 !important;
}
[data-bs-theme="dark"] #editUserModal .edit-user-perm-seg-access:has(input:checked),
[data-bs-theme="dark"] #editUserModal .edit-user-perm-seg-access.is-active,
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-seg-access:has(input:checked),
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-seg-access.is-active {
  color: #9ec5e0 !important;
}
[data-bs-theme="dark"] #editUserModal .edit-user-perm-seg-edit:has(input:checked),
[data-bs-theme="dark"] #editUserModal .edit-user-perm-seg-edit.is-active,
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-seg-edit:has(input:checked),
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-seg-edit.is-active {
  color: #75b798 !important;
}
[data-bs-theme="dark"] #editUserModal .edit-user-perm-seg-btn:has(input:focus-visible),
[data-bs-theme="dark"] #wmsAccessControlModal .edit-user-perm-seg-btn:has(input:focus-visible) {
  box-shadow: 0 0 0 2px rgba(62, 196, 204, 0.45) !important;
}

/* —— User profile view (modules/user/profile.php) —— */
[data-bs-theme="dark"] .profile-card,
[data-bs-theme="dark"] .profile-module-card,
[data-bs-theme="dark"] .profile-week-card,
[data-bs-theme="dark"] .profile-unit-card {
  background-color: var(--wms-surface) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
  box-shadow: none;
}
[data-bs-theme="dark"] .profile-module-card,
[data-bs-theme="dark"] .profile-week-card,
[data-bs-theme="dark"] .profile-unit-card {
  background-color: var(--wms-surface-2) !important;
}
[data-bs-theme="dark"] .profile-section-title,
[data-bs-theme="dark"] .profile-unit-name,
[data-bs-theme="dark"] .profile-module-name,
[data-bs-theme="dark"] .profile-field-value,
[data-bs-theme="dark"] .profile-week-card h3 {
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .profile-field-label,
[data-bs-theme="dark"] .profile-module-level,
[data-bs-theme="dark"] .profile-empty {
  color: var(--wms-muted) !important;
}
[data-bs-theme="dark"] .profile-contact-link {
  color: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .profile-contact-link:hover,
[data-bs-theme="dark"] .profile-contact-link:focus {
  color: var(--bs-link-hover-color, #6ad4da) !important;
}
[data-bs-theme="dark"] .profile-auth-badge,
[data-bs-theme="dark"] .profile-role-badge,
[data-bs-theme="dark"] .profile-week-badge-vacation,
[data-bs-theme="dark"] .profile-week-badge-substitute {
  color: var(--wms-brand) !important;
}
[data-bs-theme="dark"] .profile-auth-badge,
[data-bs-theme="dark"] .profile-week-badge-vacation {
  background: rgba(62, 196, 204, 0.2) !important;
}
[data-bs-theme="dark"] .profile-auth-badge-admin,
[data-bs-theme="dark"] .profile-role-badge,
[data-bs-theme="dark"] .profile-week-badge-substitute {
  background: rgba(126, 182, 216, 0.18) !important;
}
[data-bs-theme="dark"] .profile-actions .btn-outline-primary {
  color: var(--wms-teal) !important;
  border-color: var(--wms-teal) !important;
  background-color: transparent !important;
}
[data-bs-theme="dark"] .profile-actions .btn-outline-primary:hover,
[data-bs-theme="dark"] .profile-actions .btn-outline-primary:focus {
  color: #0f1720 !important;
  background-color: var(--wms-teal) !important;
  border-color: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .profile-avatar-ring {
  background: var(--wms-surface) !important;
}

/* —— Ärenden note Quill ——
   Light theme: default snow (dark text on white).
   Dark theme: dark field with light text and light toolbar icons. */
.cases-note-editor .ql-toolbar.ql-snow {
  background: #ffffff;
  border: 1px solid #ced4da;
  border-bottom: 0;
  border-radius: 0.375rem 0.375rem 0 0;
  color: #212529;
}
.cases-note-editor .ql-container.ql-snow {
  background: #ffffff;
  border: 1px solid #ced4da;
  border-radius: 0 0 0.375rem 0.375rem;
  color: #212529;
}
.cases-note-editor .ql-editor {
  color: #212529;
  min-height: 160px;
}
.cases-note-editor .ql-editor.ql-blank::before {
  color: #6c757d;
  opacity: 1;
  font-style: italic;
}
.cases-note-editor .ql-snow .ql-stroke {
  stroke: #444444;
}
.cases-note-editor .ql-snow .ql-fill,
.cases-note-editor .ql-snow .ql-stroke.ql-fill {
  fill: #444444;
}
.cases-note-editor .ql-snow .ql-picker {
  color: #444444;
}
.cases-note-editor .ql-snow .ql-picker-options {
  background: #ffffff;
  color: #212529;
  border-color: #ced4da;
}
.cases-note-editor .ql-snow.ql-toolbar button:hover .ql-stroke,
.cases-note-editor .ql-snow .ql-toolbar button:hover .ql-stroke,
.cases-note-editor .ql-snow.ql-toolbar button.ql-active .ql-stroke,
.cases-note-editor .ql-snow .ql-toolbar button.ql-active .ql-stroke {
  stroke: #0a2f4b;
}
.cases-note-editor .ql-snow.ql-toolbar button:hover .ql-fill,
.cases-note-editor .ql-snow .ql-toolbar button:hover .ql-fill,
.cases-note-editor .ql-snow.ql-toolbar button.ql-active .ql-fill,
.cases-note-editor .ql-snow .ql-toolbar button.ql-active .ql-fill {
  fill: #0a2f4b;
}

[data-bs-theme="dark"] .cases-note-editor .ql-toolbar.ql-snow {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
  border-bottom: 0 !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .cases-note-editor .ql-container.ql-snow {
  background: var(--wms-surface-2) !important;
  border-color: var(--wms-border) !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .cases-note-editor .ql-editor {
  background: transparent !important;
  color: var(--wms-text) !important;
}
[data-bs-theme="dark"] .cases-note-editor .ql-editor.ql-blank::before {
  color: var(--wms-muted) !important;
  opacity: 1;
}
[data-bs-theme="dark"] .cases-note-editor .ql-snow .ql-stroke {
  stroke: #c5d4e0 !important;
}
[data-bs-theme="dark"] .cases-note-editor .ql-snow .ql-fill,
[data-bs-theme="dark"] .cases-note-editor .ql-snow .ql-stroke.ql-fill {
  fill: #c5d4e0 !important;
}
[data-bs-theme="dark"] .cases-note-editor .ql-snow .ql-picker {
  color: #c5d4e0 !important;
}
[data-bs-theme="dark"] .cases-note-editor .ql-snow .ql-picker-options {
  background: var(--wms-surface) !important;
  color: var(--wms-text) !important;
  border-color: var(--wms-border) !important;
}
[data-bs-theme="dark"] .cases-note-editor .ql-snow.ql-toolbar button:hover .ql-stroke,
[data-bs-theme="dark"] .cases-note-editor .ql-snow .ql-toolbar button:hover .ql-stroke,
[data-bs-theme="dark"] .cases-note-editor .ql-snow.ql-toolbar button.ql-active .ql-stroke,
[data-bs-theme="dark"] .cases-note-editor .ql-snow .ql-toolbar button.ql-active .ql-stroke {
  stroke: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .cases-note-editor .ql-snow.ql-toolbar button:hover .ql-fill,
[data-bs-theme="dark"] .cases-note-editor .ql-snow .ql-toolbar button:hover .ql-fill,
[data-bs-theme="dark"] .cases-note-editor .ql-snow.ql-toolbar button.ql-active .ql-fill,
[data-bs-theme="dark"] .cases-note-editor .ql-snow .ql-toolbar button.ql-active .ql-fill {
  fill: var(--wms-teal) !important;
}
[data-bs-theme="dark"] .cases-note-editor .ql-snow.ql-toolbar button:hover,
[data-bs-theme="dark"] .cases-note-editor .ql-snow .ql-toolbar button:hover,
[data-bs-theme="dark"] .cases-note-editor .ql-snow.ql-toolbar button.ql-active,
[data-bs-theme="dark"] .cases-note-editor .ql-snow .ql-toolbar button.ql-active {
  background: rgba(62, 196, 204, 0.12) !important;
}
