/* =============================================================================
   GLOBAL THEME SYSTEM
   Centralized color variables for dark & light themes
   All component CSS files reference these variables
   ============================================================================= */

/* Speed up theme switching by disabling transitions/animations briefly */
html.theme-switching *,
body.theme-switching * {
    transition: none !important;
    animation: none !important;
}


/* =============================================================================
   DARK THEME (Default)
   Applied when data-theme="dark" or no theme attribute is set
   ============================================================================= */
:root {
    /* Default to dark theme values - these are overridden by [data-theme] selectors */
    --theme-mode: dark;
}

[data-theme="dark"],
:root:not([data-theme="light"]) {
    /* -----------------------------------------------------------------------------
       Core Backgrounds
       ----------------------------------------------------------------------------- */
    --theme-bg-primary: #11161d;
    --theme-bg-secondary: #191f28;
    --theme-bg-tertiary: #1e252e;
    --theme-bg-card: rgba(26, 32, 40, 0.82);
    --theme-bg-card-hover: rgba(34, 42, 52, 0.92);
    --theme-bg-card-solid: #1a2028;
    --theme-bg-glass: rgba(26, 32, 40, 0.85);
    --theme-bg-dropdown: rgba(22, 27, 34, 0.98);
    --theme-bg-input: rgba(30, 36, 44, 0.8);
    --theme-bg-overlay: rgba(0, 0, 0, 0.5);
    --theme-bg-subtle: rgba(255, 255, 255, 0.04);
    --theme-bg-subtle-hover: rgba(255, 255, 255, 0.06);
    --theme-bg-subtle-strong: rgba(255, 255, 255, 0.08);
    /* -----------------------------------------------------------------------------
       Borders
       ----------------------------------------------------------------------------- */
    --theme-border-color: rgba(48, 54, 61, 0.6);
    --theme-border-subtle: rgba(48, 54, 61, 0.35);
    --theme-border-strong: rgba(48, 54, 61, 0.8);
    --theme-border-accent: rgba(54, 127, 211, 0.4);
    --theme-border-input: rgba(62, 68, 75, 0.5);
    --theme-border-muted: rgba(48, 54, 61, 0.5);
    --theme-border-solid: rgba(48, 54, 61, 0.6);
    /* -----------------------------------------------------------------------------
       Text Colors
       ----------------------------------------------------------------------------- */
    --theme-text-primary: #e6edf3;
    --theme-text-secondary: #8b949e;
    --theme-text-muted: #6e7681;
    --theme-text-tertiary: #6e7681;
    --theme-text-medium: #8b949e;
    --theme-text-dark: #e6edf3;
    --theme-text-muted-decorative: #6e7681;
    --theme-text-muted-info: #8b949e;
    --theme-text-disabled: #484f58;
    --theme-text-inverse: #11161d;
    --theme-text-link: #58a6ff;
    --theme-text-link-hover: #79b8ff;

    /* -----------------------------------------------------------------------------
       Accent Colors - Primary Palette
       ----------------------------------------------------------------------------- */
    --theme-accent-blue: #367fd3;
    --theme-accent-blue-light: #58a6ff;
    --theme-accent-blue-dark: #2563ac;
    --theme-accent-blue-darker: #1d4ed8;
    --theme-accent-blue-glow: rgba(54, 127, 211, 0.35);
    --theme-accent-blue-bg: rgba(54, 127, 211, 0.15);
    --theme-accent-blue-bg-subtle: rgba(54, 127, 211, 0.08);
    --theme-accent-cyan: #58a6ff;
    --theme-accent-cyan-light: #38bdf8;
    --theme-accent-cyan-glow: rgba(88, 166, 255, 0.35);
    --theme-accent-cyan-bg: rgba(88, 166, 255, 0.15);

    /* -----------------------------------------------------------------------------
       Semantic Colors - Status
       ----------------------------------------------------------------------------- */
    --theme-success: #3fb950;
    --theme-success-light: #56d364;
    --theme-success-dark: #238636;
    --theme-success-glow: rgba(63, 185, 80, 0.35);
    --theme-success-bg: rgba(63, 185, 80, 0.15);

    --theme-danger: #f85149;
    --theme-danger-light: #ff6b6b;
    --theme-danger-dark: #da3633;
    --theme-danger-glow: rgba(248, 81, 73, 0.35);
    --theme-danger-bg: rgba(248, 81, 73, 0.15);

    --theme-warning: #d29922;
    --theme-warning-light: #e3b341;
    --theme-warning-dark: #9e6a03;
    --theme-warning-glow: rgba(210, 153, 34, 0.35);
    --theme-warning-bg: rgba(210, 153, 34, 0.15);

    --theme-info: #58a6ff;
    --theme-info-glow: rgba(88, 166, 255, 0.35);
    --theme-info-bg: rgba(88, 166, 255, 0.15);

    /* -----------------------------------------------------------------------------
       Additional Accent Colors
       ----------------------------------------------------------------------------- */
    --theme-accent-purple: #a371f7;
    --theme-accent-purple-glow: rgba(163, 113, 247, 0.35);
    --theme-accent-purple-bg: rgba(163, 113, 247, 0.15);

    --theme-accent-orange: #f0883e;
    --theme-accent-orange-glow: rgba(240, 136, 62, 0.35);
    --theme-accent-orange-bg: rgba(240, 136, 62, 0.15);

    --theme-accent-pink: #db61a2;
    --theme-accent-pink-glow: rgba(219, 97, 162, 0.35);
    --theme-accent-pink-bg: rgba(219, 97, 162, 0.15);

    --theme-accent-teal: #2ea043;
    --theme-accent-teal-glow: rgba(46, 160, 67, 0.35);
    --theme-accent-teal-bg: rgba(46, 160, 67, 0.15);

    /* -------------------------------------------------------------------------
       Gradients
       ------------------------------------------------------------------------- */
    --theme-gradient-primary: linear-gradient(145deg, var(--theme-accent-blue) 0%, var(--theme-accent-blue-dark) 100%);
    --theme-gradient-success: linear-gradient(145deg, var(--theme-success) 0%, var(--theme-success-dark) 100%);
    --theme-gradient-danger: linear-gradient(145deg, var(--theme-danger) 0%, var(--theme-danger-dark) 100%);
    /* -----------------------------------------------------------------------------
       Shadows
       ----------------------------------------------------------------------------- */
    --theme-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --theme-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --theme-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
    --theme-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
    --theme-shadow-drop: rgba(0, 0, 0, 0.5);
    --theme-shadow-focus: 0 0 0 3px rgba(54, 127, 211, 0.35);
    --theme-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.35);
    --theme-shadow-glow: 0 0 20px rgba(54, 127, 211, 0.15);
    --theme-shadow-glow-strong: 0 0 30px rgba(54, 127, 211, 0.25);

    /* -----------------------------------------------------------------------------
       Chart/Graph Colors (for amCharts compatibility)
       ----------------------------------------------------------------------------- */
    --theme-chart-bg: #11161d;
    --theme-chart-grid: rgba(48, 54, 61, 0.4);
    --theme-chart-axis: #6e7681;
    --theme-chart-label: #e6edf3;

    /* -----------------------------------------------------------------------------
       Scrollbar Colors
       ----------------------------------------------------------------------------- */
    --theme-scrollbar-track: rgba(0, 0, 0, 0.2);
    --theme-scrollbar-thumb: rgba(88, 166, 255, 0.3);
    --theme-scrollbar-thumb-hover: rgba(88, 166, 255, 0.5);
    --theme-scrollbar-width: 8px;
    /* -----------------------------------------------------------------------------
       Form Elements
       ----------------------------------------------------------------------------- */
    --theme-input-bg: rgba(30, 36, 44, 0.8);
    --theme-input-border: rgba(62, 68, 75, 0.5);
    --theme-input-border-focus: rgba(54, 127, 211, 0.6);
    --theme-input-placeholder: #6e7681;
    --theme-input-disabled-bg: rgba(30, 36, 44, 0.4);

    /* -----------------------------------------------------------------------------
       Table Colors
       ----------------------------------------------------------------------------- */
    /* --theme-table-header-bg: rgba(0, 0, 0, 0.2); */
    /* --theme-table-row-hover: rgba(54, 127, 211, 0.08); */
    --theme-table-row-selected: rgba(54, 127, 211, 0.15);
    --theme-table-border: rgba(48, 54, 61, 0.3);
    --theme-table-sticky-bg: #1a2028;

    /* -----------------------------------------------------------------------------
       Modal/Dialog Colors
       ----------------------------------------------------------------------------- */
    --theme-modal-bg: #1c2128;
    --theme-modal-header-bg: #252c35;
    --theme-modal-border: #30363d;
    --theme-modal-backdrop: rgba(0, 0, 0, 0.7);
}

/* =============================================================================
   LIGHT THEME
   ============================================================================= */
[data-theme="light"] {
    /* -----------------------------------------------------------------------------
       Core Backgrounds
       ----------------------------------------------------------------------------- */
    --theme-bg-primary: #f1f5f9;
    --theme-bg-secondary: #ffffff;
    --theme-bg-tertiary: #f8fafc;
    --theme-bg-card: rgba(255, 255, 255, 0.95);
    --theme-bg-card-hover: rgba(248, 250, 252, 1);
    --theme-bg-card-solid: #ffffff;
    --theme-bg-glass: rgba(255, 255, 255, 0.9);
    --theme-bg-dropdown: rgba(255, 255, 255, 0.98);
    --theme-bg-input: #ffffff;
    --theme-bg-overlay: rgba(0, 0, 0, 0.3);
    --theme-bg-subtle: rgba(15, 23, 42, 0.04);
    --theme-bg-subtle-hover: rgba(15, 23, 42, 0.06);
    --theme-bg-subtle-strong: rgba(15, 23, 42, 0.08);
    /* -----------------------------------------------------------------------------
       Borders
       ----------------------------------------------------------------------------- */
    --theme-border-color: rgba(226, 232, 240, 0.8);
    --theme-border-subtle: rgba(226, 232, 240, 0.5);
    --theme-border-strong: rgba(226, 232, 240, 1);
    --theme-border-accent: rgba(59, 130, 246, 0.4);
    --theme-border-input: rgba(226, 232, 240, 0.8);
    --theme-border-muted: #cbd5e1;
    --theme-border-solid: #e2e8f0;
    /* -----------------------------------------------------------------------------
       Text Colors
       ----------------------------------------------------------------------------- */
    --theme-text-primary: #1e293b;
    --theme-text-secondary: #64748b;
    --theme-text-muted: #64748b;
    --theme-text-tertiary: #374151;
    --theme-text-medium: #6b7280;
    --theme-text-dark: #1f2937;
    --theme-text-muted-decorative: #94a3b8;
    --theme-text-muted-info: #475569;
    --theme-text-disabled: #cbd5e1;
    --theme-text-inverse: #ffffff;
    --theme-text-link: #3b82f6;
    --theme-text-link-hover: #2563eb;

    /* -----------------------------------------------------------------------------
       Accent Colors - Primary Palette
       ----------------------------------------------------------------------------- */
    --theme-accent-blue: #3b82f6;
    --theme-accent-blue-light: #60a5fa;
    --theme-accent-blue-dark: #2563eb;
    --theme-accent-blue-darker: #1d4ed8;
    --theme-accent-blue-glow: rgba(59, 130, 246, 0.2);
    --theme-accent-blue-bg: rgba(59, 130, 246, 0.1);
    --theme-accent-blue-bg-subtle: rgba(59, 130, 246, 0.04);

    --theme-accent-cyan: #0ea5e9;
    --theme-accent-cyan-light: #38bdf8;
    --theme-accent-cyan-glow: rgba(14, 165, 233, 0.2);
    --theme-accent-cyan-bg: rgba(14, 165, 233, 0.1);

    /* -----------------------------------------------------------------------------
       Semantic Colors - Status
       ----------------------------------------------------------------------------- */
    --theme-success: #22c55e;
    --theme-success-light: #4ade80;
    --theme-success-dark: #16a34a;
    --theme-success-glow: rgba(34, 197, 94, 0.2);
    --theme-success-bg: rgba(34, 197, 94, 0.1);

    --theme-danger: #ef4444;
    --theme-danger-light: #f87171;
    --theme-danger-dark: #dc2626;
    --theme-danger-glow: rgba(239, 68, 68, 0.2);
    --theme-danger-bg: rgba(239, 68, 68, 0.1);

    --theme-warning: #f59e0b;
    --theme-warning-light: #fbbf24;
    --theme-warning-dark: #d97706;
    --theme-warning-glow: rgba(245, 158, 11, 0.2);
    --theme-warning-bg: rgba(245, 158, 11, 0.1);

    --theme-info: #0ea5e9;
    --theme-info-glow: rgba(14, 165, 233, 0.2);
    --theme-info-bg: rgba(14, 165, 233, 0.1);

    /* -----------------------------------------------------------------------------
       Additional Accent Colors
       ----------------------------------------------------------------------------- */
    --theme-accent-purple: #8b5cf6;
    --theme-accent-purple-glow: rgba(139, 92, 246, 0.2);
    --theme-accent-purple-bg: rgba(139, 92, 246, 0.1);

    --theme-accent-orange: #f59e0b;
    --theme-accent-orange-glow: rgba(245, 158, 11, 0.2);
    --theme-accent-orange-bg: rgba(245, 158, 11, 0.1);

    --theme-accent-pink: #ec4899;
    --theme-accent-pink-glow: rgba(236, 72, 153, 0.2);
    --theme-accent-pink-bg: rgba(236, 72, 153, 0.1);

    --theme-accent-teal: #14b8a6;
    --theme-accent-teal-glow: rgba(20, 184, 166, 0.2);
    --theme-accent-teal-bg: rgba(20, 184, 166, 0.1);

    /* -------------------------------------------------------------------------
       Gradients
       ------------------------------------------------------------------------- */
    --theme-gradient-primary: linear-gradient(145deg, var(--theme-accent-blue) 0%, var(--theme-accent-blue-dark) 100%);
    --theme-gradient-success: linear-gradient(145deg, var(--theme-success) 0%, var(--theme-success-dark) 100%);
    --theme-gradient-danger: linear-gradient(145deg, var(--theme-danger) 0%, var(--theme-danger-dark) 100%);

    /* -----------------------------------------------------------------------------
       Shadows (lighter for light theme)
       ----------------------------------------------------------------------------- */
    --theme-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --theme-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --theme-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --theme-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    --theme-shadow-drop: rgba(0, 0, 0, 0.12);
    --theme-shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.25);
    --theme-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.1);
    --theme-shadow-glow: 0 0 20px rgba(59, 130, 246, 0.1);
    --theme-shadow-glow-strong: 0 0 30px rgba(59, 130, 246, 0.15);

    /* -----------------------------------------------------------------------------
       Chart/Graph Colors
       ----------------------------------------------------------------------------- */
    --theme-chart-bg: #ffffff;
    --theme-chart-grid: rgba(226, 232, 240, 0.6);
    --theme-chart-axis: #64748b;
    --theme-chart-label: #1e293b;

    /* -----------------------------------------------------------------------------
       Scrollbar Colors
       ----------------------------------------------------------------------------- */
    --theme-scrollbar-track: rgba(15, 23, 42, 0.05);
    --theme-scrollbar-thumb: rgba(59, 130, 246, 0.3);
    --theme-scrollbar-thumb-hover: rgba(59, 130, 246, 0.5);
    --theme-scrollbar-width: 8px;

    /* -----------------------------------------------------------------------------
       Form Elements
       ----------------------------------------------------------------------------- */
    --theme-input-bg: #ffffff;
    --theme-input-border: rgba(226, 232, 240, 0.8);
    --theme-input-border-focus: rgba(59, 130, 246, 0.6);
    --theme-input-placeholder: #475569;
    --theme-input-disabled-bg: rgba(226, 232, 240, 0.4);

    /* -----------------------------------------------------------------------------
       Table Colors
       ----------------------------------------------------------------------------- */
    --theme-table-header-bg: rgba(248, 250, 252, 1);
    --theme-table-row-hover: #f3f8fe;
    --theme-table-row-selected: rgba(59, 130, 246, 0.12);
    --theme-table-border: rgba(226, 232, 240, 0.6);
    --theme-table-sticky-bg: #f8fafc;

    /* -----------------------------------------------------------------------------
       Modal/Dialog Colors
       ----------------------------------------------------------------------------- */
    --theme-modal-bg: #ffffff;
    --theme-modal-header-bg: #f8fafc;
    --theme-modal-border: #e2e8f0;
    --theme-modal-backdrop: rgba(0, 0, 0, 0.4);
}

/* =============================================================================
   BASE STYLES - Apply theme to core elements
   These use [data-theme] selectors to override hardcoded colors in darkblue.css
   ============================================================================= */

/* =============================================================================
   SLIMSCROLL - Light theme normalization
   ============================================================================= */
[data-theme="light"] .slimScrollBar,
[data-theme="light"] .slimScrollBarX,
[data-theme="light"] .slimScrollBarY,
html[data-theme="light"] .slimScrollBar,
html[data-theme="light"] .slimScrollBarX,
html[data-theme="light"] .slimScrollBarY {
    background-color: var(--theme-scrollbar-thumb) !important;
    border-radius: 6px !important;
    opacity: 0.85 !important;
}

[data-theme="light"] .slimScrollRail,
[data-theme="light"] .slimScrollRailX,
[data-theme="light"] .slimScrollRailY,
html[data-theme="light"] .slimScrollRail,
html[data-theme="light"] .slimScrollRailX,
html[data-theme="light"] .slimScrollRailY {
    background-color: var(--theme-scrollbar-track) !important;
    border-radius: 6px !important;
    opacity: 0.7 !important;
}

/* Dark theme body styles */
[data-theme="dark"] body,
html:not([data-theme="light"]) body {
    background: #11161d !important;
    background-color: #11161d !important;
    color: #e6edf3 !important;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light theme body styles - explicit override */
[data-theme="light"] body,
html[data-theme="light"] body {
    background: var(--theme-bg-primary, #f1f5f9) !important;
    background-color: var(--theme-bg-primary, #f1f5f9) !important;
    color: var(--theme-text-primary, #1e293b) !important;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark theme page container */
[data-theme="dark"] .page-container,
html:not([data-theme="light"]) .page-container {
    background-color: #11161d !important;
    min-height: 100vh;
    transition: background-color 0.3s ease;
}

/* Light theme page container */
[data-theme="light"] .page-container,
html[data-theme="light"] .page-container {
    background-color: var(--theme-bg-primary, #f1f5f9) !important;
    min-height: 100vh;
    transition: background-color 0.3s ease;
}

/* Light theme: section loading overlay */
[data-theme="light"] #section-loading-spinner,
html[data-theme="light"] #section-loading-spinner {
    background-color: rgba(248, 250, 252, 0.9) !important;
    backdrop-filter: blur(10px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(160%) !important;
}

[data-theme="light"] #section-loading-spinner .dot,
html[data-theme="light"] #section-loading-spinner .dot {
    background-color: var(--theme-accent-blue, #3b82f6) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.35) !important;
}

[data-theme="light"] #section-loading-spinner .loading-text,
html[data-theme="light"] #section-loading-spinner .loading-text {
    color: var(--theme-text-primary, #1e293b) !important;
    text-shadow: none !important;
}

[data-theme="light"] #page-loading-spinner,
html[data-theme="light"] #page-loading-spinner {
    background-color: rgba(248, 250, 252, 0.92) !important;
}

/* Page content area - uses theme variable */
.page-content-wrapper {
    background: transparent !important;
}

/* Dark theme page-content */
[data-theme="dark"] .page-content,
html:not([data-theme="light"]) .page-content {
    background-color: var(--theme-bg-primary, #11161d) !important;
}

/* Light theme page-content */
[data-theme="light"] .page-content,
html[data-theme="light"] .page-content {
    background-color: var(--theme-bg-primary, #f1f5f9) !important;
}

/* Sidebar - transparent on dark */
[data-theme="dark"] .page-sidebar-wrapper,
[data-theme="dark"] .page-sidebar,
[data-theme="dark"] .navbar.sidebar,
[data-theme="dark"] .navbar.sidebar .container-fluid,
[data-theme="dark"] .navbar.sidebar .nav.navbar-nav,
[data-theme="dark"] #meniuLeft,
[data-theme="dark"] #bs-sidebar-navbar-collapse-1,
html:not([data-theme="light"]) .page-sidebar-wrapper,
html:not([data-theme="light"]) .page-sidebar,
html:not([data-theme="light"]) .navbar.sidebar {
    background: transparent !important;
    background-color: transparent !important;
}

/* Light theme: give sidebar subtle background */
[data-theme="light"] .navbar.sidebar,
html[data-theme="light"] .navbar.sidebar {
    background: var(--theme-bg-glass, rgba(255, 255, 255, 0.9)) !important;
    border-right: 1px solid var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

[data-theme="light"] .page-sidebar-wrapper,
[data-theme="light"] #meniuLeft,
html[data-theme="light"] .page-sidebar-wrapper {
    background: transparent !important;
}

/* Light theme: Page sidebar */
[data-theme="light"] .page-sidebar,
[data-theme="light"] #meniuLeft.page-sidebar-wrapper,
html[data-theme="light"] .page-sidebar,
html[data-theme="light"] #meniuLeft.page-sidebar-wrapper {
    background-color: var(--theme-bg-secondary, #ffffff) !important;
    background: var(--theme-bg-secondary, #ffffff) !important;
}

[data-theme="light"] .page-sidebar .page-sidebar-menu>li>a,
html[data-theme="light"] .page-sidebar .page-sidebar-menu>li>a {
    color: var(--theme-text-primary, #1e293b) !important;
    border-top-color: var(--theme-border-subtle, rgba(226, 232, 240, 0.5)) !important;
}

[data-theme="light"] .page-sidebar .page-sidebar-menu>li>a>i,
html[data-theme="light"] .page-sidebar .page-sidebar-menu>li>a>i {
    color: var(--theme-text-secondary, #64748b) !important;
}

[data-theme="light"] .page-sidebar .page-sidebar-menu>li:hover>a,
[data-theme="light"] .page-sidebar .page-sidebar-menu>li.open>a,
html[data-theme="light"] .page-sidebar .page-sidebar-menu>li:hover>a {
    background: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
}

[data-theme="light"] .page-sidebar .page-sidebar-menu .sub-menu>li>a,
html[data-theme="light"] .page-sidebar .page-sidebar-menu .sub-menu>li>a {
    color: var(--theme-text-secondary, #64748b) !important;
}

/* =============================================================================
   LIGHT THEME - Sidebar Menu (Modern Menu)
   ============================================================================= */

/* Sidebar navbar container */
[data-theme="light"] .navbar.sidebar,
[data-theme="light"] .navbar.sidebar .container-fluid,
html[data-theme="light"] .navbar.sidebar {
    background: var(--theme-bg-secondary, #ffffff) !important;
    background-color: var(--theme-bg-secondary, #ffffff) !important;
    border-right: 1px solid var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

/* Menu items base */
[data-theme="light"] .navbar.sidebar .nav-item .nav-link,
html[data-theme="light"] .navbar.sidebar .nav-item .nav-link {
    color: var(--theme-text-secondary, #64748b) !important;
}

[data-theme="light"] .navbar.sidebar .nav-item .nav-link .menuTitle,
html[data-theme="light"] .navbar.sidebar .nav-item .nav-link .menuTitle {
    color: var(--theme-text-primary, #1e293b) !important;
}

/* Menu icons */
[data-theme="light"] .navbar.sidebar .nav-item .nav-link .fa,
[data-theme="light"] .navbar.sidebar .nav-item .nav-link i,
html[data-theme="light"] .navbar.sidebar .nav-item .nav-link .fa {
    color: var(--theme-text-secondary, #64748b) !important;
}

/* SVG/Image icons - invert for light theme */
[data-theme="light"] .navbar.sidebar .nav-item .nav-link img,
html[data-theme="light"] .navbar.sidebar .nav-item .nav-link img {
    filter: invert(0.5) !important;
}

/* Menu items hover */
[data-theme="light"] .navbar.sidebar .nav-item:hover>.nav-link,
[data-theme="light"] .navbar.sidebar .nav.navbar-nav>.nav-item:hover>.nav-link,
html[data-theme="light"] .navbar.sidebar .nav-item:hover>.nav-link {
    background: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
    border-color: var(--theme-border-accent, rgba(59, 130, 246, 0.4)) !important;
    color: var(--theme-text-link, #3b82f6) !important;
}

[data-theme="light"] .navbar.sidebar .nav-item:hover>.nav-link .menuTitle,
html[data-theme="light"] .navbar.sidebar .nav-item:hover>.nav-link .menuTitle {
    color: var(--theme-text-link, #3b82f6) !important;
}

[data-theme="light"] .navbar.sidebar .nav-item:hover>.nav-link .fa,
[data-theme="light"] .navbar.sidebar .nav-item:hover>.nav-link i,
html[data-theme="light"] .navbar.sidebar .nav-item:hover>.nav-link .fa {
    color: var(--theme-text-link, #3b82f6) !important;
}

/* Active menu item */
[data-theme="light"] .navbar.sidebar .nav-item.active .nav-link,
html[data-theme="light"] .navbar.sidebar .nav-item.active .nav-link {
    background: linear-gradient(145deg, var(--theme-accent-blue-bg, rgba(59, 130, 246, 0.1)) 0%, rgba(59, 130, 246, 0.05) 100%) !important;
    border-color: var(--theme-border-accent, rgba(59, 130, 246, 0.4)) !important;
    color: var(--theme-text-link, #3b82f6) !important;
}

[data-theme="light"] .navbar.sidebar .nav-item.active .nav-link .menuTitle,
html[data-theme="light"] .navbar.sidebar .nav-item.active .nav-link .menuTitle {
    color: var(--theme-chart-label, #171718) !important;
}

[data-theme="light"] .navbar.sidebar .nav-item.active .nav-link .fa,
[data-theme="light"] .navbar.sidebar .nav-item.active .nav-link i,
html[data-theme="light"] .navbar.sidebar .nav-item.active .nav-link .fa {
    color: var(--theme-text-link, #3b82f6) !important;
}

/* Dropdown/Submenu */
[data-theme="light"] .alerts-menu .nav-item.active>.nav-link,
html[data-theme="light"] .alerts-menu .nav-item.active>.nav-link {
    background: linear-gradient(145deg, rgba(54, 127, 211, 0.25) 0%, rgba(54, 127, 211, 0.15) 100%) !important;
    border-color: var(--theme-border-accent, rgba(59, 130, 246, 0.4)) !important;
    color: var(--theme-text-link, #3b82f6) !important;
}

[data-theme="light"] .alerts-menu .nav-item.active>.nav-link .menuTitle,
html[data-theme="light"] .alerts-menu .nav-item.active>.nav-link .menuTitle {
    color: var(--theme-text-link, #3b82f6) !important;
}

[data-theme="light"] .navbar.sidebar .dropdown-menu,
[data-theme="light"] .navbar.sidebar .nav-item .dropdown-menu,
html[data-theme="light"] .navbar.sidebar .dropdown-menu {
    background: var(--theme-bg-dropdown, rgba(255, 255, 255, 0.98)) !important;
    border-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
    box-shadow: var(--theme-shadow-md, 0 8px 24px rgba(0, 0, 0, 0.08)) !important;
}

[data-theme="light"] .navbar.sidebar .dropdown-menu .dropdown-item,
[data-theme="light"] .navbar.sidebar .dropdown-menu li a,
html[data-theme="light"] .navbar.sidebar .dropdown-menu .dropdown-item {
    color: var(--theme-text-secondary, #64748b) !important;
}

[data-theme="light"] .navbar.sidebar .dropdown-menu .dropdown-item:hover,
[data-theme="light"] .navbar.sidebar .dropdown-menu li a:hover,
html[data-theme="light"] .navbar.sidebar .dropdown-menu .dropdown-item:hover {
    background: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
    color: var(--theme-text-link, #3b82f6) !important;
}

/* Disabled dropdown items */
[data-theme="light"] .dropdown-menu a[disabled],
[data-theme="light"] .dropdown-menu a.disabled,
html[data-theme="light"] .dropdown-menu a[disabled],
html[data-theme="light"] .dropdown-menu a.disabled {
    color: var(--theme-text-disabled, #cbd5e1) !important;
    pointer-events: none;
    cursor: not-allowed;
    background: transparent !important;
}

/* Disabled Checkbox */
.alerts-checkbox-input:disabled+.alerts-checkbox-box,
.alerts-checkbox-input[disabled]+.alerts-checkbox-box {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--theme-border-subtle, rgba(255, 255, 255, 0.05));
    background: var(--theme-bg-subtle, rgba(255, 255, 255, 0.05));
    box-shadow: none;
}


/* Collapse button at bottom */
[data-theme="light"] .navbar.sidebar .sidebar-collapse-btn,
[data-theme="light"] #sidebar-toggle-btn,
html[data-theme="light"] .navbar.sidebar .sidebar-collapse-btn {
    color: var(--theme-text-secondary, #64748b) !important;
    background: var(--theme-bg-tertiary, rgba(248, 250, 252, 0.95)) !important;
    border-color: var(--theme-border-subtle, rgba(226, 232, 240, 0.5)) !important;
}

[data-theme="light"] .navbar.sidebar .sidebar-collapse-btn:hover,
html[data-theme="light"] .navbar.sidebar .sidebar-collapse-btn:hover {
    background: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
    color: var(--theme-text-link, #3b82f6) !important;
}

/* =============================================================================
   LIGHT THEME - Header Overrides
   ============================================================================= */
/* TEST: Gray accent top bar for light theme */
[data-theme="light"] .page-header.navbar,
html[data-theme="light"] .page-header.navbar {
    background-color: #3f4a5a !important;
    background: linear-gradient(180deg, #4a5568 0%, #3f4a5a 100%) !important;
    border-bottom: 1px solid #2d3748 !important;
}

/* Adjust header icons/text for gray background */
[data-theme="light"] .page-header.navbar .top-menu .navbar-nav>li.dropdown .dropdown-toggle>i,
[data-theme="light"] .page-header.navbar .page-logo .logo-default,
[data-theme="light"] .page-header.navbar .hor-menu .navbar-nav>li>a,
html[data-theme="light"] .page-header.navbar .top-menu .navbar-nav>li.dropdown .dropdown-toggle>i {
    color: #e2e8f0 !important;
}

[data-theme="light"] .page-header.navbar .hor-menu .navbar-nav>li>a:hover,
html[data-theme="light"] .page-header.navbar .hor-menu .navbar-nav>li>a:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="light"] .page-header.navbar .top-menu .navbar-nav>li.dropdown .dropdown-toggle:hover,
html[data-theme="light"] .page-header.navbar .top-menu .navbar-nav>li.dropdown .dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Company selector in gray header */
[data-theme="light"] .page-header.navbar .company-selector-trigger,
html[data-theme="light"] .page-header.navbar .company-selector-trigger {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #e2e8f0 !important;
}

[data-theme="light"] .page-header.navbar .company-selector-trigger:hover,
html[data-theme="light"] .page-header.navbar .company-selector-trigger:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* User info in gray header */
[data-theme="light"] .page-header.navbar .username,
[data-theme="light"] .page-header.navbar .user-info,
html[data-theme="light"] .page-header.navbar .username {
    color: #e2e8f0 !important;
}

/* END TEST */

/* =============================================================================
   LIGHT THEME - Table Overrides  
   ============================================================================= */
[data-theme="light"] .table,
[data-theme="light"] table,
html[data-theme="light"] .table,
html[data-theme="light"] table {
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] .table>thead>tr>th,
[data-theme="light"] table>thead>tr>th,
[data-theme="light"] thead th,
html[data-theme="light"] .table>thead>tr>th,
html[data-theme="light"] thead th {
    background-color: var(--theme-table-header-bg, rgba(248, 250, 252, 0.95)) !important;
    color: var(--theme-text-tertiary, #374151) !important;
    /* Darker text for better visibility */
    border-bottom-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

[data-theme="light"] .table>tbody>tr>td,
[data-theme="light"] table>tbody>tr>td,
html[data-theme="light"] .table>tbody>tr>td {
    border-bottom-color: var(--theme-table-border, rgba(226, 232, 240, 0.6)) !important;
}

[data-theme="light"] .table-hover>tbody>tr:hover,
html[data-theme="light"] .table-hover>tbody>tr:hover {
    background-color: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
}

/* Light theme: Striped table rows */
[data-theme="light"] .table-striped>tbody>tr,
html[data-theme="light"] .table-striped>tbody>tr {
    background-color: var(--theme-bg-secondary, #ffffff) !important;
    border-bottom-color: var(--theme-table-border, rgba(226, 232, 240, 0.6)) !important;
}

[data-theme="light"] .table-striped>tbody:nth-of-type(even)>tr:first-child,
html[data-theme="light"] .table-striped>tbody:nth-of-type(even)>tr:first-child {
    background-color: var(--theme-bg-tertiary, #f8fafc) !important;
}

/* =============================================================================
   LIGHT THEME: Endpoints/Rovers Table (Live View)
   ============================================================================= */

/* Table header */
[data-theme="light"] #rovers-table thead,
[data-theme="light"] #endpoints-table thead,
html[data-theme="light"] #rovers-table thead,
html[data-theme="light"] #endpoints-table thead {
    background: var(--theme-table-header-bg, rgba(248, 250, 252, 0.95)) !important;
}

[data-theme="light"] #rovers-table thead th,
[data-theme="light"] #endpoints-table thead th,
html[data-theme="light"] #rovers-table thead th,
html[data-theme="light"] #endpoints-table thead th {
    background: var(--theme-table-header-bg, rgba(248, 250, 252, 0.98)) !important;
    color: var(--theme-text-tertiary, #374151) !important;
    /* Darker text for better visibility */
    border-bottom-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

/* Policies page - exclusions table header (match rovers table style) */
[data-theme="light"] #malware-table2 thead th,
[data-theme="light"] .table-alerts thead th,
[data-theme="light"] #policies-page #malware-table2 thead th,
[data-theme="light"] #policies-page .table-alerts thead th,
[data-theme="light"] .exclusions-portlet #malware-table2 thead th,
[data-theme="light"] .exclusions-portlet .table-alerts thead th,
html[data-theme="light"] #malware-table2 thead th,
html[data-theme="light"] .table-alerts thead th,
html[data-theme="light"] #policies-page #malware-table2 thead th,
html[data-theme="light"] .exclusions-portlet #malware-table2 thead th {
    background: var(--theme-table-header-bg, #f8fafc) !important;
    background-color: var(--theme-table-header-bg, #f8fafc) !important;
    color: var(--theme-text-tertiary, #374151) !important;
    border-bottom: 1px solid var(--theme-border-solid, #e2e8f0) !important;
}

/* Policies page - exclusions table thead row */
[data-theme="light"] #malware-table2 thead,
[data-theme="light"] .table-alerts thead,
[data-theme="light"] #policies-page #malware-table2 thead,
[data-theme="light"] #policies-page .table-alerts thead,
[data-theme="light"] .exclusions-portlet #malware-table2 thead,
[data-theme="light"] .exclusions-portlet .table-alerts thead,
html[data-theme="light"] #malware-table2 thead,
html[data-theme="light"] .table-alerts thead,
html[data-theme="light"] #policies-page #malware-table2 thead,
html[data-theme="light"] .exclusions-portlet #malware-table2 thead {
    background: var(--theme-table-header-bg, #f8fafc) !important;
    background-color: var(--theme-table-header-bg, #f8fafc) !important;
}

/* Policies page - exclusions table body rows (match rovers) */
[data-theme="light"] #malware-table2 tbody tr,
[data-theme="light"] .table-alerts tbody tr,
[data-theme="light"] #policies-page #malware-table2 tbody tr,
[data-theme="light"] #policies-page .table-alerts tbody tr,
[data-theme="light"] .exclusions-portlet #malware-table2 tbody tr,
[data-theme="light"] .exclusions-portlet .table-alerts tbody tr,
html[data-theme="light"] #malware-table2 tbody tr,
html[data-theme="light"] .table-alerts tbody tr {
    background: var(--theme-bg-secondary, #ffffff) !important;
    background-color: var(--theme-bg-secondary, #ffffff) !important;
    border-bottom: 1px solid var(--theme-border-solid, #e2e8f0) !important;
}

[data-theme="light"] #malware-table2 tbody tr:hover,
[data-theme="light"] .table-alerts tbody tr:hover,
[data-theme="light"] #policies-page #malware-table2 tbody tr:hover,
[data-theme="light"] #policies-page .table-alerts tbody tr:hover,
html[data-theme="light"] #malware-table2 tbody tr:hover,
html[data-theme="light"] .table-alerts tbody tr:hover {
    background: var(--theme-bg-primary, #f1f5f9) !important;
    background-color: var(--theme-bg-primary, #f1f5f9) !important;
}

/* Exclusions table cells */
[data-theme="light"] #malware-table2 tbody td,
[data-theme="light"] .table-alerts tbody td,
[data-theme="light"] #policies-page #malware-table2 tbody td,
[data-theme="light"] #policies-page .table-alerts tbody td,
html[data-theme="light"] #malware-table2 tbody td,
html[data-theme="light"] .table-alerts tbody td {
    color: var(--theme-text-dark, #1f2937) !important;
}

/* Sticky columns in light theme */
[data-theme="light"] #rovers-table .sticky-left,
[data-theme="light"] #rovers-table .sticky-left-2,
[data-theme="light"] #rovers-table .sticky-right,
[data-theme="light"] #rovers-table td:last-child,
[data-theme="light"] #rovers-table th:last-child,
[data-theme="light"] #endpoints-table .sticky-left,
[data-theme="light"] #endpoints-table .sticky-left-2,
[data-theme="light"] #endpoints-table .sticky-right,
[data-theme="light"] #endpoints-table td:last-child,
[data-theme="light"] #endpoints-table th:last-child,
html[data-theme="light"] #endpoints-table .sticky-left,
html[data-theme="light"] #endpoints-table td:last-child {
    background: var(--theme-table-sticky-bg, #f8fafc) !important;
}

/* Header sticky columns */
[data-theme="light"] #rovers-table thead .sticky-left,
[data-theme="light"] #rovers-table thead .sticky-left-2,
[data-theme="light"] #rovers-table thead .sticky-right,
[data-theme="light"] #rovers-table thead th:last-child,
[data-theme="light"] #endpoints-table thead .sticky-left,
[data-theme="light"] #endpoints-table thead .sticky-left-2,
[data-theme="light"] #endpoints-table thead .sticky-right,
[data-theme="light"] #endpoints-table thead th:last-child,
html[data-theme="light"] #endpoints-table thead .sticky-left,
html[data-theme="light"] #endpoints-table thead th:last-child {
    background: var(--theme-table-header-bg, rgba(248, 250, 252, 0.98)) !important;
}

/* Hover state for sticky columns */
[data-theme="light"] #rovers-table tbody tr:hover .sticky-left,
[data-theme="light"] #rovers-table tbody tr:hover .sticky-left-2,
[data-theme="light"] #rovers-table tbody tr:hover .sticky-right,
[data-theme="light"] #rovers-table tbody tr:hover td:last-child,
[data-theme="light"] #endpoints-table tbody tr:hover .sticky-left,
[data-theme="light"] #endpoints-table tbody tr:hover .sticky-left-2,
[data-theme="light"] #endpoints-table tbody tr:hover .sticky-right,
[data-theme="light"] #endpoints-table tbody tr:hover td:last-child,
html[data-theme="light"] #endpoints-table tbody tr:hover .sticky-left {
    background: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
}

/* Table body cells */
[data-theme="light"] #rovers-table tbody td,
[data-theme="light"] #endpoints-table tbody td,
html[data-theme="light"] #rovers-table tbody td,
html[data-theme="light"] #endpoints-table tbody td {
    color: var(--theme-text-primary, #1e293b) !important;
    border-bottom-color: var(--theme-table-border, rgba(226, 232, 240, 0.6)) !important;
}

/* Dynamic sticky table (used in many places) */
[data-theme="light"] .dynamic-sticky-table thead th,
html[data-theme="light"] .dynamic-sticky-table thead th {
    background-color: var(--theme-table-header-bg, rgba(248, 250, 252, 0.95)) !important;
    color: var(--theme-text-secondary, #64748b) !important;
}

[data-theme="light"] .dynamic-sticky-table tbody tr:nth-child(2n) td,
html[data-theme="light"] .dynamic-sticky-table tbody tr:nth-child(2n) td {
    background-color: var(--theme-bg-secondary, #ffffff) !important;
}

[data-theme="light"] .dynamic-sticky-table tbody tr:nth-child(2n+1) td,
html[data-theme="light"] .dynamic-sticky-table tbody tr:nth-child(2n+1) td {
    background-color: var(--theme-bg-tertiary, #f8fafc) !important;
}

[data-theme="light"] .dynamic-sticky-table tbody tr:hover td,
html[data-theme="light"] .dynamic-sticky-table tbody tr:hover td {
    background-color: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
}

[data-theme="light"] .dynamic-sticky-table tbody tr:hover .sticky-column,
html[data-theme="light"] .dynamic-sticky-table tbody tr:hover .sticky-column {
    background-color: var(--theme-table-row-hover, rgba(59, 130, 246, 0.08)) !important;
}

/* Hunt results tables (razvanTale) */
[data-theme="light"] table.razvanTale thead th,
html[data-theme="light"] table.razvanTale thead th {
    background-color: var(--theme-table-header-bg, rgba(248, 250, 252, 0.95)) !important;
    border-bottom-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
    color: var(--theme-text-secondary, #64748b) !important;
}

[data-theme="light"] table.razvanTale tbody tr:hover,
html[data-theme="light"] table.razvanTale tbody tr:hover {
    background-color: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
}

[data-theme="light"] table.razvanTale th.sticky-left,
[data-theme="light"] table.razvanTale td.sticky-left,
[data-theme="light"] table.razvanTale th.sticky-left-2,
[data-theme="light"] table.razvanTale td.sticky-left-2,
html[data-theme="light"] table.razvanTale th.sticky-left,
html[data-theme="light"] table.razvanTale td.sticky-left,
html[data-theme="light"] table.razvanTale th.sticky-left-2,
html[data-theme="light"] table.razvanTale td.sticky-left-2 {
    background-color: var(--theme-table-sticky-bg, #f8fafc) !important;
}

[data-theme="light"] table.razvanTale tbody tr:hover td.sticky-left,
[data-theme="light"] table.razvanTale tbody tr:hover td.sticky-left-2,
html[data-theme="light"] table.razvanTale tbody tr:hover td.sticky-left,
html[data-theme="light"] table.razvanTale tbody tr:hover td.sticky-left-2 {
    background-color: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
}

[data-theme="light"] table.razvanTale thead th.sticky-left,
[data-theme="light"] table.razvanTale thead th.sticky-left-2,
html[data-theme="light"] table.razvanTale thead th.sticky-left,
html[data-theme="light"] table.razvanTale thead th.sticky-left-2 {
    background-color: var(--theme-table-header-bg, rgba(248, 250, 252, 0.95)) !important;
}

[data-theme="light"] .razvanTale td,
html[data-theme="light"] .razvanTale td {
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] .razvanTale tr,
html[data-theme="light"] .razvanTale tr {
    border-bottom-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

/* Light theme: Color classes from darkblue.css */
[data-theme="light"] .col-1,
html[data-theme="light"] .col-1 {
    color: var(--theme-text-secondary, #64748b) !important;
}

[data-theme="light"] .col-2,
html[data-theme="light"] .col-2 {
    color: var(--theme-text-primary, #1e293b) !important;
}



[data-theme="light"] .bg-1:hover .col-1,
[data-theme="light"] .bg-1 .col-1:hover,
html[data-theme="light"] .bg-1:hover .col-1,
html[data-theme="light"] .bg-1 .col-1:hover {
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] td.col-1,
[data-theme="light"] td.col-2,
html[data-theme="light"] td.col-1,
html[data-theme="light"] td.col-2,
[data-theme="light"] tr:hover td.col-1,
html[data-theme="light"] tr:hover td.col-1 {
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] .pre-title,
html[data-theme="light"] .pre-title {
    color: var(--theme-text-secondary, #64748b) !important;
}

[data-theme="light"] .pre-pre-title,
html[data-theme="light"] .pre-pre-title {
    color: var(--theme-text-primary, #1e293b) !important;
}

/* =============================================================================
   LIGHT THEME - Form Elements
   ============================================================================= */
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="light"] .form-control,
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    background-color: var(--theme-input-bg, #ffffff) !important;
    border-color: var(--theme-input-border, rgba(226, 232, 240, 0.8)) !important;
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder,
html[data-theme="light"] input::placeholder {
    color: var(--theme-text-muted-info, var(--theme-input-placeholder, #94a3b8)) !important;
    opacity: 1;
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] .form-control:focus,
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
    border-color: var(--theme-accent-blue, #3b82f6) !important;
    box-shadow: var(--theme-shadow-focus, 0 0 0 3px rgba(59, 130, 246, 0.25)) !important;
}

[data-theme="light"] *:focus-visible,
html[data-theme="light"] *:focus-visible {
    outline: 2px solid var(--theme-accent-blue, #3b82f6);
    outline-offset: 2px;
}

/* =============================================================================
   LIGHT THEME - Buttons
   ============================================================================= */
[data-theme="light"] .btn-default,
html[data-theme="light"] .btn-default {
    background-color: var(--theme-bg-tertiary, #f8fafc) !important;
    border-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] .btn-default:hover,
html[data-theme="light"] .btn-default:hover {
    background-color: var(--theme-bg-card-hover, rgba(248, 250, 252, 1)) !important;
}

/* Light theme - Hunt table controls */
[data-theme="light"] .btn-report,
html[data-theme="light"] .btn-report {
    background-color: var(--theme-bg-tertiary, #f8fafc) !important;
    color: var(--theme-text-primary, #1e293b) !important;
    border-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

[data-theme="light"] .btn-report:hover,
[data-theme="light"] .btn-report:focus,
html[data-theme="light"] .btn-report:hover,
html[data-theme="light"] .btn-report:focus {
    background-color: var(--theme-bg-card-hover, rgba(248, 250, 252, 1)) !important;
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] select.rows-select.form-control,
html[data-theme="light"] select.rows-select.form-control {
    background-color: var(--theme-bg-secondary, #ffffff) !important;
    color: var(--theme-text-primary, #1e293b) !important;
    border-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

[data-theme="light"] select.rows-select.form-control:focus,
html[data-theme="light"] select.rows-select.form-control:focus {
    border-color: var(--theme-accent-blue, #3b82f6) !important;
    box-shadow: none !important;
}

[data-theme="light"] select.rows-select.form-control option,
html[data-theme="light"] select.rows-select.form-control option {
    background-color: var(--theme-bg-card-solid, #ffffff) !important;
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] .portlet-title .actions .btn-group>label.control-label,
html[data-theme="light"] .portlet-title .actions .btn-group>label.control-label {
    color: var(--theme-text-secondary, #64748b) !important;
}

[data-theme="light"] .columns-select-group.open .dropdown-toggle,
[data-theme="light"] .columns-select-group.show .dropdown-toggle,
html[data-theme="light"] .columns-select-group.open .dropdown-toggle,
html[data-theme="light"] .columns-select-group.show .dropdown-toggle {
    background-color: var(--theme-bg-card-hover, rgba(248, 250, 252, 1)) !important;
    color: var(--theme-text-primary, #1e293b) !important;
    border-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

[data-theme="light"] .columns-dropdown-menu,
html[data-theme="light"] .columns-dropdown-menu {
    background-color: var(--theme-bg-card, rgba(255, 255, 255, 0.98)) !important;
    border-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

[data-theme="light"] .columns-dropdown-menu>li>a:hover,
[data-theme="light"] .columns-dropdown-menu>li>a:focus,
html[data-theme="light"] .columns-dropdown-menu>li>a:hover,
html[data-theme="light"] .columns-dropdown-menu>li>a:focus {
    background-color: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
}

[data-theme="light"] .columns-dropdown-item,
html[data-theme="light"] .columns-dropdown-item {
    background-color: var(--theme-bg-tertiary, #f8fafc) !important;
    border-color: var(--theme-border-subtle, rgba(226, 232, 240, 0.6)) !important;
}

[data-theme="light"] .columns-checkbox,
html[data-theme="light"] .columns-checkbox {
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] .column-reorder-handle,
html[data-theme="light"] .column-reorder-handle {
    color: var(--theme-text-muted, #94a3b8) !important;
}

[data-theme="light"] .columns-dropdown-actions .btn-link,
html[data-theme="light"] .columns-dropdown-actions .btn-link {
    color: var(--theme-accent-blue, #3b82f6) !important;
}

[data-theme="light"] .columns-dropdown-actions .btn-link:hover,
[data-theme="light"] .columns-dropdown-actions .btn-link:focus,
html[data-theme="light"] .columns-dropdown-actions .btn-link:hover,
html[data-theme="light"] .columns-dropdown-actions .btn-link:focus {
    color: var(--theme-accent-blue, #3b82f6) !important;
}

[data-theme="light"] .columns-dropdown-scroll,
html[data-theme="light"] .columns-dropdown-scroll {
    scrollbar-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) transparent;
}

[data-theme="light"] .columns-dropdown-scroll::-webkit-scrollbar-thumb,
html[data-theme="light"] .columns-dropdown-scroll::-webkit-scrollbar-thumb {
    background-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

/* =============================================================================
   LIGHT THEME - Dropdown Menus
   ============================================================================= */
[data-theme="light"] .dropdown-menu,
html[data-theme="light"] .dropdown-menu {
    background-color: var(--theme-bg-dropdown, rgba(255, 255, 255, 0.98)) !important;
    border-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
    box-shadow: var(--theme-shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12)) !important;
}

[data-theme="light"] .dropdown-menu>li>a,
html[data-theme="light"] .dropdown-menu>li>a {
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] .dropdown-menu>li>a:hover,
html[data-theme="light"] .dropdown-menu>li>a:hover {
    background-color: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
}

/* =============================================================================
   LIGHT THEME - Date Range Picker
   ============================================================================= */
[data-theme="light"] .daterangepicker,
html[data-theme="light"] .daterangepicker {
    background-color: var(--theme-bg-secondary) !important;
    border: 1px solid var(--theme-border-solid) !important;
    box-shadow: var(--theme-shadow-lg) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="light"] .daterangepicker:before,
html[data-theme="light"] .daterangepicker:before {
    border-bottom-color: var(--theme-bg-secondary) !important;
}

[data-theme="light"] .daterangepicker>.left,
[data-theme="light"] .daterangepicker>.right,
[data-theme="light"] .daterangepicker>.drp-buttons,
html[data-theme="light"] .daterangepicker>.left,
html[data-theme="light"] .daterangepicker>.right,
html[data-theme="light"] .daterangepicker>.drp-buttons {
    background-color: var(--theme-bg-secondary) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="light"] .daterangepicker>.drp-buttons,
html[data-theme="light"] .daterangepicker>.drp-buttons {
    border-top: 1px solid var(--theme-border-solid) !important;
}

[data-theme="light"] .daterangepicker .calendar-table,
[data-theme="light"] .daterangepicker table,
html[data-theme="light"] .daterangepicker .calendar-table,
html[data-theme="light"] .daterangepicker table {
    background-color: var(--theme-bg-secondary) !important;
    border-color: var(--theme-border-subtle) !important;
}

[data-theme="light"] .daterangepicker td.off,
[data-theme="light"] .daterangepicker td.off.in-range,
[data-theme="light"] .daterangepicker td.off.start-date,
[data-theme="light"] .daterangepicker td.off.end-date,
html[data-theme="light"] .daterangepicker td.off,
html[data-theme="light"] .daterangepicker td.off.in-range,
html[data-theme="light"] .daterangepicker td.off.start-date,
html[data-theme="light"] .daterangepicker td.off.end-date {
    background-color: var(--theme-bg-tertiary) !important;
    color: var(--theme-text-muted-decorative) !important;
}

[data-theme="light"] .daterangepicker td.in-range,
html[data-theme="light"] .daterangepicker td.in-range {
    background-color: var(--theme-accent-blue-bg) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="light"] .daterangepicker td.available:hover,
[data-theme="light"] .daterangepicker th.available:hover,
html[data-theme="light"] .daterangepicker td.available:hover,
html[data-theme="light"] .daterangepicker th.available:hover {
    background-color: var(--theme-table-row-hover) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="light"] .daterangepicker select.monthselect,
[data-theme="light"] .daterangepicker select.yearselect,
[data-theme="light"] .daterangepicker select.hourselect,
[data-theme="light"] .daterangepicker select.minuteselect,
[data-theme="light"] .daterangepicker select.secondselect,
[data-theme="light"] .daterangepicker select.ampmselect,
html[data-theme="light"] .daterangepicker select.monthselect,
html[data-theme="light"] .daterangepicker select.yearselect,
html[data-theme="light"] .daterangepicker select.hourselect,
html[data-theme="light"] .daterangepicker select.minuteselect,
html[data-theme="light"] .daterangepicker select.secondselect,
html[data-theme="light"] .daterangepicker select.ampmselect {
    background-color: var(--theme-bg-secondary) !important;
    border: 1px solid var(--theme-border-solid) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="light"] .daterangepicker td.disabled,
[data-theme="light"] .daterangepicker option,
html[data-theme="light"] .daterangepicker td.disabled,
html[data-theme="light"] .daterangepicker option {
    color: var(--theme-text-muted-info) !important;
}

[data-theme="light"] .daterangepicker td.active.start-date.in-range.available,
[data-theme="light"] .daterangepicker td.active.end-date.in-range.available,
html[data-theme="light"] .daterangepicker td.active.start-date.in-range.available,
html[data-theme="light"] .daterangepicker td.active.end-date.in-range.available {
    background-color: var(--theme-accent-blue) !important;
    color: #ffffff !important;
}

[data-theme="light"] .daterangepicker option,
html[data-theme="light"] .daterangepicker option {
    background-color: var(--theme-bg-secondary) !important;
}

[data-theme="light"] .daterangepicker td.disabled,
[data-theme="light"] .daterangepicker option[disabled],
html[data-theme="light"] .daterangepicker td.disabled,
html[data-theme="light"] .daterangepicker option[disabled] {
    color: var(--theme-text-muted-decorative) !important;
}

[data-theme="light"] .daterangepicker .calendar-table .next span,
[data-theme="light"] .daterangepicker .calendar-table .prev span,
html[data-theme="light"] .daterangepicker .calendar-table .next span,
html[data-theme="light"] .daterangepicker .calendar-table .prev span {
    border-color: var(--theme-text-secondary) !important;
}

[data-theme="light"] .daterangepicker>.drp-buttons .btn,
html[data-theme="light"] .daterangepicker>.drp-buttons .btn {
    color: var(--theme-text-primary) !important;
}

[data-theme="light"] .daterangepicker .ranges li,
html[data-theme="light"] .daterangepicker .ranges li {
    background: var(--theme-bg-tertiary) !important;
    border: 1px solid var(--theme-border-solid) !important;
    color: var(--theme-text-secondary) !important;
}

[data-theme="light"] .daterangepicker .ranges li:hover,
html[data-theme="light"] .daterangepicker .ranges li:hover {
    background: var(--theme-accent-blue-bg) !important;
    border-color: var(--theme-accent-blue) !important;
    color: var(--theme-accent-blue) !important;
}

[data-theme="light"] .daterangepicker .ranges li.active,
html[data-theme="light"] .daterangepicker .ranges li.active {
    background: var(--theme-accent-blue-bg) !important;
    border-color: var(--theme-accent-blue) !important;
    color: var(--theme-accent-blue) !important;
}

/* =============================================================================
   LIGHT THEME - Scrollbars
   ============================================================================= */
[data-theme="light"] ::-webkit-scrollbar,
html[data-theme="light"] ::-webkit-scrollbar {
    width: var(--theme-scrollbar-width, 8px);
    height: var(--theme-scrollbar-width, 8px);
}

[data-theme="light"] ::-webkit-scrollbar-track,
html[data-theme="light"] ::-webkit-scrollbar-track {
    background: var(--theme-scrollbar-track, rgba(15, 23, 42, 0.05));
}

[data-theme="light"] ::-webkit-scrollbar-thumb,
html[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: var(--theme-scrollbar-thumb, rgba(59, 130, 246, 0.3));
    border-radius: 4px;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover,
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: var(--theme-scrollbar-thumb-hover, rgba(59, 130, 246, 0.5));
}

/* =============================================================================
   LIGHT THEME - Cards and Panels
   ============================================================================= */
[data-theme="light"] .panel,
[data-theme="light"] .portlet,
[data-theme="light"] .portlet.light,
[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .portlet,
html[data-theme="light"] .portlet.light {
    background-color: var(--theme-bg-secondary, #ffffff) !important;
    border-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

/* Light theme: mybar */
[data-theme="light"] .mybar,
html[data-theme="light"] .mybar {
    background-color: var(--theme-bg-secondary, #ffffff) !important;
    border-bottom-color: var(--theme-border-subtle, rgba(226, 232, 240, 0.5)) !important;
}

/* Light theme: page-bar */
[data-theme="light"] .page-content-white .page-bar,
[data-theme="light"] .page-container-bg-solid .page-bar,
html[data-theme="light"] .page-bar {
    background-color: var(--theme-bg-primary, #f1f5f9) !important;
}

/* Light theme: dashboard-stat */
[data-theme="light"] .dashboard-stat,
html[data-theme="light"] .dashboard-stat {
    background-color: var(--theme-bg-secondary, #ffffff) !important;
    border: 1px solid var(--theme-border-color, rgba(226, 232, 240, 0.8));
}

/* Light theme: informations */
[data-theme="light"] .informations,
html[data-theme="light"] .informations {
    background-color: var(--theme-bg-secondary, #ffffff) !important;
}

/* Light theme: showdata */
[data-theme="light"] .showdata,
[data-theme="light"] #showdatalive,
html[data-theme="light"] .showdata,
html[data-theme="light"] #showdatalive {
    background-color: var(--theme-bg-primary, #f1f5f9) !important;
}

/* Light theme: jvectormap */
[data-theme="light"] .jvectormap-container,
html[data-theme="light"] .jvectormap-container {
    background-color: var(--theme-bg-secondary, #ffffff) !important;
}

[data-theme="light"] .panel-heading,
[data-theme="light"] .portlet-title,
html[data-theme="light"] .panel-heading {
    background-color: var(--theme-bg-tertiary, #f8fafc) !important;
    border-bottom-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

/* =============================================================================
   LIGHT THEME - Modals
   ============================================================================= */
[data-theme="light"] .modal-content,
html[data-theme="light"] .modal-content {
    background-color: var(--theme-modal-bg, #ffffff) !important;
    border-color: var(--theme-modal-border, #e2e8f0) !important;
}

[data-theme="light"] .modal-header,
html[data-theme="light"] .modal-header {
    background-color: var(--theme-modal-header-bg, #f8fafc) !important;
    border-bottom-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

[data-theme="light"] .modal-footer,
html[data-theme="light"] .modal-footer {
    background-color: var(--theme-modal-header-bg, #f8fafc) !important;
    border-top-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

/* =============================================================================
   LIGHT THEME - Text Colors
   ============================================================================= */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6 {
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] p,
[data-theme="light"] label,
html[data-theme="light"] p,
html[data-theme="light"] label {
    color: var(--theme-text-primary, #1e293b);
}

[data-theme="light"] a,
html[data-theme="light"] a {
    color: var(--theme-text-link, #3b82f6);
}

[data-theme="light"] a:hover,
html[data-theme="light"] a:hover {
    color: var(--theme-text-link-hover, #2563eb);
}

/* Light theme: Nav tabs */
[data-theme="light"] .nav-tabs,
html[data-theme="light"] .nav-tabs {
    border-bottom-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

[data-theme="light"] .nav-tabs>li.active>a,
[data-theme="light"] .nav-tabs>li.active>a:hover,
[data-theme="light"] .nav-tabs>li.active>a:focus,
html[data-theme="light"] .nav-tabs>li.active>a {
    color: var(--theme-text-link, #3b82f6) !important;
    background-color: var(--theme-bg-secondary, #ffffff) !important;
    border-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

/* Light theme: bg-1, bg-3 classes */
[data-theme="light"] .bg-1,
html[data-theme="light"] .bg-1 {
    background-color: var(--theme-bg-primary, #f1f5f9) !important;
}

[data-theme="light"] .bg-3,
html[data-theme="light"] .bg-3 {
    background-color: var(--theme-bg-tertiary, #f8fafc) !important;
}

/* Light theme: Buttons */
[data-theme="light"] .btn-1,
html[data-theme="light"] .btn-1 {
    background-color: var(--theme-bg-tertiary, #f8fafc) !important;
    border-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
    color: var(--theme-text-secondary, #64748b) !important;
}

[data-theme="light"] .btn-1:hover,
html[data-theme="light"] .btn-1:hover {
    background-color: var(--theme-bg-card-hover, rgba(248, 250, 252, 1)) !important;
}

/* Light theme: Header search (table column search) */
[data-theme="light"] .header-search>div>input,
[data-theme="light"] .header-search>div>input,
[data-theme="light"] header-search div input,
html[data-theme="light"] .header-search>div>input {
    background-color: var(--theme-bg-input, #ffffff) !important;
    border: 1px solid var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] .header-search>div>input:focus,
html[data-theme="light"] .header-search>div>input:focus {
    border-color: var(--theme-accent-blue, #3b82f6) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}

[data-theme="light"] .header-search>div>input::placeholder,
html[data-theme="light"] .header-search>div>input::placeholder {
    color: var(--theme-text-muted-info, #475569) !important;
}

[data-theme="light"] .header-search>div>button,
[data-theme="light"] .header-search>div>button,
[data-theme="light"] header-search div button,
[data-theme="light"] .header-search button,
html[data-theme="light"] .header-search>div>button,
html[data-theme="light"] .header-search button {
    background-color: var(--theme-bg-tertiary, #f8fafc) !important;
    border: 1px solid var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
    color: var(--theme-accent-blue, #3b82f6) !important;
}

[data-theme="light"] .header-search>div>button:hover,
[data-theme="light"] .header-search button:hover,
html[data-theme="light"] .header-search>div>button:hover,
html[data-theme="light"] .header-search button:hover {
    background-color: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
    border-color: var(--theme-accent-blue, #3b82f6) !important;
}

/* Light theme: Header search button icon */
[data-theme="light"] .header-search button i,
[data-theme="light"] .header-search>div>button i,
html[data-theme="light"] .header-search button i {
    color: var(--theme-accent-blue, #3b82f6) !important;
}

/* Light theme: Forensics Details Button */
[data-theme="light"] .forensicsDetailsBtn,
html[data-theme="light"] .forensicsDetailsBtn {
    background-color: var(--theme-bg-tertiary, #f8fafc) !important;
    border-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
    color: var(--theme-text-secondary, #64748b) !important;
}

[data-theme="light"] .forensicsDetailsBtn:hover,
html[data-theme="light"] .forensicsDetailsBtn:hover {
    background-color: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
    border-color: var(--theme-accent-blue, #3b82f6) !important;
    color: var(--theme-accent-blue, #3b82f6) !important;
}

/* Light theme: Forensics Bar Buttons */
[data-theme="light"] .bar-forensics,
html[data-theme="light"] .bar-forensics {
    background-color: var(--theme-bg-secondary, #ffffff) !important;
    border-bottom-color: var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

[data-theme="light"] .bar-forensics p,
html[data-theme="light"] .bar-forensics p {
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] .bar-forensics a,
html[data-theme="light"] .bar-forensics a {
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] .bar-forensics>a.btn,
html[data-theme="light"] .bar-forensics>a.btn {
    color: var(--theme-text-secondary, #64748b) !important;
}

[data-theme="light"] .bar-forensics>a.btn:hover,
html[data-theme="light"] .bar-forensics>a.btn:hover {
    color: var(--theme-text-primary, #1e293b) !important;
}

[data-theme="light"] .bar-forensics>a.btn.active,
html[data-theme="light"] .bar-forensics>a.btn.active {
    color: var(--theme-accent-blue, #3b82f6) !important;
}

[data-theme="light"] .bar-forensics .active:not('.dropdown'),
html[data-theme="light"] .bar-forensics .active:not('.dropdown') {
    border-bottom-color: var(--theme-accent-blue, #3b82f6) !important;
}

/* Light theme: Forensics tables (generic overrides) */
[data-theme="light"] #forensics-page .table,
[data-theme="light"] #forensics-page table,
[data-theme="light"] .forensics-modern .table,
[data-theme="light"] .forensics-modern table,
html[data-theme="light"] #forensics-page .table,
html[data-theme="light"] .forensics-modern .table {
    background: var(--theme-bg-secondary, #ffffff) !important;
}

[data-theme="light"] #forensics-page .table thead,
[data-theme="light"] #forensics-page table thead,
[data-theme="light"] .forensics-modern .table thead,
html[data-theme="light"] #forensics-page .table thead,
html[data-theme="light"] .forensics-modern .table thead {
    background: var(--theme-table-header-bg, rgba(248, 250, 252, 0.95)) !important;
}

[data-theme="light"] #forensics-page .table thead th,
[data-theme="light"] #forensics-page table thead th,
[data-theme="light"] .forensics-modern .table thead th,
html[data-theme="light"] #forensics-page .table thead th,
html[data-theme="light"] .forensics-modern .table thead th {
    background: var(--theme-table-header-bg, rgba(248, 250, 252, 0.95)) !important;
    color: var(--theme-text-tertiary, #374151) !important;
    /* Darker text for visibility */
    border-bottom: 1px solid var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
}

[data-theme="light"] #forensics-page .table tbody tr,
[data-theme="light"] #forensics-page table tbody tr,
[data-theme="light"] .forensics-modern .table tbody tr,
html[data-theme="light"] #forensics-page .table tbody tr,
html[data-theme="light"] .forensics-modern .table tbody tr {
    background: var(--theme-bg-secondary, #ffffff) !important;
}

[data-theme="light"] #forensics-page .table tbody tr:hover,
[data-theme="light"] #forensics-page table tbody tr:hover,
[data-theme="light"] .forensics-modern .table tbody tr:hover,
html[data-theme="light"] #forensics-page .table tbody tr:hover,
html[data-theme="light"] .forensics-modern .table tbody tr:hover {
    background: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
}

[data-theme="light"] #forensics-page .table tbody td,
[data-theme="light"] #forensics-page table tbody td,
[data-theme="light"] .forensics-modern .table tbody td,
html[data-theme="light"] #forensics-page .table tbody td,
html[data-theme="light"] .forensics-modern .table tbody td {
    color: var(--theme-text-primary, #1e293b) !important;
    background: transparent !important;
}

/* Light theme: Forensics table header text - explicit dark color */
[data-theme="light"] #forensics-page th,
[data-theme="light"] #forensics-page .table th,
[data-theme="light"] #forensics-page table th,
[data-theme="light"] .forensics-modern th,
[data-theme="light"] .forensics-modern .table th,
[data-theme="light"] .fm-page th,
[data-theme="light"] .fm-data-table th,
html[data-theme="light"] #forensics-page th,
html[data-theme="light"] .forensics-modern th,
html[data-theme="light"] .fm-page th,
html[data-theme="light"] .fm-data-table th {
    color: var(--theme-text-dark, #1f2937) !important;
    /* Dark gray for visibility */
    background: var(--theme-table-header-bg, #f8fafc) !important;
}

/* Light theme: inv-menu */
[data-theme="light"] .inv-menu,
html[data-theme="light"] .inv-menu {
    background-color: var(--theme-bg-primary, #f1f5f9) !important;
}

/* Light theme: myborder */
[data-theme="light"] .myborder,
html[data-theme="light"] .myborder {
    border-top-color: var(--theme-border-subtle, rgba(226, 232, 240, 0.5)) !important;
    border-bottom-color: var(--theme-border-subtle, rgba(226, 232, 240, 0.5)) !important;
}

/* =============================================================================
   LIGHT THEME - Forensics Pagination Footer
   ============================================================================= */
[data-theme="light"] .fm-data-table-footer,
html[data-theme="light"] .fm-data-table-footer,
html[data-theme="light"] .fm-page .fm-data-table-footer,
html[data-theme="light"] .forensics-modern .fm-data-table-footer,
html[data-theme="light"] #append .fm-data-table-footer,
html[data-theme="light"] #append.fm-page .fm-data-table-footer {
    background: var(--theme-bg-primary, #f1f5f9) !important;
    border-top: 1px solid var(--theme-border-solid, #e2e8f0) !important;
}

[data-theme="light"] .fm-pagination-info,
html[data-theme="light"] .fm-pagination-info,
html[data-theme="light"] .fm-page .fm-pagination-info,
html[data-theme="light"] .forensics-modern .fm-pagination-info {
    color: var(--theme-text-tertiary, #374151) !important;
}

[data-theme="light"] .fm-pagination-btn,
html[data-theme="light"] .fm-pagination-btn,
html[data-theme="light"] .fm-page .fm-pagination-btn,
html[data-theme="light"] .forensics-modern .fm-pagination-btn {
    background: var(--theme-bg-secondary, #ffffff) !important;
    border: 1px solid var(--theme-border-solid, #e2e8f0) !important;
    color: var(--theme-text-tertiary, #374151) !important;
}

[data-theme="light"] .fm-pagination-btn:hover:not(:disabled),
html[data-theme="light"] .fm-pagination-btn:hover:not(:disabled),
html[data-theme="light"] .fm-page .fm-pagination-btn:hover:not(:disabled),
html[data-theme="light"] .forensics-modern .fm-pagination-btn:hover:not(:disabled) {
    background: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
    border-color: var(--theme-accent-blue, #3b82f6) !important;
    color: var(--theme-accent-blue, #3b82f6) !important;
}

[data-theme="light"] .fm-pagination-btn:disabled,
html[data-theme="light"] .fm-pagination-btn:disabled {
    background: var(--theme-bg-tertiary, #f8fafc) !important;
    color: var(--theme-text-muted-decorative, #94a3b8) !important;
}

/* =============================================================================
   UTILITY CLASSES - Theme-aware helpers
   ============================================================================= */

/* Text colors */
.theme-text-primary {
    color: var(--theme-text-primary) !important;
}

.theme-text-secondary {
    color: var(--theme-text-secondary) !important;
}

.theme-text-muted {
    color: var(--theme-text-muted) !important;
}

.theme-text-success {
    color: var(--theme-success) !important;
}

.theme-text-danger {
    color: var(--theme-danger) !important;
}

.theme-text-warning {
    color: var(--theme-warning) !important;
}

.theme-text-info {
    color: var(--theme-info) !important;
}

/* Background colors */
.theme-bg-primary {
    background-color: var(--theme-bg-primary) !important;
}

.theme-bg-secondary {
    background-color: var(--theme-bg-secondary) !important;
}

.theme-bg-card {
    background-color: var(--theme-bg-card) !important;
}

/* Border colors */
.theme-border {
    border-color: var(--theme-border-color) !important;
}

.theme-border-subtle {
    border-color: var(--theme-border-subtle) !important;
}

/* =============================================================================
   SMOOTH THEME TRANSITION
   Add transition to elements that change color with theme
   ============================================================================= */
body,
.page-container,
.navbar.sidebar,
.page-header,
.db-stat-card,
.db-panel,
.rv-stat-card,
.rv-panel,
.alerts-filters-container,
.exp-panel,
.users-panel,
table,
th,
td,
input,
select,
textarea,
.btn,
.dropdown-menu,
.modal-content {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* =============================================================================
   LIGHT THEME - Code/Path Elements
   Override for inline code and path elements in tables
   ============================================================================= */
[data-theme="light"] .code,
[data-theme="light"] p.code,
[data-theme="light"] td .code,
[data-theme="light"] .table .code,
html[data-theme="light"] .code,
html[data-theme="light"] p.code,
html[data-theme="light"] td .code,
html[data-theme="light"] .table .code {
    background: var(--theme-border-solid, #e2e8f0) !important;
    background-color: var(--theme-border-solid, #e2e8f0) !important;
    color: var(--theme-text-tertiary, #374151) !important;
    border: 1px solid var(--theme-border-strong, #e2e8f0) !important;
    border-radius: 4px !important;
}

/* =============================================================================
   LIGHT THEME - Modal Overrides (myborderBottomImp)
   ============================================================================= */
[data-theme="light"] .modal-body.myborderBottomImp,
html[data-theme="light"] .modal-body.myborderBottomImp {
    background-color: var(--theme-bg-secondary, #ffffff) !important;
    color: var(--theme-text-primary, #1f2937) !important;
    border-bottom: 2px solid var(--theme-border-strong, #e2e8f0) !important;
}

[data-theme="light"] .modal-body.myborderBottomImp .form-control,
html[data-theme="light"] .modal-body.myborderBottomImp .form-control {
    color: var(--theme-text-primary, #1f2937) !important;
}

/* =============================================================================
   LIGHT THEME - Global Dropdown Link Fix
   Override white text on hover for all dropdown links
   ============================================================================= */
[data-theme="light"] .dropdown-menu li a:hover,
[data-theme="light"] .dropdown-menu li.bg-1 a:hover,
[data-theme="light"] .dropdown-menu.bg-1 li a:hover,
html[data-theme="light"] .dropdown-menu li a:hover,
html[data-theme="light"] .dropdown-menu li.bg-1 a:hover,
html[data-theme="light"] .dropdown-menu.bg-1 li a:hover {
    color: var(--theme-text-primary, #1e293b) !important;
    background-color: var(--theme-accent-blue-bg, rgba(59, 130, 246, 0.1)) !important;
}

[data-theme="light"] .dropdown-menu li a:hover i,
[data-theme="light"] .dropdown-menu li.bg-1 a:hover i,
[data-theme="light"] .dropdown-menu.bg-1 li a:hover i,
html[data-theme="light"] .dropdown-menu li a:hover i,
html[data-theme="light"] .dropdown-menu li.bg-1 a:hover i,
html[data-theme="light"] .dropdown-menu.bg-1 li a:hover i {
    color: var(--theme-accent-blue, #3b82f6) !important;
}

/* Maintain active state style on hover */
[data-theme="light"] .dropdown-menu li.active a:hover,
[data-theme="light"] .dropdown-menu li.bg-1.active a:hover,
[data-theme="light"] .dropdown-menu.bg-1 li.active a:hover,
html[data-theme="light"] .dropdown-menu li.active a:hover,
html[data-theme="light"] .dropdown-menu li.bg-1.active a:hover,
html[data-theme="light"] .dropdown-menu.bg-1 li.active a:hover {
    background-color: var(--theme-accent-blue, #3b82f6) !important;
    color: #ffffff !important;
}

[data-theme="light"] .dropdown-menu li.active a:hover i,
[data-theme="light"] .dropdown-menu li.bg-1.active a:hover i,
[data-theme="light"] .dropdown-menu.bg-1 li.active a:hover i,
html[data-theme="light"] .dropdown-menu li.active a:hover i,
html[data-theme="light"] .dropdown-menu li.bg-1.active a:hover i,
html[data-theme="light"] .dropdown-menu.bg-1 li.active a:hover i {
    color: #ffffff !important;
}

/* =============================================================================
   GLOBAL COMPANY CONTEXT MESSAGE CARD
   Consolidated styles for LaunchPad, Rovers, Policies
   ============================================================================= */

.lp-company-message,
.policy-company-message,
.company-context-card {
    background: rgba(26, 32, 40, 0.82);
    border: 1px solid rgba(48, 54, 61, 0.6);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.lp-message-content,
.policy-message-content,
.company-context-card-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.lp-message-icon,
.policy-message-icon,
.company-context-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
    flex: 0 0 32px;
}

.lp-message-icon i,
.policy-message-icon i,
.company-context-card-icon i {
    font-size: 16px;
}

.lp-message-text,
.policy-message-text,
.company-context-card-text {
    flex: 1;
}

.lp-message-title,
.policy-message-title,
.company-context-card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #e6edf3;
}

.lp-message-body,
.policy-message-body,
.company-context-card-body {
    margin: 4px 0 0;
    font-size: 13px;
    color: #8b949e;
    line-height: 1.5;
}

.lp-message-body strong,
.policy-message-body strong,
.company-context-card-body strong {
    color: #e6edf3;
}

/* VARIANTS */

/* Warning (Amber/Yellow) */
.lp-company-message--warning,
.policy-company-message--warning,
.company-context-card--warning {
    background: rgba(210, 153, 34, 0.08);
    border-color: rgba(210, 153, 34, 0.5);
}

.lp-company-message--warning .lp-message-icon,
.policy-company-message--warning .policy-message-icon,
.company-context-card--warning .company-context-card-icon {
    background: rgba(210, 153, 34, 0.15);
    color: #d29922;
}

.lp-company-message--warning .lp-message-icon i,
.policy-company-message--warning .policy-message-icon i,
.company-context-card--warning .company-context-card-icon i {
    color: #d29922;
}

/* Info (Blue) */
.lp-company-message--info,
.policy-company-message--info,
.company-context-card--info {
    background: rgba(88, 166, 255, 0.08);
    border-color: rgba(88, 166, 255, 0.4);
}

.lp-company-message--info .lp-message-icon,
.policy-company-message--info .policy-message-icon,
.company-context-card--info .company-context-card-icon {
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
}

/* LIGHT THEME OVERRIDES */
[data-theme="light"] .lp-company-message,
[data-theme="light"] .policy-company-message,
[data-theme="light"] .company-context-card,
html[data-theme="light"] .lp-company-message,
html[data-theme="light"] .policy-company-message,
html[data-theme="light"] .company-context-card {
    background: var(--theme-bg-secondary);
    border: 1px solid var(--theme-border-solid);
}

[data-theme="light"] .lp-company-message--warning,
[data-theme="light"] .policy-company-message--warning,
[data-theme="light"] .company-context-card--warning,
html[data-theme="light"] .lp-company-message--warning,
html[data-theme="light"] .policy-company-message--warning,
html[data-theme="light"] .company-context-card--warning {
    background: var(--theme-warning-bg, rgba(210, 153, 34, 0.12));
    border-color: var(--theme-warning-border, rgba(210, 153, 34, 0.35));
}

[data-theme="light"] .lp-company-message--info,
[data-theme="light"] .policy-company-message--info,
[data-theme="light"] .company-context-card--info,
html[data-theme="light"] .lp-company-message--info,
html[data-theme="light"] .policy-company-message--info,
html[data-theme="light"] .company-context-card--info {
    background: var(--theme-info-bg, rgba(56, 139, 253, 0.1));
    border-color: var(--theme-info-border, rgba(56, 139, 253, 0.35));
}

[data-theme="light"] .lp-message-title,
[data-theme="light"] .policy-message-title,
[data-theme="light"] .company-context-card-title,
html[data-theme="light"] .lp-message-title,
html[data-theme="light"] .policy-message-title,
html[data-theme="light"] .company-context-card-title {
    color: var(--theme-text-dark);
}

[data-theme="light"] .lp-message-body,
[data-theme="light"] .policy-message-body,
[data-theme="light"] .company-context-card-body,
html[data-theme="light"] .lp-message-body,
html[data-theme="light"] .policy-message-body,
html[data-theme="light"] .company-context-card-body {
    color: var(--theme-text-tertiary);
}

/* Context Highlight - Theme Aware Text Highlighting */
.context-highlight {
    color: #58a6ff;
}

.context-company-highlight {
    color: #58a6ff;
}

[data-theme="light"] .context-highlight,
html[data-theme="light"] .context-highlight {
    color: #0969da;
}

[data-theme="light"] .context-company-highlight,
html[data-theme="light"] .context-company-highlight {
    color: #0969da;
}

/* =============================================================================
   REPORT PREVIEW PAGES
   Ensure download buttons and preview content stay readable on white backgrounds.
   ============================================================================= */
.report-preview #raport,
.report-preview page {
    color: #1f2937;
}

.report-preview #raport a,
.report-preview page a {
    color: #1d4ed8;
}

.report-preview .page-bar .btn,
.report-preview .view-page-bar .btn,
.report-preview .page-bar .btn-pag,
.report-preview .view-page-bar .btn-pag {
    background: var(--theme-bg-secondary, #ffffff) !important;
    border: 1px solid var(--theme-border-color, rgba(226, 232, 240, 0.8)) !important;
    color: var(--theme-text-primary, #1e293b) !important;
}

.report-preview .page-bar .btn:hover,
.report-preview .view-page-bar .btn:hover,
.report-preview .page-bar .btn-pag:hover,
.report-preview .view-page-bar .btn-pag:hover {
    background: var(--theme-table-row-hover, rgba(59, 130, 246, 0.06)) !important;
    border-color: var(--theme-border-accent, rgba(59, 130, 246, 0.4)) !important;
    color: var(--theme-accent-blue, #3b82f6) !important;
}

.report-preview .page-bar .btn:disabled,
.report-preview .view-page-bar .btn:disabled,
.report-preview .page-bar .btn-pag:disabled,
.report-preview .view-page-bar .btn-pag:disabled {
    background: var(--theme-bg-tertiary, #f8fafc) !important;
    border-color: var(--theme-border-subtle, rgba(226, 232, 240, 0.5)) !important;
    color: var(--theme-text-muted, #64748b) !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

.report-preview .table thead,
.report-preview table thead {
    background: #ffffff !important;
}

.report-preview .table thead th,
.report-preview table thead th,
.report-preview thead th {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-bottom-color: #e2e8f0 !important;
}

.report-preview page table thead,
.report-preview page table thead th,
.report-preview page thead th,
.report-preview #raport table thead,
.report-preview #raport table thead th {
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

.report-preview .sticky-table-header,
.report-preview .fixed-table-header {
    background-color: #ffffff !important;
}

.report-preview .sticky-table-header table thead,
.report-preview .fixed-table-header table thead,
.report-preview .sticky-table-header table thead th,
.report-preview .fixed-table-header table thead th,
.report-preview .sticky-table-header th,
.report-preview .fixed-table-header th {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-bottom-color: #e2e8f0 !important;
}

.report-preview .table-striped>tbody>tr,
.report-preview .table>tbody>tr {
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

.report-preview .table>tbody>tr>td,
.report-preview table>tbody>tr>td {
    color: #1f2937 !important;
    border-bottom-color: #e2e8f0 !important;
}

.report-preview .table-hover>tbody>tr:hover {
    background-color: #f8fafc !important;
}

/* Hunt report pages use #malware-table - ID selectors need higher specificity overrides */
.report-preview #malware-table,
.report-preview #malware-table2 {
    background: transparent !important;
}

.report-preview #malware-table thead,
.report-preview #malware-table2 thead {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
}

.report-preview #malware-table thead tr,
.report-preview #malware-table2 thead tr {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
}

.report-preview #malware-table thead th,
.report-preview #malware-table2 thead th {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    color: #374151 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.report-preview #malware-table tbody tr,
.report-preview #malware-table2 tbody tr {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

.report-preview #malware-table tbody td,
.report-preview #malware-table2 tbody td {
    background: transparent !important;
    color: #1f2937 !important;
    border-bottom-color: #e2e8f0 !important;
}

/* =============================================================================
   Session expired popup (chooseLogout)
   ============================================================================= */
#chooseLogout .modal-dialog {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
}

#chooseLogout .modal-content {
    background: var(--theme-bg-card-solid) !important;
    border: 1px solid var(--theme-border-color) !important;
    border-radius: 16px;
    box-shadow: var(--theme-shadow-lg);
    overflow: hidden;
}

#chooseLogout .modal-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: var(--theme-bg-tertiary);
    border-bottom: 1px solid var(--theme-border-subtle);
    position: relative;
}

#chooseLogout .modal-title {
    margin: 0;
    flex: 1 1 auto;
    color: var(--theme-text-primary);
    font-weight: 600;
    letter-spacing: 0.2px;
}

#chooseLogout .close {
    position: absolute;
    right: 16px;
    top: 10px;
    background: transparent;
    border: 0;
    color: var(--theme-text-muted);
    opacity: 0.85;
    text-shadow: none;
    font-size: 22px;
}

#chooseLogout .close:hover,
#chooseLogout .close:focus {
    color: var(--theme-text-primary);
    opacity: 1;
}

#chooseLogout .modal-body {
    padding: 16px 18px 18px;
    background: var(--theme-bg-secondary) !important;
    color: var(--theme-text-secondary) !important;
}

#chooseLogout #logotmsg {
    color: var(--theme-text-primary);
    font-weight: 500;
}

#chooseLogout .modal-body .fa-spinner {
    color: var(--theme-accent-blue);
}

/* =============================================================================
   Session renew popup (timeExpire)
   ============================================================================= */
#timeExpire .modal-dialog {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
}

#timeExpire .modal-content {
    background: var(--theme-bg-card-solid) !important;
    border: 1px solid var(--theme-border-color) !important;
    border-radius: 16px;
    box-shadow: var(--theme-shadow-lg);
    overflow: hidden;
}

#timeExpire .modal-header {
    padding: 14px 18px;
    background: var(--theme-bg-tertiary);
    border-bottom: 1px solid var(--theme-border-subtle);
}

#timeExpire .modal-title {
    margin: 0;
    color: var(--theme-text-primary);
    font-weight: 600;
    letter-spacing: 0.2px;
}

#timeExpire .modal-body {
    padding: 16px 18px 18px;
    background: var(--theme-bg-secondary) !important;
    color: var(--theme-text-secondary) !important;
}

#timeExpire .modal-body .modal-title {
    color: var(--theme-text-primary);
    font-weight: 500;
}

#timeExpire #timeExpireRenew {
    background: var(--theme-gradient-primary);
    border: 1px solid var(--theme-border-accent);
    color: #ffffff !important;
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 600;
    box-shadow: var(--theme-shadow-sm);
}

#timeExpire #timeExpireRenew:hover {
    filter: brightness(1.03);
    box-shadow: var(--theme-shadow-md);
}

#timeExpire #timeExpireSignOut {
    background: var(--theme-bg-subtle);
    border: 1px solid var(--theme-border-subtle);
    color: var(--theme-text-primary);
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 600;
}

#timeExpire #timeExpireSignOut:hover {
    background: var(--theme-bg-subtle-hover);
    border-color: var(--theme-border-color);
}

/* =============================================================================
   Page loading screen
   ============================================================================= */
#page-loading-spinner.page-loading-overlay {
    background: var(--theme-bg-primary);
    color: var(--theme-text-primary);
    font-family: "Segoe UI", Arial, sans-serif;
    gap: 14px;
}

#page-loading-spinner .page-loading-logo {
    width: 280px;
    height: auto;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.25));
}

#page-loading-spinner .page-loading-track {
    width: 320px;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--theme-bg-tertiary);
    border: 1px solid var(--theme-border-subtle);
    box-shadow: var(--theme-shadow-sm);
}

#page-loading-spinner .page-loading-bar {
    height: 100%;
    width: 0;
    background: var(--theme-gradient-primary);
    transition: width 0.4s ease;
}

#page-loading-spinner .page-loading-text {
    margin-top: 6px;
    font-size: 14px;
    color: var(--theme-text-secondary);
    letter-spacing: 0.2px;
}

/* User truncation styles - migrated from rovers-modern.css */
.truncate-user {
    display: inline-block;
    max-width: 100%;
    vertical-align: text-bottom;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =============================================================================
   ENDPOINT SCANS - Component Styles (Theme-aware)
   Uses CSS custom properties so both dark & light themes work automatically
   ============================================================================= */

/* Scans Table Scroll Container */
#alerts-scans-page .scans-table-scroll {
    overflow-x: auto;
}

#alerts-scans-page .scans-table-scroll::-webkit-scrollbar {
    height: 6px;
}

#alerts-scans-page .scans-table-scroll::-webkit-scrollbar-track {
    background: var(--theme-scrollbar-track);
    border-radius: 3px;
}

#alerts-scans-page .scans-table-scroll::-webkit-scrollbar-thumb {
    background: var(--theme-scrollbar-thumb);
    border-radius: 3px;
}

#alerts-scans-page .scans-table-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--theme-scrollbar-thumb-hover);
}

/* Scan Type Badges */
#alerts-scans-page .scan-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    white-space: nowrap;
}

#alerts-scans-page .scan-type-badge.triggered-initial {
    background: var(--theme-accent-blue-bg);
    color: var(--theme-accent-blue);
    border-color: var(--theme-border-accent);
}

#alerts-scans-page .scan-type-badge.triggered-user {
    background: var(--theme-accent-purple-bg);
    color: var(--theme-accent-purple);
    border-color: var(--theme-accent-purple-glow);
}

#alerts-scans-page .scan-type-badge.triggered-unknown {
    background: var(--theme-bg-subtle-strong);
    color: var(--theme-text-muted);
    border-color: var(--theme-border-muted);
}

/* Threats Count Badge */
#alerts-scans-page .threats-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}

#alerts-scans-page .threats-count-badge.threats-found {
    background: var(--theme-danger-bg);
    color: var(--theme-danger);
    border-color: var(--theme-danger-glow);
}

#alerts-scans-page .threats-count-badge.threats-clean {
    background: var(--theme-success-bg);
    color: var(--theme-success);
    border-color: var(--theme-success-glow);
}

/* Files Scanned Badge */
#alerts-scans-page .files-scanned-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--theme-text-secondary);
    background: var(--theme-bg-subtle);
    padding: 4px 10px;
    border-radius: 6px;
}

#alerts-scans-page .files-scanned-badge i {
    color: var(--theme-text-muted);
}

/* Row Number */
#alerts-scans-page .row-number {
    color: var(--theme-text-muted);
    font-size: 12px;
    font-weight: 500;
}

/* Cell Styles */
#alerts-scans-page .cell-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

#alerts-scans-page .cell-icon {
    color: var(--theme-text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

#alerts-scans-page .cell-text-primary {
    color: var(--theme-text-primary);
    font-weight: 500;
}

#alerts-scans-page .cell-text-secondary {
    color: var(--theme-text-secondary);
}

#alerts-scans-page .copy-icon {
    color: var(--theme-text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: color 0.15s;
}

#alerts-scans-page .copy-icon:hover {
    color: var(--theme-accent-blue);
}

/* Expand Icon */
#alerts-scans-page .expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--theme-accent-blue-bg);
    color: var(--theme-accent-blue);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

#alerts-scans-page .expand-icon:hover {
    background: var(--theme-accent-blue-glow);
    color: var(--theme-accent-blue);
}

/* Scan Row Expanded */
#alerts-scans-page .scan-row-expanded {
    background: var(--theme-accent-blue-bg-subtle) !important;
}

/* Scan Expanded Row */
#alerts-scans-page .scan-expanded-row td {
    background: var(--theme-accent-blue-bg-subtle) !important;
    padding: 0 16px 16px 16px !important;
}

/* Scan Threats Container */
#alerts-scans-page .scan-threats-container {
    border-left: 3px solid var(--theme-accent-blue);
    padding: 16px 20px;
    margin: 8px 0;
    background: var(--theme-bg-subtle);
    border-radius: 0 8px 8px 0;
}

/* Scan Threats Header */
#alerts-scans-page .scan-threats-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--theme-text-primary);
    margin-bottom: 12px;
}

#alerts-scans-page .scan-threats-header i {
    color: var(--theme-accent-blue);
    font-size: 16px;
}

#alerts-scans-page .threats-count-label {
    color: var(--theme-text-muted);
    font-size: 12px;
    font-weight: 400;
    margin-left: 4px;
}

/* Scan Threats Loading / Empty */
#alerts-scans-page .scan-threats-loading,
#alerts-scans-page .scan-threats-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    color: var(--theme-text-muted);
    font-size: 13px;
}

#alerts-scans-page .scan-threats-empty i {
    color: var(--theme-success);
}

/* Scan Threats Table */
#alerts-scans-page .scan-threats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--theme-bg-card);
    border: 1px solid var(--theme-border-color);
    border-radius: 8px;
    overflow: hidden;
}

#alerts-scans-page .scan-threats-table thead th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--theme-text-muted);
    background: var(--theme-bg-tertiary);
    padding: 10px 14px;
    border-bottom: 1px solid var(--theme-border-color);
}

#alerts-scans-page .scan-threats-table tbody td {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--theme-text-secondary);
    border-bottom: 1px solid var(--theme-border-subtle);
    vertical-align: middle;
}

#alerts-scans-page .scan-threats-table tbody tr:last-child td {
    border-bottom: none;
}

#alerts-scans-page .scan-threats-table tbody tr:hover {
    background: var(--theme-accent-blue-bg-subtle);
}

/* Classification Badge */
#alerts-scans-page .classification-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: var(--theme-accent-purple-bg);
    color: var(--theme-accent-purple);
}

/* Engine Badge */
#alerts-scans-page .engine-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: var(--theme-bg-subtle-strong);
    color: var(--theme-text-muted);
}

/* Score Badge */
#alerts-scans-page .score-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

#alerts-scans-page .score-badge.score-low {
    background: var(--theme-success-bg);
    color: var(--theme-success);
}

#alerts-scans-page .score-badge.score-medium {
    background: var(--theme-warning-bg);
    color: var(--theme-warning);
}

#alerts-scans-page .score-badge.score-high {
    background: var(--theme-warning-bg);
    color: var(--theme-warning-dark);
}

#alerts-scans-page .score-badge.score-critical {
    background: var(--theme-danger-bg);
    color: var(--theme-danger);
}

/* Status Badge */
#alerts-scans-page .status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

#alerts-scans-page .status-badge.status-unresolved {
    background: var(--theme-danger-bg);
    color: var(--theme-danger);
}

#alerts-scans-page .status-badge.status-resolved {
    background: var(--theme-success-bg);
    color: var(--theme-success);
}

#alerts-scans-page .status-badge.status-in-progress {
    background: var(--theme-warning-bg);
    color: var(--theme-warning);
}

/* Action Button */
#alerts-scans-page .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: var(--theme-accent-blue-bg);
    border: 1px solid var(--theme-border-accent);
    color: var(--theme-accent-blue);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

#alerts-scans-page .action-btn:hover {
    background: var(--theme-accent-blue-glow);
    border-color: var(--theme-border-accent);
    color: var(--theme-accent-blue);
    text-decoration: none;
}

/* Scan Threats Footer & Load More */
#alerts-scans-page .scan-threats-footer {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
}

#alerts-scans-page .btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: var(--theme-accent-blue-bg);
    border: 1px solid var(--theme-border-accent);
    color: var(--theme-accent-blue);
    cursor: pointer;
    transition: all 0.15s ease;
}

#alerts-scans-page .btn-load-more:hover {
    background: var(--theme-accent-blue-glow);
    border-color: var(--theme-border-accent);
}

#alerts-scans-page .btn-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pagination Buttons */
#alerts-scans-page .pagination .btn-pag {
    background: var(--theme-accent-blue-bg) !important;
    border: 1px solid var(--theme-border-accent) !important;
    color: var(--theme-accent-blue) !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

#alerts-scans-page .pagination .btn-pag:hover:not(:disabled) {
    background: var(--theme-accent-blue-glow) !important;
    border-color: var(--theme-accent-blue) !important;
}

#alerts-scans-page .pagination .btn-pag:disabled {
    background: var(--theme-bg-subtle) !important;
    border-color: var(--theme-border-subtle) !important;
    color: var(--theme-text-muted) !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

/* Active Filters Bar */
#alerts-scans-page .scans-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: var(--theme-accent-blue-bg-subtle);
    border: 1px solid var(--theme-border-accent);
    border-radius: 8px;
    margin-bottom: 16px;
}

#alerts-scans-page .scans-filters-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--theme-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#alerts-scans-page .scans-filters-header .fa-filter {
    color: var(--theme-accent-blue);
}

#alerts-scans-page .scans-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

#alerts-scans-page .scans-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--theme-accent-blue-bg);
    border: 1px solid var(--theme-border-accent);
    border-radius: 6px;
    font-size: 12px;
    color: var(--theme-text-primary);
}

#alerts-scans-page .scans-filter-tag strong {
    color: var(--theme-accent-blue);
}

#alerts-scans-page .scans-filter-remove {
    background: none;
    border: none;
    color: var(--theme-text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    margin-left: 4px;
    line-height: 1;
    transition: color 0.15s;
}

#alerts-scans-page .scans-filter-remove:hover {
    color: var(--theme-danger);
}

#alerts-scans-page .scans-filter-clear {
    list-style: none;
}

#alerts-scans-page .scans-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: transparent;
    border: 1px solid var(--theme-border-color);
    border-radius: 6px;
    font-size: 12px;
    color: var(--theme-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

#alerts-scans-page .scans-clear-btn:hover {
    background: var(--theme-danger-bg);
    border-color: var(--theme-danger-glow);
    color: var(--theme-danger);
}

/* Empty State */
#alerts-scans-page .empty-state {
    padding: 40px 16px !important;
    color: var(--theme-text-muted);
    font-size: 14px;
}

#alerts-scans-page .empty-state i {
    display: block;
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--theme-text-disabled);
}

/* ElementToHover Filter Icons */
#alerts-scans-page .elementToHover {
    position: relative;
}

#alerts-scans-page .elementToHover:hover {
    border-color: var(--theme-border-accent);
}

#alerts-scans-page .elementHover {
    position: absolute;
    top: -2px;
    right: -6px;
    display: none;
    gap: 4px;
    background: var(--theme-bg-dropdown);
    border: 1px solid var(--theme-border-accent);
    border-radius: 6px;
    padding: 4px 6px;
    box-shadow: var(--theme-shadow-md);
    z-index: 10;
}

#alerts-scans-page .elementToHover:hover .elementHover {
    display: flex;
}

#alerts-scans-page .elementHover i {
    font-size: 12px;
    color: var(--theme-text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s;
}

#alerts-scans-page .elementHover i.fa-plus:hover {
    color: var(--theme-success);
    background: var(--theme-success-bg);
}

#alerts-scans-page .elementHover i.fa-minus:hover {
    color: var(--theme-danger);
    background: var(--theme-danger-bg);
}

/* Search Input */
#alerts-scans-page .search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#alerts-scans-page .search-input-wrapper .search-icon {
    position: absolute;
    left: 12px;
    color: var(--theme-text-muted);
    font-size: 14px;
    z-index: 1;
}

#alerts-scans-page .search-input-wrapper .search-input {
    padding-left: 36px;
    background: var(--theme-bg-input);
    border: 1px solid var(--theme-border-input);
    border-radius: 8px;
    color: var(--theme-text-primary);
    font-size: 13px;
    min-width: 240px;
    transition: all 0.15s ease;
}

#alerts-scans-page .search-input-wrapper .search-input:focus {
    border-color: var(--theme-accent-blue);
    box-shadow: var(--theme-shadow-focus);
    outline: none;
}

#alerts-scans-page .search-input-wrapper .search-input::placeholder {
    color: var(--theme-input-placeholder);
}

/* Loading Overlay */
#alerts-scans-page .db-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--theme-bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 12px;
}

/* =============================================================================
   BOOTBOX GLOBAL MODERNIZATION
   ============================================================================= */
.bootbox.modal {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding-right: 0 !important;
}

.bootbox.modal .modal-dialog {
    margin: 0;
    width: 100%;
    max-width: 540px;
    transform: none !important;
    /* Center properly without Bootstrap's top sliding offset */
}

.bootbox.modal .modal-content {
    background: var(--theme-bg-card-solid, var(--theme-modal-bg, #1c2128));
    border: 1px solid var(--theme-border-strong, var(--theme-modal-border, #30363d));
    border-radius: 12px;
    box-shadow: var(--theme-shadow-xl, 0 16px 48px rgba(0, 0, 0, 0.5));
    overflow: hidden;
    color: var(--theme-text-primary, #e6edf3);
}

.bootbox.modal .modal-header {
    background: var(--theme-bg-secondary, var(--theme-modal-header-bg, #252c35));
    border-bottom: 1px solid var(--theme-border-subtle, var(--theme-modal-border, #30363d));
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.bootbox.modal .modal-header .modal-title {
    grid-column: 2;
    font-size: 18px;
    font-weight: 600;
    color: var(--theme-text-primary, #e6edf3);
    margin: 0;
    text-align: center;
}

.bootbox.modal .modal-header .bootbox-close-button,
.bootbox.modal .modal-header .close {
    grid-column: 3;
    justify-self: end;
    border: none !important;
    background: transparent !important;
    color: #ffffff !important;
    font-size: 24px !important;
    line-height: 1;
    opacity: 1 !important;
    text-shadow: none !important;
    font-weight: normal;
    transition: all 0.2s;
    margin-top: -2px;
    cursor: pointer;
    outline: none !important;
    display: inline-block !important;
}

.bootbox.modal .modal-header .bootbox-close-button>*,
.bootbox.modal .modal-header .close>* {
    display: none !important;
}

.bootbox.modal .modal-header .bootbox-close-button::before,
.bootbox.modal .modal-header .close::before {
    content: "✕" !important;
    font-family: sans-serif;
    display: block;
    margin-bottom: -16px;
}

.bootbox.modal .modal-header .bootbox-close-button:hover,
.bootbox.modal .modal-header .close:hover {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Light Theme override for close button */
[data-theme="light"] .bootbox.modal .modal-header .bootbox-close-button,
[data-theme="light"] .bootbox.modal .modal-header .close {
    color: #11161d !important;
}

[data-theme="light"] .bootbox.modal .modal-header .bootbox-close-button:hover,
[data-theme="light"] .bootbox.modal .modal-header .close:hover {
    color: #000000 !important;
}

.bootbox.modal .modal-body {
    padding: 24px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--theme-text-secondary, #8b949e);
}

.bootbox.modal .modal-body strong {
    color: var(--theme-text-primary, #e6edf3);
    font-weight: 600;
}

.bootbox.modal .modal-footer {
    background: transparent;
    border-top: 1px solid var(--theme-border-subtle, rgba(48, 54, 61, 0.35));
    padding: 16px 24px;
    display: flex;
    flex-direction: row-reverse;
    /* Reverses the DOM order so Confirm is left of Cancel */
    justify-content: flex-start;
    /* flex-start with row-reverse pushes them to the right edge */
    gap: 12px;
}

.bootbox.modal .modal-footer .btn {
    margin: 0;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bootbox.modal .modal-footer .btn-default {
    background: var(--theme-bg-input, rgba(30, 36, 44, 0.8));
    border: 1px solid var(--theme-border-color, rgba(48, 54, 61, 0.6));
    color: var(--theme-text-primary, #e6edf3);
    box-shadow: var(--theme-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.2));
}

.bootbox.modal .modal-footer .btn-default:hover {
    background: var(--theme-bg-subtle-strong, rgba(255, 255, 255, 0.08));
    border-color: var(--theme-text-muted, #8b949e);
}

.bootbox.modal .modal-footer .btn-success {
    background: var(--theme-accent-blue, #367fd3);
    border: 1px solid var(--theme-accent-blue-dark, #2563ac);
    color: #fff;
    box-shadow: 0 0 10px var(--theme-accent-blue-glow, rgba(54, 127, 211, 0.35));
}

.bootbox.modal .modal-footer .btn-success:hover {
    background: var(--theme-accent-blue-light, #58a6ff);
    border-color: var(--theme-accent-blue-light, #58a6ff);
}