/* Enterprise Minimalist UI Styles - Ziti Unified Theme */
:root {
    /* Primary Colors - Aligned with Ziti Unified SSO */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #0891b2;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    
    /* Ziti Accent Colors - Cyan & Purple from SSO theme */
    --ziti-cyan-50: #ecfeff;
    --ziti-cyan-100: #cffafe;
    --ziti-cyan-200: #a5f3fc;
    --ziti-cyan-300: #67e8f9;
    --ziti-cyan-400: #22d3ee;
    --ziti-cyan-500: #06b6d4;
    --ziti-cyan-600: #0891b2;
    --ziti-cyan-700: #0e7490;
    --ziti-cyan-800: #155e75;
    --ziti-cyan-900: #164e63;
    
    --ziti-purple-50: #faf5ff;
    --ziti-purple-100: #f3e8ff;
    --ziti-purple-200: #e9d5ff;
    --ziti-purple-300: #d8b4fe;
    --ziti-purple-400: #c084fc;
    --ziti-purple-500: #a855f7;
    --ziti-purple-600: #9333ea;
    --ziti-purple-700: #7c3aed;
    --ziti-purple-800: #6b21a8;
    --ziti-purple-900: #581c87;
    
    /* Gray Scale */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Design Tokens */
    --border-radius: 6px;
    --border-radius-lg: 8px;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Ziti Gradient */
    --ziti-gradient: linear-gradient(135deg, var(--ziti-cyan-500) 0%, var(--primary-color) 50%, var(--ziti-purple-600) 100%);
    --ziti-gradient-hover: linear-gradient(135deg, var(--ziti-cyan-600) 0%, var(--primary-hover) 50%, var(--ziti-purple-700) 100%);
    
    /* Focus Ring */
    --focus-ring: 0 0 0 2px var(--ziti-cyan-500), 0 0 0 4px rgba(6, 182, 212, 0.15);
    
    /* Z-Index management for proper stacking context */
    --z-index-dropdown: 1050;
    --z-index-modal: 1060;
    --z-index-popover: 1070;
    --z-index-tooltip: 1080;
    --z-index-fixed: 1030;
    --z-index-sticky: 1020;
}

/* Dark Theme Variables */
.theme-dark {
    --primary-color: #3b82f6;
    --secondary-color: #94a3b8;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-color: #0f172a;
    --dark-color: #f8fafc;
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --box-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Light Theme Variables (explicit) */
.theme-light {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #0891b2;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --border-radius: 6px;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Auto Theme - will be handled by JavaScript for system preference */
.theme-auto {
    /* Inherits from root by default, JavaScript will override based on system preference */
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: var(--gray-900);
    background-color: var(--gray-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

/* Logo Placeholder */
.logo-placeholder {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.logo-placeholder i {
    color: white !important;
}

/* Header Logo Enhancement - Further increased size from 40px to 48px */
.navbar-brand img {
    height: 48px; /* Further increased from 40px */
    margin-right: 14px; /* Adjusted spacing */
    vertical-align: middle;
}

/* Landing Page Logo */
.landing-logo {
    width: 180px; /* Increased from 450px */
    height: 80px; /* Increased from 200px */
    object-fit: contain;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.landing-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* Dark theme logo adjustments */
.theme-dark .landing-logo {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.theme-dark .landing-logo:hover {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* Mobile responsive logo */
@media (max-width: 768px) {
    .landing-logo {
        width: 140px; /* Slightly smaller on mobile */
        height: 60px; /* Slightly smaller on mobile */
    }
    
    /* Revert header logo to original size on mobile for better fit */
    .navbar-brand img {
        height: 32px;
        margin-right: 8px;
    }
}

@media (max-width: 576px) {
    .landing-logo {
        width: 120px; /* Smaller on very small screens */
        height: 50px; /* Smaller on very small screens */
    }
}

/* Navigation - Ziti Unified SSO Style */
.navbar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%) !important;
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(6, 182, 212, 0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.1rem;
    color: white !important;
}

.navbar-brand small {
    color: var(--ziti-cyan-300) !important;
}

.nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    margin: 0 4px;
    padding: 8px 16px !important;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--ziti-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover {
    color: white !important;
    background-color: rgba(6, 182, 212, 0.15);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link.active {
    color: var(--ziti-cyan-400) !important;
    background-color: rgba(6, 182, 212, 0.1);
}

.nav-link.active::after {
    width: 80%;
}

/* User dropdown in navigation */
.navbar .dropdown-toggle {
    color: white !important;
}

.navbar .dropdown-toggle small {
    color: var(--ziti-cyan-200) !important;
}

.navbar .dropdown-toggle:hover {
    color: white !important;
    background-color: rgba(6, 182, 212, 0.15);
}

/* Navbar text colors */
.navbar .text-light {
    color: rgba(255, 255, 255, 0.95) !important;
}

.navbar .opacity-75 {
    color: var(--ziti-cyan-200) !important;
    opacity: 1 !important;
}

/* Dropdown menu improvements */
.dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow-lg);
    border-radius: var(--border-radius);
    z-index: var(--z-index-dropdown) !important;
    position: absolute !important;
    background-color: white;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-700);
    text-align: left;
    list-style: none;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

/* Ensure card dropdown menus can break out of card constraints */
.card .dropdown-menu {
    position: absolute !important;
    z-index: var(--z-index-dropdown) !important;
}

/* Ensure dropdown containers have proper positioning context */
.dropdown,
.btn-group,
.dropend,
.dropstart,
.dropup {
    position: relative;
}

/* Fix for dropdowns in tables and cards */
.table .dropdown-menu,
.card .dropdown-menu,
.modal .dropdown-menu {
    z-index: var(--z-index-dropdown);
    position: absolute;
}

/* Enhanced dropdown positioning for better visibility */
.dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Fix dropdown menu positioning in scrollable containers */
.dropdown-menu[data-popper-placement] {
    top: 0;
    left: 0;
    margin-top: 0.125rem;
}

/* Enhanced dropdown positioning for button groups in tables */
.table-responsive {
    position: relative;
}

.table .btn-group .dropdown-menu,
.card .btn-group .dropdown-menu {
    z-index: var(--z-index-dropdown);
    position: absolute;
    min-width: 12rem;
}

/* Fix dropdowns in nested containers */
.modal .dropdown-menu,
.offcanvas .dropdown-menu,
.card .dropdown-menu {
    z-index: var(--z-index-dropdown);
    position: absolute;
}

/* Ensure dropdown toggle buttons have proper positioning */
.dropdown-toggle,
.btn-group .dropdown-toggle {
    position: relative;
}

/* Fix dropdown arrow positioning */
.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

/* Dropdown menu animation */
.dropdown-menu {
    animation: dropdown-fade-in 0.15s ease-out;
}

@keyframes dropdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fix dropdown visibility in scrollable areas */
.dropdown-menu {
    max-height: none;
    overflow: visible;
}

/* Ensure dropdowns are not clipped by parent containers */
.dropdown-menu {
    transform: translateZ(0);
}

/* Fix for dropdowns in fixed or sticky headers */
.navbar-fixed-top .dropdown-menu,
.navbar-sticky-top .dropdown-menu {
    z-index: var(--z-index-dropdown);
    position: absolute;
}

.dropdown-item {
    color: var(--gray-700);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--gray-50);
    color: var(--primary-color);
}

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

.dropdown-item.text-danger:hover {
    background-color: #fef2f2;
    color: #b91c1c !important;
}

.dropdown-header {
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* User Avatar */
.user-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

/* User avatar in navbar specifically */
.navbar .user-avatar {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

/* User avatar outside navbar (for other contexts) */
.card .user-avatar,
.dashboard .user-avatar {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    background: white;
    position: relative;
    z-index: 1;
    overflow: visible !important;
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

/* Elevate z-index for cards with open dropdowns */
.card:has(.dropdown.show),
.card:has(.dropdown-menu.show) {
    z-index: var(--z-index-dropdown) !important;
}

.card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    font-weight: 600;
    color: var(--gray-900);
    overflow: visible !important;
}

/* Ensure dropdown containers in card headers have proper positioning */
.card-header .dropdown {
    position: static;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    border: 1px solid transparent;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-md);
}

.btn:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn:active {
    transform: translateY(0);
}

/* Primary Button - Ziti Gradient Style */
.btn-primary {
    background: var(--ziti-gradient);
    border-color: transparent;
    color: white;
}

.btn-primary:hover {
    background: var(--ziti-gradient-hover);
    border-color: transparent;
    box-shadow: var(--box-shadow-md), 0 0 20px rgba(6, 182, 212, 0.3), 0 0 40px rgba(168, 85, 247, 0.2);
}

.btn-primary:focus {
    box-shadow: var(--focus-ring), 0 0 15px rgba(6, 182, 212, 0.25);
}

.btn-primary:active {
    background: linear-gradient(135deg, var(--ziti-cyan-700) 0%, var(--primary-dark) 50%, var(--ziti-purple-800) 100%);
}

.btn-success {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #047857;
    border-color: #047857;
}

.btn-danger {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-warning {
    background: var(--warning-color);
    border-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #b45309;
    border-color: #b45309;
}

.btn-info {
    background: var(--info-color);
    border-color: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #0e7490;
    border-color: #0e7490;
}

/* Outline button improvements for better visibility */
.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
    font-weight: 600;
}

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

.btn-outline-secondary {
    color: var(--gray-700);
    border-color: var(--gray-400);
    background-color: transparent;
    font-weight: 600;
}

.btn-outline-secondary:hover {
    background-color: var(--gray-700);
    border-color: var(--gray-700);
    color: white !important;
}

.btn-outline-success {
    color: #047857;
    border-color: #047857;
    background-color: transparent;
    font-weight: 600;
}

.btn-outline-success:hover {
    background-color: #047857;
    border-color: #047857;
    color: white !important;
}

.btn-outline-danger {
    color: #b91c1c;
    border-color: #b91c1c;
    background-color: transparent;
    font-weight: 600;
}

.btn-outline-danger:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
    color: white !important;
}

.btn-outline-warning {
    color: #b45309;
    border-color: #b45309;
    background-color: transparent;
    font-weight: 600;
}

.btn-outline-warning:hover {
    background-color: #b45309;
    border-color: #b45309;
    color: white !important;
}

.btn-outline-info {
    color: #0e7490;
    border-color: #0e7490;
    background-color: transparent;
    font-weight: 600;
}

.btn-outline-info:hover {
    background-color: #0e7490;
    border-color: #0e7490;
    color: white !important;
}

/* Dashboard Specific Styles */
.dashboard-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 60px rgba(6, 182, 212, 0.1);
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 10% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 50%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.dashboard-header h1,
.dashboard-header .h1 {
    color: white !important;
    position: relative;
    z-index: 1;
}

.dashboard-header p,
.dashboard-header span,
.dashboard-header small {
    color: rgba(255, 255, 255, 0.85) !important;
    position: relative;
    z-index: 1;
}

.dashboard-header .badge {
    position: relative;
    z-index: 1;
}

.dashboard-header i {
    color: var(--ziti-cyan-400);
}

/* Back Button Styling on Dark Backgrounds (Dashboard Header) */
/* These styles ensure buttons are visible on the dark gradient background */
.dashboard-header .btn,
.dashboard-header .btn-group .btn {
    position: relative;
    z-index: 1;
}

.dashboard-header .btn-outline-secondary {
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    background-color: transparent !important;
}

.dashboard-header .btn-outline-secondary:hover {
    color: #0f172a !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-color: white !important;
}

.dashboard-header .btn-outline-secondary:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3), 0 0 0 4px rgba(6, 182, 212, 0.2) !important;
}

.dashboard-header .btn-outline-secondary i {
    color: inherit !important;
}

.dashboard-header .btn-outline-primary {
    color: var(--ziti-cyan-300) !important;
    border-color: var(--ziti-cyan-400) !important;
    background-color: transparent !important;
}

.dashboard-header .btn-outline-primary:hover {
    color: #0f172a !important;
    background-color: var(--ziti-cyan-400) !important;
    border-color: var(--ziti-cyan-400) !important;
}

.dashboard-header .btn-outline-primary:focus {
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.3), 0 0 0 4px rgba(6, 182, 212, 0.15) !important;
}

.dashboard-header .btn-outline-primary i {
    color: inherit !important;
}

.dashboard-header .btn-outline-danger {
    color: #fca5a5 !important;
    border-color: #f87171 !important;
    background-color: transparent !important;
}

.dashboard-header .btn-outline-danger:hover {
    color: white !important;
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
}

.dashboard-header .btn-outline-success {
    color: #86efac !important;
    border-color: #4ade80 !important;
    background-color: transparent !important;
}

.dashboard-header .btn-outline-success:hover {
    color: white !important;
    background-color: #16a34a !important;
    border-color: #16a34a !important;
}

.dashboard-header .btn-outline-warning {
    color: #fcd34d !important;
    border-color: #fbbf24 !important;
    background-color: transparent !important;
}

.dashboard-header .btn-outline-warning:hover {
    color: #0f172a !important;
    background-color: #fbbf24 !important;
    border-color: #fbbf24 !important;
}

.dashboard-header .btn-outline-info {
    color: #67e8f9 !important;
    border-color: #22d3ee !important;
    background-color: transparent !important;
}

.dashboard-header .btn-outline-info:hover {
    color: #0f172a !important;
    background-color: #22d3ee !important;
    border-color: #22d3ee !important;
}

/* Solid buttons in dashboard header */
.dashboard-header .btn-primary {
    background: var(--ziti-gradient) !important;
    border-color: transparent !important;
    color: white !important;
}

.dashboard-header .btn-primary:hover {
    background: var(--ziti-gradient-hover) !important;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4) !important;
}

.dashboard-header .btn-secondary {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

.dashboard-header .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: white !important;
}

/* Button group styling in dashboard header */
.dashboard-header .btn-group {
    position: relative;
    z-index: 1;
}

.dashboard-header .btn-group .btn + .btn {
    margin-left: -1px;
}

/* Ensure icons inside buttons inherit color */
.dashboard-header .btn i,
.dashboard-header .btn-group .btn i {
    color: inherit !important;
}

.dashboard-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    border-image: var(--ziti-gradient);
    border-image-slice: 1;
}

.dashboard-card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.stat-card {
    text-align: center;
    padding: 2rem 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    color: var(--secondary-color);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* Quick Actions */
.quick-actions {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.quick-action-btn {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--dark-color);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    margin-bottom: 0.5rem;
}

.quick-action-btn:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
    transform: translateX(5px);
    text-decoration: none;
}

.quick-action-btn i {
    width: 20px;
    margin-right: 0.75rem;
    color: var(--primary-color);
}

/* Tables */
.table {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.table-responsive {
    overflow: visible;
}

.table-responsive .dropdown-menu {
    position: absolute;
    z-index: 1050;
}

.card-header .dropdown {
    position: static;
}

.card {
    overflow: visible !important;
}

.table thead th {
    background: var(--gray-50);
    border: none;
    font-weight: 600;
    color: var(--gray-900);
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-300);
    transition: all 0.15s ease-in-out;
    font-weight: 500;
    color: var(--gray-900);
    background-color: white;
    min-height: 2.5rem;
}

.form-control:focus {
    border-color: var(--ziti-cyan-500);
    box-shadow: var(--focus-ring);
    color: var(--gray-900);
    background-color: white;
    outline: none;
}

.form-control::placeholder {
    color: var(--gray-500);
    opacity: 1;
}

.form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-300);
    transition: all 0.15s ease-in-out;
    font-weight: 500;
    color: var(--gray-900);
    background-color: white;
    min-height: 2.5rem;
}

.form-select:focus {
    border-color: var(--ziti-cyan-500);
    box-shadow: var(--focus-ring);
    color: var(--gray-900);
    background-color: white;
    outline: none;
}

.form-check-input:focus {
    border-color: var(--ziti-cyan-500);
    box-shadow: var(--focus-ring);
    outline: none;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-label {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

/* Links - Ziti Cyan Style */
a {
    color: var(--ziti-cyan-600);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover {
    color: var(--ziti-cyan-700);
    text-decoration: underline;
}

/* Preserve specific link colors */
.text-primary a,
a.text-primary {
    color: var(--primary-color);
}

.text-danger a,
a.text-danger {
    color: var(--danger-color);
}

.btn a,
a.btn {
    text-decoration: none;
}

/* Navbar links override - exclude dropdown items */
.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    text-decoration: none;
}

/* Dropdown menu items must have dark text on light background */
.navbar .dropdown-menu .dropdown-item,
.dropdown-menu .dropdown-item {
    color: var(--gray-700) !important;
    background-color: transparent !important;
}

.navbar .dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:hover {
    color: var(--primary-color) !important;
    background-color: var(--gray-50) !important;
    text-decoration: none;
}

.navbar .dropdown-menu .dropdown-item.text-danger,
.dropdown-menu .dropdown-item.text-danger {
    color: var(--danger-color) !important;
}

.navbar .dropdown-menu .dropdown-item.text-danger:hover,
.dropdown-menu .dropdown-item.text-danger:hover {
    background-color: #fef2f2 !important;
    color: #b91c1c !important;
}

/* Text color improvements */
.text-muted {
    color: var(--gray-600) !important;
}

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

.text-success {
    color: #047857 !important;
}

.text-danger {
    color: #b91c1c !important;
}

.text-warning {
    color: #b45309 !important;
}

.text-info {
    color: #0e7490 !important;
}

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

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

.text-light {
    color: var(--gray-100) !important;
}

/* Improved readability for small text */
small, .small {
    color: var(--gray-600);
    font-weight: 500;
}

/* Alert improvements */
.alert {
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    font-weight: 500;
}

.alert-success {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #fed7aa;
    color: #b45309;
}

.alert-info {
    background-color: #f0f9ff;
    border-color: #bae6fd;
    color: #0e7490;
}

.alert-primary {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.alert-secondary {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: var(--gray-700);
}

/* Badges */
.badge {
    font-weight: 600;
    border-radius: 20px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Badge color improvements for better contrast */
.badge.bg-success {
    background-color: #047857 !important;
    color: white !important;
}

.badge.bg-primary {
    background-color: #1d4ed8 !important;
    color: white !important;
}

.badge.bg-warning {
    background-color: #b45309 !important;
    color: white !important;
}

.badge.bg-danger {
    background-color: #b91c1c !important;
    color: white !important;
}

.badge.bg-info {
    background-color: #0e7490 !important;
    color: white !important;
}

.badge.bg-secondary {
    background-color: #475569 !important;
    color: white !important;
}

/* Additional badge color definitions for CR roles */
.badge.bg-orange {
    background-color: #f97316 !important;
    color: white !important;
}

.badge.bg-purple {
    background-color: #9333ea !important;
    color: white !important;
}

.badge.bg-teal {
    background-color: #14b8a6 !important;
    color: white !important;
}

/* Ensure text-white is properly defined for badges */
.badge.text-white {
    color: white !important;
}

.badge.bg-outline-secondary {
    background-color: transparent !important;
    color: var(--gray-700) !important;
    border: 1px solid var(--gray-400) !important;
    font-weight: 600;
}

/* Status Indicators */
.status-active {
    color: var(--success-color);
}

.status-inactive {
    color: var(--secondary-color);
}

.status-pending {
    color: var(--warning-color);
}

.status-error {
    color: var(--danger-color);
}

/* Welcome Page */
.welcome-hero {
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-900);
    padding: 4rem 2rem;
    text-align: center;
    border-radius: var(--border-radius);
    margin-bottom: 3rem;
    box-shadow: var(--box-shadow);
}

.welcome-hero h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.welcome-hero p {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.feature-card {
    text-align: left;
    padding: 1.5rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.2s ease;
    height: 100%;
}

.feature-card:hover {
    box-shadow: var(--box-shadow-md);
    border-color: var(--gray-300);
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(59, 130, 246, 0.1) 50%, rgba(148, 85, 247, 0.1) 100%);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    color: var(--ziti-cyan-600);
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(59, 130, 246, 0.2) 50%, rgba(148, 85, 247, 0.2) 100%);
    border-color: var(--ziti-cyan-500);
    transform: scale(1.1);
}

/* Hero Section Enhancements */
.hero-sparkle {
    color: var(--ziti-cyan-500);
    font-size: 1.5rem;
    animation: sparkle 2s ease-in-out infinite;
    margin-bottom: 0.5rem;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.hero-cta {
    position: relative;
    overflow: hidden;
}

.hero-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.hero-cta:hover::before {
    left: 100%;
}

/* Call to Action Section - Ziti Unified SSO Theme */
.cta-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 60px rgba(6, 182, 212, 0.15);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-icon {
    width: 80px;
    height: 80px;
    background: var(--ziti-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4), 0 4px 20px rgba(168, 85, 247, 0.3);
    animation: cta-pulse 3s ease-in-out infinite;
}

.cta-icon i {
    font-size: 2rem;
    color: white;
}

@keyframes cta-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4), 0 4px 20px rgba(168, 85, 247, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 8px 30px rgba(6, 182, 212, 0.5), 0 8px 30px rgba(168, 85, 247, 0.4);
    }
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.75) !important;
}

.cta-btn-primary {
    background: white !important;
    color: #0f172a !important;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

.cta-btn-primary:hover {
    background: var(--ziti-cyan-100) !important;
    color: var(--ziti-cyan-800) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

.cta-btn-secondary {
    background: transparent !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: white !important;
    color: white !important;
    transform: translateY(-2px);
}

/* Dark Theme CTA adjustments */
.theme-dark .cta-section {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 50%, var(--gray-100) 100%);
    border-color: var(--gray-300);
    box-shadow: var(--box-shadow-lg);
}

.theme-dark .cta-section::before {
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
}

.theme-dark .cta-section h2 {
    color: var(--gray-900) !important;
}

.theme-dark .cta-section .text-white-75 {
    color: var(--gray-700) !important;
}

.theme-dark .cta-btn-primary {
    background: var(--ziti-gradient) !important;
    color: white !important;
}

.theme-dark .cta-btn-primary:hover {
    background: var(--ziti-gradient-hover) !important;
    color: white !important;
}

.theme-dark .cta-btn-secondary {
    background: transparent !important;
    color: var(--gray-800) !important;
    border: 2px solid var(--gray-400) !important;
}

.theme-dark .cta-btn-secondary:hover {
    background: var(--gray-200) !important;
    border-color: var(--gray-500) !important;
    color: var(--gray-900) !important;
}

/* Footer */
.footer {
    margin-top: auto;
    background: white !important;
    border-top: 1px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1.5rem;
        text-align: center;
    }
    
    .welcome-hero h1 {
        font-size: 2rem;
    }
    
    .welcome-hero p {
        font-size: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Tab Navigation Fixes */
.nav-tabs .nav-link {
    color: var(--gray-700) !important;
    background-color: transparent;
    border: 1px solid transparent;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--gray-50);
    border-color: var(--gray-200);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color) !important;
    background-color: white !important;
    border-color: var(--gray-200) var(--gray-200) white !important;
    font-weight: 700;
}

/* Ensure tab buttons are always visible */
.card-header-tabs .nav-link {
    color: var(--gray-700) !important;
    background-color: var(--gray-50) !important;
    border: 1px solid var(--gray-200) !important;
    margin-right: 4px;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

.card-header-tabs .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
}

.card-header-tabs .nav-link.active {
    color: var(--primary-color) !important;
    background-color: white !important;
    border-color: var(--gray-200) var(--gray-200) white !important;
    border-bottom: 1px solid white !important;
    position: relative;
    z-index: 1;
}

/* Dark Theme Specific Styles */
body.theme-dark {
    background-color: var(--gray-50) !important;
    color: var(--gray-900) !important;
}

/* Dark theme text colors - Enhanced specificity */
.theme-dark,
.theme-dark body,
.theme-dark .card,
.theme-dark .card-header,
.theme-dark .card-body,
.theme-dark .card-footer,
.theme-dark .form-control,
.theme-dark .form-select,
.theme-dark .form-label,
.theme-dark .form-text,
.theme-dark .text-muted,
.theme-dark .text-primary,
.theme-dark .text-secondary,
.theme-dark .text-dark,
.theme-dark .text-info,
.theme-dark .text-success,
.theme-dark .text-warning,
.theme-dark .text-danger,
.theme-dark h1, .theme-dark h2, .theme-dark h3, .theme-dark h4, .theme-dark h5, .theme-dark h6,
.theme-dark p, .theme-dark span, .theme-dark div, .theme-dark small,
.theme-dark .btn,
.theme-dark .dropdown-item,
.theme-dark .nav-link,
.theme-dark .navbar-brand,
.theme-dark .table,
.theme-dark .alert,
.theme-dark .modal-content,
.theme-dark .modal-header,
.theme-dark .modal-body,
.theme-dark .modal-footer,
.theme-dark .offcanvas,
.theme-dark .toast,
.theme-dark .popover,
.theme-dark .tooltip {
    color: var(--gray-900) !important;
}

/* Enhanced dark theme for better contrast */
.theme-dark .text-muted {
    color: var(--gray-600) !important;
}

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

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

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

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

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

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

.theme-dark .text-dark {
    color: var(--gray-900) !important;
}

.theme-dark .text-light {
    color: var(--gray-300) !important;
}

.theme-dark .card {
    background-color: var(--gray-100);
    border: 1px solid var(--gray-200);
}

.theme-dark .card-header {
    background-color: var(--gray-200);
    border-bottom: 1px solid var(--gray-300);
    color: var(--gray-900);
}

/* Dark theme navbar - Always uses light text on dark background */
/* The navbar maintains its dark SSO-style gradient regardless of theme */
.theme-dark .navbar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%) !important;
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
}

/* Navbar text must always be light/white for visibility on dark navbar */
.theme-dark .navbar-brand,
.theme-dark .navbar-brand small,
.theme-dark .nav-link,
.theme-dark .navbar .dropdown-toggle,
.theme-dark .navbar .dropdown-toggle small,
.theme-dark .navbar .text-light,
.theme-dark .navbar .user-avatar,
.theme-dark .navbar .navbar-nav .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
}

.theme-dark .navbar-brand small {
    color: #67e8f9 !important; /* Cyan-300 for accent */
}

.theme-dark .navbar .dropdown-toggle small {
    color: #a5f3fc !important; /* Cyan-200 for accent */
}

.theme-dark .nav-link:hover {
    background-color: rgba(6, 182, 212, 0.15);
    color: #ffffff !important;
}

.theme-dark .nav-link.active {
    color: #22d3ee !important; /* Cyan-400 */
    background-color: rgba(6, 182, 212, 0.1);
}

/* Dark theme user avatar in navbar */
.theme-dark .navbar .user-avatar {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.theme-dark .navbar .user-avatar i {
    color: rgba(255, 255, 255, 0.9) !important;
}

.theme-dark .dropdown-menu {
    background-color: var(--gray-100);
    border: 1px solid var(--gray-200);
}

.theme-dark .dropdown-item {
    color: var(--gray-900);
}

.theme-dark .dropdown-item:hover {
    background-color: var(--gray-200);
    color: var(--primary-color);
}

.theme-dark .dropdown-header {
    color: var(--gray-600);
}

.theme-dark .form-control,
.theme-dark .form-select {
    background-color: var(--gray-100);
    border: 1px solid var(--gray-300);
    color: var(--gray-900);
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus {
    background-color: var(--gray-100);
    border-color: var(--primary-color);
    color: var(--gray-900);
}

.theme-dark .form-control::placeholder {
    color: var(--gray-500);
}

.theme-dark .table {
    background-color: var(--gray-100);
}

.theme-dark .table thead th {
    background-color: var(--gray-200);
    color: var(--gray-900);
}

.theme-dark .table tbody tr:hover {
    background-color: var(--gray-200);
}

.theme-dark .footer {
    background-color: var(--gray-100) !important;
    border-top: 1px solid var(--gray-200);
}

.theme-dark .footer .text-muted {
    color: var(--gray-600) !important;
}

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

.theme-dark .welcome-hero {
    background-color: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-900);
}

.theme-dark .feature-card {
    background-color: var(--gray-100);
    border: 1px solid var(--gray-200);
}

.theme-dark .feature-icon {
    background-color: var(--gray-200);
    border: 1px solid var(--gray-300);
}

.theme-dark .dashboard-header {
    background-color: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-900);
}

.theme-dark .dashboard-card {
    background-color: var(--gray-100);
}

.theme-dark .quick-actions {
    background-color: var(--gray-100);
}

.theme-dark .quick-action-btn {
    background-color: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-900);
}

.theme-dark .quick-action-btn:hover {
    background-color: var(--gray-200);
    color: var(--primary-color);
}

.theme-dark .alert-success {
    background-color: #064e3b;
    border-color: #047857;
    color: #34d399;
}

.theme-dark .alert-danger {
    background-color: #7f1d1d;
    border-color: #b91c1c;
    color: #f87171;
}

.theme-dark .alert-warning {
    background-color: #78350f;
    border-color: #b45309;
    color: #fbbf24;
}

.theme-dark .alert-info {
    background-color: #075985;
    border-color: #0e7490;
    color: #38bdf8;
}

.theme-dark .alert-primary {
    background-color: #1e3a8a;
    border-color: #1d4ed8;
    color: #60a5fa;
}

.theme-dark .alert-secondary {
    background-color: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-900);
}

/* Tab Navigation Dark Theme */
.theme-dark .nav-tabs .nav-link {
    color: var(--gray-700) !important;
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-200) !important;
}

.theme-dark .nav-tabs .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--gray-200) !important;
    border-color: var(--gray-300) !important;
}

.theme-dark .nav-tabs .nav-link.active {
    color: var(--primary-color) !important;
    background-color: var(--gray-100) !important;
    border-color: var(--gray-200) var(--gray-200) var(--gray-100) !important;
}

.theme-dark .card-header-tabs .nav-link {
    color: var(--gray-700) !important;
    background-color: var(--gray-200) !important;
    border: 1px solid var(--gray-300) !important;
}

.theme-dark .card-header-tabs .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--gray-300) !important;
    border-color: var(--gray-400) !important;
}

.theme-dark .card-header-tabs .nav-link.active {
    color: var(--primary-color) !important;
    background-color: var(--gray-100) !important;
    border-color: var(--gray-200) var(--gray-200) var(--gray-100) !important;
    border-bottom: 1px solid var(--gray-100) !important;
}

/* Enhanced Bootstrap Overrides for Dark Theme */
.theme-dark .badge {
    color: white !important;
}

.theme-dark .badge.bg-primary {
    background-color: var(--primary-color) !important;
}

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

.theme-dark .badge.bg-success {
    background-color: var(--success-color) !important;
}

.theme-dark .badge.bg-danger {
    background-color: var(--danger-color) !important;
}

.theme-dark .badge.bg-warning {
    background-color: var(--warning-color) !important;
}

.theme-dark .badge.bg-info {
    background-color: var(--info-color) !important;
}

.theme-dark .badge.bg-light {
    background-color: var(--gray-600) !important;
    color: white !important;
}

.theme-dark .badge.bg-dark {
    background-color: var(--gray-300) !important;
    color: var(--gray-900) !important;
}

/* Enhanced table dark theme */
.theme-dark .table {
    background-color: var(--gray-100) !important;
    color: var(--gray-900) !important;
}

.theme-dark .table thead th {
    background-color: var(--gray-200) !important;
    color: var(--gray-900) !important;
    border-color: var(--gray-300) !important;
}

.theme-dark .table tbody td {
    background-color: var(--gray-100) !important;
    color: var(--gray-900) !important;
    border-color: var(--gray-300) !important;
}

.theme-dark .table tbody tr:hover td {
    background-color: var(--gray-200) !important;
}

.theme-dark .table-striped tbody tr:nth-of-type(odd) td {
    background-color: var(--gray-150) !important;
}

.theme-dark .table-striped tbody tr:nth-of-type(odd):hover td {
    background-color: var(--gray-200) !important;
}

/* Enhanced button dark theme */
.theme-dark .btn {
    border-color: var(--gray-300) !important;
}

.theme-dark .btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.theme-dark .btn-outline-primary:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.theme-dark .btn-outline-secondary {
    color: var(--gray-700) !important;
    border-color: var(--gray-500) !important;
}

.theme-dark .btn-outline-secondary:hover {
    background-color: var(--gray-700) !important;
    border-color: var(--gray-700) !important;
    color: white !important;
}

.theme-dark .btn-outline-success {
    color: var(--success-color) !important;
    border-color: var(--success-color) !important;
}

.theme-dark .btn-outline-success:hover {
    background-color: var(--success-color) !important;
    color: white !important;
}

.theme-dark .btn-outline-danger {
    color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
}

.theme-dark .btn-outline-danger:hover {
    background-color: var(--danger-color) !important;
    color: white !important;
}

.theme-dark .btn-outline-warning {
    color: var(--warning-color) !important;
    border-color: var(--warning-color) !important;
}

.theme-dark .btn-outline-warning:hover {
    background-color: var(--warning-color) !important;
    color: white !important;
}

.theme-dark .btn-outline-info {
    color: var(--info-color) !important;
    border-color: var(--info-color) !important;
}

.theme-dark .btn-outline-info:hover {
    background-color: var(--info-color) !important;
    color: white !important;
}

/* Enhanced form dark theme */
.theme-dark .form-control,
.theme-dark .form-select,
.theme-dark .form-check-input {
    background-color: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus,
.theme-dark .form-check-input:focus {
    background-color: var(--gray-100) !important;
    border-color: var(--primary-color) !important;
    color: var(--gray-900) !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25) !important;
}

.theme-dark .form-control::placeholder {
    color: var(--gray-500) !important;
}

.theme-dark .form-text {
    color: var(--gray-600) !important;
}

.theme-dark .form-check-label {
    color: var(--gray-900) !important;
}

/* Enhanced modal dark theme */
.theme-dark .modal-content {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .modal-header {
    background-color: var(--gray-200) !important;
    border-bottom: 1px solid var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .modal-footer {
    background-color: var(--gray-100) !important;
    border-top: 1px solid var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .modal-body {
    background-color: var(--gray-100) !important;
    color: var(--gray-900) !important;
}

/* Enhanced dropdown dark theme */
.theme-dark .dropdown-menu {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-300) !important;
    box-shadow: var(--box-shadow-lg) !important;
    z-index: var(--z-index-dropdown) !important;
    position: absolute !important;
}

.theme-dark .dropdown-item {
    color: var(--gray-900) !important;
    background-color: transparent !important;
}

.theme-dark .dropdown-item:hover {
    background-color: var(--gray-200) !important;
    color: var(--primary-color) !important;
}

.theme-dark .dropdown-header {
    color: var(--gray-700) !important;
    background-color: var(--gray-100) !important;
}

/* Dark theme fixes for dropdowns in specific containers */
.theme-dark .table .dropdown-menu,
.theme-dark .card .dropdown-menu,
.theme-dark .modal .dropdown-menu,
.theme-dark .btn-group .dropdown-menu {
    z-index: var(--z-index-dropdown) !important;
    position: absolute !important;
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-300) !important;
}

/* Dark theme dropdown animation */
.theme-dark .dropdown-menu {
    animation: dropdown-fade-in-dark 0.15s ease-out;
}

@keyframes dropdown-fade-in-dark {
    from {
        opacity: 0;
        transform: translateY(-10px);
        background-color: var(--gray-100);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        background-color: var(--gray-100);
    }
}

/* Enhanced pagination dark theme */
.theme-dark .pagination .page-link {
    background-color: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .pagination .page-link:hover {
    background-color: var(--gray-200) !important;
    border-color: var(--gray-400) !important;
    color: var(--primary-color) !important;
}

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

/* Enhanced list group dark theme */
.theme-dark .list-group-item {
    background-color: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .list-group-item:hover {
    background-color: var(--gray-200) !important;
}

/* Enhanced breadcrumb dark theme */
.theme-dark .breadcrumb {
    background-color: var(--gray-100) !important;
}

.theme-dark .breadcrumb-item {
    color: var(--gray-700) !important;
}

.theme-dark .breadcrumb-item.active {
    color: var(--gray-500) !important;
}

/* Enhanced progress bar dark theme */
.theme-dark .progress {
    background-color: var(--gray-300) !important;
}

.theme-dark .progress-bar {
    background-color: var(--primary-color) !important;
}

/* Enhanced accordion dark theme */
.theme-dark .accordion-item {
    background-color: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
}

.theme-dark .accordion-button {
    background-color: var(--gray-200) !important;
    color: var(--gray-900) !important;
    border-color: var(--gray-300) !important;
}

.theme-dark .accordion-button:not(.collapsed) {
    background-color: var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25) !important;
}

.theme-dark .accordion-body {
    background-color: var(--gray-100) !important;
    color: var(--gray-900) !important;
}

/* Enhanced card dark theme for all card variants */
.theme-dark .card,
.theme-dark .card-body,
.theme-dark .card-header,
.theme-dark .card-footer {
    background-color: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .card.border-primary {
    border-color: var(--primary-color) !important;
}

.theme-dark .card.border-success {
    border-color: var(--success-color) !important;
}

.theme-dark .card.border-danger {
    border-color: var(--danger-color) !important;
}

.theme-dark .card.border-warning {
    border-color: var(--warning-color) !important;
}

.theme-dark .card.border-info {
    border-color: var(--info-color) !important;
}

.theme-dark .card.border-secondary {
    border-color: var(--gray-500) !important;
}

/* Enhanced avatar and user elements dark theme */
.theme-dark .avatar-sm,
.theme-dark .user-avatar {
    background-color: var(--gray-200) !important;
    border-color: var(--gray-300) !important;
    color: var(--gray-700) !important;
}

.theme-dark .avatar-sm i,
.theme-dark .user-avatar i {
    color: var(--gray-700) !important;
}

/* Enhanced code and pre elements dark theme */
.theme-dark code,
.theme-dark pre {
    background-color: var(--gray-200) !important;
    color: var(--gray-900) !important;
    border-color: var(--gray-300) !important;
}

.theme-dark pre {
    background-color: var(--gray-150) !important;
}

/* Enhanced blockquote dark theme */
.theme-dark blockquote {
    border-left-color: var(--gray-500) !important;
    color: var(--gray-700) !important;
}

.theme-dark blockquote p {
    color: var(--gray-700) !important;
}

/* Enhanced figure and images dark theme */
.theme-dark figure {
    color: var(--gray-700) !important;
}

.theme-dark figure figcaption {
    color: var(--gray-600) !important;
}

/* Profile page specific dark theme fixes */
.theme-dark .avatar-lg {
    background-color: var(--gray-200) !important;
    border: 1px solid var(--gray-300) !important;
    color: var(--gray-700) !important;
}

.theme-dark .avatar-lg i {
    color: var(--gray-700) !important;
}

/* Settings page specific dark theme fixes */
.theme-dark .form-check-input {
    background-color: var(--gray-200) !important;
    border-color: var(--gray-400) !important;
}

.theme-dark .form-check-input:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.theme-dark .form-check-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25) !important;
}

.theme-dark .form-check-label {
    color: var(--gray-900) !important;
}

.theme-dark .form-check-label strong {
    color: var(--gray-900) !important;
}

/* Dashboard specific dark theme fixes */
.theme-dark .stat-number {
    color: var(--primary-color) !important;
}

.theme-dark .stat-number[style*="color: var(--success-color)"] {
    color: var(--success-color) !important;
}

.theme-dark .stat-number[style*="color: var(--warning-color)"] {
    color: var(--warning-color) !important;
}

.theme-dark .stat-number[style*="color: var(--info-color)"] {
    color: var(--info-color) !important;
}

.theme-dark .feature-icon {
    background-color: var(--gray-200) !important;
    border: 1px solid var(--gray-300) !important;
    color: var(--primary-color) !important;
}

.theme-dark .feature-icon i {
    color: var(--primary-color) !important;
}

/* User management page specific fixes */
.theme-dark .avatar-sm {
    background-color: var(--gray-200) !important;
    border: 1px solid var(--gray-300) !important;
    color: var(--gray-700) !important;
}

.theme-dark .avatar-sm i {
    color: var(--gray-700) !important;
}

/* Service management page specific fixes */
.theme-dark code {
    background-color: var(--gray-200) !important;
    color: var(--gray-900) !important;
    border: 1px solid var(--gray-300) !important;
}

/* Customer management page specific fixes */
.theme-dark .border-end {
    border-color: var(--gray-300) !important;
}

/* Tickets page specific fixes */
.theme-dark .table-responsive {
    background-color: var(--gray-100) !important;
}

.theme-dark .table-light {
    background-color: var(--gray-200) !important;
    color: var(--gray-900) !important;
}

.theme-dark .table-light th {
    background-color: var(--gray-200) !important;
    color: var(--gray-900) !important;
    border-color: var(--gray-300) !important;
}

/* Alert container fixes for dark theme */
.theme-dark #alertContainer .alert {
    border-color: var(--gray-300) !important;
}

.theme-dark #alertContainer .alert-success {
    background-color: #064e3b !important;
    border-color: #047857 !important;
    color: #34d399 !important;
}

.theme-dark #alertContainer .alert-danger {
    background-color: #7f1d1d !important;
    border-color: #b91c1c !important;
    color: #f87171 !important;
}

.theme-dark #alertContainer .alert-warning {
    background-color: #78350f !important;
    border-color: #b45309 !important;
    color: #fbbf24 !important;
}

.theme-dark #alertContainer .alert-info {
    background-color: #075985 !important;
    border-color: #0e7490 !important;
    color: #38bdf8 !important;
}

/* Button group fixes */
.theme-dark .btn-group .btn {
    border-color: var(--gray-300) !important;
}

.theme-dark .btn-group .btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.theme-dark .btn-group .btn-outline-secondary {
    color: var(--gray-700) !important;
    border-color: var(--gray-500) !important;
}

.theme-dark .btn-group .btn-outline-success {
    color: var(--success-color) !important;
    border-color: var(--success-color) !important;
}

.theme-dark .btn-group .btn-outline-danger {
    color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
}

.theme-dark .btn-group .btn-outline-warning {
    color: var(--warning-color) !important;
    border-color: var(--warning-color) !important;
}

.theme-dark .btn-group .btn-outline-info {
    color: var(--info-color) !important;
    border-color: var(--info-color) !important;
}

/* Loading spinner fixes */
.theme-dark .spinner-border {
    border-color: var(--gray-300) !important;
    border-right-color: transparent !important;
}

.theme-dark .spinner-border-sm {
    border-color: var(--gray-300) !important;
    border-right-color: transparent !important;
}

/* Fade-in animation fixes */
.theme-dark .fade-in {
    opacity: 1;
}

/* Quick action button fixes */
.theme-dark .quick-action-btn {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-200) !important;
    color: var(--gray-900) !important;
}

.theme-dark .quick-action-btn:hover {
    background-color: var(--gray-200) !important;
    color: var(--primary-color) !important;
}

.theme-dark .quick-action-btn i {
    color: var(--primary-color) !important;
}

/* Form switch fixes */
.theme-dark .form-check-input[type="checkbox"] {
    background-color: var(--gray-300) !important;
    border-color: var(--gray-400) !important;
}

.theme-dark .form-check-input[type="checkbox"]:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.theme-dark .form-check-input[type="radio"] {
    background-color: var(--gray-200) !important;
    border-color: var(--gray-400) !important;
}

.theme-dark .form-check-input[type="radio"]:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Badge text fixes for better readability */
.theme-dark .badge {
    font-weight: 600 !important;
}

.theme-dark .badge.bg-light {
    background-color: var(--gray-600) !important;
    color: white !important;
}

.theme-dark .badge.bg-dark {
    background-color: var(--gray-300) !important;
    color: var(--gray-900) !important;
}

/* Customer card specific fixes */
.theme-dark .customer-card {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-200) !important;
}

.theme-dark .customer-card .card-header {
    background-color: var(--gray-200) !important;
    border-bottom: 1px solid var(--gray-300) !important;
}

.theme-dark .customer-card .card-body {
    background-color: var(--gray-100) !important;
}

.theme-dark .customer-card .card-footer {
    background-color: var(--gray-100) !important;
    border-top: 1px solid var(--gray-200) !important;
}

/* Service card specific fixes */
.theme-dark .service-card {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-200) !important;
}

.theme-dark .service-card .card-header {
    background-color: var(--gray-200) !important;
    border-bottom: 1px solid var(--gray-300) !important;
}

.theme-dark .service-card .card-body {
    background-color: var(--gray-100) !important;
}

/* User detail page fixes */
.theme-dark .user-detail-card {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-200) !important;
}

.theme-dark .user-detail-card .card-header {
    background-color: var(--gray-200) !important;
    border-bottom: 1px solid var(--gray-300) !important;
}

.theme-dark .user-detail-card .card-body {
    background-color: var(--gray-100) !important;
}

/* Ticket detail page fixes */
.theme-dark .ticket-detail-card {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-200) !important;
}

.theme-dark .ticket-detail-card .card-header {
    background-color: var(--gray-200) !important;
    border-bottom: 1px solid var(--gray-300) !important;
}

.theme-dark .ticket-detail-card .card-body {
    background-color: var(--gray-100) !important;
}

/* Comment section fixes */
.theme-dark .comment-section {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-200) !important;
}

.theme-dark .comment {
    background-color: var(--gray-150) !important;
    border: 1px solid var(--gray-250) !important;
}

.theme-dark .comment-header {
    background-color: var(--gray-200) !important;
    border-bottom: 1px solid var(--gray-300) !important;
}

.theme-dark .comment-body {
    background-color: var(--gray-150) !important;
}

/* Attachment fixes */
.theme-dark .attachment-list {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-200) !important;
}

.theme-dark .attachment-item {
    background-color: var(--gray-150) !important;
    border: 1px solid var(--gray-250) !important;
}

/* Search and filter fixes */
.theme-dark .search-container {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-200) !important;
}

.theme-dark .filter-container {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-200) !important;
}

/* Pagination fixes */
.theme-dark .pagination {
    background-color: var(--gray-100) !important;
}

.theme-dark .pagination .page-item {
    background-color: var(--gray-100) !important;
}

.theme-dark .pagination .page-item.disabled .page-link {
    background-color: var(--gray-200) !important;
    color: var(--gray-500) !important;
}

/* Breadcrumb fixes */
.theme-dark .breadcrumb {
    background-color: var(--gray-100) !important;
}

.theme-dark .breadcrumb-item + .breadcrumb-item::before {
    color: var(--gray-600) !important;
}

/* Progress fixes */
.theme-dark .progress {
    background-color: var(--gray-300) !important;
}

.theme-dark .progress-bar {
    background-color: var(--primary-color) !important;
}

/* List group fixes */
.theme-dark .list-group {
    background-color: var(--gray-100) !important;
}

.theme-dark .list-group-item {
    background-color: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
}

.theme-dark .list-group-item.active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

/* Accordion fixes */
.theme-dark .accordion {
    background-color: var(--gray-100) !important;
}

.theme-dark .accordion-item {
    background-color: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
}

.theme-dark .accordion-button {
    background-color: var(--gray-200) !important;
    color: var(--gray-900) !important;
}

.theme-dark .accordion-button:not(.collapsed) {
    background-color: var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .accordion-body {
    background-color: var(--gray-100) !important;
    color: var(--gray-900) !important;
}

/* Tooltip fixes */
.theme-dark .tooltip-inner {
    background-color: var(--gray-800) !important;
    color: var(--gray-100) !important;
}

.theme-dark .tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--gray-800) !important;
}

.theme-dark .tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: var(--gray-800) !important;
}

.theme-dark .tooltip.bs-tooltip-left .tooltip-arrow::before {
    border-left-color: var(--gray-800) !important;
}

.theme-dark .tooltip.bs-tooltip-right .tooltip-arrow::before {
    border-right-color: var(--gray-800) !important;
}

/* Popover fixes */
.theme-dark .popover {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-300) !important;
}

.theme-dark .popover-header {
    background-color: var(--gray-200) !important;
    border-bottom: 1px solid var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .popover-body {
    background-color: var(--gray-100) !important;
    color: var(--gray-900) !important;
}

/* Toast fixes */
.theme-dark .toast {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-300) !important;
}

.theme-dark .toast-header {
    background-color: var(--gray-200) !important;
    border-bottom: 1px solid var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .toast-body {
    background-color: var(--gray-100) !important;
    color: var(--gray-900) !important;
}

/* Offcanvas fixes */
.theme-dark .offcanvas {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-300) !important;
}

.theme-dark .offcanvas-header {
    background-color: var(--gray-200) !important;
    border-bottom: 1px solid var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .offcanvas-body {
    background-color: var(--gray-100) !important;
    color: var(--gray-900) !important;
}

/* Modal fixes for all modal types */
.theme-dark .modal.show {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

.theme-dark .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

/* Dropdown fixes for all dropdown types */
.theme-dark .dropdown-menu.show {
    background-color: var(--gray-100) !important;
    border: 1px solid var(--gray-300) !important;
}

.theme-dark .dropdown-divider {
    border-color: var(--gray-300) !important;
}

/* Navbar fixes for all navbar types */
.theme-dark .navbar-toggler {
    border-color: var(--gray-300) !important;
}

.theme-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(248, 250, 252, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Footer fixes */
.theme-dark .footer {
    background-color: var(--gray-100) !important;
    border-top: 1px solid var(--gray-200) !important;
    color: var(--gray-900) !important;
}

.theme-dark .footer .text-muted {
    color: var(--gray-600) !important;
}

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

.theme-dark .footer a {
    color: var(--primary-color) !important;
}

.theme-dark .footer a:hover {
    color: var(--primary-color) !important;
    opacity: 0.8;
}

/* General fixes for borders only on specific elements - removed overly broad selector */
.theme-dark .border,
.theme-dark .card,
.theme-dark .form-control,
.theme-dark .form-select,
.theme-dark .table,
.theme-dark .dropdown-menu,
.theme-dark .modal-content {
    border-color: var(--gray-300);
}

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

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

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

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

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

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

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

.theme-dark .text-dark {
    color: var(--gray-900) !important;
}

.theme-dark .text-light {
    color: var(--gray-300) !important;
}

.theme-dark .text-white {
    color: var(--gray-100) !important;
}

.theme-dark .bg-white {
    background-color: var(--gray-100) !important;
}

.theme-dark .bg-light {
    background-color: var(--gray-200) !important;
}

.theme-dark .bg-dark {
    background-color: var(--gray-800) !important;
}

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

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

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

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

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

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

/* Final comprehensive fixes */
.theme-dark .border {
    border-color: var(--gray-300) !important;
}

.theme-dark .border-top {
    border-top-color: var(--gray-300) !important;
}

.theme-dark .border-bottom {
    border-bottom-color: var(--gray-300) !important;
}

.theme-dark .border-left {
    border-left-color: var(--gray-300) !important;
}

.theme-dark .border-right {
    border-right-color: var(--gray-300) !important;
}

.theme-dark .shadow {
    box-shadow: var(--box-shadow) !important;
}

.theme-dark .shadow-sm {
    box-shadow: var(--box-shadow) !important;
}

.theme-dark .shadow-lg {
    box-shadow: var(--box-shadow-lg) !important;
}

.theme-dark .rounded {
    border-radius: var(--border-radius) !important;
}

.theme-dark .rounded-circle {
    border-radius: 50% !important;
}

.theme-dark .rounded-pill {
    border-radius: 50rem !important;
}

/* Change Request Specific Styles */
.cr-status-badge {
    font-weight: 600;
    border-radius: 20px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

.cr-status-submitted {
    background-color: #fd7e14 !important;
    color: white !important;
}

.cr-status-l1-approval {
    background-color: #0dcaf0 !important;
    color: white !important;
}

.cr-status-l2-approval {
    background-color: #0d6efd !important;
    color: white !important;
}

.cr-status-approved {
    background-color: #198754 !important;
    color: white !important;
}

.cr-status-rejected {
    background-color: #dc3545 !important;
    color: white !important;
}

.cr-status-implemented {
    background-color: #6f42c1 !important;
    color: white !important;
}

.cr-status-completed {
    background-color: #20c997 !important;
    color: white !important;
}

.cr-status-cancelled {
    background-color: #343a40 !important;
    color: white !important;
}

/* CR Priority Styles */
.cr-priority-critical {
    background-color: #dc3545 !important;
    color: white !important;
}

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

.cr-priority-medium {
    background-color: #0d6efd !important;
    color: white !important;
}

.cr-priority-low {
    background-color: #6c757d !important;
    color: white !important;
}

/* CR Action Buttons */
.cr-action-btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.cr-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-md);
}

/* CR Table Enhancements */
.cr-table {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.cr-table .table-responsive {
    overflow: visible;
}

.cr-table .table thead th {
    background: var(--gray-50);
    border: none;
    font-weight: 600;
    color: var(--gray-900);
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cr-table .table tbody tr {
    transition: all 0.2s ease;
}

.cr-table .table tbody tr:hover {
    background-color: var(--gray-50);
    transform: translateX(2px);
}

/* CR Statistics Cards */
.cr-stat-card {
    text-align: center;
    padding: 2rem 1rem;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.cr-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-lg);
}

.cr-stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

.cr-stat-label {
    color: var(--secondary-color);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* CR Filter Section */
.cr-filter-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.cr-filter-section .form-label {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

/* CR Modal Styles */
.cr-modal .modal-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.cr-modal .modal-title {
    font-weight: 600;
    color: var(--gray-900);
}

.cr-modal .form-label {
    font-weight: 600;
    color: var(--gray-900);
}

/* CR Progress Indicator */
.cr-progress {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--gray-200);
    margin: 1rem 0;
}

.cr-progress-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.cr-progress-draft { background-color: #6c757d; }
.cr-progress-submitted { background-color: #fd7e14; }
.cr-progress-l1-approval { background-color: #0dcaf0; }
.cr-progress-l2-approval { background-color: #0d6efd; }
.cr-progress-approved { background-color: #198754; }
.cr-progress-implemented { background-color: #6f42c1; }
.cr-progress-completed { background-color: #20c997; }

/* CR Workflow Steps */
.cr-workflow-steps {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    position: relative;
}

.cr-workflow-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.cr-workflow-step::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: var(--gray-300);
    z-index: -1;
}

.cr-workflow-step:last-child::before {
    display: none;
}

.cr-workflow-step.active::before {
    background: var(--primary-color);
}

.cr-workflow-step.completed::before {
    background: var(--success-color);
}

.cr-workflow-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gray-300);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.cr-workflow-step.active .cr-workflow-icon {
    background: var(--primary-color);
}

.cr-workflow-step.completed .cr-workflow-icon {
    background: var(--success-color);
}

.cr-workflow-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
}

.cr-workflow-step.active .cr-workflow-label {
    color: var(--primary-color);
    font-weight: 600;
}

.cr-workflow-step.completed .cr-workflow-label {
    color: var(--success-color);
    font-weight: 600;
}

/* CR Dark Theme Overrides */
.theme-dark .cr-stat-card {
    background-color: var(--gray-100);
    border-left-color: var(--primary-color);
}

.theme-dark .cr-filter-section {
    background-color: var(--gray-100);
}

.theme-dark .cr-table {
    background-color: var(--gray-100);
}

.theme-dark .cr-table .table thead th {
    background-color: var(--gray-200);
    color: var(--gray-900);
}

.theme-dark .cr-table .table tbody tr:hover td {
    background-color: var(--gray-200);
}

.theme-dark .cr-modal .modal-header {
    background-color: var(--gray-200);
    border-bottom-color: var(--gray-300);
}

.theme-dark .cr-progress {
    background-color: var(--gray-300);
}

.theme-dark .cr-workflow-step::before {
    background: var(--gray-400);
}

.theme-dark .cr-workflow-icon {
    background: var(--gray-400);
}

.theme-dark .cr-workflow-label {
    color: var(--gray-600);
}

/* CR Responsive Design */
@media (max-width: 768px) {
    .cr-workflow-steps {
        flex-direction: column;
        align-items: center;
    }
    
    .cr-workflow-step::before {
        top: 30px;
        left: 15px;
        right: auto;
        bottom: -30px;
        width: 2px;
        height: 60px;
    }
    
    .cr-workflow-step:last-child::before {
        display: none;
    }
    
    .cr-stat-number {
        font-size: 2rem;
    }
    
    .cr-filter-section .row > div {
        margin-bottom: 1rem;
    }
    
    .cr-table .btn-group {
        flex-direction: column;
    }
    
    .cr-table .btn-group .btn {
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 576px) {
    .cr-stat-card {
        padding: 1.5rem 0.75rem;
    }
    
    .cr-stat-number {
        font-size: 1.75rem;
    }
    
    .cr-workflow-label {
        font-size: 0.625rem;
    }
}

/* Flatpickr Date Picker Styling - Force proper display */
.flatpickr-calendar {
    background: white !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--box-shadow-lg) !important;
    font-family: inherit !important;
    color: var(--gray-900) !important;
    z-index: 9999 !important;
}

.flatpickr-calendar * {
    color: inherit;
}

/* Month/Year Header - CRITICAL: Ensure visibility */
.flatpickr-months {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: var(--gray-50) !important;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 8px !important;
    min-height: 50px !important;
}

.flatpickr-months .flatpickr-month {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    color: var(--gray-900) !important;
    fill: var(--gray-900) !important;
    height: 34px !important;
}

/* CRITICAL: Month/Year selector visibility fix */
.flatpickr-current-month {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--gray-900) !important;
    padding: 0 !important;
    width: auto !important;
    position: relative !important;
    left: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}

/* Month dropdown - ensure visible */
.flatpickr-current-month .flatpickr-monthDropdown-months {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    display: inline-block !important;
    min-width: 90px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: white !important;
    border: 1px solid var(--gray-300) !important;
    border-radius: var(--border-radius) !important;
    color: var(--gray-900) !important;
    padding: 4px 8px !important;
    cursor: pointer !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    border-color: var(--ziti-cyan-500) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: white !important;
    color: var(--gray-900) !important;
}

/* Year input wrapper - ensure visible */
.flatpickr-current-month .numInputWrapper {
    display: inline-flex !important;
    align-items: center !important;
    min-width: 70px !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

.flatpickr-current-month input.cur-year {
    display: inline-block !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: white !important;
    border: 1px solid var(--gray-300) !important;
    border-radius: var(--border-radius) !important;
    color: var(--gray-900) !important;
    padding: 4px 8px !important;
    width: 70px !important;
    cursor: text !important;
}

.flatpickr-current-month input.cur-year:hover,
.flatpickr-current-month input.cur-year:focus {
    border-color: var(--ziti-cyan-500) !important;
}

/* Year increment/decrement arrows */
.flatpickr-current-month .numInputWrapper span.arrowUp,
.flatpickr-current-month .numInputWrapper span.arrowDown {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: var(--gray-600) !important;
    cursor: pointer !important;
    padding: 0 4px !important;
    position: absolute !important;
    right: 0 !important;
    width: 14px !important;
    height: 50% !important;
    line-height: 50% !important;
    border: none !important;
}

.flatpickr-current-month .numInputWrapper span.arrowUp {
    top: 0 !important;
}

.flatpickr-current-month .numInputWrapper span.arrowDown {
    bottom: 0 !important;
}

.flatpickr-current-month .numInputWrapper span.arrowUp:hover,
.flatpickr-current-month .numInputWrapper span.arrowDown:hover {
    background: var(--gray-100) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--gray-600) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowDown:after {
    border-top-color: var(--gray-600) !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    fill: var(--gray-600) !important;
    color: var(--gray-600) !important;
    padding: 0.5rem !important;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    fill: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
    fill: inherit !important;
}

.flatpickr-weekdays {
    background: var(--gray-50) !important;
}

.flatpickr-weekday {
    background: transparent !important;
    color: var(--gray-600) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
}

.flatpickr-days {
    background: white !important;
    border: none !important;
}

.dayContainer {
    background: white !important;
}

.flatpickr-day {
    background: white !important;
    border: none !important;
    color: var(--gray-900) !important;
    font-weight: 500 !important;
    max-width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    border-radius: var(--border-radius) !important;
}

.flatpickr-day:hover {
    background: var(--gray-100) !important;
    border: none !important;
    color: var(--gray-900) !important;
}

.flatpickr-day.today {
    border: 2px solid var(--ziti-cyan-500) !important;
    background: transparent !important;
    color: var(--ziti-cyan-600) !important;
}

.flatpickr-day.today:hover {
    background: var(--ziti-cyan-50) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--ziti-gradient) !important;
    border: none !important;
    color: white !important;
}

.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: var(--ziti-gradient-hover) !important;
    color: white !important;
}

.flatpickr-day.inRange {
    background: var(--ziti-cyan-100) !important;
    color: var(--ziti-cyan-800) !important;
    box-shadow: none !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--gray-400) !important;
}

.flatpickr-day.disabled,
.flatpickr-day.disabled:hover {
    color: var(--gray-300) !important;
    background: transparent !important;
    cursor: not-allowed !important;
}

.flatpickr-time {
    background: var(--gray-50) !important;
    border-top: 1px solid var(--gray-200) !important;
}

.flatpickr-time input {
    background: white !important;
    border: 1px solid var(--gray-300) !important;
    color: var(--gray-900) !important;
    border-radius: var(--border-radius) !important;
}

.flatpickr-time input:focus {
    border-color: var(--ziti-cyan-500) !important;
    box-shadow: var(--focus-ring) !important;
}

.flatpickr-time .flatpickr-am-pm {
    background: white !important;
    border: 1px solid var(--gray-300) !important;
    color: var(--gray-900) !important;
    border-radius: var(--border-radius) !important;
}

.flatpickr-time .flatpickr-time-separator {
    color: var(--gray-600) !important;
}

/* Flatpickr Dark Theme */
.theme-dark .flatpickr-calendar {
    background: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
    color: var(--gray-900) !important;
}

.theme-dark .flatpickr-months {
    background: var(--gray-200) !important;
}

.theme-dark .flatpickr-current-month,
.theme-dark .flatpickr-current-month .flatpickr-monthDropdown-months,
.theme-dark .flatpickr-current-month input.cur-year {
    color: var(--gray-900) !important;
}

.theme-dark .flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: var(--gray-100) !important;
    color: var(--gray-900) !important;
}

.theme-dark .flatpickr-prev-month,
.theme-dark .flatpickr-next-month {
    fill: var(--gray-600) !important;
    color: var(--gray-600) !important;
}

.theme-dark .flatpickr-weekdays {
    background: var(--gray-200) !important;
}

.theme-dark .flatpickr-weekday {
    color: var(--gray-600) !important;
}

.theme-dark .flatpickr-days,
.theme-dark .dayContainer {
    background: var(--gray-100) !important;
}

.theme-dark .flatpickr-day {
    background: var(--gray-100) !important;
    color: var(--gray-900) !important;
}

.theme-dark .flatpickr-day:hover {
    background: var(--gray-200) !important;
    color: var(--gray-900) !important;
}

.theme-dark .flatpickr-day.today {
    border-color: var(--ziti-cyan-500) !important;
    color: var(--ziti-cyan-400) !important;
}

.theme-dark .flatpickr-day.today:hover {
    background: var(--gray-200) !important;
}

.theme-dark .flatpickr-day.prevMonthDay,
.theme-dark .flatpickr-day.nextMonthDay {
    color: var(--gray-500) !important;
}

.theme-dark .flatpickr-day.disabled {
    color: var(--gray-400) !important;
}

.theme-dark .flatpickr-time {
    background: var(--gray-200) !important;
    border-top-color: var(--gray-300) !important;
}

.theme-dark .flatpickr-time input,
.theme-dark .flatpickr-time .flatpickr-am-pm {
    background: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
    color: var(--gray-900) !important;
}

/* Print Styles */
@media print {
    .navbar, .footer, .btn, .quick-actions {
        display: none !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .cr-filter-section {
        display: none !important;
    }
    
    .cr-action-btn {
        display: none !important;
    }
}
