/* ==========================================================================
   SOVEREIGN DARK THEME ENGINE v2.0 (MIDNIGHT OBSIDIAN EDITION)
   Universal Non-Destructive Dark Mode for MS ERP System
   --------------------------------------------------------------------------
   - Zero impact on Light Theme (strictly scoped to html[data-theme="dark"])
   - Print-safe: Scoped to @media screen so printed reports/invoices stay light
   - Preserves the signature Royal Navy Primary Icon Sidebar (.main-icon-menu)
   - Full coverage for all 54 Unified Executive Banners, Cards, Tables, jsGrid,
     Chart of Accounts, Forms, Select2, Modals, Widgets, Portal, and Login.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. THEME SWITCHER UI COMPONENTS (Active in both Light & Dark modes)
   -------------------------------------------------------------------------- */
.topbar-theme-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    padding: 0;
}

.topbar-theme-btn:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.topbar-theme-btn i {
    font-size: 16px;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.25s ease;
}

.topbar-theme-btn:hover i {
    transform: rotate(-15deg) scale(1.1);
}

.profile-theme-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.profile-theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.profile-theme-btn:hover {
    color: #0f172a;
}

.profile-theme-btn.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.portal-theme-btn,
.login-theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.85);
    color: #1e293b;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    outline: none;
}

.portal-theme-btn:hover,
.login-theme-btn:hover {
    transform: translateY(-1px);
    border-color: #3b82f6;
    color: #2563eb;
}

.login-theme-btn {
    position: fixed;
    top: 22px;
    left: 22px;
    z-index: 9999;
}

html[dir="ltr"] .login-theme-btn {
    left: auto;
    right: 22px;
}

/* ==========================================================================
   1. DARK MODE ENGINE (@media screen ONLY - preserves Light Mode for Print)
   ========================================================================== */
@media screen {

    html[data-theme="dark"] {
        color-scheme: dark;
        background-color: #0b1120 !important;
        color: #e2e8f0 !important;
    }

    /* ----------------------------------------------------------------------
       1.1 UNIVERSAL CSS VARIABLES OVERRIDE (All Modules & Layouts)
       ---------------------------------------------------------------------- */
    html[data-theme="dark"]:root,
    html[data-theme="dark"] body {
        /* Core Palette */
        --bg-body: #0b1120 !important;
        --bg-main: #0b1120 !important;
        --bg-page: #0b1120 !important;
        --bg-light: #111827 !important;
        --bg-soft: #111827 !important;
        --bg-muted: #1e293b !important;
        --bg-subtle: #162032 !important;
        --bg-surface: #111827 !important;
        --bg-elevated: #1e293b !important;
        --bg-card: #111827 !important;
        --bg-glass: rgba(17, 24, 39, 0.92) !important;
        --bg-panel: #111827 !important;
        --bg-input: #0f172a !important;
        --bg-hover: rgba(56, 189, 248, 0.08) !important;

        --surface: #111827 !important;
        --surface-1: #111827 !important;
        --surface-2: #1e293b !important;
        --surface-3: #334155 !important;
        --surface-bg: #0b1120 !important;
        --surface-card: #111827 !important;
        --surface-glass: rgba(17, 24, 39, 0.92) !important;
        --surface-hover: #1e293b !important;
        --surface-muted: #162032 !important;
        --surface-border: #1e293b !important;

        --card-bg: #111827 !important;
        --card-border: #1e293b !important;
        --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5) !important;
        --panel-bg: #111827 !important;
        --panel-border: #1e293b !important;

        --text-main: #f1f5f9 !important;
        --text-primary: #f8fafc !important;
        --text-dark: #f8fafc !important;
        --text-heading: #ffffff !important;
        --text-secondary: #cbd5e1 !important;
        --text-body: #e2e8f0 !important;
        --text-muted: #94a3b8 !important;
        --text-light: #64748b !important;
        --text-sub: #94a3b8 !important;

        --border: #1e293b !important;
        --border-color: #1e293b !important;
        --border-light: #1e293b !important;
        --border-subtle: rgba(148, 163, 184, 0.14) !important;
        --border-glass: rgba(148, 163, 184, 0.16) !important;
        --divider: #1e293b !important;

        /* Sovereign (--sov-*) & MS Global (--ms-*) */
        --sov-bg: #0b1120 !important;
        --sov-surface: #111827 !important;
        --sov-surface-2: #1e293b !important;
        --sov-card: #111827 !important;
        --sov-glass: rgba(17, 24, 39, 0.92) !important;
        --sov-border: #1e293b !important;
        --sov-text: #f1f5f9 !important;
        --sov-text-dark: #f8fafc !important;
        --sov-text-muted: #94a3b8 !important;
        --sov-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;

        --ms-bg: #0b1120 !important;
        --ms-bg-main: #0b1120 !important;
        --ms-bg-body: #0b1120 !important;
        --ms-bg-light: #111827 !important;
        --ms-bg-soft: #162032 !important;
        --ms-bg-subtle: #162032 !important;
        --ms-surface: #111827 !important;
        --ms-surface-1: #111827 !important;
        --ms-surface-2: #1e293b !important;
        --ms-surface-3: #334155 !important;
        --ms-surface-hover: #1e293b !important;
        --ms-card: #111827 !important;
        --ms-card-bg: #111827 !important;
        --ms-glass: rgba(17, 24, 39, 0.92) !important;
        --ms-glass-bg: rgba(17, 24, 39, 0.92) !important;
        --ms-glass-border: rgba(148, 163, 184, 0.16) !important;
        --ms-border: #1e293b !important;
        --ms-border-light: #1e293b !important;
        --ms-border-color: #1e293b !important;
        --ms-text: #f1f5f9 !important;
        --ms-text-main: #f1f5f9 !important;
        --ms-text-dark: #f8fafc !important;
        --ms-text-primary: #f8fafc !important;
        --ms-text-secondary: #cbd5e1 !important;
        --ms-text-muted: #94a3b8 !important;
        --ms-text-sub: #94a3b8 !important;
        --ms-text-light: #64748b !important;
        --ms-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
        --ms-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
        --ms-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
        --ms-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55) !important;

        /* ERP Core (--erp-*) */
        --erp-bg: #0b1120 !important;
        --erp-bg-main: #0b1120 !important;
        --erp-bg-light: #0f172a !important;
        --erp-bg-soft: #111827 !important;
        --erp-surface: #111827 !important;
        --erp-surface-2: #1e293b !important;
        --erp-card: #111827 !important;
        --erp-card-bg: #111827 !important;
        --erp-glass: rgba(17, 24, 39, 0.92) !important;
        --erp-border: #1e293b !important;
        --erp-border-light: #1e293b !important;
        --erp-border-color: #1e293b !important;
        --erp-text: #f1f5f9 !important;
        --erp-text-main: #f1f5f9 !important;
        --erp-text-dark: #f8fafc !important;
        --erp-text-muted: #94a3b8 !important;
        --erp-text-sub: #94a3b8 !important;

        /* Dashboard (--dash-*) */
        --dash-bg: #0b1120 !important;
        --dash-surface: #111827 !important;
        --dash-surface-2: #1e293b !important;
        --dash-card: #111827 !important;
        --dash-card-bg: #111827 !important;
        --dash-glass: rgba(17, 24, 39, 0.92) !important;
        --dash-border: #1e293b !important;
        --dash-text: #f1f5f9 !important;
        --dash-text-dark: #f8fafc !important;
        --dash-text-main: #f1f5f9 !important;
        --dash-text-muted: #94a3b8 !important;
        --dash-shadow: 0 10px 28px rgba(0, 0, 0, 0.45) !important;

        /* Finance (--fin-*) */
        --fin-bg: #0b1120 !important;
        --fin-bg-main: #0b1120 !important;
        --fin-bg-soft: #162032 !important;
        --fin-light-soft: #141f36 !important;
        --fin-primary: #93c5fd !important;
        --fin-primary-light: rgba(37, 99, 235, 0.18) !important;
        --fin-teal-light: rgba(13, 148, 136, 0.18) !important;
        --fin-navy: #f1f5f9 !important;
        --fin-surface: #111827 !important;
        --fin-surface-2: #1e293b !important;
        --fin-card: #111827 !important;
        --fin-card-bg: #111827 !important;
        --fin-glass: rgba(17, 24, 39, 0.92) !important;
        --fin-glass-border: rgba(148, 163, 184, 0.16) !important;
        --fin-border: #1e293b !important;
        --fin-border-light: #1e293b !important;
        --fin-text: #f1f5f9 !important;
        --fin-text-main: #f1f5f9 !important;
        --fin-text-dark: #f8fafc !important;
        --fin-muted: #94a3b8 !important;
        --fin-text-muted: #94a3b8 !important;
        --fin-text-sub: #94a3b8 !important;

        /* Inventory (--inv-*) */
        --inv-bg: #0b1120 !important;
        --inv-bg-main: #0b1120 !important;
        --inv-bg-soft: #162032 !important;
        --inv-light-soft: #141f36 !important;
        --inv-surface: #111827 !important;
        --inv-surface-2: #1e293b !important;
        --inv-card: #111827 !important;
        --inv-card-bg: #111827 !important;
        --inv-glass: rgba(17, 24, 39, 0.92) !important;
        --inv-glass-border: rgba(148, 163, 184, 0.16) !important;
        --inv-border: #1e293b !important;
        --inv-border-light: #1e293b !important;
        --inv-text: #f1f5f9 !important;
        --inv-text-main: #f1f5f9 !important;
        --inv-text-dark: #f8fafc !important;
        --inv-muted: #94a3b8 !important;
        --inv-text-muted: #94a3b8 !important;
        --inv-text-sub: #94a3b8 !important;

        /* Procurement (--prc-*) */
        --prc-bg: #0b1120 !important;
        --prc-bg-main: #0b1120 !important;
        --prc-bg-soft: #162032 !important;
        --prc-light-soft: #141f36 !important;
        --prc-surface: #111827 !important;
        --prc-surface-2: #1e293b !important;
        --prc-card: #111827 !important;
        --prc-card-bg: #111827 !important;
        --prc-glass: rgba(17, 24, 39, 0.92) !important;
        --prc-glass-border: rgba(148, 163, 184, 0.16) !important;
        --prc-border: #1e293b !important;
        --prc-border-light: #1e293b !important;
        --prc-text: #f1f5f9 !important;
        --prc-text-main: #f1f5f9 !important;
        --prc-text-dark: #f8fafc !important;
        --prc-muted: #94a3b8 !important;
        --prc-text-muted: #94a3b8 !important;
        --prc-text-sub: #94a3b8 !important;

        /* CRM (--crm-*) */
        --crm-bg: #0b1120 !important;
        --crm-bg-main: #0b1120 !important;
        --crm-bg-soft: #162032 !important;
        --crm-surface: #111827 !important;
        --crm-surface-2: #1e293b !important;
        --crm-card: #111827 !important;
        --crm-card-bg: #111827 !important;
        --crm-glass: rgba(17, 24, 39, 0.92) !important;
        --crm-border: #1e293b !important;
        --crm-text: #f1f5f9 !important;
        --crm-text-main: #f1f5f9 !important;
        --crm-text-dark: #f8fafc !important;
        --crm-muted: #94a3b8 !important;
        --crm-text-muted: #94a3b8 !important;

        /* Projects (--pm-*) */
        --pm-bg: #0b1120 !important;
        --pm-bg-soft: #162032 !important;
        --pm-surface: #111827 !important;
        --pm-surface-2: #1e293b !important;
        --pm-card: #111827 !important;
        --pm-card-bg: #111827 !important;
        --pm-glass: rgba(17, 24, 39, 0.92) !important;
        --pm-border: #1e293b !important;
        --pm-text: #f1f5f9 !important;
        --pm-text-main: #f1f5f9 !important;
        --pm-text-dark: #f8fafc !important;
        --pm-muted: #94a3b8 !important;
        --pm-text-muted: #94a3b8 !important;

        /* Assets (--ast-*), Attendance (--att-*), Payroll (--pay-*), Recruitment (--rec-*) */
        --ast-bg: #0b1120 !important;
        --ast-surface: #111827 !important;
        --ast-card: #111827 !important;
        --ast-glass: rgba(17, 24, 39, 0.92) !important;
        --ast-border: #1e293b !important;
        --ast-text: #f1f5f9 !important;
        --ast-text-dark: #f8fafc !important;
        --ast-text-muted: #94a3b8 !important;

        --att-bg: #0b1120 !important;
        --att-surface: #111827 !important;
        --att-card: #111827 !important;
        --att-glass: rgba(17, 24, 39, 0.92) !important;
        --att-border: #1e293b !important;
        --att-text: #f1f5f9 !important;
        --att-text-dark: #f8fafc !important;
        --att-text-muted: #94a3b8 !important;

        --pay-bg: #0b1120 !important;
        --pay-surface: #111827 !important;
        --pay-card: #111827 !important;
        --pay-glass: rgba(17, 24, 39, 0.92) !important;
        --pay-border: #1e293b !important;
        --pay-text: #f1f5f9 !important;
        --pay-text-dark: #f8fafc !important;
        --pay-text-muted: #94a3b8 !important;

        --rec-bg: #0b1120 !important;
        --rec-surface: #111827 !important;
        --rec-card: #111827 !important;
        --rec-glass: rgba(17, 24, 39, 0.92) !important;
        --rec-border: #1e293b !important;
        --rec-navy: #f1f5f9 !important;
        --rec-blue: #60a5fa !important;
        --rec-text: #f1f5f9 !important;
        --rec-text-dark: #f8fafc !important;
        --rec-text-muted: #94a3b8 !important;

        /* Manager (--mgr-*) & Employee (--emp-*) */
        --mgr-bg: #0b1120 !important;
        --mgr-bg-soft: #162032 !important;
        --mgr-surface: #111827 !important;
        --mgr-surface-2: #1e293b !important;
        --mgr-card: #111827 !important;
        --mgr-card-bg: #111827 !important;
        --mgr-glass: rgba(17, 24, 39, 0.92) !important;
        --mgr-border: #1e293b !important;
        --mgr-text: #f1f5f9 !important;
        --mgr-text-main: #f1f5f9 !important;
        --mgr-text-dark: #f8fafc !important;
        --mgr-text-muted: #94a3b8 !important;

        --emp-bg: #0b1120 !important;
        --emp-bg-soft: #162032 !important;
        --emp-surface: #111827 !important;
        --emp-surface-2: #1e293b !important;
        --emp-card: #111827 !important;
        --emp-card-bg: #111827 !important;
        --emp-glass: rgba(17, 24, 39, 0.92) !important;
        --emp-border: #1e293b !important;
        --emp-text: #f1f5f9 !important;
        --emp-text-main: #f1f5f9 !important;
        --emp-text-dark: #f8fafc !important;
        --emp-text-muted: #94a3b8 !important;

        /* POS (--pos-*), Restaurant (--rst-*), Config (--cfg-*), Portal (--p-* / --cp-*), Dongle (--dng-*) */
        --pos-bg: #0b1120 !important;
        --pos-surface: #111827 !important;
        --pos-card: #111827 !important;
        --pos-border: #1e293b !important;
        --pos-text: #f1f5f9 !important;
        --pos-text-dark: #f8fafc !important;
        --pos-text-muted: #94a3b8 !important;

        --rst-bg: #0b1120 !important;
        --rst-surface: #111827 !important;
        --rst-card: #111827 !important;
        --rst-border: #1e293b !important;
        --rst-text: #f1f5f9 !important;
        --rst-text-dark: #f8fafc !important;
        --rst-text-muted: #94a3b8 !important;

        --cfg-bg: #0b1120 !important;
        --cfg-bg-soft: #162032 !important;
        --cfg-sidebar-bg: #0f172a !important;
        --cfg-surface: #111827 !important;
        --cfg-card: #111827 !important;
        --cfg-card-bg: #111827 !important;
        --cfg-border: #1e293b !important;
        --cfg-navy: #f1f5f9 !important;
        --cfg-blue: #60a5fa !important;
        --cfg-text: #f1f5f9 !important;
        --cfg-text-main: #f1f5f9 !important;
        --cfg-text-dark: #f8fafc !important;
        --cfg-text-muted: #94a3b8 !important;

        /* HR & Enterprise Sub-Modules (--alw-*, --bi-*, --br-*, --brg-*, --cs-*, --dfn-*, --doc-*, --hr-*, --inc-*, --ins-*, --lcd-*, --lea-*, --lev-*, --ln-*, --mfg-*, --mob-*, --op-*, --ops-*, --perf-*, --rdd-*, --rep-*, --rw-*, --shlev-*, --sn-*, --st-*, --sv-*, --wf-*) */
        --alw-border: #1e293b !important;
        --alw-navy: #f1f5f9 !important;
        --ast-blue: #60a5fa !important;
        --ast-navy: #f1f5f9 !important;
        --att-blue: #60a5fa !important;
        --att-navy: #f1f5f9 !important;
        --bi-bg: #0b1120 !important;
        --bi-border: #1e293b !important;
        --bi-navy: #f1f5f9 !important;
        --bi-text: #e2e8f0 !important;
        --br-blue: #60a5fa !important;
        --br-border: #1e293b !important;
        --br-navy: #f1f5f9 !important;
        --brg-blue: #60a5fa !important;
        --brg-border: #1e293b !important;
        --brg-navy: #f1f5f9 !important;
        --cs-bg: #0b1120 !important;
        --cs-blue: #60a5fa !important;
        --cs-border: #1e293b !important;
        --cs-navy: #f1f5f9 !important;
        --cs-text-muted: #94a3b8 !important;
        --dfn-blue: #60a5fa !important;
        --dfn-border: #1e293b !important;
        --dfn-navy: #f1f5f9 !important;
        --doc-bg: #0b1120 !important;
        --doc-blue: #60a5fa !important;
        --doc-border: #1e293b !important;
        --doc-navy: #f1f5f9 !important;
        --doc-text-muted: #94a3b8 !important;
        --emp-navy: #f1f5f9 !important;
        --emp-slate: #cbd5e1 !important;
        --emp-primary-light: rgba(37, 99, 235, 0.18) !important;
        --hr-bg: #0b1120 !important;
        --hr-border: #1e293b !important;
        --hr-card-bg: #111827 !important;
        --hr-text: #f1f5f9 !important;
        --hr-text-muted: #94a3b8 !important;
        --inc-bg: #0b1120 !important;
        --inc-blue: #60a5fa !important;
        --inc-border: #1e293b !important;
        --inc-navy: #f1f5f9 !important;
        --inc-text-muted: #94a3b8 !important;
        --ins-bg: #0b1120 !important;
        --ins-border: #1e293b !important;
        --ins-navy: #f1f5f9 !important;
        --ins-text-muted: #94a3b8 !important;
        --lcd-bg-soft: #162032 !important;
        --lcd-blue: #60a5fa !important;
        --lcd-border: #1e293b !important;
        --lcd-navy: #f1f5f9 !important;
        --lea-blue: #60a5fa !important;
        --lea-border: #1e293b !important;
        --lea-navy: #f1f5f9 !important;
        --lev-bg: #0b1120 !important;
        --lev-blue: #60a5fa !important;
        --lev-border: #1e293b !important;
        --lev-navy: #f1f5f9 !important;
        --lev-text-muted: #94a3b8 !important;
        --ln-bg: #0b1120 !important;
        --ln-blue: #60a5fa !important;
        --ln-border: #1e293b !important;
        --ln-navy: #f1f5f9 !important;
        --ln-text-muted: #94a3b8 !important;
        --mfg-glass-bg: rgba(17, 24, 39, 0.92) !important;
        --mfg-glass-border: #1e293b !important;
        --mfg-navy: #f1f5f9 !important;
        --mfg-primary-soft: rgba(249, 115, 22, 0.18) !important;
        --mgr-navy: #f1f5f9 !important;
        --mob-bg: #0b1120 !important;
        --mob-blue: #60a5fa !important;
        --mob-border: #1e293b !important;
        --mob-navy: #f1f5f9 !important;
        --mob-text-muted: #94a3b8 !important;
        --ms-sidebar: #0f172a !important;
        --ms-navy: #f1f5f9 !important;
        --ms-blue: #60a5fa !important;
        --op-blue: #60a5fa !important;
        --op-border: #1e293b !important;
        --op-navy: #f1f5f9 !important;
        --ops-bg-glass: rgba(17, 24, 39, 0.85) !important;
        --ops-border: #1e293b !important;
        --ops-muted: #94a3b8 !important;
        --ops-navy: #f1f5f9 !important;
        --ops-primary: #60a5fa !important;
        --pay-blue: #60a5fa !important;
        --pay-navy: #f1f5f9 !important;
        --perf-bg: #0b1120 !important;
        --perf-border: #1e293b !important;
        --perf-navy: #f1f5f9 !important;
        --perf-text-muted: #94a3b8 !important;
        --rdd-blue: #60a5fa !important;
        --rdd-border: #1e293b !important;
        --rdd-navy: #f1f5f9 !important;
        --rec-blue: #60a5fa !important;
        --rec-navy: #f1f5f9 !important;
        --rep-blue: #60a5fa !important;
        --rep-border: #1e293b !important;
        --rep-navy: #f1f5f9 !important;
        --rw-bg: #0b1120 !important;
        --rw-blue: #60a5fa !important;
        --rw-border: #1e293b !important;
        --rw-navy: #f1f5f9 !important;
        --rw-text-muted: #94a3b8 !important;
        --shlev-bg: #0b1120 !important;
        --shlev-border: #1e293b !important;
        --shlev-navy: #f1f5f9 !important;
        --shlev-text-muted: #94a3b8 !important;
        --sn-bg: #0b1120 !important;
        --sn-blue: #60a5fa !important;
        --sn-border: #1e293b !important;
        --sn-navy: #f1f5f9 !important;
        --sn-text-muted: #94a3b8 !important;
        --st-bg: #0b1120 !important;
        --st-blue: #60a5fa !important;
        --st-border: #1e293b !important;
        --st-card-bg: #111827 !important;
        --st-navy: #f1f5f9 !important;
        --st-text: #e2e8f0 !important;
        --sv-bg: #0b1120 !important;
        --sv-blue: #60a5fa !important;
        --sv-border: #1e293b !important;
        --sv-navy: #f1f5f9 !important;
        --wf-bg: #0b1120 !important;
        --wf-blue: #60a5fa !important;
        --wf-border: #1e293b !important;
        --wf-navy: #f1f5f9 !important;

        --cp-bg: #0b1120 !important;
        --cp-surface: #111827 !important;
        --cp-card: #111827 !important;
        --cp-border: #1e293b !important;
        --cp-text: #f1f5f9 !important;
        --cp-text-dark: #f8fafc !important;
        --cp-muted: #94a3b8 !important;
        --cp-text-muted: #94a3b8 !important;

        --dng-bg: #0b1120 !important;
        --dng-bg-soft: #162032 !important;
        --dng-surface: #111827 !important;
        --dng-card: #111827 !important;
        --dng-card-bg: #111827 !important;
        --dng-navy: #f1f5f9 !important;
        --dng-border: #1e293b !important;
        --dng-text: #f1f5f9 !important;
        --dng-text-dark: #f8fafc !important;
        --dng-text-muted: #94a3b8 !important;

        --p-bg: #0b1120 !important;
        --p-white: #111827 !important;
        --p-navy: #60a5fa !important;
        --p-navy-dark: #f1f5f9 !important;
        --p-surface: #111827 !important;
        --p-card: #111827 !important;
        --p-border: #1e293b !important;
        --p-text: #f1f5f9 !important;
        --p-text-muted: #94a3b8 !important;

        --tm-navy: #f1f5f9 !important;
        --pm-navy: #60a5fa !important;
        --sov-navy: #f1f5f9 !important;
    }

    /* HR System Configuration Sidebar (#configSidebar) & Accordion */
    html[data-theme="dark"] body #configSidebar {
        background: #0f172a !important;
        border-color: #1e293b !important;
    }

    html[data-theme="dark"] body .sb-header-box {
        background: #111827 !important;
        border-bottom-color: #1e293b !important;
    }

    html[data-theme="dark"] body .sb-group {
        border-color: #1e293b !important;
        background: #111827 !important;
    }

    html[data-theme="dark"] body .sb-group-header {
        background: #162033 !important;
    }

    html[data-theme="dark"] body .sb-group-header span {
        color: #93c5fd !important;
    }

    html[data-theme="dark"] body .sb-group-content {
        background: #0f172a !important;
    }

    html[data-theme="dark"] body .sb-nav-btn {
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] body .sb-nav-btn:hover,
    html[data-theme="dark"] body .sb-nav-btn.active {
        background: rgba(59, 130, 246, 0.16) !important;
        color: #60a5fa !important;
        border-color: rgba(59, 130, 246, 0.3) !important;
    }

    /* ----------------------------------------------------------------------
       1.2 GLOBAL PAGE SHELL & LAYOUT CONTAINERS
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] body,
    html[data-theme="dark"] .page-wrapper,
    html[data-theme="dark"] .page-content,
    html[data-theme="dark"] .page-content-tab,
    html[data-theme="dark"] .page-content-fluid,
    html[data-theme="dark"] .content-page,
    html[data-theme="dark"] #ContainerID,
    html[data-theme="dark"] .main-content,
    html[data-theme="dark"] .app-wrapper,
    html[data-theme="dark"] .fin-wrapper,
    html[data-theme="dark"] .inv-wrapper,
    html[data-theme="dark"] .prc-wrapper,
    html[data-theme="dark"] .crm-wrapper,
    html[data-theme="dark"] .pm-wrapper,
    html[data-theme="dark"] .erp-page-wrapper,
    html[data-theme="dark"] .fin-page-wrapper,
    html[data-theme="dark"] .inv-page-wrapper,
    html[data-theme="dark"] .prc-page-wrapper,
    html[data-theme="dark"] .crm-page-wrapper,
    html[data-theme="dark"] .pm-page-wrapper,
    html[data-theme="dark"] .mgr-page-wrapper,
    html[data-theme="dark"] .emp-page-wrapper,
    html[data-theme="dark"] .ast-page-wrapper,
    html[data-theme="dark"] .att-page-wrapper,
    html[data-theme="dark"] .pay-page-wrapper,
    html[data-theme="dark"] .rec-page-wrapper,
    html[data-theme="dark"] .pos-page-wrapper,
    html[data-theme="dark"] .rst-page-wrapper {
        background-color: #0b1120 !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] .footer {
        background: #0b1120 !important;
        border-top: 1px solid #1e293b !important;
        color: #94a3b8 !important;
    }

    /* ----------------------------------------------------------------------
       1.3 TOPBAR, HEADER, PROFILE DROPDOWN & NOTIFICATION HUB
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] .topbar,
    html[data-theme="dark"] .navbar-custom {
        background: rgba(15, 23, 42, 0.95) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border-bottom: 1px solid rgba(148, 163, 184, 0.14) !important;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4) !important;
    }

    html[data-theme="dark"] .button-menu-mobile,
    html[data-theme="dark"] .topbar-bell-btn,
    html[data-theme="dark"] .topbar-theme-btn,
    html[data-theme="dark"] .topbar-action-btn,
    html[data-theme="dark"] .nav-link.topbar-icon {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] .button-menu-mobile:hover,
    html[data-theme="dark"] .topbar-bell-btn:hover,
    html[data-theme="dark"] .topbar-theme-btn:hover,
    html[data-theme="dark"] .topbar-action-btn:hover {
        background: rgba(56, 189, 248, 0.15) !important;
        border-color: rgba(56, 189, 248, 0.4) !important;
        color: #38bdf8 !important;
    }

    html[data-theme="dark"] .topbar-theme-btn i {
        color: #fbbf24 !important;
    }

    html[data-theme="dark"] .topbar-entity-badge {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #f1f5f9 !important;
    }

    html[data-theme="dark"] .topbar-entity-badge .entity-name {
        color: #f1f5f9 !important;
    }

    html[data-theme="dark"] .nav-user-btn,
    html[data-theme="dark"] .user-profile-pill,
    html[data-theme="dark"] .topbar-user-trigger {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #f1f5f9 !important;
    }

    html[data-theme="dark"] .nav-user-btn .nav-user-name {
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .nav-user-btn .nav-user-role {
        color: #94a3b8 !important;
    }

    html[data-theme="dark"] .profile-dropdown-card,
    html[data-theme="dark"] #crm-notif-menu,
    html[data-theme="dark"] #BellHub_Dropdown,
    html[data-theme="dark"] .dropdown-menu {
        background: #111827 !important;
        border: 1px solid #1e293b !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65) !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] .profile-dropdown-body,
    html[data-theme="dark"] .profile-dropdown-footer {
        background: #111827 !important;
        border-color: #1e293b !important;
    }

    html[data-theme="dark"] .profile-dropdown-item .item-title {
        color: #f1f5f9 !important;
    }

    html[data-theme="dark"] .profile-dropdown-item .item-desc {
        color: #94a3b8 !important;
    }

    html[data-theme="dark"] .profile-dropdown-item:hover {
        background: #1e293b !important;
    }

    html[data-theme="dark"] .profile-info-row,
    html[data-theme="dark"] .profile-stat-box,
    html[data-theme="dark"] .profile-lang-group,
    html[data-theme="dark"] .profile-theme-group {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] .profile-lang-btn,
    html[data-theme="dark"] .profile-theme-btn {
        color: #94a3b8 !important;
    }

    html[data-theme="dark"] .profile-lang-btn.active,
    html[data-theme="dark"] .profile-lang-btn.active-lang,
    html[data-theme="dark"] .profile-theme-btn.active {
        background: #0f172a !important;
        color: #38bdf8 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    }

    html[data-theme="dark"] .dropdown-item {
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] .dropdown-item:hover,
    html[data-theme="dark"] .dropdown-item:focus {
        background-color: #1e293b !important;
        color: #38bdf8 !important;
    }

    html[data-theme="dark"] .dropdown-divider,
    html[data-theme="dark"] .profile-dropdown-divider {
        border-top-color: #1e293b !important;
        background-color: #1e293b !important;
    }

    /* ----------------------------------------------------------------------
       1.4 LEFT SIDEBAR & NAVIGATION DRAWER
       (Preserves the original Royal Navy Primary Icon Column .main-icon-menu!)
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] .leftbar-tab-menu {
        background: #0f172a !important;
        border-color: #1e293b !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45) !important;
    }

    /* Primary Icon Strip (.main-icon-menu) - Smooth Deep Royal Navy Gradient in Dark Mode (Not Black, Harmonious Depth) */
    html[data-theme="dark"] body .leftbar-tab-menu .main-icon-menu,
    html[data-theme="dark"] body .main-icon-menu,
    html[data-theme="dark"] .main-icon-menu {
        background: linear-gradient(180deg, #13223f 0%, #172b52 50%, #1c3566 100%) !important;
        border-inline-end: 1px solid rgba(96, 165, 250, 0.14) !important;
        box-shadow: inset -1px 0 0 rgba(148, 163, 184, 0.08), 4px 0 20px rgba(8, 15, 32, 0.45) !important;
    }

    html[data-theme="dark"][dir="rtl"] body .leftbar-tab-menu .main-icon-menu .nav-link.active:before {
        border-left-color: #0f172a !important;
    }

    html[data-theme="dark"]:not([dir="rtl"]) body .leftbar-tab-menu .main-icon-menu .nav-link.active:before {
        border-right-color: #0f172a !important;
    }

    html[data-theme="dark"] .main-icon-menu .nav-link {
        color: rgba(255, 255, 255, 0.65) !important;
    }

    html[data-theme="dark"] .main-icon-menu .nav-link:hover {
        color: #ffffff !important;
        background: rgba(255, 255, 255, 0.14) !important;
    }

    html[data-theme="dark"] .main-icon-menu .nav-link.active {
        color: #ffffff !important;
        background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%) !important;
        box-shadow: 0 4px 14px rgba(29, 78, 216, 0.45) !important;
    }

    /* Secondary Sub-Menu Panel (.main-menu-inner) in Dark Slate */
    html[data-theme="dark"] .main-menu-inner,
    html[data-theme="dark"] .left-sidenav {
        background: #0f172a !important;
        border-inline-end: 1px solid #1e293b !important;
    }

    html[data-theme="dark"] .main-menu-inner .topbar-left,
    html[data-theme="dark"] .main-menu-inner .menu-body {
        background: #0f172a !important;
        border-bottom-color: #1e293b !important;
    }

    html[data-theme="dark"] .main-menu-inner .topbar-left .logo span {
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .main-menu-inner .title-box {
        border-bottom-color: #1e293b !important;
    }

    html[data-theme="dark"] .main-menu-inner .menu-title,
    html[data-theme="dark"] .left-sidenav-menu .menu-title {
        color: #94a3b8 !important;
    }

    html[data-theme="dark"] .main-menu-inner .nav-link,
    html[data-theme="dark"] .main-menu-inner .nav-item a,
    html[data-theme="dark"] .main-menu-inner .nav.metismenu > .nav-item > .nav-link,
    html[data-theme="dark"] .main-menu-inner .nav.metismenu > .nav-item > .nav-link span,
    html[data-theme="dark"] .main-menu-inner .nav-second-level > li > a,
    html[data-theme="dark"] .main-menu-inner .nav-third-level > li > a,
    html[data-theme="dark"] .left-sidenav-menu li > a {
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] .main-menu-inner .nav-link:hover,
    html[data-theme="dark"] .main-menu-inner .nav-item a:hover,
    html[data-theme="dark"] .main-menu-inner .nav.metismenu > .nav-item > .nav-link:hover,
    html[data-theme="dark"] .main-menu-inner .nav.metismenu > .nav-item > .nav-link:hover span,
    html[data-theme="dark"] .main-menu-inner .nav.metismenu > .nav-item.active > .nav-link,
    html[data-theme="dark"] .main-menu-inner .nav.metismenu > .nav-item.mm-active > .nav-link,
    html[data-theme="dark"] .main-menu-inner .nav.metismenu > .nav-item.active > .nav-link span,
    html[data-theme="dark"] .main-menu-inner .nav.metismenu > .nav-item.mm-active > .nav-link span,
    html[data-theme="dark"] .main-menu-inner .nav-second-level > li > a:hover,
    html[data-theme="dark"] .main-menu-inner .nav-second-level > li.active > a,
    html[data-theme="dark"] .main-menu-inner .nav-link.active,
    html[data-theme="dark"] .left-sidenav-menu li > a:hover,
    html[data-theme="dark"] .left-sidenav-menu li.mm-active > a {
        background: rgba(56, 189, 248, 0.14) !important;
        color: #38bdf8 !important;
    }

    /* ----------------------------------------------------------------------
       1.5 UNIFIED EXECUTIVE BANNERS & HERO HEADERS (All 54 Module Banners)
       Exact high-specificity overrides for Sovereign-Aesthetics.css Section 8
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] body .mgr-banner,
    html[data-theme="dark"] body .emp-banner,
    html[data-theme="dark"] body .rec-banner:not(.erp-main-banner-synced),
    html[data-theme="dark"] body .alw-mgr-banner,
    html[data-theme="dark"] body .att-banner,
    html[data-theme="dark"] body .bi-banner,
    html[data-theme="dark"] body .br-banner,
    html[data-theme="dark"] body .brg-banner,
    html[data-theme="dark"] body .dfn-banner,
    html[data-theme="dark"] body .imperial-banner,
    html[data-theme="dark"] body .lcd-banner,
    html[data-theme="dark"] body .lea-banner,
    html[data-theme="dark"] body .master-banner,
    html[data-theme="dark"] body .op-banner,
    html[data-theme="dark"] body .rdd-banner,
    html[data-theme="dark"] body .rep-banner,
    html[data-theme="dark"] body .sv-banner,
    html[data-theme="dark"] body .wf-banner,
    html[data-theme="dark"] body .emp-header-bar,
    html[data-theme="dark"] body .emp360-hero-banner,
    html[data-theme="dark"] body .sov-page-card > .d-flex.border-bottom:first-child,
    html[data-theme="dark"] body .fin-header-banner,
    html[data-theme="dark"] body .coa-erp-header,
    html[data-theme="dark"] body .fin-glass-card.card-header-bar,
    html[data-theme="dark"] body .ye-hero-card,
    html[data-theme="dark"] body .inv-header-banner,
    html[data-theme="dark"] body .prc-header-banner,
    html[data-theme="dark"] body .prc-hero-banner,
    html[data-theme="dark"] body .c360-header-card,
    html[data-theme="dark"] body .pm-header-banner,
    html[data-theme="dark"] body .pm-page-header-card,
    html[data-theme="dark"] body .ss-header-banner,
    html[data-theme="dark"] body .crm-executive-banner,
    html[data-theme="dark"] body .crm-compact-header,
    html[data-theme="dark"] body .financial-hub-header,
    html[data-theme="dark"] body .pb-header-card,
    html[data-theme="dark"] body .nc-header-card,
    html[data-theme="dark"] body .sub-header-card,
    html[data-theme="dark"] body .so-header-card,
    html[data-theme="dark"] body .st-header-card,
    html[data-theme="dark"] body .cd-header,
    html[data-theme="dark"] body .ld-header,
    html[data-theme="dark"] body .vs-header,
    html[data-theme="dark"] body .sod-hero,
    html[data-theme="dark"] body .guide-header,
    html[data-theme="dark"] body .erp-top-nav,
    html[data-theme="dark"] body .dashboard-header-card,
    html[data-theme="dark"] body .header-card,
    html[data-theme="dark"] body .report-header-card,
    html[data-theme="dark"] body .rst-header,
    html[data-theme="dark"] body .rst-header-card,
    html[data-theme="dark"] body .expo-header-card,
    html[data-theme="dark"] body .guide-header-card,
    html[data-theme="dark"] body .bn-header,
    html[data-theme="dark"] body .fin-banner,
    html[data-theme="dark"] body .inv-banner,
    html[data-theme="dark"] body .prc-banner,
    html[data-theme="dark"] body .crm-banner,
    html[data-theme="dark"] body .pm-banner,
    html[data-theme="dark"] body .ast-banner,
    html[data-theme="dark"] body .pay-banner,
    html[data-theme="dark"] body .rst-banner,
    html[data-theme="dark"] body .pos-banner,
    html[data-theme="dark"] body .cfg-banner,
    html[data-theme="dark"] body .cp-banner,
    html[data-theme="dark"] body .dng-banner,
    html[data-theme="dark"] body .sov-banner,
    html[data-theme="dark"] body .dash-hero,
    html[data-theme="dark"] body .welcome-banner,
    html[data-theme="dark"] body .hero-banner,
    html[data-theme="dark"] body .page-title-box {
        background: radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.12) 0%, transparent 260px), linear-gradient(135deg, #111827 0%, #172236 60%, #1e293b 100%) !important;
        border: 1px solid rgba(56, 189, 248, 0.22) !important;
        border-inline-start: 4px solid #38bdf8 !important;
        box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.5) !important;
        color: #f8fafc !important;
    }

    /* Unified Banner Titles & Headings -> Pure Crisp White */
    html[data-theme="dark"] body .mgr-banner h1, html[data-theme="dark"] body .mgr-banner h2, html[data-theme="dark"] body .mgr-banner h3, html[data-theme="dark"] body .mgr-banner h4, html[data-theme="dark"] body .mgr-banner h5,
    html[data-theme="dark"] body .emp-banner h1, html[data-theme="dark"] body .emp-banner h2, html[data-theme="dark"] body .emp-banner h3, html[data-theme="dark"] body .emp-banner h4, html[data-theme="dark"] body .emp-banner h5,
    html[data-theme="dark"] body .rec-banner h2, html[data-theme="dark"] body .rec-banner h3, html[data-theme="dark"] body .rec-banner h4, html[data-theme="dark"] body .rec-banner h5,
    html[data-theme="dark"] body .alw-mgr-banner h4, html[data-theme="dark"] body .att-banner h4, html[data-theme="dark"] body .bi-banner h4, html[data-theme="dark"] body .br-banner h4, html[data-theme="dark"] body .brg-banner h4,
    html[data-theme="dark"] body .dfn-banner h4, html[data-theme="dark"] body .imperial-banner h4, html[data-theme="dark"] body .lcd-banner h4, html[data-theme="dark"] body .lea-banner h4, html[data-theme="dark"] body .master-banner h4,
    html[data-theme="dark"] body .op-banner h4, html[data-theme="dark"] body .rdd-banner h4, html[data-theme="dark"] body .rep-banner h4, html[data-theme="dark"] body .sv-banner h4, html[data-theme="dark"] body .wf-banner h4,
    html[data-theme="dark"] body .emp-header-bar h4, html[data-theme="dark"] body .emp360-hero-banner h2, html[data-theme="dark"] body .emp360-hero-banner h3, html[data-theme="dark"] body .emp360-hero-banner h4,
    html[data-theme="dark"] body .sov-page-card > .d-flex.border-bottom:first-child h4,
    html[data-theme="dark"] body .sov-page-card > .d-flex.border-bottom:first-child h5,
    html[data-theme="dark"] body .fin-header-banner h2, html[data-theme="dark"] body .fin-header-banner h3, html[data-theme="dark"] body .fin-header-banner h4, html[data-theme="dark"] body .fin-header-banner h5,
    html[data-theme="dark"] body .coa-erp-header h4, html[data-theme="dark"] body .coa-erp-header h5,
    html[data-theme="dark"] body .fin-glass-card.card-header-bar h3, html[data-theme="dark"] body .fin-glass-card.card-header-bar h4, html[data-theme="dark"] body .fin-glass-card.card-header-bar h5,
    html[data-theme="dark"] body .ye-hero-card h4, html[data-theme="dark"] body .ye-hero-card h5,
    html[data-theme="dark"] body .inv-header-banner h2, html[data-theme="dark"] body .inv-header-banner h3, html[data-theme="dark"] body .inv-header-banner h4, html[data-theme="dark"] body .inv-header-banner h5,
    html[data-theme="dark"] body .prc-header-banner h2, html[data-theme="dark"] body .prc-header-banner h3, html[data-theme="dark"] body .prc-header-banner h4, html[data-theme="dark"] body .prc-header-banner h5,
    html[data-theme="dark"] body .prc-hero-banner h2, html[data-theme="dark"] body .prc-hero-banner h3, html[data-theme="dark"] body .prc-hero-banner h4, html[data-theme="dark"] body .prc-hero-banner h5,
    html[data-theme="dark"] body .c360-header-card h2, html[data-theme="dark"] body .c360-header-card h3, html[data-theme="dark"] body .c360-header-card h4,
    html[data-theme="dark"] body .pm-header-banner .pm-title, html[data-theme="dark"] body .pm-header-banner h2, html[data-theme="dark"] body .pm-header-banner h4,
    html[data-theme="dark"] body .pm-page-header-card .pm-page-header-title, html[data-theme="dark"] body .pm-page-header-card h4,
    html[data-theme="dark"] body .ss-header-banner .ss-header-title, html[data-theme="dark"] body .ss-header-banner h2, html[data-theme="dark"] body .ss-header-banner h4,
    html[data-theme="dark"] body .crm-executive-banner h3, html[data-theme="dark"] body .crm-executive-banner h4, html[data-theme="dark"] body .crm-executive-banner h5,
    html[data-theme="dark"] body .crm-compact-header h3, html[data-theme="dark"] body .crm-compact-header h4, html[data-theme="dark"] body .crm-compact-header h5,
    html[data-theme="dark"] body .financial-hub-header h4, html[data-theme="dark"] body .financial-hub-header h5,
    html[data-theme="dark"] body .pb-header-card h4, html[data-theme="dark"] body .pb-header-card h5,
    html[data-theme="dark"] body .nc-header-card h3, html[data-theme="dark"] body .nc-header-card h4, html[data-theme="dark"] body .sub-header-card h3, html[data-theme="dark"] body .sub-header-card h4,
    html[data-theme="dark"] body .cd-header h3, html[data-theme="dark"] body .cd-header h4, html[data-theme="dark"] body .ld-header h3, html[data-theme="dark"] body .ld-header h4, html[data-theme="dark"] body .vs-header h3, html[data-theme="dark"] body .vs-header h4,
    html[data-theme="dark"] body .sod-hero #sod_title,
    html[data-theme="dark"] body .erp-top-nav .erp-invoice-title, html[data-theme="dark"] body .erp-top-nav .erp-transfer-title, html[data-theme="dark"] body .erp-top-nav .erp-voucher-title,
    html[data-theme="dark"] body .dashboard-header-card h1, html[data-theme="dark"] body .dashboard-header-card h2, html[data-theme="dark"] body .dashboard-header-card h3, html[data-theme="dark"] body .dashboard-header-card h4,
    html[data-theme="dark"] body .header-card .header-title, html[data-theme="dark"] body .header-card h1, html[data-theme="dark"] body .header-card h2, html[data-theme="dark"] body .header-card h4,
    html[data-theme="dark"] body .report-header-card h1, html[data-theme="dark"] body .report-header-card h2, html[data-theme="dark"] body .report-header-card h4,
    html[data-theme="dark"] body .rst-header h1, html[data-theme="dark"] body .rst-header h2, html[data-theme="dark"] body .rst-header h4,
    html[data-theme="dark"] body .rst-header-card .rst-header-title, html[data-theme="dark"] body .rst-header-card h1, html[data-theme="dark"] body .rst-header-card h4,
    html[data-theme="dark"] body .expo-header-card h2, html[data-theme="dark"] body .expo-header-card h4,
    html[data-theme="dark"] body .bn-header h2, html[data-theme="dark"] body .bn-header h4,
    html[data-theme="dark"] body .mgr-banner .text-white:not(.btn):not(.badge),
    html[data-theme="dark"] body .fin-header-banner .text-white:not(.btn):not(.badge),
    html[data-theme="dark"] body .fin-glass-card.card-header-bar .text-white:not(.btn):not(.badge),
    html[data-theme="dark"] body .ye-hero-card .text-white:not(.btn):not(.badge),
    html[data-theme="dark"] body .inv-header-banner .text-white:not(.btn):not(.badge),
    html[data-theme="dark"] body .prc-header-banner .text-white:not(.btn):not(.badge),
    html[data-theme="dark"] body .prc-hero-banner .text-white:not(.btn):not(.badge),
    html[data-theme="dark"] body .pm-header-banner .text-white:not(.btn):not(.badge),
    html[data-theme="dark"] body .ss-header-banner .text-white:not(.btn):not(.badge),
    html[data-theme="dark"] body .crm-executive-banner .text-white:not(.btn):not(.badge),
    html[data-theme="dark"] body .crm-compact-header .text-white:not(.btn):not(.badge),
    html[data-theme="dark"] body .financial-hub-header .text-white:not(.btn):not(.badge),
    html[data-theme="dark"] body .cd-header .text-white:not(.badge):not(.btn),
    html[data-theme="dark"] body .master-banner .text-white:not(.badge):not(.btn),
    html[data-theme="dark"] body .master-banner h3,
    html[data-theme="dark"] body .sod-hero {
        color: #f8fafc !important;
        -webkit-text-fill-color: #f8fafc !important;
    }

    /* Unified Banner Subtitles & Descriptions -> Soft Slate */
    html[data-theme="dark"] body .mgr-banner p:not(.mgr-banner-eyebrow), html[data-theme="dark"] body .mgr-banner .mgr-banner-sub, html[data-theme="dark"] body .mgr-banner small:not(.badge),
    html[data-theme="dark"] body .emp-banner p, html[data-theme="dark"] body .rec-banner p, html[data-theme="dark"] body .alw-mgr-banner p, html[data-theme="dark"] body .att-banner p, html[data-theme="dark"] body .bi-banner p,
    html[data-theme="dark"] body .br-banner p, html[data-theme="dark"] body .brg-banner p, html[data-theme="dark"] body .dfn-banner p, html[data-theme="dark"] body .imperial-banner p, html[data-theme="dark"] body .lcd-banner p,
    html[data-theme="dark"] body .lea-banner p, html[data-theme="dark"] body .master-banner p, html[data-theme="dark"] body .op-banner p, html[data-theme="dark"] body .rdd-banner p, html[data-theme="dark"] body .rep-banner p,
    html[data-theme="dark"] body .sv-banner p, html[data-theme="dark"] body .wf-banner p, html[data-theme="dark"] body .emp-header-bar p, html[data-theme="dark"] body .emp360-hero-banner p,
    html[data-theme="dark"] body .sov-page-card > .d-flex.border-bottom:first-child p,
    html[data-theme="dark"] body .fin-header-banner p, html[data-theme="dark"] body .fin-header-banner .text-white-50,
    html[data-theme="dark"] body .fin-glass-card.card-header-bar p, html[data-theme="dark"] body .fin-glass-card.card-header-bar .text-white-50,
    html[data-theme="dark"] body .ye-hero-card p, html[data-theme="dark"] body .ye-hero-card .text-white-50,
    html[data-theme="dark"] body .inv-header-banner p, html[data-theme="dark"] body .inv-header-banner .text-white-50,
    html[data-theme="dark"] body .prc-header-banner p, html[data-theme="dark"] body .prc-hero-banner p, html[data-theme="dark"] body .prc-hero-banner .text-white-50,
    html[data-theme="dark"] body .c360-header-card p,
    html[data-theme="dark"] body .pm-header-banner .pm-subtitle, html[data-theme="dark"] body .pm-header-banner p,
    html[data-theme="dark"] body .pm-page-header-card .pm-page-header-subtitle, html[data-theme="dark"] body .pm-page-header-card p,
    html[data-theme="dark"] body .ss-header-banner .ss-header-subtitle, html[data-theme="dark"] body .ss-header-banner p,
    html[data-theme="dark"] body .crm-executive-banner p, html[data-theme="dark"] body .crm-compact-header p, html[data-theme="dark"] body .crm-compact-header .text-white-50,
    html[data-theme="dark"] body .financial-hub-header p, html[data-theme="dark"] body .financial-hub-header .text-white-50,
    html[data-theme="dark"] body .nc-header-card p, html[data-theme="dark"] body .sub-header-card p, html[data-theme="dark"] body .cd-header p, html[data-theme="dark"] body .ld-header p, html[data-theme="dark"] body .vs-header p,
    html[data-theme="dark"] body .erp-top-nav .erp-invoice-subtitle, html[data-theme="dark"] body .erp-top-nav .erp-transfer-subtitle, html[data-theme="dark"] body .erp-top-nav .erp-voucher-subtitle,
    html[data-theme="dark"] body .dashboard-header-card p, html[data-theme="dark"] body .header-card p, html[data-theme="dark"] body .report-header-card p,
    html[data-theme="dark"] body .rst-header p, html[data-theme="dark"] body .rst-header-card p, html[data-theme="dark"] body .expo-header-card p, html[data-theme="dark"] body .bn-header p,
    html[data-theme="dark"] body .mgr-banner .text-white-50,
    html[data-theme="dark"] body .inv-header-banner .text-white-50,
    html[data-theme="dark"] body .prc-header-banner .text-white-50,
    html[data-theme="dark"] body .pm-header-banner .text-white-50,
    html[data-theme="dark"] body .ss-header-banner .text-white-50,
    html[data-theme="dark"] body .crm-executive-banner .text-white-50 {
        color: #94a3b8 !important;
        opacity: 1 !important;
    }

    /* Unified Emblem & Icon Boxes inside Banners */
    html[data-theme="dark"] body .mgr-banner-emblem,
    html[data-theme="dark"] body .pm-project-icon,
    html[data-theme="dark"] body .ss-header-icon,
    html[data-theme="dark"] body .coa-erp-title-icon,
    html[data-theme="dark"] body .erp-invoice-icon,
    html[data-theme="dark"] body .erp-transfer-icon,
    html[data-theme="dark"] body .erp-voucher-icon,
    html[data-theme="dark"] body .emp-header-icon,
    html[data-theme="dark"] body .bn-header-icon,
    html[data-theme="dark"] body .sov-page-card > .d-flex.border-bottom:first-child div[style*="width:48px"],
    html[data-theme="dark"] body .sov-page-card > .d-flex.border-bottom:first-child div[style*="width: 48px"],
    html[data-theme="dark"] body .mgr-banner div[style*="width:48px"],
    html[data-theme="dark"] body .mgr-banner div[style*="width: 48px"],
    html[data-theme="dark"] body .mgr-banner div[style*="width:55px"],
    html[data-theme="dark"] body .mgr-banner div[style*="width: 56px"],
    html[data-theme="dark"] body .crm-compact-header div[style*="width:38px"],
    html[data-theme="dark"] body .crm-compact-header div[style*="width: 38px"],
    html[data-theme="dark"] body .crm-compact-header div[style*="width:42px"],
    html[data-theme="dark"] body .crm-compact-header div[style*="width: 42px"],
    html[data-theme="dark"] body .fin-glass-card.card-header-bar div[style*="width: 54px"],
    html[data-theme="dark"] body .ye-hero-card span[style*="width: 36px"] {
        background: rgba(56, 189, 248, 0.14) !important;
        border: 1px solid rgba(56, 189, 248, 0.3) !important;
        color: #38bdf8 !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
    }

    html[data-theme="dark"] body .mgr-banner-emblem i,
    html[data-theme="dark"] body .pm-project-icon i,
    html[data-theme="dark"] body .ss-header-icon i,
    html[data-theme="dark"] body .coa-erp-title-icon i,
    html[data-theme="dark"] body .erp-invoice-icon i,
    html[data-theme="dark"] body .erp-transfer-icon i,
    html[data-theme="dark"] body .erp-voucher-icon i,
    html[data-theme="dark"] body .emp-header-icon i,
    html[data-theme="dark"] body .bn-header-icon i,
    html[data-theme="dark"] body .fin-header-banner h2 i, html[data-theme="dark"] body .fin-header-banner h4 i, html[data-theme="dark"] body .fin-header-banner h5 i,
    html[data-theme="dark"] body .inv-header-banner h2 i, html[data-theme="dark"] body .inv-header-banner h4 i, html[data-theme="dark"] body .inv-header-banner h5 i,
    html[data-theme="dark"] body .prc-header-banner h2 i, html[data-theme="dark"] body .prc-header-banner h4 i, html[data-theme="dark"] body .prc-header-banner h5 i,
    html[data-theme="dark"] body .crm-executive-banner h4 i, html[data-theme="dark"] body .crm-executive-banner h5 i,
    html[data-theme="dark"] body .crm-compact-header h4 i, html[data-theme="dark"] body .crm-compact-header h5 i,
    html[data-theme="dark"] body .financial-hub-header h4 i, html[data-theme="dark"] body .financial-hub-header h5 i,
    html[data-theme="dark"] body .mgr-banner h2 i, html[data-theme="dark"] body .mgr-banner h4 i, html[data-theme="dark"] body .mgr-banner h5 i {
        color: #38bdf8 !important;
    }

    /* Inputs, Selects, Buttons & Meta Boxes inside Unified Banners */
    html[data-theme="dark"] body .mgr-banner select.form-control,
    html[data-theme="dark"] body .mgr-banner select.form-select,
    html[data-theme="dark"] body .fin-header-banner select,
    html[data-theme="dark"] body .inv-header-banner select,
    html[data-theme="dark"] body .prc-header-banner select,
    html[data-theme="dark"] body .pm-header-banner .pm-project-selector,
    html[data-theme="dark"] body .crm-compact-header select,
    html[data-theme="dark"] body .ye-hero-card select {
        background-color: #0f172a !important;
        color: #f8fafc !important;
        border: 1px solid #334155 !important;
        color-scheme: dark !important;
    }

    html[data-theme="dark"] body .mgr-banner .btn-outline-light,
    html[data-theme="dark"] body .fin-header-banner .btn-outline-light,
    html[data-theme="dark"] body .fin-glass-card.card-header-bar .btn-outline-light,
    html[data-theme="dark"] body .inv-header-banner .btn-outline-light,
    html[data-theme="dark"] body .prc-header-banner .btn-outline-light,
    html[data-theme="dark"] body .prc-hero-banner .btn-outline-light,
    html[data-theme="dark"] body .pm-header-banner .btn-outline-light,
    html[data-theme="dark"] body .ss-header-banner .btn-outline-light,
    html[data-theme="dark"] body .crm-executive-banner .btn-outline-light,
    html[data-theme="dark"] body .crm-compact-header .btn-outline-light,
    html[data-theme="dark"] body .sod-hero .sod-btn-white,
    html[data-theme="dark"] body .crm-compact-header button[style*="rgba(255"],
    html[data-theme="dark"] body .crm-compact-header a[style*="rgba(255"],
    html[data-theme="dark"] body .ss-header-banner button[style*="rgba(255"],
    html[data-theme="dark"] body .mgr-banner .btn.text-white[style*="rgba(255"],
    html[data-theme="dark"] body .crm-compact-header .btn.text-white[style*="rgba(255"],
    html[data-theme="dark"] body .pb-header-card .btn.text-white[style*="rgba(255"],
    html[data-theme="dark"] body .ss-header-banner .btn.text-white[style*="rgba(255"],
    html[data-theme="dark"] body #pipeline_stale_radar_bar .btn.text-white,
    html[data-theme="dark"] body #pipeline_stale_radar_bar .btn.text-white[style*="rgba(255"] {
        background: #1e293b !important;
        color: #e2e8f0 !important;
        border: 1px solid #334155 !important;
    }

    html[data-theme="dark"] body .ye-hero-card .ye-hero-meta,
    html[data-theme="dark"] body .nc-header-card .nc-info-item,
    html[data-theme="dark"] body .sub-header-card .sub-info-item,
    html[data-theme="dark"] body .prc-hero-banner .hero-stat-card,
    html[data-theme="dark"] body .crm-compact-header #pipeline_stale_radar_bar,
    html[data-theme="dark"] body .crm-compact-header .bg-black {
        background: #162032 !important;
        border: 1px solid #334155 !important;
        color: #f1f5f9 !important;
    }

    html[data-theme="dark"] body .nc-header-card .nc-info-value,
    html[data-theme="dark"] body .sub-header-card .sub-info-value,
    html[data-theme="dark"] body .nc-header-card .nc-info-value input,
    html[data-theme="dark"] body .nc-header-card .nc-info-value select,
    html[data-theme="dark"] body .sub-header-card .sub-info-value input,
    html[data-theme="dark"] body .crm-compact-header #pipeline_workflow_select,
    html[data-theme="dark"] body .crm-compact-header #pipeline_workflow_select option {
        color: #f8fafc !important;
        background-color: #0f172a !important;
        color-scheme: dark !important;
    }

    /* ----------------------------------------------------------------------
       1.6 CARDS, GLASS PANELS, CARD HEADER BARS, KPI CAPSULES & SHARDS
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] .card,
    html[data-theme="dark"] .panel,
    html[data-theme="dark"] .well,
    html[data-theme="dark"] .glass-card,
    html[data-theme="dark"] .glass-panel,
    html[data-theme="dark"] .fin-glass-card,
    html[data-theme="dark"] .fin-card,
    html[data-theme="dark"] .fin-kpi-card,
    html[data-theme="dark"] .fin-filter-ribbon,
    html[data-theme="dark"] .fin-tab-bar,
    html[data-theme="dark"] .inv-glass-card,
    html[data-theme="dark"] .inv-card,
    html[data-theme="dark"] .inv-kpi-card,
    html[data-theme="dark"] .inv-filter-ribbon,
    html[data-theme="dark"] .inv-tab-bar,
    html[data-theme="dark"] .prc-glass-card,
    html[data-theme="dark"] .prc-card,
    html[data-theme="dark"] .prc-kpi-card,
    html[data-theme="dark"] .prc-filter-ribbon,
    html[data-theme="dark"] .prc-tab-bar,
    html[data-theme="dark"] .crm-glass-card,
    html[data-theme="dark"] .crm-card,
    html[data-theme="dark"] .pm-glass-card,
    html[data-theme="dark"] .pm-card,
    html[data-theme="dark"] .ast-glass-card,
    html[data-theme="dark"] .ast-card,
    html[data-theme="dark"] .att-glass-card,
    html[data-theme="dark"] .att-card,
    html[data-theme="dark"] .pay-glass-card,
    html[data-theme="dark"] .pay-card,
    html[data-theme="dark"] .rec-glass-card,
    html[data-theme="dark"] .rec-card,
    html[data-theme="dark"] .mgr-glass-card,
    html[data-theme="dark"] .mgr-card,
    html[data-theme="dark"] .emp-glass-card,
    html[data-theme="dark"] .emp-card,
    html[data-theme="dark"] .pos-card,
    html[data-theme="dark"] .rst-card,
    html[data-theme="dark"] .cfg-card,
    html[data-theme="dark"] .cp-card,
    html[data-theme="dark"] .dng-card,
    html[data-theme="dark"] .sov-card,
    html[data-theme="dark"] .sov-page-card,
    html[data-theme="dark"] .ms-card,
    html[data-theme="dark"] .ms-glass-card,
    html[data-theme="dark"] .erp-card,
    html[data-theme="dark"] .dash-card,
    html[data-theme="dark"] .bento-card,
    html[data-theme="dark"] .bento-item,
    html[data-theme="dark"] .kpi-capsule,
    html[data-theme="dark"] .kpi-card,
    html[data-theme="dark"] .kpi-accent-card,
    html[data-theme="dark"] .stat-card,
    html[data-theme="dark"] .metric-card,
    html[data-theme="dark"] .app-card,
    html[data-theme="dark"] .module-card,
    html[data-theme="dark"] .service-card,
    html[data-theme="dark"] .action-card,
    html[data-theme="dark"] .summary-card,
    html[data-theme="dark"] .filter-card,
    html[data-theme="dark"] .search-card,
    html[data-theme="dark"] .voucher-card,
    html[data-theme="dark"] .invoice-card,
    html[data-theme="dark"] .report-card,
    html[data-theme="dark"] .widget-card,
    html[data-theme="dark"] .chart-card,
    html[data-theme="dark"] .section-card,
    html[data-theme="dark"] .info-card,
    html[data-theme="dark"] .feature-card,
    html[data-theme="dark"] .portal-card,
    html[data-theme="dark"] .coa-card,
    html[data-theme="dark"] .coa-tree-panel,
    html[data-theme="dark"] .coa-detail-panel {
        background: #111827 !important;
        border-color: #1e293b !important;
        box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.5) !important;
        color: #e2e8f0 !important;
    }

    /* Card Headers & .card-header-bar (Fixes white card headers in Finance/Inventory/HR) */
    html[data-theme="dark"] .card-header,
    html[data-theme="dark"] .card-header-bar,
    html[data-theme="dark"] .panel-heading,
    html[data-theme="dark"] .panel-header,
    html[data-theme="dark"] .card-footer,
    html[data-theme="dark"] .panel-footer,
    html[data-theme="dark"] .fin-card-header,
    html[data-theme="dark"] .inv-card-header,
    html[data-theme="dark"] .prc-card-header,
    html[data-theme="dark"] .crm-card-header,
    html[data-theme="dark"] .pm-card-header,
    html[data-theme="dark"] .mgr-card-header,
    html[data-theme="dark"] .emp-card-header,
    html[data-theme="dark"] .ms-card-header,
    html[data-theme="dark"] .coa-erp-subbar {
        background: #162032 !important;
        border-color: #1e293b !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .card-header-bar h5,
    html[data-theme="dark"] .card-header-bar h6,
    html[data-theme="dark"] .card-header h5,
    html[data-theme="dark"] .card-header h6 {
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .card-body,
    html[data-theme="dark"] .card-body-pad,
    html[data-theme="dark"] .panel-body {
        background: transparent !important;
        color: #e2e8f0 !important;
    }

    /* Hover elevation on interactive cards */
    html[data-theme="dark"] .app-card:hover,
    html[data-theme="dark"] .kpi-capsule:hover,
    html[data-theme="dark"] .kpi-card:hover,
    html[data-theme="dark"] .fin-kpi-card:hover,
    html[data-theme="dark"] .inv-kpi-card:hover,
    html[data-theme="dark"] .stat-card:hover,
    html[data-theme="dark"] .module-card:hover,
    html[data-theme="dark"] .service-card:hover {
        background: #172236 !important;
        border-color: rgba(56, 189, 248, 0.35) !important;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6) !important;
    }

    /* Inner subtle boxes, list items, KPI sub-containers */
    html[data-theme="dark"] .list-group-item,
    html[data-theme="dark"] .activity-item,
    html[data-theme="dark"] .timeline-item,
    html[data-theme="dark"] .task-item,
    html[data-theme="dark"] .notification-item,
    html[data-theme="dark"] .emp-info-box,
    html[data-theme="dark"] .mgr-stat-pill,
    html[data-theme="dark"] .fin-stat-box,
    html[data-theme="dark"] .inv-stat-box,
    html[data-theme="dark"] .prc-stat-box,
    html[data-theme="dark"] .crm-stat-box,
    html[data-theme="dark"] .pm-stat-box,
    html[data-theme="dark"] .sub-card,
    html[data-theme="dark"] .inner-box,
    html[data-theme="dark"] .meta-box,
    html[data-theme="dark"] .detail-row,
    html[data-theme="dark"] .info-row,
    html[data-theme="dark"] .summary-row,
    html[data-theme="dark"] .totals-box,
    html[data-theme="dark"] .invoice-totals,
    html[data-theme="dark"] .voucher-totals {
        background-color: #162032 !important;
        border-color: #1e293b !important;
        color: #e2e8f0 !important;
    }

    /* ----------------------------------------------------------------------
       1.7 TYPOGRAPHY, HEADINGS & UTILITY CLASSES (.text-navy, .text-dark, etc.)
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] h1,
    html[data-theme="dark"] h2,
    html[data-theme="dark"] h3,
    html[data-theme="dark"] h4,
    html[data-theme="dark"] h5,
    html[data-theme="dark"] h6,
    html[data-theme="dark"] .h1,
    html[data-theme="dark"] .h2,
    html[data-theme="dark"] .h3,
    html[data-theme="dark"] .h4,
    html[data-theme="dark"] .h5,
    html[data-theme="dark"] .h6,
    html[data-theme="dark"] .card-title,
    html[data-theme="dark"] .header-title,
    html[data-theme="dark"] .section-title,
    html[data-theme="dark"] .module-title,
    html[data-theme="dark"] .kpi-value,
    html[data-theme="dark"] .fin-kpi-value,
    html[data-theme="dark"] .inv-kpi-value,
    html[data-theme="dark"] .prc-kpi-value,
    html[data-theme="dark"] .stat-value,
    html[data-theme="dark"] .metric-value,
    html[data-theme="dark"] .app-card-title {
        color: #f8fafc !important;
    }

    html[data-theme="dark"] label,
    html[data-theme="dark"] .form-label,
    html[data-theme="dark"] .control-label,
    html[data-theme="dark"] .col-form-label,
    html[data-theme="dark"] .field-label {
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] .text-navy,
    html[data-theme="dark"] body .text-navy,
    html[data-theme="dark"] .text-dark,
    html[data-theme="dark"] body .text-dark,
    html[data-theme="dark"] .text-black,
    html[data-theme="dark"] .text-body {
        color: #f1f5f9 !important;
    }

    html[data-theme="dark"] .text-muted,
    html[data-theme="dark"] .text-secondary,
    html[data-theme="dark"] .kpi-label,
    html[data-theme="dark"] .fin-kpi-label,
    html[data-theme="dark"] .inv-kpi-label,
    html[data-theme="dark"] .prc-kpi-label,
    html[data-theme="dark"] .kpi-accent-card .kpi-label,
    html[data-theme="dark"] .kpi-accent-card .kpi-sub,
    html[data-theme="dark"] .stat-label,
    html[data-theme="dark"] .sub-text,
    html[data-theme="dark"] small {
        color: #94a3b8 !important;
    }

    /* High-contrast semantic text colors inside Inventory/Finance views */
    html[data-theme="dark"] .inv-wrapper .text-info,
    html[data-theme="dark"] .fin-wrapper .text-info { color: #38bdf8 !important; }
    html[data-theme="dark"] .inv-wrapper .text-success,
    html[data-theme="dark"] .fin-wrapper .text-success { color: #34d399 !important; }
    html[data-theme="dark"] .inv-wrapper .text-danger,
    html[data-theme="dark"] .fin-wrapper .text-danger { color: #f87171 !important; }
    html[data-theme="dark"] .inv-wrapper .text-warning,
    html[data-theme="dark"] .fin-wrapper .text-warning { color: #fbbf24 !important; }
    html[data-theme="dark"] .inv-wrapper .text-muted,
    html[data-theme="dark"] .fin-wrapper .text-muted { color: #94a3b8 !important; }

    /* Bootstrap & Utility Background Overrides */
    html[data-theme="dark"] .bg-white,
    html[data-theme="dark"] .bg-light,
    html[data-theme="dark"] .bg-light-soft,
    html[data-theme="dark"] body .bg-light-soft,
    html[data-theme="dark"] .bg-soft,
    html[data-theme="dark"] .bg-gray-50,
    html[data-theme="dark"] .bg-gray-100,
    html[data-theme="dark"] .bg-slate-50,
    html[data-theme="dark"] .bg-slate-100 {
        background-color: #162033 !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] .border,
    html[data-theme="dark"] .border-top,
    html[data-theme="dark"] .border-bottom,
    html[data-theme="dark"] .border-left,
    html[data-theme="dark"] .border-right,
    html[data-theme="dark"] .border-light {
        border-color: #334155 !important;
    }

    html[data-theme="dark"] hr {
        border-color: #1e293b !important;
        opacity: 1 !important;
    }

    /* ----------------------------------------------------------------------
       1.8 TABLES, DATAGRIDS, JSGRID, CHART OF ACCOUNTS & PAGINATION
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] .table-responsive,
    html[data-theme="dark"] .modal-table-scroll-container,
    html[data-theme="dark"] .table-scroll-container,
    html[data-theme="dark"] .dataTables_wrapper,
    html[data-theme="dark"] .grid-container,
    html[data-theme="dark"] .table-container,
    html[data-theme="dark"] .fin-table-wrap,
    html[data-theme="dark"] .inv-table-wrap,
    html[data-theme="dark"] .prc-table-wrap,
    html[data-theme="dark"] .inv-modern-grid,
    html[data-theme="dark"] .inv-modern-grid.jsgrid,
    html[data-theme="dark"] #stkJsGridContainer {
        background-color: #111827 !important;
        border-color: #1e293b !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] table,
    html[data-theme="dark"] .table,
    html[data-theme="dark"] .fin-table,
    html[data-theme="dark"] .inv-table,
    html[data-theme="dark"] .prc-table,
    html[data-theme="dark"] .crm-table,
    html[data-theme="dark"] .pm-table,
    html[data-theme="dark"] .mgr-table,
    html[data-theme="dark"] .emp-table,
    html[data-theme="dark"] .ast-table,
    html[data-theme="dark"] .att-table,
    html[data-theme="dark"] .pay-table,
    html[data-theme="dark"] .rec-table,
    html[data-theme="dark"] .erp-table,
    html[data-theme="dark"] .ms-table,
    html[data-theme="dark"] .coa-table-erp,
    html[data-theme="dark"] .custom-table,
    html[data-theme="dark"] .report-table,
    html[data-theme="dark"] .jsgrid-table,
    html[data-theme="dark"] .dataTable {
        background-color: #111827 !important;
        color: #e2e8f0 !important;
        border-color: #1e293b !important;
    }

    html[data-theme="dark"] table:not(.ui-datepicker-calendar):not(.table-condensed) thead,
    html[data-theme="dark"] table:not(.ui-datepicker-calendar):not(.table-condensed) thead tr,
    html[data-theme="dark"] table:not(.ui-datepicker-calendar):not(.table-condensed) thead th,
    html[data-theme="dark"] .table:not(.table-condensed) thead th,
    html[data-theme="dark"] .table-light,
    html[data-theme="dark"] .table-light > th,
    html[data-theme="dark"] .table-light > td,
    html[data-theme="dark"] .thead-light th,
    html[data-theme="dark"] .fin-table thead th,
    html[data-theme="dark"] .inv-table thead th,
    html[data-theme="dark"] .prc-table thead th,
    html[data-theme="dark"] .crm-table thead th,
    html[data-theme="dark"] .pm-table thead th,
    html[data-theme="dark"] .mgr-table thead th,
    html[data-theme="dark"] .emp-table thead th,
    html[data-theme="dark"] .coa-table-erp thead th,
    html[data-theme="dark"] .inv-wrapper table th,
    html[data-theme="dark"] table.custom-table th,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-grid-header,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-header-row > th.jsgrid-header-cell,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-header-row th.jsgrid-header-cell {
        background: #162032 !important;
        color: #cbd5e1 !important;
        border-color: #1e293b !important;
        border-bottom: 1px solid #334155 !important;
    }

    html[data-theme="dark"] table:not(.ui-datepicker-calendar):not(.table-condensed) tbody tr,
    html[data-theme="dark"] .table:not(.table-condensed) tbody tr,
    html[data-theme="dark"] .coa-row-leaf,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-row,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-row > td.jsgrid-cell,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-row td.jsgrid-cell {
        background-color: #111827 !important;
        border-color: #1e293b !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd),
    html[data-theme="dark"] table.table-striped tbody tr:nth-child(odd),
    html[data-theme="dark"] .coa-row-parent,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-alt-row,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-alt-row > td.jsgrid-cell,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-alt-row td.jsgrid-cell {
        background-color: #151f32 !important;
        border-color: #1e293b !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] table:not(.ui-datepicker-calendar):not(.table-condensed) tbody tr:hover,
    html[data-theme="dark"] .table-hover tbody tr:hover,
    html[data-theme="dark"] .fin-table tbody tr:hover,
    html[data-theme="dark"] .inv-table tbody tr:hover,
    html[data-theme="dark"] .prc-table tbody tr:hover,
    html[data-theme="dark"] .coa-row-parent:hover,
    html[data-theme="dark"] .coa-row-leaf:hover,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-row:hover > td.jsgrid-cell,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-alt-row:hover > td.jsgrid-cell,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-row:hover td,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-alt-row:hover td {
        background-color: rgba(56, 189, 248, 0.10) !important;
        color: #ffffff !important;
    }

    /* Special Group & Balance Rows in jsGrid / Reports */
    html[data-theme="dark"] .inv-modern-grid tr.mat-group-header-row > td.jsgrid-cell,
    html[data-theme="dark"] .inv-modern-grid tr.mat-group-header-row td.jsgrid-cell,
    html[data-theme="dark"] .inv-modern-grid tr.table-primary > td.jsgrid-cell,
    html[data-theme="dark"] tr.table-info,
    html[data-theme="dark"] tr.table-info > td,
    html[data-theme="dark"] tr.table-info > th {
        background: linear-gradient(90deg, #172554 0%, #1e293b 100%) !important;
        color: #93c5fd !important;
        border-top-color: #3b82f6 !important;
        border-bottom-color: #3b82f6 !important;
    }

    html[data-theme="dark"] .inv-modern-grid tr.mat-prev-bal-row > td.jsgrid-cell,
    html[data-theme="dark"] .inv-modern-grid tr.mat-prev-bal-row td.jsgrid-cell {
        background: #272011 !important;
        color: #fcd34d !important;
        border-bottom-color: #d97706 !important;
    }

    html[data-theme="dark"] table td,
    html[data-theme="dark"] table th,
    html[data-theme="dark"] .table td,
    html[data-theme="dark"] .table th,
    html[data-theme="dark"] .table-bordered td,
    html[data-theme="dark"] .table-bordered th {
        border-color: #1e293b !important;
        color: #e2e8f0 !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 {
        background-color: #162032 !important;
        border-color: #334155 !important;
        color: #f8fafc !important;
        font-weight: 700;
    }

    /* Trial Balance, Account Balances & Financial Statement Report Tables */
    html[data-theme="dark"] body #tb_table_container,
    html[data-theme="dark"] body #ab_table_container,
    html[data-theme="dark"] body #aging_table_container,
    html[data-theme="dark"] body .fin-report-container .table-responsive {
        background-color: #0f172a !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] body .fin-tb-table th,
    html[data-theme="dark"] body #tb_thead_row1 th,
    html[data-theme="dark"] body #tb_thead_row2 th,
    html[data-theme="dark"] body .fin-ab-table th {
        background-color: #162033 !important;
        color: #cbd5e1 !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] body table th.bg-light-soft,
    html[data-theme="dark"] body .fin-tb-table th.bg-light-soft {
        background-color: #172554 !important;
        color: #93c5fd !important;
        border-color: #1e3a8a !important;
    }

    html[data-theme="dark"] body table tbody td.bg-light-soft,
    html[data-theme="dark"] body .fin-tb-table tbody td.bg-light-soft {
        background-color: rgba(30, 58, 138, 0.16) !important;
        color: #f8fafc !important;
        border-color: #1e293b !important;
    }

    html[data-theme="dark"] body table tfoot td.bg-light-soft,
    html[data-theme="dark"] body #tb_main_table tfoot tr td.bg-light-soft {
        background-color: #1e293b !important;
        color: #38bdf8 !important;
    }

    html[data-theme="dark"] body .tb-row-main-lvl0,
    html[data-theme="dark"] body .tb-lvl-1 {
        background-color: #172554 !important;
        color: #f8fafc !important;
        border-inline-start-color: #3b82f6 !important;
    }

    html[data-theme="dark"] body .tb-row-main,
    html[data-theme="dark"] body .tb-lvl-2 {
        background-color: #152036 !important;
        color: #e2e8f0 !important;
        border-inline-start-color: #60a5fa !important;
    }

    html[data-theme="dark"] body .tb-row-sub {
        background-color: #0f172a !important;
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] body .tb-row-sub:hover,
    html[data-theme="dark"] body .tb-row-main:hover,
    html[data-theme="dark"] body .tb-row-main-lvl0:hover {
        background-color: rgba(56, 189, 248, 0.12) !important;
    }

    html[data-theme="dark"] body .tb-badge-main {
        background-color: rgba(37, 99, 235, 0.22) !important;
        color: #93c5fd !important;
        border-color: rgba(59, 130, 246, 0.4) !important;
    }

    html[data-theme="dark"] body .tb-badge-sub {
        background-color: rgba(16, 185, 129, 0.2) !important;
        color: #6ee7b7 !important;
        border-color: rgba(16, 185, 129, 0.35) !important;
    }

    html[data-theme="dark"] body .tb-drill-btn,
    html[data-theme="dark"] body .tb-filter-pill {
        background-color: #1e293b !important;
        color: #cbd5e1 !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] body .tb-drill-btn:hover,
    html[data-theme="dark"] body .tb-filter-pill.active {
        background-color: #2563eb !important;
        color: #ffffff !important;
        border-color: #3b82f6 !important;
    }

    html[data-theme="dark"] body .fin-statement-table tbody tr.fin-stmt-row-category {
        background-color: #162033 !important;
    }

    html[data-theme="dark"] body .fin-statement-table tbody tr.fin-stmt-row-category td {
        color: #f8fafc !important;
    }

    html[data-theme="dark"] body .fin-statement-table tbody tr.fin-stmt-row-detail {
        background-color: #0f172a !important;
    }

    html[data-theme="dark"] body .fin-statement-table tbody tr.fin-stmt-row-detail td {
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] body .fin-statement-table tbody tr.fin-stmt-row-subtotal {
        background-color: #172554 !important;
        border-top-color: #3b82f6 !important;
        border-bottom-color: #60a5fa !important;
    }

    html[data-theme="dark"] body .fin-statement-table tbody tr.fin-stmt-row-subtotal td {
        color: #93c5fd !important;
    }

    html[data-theme="dark"] body .fin-statement-table tbody tr.fin-stmt-row-grandtotal {
        background: linear-gradient(90deg, #172554 0%, #1e293b 100%) !important;
        border-top-color: #3b82f6 !important;
        border-bottom-color: #60a5fa !important;
    }

    html[data-theme="dark"] body .fin-statement-table tbody tr.fin-stmt-row-grandtotal td {
        color: #f8fafc !important;
    }

    html[data-theme="dark"] body .fin-statement-table tbody tr.fin-stmt-row-netprofit {
        background: linear-gradient(90deg, rgba(6, 78, 59, 0.55) 0%, rgba(16, 185, 129, 0.18) 100%) !important;
    }

    html[data-theme="dark"] body .fin-statement-table tbody tr.fin-stmt-row-netprofit td {
        color: #6ee7b7 !important;
    }

    /* Chart of Accounts & Cost Centers Specific Controls */
    html[data-theme="dark"] .coa-erp-search-group,
    html[data-theme="dark"] .coa-segmented-ctrl {
        background: #0f172a !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] .coa-erp-search-input {
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .coa-erp-search-modal-btn,
    html[data-theme="dark"] .coa-toggle-btn {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #60a5fa !important;
    }

    html[data-theme="dark"] .coa-toggle-btn.expanded,
    html[data-theme="dark"] .coa-toggle-btn:hover {
        background: #2563eb !important;
        border-color: #3b82f6 !important;
        color: #ffffff !important;
    }

    html[data-theme="dark"] .coa-seg-btn,
    html[data-theme="dark"] .coa-class-pill {
        color: #94a3b8 !important;
    }

    html[data-theme="dark"] .coa-seg-btn:hover,
    html[data-theme="dark"] .coa-class-pill:hover {
        background: #1e293b !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .coa-seg-btn.active {
        background: #2563eb !important;
        color: #ffffff !important;
    }

    html[data-theme="dark"] .coa-class-pill.active {
        background: #2563eb !important;
        color: #ffffff !important;
    }

    html[data-theme="dark"] .coa-seg-divider {
        background: #334155 !important;
    }

    html[data-theme="dark"] .coa-code-chip {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] .coa-row-parent .coa-code-chip {
        background: #1e3a8a !important;
        border-color: #3b82f6 !important;
        color: #bfdbfe !important;
    }

    /* Pagination & DataTables / jsGrid Controls */
    html[data-theme="dark"] .page-link,
    html[data-theme="dark"] .pagination > li > a,
    html[data-theme="dark"] .pagination > li > span,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-pager-page a,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-pager-nav-button a,
    html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
        background-color: #162032 !important;
        border-color: #334155 !important;
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] .page-item.active .page-link,
    html[data-theme="dark"] .pagination > .active > a,
    html[data-theme="dark"] .inv-modern-grid .jsgrid-pager-current-page,
    html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current {
        background: linear-gradient(135deg, #2563eb, #0284c7) !important;
        border-color: #3b82f6 !important;
        color: #ffffff !important;
    }

    /* ----------------------------------------------------------------------
       1.9 FORMS, INPUTS, SELECTS, SELECT2, CHOSEN & DATEPICKERS
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    html[data-theme="dark"] select,
    html[data-theme="dark"] textarea,
    html[data-theme="dark"] .form-control,
    html[data-theme="dark"] .form-select,
    html[data-theme="dark"] .custom-select,
    html[data-theme="dark"] .fin-input,
    html[data-theme="dark"] .fin-select,
    html[data-theme="dark"] .inv-input,
    html[data-theme="dark"] .inv-select,
    html[data-theme="dark"] .prc-input,
    html[data-theme="dark"] .prc-select,
    html[data-theme="dark"] .crm-input,
    html[data-theme="dark"] .pm-input,
    html[data-theme="dark"] .mgr-input,
    html[data-theme="dark"] .emp-input,
    html[data-theme="dark"] .erp-input,
    html[data-theme="dark"] .ms-input,
    html[data-theme="dark"] .search-input,
    html[data-theme="dark"] .filter-input {
        background-color: #0f172a !important;
        border-color: #334155 !important;
        color: #f8fafc !important;
        box-shadow: none !important;
    }

    html[data-theme="dark"] input:focus,
    html[data-theme="dark"] select:focus,
    html[data-theme="dark"] textarea:focus,
    html[data-theme="dark"] .form-control:focus,
    html[data-theme="dark"] .custom-select:focus {
        background-color: #0f172a !important;
        border-color: #38bdf8 !important;
        color: #ffffff !important;
        box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18) !important;
    }

    html[data-theme="dark"] input[readonly],
    html[data-theme="dark"] input[disabled],
    html[data-theme="dark"] select[disabled],
    html[data-theme="dark"] textarea[readonly],
    html[data-theme="dark"] textarea[disabled],
    html[data-theme="dark"] .form-control:disabled,
    html[data-theme="dark"] .form-control[readonly] {
        background-color: #162032 !important;
        border-color: #1e293b !important;
        color: #94a3b8 !important;
        opacity: 0.85;
    }

    html[data-theme="dark"] input::placeholder,
    html[data-theme="dark"] textarea::placeholder,
    html[data-theme="dark"] .form-control::placeholder {
        color: #64748b !important;
    }

    html[data-theme="dark"] select option {
        background-color: #0f172a !important;
        color: #f1f5f9 !important;
    }

    /* Input Groups & Addons */
    html[data-theme="dark"] .input-group-text,
    html[data-theme="dark"] .input-group-addon,
    html[data-theme="dark"] .input-group-prepend .btn-light,
    html[data-theme="dark"] .input-group-append .btn-light {
        background-color: #1e293b !important;
        border-color: #334155 !important;
        color: #cbd5e1 !important;
    }

    /* Select2 v3 & v4 */
    html[data-theme="dark"] .select2-container--default .select2-selection--single,
    html[data-theme="dark"] .select2-container--default .select2-selection--multiple,
    html[data-theme="dark"] .select2-container .select2-choice,
    html[data-theme="dark"] .select2-container-multi .select2-choices {
        background: #0f172a !important;
        border-color: #334155 !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
    html[data-theme="dark"] .select2-container .select2-choice > .select2-chosen {
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .select2-dropdown,
    html[data-theme="dark"] .select2-drop,
    html[data-theme="dark"] .coa-search-results-dropdown {
        background: #111827 !important;
        border-color: #334155 !important;
        color: #e2e8f0 !important;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6) !important;
    }

    html[data-theme="dark"] .select2-search--dropdown .select2-search__field,
    html[data-theme="dark"] .select2-search input {
        background: #0f172a !important;
        border-color: #334155 !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .select2-results__option,
    html[data-theme="dark"] .select2-results li,
    html[data-theme="dark"] .coa-search-item {
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"] {
        background-color: #1e293b !important;
        color: #38bdf8 !important;
    }

    html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected],
    html[data-theme="dark"] .select2-results .select2-highlighted,
    html[data-theme="dark"] .coa-search-item:hover {
        background: #2563eb !important;
        color: #ffffff !important;
    }

    /* jQuery UI Datepicker & Bootstrap Datepicker */
    html[data-theme="dark"] #ui-datepicker-div,
    html[data-theme="dark"] .ui-widget-content,
    html[data-theme="dark"] .ui-datepicker,
    html[data-theme="dark"] .datepicker-dropdown,
    html[data-theme="dark"] .daterangepicker {
        background: #111827 !important;
        border-color: #334155 !important;
        color: #e2e8f0 !important;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6) !important;
    }

    html[data-theme="dark"] .ui-datepicker .ui-datepicker-header,
    html[data-theme="dark"] .ui-datepicker-header,
    html[data-theme="dark"] .ui-widget-header {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .ui-datepicker .ui-datepicker-title,
    html[data-theme="dark"] .ui-datepicker .ui-datepicker-title select.ui-datepicker-month,
    html[data-theme="dark"] .ui-datepicker .ui-datepicker-title select.ui-datepicker-year {
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .ui-datepicker .ui-datepicker-title select.ui-datepicker-month,
    html[data-theme="dark"] .ui-datepicker .ui-datepicker-title select.ui-datepicker-year {
        background-color: #0f172a !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] .ui-datepicker .ui-datepicker-prev,
    html[data-theme="dark"] .ui-datepicker .ui-datepicker-next {
        background-color: #0f172a !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] .ui-datepicker .ui-datepicker-prev {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10 3 5 8l5 5'/%3e%3c/svg%3e") !important;
    }

    html[data-theme="dark"] .ui-datepicker .ui-datepicker-next {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 3 5 5-5 5'/%3e%3c/svg%3e") !important;
    }

    html[data-theme="dark"] .ui-datepicker.ui-datepicker-rtl .ui-datepicker-prev {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 3 5 5-5 5'/%3e%3c/svg%3e") !important;
    }

    html[data-theme="dark"] .ui-datepicker.ui-datepicker-rtl .ui-datepicker-next {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10 3 5 8l5 5'/%3e%3c/svg%3e") !important;
    }

    html[data-theme="dark"] .ui-datepicker table.ui-datepicker-calendar th {
        color: #94a3b8 !important;
        background: transparent !important;
        border: 0 !important;
    }

    html[data-theme="dark"] .ui-datepicker table.ui-datepicker-calendar td {
        background: transparent !important;
        border: 0 !important;
    }

    html[data-theme="dark"] .ui-datepicker table.ui-datepicker-calendar td a,
    html[data-theme="dark"] .ui-datepicker table.ui-datepicker-calendar td span,
    html[data-theme="dark"] .ui-state-default,
    html[data-theme="dark"] .ui-widget-content .ui-state-default {
        background: #162032 !important;
        border-color: #1e293b !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] .ui-datepicker table.ui-datepicker-calendar td a:hover,
    html[data-theme="dark"] .ui-datepicker table.ui-datepicker-calendar td.ui-datepicker-today a,
    html[data-theme="dark"] .ui-datepicker table.ui-datepicker-calendar td a.ui-state-active,
    html[data-theme="dark"] .ui-state-highlight,
    html[data-theme="dark"] .ui-state-active,
    html[data-theme="dark"] .ui-state-hover {
        background: #2563eb !important;
        border-color: #3b82f6 !important;
        color: #ffffff !important;
    }

    /* ----------------------------------------------------------------------
       1.10 TABS, NAV PILLS, ACCORDIONS & SEGMENTED CONTROLS
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] .nav-tabs {
        border-bottom-color: #1e293b !important;
    }

    /* Overrides .nav.nav-pills { background-color: #fbfbfb } in app.css / app-rtl.css */
    html[data-theme="dark"] body .nav.nav-pills,
    html[data-theme="dark"] body .nav-pills,
    html[data-theme="dark"] body #archiveTabs,
    html[data-theme="dark"] body #leaveTabs.nav-pills,
    html[data-theme="dark"] body #loanTabs.nav-pills,
    html[data-theme="dark"] body #custodyTabs.nav-pills,
    html[data-theme="dark"] body #p_shift_tabs,
    html[data-theme="dark"] body #progress_sub_tabs,
    html[data-theme="dark"] body .chat-box-left .nav-pills,
    html[data-theme="dark"] body .inv-tab-pill-bar,
    html[data-theme="dark"] body .crm-sub-nav,
    html[data-theme="dark"] body .leads-filter-bar,
    html[data-theme="dark"] body .crm-filter-ribbon {
        background: #0f172a !important;
        background-color: #0f172a !important;
        border: 1px solid #1e293b !important;
        border-radius: 12px !important;
    }

    html[data-theme="dark"] body #archiveTabs,
    html[data-theme="dark"] body .nav.nav-pills:not(.flex-column) {
        padding: 6px !important;
        gap: 6px !important;
    }

    html[data-theme="dark"] body .nav.nav-pills.flex-column {
        background: transparent !important;
        background-color: transparent !important;
        border-color: transparent !important;
    }

    html[data-theme="dark"] .nav-tabs .nav-link,
    html[data-theme="dark"] .nav-pills .nav-link,
    html[data-theme="dark"] body #archiveTabs .nav-link,
    html[data-theme="dark"] body #leaveTabs.nav-pills .nav-link,
    html[data-theme="dark"] body #loanTabs.nav-pills .nav-link,
    html[data-theme="dark"] body #custodyTabs.nav-pills .nav-link,
    html[data-theme="dark"] body .crm-sub-btn,
    html[data-theme="dark"] body .filter-chip,
    html[data-theme="dark"] .fin-tab,
    html[data-theme="dark"] .inv-tab,
    html[data-theme="dark"] .prc-tab,
    html[data-theme="dark"] .crm-tab,
    html[data-theme="dark"] .pm-tab,
    html[data-theme="dark"] .mgr-tab,
    html[data-theme="dark"] .emp-tab,
    html[data-theme="dark"] .mat-view-btn {
        color: #94a3b8 !important;
        background: transparent !important;
        background-color: transparent !important;
        border-color: transparent !important;
    }

    html[data-theme="dark"] body .filter-chip {
        background: #162033 !important;
        border-color: #334155 !important;
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] .nav-tabs .nav-link:hover,
    html[data-theme="dark"] .nav-pills .nav-link:hover,
    html[data-theme="dark"] body #archiveTabs .nav-link:hover,
    html[data-theme="dark"] body #leaveTabs.nav-pills .nav-link:hover,
    html[data-theme="dark"] body #loanTabs.nav-pills .nav-link:hover,
    html[data-theme="dark"] body #custodyTabs.nav-pills .nav-link:hover,
    html[data-theme="dark"] body .crm-sub-btn:hover,
    html[data-theme="dark"] body .filter-chip:hover,
    html[data-theme="dark"] .mat-view-btn:hover {
        color: #f8fafc !important;
        background-color: rgba(59, 130, 246, 0.12) !important;
        border-color: #334155 !important;
    }

    .overflow-y-auto,
    #overview_alerts_container {
        overflow-y: auto !important;
        overflow-x: hidden !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 .nav-item.show .nav-link,
    html[data-theme="dark"] body #archiveTabs .nav-link.active,
    html[data-theme="dark"] body #leaveTabs.nav-pills .nav-link.active,
    html[data-theme="dark"] body #loanTabs.nav-pills .nav-link.active,
    html[data-theme="dark"] body #custodyTabs.nav-pills .nav-link.active,
    html[data-theme="dark"] body .crm-sub-btn.active,
    html[data-theme="dark"] body .filter-chip.active,
    html[data-theme="dark"] .fin-tab.active,
    html[data-theme="dark"] .inv-tab.active,
    html[data-theme="dark"] .prc-tab.active,
    html[data-theme="dark"] .crm-tab.active,
    html[data-theme="dark"] .pm-tab.active,
    html[data-theme="dark"] .mat-view-btn.active,
    html[data-theme="dark"] body .mfg-nav-link.active,
    html[data-theme="dark"] body .manual-nav-btn.active,
    html[data-theme="dark"] body .pm-nav-btn.active,
    html[data-theme="dark"] body #p_shift_tabs .nav-link.active,
    html[data-theme="dark"] body .op-pill.active,
    html[data-theme="dark"] body .crm-modal-tabs .nav-link.active {
        background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
        background-color: #1e3a8a !important;
        border-color: #3b82f6 !important;
        color: #ffffff !important;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
    }

    html[data-theme="dark"] body .mfg-nav-link.active span,
    html[data-theme="dark"] body .pm-nav-btn.active span,
    html[data-theme="dark"] body #archiveTabs .nav-link.active i,
    html[data-theme="dark"] body #leaveTabs.nav-pills .nav-link.active i,
    html[data-theme="dark"] body #loanTabs.nav-pills .nav-link.active i,
    html[data-theme="dark"] body #custodyTabs.nav-pills .nav-link.active i {
        color: #ffffff !important;
    }

    html[data-theme="dark"] body .mfg-nav-pills {
        background: #111827 !important;
        border-color: #1e293b !important;
    }

    html[data-theme="dark"] body .mfg-btn-secondary {
        background: #162033 !important;
        border-color: #334155 !important;
        color: #f1f5f9 !important;
    }

    html[data-theme="dark"] body .mfg-btn-secondary:hover {
        background: #1e293b !important;
        border-color: #3b82f6 !important;
        color: #ffffff !important;
    }

    /* ----------------------------------------------------------------------
       1.11 MODALS, SEARCH DIALOGS, SWEETALERT2 & NOTIFICATIONS
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] .modal-content,
    html[data-theme="dark"] body .global-erp-search-modal .modal-content,
    html[data-theme="dark"] body .search-modal-content,
    html[data-theme="dark"] .coa-modal-glass,
    html[data-theme="dark"] .ui-dialog {
        background: #111827 !important;
        background-color: #111827 !important;
        border: 1px solid #334155 !important;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75) !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] .modal-header,
    html[data-theme="dark"] body .search-modal-header,
    html[data-theme="dark"] .coa-modal-header,
    html[data-theme="dark"] .ui-dialog-titlebar {
        background: #162032 !important;
        background-color: #162032 !important;
        border-bottom: 1px solid #1e293b !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .modal-title,
    html[data-theme="dark"] body .search-modal-title {
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .modal-body,
    html[data-theme="dark"] body .search-modal-body,
    html[data-theme="dark"] .coa-modal-body,
    html[data-theme="dark"] .ui-dialog-content {
        background: #111827 !important;
        background-color: #111827 !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] .modal-footer,
    html[data-theme="dark"] body .search-modal-footer,
    html[data-theme="dark"] .coa-modal-footer,
    html[data-theme="dark"] .ui-dialog-buttonpane {
        background: #0f172a !important;
        background-color: #0f172a !important;
        border-top: 1px solid #1e293b !important;
    }

    html[data-theme="dark"] body .search-input-control,
    html[data-theme="dark"] body .search-input-control:focus {
        background: #0f172a !important;
        border-color: #334155 !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] body .search-input-hint {
        background: #1e293b !important;
        color: #94a3b8 !important;
    }

    html[data-theme="dark"] body .search-results-container {
        background: #111827 !important;
        border-color: #1e293b !important;
    }

    html[data-theme="dark"] body .search-results-container table thead th {
        background: #162032 !important;
        color: #cbd5e1 !important;
        border-bottom-color: #334155 !important;
    }

    html[data-theme="dark"] body .search-results-container table tbody td {
        color: #e2e8f0 !important;
        border-bottom-color: #1e293b !important;
    }

    html[data-theme="dark"] body .search-results-container table tbody tr:nth-child(even) {
        background-color: #151f32 !important;
    }

    html[data-theme="dark"] body .search-results-container table tbody tr:hover,
    html[data-theme="dark"] body .search-results-container table tbody tr.listview_hover_selected {
        background-color: #1e293b !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] body .search-results-container table tbody tr.listview_selected,
    html[data-theme="dark"] body .search-results-container table tbody tr.listview_selected:hover {
        background-color: rgba(37, 99, 235, 0.25) !important;
        color: #ffffff !important;
    }

    html[data-theme="dark"] body .search-results-container table tbody tr.listview_selected td,
    html[data-theme="dark"] body .search-results-container table tbody tr.listview_selected:hover td,
    html[data-theme="dark"] body .search-results-container table tbody tr.listview_selected td *,
    html[data-theme="dark"] body .search-results-container table tbody tr.listview_selected:hover td * {
        color: #ffffff !important;
    }

    html[data-theme="dark"] body .form-switch-custom {
        background: #162033 !important;
        border-color: #1e293b !important;
    }

    html[data-theme="dark"] body .form-switch-custom:hover {
        background: #1e293b !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] body .form-switch-custom label {
        color: #e2e8f0 !important;
    }

    /* Universal Toggle Switches & Checkboxes in Dark Mode (.sov-switch, .toggle-switch, .ye-switch, .custom-switch) */
    html[data-theme="dark"] input[type="checkbox"],
    html[data-theme="dark"] input[type="radio"],
    html[data-theme="dark"] .form-check-input {
        accent-color: #3b82f6 !important;
        color-scheme: dark !important;
    }

    html[data-theme="dark"] body .sov-switch input:not(:checked) + .sov-slider,
    html[data-theme="dark"] body .toggle-switch input:not(:checked) + .slider,
    html[data-theme="dark"] body .switch input:not(:checked) + .slider,
    html[data-theme="dark"] body input:not(:checked) + .sov-slider,
    html[data-theme="dark"] body input:not(:checked) + .slider,
    html[data-theme="dark"] body .ye-switch input:not(:checked) + .ye-switch-slider {
        background: #1e293b !important;
        background-color: #1e293b !important;
        box-shadow: inset 0 0 0 1.5px #475569, inset 0 1px 3px rgba(0, 0, 0, 0.5) !important;
    }

    html[data-theme="dark"] body .sov-switch input:not(:checked) + .sov-slider:before,
    html[data-theme="dark"] body .toggle-switch input:not(:checked) + .slider:before,
    html[data-theme="dark"] body .switch input:not(:checked) + .slider:before,
    html[data-theme="dark"] body input:not(:checked) + .sov-slider:before,
    html[data-theme="dark"] body input:not(:checked) + .slider:before,
    html[data-theme="dark"] body .ye-switch input:not(:checked) + .ye-switch-slider:before {
        background-color: #94a3b8 !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45) !important;
    }

    html[data-theme="dark"] body .sov-switch input:checked + .sov-slider,
    html[data-theme="dark"] body .toggle-switch input:checked + .slider,
    html[data-theme="dark"] body .switch input:checked + .slider,
    html[data-theme="dark"] body input:checked + .sov-slider,
    html[data-theme="dark"] body input:checked + .slider,
    html[data-theme="dark"] body .ye-switch input:checked + .ye-switch-slider {
        background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
        background-color: #2563eb !important;
        box-shadow: inset 0 0 0 1px #60a5fa, 0 0 12px rgba(59, 130, 246, 0.45) !important;
    }

    html[data-theme="dark"] body .sov-switch input:checked + .sov-slider:before,
    html[data-theme="dark"] body .toggle-switch input:checked + .slider:before,
    html[data-theme="dark"] body .switch input:checked + .slider:before,
    html[data-theme="dark"] body input:checked + .sov-slider:before,
    html[data-theme="dark"] body input:checked + .slider:before,
    html[data-theme="dark"] body .ye-switch input:checked + .ye-switch-slider:before {
        background-color: #ffffff !important;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35) !important;
    }

    html[data-theme="dark"] body .custom-switch .custom-control-input:not(:checked) ~ .custom-control-label::before {
        background-color: #1e293b !important;
        border-color: #475569 !important;
    }

    html[data-theme="dark"] body .custom-switch .custom-control-input:not(:checked) ~ .custom-control-label::after {
        background-color: #94a3b8 !important;
    }

    html[data-theme="dark"] body .custom-switch .custom-control-input:checked ~ .custom-control-label::before {
        background-color: #2563eb !important;
        border-color: #60a5fa !important;
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.4) !important;
    }

    html[data-theme="dark"] body .custom-switch .custom-control-input:checked ~ .custom-control-label::after {
        background-color: #ffffff !important;
    }

    html[data-theme="dark"] .close,
    html[data-theme="dark"] .btn-close {
        color: #cbd5e1 !important;
        text-shadow: none !important;
    }

    /* SweetAlert2 */
    html[data-theme="dark"] .swal2-popup,
    html[data-theme="dark"] .swal2-toast {
        background: #111827 !important;
        border: 1px solid #334155 !important;
        color: #f1f5f9 !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7) !important;
    }

    html[data-theme="dark"] .swal2-title {
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .swal2-html-container,
    html[data-theme="dark"] .swal2-content {
        color: #cbd5e1 !important;
    }

    /* Information / Notification Popup Window (sitear.css) */
    html[data-theme="dark"] .notification_container {
        background: #111827 !important;
        border-color: #334155 !important;
        color: #e2e8f0 !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7) !important;
    }

    html[data-theme="dark"] .notification_container .info_header,
    html[data-theme="dark"] .notification_container .info_footer {
        background: #162032 !important;
        border-color: #1e293b !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .notification_container .info_body {
        background: #111827 !important;
        color: #e2e8f0 !important;
    }

    /* ----------------------------------------------------------------------
       1.12 BUTTONS, BADGES, SOFT PILLS & ALERTS
       ---------------------------------------------------------------------- */
    /* Global Fallback Utilities for Modules Missing _CrmStyles.cshtml (e.g., SmartService, Assets, etc.) */
    .btn-navy {
        background: linear-gradient(135deg, #1b2e63 0%, #324ea0 100%);
        color: #ffffff !important;
        border: 1px solid #1b2e63;
        box-shadow: 0 4px 12px rgba(27, 46, 99, 0.18);
        transition: all 0.2s ease;
    }

    .btn-navy:hover,
    .btn-navy:focus {
        background: linear-gradient(135deg, #15244f 0%, #263d80 100%);
        color: #ffffff !important;
    }

    .btn-gold {
        background: linear-gradient(135deg, #c5a059 0%, #a88544 100%);
        color: #ffffff !important;
        border: 1px solid #b89146;
        box-shadow: 0 4px 12px rgba(197, 160, 89, 0.22);
        transition: all 0.2s ease;
    }

    .btn-outline-navy {
        background: #ffffff;
        color: #1b2e63;
        border: 1.5px solid #324ea0;
        transition: all 0.2s ease;
    }

    .btn-navy-soft {
        background: #eff6ff;
        color: #1b2e63;
        border: 1px solid #bfdbfe;
        transition: all 0.2s ease;
    }

    .text-gold {
        color: #c5a059 !important;
    }

    .text-blue {
        color: #2563eb !important;
    }

    .text-purple {
        color: #7c3aed !important;
    }

    .text-teal {
        color: #0d9488 !important;
    }

    .bg-soft-navy {
        background-color: rgba(50, 78, 160, 0.12) !important;
    }

    .bg-soft-gold {
        background-color: rgba(197, 160, 89, 0.15) !important;
    }

    .bg-soft-purple {
        background-color: rgba(139, 92, 246, 0.15) !important;
    }

    .bg-soft-teal {
        background-color: rgba(20, 184, 166, 0.15) !important;
    }

    .bg-soft-blue {
        background-color: rgba(59, 130, 246, 0.15) !important;
    }

    .bg-soft-dark {
        background-color: rgba(30, 41, 59, 0.12) !important;
    }

    /* Primary Navy / Dark / Module CTA Buttons in Dark Mode (High-Contrast Royal Sapphire) */
    html[data-theme="dark"] body .btn-navy,
    html[data-theme="dark"] body .btn-dark,
    html[data-theme="dark"] body .pm-btn-navy,
    html[data-theme="dark"] body .pm-btn-primary,
    html[data-theme="dark"] body #PMMasterRoot .btn-primary,
    html[data-theme="dark"] body #PMMasterRoot .btn-navy,
    html[data-theme="dark"] body #PMMasterRoot .btn-dark,
    html[data-theme="dark"] body .btn-fin-primary,
    html[data-theme="dark"] body .btn-hr-primary,
    html[data-theme="dark"] body .btn-inv-primary,
    html[data-theme="dark"] body .btn-inv-primary-sm,
    html[data-theme="dark"] body .btn-prc-primary,
    html[data-theme="dark"] body .btn-emp-primary,
    html[data-theme="dark"] body .btn-rst-primary,
    html[data-theme="dark"] body .btn-portal-primary,
    html[data-theme="dark"] body .btn-primary-custom,
    html[data-theme="dark"] body .btn-dir-primary,
    html[data-theme="dark"] body .mfg-btn-primary,
    html[data-theme="dark"] body .lev-btn-primary,
    html[data-theme="dark"] body .shlev-btn-primary,
    html[data-theme="dark"] body .btn-primary-cfg,
    html[data-theme="dark"] body .salla-btn-primary,
    html[data-theme="dark"] body .cp-btn-primary,
    html[data-theme="dark"] body .lcd-modal-footer .btn-primary,
    html[data-theme="dark"] body .lt-modal-footer .btn-primary,
    html[data-theme="dark"] body .st-modal-box .btn-primary,
    html[data-theme="dark"] body .alw-modal-terminal .btn-primary,
    html[data-theme="dark"] body .modal-footer .btn-primary,
    html[data-theme="dark"] body .btn[style*="var(--p-navy)"],
    html[data-theme="dark"] body .btn[style*="var(--ast-main)"],
    html[data-theme="dark"] body .btn[style*="var(--fin-navy)"],
    html[data-theme="dark"] body .btn[style*="var(--hr-navy)"],
    html[data-theme="dark"] body .btn[style*="var(--inv-navy)"],
    html[data-theme="dark"] body .btn[style*="var(--prc-navy)"] {
        background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
        background-color: #2563eb !important;
        border: 1px solid #3b82f6 !important;
        color: #ffffff !important;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
    }

    html[data-theme="dark"] body .btn-navy:hover,
    html[data-theme="dark"] body .btn-navy:focus,
    html[data-theme="dark"] body .btn-dark:hover,
    html[data-theme="dark"] body .pm-btn-navy:hover,
    html[data-theme="dark"] body .pm-btn-primary:hover,
    html[data-theme="dark"] body #PMMasterRoot .btn-primary:hover,
    html[data-theme="dark"] body #PMMasterRoot .btn-navy:hover,
    html[data-theme="dark"] body #PMMasterRoot .btn-dark:hover,
    html[data-theme="dark"] body .btn-fin-primary:hover,
    html[data-theme="dark"] body .btn-hr-primary:hover,
    html[data-theme="dark"] body .btn-inv-primary:hover,
    html[data-theme="dark"] body .btn-prc-primary:hover,
    html[data-theme="dark"] body .btn-emp-primary:hover,
    html[data-theme="dark"] body .btn-rst-primary:hover,
    html[data-theme="dark"] body .btn-portal-primary:hover,
    html[data-theme="dark"] body .btn-primary-custom:hover,
    html[data-theme="dark"] body .btn-dir-primary:hover,
    html[data-theme="dark"] body .mfg-btn-primary:hover {
        background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
        background-color: #3b82f6 !important;
        border-color: #60a5fa !important;
        color: #ffffff !important;
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.45) !important;
    }

    html[data-theme="dark"] body .btn-navy span,
    html[data-theme="dark"] body .btn-navy i:not(.text-gold):not(.text-warning):not(.text-danger):not(.text-success) {
        color: #ffffff !important;
    }

    html[data-theme="dark"] body .btn-navy i.text-gold,
    html[data-theme="dark"] body .text-gold {
        color: #fbbf24 !important;
    }

    html[data-theme="dark"] body .text-blue {
        color: #60a5fa !important;
    }

    html[data-theme="dark"] body .text-purple {
        color: #c084fc !important;
    }

    html[data-theme="dark"] body .text-teal {
        color: #2dd4bf !important;
    }

    /* Gold Brand Buttons in Dark Mode */
    html[data-theme="dark"] body .btn-gold {
        background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
        border: 1px solid #f59e0b !important;
        color: #ffffff !important;
        box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35) !important;
    }

    html[data-theme="dark"] body .btn-gold:hover {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
        border-color: #fbbf24 !important;
        color: #ffffff !important;
    }

    /* Secondary, White, Light, Ghost, Subtle & Filter Pill Buttons in Dark Mode */
    html[data-theme="dark"] .btn-light,
    html[data-theme="dark"] .btn-white,
    html[data-theme="dark"] .btn-default,
    html[data-theme="dark"] .btn-outline-secondary,
    html[data-theme="dark"] .btn-outline-dark,
    html[data-theme="dark"] body .btn-gradient-secondary,
    html[data-theme="dark"] body .btn-action-soft,
    html[data-theme="dark"] body .btn-outline-navy:not(.active),
    html[data-theme="dark"] body .btn-navy-soft,
    html[data-theme="dark"] body .btn-act-print.dropdown-toggle,
    html[data-theme="dark"] body .btn-group > .btn-act-print.dropdown-toggle,
    html[data-theme="dark"] body .search-modal-footer .btn-secondary,
    html[data-theme="dark"] body .search-modal-footer .btn-act-secondary,
    html[data-theme="dark"] body .row .col-sm-2 > span.btn-default,
    html[data-theme="dark"] .fin-btn-secondary,
    html[data-theme="dark"] .inv-btn-secondary,
    html[data-theme="dark"] .prc-btn-secondary,
    html[data-theme="dark"] body .pm-btn-secondary,
    html[data-theme="dark"] body .pm-btn-cancel,
    html[data-theme="dark"] body .pm-btn-outline-secondary,
    html[data-theme="dark"] body .pm-btn-outline-navy,
    html[data-theme="dark"] body .btn-emp-secondary,
    html[data-theme="dark"] body .btn-portal-outline,
    html[data-theme="dark"] body .btn-prc-ghost-dark,
    html[data-theme="dark"] body .ast-btn-ghost,
    html[data-theme="dark"] body .btn-ghost,
    html[data-theme="dark"] body .btn-subtle,
    html[data-theme="dark"] body .erp-btn-subtle,
    html[data-theme="dark"] body .erp-btn-import-row,
    html[data-theme="dark"] body .btn-dir-secondary,
    html[data-theme="dark"] body .btn-dir-light,
    html[data-theme="dark"] body .btn-secondary-cfg,
    html[data-theme="dark"] body .lev-btn-op,
    html[data-theme="dark"] body .shlev-btn-op,
    html[data-theme="dark"] body .fin-card-btn-print,
    html[data-theme="dark"] body .fin-preset-btn:not(.active),
    html[data-theme="dark"] body .rst-preset-btn:not(.active),
    html[data-theme="dark"] body .ab-chip-btn:not(.active),
    html[data-theme="dark"] body .fin-category-btn:not(.active),
    html[data-theme="dark"] body .recon-tab-btn:not(.active),
    html[data-theme="dark"] body .ast-tab-btn:not(.active),
    html[data-theme="dark"] body .btn-ast-sub-tab:not(.active),
    html[data-theme="dark"] body .btn-inv-sub-tab:not(.active),
    html[data-theme="dark"] body .prof-tab-btn:not(.active),
    html[data-theme="dark"] body .tracker-filter-btn:not(.active),
    html[data-theme="dark"] body .erp-designs-tab-btn:not(.active),
    html[data-theme="dark"] body .erp-module-pill-btn:not(.active),
    html[data-theme="dark"] body .erp-sidebar-tab-btn:not(.active),
    html[data-theme="dark"] body .res-tab-btn:not(.active),
    html[data-theme="dark"] body .floor-pill-btn:not(.active),
    html[data-theme="dark"] body .service-pill-btn:not(.active),
    html[data-theme="dark"] body .ss-nav-btn:not(.active),
    html[data-theme="dark"] body .ye-acc-btn,
    html[data-theme="dark"] body .maint-action-btn {
        background: #1e293b !important;
        background-color: #1e293b !important;
        border: 1px solid #334155 !important;
        color: #e2e8f0 !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    }

    html[data-theme="dark"] .btn-light:hover,
    html[data-theme="dark"] .btn-white:hover,
    html[data-theme="dark"] .btn-default:hover,
    html[data-theme="dark"] .btn-outline-secondary:hover,
    html[data-theme="dark"] body .btn-gradient-secondary:hover,
    html[data-theme="dark"] body .btn-action-soft:hover,
    html[data-theme="dark"] body .btn-outline-navy:hover,
    html[data-theme="dark"] body .btn-navy-soft:hover,
    html[data-theme="dark"] body .btn-act-print.dropdown-toggle:hover,
    html[data-theme="dark"] body .btn-group > .btn-act-print.dropdown-toggle:hover,
    html[data-theme="dark"] body .pm-btn-secondary:hover,
    html[data-theme="dark"] body .pm-btn-cancel:hover,
    html[data-theme="dark"] body .pm-btn-outline-secondary:hover,
    html[data-theme="dark"] body .pm-btn-outline-navy:hover,
    html[data-theme="dark"] body .btn-emp-secondary:hover,
    html[data-theme="dark"] body .btn-portal-outline:hover,
    html[data-theme="dark"] body .btn-prc-ghost-dark:hover,
    html[data-theme="dark"] body .ast-btn-ghost:hover,
    html[data-theme="dark"] body .erp-btn-subtle:hover,
    html[data-theme="dark"] body .erp-btn-import-row:hover,
    html[data-theme="dark"] body .btn-dir-secondary:hover,
    html[data-theme="dark"] body .btn-dir-light:hover,
    html[data-theme="dark"] body .lev-btn-op:hover,
    html[data-theme="dark"] body .shlev-btn-op:hover,
    html[data-theme="dark"] body .fin-card-btn-print:hover,
    html[data-theme="dark"] body .fin-preset-btn:hover,
    html[data-theme="dark"] body .rst-preset-btn:hover,
    html[data-theme="dark"] body .ab-chip-btn:hover,
    html[data-theme="dark"] body .fin-category-btn:hover,
    html[data-theme="dark"] body .recon-tab-btn:hover,
    html[data-theme="dark"] body .ast-tab-btn:hover,
    html[data-theme="dark"] body .btn-ast-sub-tab:hover,
    html[data-theme="dark"] body .btn-inv-sub-tab:hover,
    html[data-theme="dark"] body .prof-tab-btn:hover,
    html[data-theme="dark"] body .tracker-filter-btn:hover,
    html[data-theme="dark"] body .erp-designs-tab-btn:hover,
    html[data-theme="dark"] body .erp-module-pill-btn:hover,
    html[data-theme="dark"] body .erp-sidebar-tab-btn:hover,
    html[data-theme="dark"] body .res-tab-btn:hover,
    html[data-theme="dark"] body .floor-pill-btn:hover,
    html[data-theme="dark"] body .service-pill-btn:hover,
    html[data-theme="dark"] body .ss-nav-btn:hover,
    html[data-theme="dark"] body .ye-acc-btn:hover,
    html[data-theme="dark"] body .maint-action-btn:hover {
        background: #334155 !important;
        background-color: #334155 !important;
        border-color: #475569 !important;
        color: #ffffff !important;
    }

    /* Preserve Semantic Text Colors on .btn-white / .btn-light in Dark Mode */
    html[data-theme="dark"] body .btn-white.text-danger,
    html[data-theme="dark"] body .btn-light.text-danger {
        color: #fca5a5 !important;
        border-color: rgba(239, 68, 68, 0.4) !important;
    }

    html[data-theme="dark"] body .btn-white.text-success,
    html[data-theme="dark"] body .btn-light.text-success {
        color: #6ee7b7 !important;
        border-color: rgba(16, 185, 129, 0.4) !important;
    }

    html[data-theme="dark"] body .btn-white.text-warning,
    html[data-theme="dark"] body .btn-light.text-warning {
        color: #fcd34d !important;
        border-color: rgba(245, 158, 11, 0.4) !important;
    }

    html[data-theme="dark"] body .btn-white.text-primary,
    html[data-theme="dark"] body .btn-light.text-primary {
        color: #93c5fd !important;
        border-color: rgba(59, 130, 246, 0.4) !important;
    }

    /* Active State for Custom Tab / Preset / Filter Buttons */
    html[data-theme="dark"] body .btn-outline-navy.active,
    html[data-theme="dark"] body .search-cat-btn.active,
    html[data-theme="dark"] body .fin-preset-btn.active,
    html[data-theme="dark"] body .rst-preset-btn.active,
    html[data-theme="dark"] body .ab-chip-btn.active,
    html[data-theme="dark"] body .fin-category-btn.active,
    html[data-theme="dark"] body .recon-tab-btn.active,
    html[data-theme="dark"] body .ast-tab-btn.active,
    html[data-theme="dark"] body .btn-ast-sub-tab.active,
    html[data-theme="dark"] body .btn-inv-sub-tab.active,
    html[data-theme="dark"] body .prof-tab-btn.active,
    html[data-theme="dark"] body .tracker-filter-btn.active,
    html[data-theme="dark"] body .erp-designs-tab-btn.active,
    html[data-theme="dark"] body .erp-module-pill-btn.active,
    html[data-theme="dark"] body .erp-sidebar-tab-btn.active,
    html[data-theme="dark"] body .res-tab-btn.active,
    html[data-theme="dark"] body .floor-pill-btn.active,
    html[data-theme="dark"] body .service-pill-btn.active,
    html[data-theme="dark"] body .ss-nav-btn.active {
        background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
        background-color: #2563eb !important;
        border-color: #3b82f6 !important;
        color: #ffffff !important;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
    }

    /* Outline Semantic Buttons & Soft Action Buttons (.btn-outline-*, .btn-soft-*, .btn-act-*) */
    html[data-theme="dark"] body .btn-outline-primary,
    html[data-theme="dark"] body .btn-outline-custom-primary,
    html[data-theme="dark"] body .btn-soft-primary,
    html[data-theme="dark"] body .btn-act-print:not(.dropdown-toggle),
    html[data-theme="dark"] body .btn-act-release,
    html[data-theme="dark"] body .btn-act-out,
    html[data-theme="dark"] body .erp-btn-add-row,
    html[data-theme="dark"] body .inv-act-btn.edit,
    html[data-theme="dark"] body .rst-table-btn.edit {
        background: rgba(37, 99, 235, 0.16) !important;
        background-color: rgba(37, 99, 235, 0.16) !important;
        border: 1px solid rgba(59, 130, 246, 0.45) !important;
        color: #93c5fd !important;
    }

    html[data-theme="dark"] body .btn-outline-primary:hover,
    html[data-theme="dark"] body .btn-outline-primary.active,
    html[data-theme="dark"] body .btn-outline-custom-primary:hover,
    html[data-theme="dark"] body .btn-soft-primary:hover,
    html[data-theme="dark"] body .btn-act-print:not(.dropdown-toggle):hover,
    html[data-theme="dark"] body .btn-act-release:hover,
    html[data-theme="dark"] body .btn-act-out:hover,
    html[data-theme="dark"] body .erp-btn-add-row:hover {
        background: #2563eb !important;
        background-color: #2563eb !important;
        border-color: #3b82f6 !important;
        color: #ffffff !important;
    }

    html[data-theme="dark"] body .btn-outline-success,
    html[data-theme="dark"] body .pm-btn-outline-success,
    html[data-theme="dark"] body .btn-soft-success,
    html[data-theme="dark"] body .btn-act-view,
    html[data-theme="dark"] body .btn-act-in,
    html[data-theme="dark"] body .btn-act-receipt,
    html[data-theme="dark"] body .erp-btn-merge-rows {
        background: rgba(16, 185, 129, 0.16) !important;
        background-color: rgba(16, 185, 129, 0.16) !important;
        border: 1px solid rgba(16, 185, 129, 0.45) !important;
        color: #6ee7b7 !important;
    }

    html[data-theme="dark"] body .btn-outline-success:hover,
    html[data-theme="dark"] body .btn-outline-success.active,
    html[data-theme="dark"] body .pm-btn-outline-success:hover,
    html[data-theme="dark"] body .btn-soft-success:hover,
    html[data-theme="dark"] body .btn-act-view:hover,
    html[data-theme="dark"] body .btn-act-in:hover,
    html[data-theme="dark"] body .btn-act-receipt:hover,
    html[data-theme="dark"] body .erp-btn-merge-rows:hover {
        background: #059669 !important;
        background-color: #059669 !important;
        border-color: #10b981 !important;
        color: #ffffff !important;
    }

    html[data-theme="dark"] body .btn-outline-danger,
    html[data-theme="dark"] body .pm-btn-outline-danger,
    html[data-theme="dark"] body .btn-soft-danger,
    html[data-theme="dark"] body .btn-act-cancel,
    html[data-theme="dark"] body .inv-act-btn.delete,
    html[data-theme="dark"] body .rst-table-btn.delete {
        background: rgba(239, 68, 68, 0.16) !important;
        background-color: rgba(239, 68, 68, 0.16) !important;
        border: 1px solid rgba(239, 68, 68, 0.45) !important;
        color: #fca5a5 !important;
    }

    html[data-theme="dark"] body .btn-outline-danger:hover,
    html[data-theme="dark"] body .btn-outline-danger.active,
    html[data-theme="dark"] body .pm-btn-outline-danger:hover,
    html[data-theme="dark"] body .btn-soft-danger:hover,
    html[data-theme="dark"] body .btn-act-cancel:hover {
        background: #dc2626 !important;
        background-color: #dc2626 !important;
        border-color: #ef4444 !important;
        color: #ffffff !important;
    }

    html[data-theme="dark"] body .btn-outline-warning,
    html[data-theme="dark"] body .pm-btn-outline-warning,
    html[data-theme="dark"] body .btn-soft-warning,
    html[data-theme="dark"] body .btn-act-edit,
    html[data-theme="dark"] body .btn-act-issue {
        background: rgba(245, 158, 11, 0.16) !important;
        background-color: rgba(245, 158, 11, 0.16) !important;
        border: 1px solid rgba(245, 158, 11, 0.45) !important;
        color: #fcd34d !important;
    }

    html[data-theme="dark"] body .btn-outline-warning:hover,
    html[data-theme="dark"] body .btn-outline-warning.active,
    html[data-theme="dark"] body .pm-btn-outline-warning:hover,
    html[data-theme="dark"] body .btn-soft-warning:hover,
    html[data-theme="dark"] body .btn-act-edit:hover,
    html[data-theme="dark"] body .btn-act-issue:hover {
        background: #d97706 !important;
        background-color: #d97706 !important;
        border-color: #f59e0b !important;
        color: #ffffff !important;
    }

    html[data-theme="dark"] body .btn-outline-info,
    html[data-theme="dark"] body .btn-outline-teal,
    html[data-theme="dark"] body .btn-soft-info,
    html[data-theme="dark"] body .btn-act-shortage,
    html[data-theme="dark"] body .btn-act-match {
        background: rgba(14, 165, 233, 0.16) !important;
        background-color: rgba(14, 165, 233, 0.16) !important;
        border: 1px solid rgba(14, 165, 233, 0.45) !important;
        color: #7dd3fc !important;
    }

    html[data-theme="dark"] body .btn-outline-info:hover,
    html[data-theme="dark"] body .btn-outline-info.active,
    html[data-theme="dark"] body .btn-outline-teal:hover,
    html[data-theme="dark"] body .btn-soft-info:hover,
    html[data-theme="dark"] body .btn-act-shortage:hover,
    html[data-theme="dark"] body .btn-act-match:hover {
        background: #0284c7 !important;
        background-color: #0284c7 !important;
        border-color: #0ea5e9 !important;
        color: #ffffff !important;
    }

    /* Finance, Inventory & Global Soft Badges */
    html[data-theme="dark"] .fin-badge-blue,
    html[data-theme="dark"] .inv-badge-blue,
    html[data-theme="dark"] .coa-badge-cust,
    html[data-theme="dark"] .badge-soft-primary,
    html[data-theme="dark"] .bg-soft-primary,
    html[data-theme="dark"] .bg-primary-soft,
    html[data-theme="dark"] .bg-primary-subtle,
    html[data-theme="dark"] .bg-soft-blue,
    html[data-theme="dark"] .bg-blue-soft,
    html[data-theme="dark"] .kpi-icon-primary {
        background-color: rgba(59, 130, 246, 0.18) !important;
        border-color: rgba(59, 130, 246, 0.35) !important;
        color: #93c5fd !important;
    }

    html[data-theme="dark"] .fin-badge-green,
    html[data-theme="dark"] .inv-badge-green,
    html[data-theme="dark"] .badge-soft-success,
    html[data-theme="dark"] .bg-soft-success,
    html[data-theme="dark"] .bg-success-soft,
    html[data-theme="dark"] .bg-success-subtle,
    html[data-theme="dark"] .bg-emerald-soft,
    html[data-theme="dark"] .bg-emerald-subtle,
    html[data-theme="dark"] .bg-green-soft,
    html[data-theme="dark"] .kpi-icon-success {
        background-color: rgba(16, 185, 129, 0.18) !important;
        border-color: rgba(16, 185, 129, 0.35) !important;
        color: #6ee7b7 !important;
    }

    html[data-theme="dark"] .fin-badge-amber,
    html[data-theme="dark"] .inv-badge-amber,
    html[data-theme="dark"] .coa-badge-supp,
    html[data-theme="dark"] .badge-soft-warning,
    html[data-theme="dark"] .bg-soft-warning,
    html[data-theme="dark"] .bg-warning-soft,
    html[data-theme="dark"] .bg-warning-subtle,
    html[data-theme="dark"] .bg-amber-soft,
    html[data-theme="dark"] .bg-amber-subtle,
    html[data-theme="dark"] .bg-orange-soft,
    html[data-theme="dark"] .bg-soft-gold,
    html[data-theme="dark"] .bg-gold-soft,
    html[data-theme="dark"] .kpi-icon-warning {
        background-color: rgba(245, 158, 11, 0.18) !important;
        border-color: rgba(245, 158, 11, 0.35) !important;
        color: #fcd34d !important;
    }

    html[data-theme="dark"] .fin-badge-red,
    html[data-theme="dark"] .inv-badge-red,
    html[data-theme="dark"] .badge-soft-danger,
    html[data-theme="dark"] .bg-soft-danger,
    html[data-theme="dark"] .bg-danger-soft,
    html[data-theme="dark"] .bg-danger-subtle,
    html[data-theme="dark"] .bg-red-soft,
    html[data-theme="dark"] .bg-rose-subtle,
    html[data-theme="dark"] .bg-soft-pink,
    html[data-theme="dark"] .bg-pink-soft,
    html[data-theme="dark"] .kpi-icon-danger {
        background-color: rgba(239, 68, 68, 0.18) !important;
        border-color: rgba(239, 68, 68, 0.35) !important;
        color: #fca5a5 !important;
    }

    html[data-theme="dark"] .fin-badge-purple,
    html[data-theme="dark"] .bg-indigo-soft,
    html[data-theme="dark"] .bg-indigo-subtle,
    html[data-theme="dark"] .bg-soft-purple,
    html[data-theme="dark"] .bg-purple-soft,
    html[data-theme="dark"] .bg-purple-subtle {
        background-color: rgba(139, 92, 246, 0.18) !important;
        border-color: rgba(139, 92, 246, 0.35) !important;
        color: #c4b5fd !important;
    }

    html[data-theme="dark"] .fin-badge-gray,
    html[data-theme="dark"] .badge-light,
    html[data-theme="dark"] .badge-soft-secondary,
    html[data-theme="dark"] .bg-soft-secondary,
    html[data-theme="dark"] .bg-secondary-soft,
    html[data-theme="dark"] .bg-secondary-subtle,
    html[data-theme="dark"] .bg-soft-light,
    html[data-theme="dark"] .bg-light-soft,
    html[data-theme="dark"] .bg-light-subtle {
        background-color: #1e293b !important;
        border-color: #334155 !important;
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] .badge-soft-info,
    html[data-theme="dark"] .bg-soft-info,
    html[data-theme="dark"] .bg-info-soft,
    html[data-theme="dark"] .bg-info-subtle,
    html[data-theme="dark"] .bg-teal-soft {
        background-color: rgba(14, 165, 233, 0.18) !important;
        border-color: rgba(14, 165, 233, 0.35) !important;
        color: #7dd3fc !important;
    }

    /* ----------------------------------------------------------------------
       1.13 FLOATING DOCK, LIVE CHAT & HR AI ASSISTANT WIDGETS
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] #erp-floating-dock {
        background: rgba(15, 23, 42, 0.90) !important;
        border: 1px solid rgba(148, 163, 184, 0.24) !important;
        box-shadow: 0 14px 38px rgba(0, 0, 0, 0.60), 0 0 0 1px rgba(56, 189, 248, 0.10) inset !important;
    }

    html[data-theme="dark"] #erp-floating-dock:hover {
        background: rgba(15, 23, 42, 0.97) !important;
        border-color: rgba(56, 189, 248, 0.35) !important;
        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(56, 189, 248, 0.16) inset !important;
    }

    html[data-theme="dark"] #erp-floating-dock.is-dragging {
        background: rgba(15, 23, 42, 0.98) !important;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.80), 0 0 0 1px rgba(56, 189, 248, 0.30) inset !important;
    }

    html[data-theme="dark"] #erp-floating-dock.is-collapsed {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    html[data-theme="dark"] #erp-floating-dock .erp-dock-drag-handle {
        color: #64748b !important;
    }

    html[data-theme="dark"] #erp-floating-dock .erp-dock-drag-handle:hover {
        color: #38bdf8 !important;
        background: rgba(56, 189, 248, 0.14) !important;
    }

    html[data-theme="dark"] #erp-floating-dock .erp-dock-toggle-btn {
        background: #1e293b !important;
        border-color: rgba(148, 163, 184, 0.28) !important;
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] #erp-floating-dock .erp-dock-toggle-btn:hover {
        background: #334155 !important;
        border-color: rgba(56, 189, 248, 0.45) !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] #erp-floating-dock .erp-dock-collapsed-badge {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
        border-color: rgba(56, 189, 248, 0.45) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65) !important;
    }

    html[data-theme="dark"] #erp-floating-dock #ms-siraj-dock-badge,
    html[data-theme="dark"] #erp-floating-dock .ms-chat-launcher-unread,
    html[data-theme="dark"] #erp-floating-dock .erp-dock-unread-dot {
        border-color: #0f172a !important;
    }

    html[data-theme="dark"] #erp-floating-dock .notification_container_btn {
        border: 2px solid rgba(148, 163, 184, 0.28) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
    }

    html[data-theme="dark"] #erp-floating-dock .ms-dock-fab-options {
        background: #111827 !important;
        border-color: #334155 !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.72) !important;
    }

    html[data-theme="dark"] #erp-floating-dock .ms-dock-fab-body {
        background: #111827 !important;
    }

    html[data-theme="dark"] #erp-floating-dock .ms-dock-fab-link {
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] #erp-floating-dock .ms-dock-fab-link:hover {
        background: #1e293b !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] #erp-floating-dock .ms-dock-fab-text strong {
        color: #f1f5f9 !important;
    }

    html[data-theme="dark"] #erp-floating-dock .ms-dock-fab-text small {
        color: #94a3b8 !important;
    }

    html[data-theme="dark"] #erp-floating-dock .dock-panel,
    html[data-theme="dark"] #erp-floating-dock .dock-modal,
    html[data-theme="dark"] #ms-live-chat-root .lc-panel,
    html[data-theme="dark"] #ms-hr-assistant-root .hra-panel {
        background: #111827 !important;
        border-color: #334155 !important;
        color: #e2e8f0 !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7) !important;
    }

    html[data-theme="dark"] #ms-live-chat-root .lc-body,
    html[data-theme="dark"] #ms-hr-assistant-root .hra-body,
    html[data-theme="dark"] #ms-live-chat-root .lc-sidebar {
        background: #0b1120 !important;
        border-color: #1e293b !important;
    }

    html[data-theme="dark"] #ms-live-chat-root .lc-footer,
    html[data-theme="dark"] #ms-hr-assistant-root .hra-footer {
        background: #111827 !important;
        border-top-color: #1e293b !important;
    }

    html[data-theme="dark"] #ms-live-chat-root .lc-msg-incoming .lc-msg-bubble,
    html[data-theme="dark"] #ms-hr-assistant-root .hra-msg-bot .hra-msg-bubble {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #f1f5f9 !important;
    }

    /* ----------------------------------------------------------------------
       1.14 CUSTOMER PORTAL & LOGIN PAGE DARK THEME
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] .portal-navbar,
    html[data-theme="dark"] .portal-header {
        background: rgba(15, 23, 42, 0.92) !important;
        border-bottom-color: #1e293b !important;
    }

    html[data-theme="dark"] .portal-theme-btn,
    html[data-theme="dark"] .login-theme-btn {
        background: rgba(30, 41, 59, 0.9) !important;
        border-color: #334155 !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] .portal-theme-btn i,
    html[data-theme="dark"] .login-theme-btn i {
        color: #fbbf24 !important;
    }

    html[data-theme="dark"] .login-card,
    html[data-theme="dark"] .auth-card,
    html[data-theme="dark"] .login-box,
    html[data-theme="dark"] .login-form-panel {
        background: rgba(17, 24, 39, 0.92) !important;
        border-color: rgba(148, 163, 184, 0.18) !important;
        color: #f1f5f9 !important;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7) !important;
    }

    /* ----------------------------------------------------------------------
       1.15 CUSTOM SCROLLBARS IN DARK MODE
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    html[data-theme="dark"] ::-webkit-scrollbar-track,
    html[data-theme="dark"] #coa_table_scroll_viewport::-webkit-scrollbar-track,
    html[data-theme="dark"] .coa-viewport::-webkit-scrollbar-track {
        background: #0b1120 !important;
    }

    html[data-theme="dark"] ::-webkit-scrollbar-thumb,
    html[data-theme="dark"] #coa_table_scroll_viewport::-webkit-scrollbar-thumb,
    html[data-theme="dark"] .coa-viewport::-webkit-scrollbar-thumb {
        background: #334155 !important;
        border-color: #0b1120 !important;
        border-radius: 4px;
    }

    html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
        background: #475569 !important;
    }

    html[data-theme="dark"] body .crm-table-scroll-viewport,
    html[data-theme="dark"] body .crm-leads-scroll-viewport {
        scrollbar-color: #334155 #0b1120 !important;
    }

    html[data-theme="dark"] body .crm-sticky-table thead th {
        background-color: #162032 !important;
        color: #f1f5f9 !important;
        box-shadow: inset 0 -1px 0 #1e293b !important;
    }

    /* ----------------------------------------------------------------------
       1.15b HOVER READABILITY & CONTRAST GUARD (Dashboard, Lists, Tables, Buttons)
       ---------------------------------------------------------------------- */
    /* Dashboard Pending Tasks, Warnings, Task Rows, and Notification Items */
    html[data-theme="dark"] body #PendingTasksContainerID a:hover,
    html[data-theme="dark"] body #WarningsID a:hover,
    html[data-theme="dark"] body .task-row:hover,
    html[data-theme="dark"] body a.task-row:hover,
    html[data-theme="dark"] body .transition-hover:hover,
    html[data-theme="dark"] body .notification-item:hover {
        background: #1e293b !important;
        background-color: #1e293b !important;
        border-color: #334155 !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] body #PendingTasksContainerID a:hover div,
    html[data-theme="dark"] body #PendingTasksContainerID a:hover span:not(.badge),
    html[data-theme="dark"] body #WarningsID a:hover div,
    html[data-theme="dark"] body #WarningsID a:hover span:not(.badge),
    html[data-theme="dark"] body .task-row:hover .task-title,
    html[data-theme="dark"] body .task-row:hover h1,
    html[data-theme="dark"] body .task-row:hover h2,
    html[data-theme="dark"] body .task-row:hover h3,
    html[data-theme="dark"] body .task-row:hover h4,
    html[data-theme="dark"] body .task-row:hover h5,
    html[data-theme="dark"] body .task-row:hover h6,
    html[data-theme="dark"] body .transition-hover:hover h1,
    html[data-theme="dark"] body .transition-hover:hover h2,
    html[data-theme="dark"] body .transition-hover:hover h3,
    html[data-theme="dark"] body .transition-hover:hover h4,
    html[data-theme="dark"] body .transition-hover:hover h5,
    html[data-theme="dark"] body .transition-hover:hover h6,
    html[data-theme="dark"] body .notification-item:hover h1,
    html[data-theme="dark"] body .notification-item:hover h2,
    html[data-theme="dark"] body .notification-item:hover h3,
    html[data-theme="dark"] body .notification-item:hover h4,
    html[data-theme="dark"] body .notification-item:hover h5,
    html[data-theme="dark"] body .notification-item:hover h6 {
        color: #f8fafc !important;
    }

    /* Listview Hover & Selected Rows (Global & Search Modals) */
    html[data-theme="dark"] body .listview_hover:hover,
    html[data-theme="dark"] body .listview_hover:hover > td,
    html[data-theme="dark"] body .listview_hover:hover > th,
    html[data-theme="dark"] body tr.listview_hover:hover,
    html[data-theme="dark"] body tr.listview_hover:hover > td {
        background: #1e293b !important;
        background-color: #1e293b !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] body .listview_hover:hover td span:not(.badge),
    html[data-theme="dark"] body .listview_hover:hover td a:not(.btn),
    html[data-theme="dark"] body .listview_hover:hover td div,
    html[data-theme="dark"] body .listview_hover:hover td strong,
    html[data-theme="dark"] body .listview_hover:hover td b,
    html[data-theme="dark"] body .listview_hover:hover td small {
        color: #f8fafc !important;
    }

    html[data-theme="dark"] body .listview_selected,
    html[data-theme="dark"] body .listview_selected > td,
    html[data-theme="dark"] body .listview_selected > th,
    html[data-theme="dark"] body tr.listview_selected,
    html[data-theme="dark"] body tr.listview_selected > td,
    html[data-theme="dark"] body .listview_selected:hover,
    html[data-theme="dark"] body .listview_selected:hover > td,
    html[data-theme="dark"] body tr.listview_selected:hover,
    html[data-theme="dark"] body tr.listview_selected:hover > td {
        background: rgba(37, 99, 235, 0.28) !important;
        background-color: rgba(37, 99, 235, 0.28) !important;
        color: #ffffff !important;
    }

    html[data-theme="dark"] body .listview_selected td span:not(.badge),
    html[data-theme="dark"] body .listview_selected td a:not(.btn),
    html[data-theme="dark"] body .listview_selected td div,
    html[data-theme="dark"] body .listview_selected td strong,
    html[data-theme="dark"] body .listview_selected td b,
    html[data-theme="dark"] body .listview_selected td small,
    html[data-theme="dark"] body .listview_selected:hover td span:not(.badge),
    html[data-theme="dark"] body .listview_selected:hover td a:not(.btn),
    html[data-theme="dark"] body .listview_selected:hover td div,
    html[data-theme="dark"] body .listview_selected:hover td strong,
    html[data-theme="dark"] body .listview_selected:hover td b,
    html[data-theme="dark"] body .listview_selected:hover td small {
        color: #ffffff !important;
    }

    /* Global & Module Table Row Hover States */
    html[data-theme="dark"] body table tbody tr:hover > td,
    html[data-theme="dark"] body .table-hover tbody tr:hover,
    html[data-theme="dark"] body .table-hover tbody tr:hover > td,
    html[data-theme="dark"] body .table-hover tbody tr:hover > th,
    html[data-theme="dark"] body .custom-table tbody tr:hover,
    html[data-theme="dark"] body .custom-table tbody tr:hover > td,
    html[data-theme="dark"] body .fin-table tbody tr:hover > td,
    html[data-theme="dark"] body .inv-table tbody tr:hover > td,
    html[data-theme="dark"] body .prc-table tbody tr:hover > td,
    html[data-theme="dark"] body .iw-table tbody tr:hover,
    html[data-theme="dark"] body .iw-table tbody tr:hover > td,
    html[data-theme="dark"] body .search-results-container table tbody tr:hover td {
        background: #1e293b !important;
        background-color: #1e293b !important;
        color: #f8fafc !important;
    }

    /* Bootstrap List Group Action Hover / Focus */
    html[data-theme="dark"] body .list-group-item-action:hover,
    html[data-theme="dark"] body .list-group-item-action:focus,
    html[data-theme="dark"] body a.list-group-item:hover,
    html[data-theme="dark"] body a.list-group-item:focus,
    html[data-theme="dark"] body button.list-group-item:hover,
    html[data-theme="dark"] body button.list-group-item:focus {
        background: #1e293b !important;
        background-color: #1e293b !important;
        color: #f8fafc !important;
        border-color: #334155 !important;
    }

    /* Sovereign Soft Action Buttons & Secondary Buttons Hover */
    html[data-theme="dark"] body .btn-action:hover {
        background: #1e293b !important;
        background-color: #1e293b !important;
        border-color: #475569 !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] body .btn-action-soft.action-view:hover {
        background: rgba(59, 130, 246, 0.22) !important;
        background-color: rgba(59, 130, 246, 0.22) !important;
        color: #93c5fd !important;
        border-color: rgba(59, 130, 246, 0.45) !important;
    }

    html[data-theme="dark"] body .btn-action-soft.action-edit:hover {
        background: rgba(245, 158, 11, 0.22) !important;
        background-color: rgba(245, 158, 11, 0.22) !important;
        color: #fcd34d !important;
        border-color: rgba(245, 158, 11, 0.45) !important;
    }

    html[data-theme="dark"] body .btn-action-soft.action-delete:hover {
        background: rgba(239, 68, 68, 0.22) !important;
        background-color: rgba(239, 68, 68, 0.22) !important;
        color: #fca5a5 !important;
        border-color: rgba(239, 68, 68, 0.45) !important;
    }

    html[data-theme="dark"] body .search-modal-footer .btn-secondary:hover,
    html[data-theme="dark"] body .search-modal-footer .btn-act-secondary:hover,
    html[data-theme="dark"] body a[href*="/edit"].btn-act:hover,
    html[data-theme="dark"] body a[href*="/Edit"].btn-act:hover,
    html[data-theme="dark"] body .btn-group .btn-act.dropdown-toggle:hover,
    html[data-theme="dark"] body .btn-group > .btn-act-print.dropdown-toggle:hover {
        background: #334155 !important;
        background-color: #334155 !important;
        color: #f8fafc !important;
        border-color: #475569 !important;
    }

    html[data-theme="dark"] body .mgr-banner .btn-outline-light:hover,
    html[data-theme="dark"] body .fin-header-banner .btn-outline-light:hover,
    html[data-theme="dark"] body .inv-header-banner .btn-outline-light:hover,
    html[data-theme="dark"] body .prc-header-banner .btn-outline-light:hover,
    html[data-theme="dark"] body .crm-compact-header .btn-outline-light:hover {
        background: rgba(255, 255, 255, 0.16) !important;
        background-color: rgba(255, 255, 255, 0.16) !important;
        color: #ffffff !important;
        border-color: rgba(255, 255, 255, 0.4) !important;
    }

    /* Search Fields Chips & Toggle Hover */
    html[data-theme="dark"] body .mat-field-chip:hover {
        background: rgba(59, 130, 246, 0.18) !important;
        background-color: rgba(59, 130, 246, 0.18) !important;
        color: #93c5fd !important;
        border-color: rgba(59, 130, 246, 0.4) !important;
    }

    html[data-theme="dark"] body .mat-field-chip.active {
        background: rgba(37, 99, 235, 0.28) !important;
        background-color: rgba(37, 99, 235, 0.28) !important;
        color: #ffffff !important;
        border-color: #3b82f6 !important;
    }

    html[data-theme="dark"] body .search-fields-toggle-btn:hover {
        background: #334155 !important;
        background-color: #334155 !important;
        color: #f8fafc !important;
    }

    /* ----------------------------------------------------------------------
       1.15b UNIFIED SITEAR / SITEEN & MODULE ROOT ZERO-FLASH DARK OVERRIDES
       Ensures instant Frame-0 Dark Mode rendering before body scripts run
       ---------------------------------------------------------------------- */
    html[data-theme="dark"] body #crm-master-orchestration-root,
    html[data-theme="dark"] body #PMMasterRoot,
    html[data-theme="dark"] body .inv-wrapper {
        background: #0b1120 !important;
        background-color: #0b1120 !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] body .crm-nav-bar,
    html[data-theme="dark"] body .pm-nav-ribbon,
    html[data-theme="dark"] body .ai-sidebar {
        background: rgba(17, 24, 39, 0.94) !important;
        background-color: #111827 !important;
        border-color: #1e293b !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
    }

    html[data-theme="dark"] body .crm-nav-btn:not(.active) {
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] body .crm-nav-btn:not(.active):hover {
        background: #1e293b !important;
        background-color: #1e293b !important;
        color: #60a5fa !important;
    }

    html[data-theme="dark"] body .glass-card,
    html[data-theme="dark"] body .fab-item,
    html[data-theme="dark"] body .inv-glass-card,
    html[data-theme="dark"] body .rec-matrix-card,
    html[data-theme="dark"] body .rec-filter-hub-nx,
    html[data-theme="dark"] body .rec-banner,
    html[data-theme="dark"] body .RowContainer,
    html[data-theme="dark"] body .mat-search-fields-panel {
        background: #111827 !important;
        background-color: #111827 !important;
        border-color: #1e293b !important;
        color: #f1f5f9 !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38) !important;
    }

    html[data-theme="dark"] body .rec-banner {
        border-right-color: #3b82f6 !important;
    }

    html[data-theme="dark"] body .rec-banner-content h4,
    html[data-theme="dark"] body .rec-filter-hub-nx span {
        color: #f1f5f9 !important;
    }

    html[data-theme="dark"] body .rec-banner-content p {
        color: #94a3b8 !important;
    }

    html[data-theme="dark"] body .rec-input-nx,
    html[data-theme="dark"] body .RowContainerFields .form-control {
        background: #0f172a !important;
        background-color: #0f172a !important;
        border-color: #334155 !important;
        color: #f1f5f9 !important;
    }

    html[data-theme="dark"] body .rec-input-nx::placeholder,
    html[data-theme="dark"] body .RowContainerFields .form-control::placeholder {
        color: #64748b !important;
    }

    html[data-theme="dark"] body .rec-input-nx:focus,
    html[data-theme="dark"] body .RowContainerFields .form-control:focus {
        background: #0f172a !important;
        background-color: #0f172a !important;
        border-color: #3b82f6 !important;
        color: #ffffff !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22) !important;
    }

    html[data-theme="dark"] body .rec-table-nx th,
    html[data-theme="dark"] body .custom-table thead th {
        background: #162032 !important;
        background-color: #162032 !important;
        color: #cbd5e1 !important;
        border-bottom-color: #1e293b !important;
    }

    html[data-theme="dark"] body .rec-table-nx td,
    html[data-theme="dark"] body .custom-table tbody td {
        border-color: #1e293b !important;
        border-bottom-color: #1e293b !important;
        color: #e2e8f0 !important;
    }

    html[data-theme="dark"] body .rec-table-nx tbody tr:hover,
    html[data-theme="dark"] body .custom-table tbody tr:hover {
        background: rgba(30, 41, 59, 0.72) !important;
        background-color: rgba(30, 41, 59, 0.72) !important;
        color: #f8fafc !important;
    }

    html[data-theme="dark"] body .custom-table tfoot td {
        background: #162032 !important;
        background-color: #162032 !important;
        color: #93c5fd !important;
        border-top-color: #334155 !important;
    }

    html[data-theme="dark"] body .control-orb {
        background: #1e293b !important;
        background-color: #1e293b !important;
        border-color: #334155 !important;
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] body .control-orb:hover {
        background: #2563eb !important;
        background-color: #2563eb !important;
        border-color: #3b82f6 !important;
        color: #ffffff !important;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
    }

    html[data-theme="dark"] body .control-orb.text-danger {
        color: #f87171 !important;
        border-color: rgba(239, 68, 68, 0.3) !important;
    }

    html[data-theme="dark"] body .control-orb.text-danger:hover {
        background: #dc2626 !important;
        background-color: #dc2626 !important;
        border-color: #ef4444 !important;
        color: #ffffff !important;
    }

    html[data-theme="dark"] body .card-header-bar {
        background: linear-gradient(135deg, #111827 0%, #162032 100%) !important;
        border-bottom-color: #1e293b !important;
    }

    html[data-theme="dark"] body .card-header-bar h5,
    html[data-theme="dark"] body .card-header-bar h6 {
        color: #f1f5f9 !important;
    }

    html[data-theme="dark"] body .search-fields-toggle-btn,
    html[data-theme="dark"] body .btn-act-secondary,
    html[data-theme="dark"] body a[href*="/edit"].btn-act,
    html[data-theme="dark"] body a[href*="/Edit"].btn-act,
    html[data-theme="dark"] body .btn-group .btn-act.dropdown-toggle,
    html[data-theme="dark"] body .btn-group > .btn-act-print.dropdown-toggle {
        background: #1e293b !important;
        background-color: #1e293b !important;
        color: #e2e8f0 !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] body .btn-inv-primary-sm,
    html[data-theme="dark"] body .btn-act-print:not(.dropdown-toggle),
    html[data-theme="dark"] body button[onclick*="Pdf"].btn-act,
    html[data-theme="dark"] body button[onclick*="Print"].btn-act {
        background: rgba(37, 99, 235, 0.16) !important;
        background-color: rgba(37, 99, 235, 0.16) !important;
        color: #93c5fd !important;
        border-color: rgba(59, 130, 246, 0.35) !important;
    }

    html[data-theme="dark"] body .btn-inv-primary-sm:hover,
    html[data-theme="dark"] body .btn-act-print:not(.dropdown-toggle):hover,
    html[data-theme="dark"] body button[onclick*="Pdf"].btn-act:hover,
    html[data-theme="dark"] body button[onclick*="Print"].btn-act:hover {
        background: #2563eb !important;
        background-color: #2563eb !important;
        color: #ffffff !important;
        border-color: #3b82f6 !important;
    }

    /* ----------------------------------------------------------------------
       1.16 ICON FONT PROTECTION (Prevents wildcard * { font-family: Cairo !important } from breaking FontAwesome / MDI icons)
       ---------------------------------------------------------------------- */
    .fa,
    .fas,
    .far,
    .fal,
    .fad,
    i[class*="fa-"],
    .topbar-theme-btn i,
    .profile-theme-btn i,
    .portal-theme-btn i,
    .login-theme-btn i {
        font-family: "Font Awesome 5 Free" !important;
        font-style: normal !important;
    }

    .fa,
    .fas,
    .topbar-theme-btn i,
    .profile-theme-btn i,
    .portal-theme-btn i,
    .login-theme-btn i {
        font-weight: 900 !important;
    }

    .far {
        font-weight: 400 !important;
    }

    .fab {
        font-family: "Font Awesome 5 Brands" !important;
        font-weight: 400 !important;
        font-style: normal !important;
    }

    .mdi,
    .mdi:before,
    .mdi-set {
        font-family: "Material Design Icons" !important;
        font-style: normal !important;
    }
}

/* ==========================================================================
   APEXCHARTS FULL DARK MODE COVERAGE (v21)
   ========================================================================== */
@media screen {
    html[data-theme="dark"] .apexcharts-canvas text,
    html[data-theme="dark"] .apexcharts-text,
    html[data-theme="dark"] .apexcharts-xaxis-label,
    html[data-theme="dark"] .apexcharts-yaxis-label,
    html[data-theme="dark"] .apexcharts-datalabel-label,
    html[data-theme="dark"] .apexcharts-datalabel-value,
    html[data-theme="dark"] .apexcharts-title-text,
    html[data-theme="dark"] .apexcharts-subtitle-text {
        fill: #cbd5e1 !important;
        color: #cbd5e1 !important;
    }
    html[data-theme="dark"] .apexcharts-legend-text {
        color: #e2e8f0 !important;
    }
    html[data-theme="dark"] .apexcharts-gridline,
    html[data-theme="dark"] .apexcharts-xcrosshairs,
    html[data-theme="dark"] .apexcharts-ycrosshairs {
        stroke: rgba(148, 163, 184, 0.16) !important;
    }
    html[data-theme="dark"] .apexcharts-tooltip,
    html[data-theme="dark"] .apexcharts-tooltip.apexcharts-theme-light {
        background: #0f172a !important;
        border: 1px solid #334155 !important;
        color: #f1f5f9 !important;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5) !important;
    }
    html[data-theme="dark"] .apexcharts-tooltip-title,
    html[data-theme="dark"] .apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {
        background: #1e293b !important;
        border-bottom: 1px solid #334155 !important;
        color: #f8fafc !important;
    }
    html[data-theme="dark"] .apexcharts-xaxistooltip,
    html[data-theme="dark"] .apexcharts-yaxistooltip {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #f8fafc !important;
    }
    html[data-theme="dark"] .apexcharts-menu {
        background: #111827 !important;
        border-color: #334155 !important;
        color: #f1f5f9 !important;
    }
    html[data-theme="dark"] .apexcharts-menu-item:hover {
        background: #1e293b !important;
    }

    /* Wave 9 Dark Mode Token & Component Integrity Fixes */
    html[data-theme="dark"] {
        --inv-main: #93c5fd !important;
        --prc-main: #93c5fd !important;
        --ast-main: #60a5fa !important;
        --cp-primary: #93c5fd !important;
        --dash-navy: #e2e8f0 !important;
        --erp-primary: #60a5fa !important;
        --hr-primary: #60a5fa !important;
        --mfg-primary: #60a5fa !important;
        --pos-primary: #60a5fa !important;
        scrollbar-color: #334155 #0f172a;
    }

    html[data-theme="dark"] * {
        scrollbar-color: #334155 #0f172a;
    }

    html[data-theme="dark"] ::-webkit-scrollbar {
        width: 9px;
        height: 9px;
    }
    html[data-theme="dark"] ::-webkit-scrollbar-track {
        background: #0f172a !important;
    }
    html[data-theme="dark"] ::-webkit-scrollbar-thumb {
        background: #334155 !important;
        border-radius: 6px;
        border: 2px solid #0f172a;
    }
    html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
        background: #475569 !important;
    }

    html[data-theme="dark"] body .progress, html[data-theme="dark"] body .dash-panel .progress, html[data-theme="dark"] .progress,
    html[data-theme="dark"] .crm-progress-track,
    html[data-theme="dark"] .pipeline-progress,
    html[data-theme="dark"] [class*="progress-track"],
    html[data-theme="dark"] [class*="bar-bg"] {
        background-color: #1e293b !important;
        background: #1e293b !important;
    }

    html[data-theme="dark"] .btn-default {
        background-color: #1e293b !important;
        color: #e2e8f0 !important;
        border-color: #334155 !important;
    }
    html[data-theme="dark"] .btn-default:hover {
        background-color: #334155 !important;
        color: #ffffff !important;
    }
    html[data-theme="dark"] #GeneralPreview_Dlg_ID .modal-content,
    html[data-theme="dark"] #GeneralPreview_Dlg_ID .modal-body {
        background-color: #0f172a !important;
        color: #e2e8f0 !important;
    }
    html[data-theme="dark"] #GeneralPreview_Dlg_ID .modal-footer {
        background-color: #111827 !important;
        border-color: #334155 !important;
    }
    html[data-theme="dark"] .cp-footer {
        background-color: #0f172a !important;
        border-color: #1e293b !important;
        color: #94a3b8 !important;
    }
}