:root {
    --pm-bg: #f5f7fa;
    --pm-surface: #ffffff;
    --pm-surface-2: #f8fafc;
    --pm-text: #1f2937;
    --pm-text-muted: #6b7280;
    --pm-border: #d1d5db;
}

html[data-theme="dark"] {
    --pm-bg: #0f172a;
    --pm-surface: #1f2937;
    --pm-surface-2: #0f172a;
    --pm-text: #e5e7eb;
    --pm-text-muted: #9ca3af;
    --pm-border: #374151;
    scrollbar-color: #4b5563 #111827;
    color-scheme: dark;
}

body {
    background-color: var(--pm-bg);
    color: var(--pm-text);
}

.main-content,
.page-content,
.card,
.modal-content,
.modal-header,
.modal-body,
.modal-footer,
.dropdown-menu,
.footer .footer-inner > div {
    background-color: var(--pm-surface);
    color: var(--pm-text);
}

/* keep page canvas darker than cards in dark mode */
html[data-theme="dark"] .main-content,
html[data-theme="dark"] .page-content,
html[data-theme="dark"] .body-container,
html[data-theme="dark"] .main-container {
    background-color: var(--pm-bg) !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] .body-container {
    background-color: #07111f !important;
    background-image: linear-gradient(180deg, #07111f 0%, #0f1e33 58%, #123556 100%) !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] .background img {
    filter: none;
    opacity: 0.16;
}

html[data-theme="dark"][data-theme-mode="system-only"] .main-container.bgc-transparent,
html[data-theme="dark"][data-theme-mode="system-only"] .main-content {
    background-color: transparent !important;
    background-image: none !important;
}

.text-muted,
.text-grey-m1,
.text-grey-m2,
.text-grey-d1,
.text-default-m1 {
    color: var(--pm-text-muted) !important;
}

html[data-theme="dark"] i.text-dark-m1,
html[data-theme="dark"] i.text-dark-d1,
html[data-theme="dark"] .fa.text-dark-m1,
html[data-theme="dark"] .fa.text-dark-d1,
html[data-theme="dark"] .fas.text-dark-m1,
html[data-theme="dark"] .fas.text-dark-d1,
html[data-theme="dark"] .far.text-dark-m1,
html[data-theme="dark"] .far.text-dark-d1,
html[data-theme="dark"] .fal.text-dark-m1,
html[data-theme="dark"] .fal.text-dark-d1,
html[data-theme="dark"] .fad.text-dark-m1,
html[data-theme="dark"] .fad.text-dark-d1,
html[data-theme="dark"] .svg-inline--fa.text-dark-m1,
html[data-theme="dark"] .svg-inline--fa.text-dark-d1 {
    color: #cbd5e1 !important;
}

.border,
.border-1,
.card,
.modal-content,
.modal-header,
.modal-footer,
.dropdown-menu,
.table td,
.table th {
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] hr.brc-grey-l3,
html[data-theme="dark"] hr[class*="brc-grey-l3"] {
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-body,
html[data-theme="dark"] .modal-footer {
    background-color: var(--pm-surface) !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .modal-header {
    border-bottom-color: var(--pm-border) !important;
}

html[data-theme="dark"] .modal-footer {
    border-top-color: var(--pm-border) !important;
}

html[data-theme="dark"] .modal-header .close,
html[data-theme="dark"] .modal-header button.close,
html[data-theme="dark"] .modal-header .btn-close {
    color: #cbd5e1 !important;
    text-shadow: none !important;
    opacity: 0.85 !important;
    filter: invert(1) grayscale(100%) brightness(1.6) !important;
}

html[data-theme="dark"] .modal-header .close:hover,
html[data-theme="dark"] .modal-header .close:focus,
html[data-theme="dark"] .modal-header button.close:hover,
html[data-theme="dark"] .modal-header button.close:focus,
html[data-theme="dark"] .modal-header .btn-close:hover,
html[data-theme="dark"] .modal-header .btn-close:focus {
    color: #f3f4f6 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .navbar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .footer .footer-inner > div,
html[data-theme="dark"] .bgc-white,
html[data-theme="dark"] .bgc-white-tp1,
html[data-theme="dark"] .bgc-white-tp9 {
    background-color: var(--pm-surface) !important;
    color: var(--pm-text) !important;
}

html[data-theme="dark"] .bgc-blue-l2,
html[data-theme="dark"] .bgc-h-blue-l2:hover {
    background-color: #1e3a5f !important;
    color: #dbeafe !important;
}

/* workflow/call-log/notifications dropdown headers: avoid bright blue/white dividers in dark mode */
html[data-theme="dark"] #notificationsDropdown .dropdown-menu > .bgc-blue-l2.border-b-1,
html[data-theme="dark"] #notificationsDropdown .dropdown-menu > .bgc-blue-l2[class*="brc-blue-l"],
html[data-theme="dark"] #workflowDropdown .dropdown-menu > .bgc-blue-l2.border-b-1,
html[data-theme="dark"] #workflowDropdown .dropdown-menu > .bgc-blue-l2[class*="brc-blue-l"],
html[data-theme="dark"] #callLogsDropdown .dropdown-menu > .bgc-blue-l2.border-b-1,
html[data-theme="dark"] #callLogsDropdown .dropdown-menu > .bgc-blue-l2[class*="brc-blue-l"] {
    border-bottom-color: var(--pm-border) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] #notificationsDropdown .dropdown-menu > .bgc-blue-l2 .text-dark-tp4,
html[data-theme="dark"] #workflowDropdown .dropdown-menu > .bgc-blue-l2 .text-dark-tp4,
html[data-theme="dark"] #callLogsDropdown .dropdown-menu > .bgc-blue-l2 .text-dark-tp4 {
    color: #dbeafe !important;
}

html[data-theme="dark"] #notificationsDropdown .user-notification {
    color: var(--pm-text) !important;
}

html[data-theme="dark"] #notificationsDropdown .user-notification.bgc-danger-l3 {
    background-color: #3f1f2a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] #notificationsDropdown .user-notification .text-grey-d1,
html[data-theme="dark"] #notificationsDropdown .user-notification small.text-grey-d1 {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] #notificationsDropdown .user-notification.bgc-danger-l3 .text-grey-d1,
html[data-theme="dark"] #notificationsDropdown .user-notification.bgc-danger-l3 small.text-grey-d1 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] #workflowDropdown #header-workflow-area > .row.bgc-light {
    background-color: #111827 !important;
    color: var(--pm-text) !important;
    border-top: 1px solid var(--pm-border) !important;
}

html[data-theme="dark"] #workflowDropdown #header-workflow-area > .row.bgc-light .text-grey {
    color: #d1d5db !important;
}

#navIcons #header-workflow-count.badge,
#navIcons #header-calls-count.badge,
#navIcons #header-bell-count.badge {
    align-items: center;
    border-radius: 50% !important;
    display: inline-flex;
    height: 1.3rem;
    justify-content: center;
    line-height: 1 !important;
    min-width: 0;
    padding: 0 !important;
    width: 1.3rem;
}

#navIcons #header-workflow-count.badge:empty,
#navIcons #header-calls-count.badge:empty,
#navIcons #header-bell-count.badge:empty {
    display: none;
}

/* remove bright divider lines on top navbar and sidebar header areas */
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .navbar .navbar-inner,
html[data-theme="dark"] .sidebar .sidebar-section-item,
html[data-theme="dark"] .sidebar .border-b-1,
html[data-theme="dark"] .sidebar [class*="brc-secondary-l"] {
    border-color: var(--pm-border) !important;
}

/* footer top divider should match the top header bottom divider in dark mode */
html[data-theme="dark"] .footer,
html[data-theme="dark"] .footer-inner,
html[data-theme="dark"] .footer .footer-inner,
html[data-theme="dark"] .footer .footer-inner > div,
html[data-theme="dark"] .footer [class*="border-t-"],
html[data-theme="dark"] .footer [class*="brc-secondary-l"] {
    border-top-color: var(--pm-border) !important;
    border-color: var(--pm-border) !important;
}

/* Ace secondary utility panels are too bright in dark mode */
html[data-theme="dark"] div.bgc-secondary-l4.brc-secondary-l2,
html[data-theme="dark"] .bgc-secondary-l4.brc-secondary-l2 {
    background-color: #273449 !important;
    color: #d8e0ea !important;
    border-color: #4b5563 !important;
}

/* form submit button rows commonly use border-t-1 brc-secondary-l2 */
html[data-theme="dark"] .border-t-1.brc-secondary-l1,
html[data-theme="dark"] .border-t-1.brc-secondary-l2,
html[data-theme="dark"] .border-t-1.brc-secondary-l3,
html[data-theme="dark"] .border-t-1.brc-secondary-l4,
html[data-theme="dark"] .border-t-1.brc-secondary-l5,
html[data-theme="dark"] [class*="border-t-"].brc-secondary-l1,
html[data-theme="dark"] [class*="border-t-"].brc-secondary-l2,
html[data-theme="dark"] [class*="border-t-"].brc-secondary-l3,
html[data-theme="dark"] [class*="border-t-"].brc-secondary-l4,
html[data-theme="dark"] [class*="border-t-"].brc-secondary-l5 {
    border-top-color: var(--pm-border) !important;
}

/* floating back-to-top button */
html[data-theme="dark"] .footer-tools .btn-scroll-up,
html[data-theme="dark"] #btn-scroll-up.btn-scroll-up {
    background-color: #1f2937 !important;
    color: #cbd5e1 !important;
    border-color: var(--pm-border) !important;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .footer-tools .btn-scroll-up:hover,
html[data-theme="dark"] .footer-tools .btn-scroll-up:focus,
html[data-theme="dark"] #btn-scroll-up.btn-scroll-up:hover,
html[data-theme="dark"] #btn-scroll-up.btn-scroll-up:focus {
    background-color: #273449 !important;
    color: #f3f4f6 !important;
    border-color: #4b5563 !important;
}

/* left sidebar right edge divider */
html[data-theme="dark"] #sidebar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .sidebar::after {
    border-right-color: var(--pm-border) !important;
}

/* ace theme sets border on .sidebar-inner for sidebar-white variants */
html[data-theme="dark"] .sidebar.sidebar-white .sidebar-inner,
html[data-theme="dark"] .sidebar.sidebar-white2 .sidebar-inner,
html[data-theme="dark"] .sidebar.sidebar-white3 .sidebar-inner,
html[data-theme="dark"] .sidebar.sidebar-white4 .sidebar-inner {
    border-right-color: var(--pm-border) !important;
    box-shadow: inset -1px 0 0 0 var(--pm-border) !important;
}

/* catch additional white utility backgrounds used by dashboard summary cards */
html[data-theme="dark"] [class*="bgc-white"] {
    background-color: var(--pm-surface) !important;
    color: var(--pm-text) !important;
}

/* sidebar submenu backgrounds */
html[data-theme="dark"] .sidebar .submenu,
html[data-theme="dark"] .sidebar .submenu-inner,
html[data-theme="dark"] .sidebar .nav > .nav-item > .submenu {
    background-color: #16202d !important;
}

html[data-theme="dark"] .sidebar .submenu .nav-link,
html[data-theme="dark"] .sidebar .submenu .nav-text {
    color: #9ca3af !important;
}

/* hide Ace sidebar submenu hover bullets */
.sidebar .submenu .nav-item > .nav-link:hover > .nav-text::before {
    content: none !important;
    display: none !important;
}

/* sidebar user-name toggle should not turn blue on hover in dark mode */
html[data-theme="dark"] .sidebar #id-user-info a {
    background-color: transparent !important;
    color: #9ca3af !important;
}

html[data-theme="dark"] .sidebar #id-user-info a:hover,
html[data-theme="dark"] .sidebar #id-user-info a:focus,
html[data-theme="dark"] .sidebar #id-user-info a[aria-expanded="true"] {
    background-color: #0f172a !important;
    color: #9ca3af !important;
}

html[data-theme="dark"] .sidebar #id-user-info a span,
html[data-theme="dark"] .sidebar #id-user-info .font-bolder {
    color: #9ca3af !important;
}

/* left sidebar nav item hover/active states */
html[data-theme="dark"] .sidebar .nav-link:hover,
html[data-theme="dark"] .sidebar .nav-item:hover > .nav-link,
html[data-theme="dark"] .sidebar .nav-item.active > .nav-link,
html[data-theme="dark"] .sidebar .nav-item.open > .nav-link,
html[data-theme="dark"] .sidebar .nav > .nav-item > .dropdown-toggle:not(.collapsed) {
    background-color: #0f172a !important;
    color: #9ca3af !important;
}

/* leaf sidebar links (items without submenus) should not look selected when inactive */
html[data-theme="dark"] .sidebar .nav > .nav-item:not(.active):not(.open) > .nav-link:not(.dropdown-toggle) {
    background-color: transparent !important;
}

/* keep single sidebar links at the same weight as parent items with submenus in dark mode */
html[data-theme="dark"] .sidebar .nav > .nav-item > .nav-link:not(.dropdown-toggle),
html[data-theme="dark"] .sidebar .nav > .nav-item > .nav-link:not(.dropdown-toggle) .nav-text {
    font-weight: 600 !important;
}

html[data-theme="dark"] .sidebar .nav > .nav-item:not(.active):not(.open) > .nav-link:not(.dropdown-toggle):hover,
html[data-theme="dark"] .sidebar .nav > .nav-item:not(.active):not(.open):hover > .nav-link:not(.dropdown-toggle) {
    background-color: #0f172a !important;
}

/* left sidebar circle icon palette */
html[data-theme="dark"] .sidebar .nav-link > .nav-icon,
html[data-theme="dark"] .sidebar .nav-link .nav-icon {
    color: #e5edf6 !important;
}

html[data-theme="dark"] .sidebar .nav-link > .nav-icon.nav-icon-round,
html[data-theme="dark"] .sidebar .nav-link .nav-icon.nav-icon-round {
    filter: none;
}

html[data-theme="dark"] .sidebar .nav-icon-round.bgc-primary-tp1 { background-color: #1d4f87 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-default-tp1 { background-color: #4b5563 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-secondary-tp1 { background-color: #475569 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-info-tp1 { background-color: #0f6f8f !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-success-tp1 { background-color: #1f6f46 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-danger-tp1 { background-color: #a33b3b !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-warning-tp1 { background-color: #9a6a12 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-dark-tp1 { background-color: #334155 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-grey-tp1 { background-color: #4b5563 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-purple-tp1 { background-color: #6550a8 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-pink-tp1 { background-color: #a34073 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-yellow-tp1 { background-color: #a87917 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-lightgrey-tp1 { background-color: #64748b !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-brown-tp1 { background-color: #8a5a2b !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-blue-tp1 { background-color: #1d4f87 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-red-tp1 { background-color: #a83f3f !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-green-tp1 { background-color: #1f6f46 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-orange-tp1 { background-color: #a65f18 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-light-tp1 { background-color: #64748b !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-black-tp1 { background-color: #111827 !important; }
html[data-theme="dark"] .sidebar .nav-icon-round.bgc-white-tp1 { background-color: #64748b !important; }

html[data-theme="dark"] .table,
html[data-theme="dark"] .table-hover tbody tr:hover {
    color: var(--pm-text);
}

/* tables: use softer dark-mode row/header colours instead of bright white/dark-grey mix */
html[data-theme="dark"] .table,
html[data-theme="dark"] .bootstrap-table .table,
html[data-theme="dark"] .fixed-table-container,
html[data-theme="dark"] .fixed-table-body {
    background-color: var(--pm-surface) !important;
    color: #b6c2cf !important;
}

html[data-theme="dark"] .table thead,
html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .bootstrap-table .table thead th,
html[data-theme="dark"] .fixed-table-header,
html[data-theme="dark"] .fixed-table-header table,
html[data-theme="dark"] .fixed-table-header th {
    background-color: #111827 !important;
    color: #9ca3af !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .table thead input[type="checkbox"]:not(.form-check-input),
html[data-theme="dark"] .bootstrap-table .table thead input[type="checkbox"]:not(.form-check-input),
html[data-theme="dark"] .fixed-table-header input[type="checkbox"]:not(.form-check-input),
html[data-theme="dark"] .table tbody input[type="checkbox"]:not(.form-check-input):not(.ace-switch),
html[data-theme="dark"] .bootstrap-table .table tbody input[type="checkbox"]:not(.form-check-input):not(.ace-switch),
html[data-theme="dark"] .fixed-table-body input[type="checkbox"]:not(.form-check-input):not(.ace-switch) {
    background-color: #0f172a !important;
    border-color: var(--pm-border) !important;
    accent-color: auto;
}

html[data-theme="dark"] .table thead input[type="checkbox"]:not(.form-check-input):checked,
html[data-theme="dark"] .bootstrap-table .table thead input[type="checkbox"]:not(.form-check-input):checked,
html[data-theme="dark"] .fixed-table-header input[type="checkbox"]:not(.form-check-input):checked,
html[data-theme="dark"] .table tbody input[type="checkbox"]:not(.form-check-input):not(.ace-switch):checked,
html[data-theme="dark"] .bootstrap-table .table tbody input[type="checkbox"]:not(.form-check-input):not(.ace-switch):checked,
html[data-theme="dark"] .fixed-table-body input[type="checkbox"]:not(.form-check-input):not(.ace-switch):checked {
    background-color: #0f172a !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .table thead input[type="checkbox"]:not(.form-check-input):focus,
html[data-theme="dark"] .bootstrap-table .table thead input[type="checkbox"]:not(.form-check-input):focus,
html[data-theme="dark"] .fixed-table-header input[type="checkbox"]:not(.form-check-input):focus,
html[data-theme="dark"] .table tbody input[type="checkbox"]:not(.form-check-input):not(.ace-switch):focus,
html[data-theme="dark"] .bootstrap-table .table tbody input[type="checkbox"]:not(.form-check-input):not(.ace-switch):focus,
html[data-theme="dark"] .fixed-table-body input[type="checkbox"]:not(.form-check-input):not(.ace-switch):focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25) !important;
}

html[data-theme="dark"] .table tfoot,
html[data-theme="dark"] .table tfoot tr,
html[data-theme="dark"] .table tfoot th,
html[data-theme="dark"] .table tfoot td,
html[data-theme="dark"] .bootstrap-table .table tfoot,
html[data-theme="dark"] .bootstrap-table .table tfoot tr,
html[data-theme="dark"] .bootstrap-table .table tfoot th,
html[data-theme="dark"] .bootstrap-table .table tfoot td,
html[data-theme="dark"] .fixed-table-footer,
html[data-theme="dark"] .fixed-table-footer table,
html[data-theme="dark"] .fixed-table-footer th,
html[data-theme="dark"] .fixed-table-footer td,
html[data-theme="dark"] .fixed-table-pagination {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .fixed-table-pagination .pagination-detail,
html[data-theme="dark"] .fixed-table-pagination .page-list,
html[data-theme="dark"] .fixed-table-pagination .btn,
html[data-theme="dark"] .fixed-table-pagination .dropdown-toggle {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .fixed-table-pagination .pagination .page-link,
html[data-theme="dark"] .fixed-table-pagination .pagination .page-item .page-link,
html[data-theme="dark"] .fixed-table-pagination .pagination > li > a,
html[data-theme="dark"] .fixed-table-pagination .pagination > li > span {
    background-color: #1f2937 !important;
    color: #cbd5e1 !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .fixed-table-pagination .pagination .page-link:hover,
html[data-theme="dark"] .fixed-table-pagination .pagination .page-item:not(.disabled) .page-link:hover,
html[data-theme="dark"] .fixed-table-pagination .pagination > li > a:hover {
    background-color: #273449 !important;
    color: #f3f4f6 !important;
    border-color: #4b5563 !important;
}

html[data-theme="dark"] .fixed-table-pagination .pagination .page-item.active .page-link,
html[data-theme="dark"] .fixed-table-pagination .pagination > li.active > a,
html[data-theme="dark"] .fixed-table-pagination .pagination > li.active > span {
    background-color: #1e3a5f !important;
    color: #dbeafe !important;
    border-color: #2563eb !important;
}

html[data-theme="dark"] .fixed-table-pagination .pagination .page-item.disabled .page-link,
html[data-theme="dark"] .fixed-table-pagination .pagination > li.disabled > a,
html[data-theme="dark"] .fixed-table-pagination .pagination > li.disabled > span {
    background-color: #111827 !important;
    color: #6b7280 !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu,
html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu .dropdown-item,
html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu .dropdown-item a,
html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu li,
html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu li a {
    background-color: #1f2937 !important;
    color: #cbd5e1 !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu .dropdown-item:hover,
html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu .dropdown-item:focus,
html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu li a:hover,
html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu li a:focus {
    background-color: #273449 !important;
    color: #f3f4f6 !important;
}

html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu .dropdown-item.active,
html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu .dropdown-item.active a,
html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu li.active,
html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu li.active a,
html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu .selected,
html[data-theme="dark"] .fixed-table-pagination .page-list .dropdown-menu .selected a {
    background-color: #1e3a5f !important;
    color: #dbeafe !important;
}

html[data-theme="dark"] .table tbody,
html[data-theme="dark"] .table tbody tr,
html[data-theme="dark"] .table tbody td,
html[data-theme="dark"] .bootstrap-table .table tbody tr,
html[data-theme="dark"] .bootstrap-table .table tbody td {
    background-color: #1f2937 !important;
    color: #b6c2cf !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .table tbody a,
html[data-theme="dark"] .table tbody td a,
html[data-theme="dark"] .bootstrap-table .table tbody a,
html[data-theme="dark"] .bootstrap-table .table tbody td a {
    color: #b6c2cf !important;
}

/* preserve explicit danger text/icon colour on links in tables and button-like anchors */
html[data-theme="dark"] a.text-danger-d1,
html[data-theme="dark"] a.text-danger-d1 i,
html[data-theme="dark"] a.text-danger-d1 .fa,
html[data-theme="dark"] a.text-danger-d1 .fas,
html[data-theme="dark"] a.text-danger-d1 .far,
html[data-theme="dark"] a.text-danger-d1 .fal,
html[data-theme="dark"] a.text-danger-d1 .fad,
html[data-theme="dark"] a.text-danger-d1 .svg-inline--fa,
html[data-theme="dark"] .table tbody a.text-danger-d1,
html[data-theme="dark"] .table tbody a.text-danger-d1 i,
html[data-theme="dark"] .bootstrap-table .table tbody a.text-danger-d1,
html[data-theme="dark"] .bootstrap-table .table tbody a.text-danger-d1 i {
    color: #e53935 !important;
}

html[data-theme="dark"] a.text-danger-d1:hover,
html[data-theme="dark"] a.text-danger-d1:focus,
html[data-theme="dark"] a.text-danger-d1:hover i,
html[data-theme="dark"] a.text-danger-d1:focus i,
html[data-theme="dark"] .table tbody a.text-danger-d1:hover,
html[data-theme="dark"] .table tbody a.text-danger-d1:focus,
html[data-theme="dark"] .bootstrap-table .table tbody a.text-danger-d1:hover,
html[data-theme="dark"] .bootstrap-table .table tbody a.text-danger-d1:focus {
    color: #ef5350 !important;
}

html[data-theme="dark"] .table tbody a:hover,
html[data-theme="dark"] .table tbody a:focus,
html[data-theme="dark"] .bootstrap-table .table tbody a:hover,
html[data-theme="dark"] .bootstrap-table .table tbody a:focus {
    color: #f3f4f6 !important;
}

html[data-theme="dark"] .table tbody .datepicker.form-control-plaintext,
html[data-theme="dark"] .table tbody input.datepicker.form-control-plaintext,
html[data-theme="dark"] .bootstrap-table .table tbody .datepicker.form-control-plaintext,
html[data-theme="dark"] .bootstrap-table .table tbody input.datepicker.form-control-plaintext {
    color: #b6c2cf !important;
}

html[data-theme="dark"] .table tbody .datepicker.form-control-plaintext:hover,
html[data-theme="dark"] .table tbody .datepicker.form-control-plaintext:focus,
html[data-theme="dark"] .bootstrap-table .table tbody .datepicker.form-control-plaintext:hover,
html[data-theme="dark"] .bootstrap-table .table tbody .datepicker.form-control-plaintext:focus {
    color: #f3f4f6 !important;
}

html[data-theme="dark"] .pm-project-status {
    border: 1px solid transparent !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .pm-project-status-quote {
    background-color: #475569 !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] .pm-project-status-not-started {
    background-color: #334155 !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] .pm-project-status-ongoing {
    background-color: #0f6f8f !important;
    border-color: #0891b2 !important;
}

html[data-theme="dark"] .pm-project-status-on-hold {
    background-color: #9f3a3a !important;
    border-color: #dc2626 !important;
}

html[data-theme="dark"] .pm-project-status-completed {
    background-color: #1f6f46 !important;
    border-color: #2f9f68 !important;
}

html[data-theme="dark"] .pm-invoice-status {
    border: 1px solid transparent !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .pm-invoice-status-paid {
    background-color: #1f6f46 !important;
    border-color: #2f9f68 !important;
}

html[data-theme="dark"] .pm-invoice-status-not-paid {
    background-color: #475569 !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] .pm-invoice-status-due-soon {
    background-color: #8a6518 !important;
    border-color: #b88920 !important;
    color: #fff7d6 !important;
}

html[data-theme="dark"] .pm-invoice-status-overdue {
    background-color: #9f3a3a !important;
    border-color: #dc2626 !important;
    color: #fff1f2 !important;
}

html[data-theme="dark"] .pm-invoice-status-gocardless {
    background-color: #0f6f8f !important;
    border-color: #0891b2 !important;
}

html[data-theme="dark"] .pm-invoice-status-draft {
    background-color: #334155 !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] .pm-leave-status {
    border: 1px solid transparent !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .pm-leave-status-pending {
    background-color: #334155 !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] .pm-leave-status-approved {
    background-color: #1f6f46 !important;
    border-color: #2f9f68 !important;
}

html[data-theme="dark"] .datepicker table tr th {
    color: var(--pm-text) !important;
}

html[data-theme="dark"] .datepicker thead tr:first-child th:hover,
html[data-theme="dark"] .datepicker thead tr:first-child th:focus,
html[data-theme="dark"] .datepicker tfoot tr th:hover,
html[data-theme="dark"] .datepicker tfoot tr th:focus,
html[data-theme="dark"] .datepicker table tr td.day:not(.active):not(.today):not(.disabled):hover,
html[data-theme="dark"] .datepicker table tr td.day:not(.active):not(.today):not(.disabled).focused,
html[data-theme="dark"] .datepicker table tr td span:not(.active):not(.disabled):hover,
html[data-theme="dark"] .datepicker table tr td span:not(.active):not(.disabled):focus {
    background-color: #273449 !important;
    color: #f3f4f6 !important;
}

html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd),
html[data-theme="dark"] .table[class*="table-striped"]:not(.bt) tbody tr:nth-of-type(even),
html[data-theme="dark"] .table-striped-primary tbody tr:nth-of-type(odd),
html[data-theme="dark"] .table-striped-secondary tbody tr:nth-of-type(odd),
html[data-theme="dark"] .table-striped-blue tbody tr:nth-of-type(odd),
html[data-theme="dark"] .table-striped-danger tbody tr:nth-of-type(odd),
html[data-theme="dark"] .table-striped-success tbody tr:nth-of-type(odd),
html[data-theme="dark"] .table-striped-warning tbody tr:nth-of-type(odd),
html[data-theme="dark"] .table-striped-info tbody tr:nth-of-type(odd),
html[data-theme="dark"] .table-striped-default tbody tr:nth-of-type(odd) {
    background-color: #182231 !important;
}

html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .table[class*="table-striped"]:not(.bt) tbody tr:nth-of-type(even) td,
html[data-theme="dark"] .table-striped-primary tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .table-striped-secondary tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .table-striped-blue tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .table-striped-danger tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .table-striped-success tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .table-striped-warning tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .table-striped-info tbody tr:nth-of-type(odd) td,
html[data-theme="dark"] .table-striped-default tbody tr:nth-of-type(odd) td {
    background-color: #182231 !important;
}

html[data-theme="dark"] .table-hover tbody tr:hover,
html[data-theme="dark"] .table-hover tbody tr:hover td,
html[data-theme="dark"] .bootstrap-table .table-hover tbody tr:hover,
html[data-theme="dark"] .bootstrap-table .table-hover tbody tr:hover td {
    background-color: #273449 !important;
    color: #f3f4f6 !important;
}

/* FullCalendar borders/backgrounds */
html[data-theme="dark"] .fc,
html[data-theme="dark"] .fc-theme-standard,
html[data-theme="dark"] .fc-theme-bootstrap {
    --fc-border-color: var(--pm-border);
    --fc-page-bg-color: var(--pm-surface);
    --fc-neutral-bg-color: #111827;
    --fc-neutral-text-color: var(--pm-text-muted);
    --fc-today-bg-color: rgba(30, 58, 95, 0.45);
    --fc-list-event-hover-bg-color: #273449;
    color: var(--pm-text) !important;
}

html[data-theme="dark"] .fc-theme-standard td,
html[data-theme="dark"] .fc-theme-standard th,
html[data-theme="dark"] .fc-theme-standard .fc-scrollgrid,
html[data-theme="dark"] .fc-theme-standard .fc-list,
html[data-theme="dark"] .fc-theme-standard .fc-popover,
html[data-theme="dark"] .fc-theme-bootstrap th,
html[data-theme="dark"] .fc-theme-bootstrap td,
html[data-theme="dark"] .fc-theme-bootstrap hr,
html[data-theme="dark"] .fc-theme-bootstrap thead,
html[data-theme="dark"] .fc-theme-bootstrap tbody,
html[data-theme="dark"] .fc-theme-bootstrap .fc-popover {
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .fc .fc-scrollgrid-section-sticky > *,
html[data-theme="dark"] .fc .fc-list-day-cushion,
html[data-theme="dark"] .fc .fc-popover,
html[data-theme="dark"] .fc .fc-popover-header {
    background-color: var(--pm-surface) !important;
    color: var(--pm-text) !important;
}

html[data-theme="dark"] .fc .pm-cal-event,
html[data-theme="dark"] .fc .pm-cal-event .fc-event-main {
    color: #f8fafc !important;
}

html[data-theme="dark"] .fc .pm-cal-white { background-color: #273449 !important; border-color: #64748b !important; color: #e5e7eb !important; }
html[data-theme="dark"] .fc .pm-cal-stage { background-color: #3b3560 !important; border-color: #6550a8 !important; color: #ede9fe !important; }
html[data-theme="dark"] .fc .pm-cal-blue { background-color: #155e75 !important; border-color: #0891b2 !important; color: #ecfeff !important; }
html[data-theme="dark"] .fc .pm-cal-red { background-color: #8f2f3a !important; border-color: #c24a50 !important; color: #fff1f2 !important; }
html[data-theme="dark"] .fc .pm-cal-pink { background-color: #8f3a63 !important; border-color: #c44f86 !important; color: #fdf2f8 !important; }
html[data-theme="dark"] .fc .pm-cal-yellow { background-color: #8a6518 !important; border-color: #b88920 !important; color: #fff7d6 !important; }
html[data-theme="dark"] .fc .pm-cal-orange { background-color: #9a5716 !important; border-color: #d97706 !important; color: #fff7ed !important; }
html[data-theme="dark"] .fc .pm-cal-green { background-color: #1f6f46 !important; border-color: #2f9f68 !important; color: #ecfdf5 !important; }
html[data-theme="dark"] .fc .pm-cal-purple { background-color: #5b4aa0 !important; border-color: #7c68c8 !important; color: #f5f3ff !important; }
html[data-theme="dark"] .fc .pm-cal-sick { background-color: #991b1b !important; border-color: #dc2626 !important; color: #fff1f2 !important; }
html[data-theme="dark"] .fc .pm-cal-project-status-0 { background-color: #475569 !important; border-color: #64748b !important; color: #f8fafc !important; }
html[data-theme="dark"] .fc .pm-cal-project-status-1 { background-color: #334155 !important; border-color: #64748b !important; color: #f8fafc !important; }
html[data-theme="dark"] .fc .pm-cal-project-status-2 { background-color: #0f6f8f !important; border-color: #0891b2 !important; color: #ecfeff !important; }
html[data-theme="dark"] .fc .pm-cal-project-status-3 { background-color: #9f3a3a !important; border-color: #dc2626 !important; color: #fff1f2 !important; }
html[data-theme="dark"] .fc .pm-cal-project-status-4 { background-color: #1f6f46 !important; border-color: #2f9f68 !important; color: #ecfdf5 !important; }

html[data-theme="dark"] .fc .pm-cal-event .fc-event-main,
html[data-theme="dark"] .fc .pm-cal-event .fc-event-title,
html[data-theme="dark"] .fc .pm-cal-event .fc-event-time {
    color: inherit !important;
}

html[data-theme="dark"] .fc .pm-cal-event .fc-daygrid-event-dot,
html[data-theme="dark"] .fc .pm-cal-event .fc-list-event-dot {
    border-color: currentColor !important;
}

/* Bootstrap popovers used by FullCalendar event hover details are appended to body */
html[data-theme="dark"] .popover,
html[data-theme="dark"] .popover-header,
html[data-theme="dark"] .popover-body {
    background-color: var(--pm-surface) !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .popover-header {
    border-bottom-color: var(--pm-border) !important;
}

html[data-theme="dark"] .popover a,
html[data-theme="dark"] .popover .popover-body a {
    color: #93c5fd !important;
}

html[data-theme="dark"] .bs-popover-top > .arrow::after,
html[data-theme="dark"] .bs-popover-auto[x-placement^="top"] > .arrow::after {
    border-top-color: var(--pm-surface) !important;
}

html[data-theme="dark"] .bs-popover-right > .arrow::after,
html[data-theme="dark"] .bs-popover-auto[x-placement^="right"] > .arrow::after {
    border-right-color: var(--pm-surface) !important;
}

html[data-theme="dark"] .bs-popover-bottom > .arrow::after,
html[data-theme="dark"] .bs-popover-auto[x-placement^="bottom"] > .arrow::after {
    border-bottom-color: var(--pm-surface) !important;
}

html[data-theme="dark"] .bs-popover-left > .arrow::after,
html[data-theme="dark"] .bs-popover-auto[x-placement^="left"] > .arrow::after {
    border-left-color: var(--pm-surface) !important;
}

html[data-theme="dark"] .bootstrap-table .fixed-table-container .table tbody tr.selected td {
    background-color: #1e3a2f !important;
    color: #d1fae5 !important;
}

/* preserve Bootstrap contextual table rows in dark mode */
html[data-theme="dark"] .table tbody tr.table-primary,
html[data-theme="dark"] .table tbody tr.table-primary > th,
html[data-theme="dark"] .table tbody tr.table-primary > td,
html[data-theme="dark"] .table tbody th.table-primary,
html[data-theme="dark"] .table tbody td.table-primary {
    background-color: #1e3a5f !important;
    color: #dbeafe !important;
}

html[data-theme="dark"] .table tbody tr.table-secondary,
html[data-theme="dark"] .table tbody tr.table-secondary > th,
html[data-theme="dark"] .table tbody tr.table-secondary > td,
html[data-theme="dark"] .table tbody th.table-secondary,
html[data-theme="dark"] .table tbody td.table-secondary {
    background-color: #374151 !important;
    color: #e5e7eb !important;
}

html[data-theme="dark"] .table tbody tr.table-success,
html[data-theme="dark"] .table tbody tr.table-success > th,
html[data-theme="dark"] .table tbody tr.table-success > td,
html[data-theme="dark"] .table tbody th.table-success,
html[data-theme="dark"] .table tbody td.table-success {
    background-color: #14532d !important;
    color: #dcfce7 !important;
}

html[data-theme="dark"] .table tbody tr.table-danger,
html[data-theme="dark"] .table tbody tr.table-danger > th,
html[data-theme="dark"] .table tbody tr.table-danger > td,
html[data-theme="dark"] .table tbody th.table-danger,
html[data-theme="dark"] .table tbody td.table-danger {
    background-color: #5f1f2a !important;
    color: #fee2e2 !important;
}

html[data-theme="dark"] .table tbody tr.table-warning,
html[data-theme="dark"] .table tbody tr.table-warning > th,
html[data-theme="dark"] .table tbody tr.table-warning > td,
html[data-theme="dark"] .table tbody th.table-warning,
html[data-theme="dark"] .table tbody td.table-warning {
    background-color: #5f4316 !important;
    color: #fef3c7 !important;
}

html[data-theme="dark"] .table tbody tr.table-info,
html[data-theme="dark"] .table tbody tr.table-info > th,
html[data-theme="dark"] .table tbody tr.table-info > td,
html[data-theme="dark"] .table tbody th.table-info,
html[data-theme="dark"] .table tbody td.table-info {
    background-color: #164e63 !important;
    color: #cffafe !important;
}

html[data-theme="dark"] .table tbody tr.table-light,
html[data-theme="dark"] .table tbody tr.table-light > th,
html[data-theme="dark"] .table tbody tr.table-light > td,
html[data-theme="dark"] .table tbody th.table-light,
html[data-theme="dark"] .table tbody td.table-light {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .table tbody tr.table-dark,
html[data-theme="dark"] .table tbody tr.table-dark > th,
html[data-theme="dark"] .table tbody tr.table-dark > td,
html[data-theme="dark"] .table tbody th.table-dark,
html[data-theme="dark"] .table tbody td.table-dark {
    background-color: #020617 !important;
    color: #e5e7eb !important;
}

html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .btn {
    color: var(--pm-text);
}

/* Bootstrap tabs/pills */
.nav-tabs .nav-item.show .nav-link:not([class*="btn-"]),
.nav-tabs .nav-link.active:not([class*="btn-"]) {
    border-bottom-color: transparent !important;
    position: relative;
}

.nav-tabs .nav-item.show .nav-link:not([class*="btn-"])::after,
.nav-tabs .nav-link.active:not([class*="btn-"])::after {
    background-color: #fff;
    bottom: -1px;
    content: "";
    height: 1px;
    left: 0;
    position: absolute;
    right: 0;
}

@media (min-width: 768px) {
    .nav-tabs.nav-justified {
        flex-wrap: nowrap;
    }

    .nav-tabs.nav-justified .nav-item {
        min-width: 0;
    }

    .nav-tabs .nav-link:not([class*="btn-"]) {
        align-items: center;
        display: flex;
        min-width: 0;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        white-space: nowrap;
    }

    .nav-tabs .nav-link:not([class*="btn-"]) > i {
        flex: 0 0 auto;
    }

    .nav-tabs .nav-link:not([class*="btn-"]) > span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

html[data-theme="dark"] .nav-tabs {
    border-bottom-color: var(--pm-border) !important;
}

html[data-theme="dark"] .nav-tabs .nav-link,
html[data-theme="dark"] .nav-pills .nav-link,
html[data-theme="dark"] .tabbable .nav-link {
    background-color: #1f2937 !important;
    color: #9ca3af !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .nav-tabs .nav-link:hover,
html[data-theme="dark"] .nav-tabs .nav-link:focus,
html[data-theme="dark"] .nav-pills .nav-link:hover,
html[data-theme="dark"] .nav-pills .nav-link:focus,
html[data-theme="dark"] .tabbable .nav-link:hover,
html[data-theme="dark"] .tabbable .nav-link:focus {
    background-color: #273449 !important;
    color: #f3f4f6 !important;
    border-color: #4b5563 !important;
}

html[data-theme="dark"] .nav-tabs .nav-link.active,
html[data-theme="dark"] .nav-tabs .nav-item.show .nav-link,
html[data-theme="dark"] .nav-pills .nav-link.active,
html[data-theme="dark"] .nav-pills .show > .nav-link,
html[data-theme="dark"] .tabbable .nav-link.active {
    background-color: var(--pm-surface) !important;
    color: #e5e7eb !important;
    border-top-color: inherit !important;
    border-right-color: var(--pm-border) !important;
    border-bottom-color: transparent !important;
    border-left-color: var(--pm-border) !important;
}

html[data-theme="dark"] .nav-tabs .nav-item.show .nav-link:not([class*="btn-"])::after,
html[data-theme="dark"] .nav-tabs .nav-link.active:not([class*="btn-"])::after {
    background-color: var(--pm-surface);
}

html[data-theme="dark"] .tab-content,
html[data-theme="dark"] .tab-pane {
    background-color: var(--pm-surface) !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

/* top header icon hover/active states */
html[data-theme="dark"] .navbar .nav.has-active-border .nav-link:hover,
html[data-theme="dark"] .navbar .nav.has-active-border .nav-item:hover > .nav-link,
html[data-theme="dark"] .navbar .nav.has-active-border .nav-item.active > .nav-link,
html[data-theme="dark"] .navbar .nav.has-active-border .nav-link:focus {
    background-color: #0f172a !important;
    color: var(--pm-text) !important;
}

/* keep top header dropdown buttons dark after interacting with their dropdown content */
html[data-theme="dark"] .navbar #navIcons > .nav-item.show > .nav-link,
html[data-theme="dark"] .navbar #navIcons > .nav-item.open > .nav-link,
html[data-theme="dark"] .navbar #navIcons > .nav-item > .nav-link[aria-expanded="true"],
html[data-theme="dark"] .navbar #navIcons > .nav-item > .nav-link:hover,
html[data-theme="dark"] .navbar #navIcons > .nav-item > .nav-link:focus,
html[data-theme="dark"] .navbar #navIcons > .nav-item > .nav-link:active {
    background-color: #0f172a !important;
    color: var(--pm-text) !important;
}

html[data-theme="dark"] .navbar #navIcons > .nav-item.show > .nav-link::before,
html[data-theme="dark"] .navbar #navIcons > .nav-item.open > .nav-link::before,
html[data-theme="dark"] .navbar #navIcons > .nav-item > .nav-link[aria-expanded="true"]::before {
    background-color: #60a5fa !important;
}

.btn-burger [data-sidebar-toggle-icon] {
    color: inherit;
    line-height: 1;
    transition: color .15s ease;
}

.navbar-white2 .btn.btn-burger,
.navbar-white2 button.btn-burger {
    color: #586a84 !important;
}

.navbar-white2 .btn.btn-burger:hover,
.navbar-white2 .btn.btn-burger:focus,
.navbar-white2 .btn.btn-burger:active,
.navbar-white2 .btn.btn-burger.btn-h-light-primary:hover,
.navbar-white2 .btn.btn-burger.btn-h-light-primary:focus,
.navbar-white2 .btn.btn-burger.btn-h-light-primary:active,
.navbar-white2 button.btn-burger:hover,
.navbar-white2 button.btn-burger:focus,
.navbar-white2 button.btn-burger:active,
.navbar-white2 button.btn-burger.btn-h-light-primary:hover,
.navbar-white2 button.btn-burger.btn-h-light-primary:focus,
.navbar-white2 button.btn-burger.btn-h-light-primary:active {
    color: #4f6078 !important;
}

html[data-theme="dark"] .navbar-white2 .btn.btn-burger,
html[data-theme="dark"] .navbar-white2 button.btn-burger {
    color: #617694 !important;
}

html[data-theme="dark"] .navbar-white2 .btn.btn-burger:hover,
html[data-theme="dark"] .navbar-white2 .btn.btn-burger:focus,
html[data-theme="dark"] .navbar-white2 .btn.btn-burger:active,
html[data-theme="dark"] .navbar-white2 .btn.btn-burger.btn-h-light-primary:hover,
html[data-theme="dark"] .navbar-white2 .btn.btn-burger.btn-h-light-primary:focus,
html[data-theme="dark"] .navbar-white2 .btn.btn-burger.btn-h-light-primary:active,
html[data-theme="dark"] .navbar-white2 button.btn-burger:hover,
html[data-theme="dark"] .navbar-white2 button.btn-burger:focus,
html[data-theme="dark"] .navbar-white2 button.btn-burger:active,
html[data-theme="dark"] .navbar-white2 button.btn-burger.btn-h-light-primary:hover,
html[data-theme="dark"] .navbar-white2 button.btn-burger.btn-h-light-primary:focus,
html[data-theme="dark"] .navbar-white2 button.btn-burger.btn-h-light-primary:active {
    color: #586a84 !important;
}

/* sidebar toggle should not flash white/light on hover in dark mode */
html[data-theme="dark"] .btn.btn-burger,
html[data-theme="dark"] button.btn-burger {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--pm-text) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .btn.btn-burger:hover,
html[data-theme="dark"] .btn.btn-burger:focus,
html[data-theme="dark"] .btn.btn-burger:active,
html[data-theme="dark"] .btn.btn-burger.btn-h-light-primary:hover,
html[data-theme="dark"] .btn.btn-burger.btn-h-light-primary:focus,
html[data-theme="dark"] .btn.btn-burger.btn-h-light-primary:active,
html[data-theme="dark"] button.btn-burger:hover,
html[data-theme="dark"] button.btn-burger:focus,
html[data-theme="dark"] button.btn-burger:active,
html[data-theme="dark"] button.btn-burger.btn-h-light-primary:hover,
html[data-theme="dark"] button.btn-burger.btn-h-light-primary:focus,
html[data-theme="dark"] button.btn-burger.btn-h-light-primary:active {
    background: #0f172a !important;
    background-color: #0f172a !important;
    background-image: none !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] button.btn-burger .bars,
html[data-theme="dark"] button.btn-burger .bars::before,
html[data-theme="dark"] button.btn-burger .bars::after,
html[data-theme="dark"] .btn.btn-burger .bars,
html[data-theme="dark"] .btn.btn-burger .bars::before,
html[data-theme="dark"] .btn.btn-burger .bars::after {
    background-color: #cbd5e1 !important;
}

html[data-theme="dark"] button.btn-burger [data-sidebar-toggle-icon],
html[data-theme="dark"] .btn.btn-burger [data-sidebar-toggle-icon] {
    color: inherit !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-body,
html[data-theme="dark"] .card-footer {
    background-color: var(--pm-surface) !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .card-header .btn.bg-white,
html[data-theme="dark"] .card-header .btn.bgc-white,
html[data-theme="dark"] .card-header .btn[class*="btn-light"],
html[data-theme="dark"] .card-header .card-toolbar-btn,
html[data-theme="dark"] .card-toolbar .btn.bg-white,
html[data-theme="dark"] .card-toolbar .btn.bgc-white,
html[data-theme="dark"] .card-toolbar .btn[class*="btn-light"],
html[data-theme="dark"] .card-toolbar-btn[class*="btn-light"] {
    background-color: #273449 !important;
    color: #d8e0ea !important;
    border-color: #4b5563 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .btn-lighter-default,
html[data-theme="dark"] .btn-h-lighter-default:hover,
html[data-theme="dark"] .btn-h-lighter-default[class*="btn-lighter-"]:hover,
html[data-theme="dark"] .show > .btn.btn-a-lighter-default.dropdown-toggle,
html[data-theme="dark"] .btn-a-lighter-default:not(:disabled):not(.disabled):active,
html[data-theme="dark"] .btn-a-lighter-default:not(:disabled):not(.disabled).active {
    background-color: #273449 !important;
    color: #d8e0ea !important;
    border-color: #4b5563 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .btn-success,
html[data-theme="dark"] .btn-success:hover,
html[data-theme="dark"] .btn-success:focus,
html[data-theme="dark"] .btn-success.focus,
html[data-theme="dark"] .show > .btn.btn-success.dropdown-toggle,
html[data-theme="dark"] .btn-success:not(:disabled):not(.disabled):active,
html[data-theme="dark"] .btn-success:not(:disabled):not(.disabled).active,
html[data-theme="dark"] .btn-success.disabled,
html[data-theme="dark"] .btn-success:disabled,
html[data-theme="dark"] a.btn.btn-success,
html[data-theme="dark"] a.btn.btn-success:hover,
html[data-theme="dark"] a.btn.btn-success:focus,
html[data-theme="dark"] a.btn.btn-success:active,
html[data-theme="dark"] a.btn.btn-success.active,
html[data-theme="dark"] .btn-danger,
html[data-theme="dark"] .btn-danger:hover,
html[data-theme="dark"] .btn-danger:focus,
html[data-theme="dark"] .btn-danger.focus,
html[data-theme="dark"] .show > .btn.btn-danger.dropdown-toggle,
html[data-theme="dark"] .btn-danger:not(:disabled):not(.disabled):active,
html[data-theme="dark"] .btn-danger:not(:disabled):not(.disabled).active,
html[data-theme="dark"] .btn-danger.disabled,
html[data-theme="dark"] .btn-danger:disabled,
html[data-theme="dark"] a.btn.btn-danger,
html[data-theme="dark"] a.btn.btn-danger:hover,
html[data-theme="dark"] a.btn.btn-danger:focus,
html[data-theme="dark"] a.btn.btn-danger:active,
html[data-theme="dark"] a.btn.btn-danger.active {
    color: #fff !important;
}

html[data-theme="dark"] .btn-success i,
html[data-theme="dark"] .btn-danger i {
    color: #fff !important;
}

html[data-theme="dark"] .btn-orange,
html[data-theme="dark"] .btn-orange:hover,
html[data-theme="dark"] .btn-orange:focus,
html[data-theme="dark"] .btn-orange.focus,
html[data-theme="dark"] .show > .btn.btn-orange.dropdown-toggle,
html[data-theme="dark"] .btn-orange:not(:disabled):not(.disabled):active,
html[data-theme="dark"] .btn-orange:not(:disabled):not(.disabled).active,
html[data-theme="dark"] .btn-orange.disabled,
html[data-theme="dark"] .btn-orange:disabled,
html[data-theme="dark"] a.btn.btn-orange,
html[data-theme="dark"] a.btn.btn-orange:hover,
html[data-theme="dark"] a.btn.btn-orange:focus,
html[data-theme="dark"] a.btn.btn-orange:active,
html[data-theme="dark"] a.btn.btn-orange.active,
html[data-theme="dark"] .btn-warning,
html[data-theme="dark"] .btn-warning:hover,
html[data-theme="dark"] .btn-warning:focus,
html[data-theme="dark"] .btn-warning.focus,
html[data-theme="dark"] .show > .btn.btn-warning.dropdown-toggle,
html[data-theme="dark"] .btn-warning:not(:disabled):not(.disabled):active,
html[data-theme="dark"] .btn-warning:not(:disabled):not(.disabled).active,
html[data-theme="dark"] .btn-warning.disabled,
html[data-theme="dark"] .btn-warning:disabled,
html[data-theme="dark"] a.btn.btn-warning,
html[data-theme="dark"] a.btn.btn-warning:hover,
html[data-theme="dark"] a.btn.btn-warning:focus,
html[data-theme="dark"] a.btn.btn-warning:active,
html[data-theme="dark"] a.btn.btn-warning.active {
    color: #111827 !important;
}

html[data-theme="dark"] .btn-orange i,
html[data-theme="dark"] .btn-orange .text-white,
html[data-theme="dark"] .btn-orange .text-white-tp1,
html[data-theme="dark"] .btn-warning i,
html[data-theme="dark"] .btn-warning .text-white,
html[data-theme="dark"] .btn-warning .text-white-tp1 {
    color: #111827 !important;
}

/* btn-outline-light is too stark in dark mode; keep it subdued on hover/focus too */
html[data-theme="dark"] .btn-outline-light,
html[data-theme="dark"] a.btn-outline-light {
    background-color: transparent !important;
    color: #cbd5e1 !important;
    border-color: #4b5563 !important;
}

html[data-theme="dark"] .btn-outline-light:hover,
html[data-theme="dark"] .btn-outline-light:focus,
html[data-theme="dark"] .btn-outline-light:active,
html[data-theme="dark"] .btn-outline-light.active,
html[data-theme="dark"] a.btn-outline-light:hover,
html[data-theme="dark"] a.btn-outline-light:focus,
html[data-theme="dark"] a.btn-outline-light:active,
html[data-theme="dark"] a.btn-outline-light.active,
html[data-theme="dark"] .show > .btn-outline-light.dropdown-toggle {
    background-color: #273449 !important;
    color: #f3f4f6 !important;
    border-color: #64748b !important;
    box-shadow: none !important;
}

/* main action button icon blocks should stay visibly lighter than the button in dark mode */
html[data-theme="dark"] .btn-bold > .bgc-white-tp9,
html[data-theme="dark"] .btn-bold > span.bgc-white-tp9 {
    background-color: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-orange.btn-bold > .bgc-white-tp9,
html[data-theme="dark"] .btn-orange.btn-bold > span.bgc-white-tp9,
html[data-theme="dark"] .btn-warning.btn-bold > .bgc-white-tp9,
html[data-theme="dark"] .btn-warning.btn-bold > span.bgc-white-tp9 {
    background-color: rgba(17, 24, 39, 0.14) !important;
    color: #111827 !important;
}

html[data-theme="dark"] .card-header .btn.bg-white:hover,
html[data-theme="dark"] .card-header .btn.bg-white:focus,
html[data-theme="dark"] .card-header .btn.bgc-white:hover,
html[data-theme="dark"] .card-header .btn.bgc-white:focus,
html[data-theme="dark"] .card-header .btn[class*="btn-light"]:hover,
html[data-theme="dark"] .card-header .btn[class*="btn-light"]:focus,
html[data-theme="dark"] .card-header .card-toolbar-btn:hover,
html[data-theme="dark"] .card-header .card-toolbar-btn:focus,
html[data-theme="dark"] .card-toolbar .btn.bg-white:hover,
html[data-theme="dark"] .card-toolbar .btn.bg-white:focus,
html[data-theme="dark"] .card-toolbar .btn.bgc-white:hover,
html[data-theme="dark"] .card-toolbar .btn.bgc-white:focus,
html[data-theme="dark"] .card-toolbar .btn[class*="btn-light"]:hover,
html[data-theme="dark"] .card-toolbar .btn[class*="btn-light"]:focus,
html[data-theme="dark"] .card-toolbar-btn[class*="btn-light"]:hover,
html[data-theme="dark"] .card-toolbar-btn[class*="btn-light"]:focus {
    background-color: #334155 !important;
    color: #f3f4f6 !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] .card .card-title,
html[data-theme="dark"] .card-header .card-title,
html[data-theme="dark"] .bcard .card-title,
html[data-theme="dark"] .ccard > .card-header > .card-title,
html[data-theme="dark"] .dcard > .card-header > .card-title,
html[data-theme="dark"] .acard > .card-header .card-title,
html[data-theme="dark"] .modal-header .modal-title,
html[data-theme="dark"] .modal-title {
    color: #9ca3af !important;
}

/* view invoice: match main invoice detail text to the main card title colour in dark mode */
html[data-theme="dark"] #invoiceDetailsCard .text-dark-l1,
html[data-theme="dark"] #invoiceDetailsCard .text-grey-m1,
html[data-theme="dark"] #invoiceDetailsCard .text-secondary-d3 {
    color: #9ca3af !important;
}

/* Bootstrap/Ace alerts */
html[data-theme="dark"] .alert,
html[data-theme="dark"] [class*="alert-"] {
    background-color: #1f2937 !important;
    color: #b6c2cf !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .alert.brc-danger.border-t-4,
html[data-theme="dark"] .alert.brc-danger[class*="border-t-"] {
    border-top-color: #e53935 !important;
}

html[data-theme="dark"] .alert.brc-warning.border-t-4,
html[data-theme="dark"] .alert.brc-warning[class*="border-t-"] {
    border-top-color: #ffc107 !important;
}

html[data-theme="dark"] .alert.bgc-secondary-l3,
html[data-theme="dark"] div.alert.bgc-secondary-l3 {
    background-color: #273449 !important;
    color: #d8e0ea !important;
    border-color: #4b5563 !important;
}

html[data-theme="dark"] .alert-heading,
html[data-theme="dark"] .alert .alert-heading,
html[data-theme="dark"] .alert strong,
html[data-theme="dark"] .alert b {
    color: #d8e0ea !important;
}

html[data-theme="dark"] .alert a,
html[data-theme="dark"] .alert .alert-link {
    color: #93c5fd !important;
}

html[data-theme="dark"] .alert hr {
    border-top-color: var(--pm-border) !important;
}

html[data-theme="dark"] .alert .close,
html[data-theme="dark"] .alert button.close {
    color: #cbd5e1 !important;
    text-shadow: none !important;
    opacity: 0.75 !important;
}

html[data-theme="dark"] .alert .close:hover,
html[data-theme="dark"] .alert button.close:hover,
html[data-theme="dark"] .alert .close:focus,
html[data-theme="dark"] .alert button.close:focus {
    color: #f3f4f6 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .alert-primary { background-color: #1e3a5f !important; color: #dbeafe !important; border-color: #2563eb !important; }
html[data-theme="dark"] .alert-secondary { background-color: #374151 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .alert-success { background-color: #14532d !important; color: #dcfce7 !important; }
html[data-theme="dark"] .alert-danger { background-color: #5f1f2a !important; color: #fee2e2 !important; }
html[data-theme="dark"] .alert-warning { background-color: #5f4316 !important; color: #fef3c7 !important; }
html[data-theme="dark"] .alert-info { background-color: #164e63 !important; color: #cffafe !important; }
html[data-theme="dark"] .alert-light { background-color: #334155 !important; color: #f1f5f9 !important; }
html[data-theme="dark"] .alert-dark { background-color: #020617 !important; color: #e5e7eb !important; }

/* SweetAlert2 dialogs */
html[data-theme="dark"] .swal2-popup {
    background-color: var(--pm-surface) !important;
    color: var(--pm-text) !important;
    border: 1px solid var(--pm-border) !important;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .swal2-title,
html[data-theme="dark"] .swal2-html-container,
html[data-theme="dark"] .swal2-content,
html[data-theme="dark"] .swal2-footer {
    color: var(--pm-text) !important;
}

html[data-theme="dark"] .swal2-close {
    color: var(--pm-text-muted) !important;
}

html[data-theme="dark"] .swal2-close:hover,
html[data-theme="dark"] .swal2-close:focus {
    color: var(--pm-text) !important;
}

html[data-theme="dark"] .swal2-input,
html[data-theme="dark"] .swal2-file,
html[data-theme="dark"] .swal2-textarea,
html[data-theme="dark"] .swal2-select {
    background-color: #0f172a !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .swal2-validation-message {
    background-color: #111827 !important;
    color: var(--pm-text) !important;
}

html[data-theme="dark"] .swal2-loader {
    border-color: #60a5fa transparent #60a5fa transparent !important;
}

/* ace toaster/showMessage notifications */
html[data-theme="dark"] .ace-toaster-container .toast,
html[data-theme="dark"] .ace-toaster-container .toast .toast-body,
html[data-theme="dark"] .ace-toaster-container .toast .toast-main,
html[data-theme="dark"] .ace-toaster-container .toast [class*="text-dark"] {
    background-color: var(--pm-surface) !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .ace-toaster-container .toast h4,
html[data-theme="dark"] .ace-toaster-container .toast .toast-title {
    color: var(--pm-text) !important;
}

html[data-theme="dark"] .ace-toaster-container .toast .btn,
html[data-theme="dark"] .ace-toaster-container .toast button[data-dismiss="toast"] {
    color: var(--pm-text-muted) !important;
}

html[data-theme="dark"] .ace-toaster-container .toast .btn:hover,
html[data-theme="dark"] .ace-toaster-container .toast button[data-dismiss="toast"]:hover {
    color: var(--pm-text) !important;
}

/* ace "bcard" blocks are used for dashboard summary tiles (not always .card) */
html[data-theme="dark"] .bcard,
html[data-theme="dark"] .bcard .card-header,
html[data-theme="dark"] .bcard .card-body,
html[data-theme="dark"] .bcard .card-footer {
    background-color: var(--pm-surface) !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .card-img-top[src*="/Assets/image/integrations/"] {
    filter: brightness(0.72) saturate(0.9);
}

/* dashboard tile text contrast - keep the top stats cards softer in dark mode */
html[data-theme="dark"] .bcard .text-dark-tp3,
html[data-theme="dark"] .bcard .text-dark-tp3 a {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .bcard .text-dark-tp4 {
    color: #8b98a8 !important;
}

html[data-theme="dark"] .bcard .text-dark {
    color: var(--pm-text) !important;
}

/* soften the pale icon rings on dashboard stats cards in dark mode */
html[data-theme="dark"] .bcard .border-4.brc-orange-l2 {
    border-color: rgba(194, 103, 0, 0.35) !important;
}

html[data-theme="dark"] .bcard .border-4.brc-success-l2 {
    border-color: rgba(56, 142, 60, 0.35) !important;
}

html[data-theme="dark"] .bcard .border-4.brc-danger-l2 {
    border-color: rgba(198, 40, 40, 0.35) !important;
}

html[data-theme="dark"] .bcard .border-4.brc-info-l2 {
    border-color: rgba(2, 136, 209, 0.35) !important;
}

html[data-theme="dark"] .bcard .border-4 > i.text-white {
    color: #d8e0ea !important;
}

/* decorative bottom-right circles on dashboard tiles should match the dark theme */
html[data-theme="dark"] .bcard .bgc-orange-l1,
html[data-theme="dark"] .bcard .bgc-primary-l1,
html[data-theme="dark"] .bcard .bgc-success-l1,
html[data-theme="dark"] .bcard .bgc-danger-l1,
html[data-theme="dark"] .bcard .bgc-info-l1,
html[data-theme="dark"] .bcard .bgc-yellow-l1,
html[data-theme="dark"] .bcard .bgc-pink-l1 {
    background-color: #2f5f94 !important;
    filter: none !important;
}

html[data-theme="dark"] .bcard .bgc-orange-l2,
html[data-theme="dark"] .bcard .bgc-primary-l2,
html[data-theme="dark"] .bcard .bgc-success-l2,
html[data-theme="dark"] .bcard .bgc-danger-l2,
html[data-theme="dark"] .bcard .bgc-info-l2,
html[data-theme="dark"] .bcard .bgc-yellow-l2,
html[data-theme="dark"] .bcard .bgc-pink-l2 {
    background-color: #28507d !important;
    filter: none !important;
}

html[data-theme="dark"] .bcard .bgc-orange-l3,
html[data-theme="dark"] .bcard .bgc-primary-l3,
html[data-theme="dark"] .bcard .bgc-success-l3,
html[data-theme="dark"] .bcard .bgc-danger-l3,
html[data-theme="dark"] .bcard .bgc-info-l3,
html[data-theme="dark"] .bcard .bgc-yellow-l3,
html[data-theme="dark"] .bcard .bgc-pink-l3 {
    background-color: #1e3a5f !important;
    filter: none !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .custom-select {
    background-color: #0f172a;
    color: var(--pm-text);
    border-color: var(--pm-border);
}

html[data-theme="dark"] fieldset {
    border-color: #2f3a4b !important;
}

html[data-theme="dark"] fieldset legend {
    color: #cbd5e1;
}

html[data-theme="dark"] select.form-control option,
html[data-theme="dark"] select.custom-select option {
    background-color: #0f172a;
    color: var(--pm-text);
}

html[data-theme="dark"] select.form-control option:checked,
html[data-theme="dark"] select.form-control option:hover,
html[data-theme="dark"] select.form-control option:focus,
html[data-theme="dark"] select.custom-select option:checked,
html[data-theme="dark"] select.custom-select option:hover,
html[data-theme="dark"] select.custom-select option:focus {
    background-color: #273449 !important;
    color: #f3f4f6 !important;
    box-shadow: 0 0 0 100vmax #273449 inset !important;
}

html[data-theme="dark"] .form-control-plaintext,
html[data-theme="dark"] input.form-control-plaintext,
html[data-theme="dark"] textarea.form-control-plaintext {
    color: var(--pm-text) !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] .text-dark-tp4,
html[data-theme="dark"][data-theme-mode="system-only"] .text-dark-tp3,
html[data-theme="dark"][data-theme-mode="system-only"] .text-dark-l1 {
    color: #dbe6f3 !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] .input-floating-label .floating-label {
    background-color: #0f172a !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] .input-floating-label[class*="text-"] input:focus ~ .floating-label {
    color: #93c5fd !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] .border-b-1.brc-secondary-l2,
html[data-theme="dark"][data-theme-mode="system-only"] .border-b-1.brc-grey-l2 {
    border-bottom-color: #475569 !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] #id-tab-forgot hr.brc-default-l2 {
    border-color: #475569 !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] #id-tab-forgot .text-secondary-d3 {
    color: #cbd5e1 !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] #id-col-intro {
    border-right-color: #334155 !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] #id-col-intro .bgc-blue-l4 {
    background-color: #172338 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] #id-col-intro .text-primary-d1,
html[data-theme="dark"][data-theme-mode="system-only"] .d-lg-none .text-blue-d1 {
    color: #60a5fa !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] #id-col-intro .text-dark-l1,
html[data-theme="dark"][data-theme-mode="system-only"] #id-col-intro .text-dark-tp2,
html[data-theme="dark"][data-theme-mode="system-only"] #id-col-intro .text-dark-tp3 {
    color: #cbd5e1 !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] #id-col-intro hr.brc-black-tp10 {
    border-color: #475569 !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] #id-col-intro a,
html[data-theme="dark"][data-theme-mode="system-only"] #id-col-intro a.text-primary-m1 {
    color: #93c5fd !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] #id-tab-forgot .btn-orange {
    background-color: #2f8ed8 !important;
    border-color: #2f8ed8 !important;
    color: #fff !important;
}

html[data-theme="dark"][data-theme-mode="system-only"] #id-tab-forgot .btn-orange:hover,
html[data-theme="dark"][data-theme-mode="system-only"] #id-tab-forgot .btn-orange:focus,
html[data-theme="dark"][data-theme-mode="system-only"] #id-tab-forgot .btn-orange:active {
    background-color: #257cc0 !important;
    border-color: #257cc0 !important;
    color: #fff !important;
}

/* Bootstrap custom checkboxes/radios */
html[data-theme="dark"] .form-check-input,
html[data-theme="dark"] input.form-check-input,
html[data-theme="dark"] .form-check-input input[type="checkbox"],
html[data-theme="dark"] .form-check-input input[type="radio"],
html[data-theme="dark"] span.form-check-input > input[type="checkbox"],
html[data-theme="dark"] span.form-check-input > input[type="radio"],
html[data-theme="dark"] .custom-control-input ~ .custom-control-label::before,
html[data-theme="dark"] .custom-checkbox .custom-control-label::before,
html[data-theme="dark"] .custom-radio .custom-control-label::before {
    background-color: #0f172a !important;
    border-color: var(--pm-border) !important;
    accent-color: auto;
}

/* ASP.NET CheckBox controls render CssClass on a wrapper span, with the real checkbox inside */
html[data-theme="dark"] span.form-check-input {
    background-color: transparent !important;
    border-color: transparent !important;
}

html[data-theme="dark"] .form-check-input:checked,
html[data-theme="dark"] input.form-check-input:checked,
html[data-theme="dark"] .form-check-input input[type="checkbox"]:checked,
html[data-theme="dark"] .form-check-input input[type="radio"]:checked,
html[data-theme="dark"] span.form-check-input > input[type="checkbox"]:checked,
html[data-theme="dark"] span.form-check-input > input[type="radio"]:checked,
html[data-theme="dark"] .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #0f172a !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .form-check-input:focus,
html[data-theme="dark"] input.form-check-input:focus,
html[data-theme="dark"] .form-check-input input[type="checkbox"]:focus,
html[data-theme="dark"] .form-check-input input[type="radio"]:focus,
html[data-theme="dark"] span.form-check-input > input[type="checkbox"]:focus,
html[data-theme="dark"] span.form-check-input > input[type="radio"]:focus,
html[data-theme="dark"] .custom-control-input:focus ~ .custom-control-label::before {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25) !important;
}

html[data-theme="dark"] .form-check-input:disabled,
html[data-theme="dark"] input.form-check-input:disabled,
html[data-theme="dark"] .form-check-input input[type="checkbox"]:disabled,
html[data-theme="dark"] .form-check-input input[type="radio"]:disabled,
html[data-theme="dark"] span.form-check-input > input[type="checkbox"]:disabled,
html[data-theme="dark"] span.form-check-input > input[type="radio"]:disabled,
html[data-theme="dark"] .custom-control-input:disabled ~ .custom-control-label::before {
    background-color: #111827 !important;
    border-color: #374151 !important;
    opacity: 0.65;
}

/* Bootstrap input groups */
html[data-theme="dark"] .input-group,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] .input-group-addon,
html[data-theme="dark"] .input-group-prepend,
html[data-theme="dark"] .input-group-append {
    background-color: #0f172a !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .input-group .form-control,
html[data-theme="dark"] .input-group .custom-select,
html[data-theme="dark"] .input-group .custom-file-label {
    background-color: #0f172a !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .input-group .custom-file-label::after {
    background-color: #1f2937 !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

/* TinyMCE editor */
html[data-theme="dark"] .tox-tinymce,
html[data-theme="dark"] .tox .tox-editor-container,
html[data-theme="dark"] .tox .tox-editor-header,
html[data-theme="dark"] .tox .tox-toolbar,
html[data-theme="dark"] .tox .tox-toolbar__primary,
html[data-theme="dark"] .tox .tox-toolbar__overflow,
html[data-theme="dark"] .tox .tox-statusbar,
html[data-theme="dark"] .tox .tox-menubar {
    background-color: #1f2937 !important;
    border-color: var(--pm-border) !important;
    color: var(--pm-text) !important;
}

html[data-theme="dark"] .tox-tinymce {
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .tox .tox-edit-area,
html[data-theme="dark"] .tox .tox-edit-area__iframe {
    background-color: #0f172a !important;
    color-scheme: dark;
}

html[data-theme="dark"] .tox .tox-tbtn,
html[data-theme="dark"] .tox .tox-mbtn,
html[data-theme="dark"] .tox .tox-statusbar__path-item,
html[data-theme="dark"] .tox .tox-statusbar__wordcount,
html[data-theme="dark"] .tox .tox-statusbar a,
html[data-theme="dark"] .tox .tox-statusbar__branding a {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .tox .tox-tbtn svg,
html[data-theme="dark"] .tox .tox-tbtn__icon-wrap svg {
    fill: #cbd5e1 !important;
}

html[data-theme="dark"] .tox .tox-tbtn:hover,
html[data-theme="dark"] .tox .tox-tbtn:focus,
html[data-theme="dark"] .tox .tox-tbtn--enabled,
html[data-theme="dark"] .tox .tox-mbtn:hover,
html[data-theme="dark"] .tox .tox-mbtn:focus,
html[data-theme="dark"] .tox .tox-mbtn--active {
    background-color: #273449 !important;
    color: #f3f4f6 !important;
}

html[data-theme="dark"] .tox .tox-tbtn:hover svg,
html[data-theme="dark"] .tox .tox-tbtn:focus svg,
html[data-theme="dark"] .tox .tox-tbtn--enabled svg {
    fill: #f3f4f6 !important;
}

html[data-theme="dark"] .tox .tox-toolbar__group {
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .tox .tox-collection,
html[data-theme="dark"] .tox .tox-menu,
html[data-theme="dark"] .tox .tox-pop,
html[data-theme="dark"] .tox .tox-dialog,
html[data-theme="dark"] .tox .tox-dialog__header,
html[data-theme="dark"] .tox .tox-dialog__body,
html[data-theme="dark"] .tox .tox-dialog__footer {
    background-color: #1f2937 !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .tox .tox-collection__item,
html[data-theme="dark"] .tox .tox-collection__item-label,
html[data-theme="dark"] .tox .tox-dialog__title,
html[data-theme="dark"] .tox .tox-label {
    color: var(--pm-text) !important;
}

html[data-theme="dark"] .tox .tox-collection__item--active,
html[data-theme="dark"] .tox .tox-collection__item:hover,
html[data-theme="dark"] .tox .tox-collection__item:focus {
    background-color: #273449 !important;
}

/* Chosen jQuery select controls */
html[data-theme="dark"] .chosen-container .chosen-single,
html[data-theme="dark"] .chosen-container-single .chosen-single,
html[data-theme="dark"] .chosen-container-active.chosen-with-drop .chosen-single,
html[data-theme="dark"] .chosen-container-multi .chosen-choices {
    background: #0f172a !important;
    background-color: #0f172a !important;
    background-image: none !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .chosen-container .chosen-single span,
html[data-theme="dark"] .chosen-container-single .chosen-single span,
html[data-theme="dark"] .chosen-container-single .chosen-default,
html[data-theme="dark"] .chosen-container-single .chosen-default span,
html[data-theme="dark"] .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
    color: var(--pm-text) !important;
}

html[data-theme="dark"] .chosen-container-single .chosen-single div b {
    background: none !important;
    position: relative;
}

html[data-theme="dark"] .chosen-container-single .chosen-single div b::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -25%);
    border-top: 0.35rem solid #9ca3af;
    border-right: 0.35rem solid transparent;
    border-left: 0.35rem solid transparent;
}

html[data-theme="dark"] .chosen-container-active.chosen-with-drop .chosen-single div b::before {
    transform: translate(-50%, -65%) rotate(180deg);
}

html[data-theme="dark"] .chosen-container .chosen-drop,
html[data-theme="dark"] .chosen-container-single .chosen-drop,
html[data-theme="dark"] .chosen-container-multi .chosen-drop,
html[data-theme="dark"] .chosen-container-single .chosen-search,
html[data-theme="dark"] .chosen-container .chosen-results {
    background: #0f172a !important;
    background-color: #0f172a !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .chosen-container-single .chosen-search input[type="text"] {
    background-color: #111827 !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .chosen-container .chosen-results li.active-result,
html[data-theme="dark"] .chosen-container .chosen-results li.group-result,
html[data-theme="dark"] .chosen-container-multi .chosen-drop .result-selected {
    color: #b6c2cf !important;
}

html[data-theme="dark"] .chosen-container .chosen-results li.highlighted {
    background: #273449 !important;
    background-color: #273449 !important;
    background-image: none !important;
    color: #f3f4f6 !important;
    filter: none !important;
}

html[data-theme="dark"] .chosen-container .chosen-results li.no-results,
html[data-theme="dark"] .chosen-container-multi .chosen-choices li.search-choice {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    background-image: none !important;
    color: #b6c2cf !important;
    border-color: var(--pm-border) !important;
    box-shadow: none !important;
}

/* bootstrap-table toolbar buttons should match the compact search input height */
.fixed-table-toolbar .btn,
.fixed-table-toolbar .dropdown-toggle,
.bootstrap-table .fixed-table-toolbar .btn,
.bootstrap-table .fixed-table-toolbar .dropdown-toggle {
    min-height: calc(1.5em + 0.5rem + 2px) !important;
    height: calc(1.5em + 0.5rem + 2px) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* bootstrap-table toolbar area above table headers */
html[data-theme="dark"] .fixed-table-toolbar,
html[data-theme="dark"] .fixed-table-toolbar .columns,
html[data-theme="dark"] .fixed-table-toolbar .search,
html[data-theme="dark"] .fixed-table-toolbar .float-right {
    background-color: var(--pm-surface) !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .fixed-table-toolbar .search-input,
html[data-theme="dark"] .fixed-table-toolbar input.form-control,
html[data-theme="dark"] .fixed-table-toolbar .btn,
html[data-theme="dark"] .fixed-table-toolbar .dropdown-toggle {
    background-color: #0f172a !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

/* breadcrumb bars */
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] ol.breadcrumb {
    background-color: var(--pm-surface) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] .breadcrumb-item,
html[data-theme="dark"] .breadcrumb-item a,
html[data-theme="dark"] .breadcrumb-item.active,
html[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: #9ca3af !important;
}

html[data-theme="dark"] #shorts.bgc-light {
    background-color: #273449 !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] #shorts.bgc-light label,
html[data-theme="dark"] #shorts.bgc-light .form-check-label,
html[data-theme="dark"] #shorts.bgc-light .custom-control-label {
    color: var(--pm-text) !important;
}

/* right hover shortcuts sidebar */
html[data-theme="dark"] #shortcutsSidebar .modal-content,
html[data-theme="dark"] #shortcutsSidebar .modal-body,
html[data-theme="dark"] #shortcutsSidebar .bgc-light {
    background-color: var(--pm-surface) !important;
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] #shortcutsSidebar .btn {
    color: var(--pm-text) !important;
    border-color: var(--pm-border) !important;
}

html[data-theme="dark"] #shortcutsSidebar a:hover,
html[data-theme="dark"] #shortcutsSidebar a:focus,
html[data-theme="dark"] #shortcutsSidebar .btn:hover,
html[data-theme="dark"] #shortcutsSidebar .btn:focus,
html[data-theme="dark"] #shortcutsSidebar [class*="btn-h-light"]:hover,
html[data-theme="dark"] #shortcutsSidebar [class*="btn-h-light"]:focus,
html[data-theme="dark"] #shortcutsSidebar [class*="bgc-h-white"]:hover,
html[data-theme="dark"] #shortcutsSidebar [class*="bgc-h-white"]:focus {
    background-color: #273449 !important;
    color: #f3f4f6 !important;
    border-color: #4b5563 !important;
}

/* project chat message bubbles */
html[data-theme="dark"] #chatModalBody .bgc-grey-l3 {
    background-color: #334155 !important;
    color: #e5e7eb !important;
}

html[data-theme="dark"] #chatModalBody .bgc-primary-l3 {
    background-color: #1e3a5f !important;
    color: #dbeafe !important;
}

html[data-theme="dark"] #chatModalBody .bgc-success-l3 {
    background-color: #1f4d3a !important;
    color: #dcfce7 !important;
}

html[data-theme="dark"] #chatModalBody .text-dark-m1 {
    color: inherit !important;
}

/* sidebar profile quick-action icons (under avatar/name) */
html[data-theme="dark"] .sidebar #id-user-menu .btn,
html[data-theme="dark"] .sidebar #id-user-menu .btn[class*="btn-light"],
html[data-theme="dark"] .sidebar #id-user-menu .btn[class*="btn-h-light"] {
    border-color: var(--pm-border) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .sidebar #id-user-menu .btn-light-grey,
html[data-theme="dark"] .sidebar #id-user-menu .btn-h-light-grey:hover,
html[data-theme="dark"] .sidebar #id-user-menu .btn-h-light-grey:focus {
    background-color: #253142 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .sidebar #id-user-menu .btn-light-green,
html[data-theme="dark"] .sidebar #id-user-menu .btn-h-light-green:hover,
html[data-theme="dark"] .sidebar #id-user-menu .btn-h-light-green:focus {
    background-color: #123d2d !important;
    border-color: #1f6f46 !important;
}

html[data-theme="dark"] .sidebar #id-user-menu .btn-light-blue,
html[data-theme="dark"] .sidebar #id-user-menu .btn-h-light-blue:hover,
html[data-theme="dark"] .sidebar #id-user-menu .btn-h-light-blue:focus {
    background-color: #12345a !important;
    border-color: #1d4f87 !important;
}

html[data-theme="dark"] .sidebar #id-user-menu .btn-light-red,
html[data-theme="dark"] .sidebar #id-user-menu .btn-h-light-red:hover,
html[data-theme="dark"] .sidebar #id-user-menu .btn-h-light-red:focus {
    background-color: #4a1f25 !important;
    border-color: #a83f3f !important;
}

/* preserve original coloured icon accents in quick-action buttons */
html[data-theme="dark"] .sidebar #id-user-menu .btn i.text-blue-d1 { color: #93c5fd !important; }
html[data-theme="dark"] .sidebar #id-user-menu .btn i.text-danger-d1 { color: #fca5a5 !important; }
html[data-theme="dark"] .sidebar #id-user-menu .btn i.text-white-d1 { color: #e5edf6 !important; }

/* first two quick-action icons use text-white-d1; restore their distinct accents */
html[data-theme="dark"] .sidebar #id-user-menu .btn.btn-light-grey i.text-white-d1,
html[data-theme="dark"] .sidebar #id-user-menu .btn.btn-h-light-grey i.text-white-d1 {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .sidebar #id-user-menu .btn.btn-light-green i.text-white-d1,
html[data-theme="dark"] .sidebar #id-user-menu .btn.btn-h-light-green i.text-white-d1 {
    color: #86efac !important;
}

/* non-sidebar slim scrollbars in dark mode (page, tables, cards, textareas, dropdowns, popovers) */
html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] .fixed-table-body,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .popover-body,
html[data-theme="dark"] .card,
html[data-theme="dark"] .card-body,
html[data-theme="dark"] .modal-body,
html[data-theme="dark"] .page-content,
html[data-theme="dark"] .main-content {
    scrollbar-color: #4b5563 #111827 !important;
}

html[data-theme="dark"] body::-webkit-scrollbar-track,
html[data-theme="dark"] .fixed-table-body::-webkit-scrollbar-track,
html[data-theme="dark"] textarea::-webkit-scrollbar-track,
html[data-theme="dark"] .dropdown-menu::-webkit-scrollbar-track,
html[data-theme="dark"] .popover-body::-webkit-scrollbar-track,
html[data-theme="dark"] .card::-webkit-scrollbar-track,
html[data-theme="dark"] .card-body::-webkit-scrollbar-track,
html[data-theme="dark"] .modal-body::-webkit-scrollbar-track,
html[data-theme="dark"] .page-content::-webkit-scrollbar-track,
html[data-theme="dark"] .main-content::-webkit-scrollbar-track {
    background-color: #111827 !important;
}

html[data-theme="dark"] body::-webkit-scrollbar-thumb,
html[data-theme="dark"] .fixed-table-body::-webkit-scrollbar-thumb,
html[data-theme="dark"] textarea::-webkit-scrollbar-thumb,
html[data-theme="dark"] .dropdown-menu::-webkit-scrollbar-thumb,
html[data-theme="dark"] .popover-body::-webkit-scrollbar-thumb,
html[data-theme="dark"] .card::-webkit-scrollbar-thumb,
html[data-theme="dark"] .card-body::-webkit-scrollbar-thumb,
html[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb,
html[data-theme="dark"] .page-content::-webkit-scrollbar-thumb,
html[data-theme="dark"] .main-content::-webkit-scrollbar-thumb {
    background-color: #4b5563 !important;
    border-radius: .25rem;
    border: 0 !important;
}

html[data-theme="dark"] body::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .fixed-table-body::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] textarea::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .dropdown-menu::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .popover-body::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .card::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .card-body::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .page-content::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .main-content::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280 !important;
}

/* slim custom scrollbar styling in dark mode */
html[data-theme="dark"] .ace-scroll,
html[data-theme="dark"] .ace-scrollbar {
    scrollbar-color: #4b5563 #1f2937 !important;
}

html[data-theme="dark"] .ace-scroll::-webkit-scrollbar-track,
html[data-theme="dark"] .ace-scrollbar::-webkit-scrollbar-track {
    background-color: #1f2937 !important;
    border-right-color: #1f2937 !important;
}

html[data-theme="dark"] .ace-scroll::-webkit-scrollbar-thumb,
html[data-theme="dark"] .ace-scrollbar::-webkit-scrollbar-thumb {
    background-color: #4b5563 !important;
    border-right-color: #1f2937 !important;
}

html[data-theme="dark"] .ace-scroll::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .ace-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280 !important;
}

/* force dark scrollbars inside sidebar theme variants that set light blue defaults */
html[data-theme="dark"] .sidebar .ace-scroll,
html[data-theme="dark"] .sidebar .ace-scrollbar,
html[data-theme="dark"] [class*="sidebar-"] .ace-scroll,
html[data-theme="dark"] [class*="sidebar-"] .ace-scrollbar {
    scrollbar-color: #4b5563 #1f2937 !important;
}

html[data-theme="dark"] .sidebar .ace-scroll::-webkit-scrollbar-track,
html[data-theme="dark"] .sidebar .ace-scrollbar::-webkit-scrollbar-track,
html[data-theme="dark"] [class*="sidebar-"] .ace-scroll::-webkit-scrollbar-track,
html[data-theme="dark"] [class*="sidebar-"] .ace-scrollbar::-webkit-scrollbar-track {
    background-color: #1f2937 !important;
    border-right: 1px solid #1f2937 !important;
}

html[data-theme="dark"] .sidebar .ace-scroll::-webkit-scrollbar-thumb,
html[data-theme="dark"] .sidebar .ace-scrollbar::-webkit-scrollbar-thumb,
html[data-theme="dark"] [class*="sidebar-"] .ace-scroll::-webkit-scrollbar-thumb,
html[data-theme="dark"] [class*="sidebar-"] .ace-scrollbar::-webkit-scrollbar-thumb {
    background-color: #4b5563 !important;
    border-right: 1px solid #1f2937 !important;
}

/* overlay scrollbar mode uses currentColor */
html[data-theme="dark"] .ace-scroll-wrap,
html[data-theme="dark"] .ace-scroll-wrap:hover,
html[data-theme="dark"] .ace-scroll-wrap.is-always-on,
html[data-theme="dark"] .sidebar .ace-scroll-wrap,
html[data-theme="dark"] .sidebar .ace-scroll-wrap:hover,
html[data-theme="dark"] .sidebar .ace-scroll-wrap.is-always-on {
    color: #4b5563 !important;
    scrollbar-color: #4b5563 transparent !important;
}
