/**
 * ResiPlan - Futuristic Dark Theme
 * Design futuriste avec effets avancés pour l'ensemble du site
 */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --dark-bg: #0a0e27;
    --bg-secondary: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --glow-primary: rgba(102, 126, 234, 0.5);
    --glow-secondary: rgba(118, 75, 162, 0.5);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-color: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
}

/* === BODY & BACKGROUND === */
body {
    background: var(--dark-bg) !important;
    color: var(--text-primary) !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Centrage pour pages de login/auth */
body:has(.login-container) {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Wrapper pour centrer le login-container */
body:has(.login-container) .login-container {
    margin: auto;
}

/* Footer en bas pour pages de login */
body:has(.login-container) footer {
    margin-top: auto;
}

/* Override any inline or conflicting background */
body, html {
    background: var(--dark-bg) !important;
    background-color: var(--dark-bg) !important;
    background-image: none !important;
}

/* Force text colors for all common elements */
body, body * {
    color: var(--text-primary);
}

/* Force specific elements that often have dark text */
p, span, div, label, a, li, td, th, small, i, em, strong, b {
    color: var(--text-primary) !important;
}

/* Force headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-primary) !important;
}

/* Links with proper contrast */
a {
    color: #667eea !important;
    text-decoration: none;
}

a:hover {
    color: #8b9aee !important;
}

/* Text that should be visible */
.metric-value, .stat-value, .stat-item-value,
.metric-label, .stat-label, .stat-item-label,
.quick-action-title, .quick-action-desc,
.chart-title, .section-title {
    color: var(--text-primary) !important;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    pointer-events: none;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Gradient Orbs */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite;
    pointer-events: none;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--primary-gradient);
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary-gradient);
    top: 50%;
    right: -200px;
    animation-delay: 7s;
}

.orb-3 {
    width: 600px;
    height: 600px;
    background: var(--success-gradient);
    bottom: -300px;
    left: 30%;
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -50px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* === NAVIGATION DARK OVERRIDE === */
.navbar-modern {
    background: rgba(10, 14, 39, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 30px rgba(102, 126, 234, 0.1);
}

/* Logo ResiPlan futuriste 3D */
.navbar-modern .brand-icon {
    background: transparent !important;
    position: relative;
    overflow: visible !important;
    width: 52px;
    height: 52px;
}

.navbar-modern .brand-icon i {
    display: none; /* Cacher l'icône Bootstrap */
}

/* Couche 1 : Hexagone externe en rotation */
.brand-icon::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    clip-path: polygon(
        50% 0%,
        100% 25%,
        100% 75%,
        50% 100%,
        0% 75%,
        0% 25%
    );
    animation: rotate-logo-slow 10s linear infinite, pulse-logo 3s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.7),
                0 0 60px rgba(118, 75, 162, 0.5),
                inset 0 0 20px rgba(255, 255, 255, 0.3);
    opacity: 0.8;
}

/* Couche 2 : Hexagone interne contre-rotation */
.brand-icon::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 36px;
    height: 36px;
    background: linear-gradient(225deg, #4facfe 0%, #00f2fe 100%);
    clip-path: polygon(
        50% 0%,
        100% 25%,
        100% 75%,
        50% 100%,
        0% 75%,
        0% 25%
    );
    animation: rotate-logo-reverse 8s linear infinite;
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.8),
                inset 0 0 15px rgba(255, 255, 255, 0.4);
}

/* Lettre R centrale */
.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-icon::before {
    z-index: 1;
}

.brand-icon::after {
    z-index: 2;
}

/* Lettre R centrale injectée via JS */
.logo-letter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.6rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 15px rgba(102, 126, 234, 1),
                 0 0 30px rgba(118, 75, 162, 0.8),
                 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
    font-family: 'Arial Black', 'Impact', sans-serif;
    letter-spacing: -2px;
    animation: text-glow 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes text-glow {
    0%, 100% {
        text-shadow: 0 0 15px rgba(102, 126, 234, 1),
                     0 0 30px rgba(118, 75, 162, 0.8),
                     0 2px 5px rgba(0, 0, 0, 0.5);
    }
    50% {
        text-shadow: 0 0 25px rgba(102, 126, 234, 1),
                     0 0 50px rgba(118, 75, 162, 1),
                     0 0 70px rgba(240, 147, 251, 0.6),
                     0 2px 5px rgba(0, 0, 0, 0.5);
    }
}

.brand:hover .logo-letter {
    animation: text-glow-hover 1s ease-in-out infinite, letter-float 2s ease-in-out infinite;
}

@keyframes letter-float {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes text-glow-hover {
    0%, 100% {
        text-shadow: 0 0 20px rgba(79, 172, 254, 1),
                     0 0 40px rgba(0, 242, 254, 0.9),
                     0 0 60px rgba(240, 147, 251, 0.7),
                     0 2px 5px rgba(0, 0, 0, 0.5);
    }
    50% {
        text-shadow: 0 0 30px rgba(79, 172, 254, 1),
                     0 0 60px rgba(0, 242, 254, 1),
                     0 0 90px rgba(240, 147, 251, 0.9),
                     0 2px 5px rgba(0, 0, 0, 0.5);
    }
}

/* Ajouter la lettre R via un élément dédié */
.navbar-modern .brand {
    position: relative;
}

.navbar-modern .brand-icon {
    position: relative;
}

.brand-icon:hover::before {
    animation: rotate-logo-fast 4s linear infinite, pulse-logo-hover 1.5s ease-in-out infinite;
}

.brand-icon:hover::after {
    animation: rotate-logo-reverse-fast 3s linear infinite;
}

/* Animations */
@keyframes rotate-logo-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotate-logo-reverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes rotate-logo-fast {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotate-logo-reverse-fast {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes pulse-logo {
    0%, 100% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.7),
                    0 0 60px rgba(118, 75, 162, 0.5),
                    inset 0 0 20px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 45px rgba(102, 126, 234, 0.9),
                    0 0 90px rgba(118, 75, 162, 0.7),
                    inset 0 0 30px rgba(255, 255, 255, 0.5);
    }
}

@keyframes pulse-logo-hover {
    0%, 100% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.9),
                    0 0 80px rgba(118, 75, 162, 0.7),
                    inset 0 0 25px rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 60px rgba(102, 126, 234, 1),
                    0 0 120px rgba(118, 75, 162, 0.9),
                    inset 0 0 40px rgba(255, 255, 255, 0.6);
    }
}

.mega-menu-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.nav-link:hover {
    color: white !important;
}

.user-trigger {
    background: rgba(102, 126, 234, 0.2) !important;
}

.user-trigger:hover {
    background: rgba(102, 126, 234, 0.3) !important;
}

/* === MEGA MENUS - TEXT CONTRAST FIX === */
.mega-menu {
    background: rgba(10, 14, 39, 0.98) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    max-height: 80vh !important;
    overflow-y: auto !important;
}

.mega-menu-body {
    background: transparent !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
}

.mega-menu-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05) !important;
}

.mega-menu-item {
    background: rgba(255, 255, 255, 0.02) !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mega-menu-item:hover {
    background: rgba(102, 126, 234, 0.15) !important;
    border-left: 3px solid #667eea;
}

.mega-menu-title {
    color: #ffffff !important;
    font-weight: 600;
}

.mega-menu-desc {
    color: rgba(255, 255, 255, 0.7) !important;
}

.mega-menu-subcategory-header {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%) !important;
    border-left: 3px solid #00d4ff !important;
    border-radius: 8px;
    color: #00d4ff !important;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3) !important;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8) !important;
}

.mega-menu-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    box-shadow:
        0 0 10px rgba(102, 126, 234, 0.5),
        inset 0 0 10px rgba(118, 75, 162, 0.3);
    transition: all 0.3s ease;
}

.mega-menu-item:hover .mega-menu-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow:
        0 0 25px rgba(79, 172, 254, 0.8),
        0 0 40px rgba(0, 242, 254, 0.5),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Couleurs spécifiques par catégorie de menu */
.mega-menu-item[data-category="bia"] .mega-menu-icon,
.mega-menu-item a[href*="bia"] .mega-menu-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow:
        0 0 10px rgba(240, 147, 251, 0.5),
        inset 0 0 10px rgba(245, 87, 108, 0.3);
}

.mega-menu-item[data-category="bia"]:hover .mega-menu-icon,
.mega-menu-item a[href*="bia"]:hover .mega-menu-icon {
    box-shadow:
        0 0 25px rgba(240, 147, 251, 0.8),
        0 0 40px rgba(245, 87, 108, 0.6),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
}

.mega-menu-item[data-category="bcp"] .mega-menu-icon,
.mega-menu-item a[href*="bcp"] .mega-menu-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow:
        0 0 10px rgba(79, 172, 254, 0.5),
        inset 0 0 10px rgba(0, 242, 254, 0.3);
}

.mega-menu-item[data-category="bcp"]:hover .mega-menu-icon,
.mega-menu-item a[href*="bcp"]:hover .mega-menu-icon {
    box-shadow:
        0 0 25px rgba(79, 172, 254, 0.8),
        0 0 40px rgba(0, 242, 254, 0.7),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
}

.mega-menu-item[data-category="cmp"] .mega-menu-icon,
.mega-menu-item a[href*="cmp"] .mega-menu-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow:
        0 0 10px rgba(250, 112, 154, 0.5),
        inset 0 0 10px rgba(254, 225, 64, 0.3);
}

.mega-menu-item[data-category="cmp"]:hover .mega-menu-icon,
.mega-menu-item a[href*="cmp"]:hover .mega-menu-icon {
    box-shadow:
        0 0 25px rgba(250, 112, 154, 0.8),
        0 0 40px rgba(254, 225, 64, 0.6),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
}

.mega-menu-item[data-category="risk"] .mega-menu-icon,
.mega-menu-item a[href*="risk"] .mega-menu-icon,
.mega-menu-item a[href*="risque"] .mega-menu-icon {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    box-shadow:
        0 0 10px rgba(255, 107, 107, 0.5),
        inset 0 0 10px rgba(238, 90, 36, 0.3);
}

.mega-menu-item[data-category="risk"]:hover .mega-menu-icon,
.mega-menu-item a[href*="risk"]:hover .mega-menu-icon,
.mega-menu-item a[href*="risque"]:hover .mega-menu-icon {
    box-shadow:
        0 0 25px rgba(255, 107, 107, 0.8),
        0 0 40px rgba(238, 90, 36, 0.6),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
}

.mega-menu-item[data-category="assets"] .mega-menu-icon,
.mega-menu-item a[href*="assets"] .mega-menu-icon,
.mega-menu-item a[href*="actif"] .mega-menu-icon {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    box-shadow:
        0 0 10px rgba(168, 237, 234, 0.5),
        inset 0 0 10px rgba(254, 214, 227, 0.3);
}

.mega-menu-item[data-category="assets"]:hover .mega-menu-icon,
.mega-menu-item a[href*="assets"]:hover .mega-menu-icon,
.mega-menu-item a[href*="actif"]:hover .mega-menu-icon {
    box-shadow:
        0 0 25px rgba(168, 237, 234, 0.8),
        0 0 40px rgba(254, 214, 227, 0.6),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
}

.mega-menu-item[data-category="docs"] .mega-menu-icon,
.mega-menu-item a[href*="docs"] .mega-menu-icon,
.mega-menu-item a[href*="documentation"] .mega-menu-icon {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    box-shadow:
        0 0 10px rgba(255, 236, 210, 0.5),
        inset 0 0 10px rgba(252, 182, 159, 0.3);
}

.mega-menu-item[data-category="docs"]:hover .mega-menu-icon,
.mega-menu-item a[href*="docs"]:hover .mega-menu-icon,
.mega-menu-item a[href*="documentation"]:hover .mega-menu-icon {
    box-shadow:
        0 0 25px rgba(255, 236, 210, 0.8),
        0 0 40px rgba(252, 182, 159, 0.6),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
}

.mega-menu-item[data-category="reports"] .mega-menu-icon,
.mega-menu-item a[href*="report"] .mega-menu-icon,
.mega-menu-item a[href*="rapport"] .mega-menu-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow:
        0 0 10px rgba(67, 233, 123, 0.5),
        inset 0 0 10px rgba(56, 249, 215, 0.3);
}

.mega-menu-item[data-category="reports"]:hover .mega-menu-icon,
.mega-menu-item a[href*="report"]:hover .mega-menu-icon,
.mega-menu-item a[href*="rapport"]:hover .mega-menu-icon {
    box-shadow:
        0 0 25px rgba(67, 233, 123, 0.8),
        0 0 40px rgba(56, 249, 215, 0.6),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
}

.mega-menu-item[data-category="admin"] .mega-menu-icon,
.mega-menu-item a[href*="admin"] .mega-menu-icon {
    background: linear-gradient(135deg, #fda085 0%, #f6d365 100%);
    box-shadow:
        0 0 10px rgba(253, 160, 133, 0.5),
        inset 0 0 10px rgba(246, 211, 101, 0.3);
}

.mega-menu-item[data-category="admin"]:hover .mega-menu-icon,
.mega-menu-item a[href*="admin"]:hover .mega-menu-icon {
    box-shadow:
        0 0 25px rgba(253, 160, 133, 0.8),
        0 0 40px rgba(246, 211, 101, 0.6),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
}

/* User dropdown menu */
.user-dropdown {
    background: rgba(10, 14, 39, 0.98) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* All dropdown menus */
.dropdown-menu {
    background: rgba(10, 14, 39, 0.98) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(20px);
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.9) !important;
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    color: white !important;
}

.dropdown-item:focus,
.dropdown-item:active {
    background: rgba(102, 126, 234, 0.3) !important;
    color: white !important;
}

.dropdown-item i {
    color: #667eea !important;
}

.dropdown-divider {
    border-color: rgba(102, 126, 234, 0.3) !important;
}

/* === BUTTONS IMPROVEMENTS === */
/* Primary buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6) !important;
}

/* Success buttons */
.btn-success {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4);
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.6) !important;
}

/* Outline buttons */
.btn-outline-primary {
    border: 2px solid #667eea !important;
    color: #667eea !important;
    background: rgba(102, 126, 234, 0.1) !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    border-color: #764ba2 !important;
    color: #764ba2 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-outline-secondary {
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Light buttons (for dark theme) */
.btn-light {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #0a0e27 !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-light:hover {
    background: white !important;
    color: #667eea !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

/* Button groups */
.btn-group .btn {
    border-color: rgba(102, 126, 234, 0.5) !important;
}

.btn-group .dropdown-toggle-split {
    border-left: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* === COMPLIANCE REPORTS STYLES === */
.compliance-header {
    background: linear-gradient(135deg, #ffc107 0%, #ff6b6b 100%) !important;
    color: white !important;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.standard-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    cursor: pointer;
}

.standard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    border-color: rgba(102, 126, 234, 0.5) !important;
}

.standard-card h5 {
    color: var(--text-primary) !important;
}

.compliance-score {
    font-size: 3rem;
    font-weight: 700;
}

.progress-ring {
    width: 120px;
    height: 120px;
}

.gap-item {
    border-left: 4px solid #dc3545;
    padding-left: 1rem;
    margin-bottom: 1rem;
    background: rgba(220, 53, 69, 0.1) !important;
    padding: 1rem;
    border-radius: 8px;
    color: var(--text-primary) !important;
}

/* === CARDS & CONTAINERS === */
.card,
.metric-card,
.stat-card,
.welcome-banner,
.quick-action,
.alert,
.panel,
.widget {
    background: var(--card-bg) !important;
    background-color: var(--card-bg) !important;
    background-image: none !important;
    border: 1px solid var(--card-border) !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    color: var(--text-primary) !important;
}

.card:hover,
.metric-card:hover,
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5) !important;
}

.card-header,
.metric-header,
.stat-header {
    background: rgba(102, 126, 234, 0.1) !important;
    background-color: rgba(102, 126, 234, 0.1) !important;
    background-image: none !important;
    border-bottom: 1px solid var(--card-border) !important;
    color: var(--text-primary) !important;
}

.card-body,
.metric-body,
.stat-body {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
}

.card-title,
.metric-title,
.stat-title {
    color: var(--text-primary) !important;
}

.card-text,
.metric-text,
.stat-text {
    color: var(--text-secondary) !important;
}

/* Force white/light backgrounds to be dark */
.bg-white,
.bg-light,
[style*="background: white"],
[style*="background-color: white"],
[style*="background: #fff"],
[style*="background-color: #fff"] {
    background: var(--card-bg) !important;
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

/* Welcome banner specific */
.welcome-banner {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%) !important;
}

.tenant-badge {
    background: rgba(102, 126, 234, 0.3) !important;
    color: var(--text-primary) !important;
}

/* === TABLES === */
.table {
    color: var(--text-primary) !important;
    background: transparent !important;
}

.table thead th {
    background: rgba(102, 126, 234, 0.2) !important;
    border-color: var(--card-border) !important;
    color: var(--text-primary) !important;
}

.table tbody tr {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: var(--card-border) !important;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1) !important;
}

.table td, .table th {
    border-color: var(--card-border) !important;
    color: var(--text-primary) !important;
}

/* === FORMS === */
.form-control,
.form-select,
input,
textarea,
select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--card-border) !important;
    color: var(--text-primary) !important;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25) !important;
    color: var(--text-primary) !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.form-label,
label {
    color: var(--text-primary) !important;
    font-weight: 500;
}

/* Select options */
.form-select option,
select option {
    background: var(--dark-bg) !important;
    color: var(--text-primary) !important;
}

/* Checkbox and radio labels */
.form-check-label {
    color: var(--text-primary) !important;
}

/* Input groups */
.input-group-text {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--card-border) !important;
    color: var(--text-primary) !important;
}

/* === BUTTONS === */
.btn-primary {
    background: var(--primary-gradient) !important;
    border: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid var(--card-border) !important;
    color: var(--text-primary) !important;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
}

.btn-success {
    background: var(--success-gradient) !important;
    border: none !important;
}

.btn-danger {
    background: var(--danger-gradient) !important;
    border: none !important;
}

.btn-outline-primary {
    border-color: rgba(102, 126, 234, 0.5) !important;
    color: #667eea !important;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient) !important;
    border-color: transparent !important;
    color: white !important;
}

/* === BADGES === */
.badge {
    backdrop-filter: blur(10px);
}

.badge.bg-primary {
    background: var(--primary-gradient) !important;
}

.badge.bg-success {
    background: var(--success-gradient) !important;
}

.badge.bg-danger {
    background: var(--danger-gradient) !important;
}

.badge.bg-secondary {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* === MODALS === */
.modal-content {
    background: rgba(10, 14, 39, 0.98) !important;
    border: 1px solid var(--card-border) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    border-bottom: 1px solid var(--card-border) !important;
    background: rgba(102, 126, 234, 0.1);
}

.modal-footer {
    border-top: 1px solid var(--card-border) !important;
}

.modal-title {
    color: var(--text-primary) !important;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* === ALERTS === */
.alert {
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
}

.alert-primary {
    background: rgba(102, 126, 234, 0.2) !important;
    color: var(--text-primary) !important;
}

.alert-success {
    background: rgba(79, 172, 254, 0.2) !important;
    color: var(--text-primary) !important;
}

.alert-danger {
    background: rgba(250, 112, 154, 0.2) !important;
    color: var(--text-primary) !important;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2) !important;
    color: var(--text-primary) !important;
}

/* === DROPDOWNS === */
.dropdown-menu {
    background: rgba(10, 14, 39, 0.98) !important;
    border: 1px solid var(--card-border) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dropdown-item {
    color: var(--text-primary) !important;
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.2) !important;
}

.dropdown-divider {
    border-color: var(--card-border) !important;
}

/* === PAGINATION === */
.pagination .page-link {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--card-border) !important;
    color: var(--text-primary) !important;
}

.pagination .page-link:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
}

.pagination .page-item.active .page-link {
    background: var(--primary-gradient) !important;
    border-color: transparent !important;
}

/* === BREADCRUMB === */
.breadcrumb {
    background: rgba(255, 255, 255, 0.05) !important;
}

.breadcrumb-item a {
    color: #667eea !important;
}

.breadcrumb-item.active {
    color: var(--text-secondary) !important;
}

/* === PROGRESS BARS === */
.progress {
    background: rgba(255, 255, 255, 0.1) !important;
}

.progress-bar {
    background: var(--primary-gradient) !important;
}

/* === LIST GROUPS === */
.list-group-item {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--card-border) !important;
    color: var(--text-primary) !important;
}

.list-group-item:hover {
    background: rgba(102, 126, 234, 0.1) !important;
}

.list-group-item.active {
    background: var(--primary-gradient) !important;
    border-color: transparent !important;
}

/* === TABS === */
.nav-tabs {
    border-bottom: 1px solid var(--card-border) !important;
}

.nav-tabs .nav-link {
    color: var(--text-secondary) !important;
    border-color: transparent !important;
}

.nav-tabs .nav-link:hover {
    border-color: var(--card-border) var(--card-border) transparent !important;
    color: var(--text-primary) !important;
}

.nav-tabs .nav-link.active {
    background: rgba(102, 126, 234, 0.2) !important;
    border-color: var(--card-border) var(--card-border) transparent !important;
    color: var(--text-primary) !important;
}

/* === ACCORDION === */
.accordion-item {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--card-border) !important;
}

.accordion-button {
    background: rgba(102, 126, 234, 0.1) !important;
    color: var(--text-primary) !important;
}

.accordion-button:not(.collapsed) {
    background: rgba(102, 126, 234, 0.2) !important;
    color: var(--text-primary) !important;
}

.accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.accordion-body {
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--text-primary) !important;
}

/* === OFFCANVAS === */
.offcanvas {
    background: rgba(10, 14, 39, 0.98) !important;
    backdrop-filter: blur(20px);
}

.offcanvas-header {
    border-bottom: 1px solid var(--card-border) !important;
}

.offcanvas-title {
    color: var(--text-primary) !important;
}

.offcanvas-body {
    color: var(--text-primary) !important;
}

/* === TOOLTIPS & POPOVERS === */
.tooltip-inner {
    background: rgba(10, 14, 39, 0.98) !important;
    border: 1px solid var(--card-border);
}

.popover {
    background: rgba(10, 14, 39, 0.98) !important;
    border: 1px solid var(--card-border) !important;
}

.popover-header {
    background: rgba(102, 126, 234, 0.2) !important;
    color: var(--text-primary) !important;
}

.popover-body {
    color: var(--text-primary) !important;
}

/* === TEXT UTILITIES === */
.text-muted {
    color: var(--text-secondary) !important;
}

.text-dark {
    color: var(--text-primary) !important;
}

.text-body {
    color: var(--text-primary) !important;
}

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

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary) !important;
}

/* Override Bootstrap default text colors */
.text-black-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

.lead {
    color: var(--text-primary) !important;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    color: var(--text-primary) !important;
}

/* === STATS & METRICS === */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-gradient);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === CHARTS DARK THEME === */
.chart-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1rem;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* === LOADING SPINNER === */
.spinner-border-custom {
    border-color: rgba(102, 126, 234, 0.3);
    border-right-color: #667eea;
}

/* === FOOTER === */
footer {
    background: rgba(10, 14, 39, 0.9) !important;
    border-top: 1px solid var(--card-border);
    color: var(--text-secondary) !important;
}

footer a {
    color: #667eea !important;
}

footer a:hover {
    color: #764ba2 !important;
}

/* === ADDITIONAL TEXT FIXES === */
/* Ensure all containers have proper text color */
.container, .container-fluid, .row, .col {
    color: var(--text-primary);
}

/* Small text elements */
small, .small {
    color: var(--text-secondary) !important;
}

/* Description text */
.description, .desc, .text-desc {
    color: var(--text-secondary) !important;
}

/* Strong and bold */
strong, b {
    color: var(--text-primary) !important;
}

/* Code blocks */
code, pre {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #4facfe !important;
    border: 1px solid var(--card-border);
}

/* Blockquote */
blockquote {
    border-left: 3px solid #667eea;
    padding-left: 1rem;
    color: var(--text-secondary) !important;
}

/* Lists */
ul, ol {
    color: var(--text-primary);
}

ul li, ol li {
    color: var(--text-primary) !important;
}

/* Definition lists */
dt {
    color: var(--text-primary) !important;
    font-weight: 600;
}

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

/* Horizontal rule */
hr {
    border-color: var(--card-border) !important;
    opacity: 0.3;
}

/* Caption */
caption {
    color: var(--text-secondary) !important;
}

/* Figure caption */
figcaption {
    color: var(--text-secondary) !important;
}

/* Mark/highlight */
mark {
    background: rgba(102, 126, 234, 0.3) !important;
    color: var(--text-primary) !important;
}

/* Disabled state */
:disabled, .disabled {
    opacity: 0.5;
    color: var(--text-secondary) !important;
}

/* Placeholder for contenteditable */
[contenteditable]:empty::before {
    content: attr(placeholder);
    color: rgba(255, 255, 255, 0.4);
}

/* === ICONS & VISUAL ELEMENTS === */
.metric-icon,
.stat-icon,
.quick-action-icon,
i.bi, i.fa, i[class*="icon"] {
    color: #667eea !important;
    opacity: 1;
}

/* Icon containers */
.icon-container,
.icon-wrapper,
[class*="icon-box"] {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
}

/* === CHART CONTAINERS === */
.chart-container,
.chart-wrapper,
canvas {
    background: transparent !important;
    color: var(--text-primary) !important;
}

/* === SECTION BACKGROUNDS === */
.section,
.section-content,
.content-wrapper,
.main-content,
.page-content {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
}

/* === OVERRIDE GRADIENT BACKGROUNDS === */
[style*="linear-gradient"],
[style*="radial-gradient"] {
    background-image: none !important;
    background: var(--card-bg) !important;
}

/* But keep our own gradients */
.gradient-orb,
.btn-primary,
.btn-success,
.btn-danger,
.progress-bar {
    background-image: initial !important;
}

/* === SKELETON LOADERS === */
.skeleton {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%) !important;
    background-size: 200% 100% !important;
    animation: loading 1.5s ease-in-out infinite !important;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === UTILITY CLASSES === */
.bg-primary { background: var(--primary-gradient) !important; color: white !important; }
.bg-success { background: var(--success-gradient) !important; color: white !important; }
.bg-danger { background: var(--danger-gradient) !important; color: white !important; }
.bg-warning { background: var(--danger-gradient) !important; color: white !important; }
.bg-info { background: var(--success-gradient) !important; color: white !important; }

.text-white { color: #ffffff !important; }
.text-light { color: rgba(255, 255, 255, 0.8) !important; }

/* === BORDERS === */
.border,
[class*="border-"] {
    border-color: var(--card-border) !important;
}

/* === SHADOWS === */
.shadow-sm { box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1) !important; }
.shadow { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2) !important; }
.shadow-lg { box-shadow: 0 8px 40px rgba(102, 126, 234, 0.3) !important; }

/* === HOMEPAGE SPECIFIC FIXES === */
/* Boutons de la homepage */
.module-btn,
.futuristic-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4) !important;
    font-weight: 600 !important;
    text-align: center !important;
}

.module-btn:hover,
.futuristic-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6) !important;
    transform: translateY(-3px) !important;
    color: white !important;
}

.module-btn i,
.futuristic-btn i {
    color: white !important;
    opacity: 1 !important;
}

/* Icônes des modules - Plus colorées et vibrantes */
.module-icon-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.6),
                0 0 60px rgba(102, 126, 234, 0.3) !important;
    animation: pulse-glow 3s ease-in-out infinite !important;
}

/* Couleurs différentes par module */
.module-card:nth-child(1) .module-icon-container {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    box-shadow: 0 10px 40px rgba(79, 172, 254, 0.6),
                0 0 60px rgba(0, 242, 254, 0.4) !important;
}

.module-card:nth-child(2) .module-icon-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.6),
                0 0 60px rgba(118, 75, 162, 0.4) !important;
}

.module-card:nth-child(3) .module-icon-container {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
    box-shadow: 0 10px 40px rgba(250, 112, 154, 0.6),
                0 0 60px rgba(254, 225, 64, 0.4) !important;
}

.module-card:nth-child(4) .module-icon-container {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    box-shadow: 0 10px 40px rgba(240, 147, 251, 0.6),
                0 0 60px rgba(245, 87, 108, 0.4) !important;
}

.module-card:nth-child(5) .module-icon-container {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    box-shadow: 0 10px 40px rgba(17, 153, 142, 0.6),
                0 0 60px rgba(56, 239, 125, 0.4) !important;
}

.module-card:nth-child(6) .module-icon-container {
    background: linear-gradient(135deg, #ffa751 0%, #ffe259 100%) !important;
    box-shadow: 0 10px 40px rgba(255, 167, 81, 0.6),
                0 0 60px rgba(255, 226, 89, 0.4) !important;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(102, 126, 234, 0.6),
                    0 0 60px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 15px 50px rgba(102, 126, 234, 0.8),
                    0 0 80px rgba(118, 75, 162, 0.5);
    }
}

.module-icon {
    color: white !important;
    font-size: 2.5rem !important;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Stat icons - Dégradés colorés différents */
.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 0 20px rgba(79, 172, 254, 0.6));
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 0 20px rgba(56, 239, 125, 0.6));
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 0 20px rgba(250, 112, 154, 0.6));
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.6));
}

/* Features list icons */
.module-features li i {
    color: #4facfe !important;
    font-size: 1.2rem !important;
    filter: drop-shadow(0 0 10px rgba(79, 172, 254, 0.6));
}

/* AI Assistant section */
.ai-assistant {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%) !important;
    border: 2px solid rgba(102, 126, 234, 0.4) !important;
}

/* Hero section buttons */
.hero-section .futuristic-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5) !important;
    animation: pulse-btn 2s ease-in-out infinite !important;
}

@keyframes pulse-btn {
    0%, 100% {
        box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 20px 50px rgba(102, 126, 234, 0.7);
    }
}

/* === LOGS & AUDIT STYLES === */
.log-entry {
    font-family: 'Courier New', monospace !important;
    font-size: 0.9rem !important;
    padding: 0.5rem !important;
    margin-bottom: 0.25rem !important;
    border-left: 4px solid !important;
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--text-primary) !important;
    border-radius: 4px;
}

.log-error {
    border-color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.15) !important;
}

.log-warning {
    border-color: #ffc107 !important;
    background-color: rgba(255, 193, 7, 0.15) !important;
}

.log-info {
    border-color: #0dcaf0 !important;
    background-color: rgba(13, 202, 240, 0.15) !important;
}

.log-debug {
    border-color: #6c757d !important;
    background-color: rgba(108, 117, 125, 0.15) !important;
}

/* === TIMELINE STYLES === */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(102, 126, 234, 0.5) !important;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -2.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--dark-bg) !important;
    border: 3px solid #667eea !important;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
}

.timeline-content {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: var(--text-primary) !important;
}

.timeline-content h4,
.timeline-content h5,
.timeline-content h6 {
    color: var(--text-primary) !important;
}

.timeline-content p,
.timeline-content span,
.timeline-content div {
    color: var(--text-secondary) !important;
}

/* === PROFILE PAGE STYLES === */
.profile-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    color: var(--text-primary) !important;
}

.profile-card h4,
.profile-card h5,
.profile-card h6 {
    color: var(--text-primary) !important;
}

.avatar-container {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 4rem;
    color: white !important;
    box-shadow: 0 0 40px rgba(102, 126, 234, 0.5);
}

.info-row {
    padding: 1rem 0;
    border-bottom: 1px solid var(--card-border) !important;
}

.info-row:last-child {
    border-bottom: none !important;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary) !important;
    width: 150px;
}

.info-row strong {
    color: var(--text-primary) !important;
}

/* Profile stats */
.profile-card .text-muted {
    color: var(--text-secondary) !important;
}

.profile-card strong {
    color: var(--text-primary) !important;
}

/* === TASK CARD STYLES === */
.task-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    color: var(--text-primary) !important;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5) !important;
}

.task-card.completed {
    opacity: 0.7;
    background: rgba(102, 126, 234, 0.05) !important;
}

.task-card h5,
.task-card h6 {
    color: var(--text-primary) !important;
}

.task-card p,
.task-card small {
    color: var(--text-secondary) !important;
}

.priority-badge.high {
    background: #dc3545 !important;
    color: white !important;
}

.priority-badge.medium {
    background: #ffc107 !important;
    color: #212529 !important;
}

.priority-badge.low {
    background: #28a745 !important;
    color: white !important;
}

/* === SETTINGS PAGE STYLES === */
.settings-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    color: var(--text-primary) !important;
}

.settings-card h4,
.settings-card h5,
.settings-card h6 {
    color: var(--text-primary) !important;
}

.setting-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--card-border) !important;
}

.setting-item:last-child {
    border-bottom: none !important;
}

.setting-item h6 {
    margin-bottom: 0.5rem;
    color: var(--text-primary) !important;
}

.setting-item p {
    margin-bottom: 0;
    color: var(--text-secondary) !important;
    font-size: 0.875rem;
}

/* === RISK MODULE - TABLES & CARDS === */

/* Risk statistics cards */
.stat-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
}

.stat-value {
    color: var(--text-primary) !important;
}

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

/* Risk filter cards */
.filter-card,
.risk-matrix-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Risk table cards */
.risk-table-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Risk tables */
.risk-table thead {
    background: rgba(102, 126, 234, 0.1) !important;
}

.risk-table th {
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--card-border) !important;
}

.risk-table td {
    color: var(--text-primary) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.risk-table tbody tr {
    background: transparent !important;
}

.risk-table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.15) !important;
}

.risk-id {
    color: #667eea !important;
}

.risk-title {
    color: var(--text-primary) !important;
}

/* Risk matrix card container */
.risk-matrix-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    color: var(--text-primary) !important;
}

.risk-matrix-card h4 {
    color: var(--text-primary) !important;
}

/* Risk matrix grid */
.risk-matrix {
    display: grid;
    grid-template-columns: 60px repeat(5, 1fr);
    grid-template-rows: 40px repeat(5, 80px);
    gap: 4px;
    margin: 1rem 0;
    background: transparent;
}

/* Risk matrix labels */
.matrix-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary) !important;
    background: rgba(102, 126, 234, 0.1) !important;
    border-radius: 4px;
}

/* Risk matrix cells - keep original colors for visibility */
.matrix-cell {
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-size: 0.9rem;
}

.matrix-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.matrix-cell.low {
    background: rgba(56, 239, 125, 0.2) !important;
    color: #38ef7d !important;
    border: 1px solid #38ef7d;
}

.matrix-cell.medium {
    background: rgba(255, 193, 7, 0.2) !important;
    color: #ffc107 !important;
    border: 1px solid #ffc107;
}

.matrix-cell.high {
    background: rgba(255, 126, 20, 0.2) !important;
    color: #fd7e14 !important;
    border: 1px solid #fd7e14;
}

.matrix-cell.critical {
    background: rgba(220, 53, 69, 0.2) !important;
    color: #dc3545 !important;
    border: 1px solid #dc3545;
}

/* Matrix legend */
.matrix-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary) !important;
}

.legend-color {
    width: 30px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-color.low {
    background: rgba(56, 239, 125, 0.3);
    border-color: #38ef7d;
}

.legend-color.medium {
    background: rgba(255, 193, 7, 0.3);
    border-color: #ffc107;
}

.legend-color.high {
    background: rgba(255, 126, 20, 0.3);
    border-color: #fd7e14;
}

.legend-color.critical {
    background: rgba(220, 53, 69, 0.3);
    border-color: #dc3545;
}

/* Risk badges */
.badge.bg-danger,
.badge.bg-warning,
.badge.bg-success,
.badge.bg-info {
    color: white !important;
}

/* Risk action buttons */
.btn-action {
    background: rgba(102, 126, 234, 0.1) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--card-border) !important;
}

.btn-action:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
}

/* === GLOBAL MODULE FIXES - ALL MODULES === */

/* Chart containers */
.chart-container {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

/* Quick actions */
.quick-action {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    color: var(--text-primary) !important;
}

.quick-action:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
}

.quick-action h5,
.quick-action h6 {
    color: var(--text-primary) !important;
}

.quick-action p {
    color: var(--text-secondary) !important;
}

/* BRP/DRP/IRP items */
.brp-item,
.drp-item,
.irp-item,
.plan-item {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    color: var(--text-primary) !important;
}

.brp-item:hover,
.drp-item:hover,
.irp-item:hover,
.plan-item:hover {
    border-left-color: #667eea !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2) !important;
}

.brp-item h5,
.brp-item h6,
.drp-item h5,
.drp-item h6,
.irp-item h5,
.irp-item h6,
.plan-item h5,
.plan-item h6 {
    color: var(--text-primary) !important;
}

/* Priority badges - keep colors */
.priority-badge,
.priority-critical,
.priority-high,
.priority-medium,
.priority-low {
    font-weight: 600 !important;
}

.priority-critical {
    background: #dc3545 !important;
    color: white !important;
}

.priority-high {
    background: #fd7e14 !important;
    color: white !important;
}

.priority-medium {
    background: #ffc107 !important;
    color: #000 !important;
}

.priority-low {
    background: #28a745 !important;
    color: white !important;
}

/* Status badges */
.status-badge {
    font-weight: 600 !important;
}

.status-active {
    background: #28a745 !important;
    color: white !important;
}

.status-draft {
    background: #6c757d !important;
    color: white !important;
}

.status-review {
    background: #17a2b8 !important;
    color: white !important;
}

/* RTO/RPO indicators */
.rto-indicator,
.rpo-indicator {
    color: var(--text-primary) !important;
}

.rto-value,
.rpo-value {
    color: #667eea !important;
}

/* Process items */
.process-card,
.process-item {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    color: var(--text-primary) !important;
}

.process-card:hover,
.process-item:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2) !important;
}

/* Supplier items */
.supplier-card,
.supplier-item {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    color: var(--text-primary) !important;
}

/* Asset items */
.asset-card,
.asset-item {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    color: var(--text-primary) !important;
}

/* BIA items */
.bia-card,
.bia-item {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    color: var(--text-primary) !important;
}

/* Form cards */
.form-card,
.library-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    color: var(--text-primary) !important;
}

/* Linked items / Add sections */
.linked-item,
.add-item-section {
    background: rgba(102, 126, 234, 0.05) !important;
    border-color: var(--card-border) !important;
    color: var(--text-primary) !important;
}

.linked-item h6 {
    color: var(--text-primary) !important;
}

/* Nav tabs custom */
.nav-tabs-custom {
    border-bottom-color: rgba(102, 126, 234, 0.5) !important;
}

.nav-tabs-custom .nav-link {
    color: var(--text-secondary) !important;
}

.nav-tabs-custom .nav-link.active {
    color: #667eea !important;
    border-bottom-color: #667eea !important;
}

/* Section headers */
.section-header {
    color: #667eea !important;
    border-left-color: #667eea !important;
}

/* BRP cards */
.brp-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    color: var(--text-primary) !important;
}

.brp-card:hover {
    border-color: rgba(102, 126, 234, 0.5) !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2) !important;
}

.brp-card h5 {
    color: var(--text-primary) !important;
}

/* === ADMIN AUDITS FIXES === */
/* Bootstrap card overrides for audit pages */
.card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    color: var(--text-primary) !important;
}

.card-header {
    background: rgba(102, 126, 234, 0.1) !important;
    border-bottom: 1px solid var(--card-border) !important;
    color: var(--text-primary) !important;
}

.card-header h5 {
    color: var(--text-primary) !important;
}

.card-body {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

/* Table overrides for audits */
.table {
    color: var(--text-primary) !important;
}

.table thead {
    background: rgba(102, 126, 234, 0.1) !important;
}

.table thead th {
    color: var(--text-primary) !important;
    border-bottom-color: rgba(102, 126, 234, 0.3) !important;
}

.table tbody tr {
    background: transparent !important;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1) !important;
}

.table tbody td {
    color: var(--text-primary) !important;
    border-color: var(--card-border) !important;
}

/* Badge overrides */
.badge {
    color: #fff !important;
}

.badge.bg-secondary {
    background-color: rgba(108, 117, 125, 0.8) !important;
    color: #fff !important;
}

.badge.bg-success {
    background-color: rgba(40, 167, 69, 0.8) !important;
    color: #fff !important;
}

.badge.bg-danger {
    background-color: rgba(220, 53, 69, 0.8) !important;
    color: #fff !important;
}

.badge.bg-warning {
    background-color: rgba(255, 193, 7, 0.8) !important;
    color: #000 !important;
}

.badge.bg-info {
    background-color: rgba(23, 162, 184, 0.8) !important;
    color: #fff !important;
}

.badge.bg-primary {
    background-color: rgba(102, 126, 234, 0.8) !important;
    color: #fff !important;
}

/* Text utilities */
.text-muted {
    color: var(--text-secondary) !important;
}

/* Form controls in cards */
.form-select,
.form-control {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--card-border) !important;
    color: var(--text-primary) !important;
}

.form-select:focus,
.form-control:focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

.form-select option {
    background-color: #0a0e27 !important;
    color: var(--text-primary) !important;
}

/* ========================================
   LOGIN PAGE STYLES
   ======================================== */

body.login-page,
body:has(.login-container) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* Le display flex est déjà défini plus haut avec flex-direction: column */
}

.login-container {
    background: rgba(10, 14, 39, 0.95) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
}

.login-container .logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-container .logo h1 {
    color: #ffffff !important;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.login-container .logo p {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 1rem;
}

.login-container .form-label {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
}

.login-container .form-control,
.login-container .form-select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    padding: 0.75rem;
}

.login-container .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.login-container .form-control:focus,
.login-container .form-select:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: #667eea !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

.login-container .form-check-label {
    color: rgba(255, 255, 255, 0.8) !important;
}

.login-container .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none;
    padding: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white !important;
}

.login-container .btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.login-container .btn-primary:disabled {
    opacity: 0.6;
}

/* OAuth Buttons */
.login-container .btn-outline-danger,
.login-container .btn-outline-primary {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.login-container .btn-outline-danger:hover {
    background: rgba(234, 67, 53, 0.15) !important;
    border-color: rgba(234, 67, 53, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.3);
}

.login-container .btn-outline-primary:hover {
    background: rgba(0, 120, 212, 0.15) !important;
    border-color: rgba(0, 120, 212, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.login-container a {
    color: rgba(102, 126, 234, 1) !important;
    text-decoration: none;
}

.login-container a:hover {
    color: rgba(118, 75, 162, 1) !important;
    text-decoration: underline;
}

.login-container .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

.login-container .text-muted.small {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Demo Accounts Section */
.login-container .demo-accounts {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-container .demo-accounts h6 {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.login-container .btn-demo {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
}

.login-container .btn-demo:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
    transform: translateX(5px);
}

.login-container .btn-demo code {
    background: rgba(102, 126, 234, 0.2);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Alerts */
.login-container .alert {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.login-container .alert-info {
    background: rgba(13, 202, 240, 0.15) !important;
    border-color: rgba(13, 202, 240, 0.3) !important;
}

.login-container .alert-success {
    background: rgba(25, 135, 84, 0.15) !important;
    border-color: rgba(25, 135, 84, 0.3) !important;
}

.login-container .alert-danger {
    background: rgba(220, 53, 69, 0.15) !important;
    border-color: rgba(220, 53, 69, 0.3) !important;
}

.login-container .alert-warning {
    background: rgba(255, 193, 7, 0.15) !important;
    border-color: rgba(255, 193, 7, 0.3) !important;
}

.login-container .btn-close {
    filter: invert(1);
    opacity: 0.7;
}

.login-container .btn-close:hover {
    opacity: 1;
}

/* ========================================
   DASHBOARD PAGE STYLES
   ======================================== */

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    padding: 2.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.welcome-banner h1,
.welcome-banner h2,
.welcome-banner p,
.welcome-banner .lead {
    color: #ffffff !important;
}

.tenant-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2) !important;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    color: #ffffff !important;
}

/* Metric Cards */
.metric-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 15px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.metric-card.primary::before { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.metric-card.success::before { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.metric-card.danger::before { background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%); }
.metric-card.warning::before { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.metric-card.info::before { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.metric-icon.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.metric-icon.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4);
}

.metric-icon.danger {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%) !important;
    box-shadow: 0 4px 15px rgba(238, 9, 121, 0.4);
}

.metric-icon.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.metric-icon.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.metric-card.success .metric-icon {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4);
}
.metric-card.danger .metric-icon {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%) !important;
    box-shadow: 0 4px 15px rgba(238, 9, 121, 0.4);
}
.metric-card.warning .metric-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}
.metric-card.info .metric-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

/* Icons dans les chart-containers */
.chart-container .metric-icon {
    color: inherit !important;
}

.chart-container .metric-icon i,
.chart-container .metric-icon .bi {
    color: inherit !important;
}

.metric-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff !important;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.metric-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.metric-change.positive {
    color: #38ef7d !important;
}

.metric-change.negative {
    color: #ff6a00 !important;
}

.metric-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
}

.metric-footer a {
    color: rgba(102, 126, 234, 1) !important;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.metric-footer a:hover {
    color: rgba(118, 75, 162, 1) !important;
    transform: translateX(5px);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.quick-action-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.quick-action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5) !important;
}

.quick-action-card h5 {
    color: #ffffff !important;
    margin-bottom: 0.5rem;
}

.quick-action-card p {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.quick-action-card i {
    font-size: 2rem;
    color: #667eea !important;
    margin-bottom: 1rem;
}

.quick-action-card:hover i {
    color: #764ba2 !important;
}

/* Activity Timeline */
.activity-timeline {
    position: relative;
    padding-left: 2.5rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.activity-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    top: 0.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.activity-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5) !important;
    margin-bottom: 0.25rem;
}

.activity-content {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.875rem;
}

/* Charts */
.chart-container {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-container h5 {
    color: #ffffff !important;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.stat-item .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Variantes de couleurs pour les icônes stat-item */
.stat-item.success .stat-icon {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-item.danger .stat-icon {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-item.warning .stat-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-item.info .stat-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-item .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff !important;
    margin-bottom: 0.5rem;
}

.stat-item .stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Progress Bars */
.progress-bar-custom {
    background: rgba(255, 255, 255, 0.1) !important;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    transition: width 0.6s ease;
}

.progress-fill.primary {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
}

.progress-fill.success {
    background: linear-gradient(90deg, #11998e 0%, #38ef7d 100%) !important;
}

.progress-fill.danger {
    background: linear-gradient(90deg, #ee0979 0%, #ff6a00 100%) !important;
}

.progress-fill.warning {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%) !important;
}

.progress-fill.info {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%) !important;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Bouttons outline variants pour dashboard */
.btn-outline-primary {
    border: 2px solid #667eea !important;
    color: #667eea !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background: rgba(102, 126, 234, 0.15) !important;
    border-color: #764ba2 !important;
    color: #764ba2 !important;
}

.btn-outline-success {
    border: 2px solid #38ef7d !important;
    color: #38ef7d !important;
    background: transparent !important;
}

.btn-outline-success:hover {
    background: rgba(56, 239, 125, 0.15) !important;
    border-color: #11998e !important;
    color: #11998e !important;
}

.btn-outline-danger {
    border: 2px solid #ff6a00 !important;
    color: #ff6a00 !important;
    background: transparent !important;
}

.btn-outline-danger:hover {
    background: rgba(255, 106, 0, 0.15) !important;
    border-color: #ee0979 !important;
    color: #ee0979 !important;
}

.btn-outline-warning {
    border: 2px solid #f5576c !important;
    color: #f5576c !important;
    background: transparent !important;
}

.btn-outline-warning:hover {
    background: rgba(245, 87, 108, 0.15) !important;
    border-color: #f093fb !important;
    color: #f093fb !important;
}

.btn-outline-info {
    border: 2px solid #00f2fe !important;
    color: #00f2fe !important;
    background: transparent !important;
}

.btn-outline-info:hover {
    background: rgba(0, 242, 254, 0.15) !important;
    border-color: #4facfe !important;
    color: #4facfe !important;
}

/* ============================================
   SETTINGS PAGE STYLES
   ============================================ */

/* Setting items */
.setting-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #fff;
}

.setting-item p {
    margin-bottom: 0;
    font-size: 0.875rem;
}

/* Font size classes */
body.font-small {
    font-size: 12px;
}

body.font-medium {
    font-size: 14px;
}

body.font-large {
    font-size: 16px;
}

body.font-xlarge {
    font-size: 18px;
}

/* Compact mode */
body.compact-mode .setting-item {
    padding: 1rem 0;
}

body.compact-mode .chart-container {
    padding: 1rem;
}

body.compact-mode .page-header {
    padding: 1rem 0;
}

/* No animations */
body.no-animations * {
    transition: none !important;
    animation: none !important;
}

/* Light theme overrides */
body.light-theme {
    background: #f5f5f5;
    color: #333;
}

body.light-theme .chart-container {
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

body.light-theme .setting-item {
    border-bottom: 1px solid #e0e0e0;
}

body.light-theme .setting-item h6 {
    color: #333;
}

body.light-theme .form-select,
body.light-theme .form-control {
    background: #ffffff;
    border-color: #ddd;
    color: #333;
}

body.light-theme .list-group-item {
    background: #ffffff;
    color: #333;
    border-color: #e0e0e0;
}

body.light-theme .list-group-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #fff;
}

/* Fix for select dropdowns with enhanced neon glow */
.form-select {
    position: relative !important;
    z-index: 10 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border: 2px solid #00d4ff !important;
    color: #fff !important;
    font-weight: 500 !important;
    box-shadow:
        0 0 15px rgba(0, 212, 255, 0.6),
        inset 0 0 15px rgba(0, 212, 255, 0.3) !important;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.9) !important;
    transition: all 0.3s ease !important;
}

.form-select:focus {
    border-color: #00ffff !important;
    box-shadow:
        0 0 25px rgba(0, 255, 255, 0.9),
        inset 0 0 20px rgba(0, 255, 255, 0.4) !important;
    outline: none !important;
    background: rgba(0, 50, 60, 0.7) !important;
}

.form-select:disabled {
    pointer-events: none !important;
    cursor: not-allowed !important;
    opacity: 0.5;
}

/* Enhanced neon glow for options */
.form-select option {
    cursor: pointer !important;
    background: #0a0a1e !important;
    color: #00d4ff !important;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.6) !important;
    padding: 12px !important;
    font-weight: 400 !important;
}

.form-select option:hover {
    background: rgba(102, 126, 234, 0.4) !important;
    color: #00ffff !important;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.9) !important;
}

/* Option sélectionnée avec néon très clair */
.form-select option:checked,
.form-select option[selected] {
    background: linear-gradient(135deg, #00d4ff 0%, #667eea 100%) !important;
    color: #ffffff !important;
    text-shadow:
        0 0 20px rgba(255, 255, 255, 1),
        0 0 30px rgba(0, 255, 255, 0.8) !important;
    font-weight: 600 !important;
}

/* Animation flash lors de la sélection */
@keyframes selectFlash {
    0% {
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.6), inset 0 0 15px rgba(0, 212, 255, 0.3);
        border-color: #00d4ff;
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 255, 255, 1), inset 0 0 30px rgba(0, 255, 255, 0.7);
        border-color: #00ffff;
    }
    100% {
        box-shadow: 0 0 25px rgba(0, 255, 255, 0.8), inset 0 0 20px rgba(0, 212, 255, 0.5);
        border-color: #00ffff;
    }
}

.form-select.select-flash {
    animation: selectFlash 0.4s ease;
}

/* État actif persistant - select avec valeur sélectionnée */
.form-select.select-active,
.form-select:not(:invalid):not([value=""]) {
    border-color: #00ffff !important;
    box-shadow:
        0 0 25px rgba(0, 255, 255, 0.8),
        inset 0 0 20px rgba(0, 255, 255, 0.4) !important;
    background: rgba(0, 40, 50, 0.7) !important;
}

/* Indicateur visuel de l'option active */
.form-select.select-active::after {
    content: '●';
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: #00ffff;
    font-size: 10px;
    text-shadow:
        0 0 10px rgba(0, 255, 255, 1),
        0 0 20px rgba(0, 255, 255, 0.8);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px rgba(0, 255, 255, 1), 0 0 20px rgba(0, 255, 255, 0.8); }
    50% { opacity: 0.6; text-shadow: 0 0 5px rgba(0, 255, 255, 0.6), 0 0 10px rgba(0, 255, 255, 0.4); }
}

/* Fix z-index stacking for settings page */
.setting-item .form-select,
.chart-container .form-select {
    z-index: 100 !important;
}

/* ========================================
   FORM SWITCHES - NEON TOGGLE BUTTONS
   ======================================== */

.form-check-input[type="checkbox"] {
    width: 3em !important;
    height: 1.5em !important;
    cursor: pointer !important;
    background-color: rgba(100, 100, 100, 0.3) !important;
    border: 2px solid rgba(150, 150, 150, 0.5) !important;
    box-shadow:
        0 0 5px rgba(150, 150, 150, 0.3),
        inset 0 0 5px rgba(0, 0, 0, 0.5) !important;
    transition: all 0.3s ease !important;
}

/* État ACTIVÉ - Néon cyan très lumineux */
.form-check-input[type="checkbox"]:checked {
    background-color: #00d4ff !important;
    border-color: #00ffff !important;
    box-shadow:
        0 0 25px rgba(0, 255, 255, 0.9),
        0 0 40px rgba(0, 255, 255, 0.6),
        inset 0 0 15px rgba(255, 255, 255, 0.8) !important;
}

/* Bouton circulaire du switch */
.form-check-input[type="checkbox"]::before {
    position: absolute;
    content: '';
    width: 1.1em;
    height: 1.1em;
    border-radius: 50%;
    background: #fff !important;
    top: 50%;
    left: 0.15em;
    transform: translateY(-50%);
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Bouton circulaire quand ACTIVÉ - position droite avec glow */
.form-check-input[type="checkbox"]:checked::before {
    left: calc(100% - 1.25em);
    background: #ffffff !important;
    box-shadow:
        0 0 15px rgba(255, 255, 255, 1),
        0 0 25px rgba(0, 255, 255, 0.8),
        0 0 35px rgba(0, 255, 255, 0.5) !important;
}

/* Animation au clic */
.form-check-input[type="checkbox"]:active {
    transform: scale(0.95);
}

/* Focus state */
.form-check-input[type="checkbox"]:focus {
    outline: none !important;
    box-shadow:
        0 0 30px rgba(0, 255, 255, 1),
        0 0 50px rgba(0, 255, 255, 0.6) !important;
}

/* Hover effect */
.form-check-input[type="checkbox"]:hover {
    border-color: #00d4ff !important;
    box-shadow:
        0 0 15px rgba(0, 212, 255, 0.6),
        inset 0 0 10px rgba(0, 212, 255, 0.3) !important;
}

.form-check-input[type="checkbox"]:checked:hover {
    box-shadow:
        0 0 35px rgba(0, 255, 255, 1),
        0 0 50px rgba(0, 255, 255, 0.7),
        inset 0 0 20px rgba(255, 255, 255, 0.9) !important;
}

/* ========================================
   ADMIN PAGES - TENANTS & SETTINGS
   ======================================== */

/* Page header with neon gradient */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    padding: 2rem 0 !important;
    margin-bottom: 2rem !important;
    box-shadow:
        0 4px 20px rgba(102, 126, 234, 0.4),
        0 0 40px rgba(118, 75, 162, 0.3) !important;
    border-bottom: 2px solid rgba(0, 212, 255, 0.5);
}

.page-header h1 {
    color: #ffffff !important;
    text-shadow:
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(0, 212, 255, 0.6) !important;
    font-weight: 700 !important;
}

.page-header p {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5) !important;
}

.page-header .btn {
    box-shadow:
        0 0 15px rgba(0, 212, 255, 0.6),
        inset 0 0 10px rgba(255, 255, 255, 0.2) !important;
}

/* Stat cards with dark theme */
.stat-card {
    background: rgba(15, 20, 40, 0.9) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    border-radius: 15px !important;
    padding: 1.5rem !important;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 212, 255, 0.1) !important;
    transition: all 0.3s ease !important;
}

.stat-card:hover {
    transform: translateY(-5px) !important;
    box-shadow:
        0 8px 25px rgba(102, 126, 234, 0.4),
        0 0 30px rgba(0, 212, 255, 0.3),
        inset 0 0 25px rgba(0, 212, 255, 0.15) !important;
    border-color: rgba(0, 212, 255, 0.6) !important;
}

.stat-card .stat-value,
.stat-card h3 {
    color: #00ffff !important;
    text-shadow:
        0 0 15px rgba(0, 255, 255, 0.8),
        0 0 25px rgba(0, 255, 255, 0.5) !important;
    font-weight: 700 !important;
}

.stat-card .stat-label,
.stat-card p {
    color: rgba(255, 255, 255, 0.8) !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4) !important;
}

/* Icon colors with glow */
.stat-card i.text-primary {
    color: #667eea !important;
    filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.8));
}

.stat-card i.text-success {
    color: #43e97b !important;
    filter: drop-shadow(0 0 10px rgba(67, 233, 123, 0.8));
}

.stat-card i.text-warning {
    color: #ffc107 !important;
    filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.8));
}

.stat-card i.text-info {
    color: #00d4ff !important;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.8));
}

.stat-card i.text-danger {
    color: #ff6b6b !important;
    filter: drop-shadow(0 0 10px rgba(255, 107, 107, 0.8));
}

/* Tables in admin pages */
.table {
    color: rgba(255, 255, 255, 0.9) !important;
}

.table thead th {
    background: rgba(102, 126, 234, 0.2) !important;
    color: #00ffff !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6) !important;
}

.table tbody td {
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1) !important;
}

/* Badges in tables */
.badge.bg-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%) !important;
    box-shadow: 0 0 10px rgba(67, 233, 123, 0.6) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.6) !important;
    color: #000 !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%) !important;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.6) !important;
}

.badge.bg-secondary {
    background: rgba(108, 117, 125, 0.8) !important;
    box-shadow: 0 0 8px rgba(108, 117, 125, 0.5) !important;
}

/* Cards in admin pages */
.card {
    background: rgba(15, 20, 40, 0.95) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    border-radius: 12px !important;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 212, 255, 0.05) !important;
}

.card-header {
    background: rgba(102, 126, 234, 0.15) !important;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3) !important;
    color: #ffffff !important;
}

.card-header.bg-white {
    background: rgba(102, 126, 234, 0.15) !important;
}

.card-body {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Form controls in cards */
.card .form-control,
.card .form-select {
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(102, 126, 234, 0.4) !important;
    color: #ffffff !important;
}

.card .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.card .form-control:focus,
.card .form-select:focus {
    background: rgba(0, 0, 0, 0.6) !important;
    border-color: #00d4ff !important;
    box-shadow:
        0 0 15px rgba(0, 212, 255, 0.5),
        inset 0 0 10px rgba(0, 212, 255, 0.2) !important;
    color: #ffffff !important;
}

/* Input text color */
.form-control,
.form-select {
    color: #ffffff !important;
}

.form-control option,
.form-select option {
    background: #1a1a2e !important;
    color: #ffffff !important;
}

/* Fix table text colors - ensure visibility */
.table tbody td,
.table tbody tr td,
.card .table tbody td {
    color: rgba(255, 255, 255, 0.95) !important;
}

.table tbody td strong,
.card .table tbody td strong {
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* Ensure all text in table is visible */
.table-responsive .table tbody tr,
.card-body .table tbody tr {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Button text colors in tables */
.table .btn-outline-primary,
.table .btn-outline-danger {
    color: #ffffff !important;
    border-color: rgba(102, 126, 234, 0.6) !important;
}

.table .btn-outline-primary:hover {
    background: rgba(102, 126, 234, 0.3) !important;
    border-color: #00d4ff !important;
    color: #00ffff !important;
}

.table .btn-outline-danger {
    border-color: rgba(255, 107, 107, 0.6) !important;
}

.table .btn-outline-danger:hover {
    background: rgba(255, 107, 107, 0.3) !important;
    border-color: #ff6b6b !important;
    color: #ff6b6b !important;
}

/* Very specific selectors for tenants table */
#tenantsTable tr,
#tenantsTable td,
tbody#tenantsTable tr,
tbody#tenantsTable td {
    color: rgba(255, 255, 255, 0.95) !important;
    background: transparent !important;
}

#tenantsTable td strong,
tbody#tenantsTable td strong {
    color: #00ffff !important;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6) !important;
}

/* Ensure numbers are visible */
#tenantsTable td:nth-child(3) {
    color: #ffffff !important;
}

/* Ensure domain names are visible */
#tenantsTable td:nth-child(2) {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Ensure dates are visible */
#tenantsTable td:nth-child(5) {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Fix for all tbody elements */
tbody tr td {
    color: #ffffff !important;
}

/* Invoices table in billing page */
#invoicesTable tr,
#invoicesTable td,
tbody#invoicesTable tr,
tbody#invoicesTable td {
    color: rgba(255, 255, 255, 0.95) !important;
    background: transparent !important;
}

#invoicesTable td strong,
tbody#invoicesTable td strong {
    color: #00ffff !important;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6) !important;
}

/* Card body text color fix */
.card-body,
.card-body p,
.card-body div {
    color: rgba(255, 255, 255, 0.9) !important;
}

.card-body h3 {
    color: #ffffff !important;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5) !important;
}

.card-body .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Fix for bg-primary card headers */
.card-header.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3) !important;
}

.card-header.bg-primary h5 {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5) !important;
}

/* Payment method cards */
.card-body .bi-check-circle {
    color: #43e97b !important;
    filter: drop-shadow(0 0 8px rgba(67, 233, 123, 0.6));
}

/* Buttons in card headers */
.card-header .btn-outline-secondary {
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.card-header .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: #00d4ff !important;
    color: #00ffff !important;
}

/* Backups table in backups page */
#backupsTable tr,
#backupsTable td,
tbody#backupsTable tr,
tbody#backupsTable td {
    color: rgba(255, 255, 255, 0.95) !important;
    background: transparent !important;
}

/* Ensure all text in backups table is visible */
#backupsTable td:nth-child(1),
#backupsTable td:nth-child(3),
#backupsTable td:nth-child(5) {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Badge colors for backups */
.badge.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.6) !important;
    color: #ffffff !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #00d4ff 0%, #4facfe 100%) !important;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6) !important;
    color: #ffffff !important;
}

/* Buttons in backups table */
#backupsTable .btn-outline-success {
    color: #ffffff !important;
    border-color: rgba(67, 233, 123, 0.6) !important;
}

#backupsTable .btn-outline-success:hover {
    background: rgba(67, 233, 123, 0.3) !important;
    border-color: #43e97b !important;
    color: #43e97b !important;
    box-shadow: 0 0 15px rgba(67, 233, 123, 0.5) !important;
}

#backupsTable .btn-outline-danger:hover {
    background: rgba(255, 107, 107, 0.3) !important;
    border-color: #ff6b6b !important;
    color: #ff6b6b !important;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.5) !important;
}

#backupsTable .btn-outline-primary:hover {
    background: rgba(102, 126, 234, 0.3) !important;
    border-color: #00d4ff !important;
    color: #00ffff !important;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5) !important;
}

/* Progress bars in backup page */
.progress {
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
}

.progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.6) !important;
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%) !important;
    box-shadow: 0 0 15px rgba(67, 233, 123, 0.6) !important;
}

/* Performance page - Endpoints table */
#endpointsTable tr,
#endpointsTable td,
tbody#endpointsTable tr,
tbody#endpointsTable td {
    color: rgba(255, 255, 255, 0.95) !important;
    background: transparent !important;
}

/* Code elements in tables */
code {
    background: rgba(0, 0, 0, 0.6) !important;
    color: #00ffff !important;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
}

/* Slow queries table */
#slowQueriesTable tr,
#slowQueriesTable td,
tbody#slowQueriesTable tr,
tbody#slowQueriesTable td {
    color: rgba(255, 255, 255, 0.95) !important;
    background: transparent !important;
}

/* Method badges for endpoints */
#endpointsTable .badge.bg-primary,
#endpointsTable .badge.bg-success {
    color: #ffffff !important;
}

/* Ensure all numbers and percentages are visible */
#endpointsTable td:nth-child(3),
#endpointsTable td:nth-child(4),
#endpointsTable td:nth-child(5) {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500 !important;
}

/* Timestamp visibility */
#slowQueriesTable td:nth-child(3),
#slowQueriesTable td:nth-child(4) {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Chart containers */
.chart-container {
    background: rgba(15, 20, 40, 0.9) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 212, 255, 0.05) !important;
}

.chart-container h6 {
    color: #00ffff !important;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6) !important;
}

/* Stats page - Top users table */
#topUsers tr,
#topUsers td,
tbody#topUsers tr,
tbody#topUsers td {
    color: rgba(255, 255, 255, 0.95) !important;
    background: transparent !important;
}

#topUsers td strong {
    color: #00ffff !important;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6) !important;
}

#topUsers .text-muted,
#topUsers td small.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Stats page - Recent docs table */
#recentDocs tr,
#recentDocs td,
tbody#recentDocs tr,
tbody#recentDocs td {
    color: rgba(255, 255, 255, 0.95) !important;
    background: transparent !important;
}

#recentDocs .text-muted,
#recentDocs td small.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Fix all .text-muted in tables */
.table .text-muted,
.table td .text-muted,
.table td small.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Ensure small text is visible */
.table small {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Chart text colors */
.chart-container .text-muted,
.card-body .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Audits page - Events table */
#auditsTable tr,
#auditsTable td,
tbody#auditsTable tr,
tbody#auditsTable td {
    color: rgba(255, 255, 255, 0.95) !important;
    background: transparent !important;
}

/* Ensure all columns are visible */
#auditsTable td:nth-child(1),
#auditsTable td:nth-child(2),
#auditsTable td:nth-child(4),
#auditsTable td:nth-child(7) {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* IP addresses */
#auditsTable td:nth-child(5) small.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Card header without bg-white */
.card-header:not(.bg-white):not(.bg-primary) {
    background: rgba(102, 126, 234, 0.15) !important;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3) !important;
    color: #ffffff !important;
}

.card-header h5 {
    color: #ffffff !important;
}

.card-header .badge {
    vertical-align: middle !important;
}

/* Fix for Analytics section - prevent infinite growth */
.chart-container {
    max-height: 400px !important;
    height: auto !important;
    overflow: hidden !important;
    position: relative !important;
}

.chart-container canvas {
    max-height: 350px !important;
    width: 100% !important;
    height: auto !important;
}

/* Specific fix for RTO chart */
.chart-container[style*="height: 350px"] {
    height: 350px !important;
    max-height: 350px !important;
}

.chart-container[style*="height: 350px"] canvas {
    max-height: 300px !important;
}

/* Ensure charts maintain aspect ratio */
.chart-container canvas {
    max-width: 100% !important;
    display: block !important;
}

/* Dashboard header spacing */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    padding: 2rem 0 !important;
    margin-bottom: 2rem !important;
    box-shadow:
        0 4px 20px rgba(102, 126, 234, 0.4),
        0 0 40px rgba(118, 75, 162, 0.3) !important;
}

.dashboard-header h1 {
    color: #ffffff !important;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8) !important;
}

.dashboard-header p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Export buttons */
.export-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
}

.export-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: #00d4ff !important;
    color: #00ffff !important;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5) !important;
}

/* Filter card */
.filter-card {
    background: rgba(15, 20, 40, 0.9) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    margin-bottom: 2rem !important;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 212, 255, 0.05) !important;
}

.filter-card h5 {
    color: #00ffff !important;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6) !important;
}

.filter-card label {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ========================================
   COMPREHENSIVE FORM THEME - DARK MODE
   ======================================== */

/* Form sections with light background override */
.form-section,
.form-group,
.input-group {
    background: rgba(15, 20, 40, 0.8) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    border-radius: 8px !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

/* All form controls - comprehensive override */
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="url"],
input[type="search"],
input[type="tel"],
textarea,
select {
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(102, 126, 234, 0.4) !important;
    color: #ffffff !important;
    transition: all 0.3s ease !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
    background: rgba(0, 0, 0, 0.6) !important;
    border-color: #00d4ff !important;
    box-shadow:
        0 0 15px rgba(0, 212, 255, 0.5),
        inset 0 0 10px rgba(0, 212, 255, 0.2) !important;
    color: #ffffff !important;
    outline: none !important;
}

/* Disabled state */
.form-control:disabled,
.form-select:disabled,
input:disabled,
textarea:disabled,
select:disabled {
    background: rgba(50, 50, 50, 0.5) !important;
    color: rgba(255, 255, 255, 0.4) !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

/* Form labels */
.form-label,
label {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
}

/* Form text and help text */
.form-text,
.text-muted,
small.text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Input groups */
.input-group-text {
    background: rgba(102, 126, 234, 0.3) !important;
    border: 1px solid rgba(102, 126, 234, 0.4) !important;
    color: #ffffff !important;
}

/* Checkboxes and radios */
.form-check-input {
    background-color: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(102, 126, 234, 0.4) !important;
}

.form-check-input:checked {
    background-color: #00d4ff !important;
    border-color: #00ffff !important;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6) !important;
}

.form-check-input:focus {
    border-color: #00d4ff !important;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5) !important;
}

.form-check-label {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Select dropdowns - ensure options are visible */
select option,
.form-select option {
    background: #1a1a2e !important;
    color: #ffffff !important;
    padding: 8px !important;
}

select option:checked,
.form-select option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
}

/* Modals */
.modal-content {
    background: rgba(15, 20, 40, 0.98) !important;
    border: 1px solid rgba(102, 126, 234, 0.5) !important;
    box-shadow:
        0 10px 50px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(102, 126, 234, 0.3) !important;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3) !important;
}

.modal-title {
    color: #ffffff !important;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6) !important;
}

.modal-body {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.modal-footer {
    background: rgba(0, 0, 0, 0.3) !important;
    border-top: 1px solid rgba(102, 126, 234, 0.3) !important;
}

/* Close button in modal */
.btn-close {
    filter: invert(1) brightness(2) !important;
    opacity: 0.8 !important;
}

.btn-close:hover {
    opacity: 1 !important;
}

/* Valid/Invalid states */
.form-control.is-valid,
.form-select.is-valid {
    border-color: #43e97b !important;
    box-shadow: 0 0 10px rgba(67, 233, 123, 0.4) !important;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #ff6b6b !important;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.4) !important;
}

.valid-feedback {
    color: #43e97b !important;
}

.invalid-feedback {
    color: #ff6b6b !important;
}

/* File inputs */
input[type="file"] {
    color: rgba(255, 255, 255, 0.9) !important;
}

input[type="file"]::file-selector-button {
    background: rgba(102, 126, 234, 0.3) !important;
    border: 1px solid rgba(102, 126, 234, 0.5) !important;
    color: #ffffff !important;
    padding: 0.375rem 0.75rem !important;
    border-radius: 4px !important;
    cursor: pointer !important;
}

input[type="file"]::file-selector-button:hover {
    background: rgba(102, 126, 234, 0.5) !important;
    border-color: #00d4ff !important;
}

/* Range inputs */
input[type="range"] {
    background: transparent !important;
}

input[type="range"]::-webkit-slider-track {
    background: rgba(102, 126, 234, 0.3) !important;
    border: 1px solid rgba(102, 126, 234, 0.4) !important;
    border-radius: 4px !important;
}

input[type="range"]::-webkit-slider-thumb {
    background: #00d4ff !important;
    border: 2px solid #00ffff !important;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6) !important;
}

/* Fieldsets and legends */
fieldset {
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    border-radius: 8px !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

legend {
    color: #00ffff !important;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6) !important;
    font-weight: 600 !important;
    padding: 0 0.5rem !important;
}

/* Override any inline light backgrounds */
[style*="background: #f8f9fa"],
[style*="background:#f8f9fa"],
[style*="background: #fff"],
[style*="background:#fff"],
[style*="background: white"],
[style*="background:white"] {
    background: rgba(15, 20, 40, 0.8) !important;
}

/* Asset cards and process cards */
.asset-card,
.process-card {
    background: rgba(15, 20, 40, 0.9) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.asset-card:hover,
.process-card:hover {
    border-color: #00d4ff !important;
    box-shadow:
        0 8px 25px rgba(102, 126, 234, 0.4),
        0 0 30px rgba(0, 212, 255, 0.3) !important;
}

/* Criticality and priority badges */
.criticality-badge {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3) !important;
}
