  /* ==========================================================================
   THEME SWITCHER - Royal Blue Luxury Theme
   Based on deep royal blue + gold color palette
   ========================================================================== */

/* ==========================================================================
   THEME VARIABLES
   ========================================================================== */

/* Default Theme Variables (Royal Dark Base) */
:root {
    --theme-bg-primary: #0a1628;
    --theme-bg-secondary: #0f1e36;
    --theme-bg-tertiary: #142847;
    --theme-bg-card: #152a4a;
    --theme-text-primary: #ffffff;
    --theme-text-secondary: #c0d0e8;
    --theme-text-muted: #8aa4c8;
    --theme-border-color: #1e4070;
    --theme-shadow: rgba(0, 0, 0, 0.3);
    --color-bg: #0a1628;
    --color-bg-secondary: #0f1e36;
    --color-text: #ffffff;
    --color-text-light: #c0d0e8;
    --site-background: #0a1628;
    --color-white: #152a4a;
    --color-gray-100: #0f1e36;
    --color-gray-200: #1e4070;
    --color-gray-300: #2a5090;
    --color-gray-400: #8aa4c8;
    --color-gray-500: #8aa4c8;
    --color-gray-600: #c0d0e8;
    --color-gray-700: #e0e0e0;
    --color-gray-800: #e0e0e0;
    --color-gray-900: #ffffff;
    --color-text-primary: #ffffff;
    --color-text-secondary: #c0d0e8;
    --color-text-muted: #8aa4c8;
    --color-bg-card: #152a4a;
    --color-bg-primary: #0a1628;
    --color-border: rgba(255, 215, 0, 0.1);
}

/* Explicit Light Theme */
html[data-theme="light"] {
    --theme-bg-primary: #f5f7fa;
    --theme-bg-secondary: #ffffff;
    --theme-bg-tertiary: #e8edf5;
    --theme-bg-card: #ffffff;
    --theme-text-primary: #1e3c72;
    --theme-text-secondary: #444444;
    --theme-text-muted: #666666;
    --theme-border-color: #e0e0e0;
    --theme-shadow: rgba(30, 60, 114, 0.1);
    --color-bg: #f5f7fa;
    --color-bg-secondary: #ffffff;
    --color-text: #1e3c72;
    --color-text-light: #444444;
    --site-background: #f5f7fa;
    --color-white: #ffffff;
    --color-gray-100: #f8f9fa;
    --color-gray-200: #e9ecef;
    --color-gray-300: #dee2e6;
    --color-gray-400: #ced4da;
    --color-gray-500: #adb5bd;
    --color-gray-600: #6c757d;
    --color-gray-700: #495057;
    --color-gray-800: #343a40;
    --color-gray-900: #212529;
    --color-text-primary: #212529;
    --color-text-secondary: #495057;
    --color-text-muted: #6c757d;
    --color-bg-card: #ffffff;
    --color-bg-primary: #f5f7fa;
    --color-border: #e0e0e0;
}

/* Royal Blue / Midnight Theme */
html[data-theme="royal"],
html.dark-mode {
    --theme-bg-primary: #0a1628;
    --theme-bg-secondary: #0f1e36;
    --theme-bg-tertiary: #142847;
    --theme-bg-card: #152a4a;
    --theme-text-primary: #ffffff;
    --theme-text-secondary: #c0d0e8;
    --theme-text-muted: #8aa4c8;
    --theme-border-color: #1e4070;
    --theme-shadow: rgba(0, 0, 0, 0.3);
    
    /* Override CSS custom properties */
    --color-bg: #0a1628;
    --color-bg-secondary: #0f1e36;
    --color-text: #ffffff;
    --color-text-light: #c0d0e8;
    --site-background: #0a1628;
    
    /* Override backend.css color vars for dark mode */
    --color-white: #152a4a;
    --color-gray-100: #0f1e36;
    --color-gray-200: #1e4070;
    --color-gray-300: #2a5090;
    --color-gray-400: #8aa4c8;
    --color-gray-500: #8aa4c8;
    --color-gray-600: #c0d0e8;
    --color-gray-700: #e0e0e0;
    --color-gray-800: #e0e0e0;
    --color-gray-900: #ffffff;
    --color-text-primary: #ffffff;
    --color-text-secondary: #c0d0e8;
    --color-text-muted: #8aa4c8;
    --color-bg-card: #152a4a;
    --color-bg-primary: #0a1628;
    --color-border: rgba(255, 215, 0, 0.1);
}

/* ==========================================================================
   ROYAL THEME STYLES
   ========================================================================== */

html[data-theme="royal"] body,
html.dark-mode body {
    background: linear-gradient(180deg, #0a1628 0%, #0f1e36 50%, #0a1628 100%) !important;
    background-attachment: fixed !important;
    color: var(--theme-text-primary) !important;
}

/* Header / Navigation */
html[data-theme="royal"] .header,
html.dark-mode .header {
    background: linear-gradient(180deg, #0a1628 0%, #0f1e36 100%) !important;
    border-bottom: 2px solid rgba(255, 215, 0, 0.25) !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 215, 0, 0.1) inset !important;
}

html[data-theme="royal"] .nav-container,
html.dark-mode .nav-container {
    background: transparent !important;
}

html[data-theme="royal"] .nav,
html.dark-mode .nav {
    background: transparent !important;
}

html[data-theme="royal"] .header .nav-link,
html[data-theme="royal"] .nav-links a,
html.dark-mode .header .nav-link,
html.dark-mode .nav-links a {
    color: #c0d0e8 !important;
    transition: all 0.2s ease !important;
}

html[data-theme="royal"] .header .nav-link:hover,
html[data-theme="royal"] .nav-links a:hover,
html.dark-mode .header .nav-link:hover,
html.dark-mode .nav-links a:hover {
    color: #FFD700 !important;
    background: rgba(255, 215, 0, 0.08) !important;
}

html[data-theme="royal"] .header .nav-link.active,
html[data-theme="royal"] .nav-links a.active,
html.dark-mode .header .nav-link.active,
html.dark-mode .nav-links a.active {
    color: #FFD700 !important;
    background: rgba(255, 215, 0, 0.12) !important;
}

/* Header Logo */
html[data-theme="royal"] .logo,
html.dark-mode .logo {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 215, 0, 0.2) !important;
}

html[data-theme="royal"] .logo:hover,
html.dark-mode .logo:hover {
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3), 0 0 0 1px rgba(255, 215, 0, 0.4) !important;
}

/* Header Account Dropdown */
html[data-theme="royal"] .account-dropdown,
html.dark-mode .account-dropdown {
    background: linear-gradient(180deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="royal"] .account-dropdown a,
html.dark-mode .account-dropdown a {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .account-dropdown a:hover,
html.dark-mode .account-dropdown a:hover {
    color: #FFD700 !important;
    background: rgba(255, 215, 0, 0.1) !important;
}

/* User Icon Button */
html[data-theme="royal"] .user-icon-btn,
html.dark-mode .user-icon-btn {
    color: #FFD700 !important;
    border-color: rgba(255, 215, 0, 0.3) !important;
    background: rgba(255, 215, 0, 0.08) !important;
}

html[data-theme="royal"] .user-icon-btn:hover,
html.dark-mode .user-icon-btn:hover {
    background: rgba(255, 215, 0, 0.15) !important;
    border-color: rgba(255, 215, 0, 0.5) !important;
}

/* Mega Menu */
html[data-theme="royal"] .mega-menu-dropdown,
html.dark-mode .mega-menu-dropdown {
    background: linear-gradient(180deg, #0f1e36 0%, #0a1628 100%) !important;
    border-top: 2px solid rgba(255, 215, 0, 0.25) !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="royal"] .mega-menu-section h6,
html.dark-mode .mega-menu-section h6 {
    color: #FFD700 !important;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2) !important;
}

html[data-theme="royal"] .mega-menu-section a,
html.dark-mode .mega-menu-section a {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .mega-menu-section a:hover,
html.dark-mode .mega-menu-section a:hover {
    color: #FFD700 !important;
    background: rgba(255, 215, 0, 0.08) !important;
}

/* Mobile Navigation Menu */
@media (max-width: 768px) {
    html[data-theme="royal"] .nav-links.nav-center,
    html.dark-mode .nav-links.nav-center {
        background: rgba(10, 22, 40, 0.98) !important;
    }
    
    html[data-theme="royal"] .nav-links .dropdown-menu,
    html.dark-mode .nav-links .dropdown-menu {
        background: rgba(0, 0, 0, 0.3) !important;
        border-left: 2px solid rgba(255, 215, 0, 0.3) !important;
        margin-left: 15px !important;
    }
    
    html[data-theme="royal"] .nav-links .dropdown-item,
    html.dark-mode .nav-links .dropdown-item {
        color: #c0d0e8 !important;
    }
    
    html[data-theme="royal"] .nav-links .dropdown-item:hover,
    html.dark-mode .nav-links .dropdown-item:hover {
        color: #FFD700 !important;
        background: rgba(255, 215, 0, 0.1) !important;
    }
    
    html[data-theme="royal"] .mobile-divider,
    html.dark-mode .mobile-divider {
        border-color: rgba(255, 215, 0, 0.2) !important;
    }
    
    /* Mobile Accessibility Panel */
    html[data-theme="royal"] .mobile-accessibility-panel,
    html.dark-mode .mobile-accessibility-panel {
        background: #0a1628 !important;
        border: 1px solid rgba(255, 215, 0, 0.15) !important;
        border-radius: 8px;
        margin: 10px 15px;
        padding: 15px !important;
    }
    
    html[data-theme="royal"] .accessibility-section,
    html.dark-mode .accessibility-section {
        border-color: rgba(255, 215, 0, 0.1) !important;
        padding: 10px 0;
    }
    
    html[data-theme="royal"] .accessibility-label,
    html.dark-mode .accessibility-label {
        color: #FFD700 !important;
        font-weight: 600;
    }
    
    html[data-theme="royal"] .font-btn,
    html.dark-mode .font-btn {
        background: #152a4a !important;
        border-color: #1e4070 !important;
        color: #c0d0e8 !important;
    }
    
    html[data-theme="royal"] .font-btn:hover,
    html.dark-mode .font-btn:hover {
        background: #1e4070 !important;
        color: #FFD700 !important;
        border-color: #FFD700 !important;
    }
    
    html[data-theme="royal"] .accessibility-switch .slider,
    html.dark-mode .accessibility-switch .slider {
        background: #1e4070 !important;
    }
    
    html[data-theme="royal"] .accessibility-switch input:checked + .slider,
    html.dark-mode .accessibility-switch input:checked + .slider {
        background: #FFD700 !important;
    }
    
    /* Mobile Language Selector */
    html[data-theme="royal"] .language-select-mobile,
    html.dark-mode .language-select-mobile {
        background: #0f1e36 !important;
        border: 1px solid #1e4070 !important;
        color: #ffffff !important;
        padding: 8px 12px;
        border-radius: 6px;
        width: 100%;
        font-size: 14px;
    }
    
    html[data-theme="royal"] .language-select-mobile option,
    html.dark-mode .language-select-mobile option {
        background: #0f1e36 !important;
        color: #ffffff !important;
    }
}

/* Cards & Panels */
html[data-theme="royal"] .card,
html[data-theme="royal"] .feature-card,
html[data-theme="royal"] .dashboard-card,
html[data-theme="royal"] .dash-card,
html[data-theme="royal"] .stat-box,
html.dark-mode .card,
html.dark-mode .feature-card,
html.dark-mode .dashboard-card,
html.dark-mode .dash-card,
html.dark-mode .stat-box {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}

html[data-theme="royal"] .card:hover,
html[data-theme="royal"] .feature-card:hover,
html.dark-mode .card:hover,
html.dark-mode .feature-card:hover {
    border-color: rgba(255, 215, 0, 0.25) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(255, 215, 0, 0.05) !important;
}

/* Titles & Headings */
html[data-theme="royal"] .card-title,
html[data-theme="royal"] .feature-title,
html[data-theme="royal"] .section-title,
html[data-theme="royal"] h1, 
html[data-theme="royal"] h2, 
html[data-theme="royal"] h3, 
html[data-theme="royal"] h4,
html.dark-mode .card-title,
html.dark-mode .feature-title,
html.dark-mode .section-title,
html.dark-mode h1, 
html.dark-mode h2, 
html.dark-mode h3, 
html.dark-mode h4 {
    color: #ffffff !important;
}

/* Gold Accent Titles */
html[data-theme="royal"] .dash-card-title,
html[data-theme="royal"] .stat-label,
html.dark-mode .dash-card-title,
html.dark-mode .stat-label {
    color: #c9a600 !important;
}

/* Stat Values */
html[data-theme="royal"] .stat-value,
html.dark-mode .stat-value {
    color: #FFD700 !important;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* Background Sections */
html[data-theme="royal"] .bg-light,
html[data-theme="royal"] .bg-white,
html.dark-mode .bg-light,
html.dark-mode .bg-white {
    background: #0f1e36 !important;
}

/* Footer */
html[data-theme="royal"] .footer,
html.dark-mode .footer {
    background: linear-gradient(180deg, #0a1628 0%, #050d18 100%) !important;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

/* Hero Sections */
html[data-theme="royal"] .hero-section,
html.dark-mode .hero-section {
    position: relative;
}

html[data-theme="royal"] .hero-section::before,
html.dark-mode .hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10, 22, 40, 0.85) 0%, rgba(15, 30, 54, 0.9) 100%);
    z-index: 1;
    pointer-events: none;
}

html[data-theme="royal"] .hero-section > *,
html.dark-mode .hero-section > * {
    position: relative;
    z-index: 2;
}

/* Buttons */
html[data-theme="royal"] .btn-royal,
html.dark-mode .btn-royal {
    background: linear-gradient(135deg, #c9a600 0%, #FFD700 50%, #c9a600 100%) !important;
    color: #0a1628 !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

html[data-theme="royal"] .btn-royal:hover,
html.dark-mode .btn-royal:hover {
    background: linear-gradient(135deg, #FFD700 0%, #ffe44d 50%, #FFD700 100%) !important;
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

html[data-theme="royal"] .btn-outline-royal,
html.dark-mode .btn-outline-royal {
    border: 2px solid #FFD700 !important;
    color: #FFD700 !important;
    background: transparent !important;
}

html[data-theme="royal"] .btn-outline-royal:hover,
html.dark-mode .btn-outline-royal:hover {
    background: rgba(255, 215, 0, 0.1) !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

html[data-theme="royal"] .btn-primary,
html.dark-mode .btn-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.2) !important;
}

html[data-theme="royal"] .btn-outline-primary,
html.dark-mode .btn-outline-primary {
    border-color: #2a5298 !important;
    color: #8aa4c8 !important;
}

/* Form Controls */
html[data-theme="royal"] input,
html[data-theme="royal"] textarea,
html[data-theme="royal"] select,
html[data-theme="royal"] .form-control,
html[data-theme="royal"] .form-select,
html.dark-mode input,
html.dark-mode textarea,
html.dark-mode select,
html.dark-mode .form-control,
html.dark-mode .form-select {
    background: #0f1e36 !important;
    border: 1px solid #1e4070 !important;
    color: #ffffff !important;
}

html[data-theme="royal"] input:focus,
html[data-theme="royal"] textarea:focus,
html[data-theme="royal"] select:focus,
html[data-theme="royal"] .form-control:focus,
html.dark-mode input:focus,
html.dark-mode textarea:focus,
html.dark-mode select:focus,
html.dark-mode .form-control:focus {
    border-color: #FFD700 !important;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] input::placeholder,
html[data-theme="royal"] textarea::placeholder,
html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder {
    color: #6688aa !important;
}

/* Dropdowns */
html[data-theme="royal"] .dropdown-menu,
html.dark-mode .dropdown-menu {
    background: linear-gradient(180deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="royal"] .dropdown-item,
html.dark-mode .dropdown-item {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .dropdown-item:hover,
html.dark-mode .dropdown-item:hover {
    background: rgba(255, 215, 0, 0.1) !important;
    color: #FFD700 !important;
}

/* Tables */
html[data-theme="royal"] .table,
html.dark-mode .table {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .table thead th,
html.dark-mode .table thead th {
    background: #0f1e36 !important;
    border-color: #1e4070 !important;
    color: #FFD700 !important;
}

html[data-theme="royal"] .table tbody td,
html.dark-mode .table tbody td {
    border-color: #1e4070 !important;
}

html[data-theme="royal"] .table-striped tbody tr:nth-of-type(odd),
html.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.02) !important;
}

/* Modals */
html[data-theme="royal"] .modal-content,
html.dark-mode .modal-content {
    background: linear-gradient(180deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] .modal-header,
html.dark-mode .modal-header {
    border-color: rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .modal-footer,
html.dark-mode .modal-footer {
    border-color: rgba(255, 215, 0, 0.1) !important;
}

/* Side Panels and Info Boxes */
html[data-theme="royal"] .side-panel,
html[data-theme="royal"] .info-panel,
html[data-theme="royal"] .tips-panel,
html[data-theme="royal"] .sidebar-advert,
html[data-theme="royal"] .sidebar-quicklinks,
html[data-theme="royal"] .profile-section,
html[data-theme="royal"] .home-municipality-card,
html.dark-mode .side-panel,
html.dark-mode .info-panel,
html.dark-mode .tips-panel,
html.dark-mode .sidebar-advert,
html.dark-mode .sidebar-quicklinks,
html.dark-mode .profile-section,
html.dark-mode .home-municipality-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .side-panel h4,
html[data-theme="royal"] .side-panel h5,
html[data-theme="royal"] .info-panel h4,
html[data-theme="royal"] .tips-panel h4,
html.dark-mode .side-panel h4,
html.dark-mode .side-panel h5,
html.dark-mode .info-panel h4,
html.dark-mode .tips-panel h4 {
    color: #FFD700 !important;
}

/* Badges */
html[data-theme="royal"] .badge.bg-primary,
html.dark-mode .badge.bg-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
}

html[data-theme="royal"] .badge.bg-success,
html.dark-mode .badge.bg-success {
    background: linear-gradient(135deg, #0d6d3c 0%, #198754 100%) !important;
}

html[data-theme="royal"] .badge.bg-warning,
html.dark-mode .badge.bg-warning {
    background: linear-gradient(135deg, #cc8a00 0%, #ffc107 100%) !important;
    color: #0a1628 !important;
}

html[data-theme="royal"] .badge.bg-secondary,
html.dark-mode .badge.bg-secondary {
    background: #1e4070 !important;
}

/* Progress Bars */
html[data-theme="royal"] .progress,
html.dark-mode .progress {
    background: #0f1e36 !important;
    border: 1px solid #1e4070;
}

html[data-theme="royal"] .progress-bar,
html.dark-mode .progress-bar {
    background: linear-gradient(90deg, #c9a600 0%, #FFD700 100%) !important;
}

/* Alerts */
html[data-theme="royal"] .alert,
html.dark-mode .alert {
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] .alert-info,
html.dark-mode .alert-info {
    background: rgba(30, 64, 112, 0.5) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .alert-success,
html.dark-mode .alert-success {
    background: rgba(25, 135, 84, 0.2) !important;
    color: #75d9a6 !important;
}

html[data-theme="royal"] .alert-warning,
html.dark-mode .alert-warning {
    background: rgba(255, 193, 7, 0.15) !important;
    color: #FFD700 !important;
}

html[data-theme="royal"] .alert-danger,
html.dark-mode .alert-danger {
    background: rgba(220, 53, 69, 0.2) !important;
    color: #f5a5ad !important;
}

/* List Groups */
html[data-theme="royal"] .list-group-item,
html.dark-mode .list-group-item {
    background: #0f1e36 !important;
    border-color: #1e4070 !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .list-group-item:hover,
html.dark-mode .list-group-item:hover {
    background: #152a4a !important;
}

/* Pagination */
html[data-theme="royal"] .page-link,
html.dark-mode .page-link {
    background: #0f1e36 !important;
    border-color: #1e4070 !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .page-link:hover,
html.dark-mode .page-link:hover {
    background: #152a4a !important;
    color: #FFD700 !important;
}

html[data-theme="royal"] .page-item.active .page-link,
html.dark-mode .page-item.active .page-link {
    background: linear-gradient(135deg, #c9a600 0%, #FFD700 100%) !important;
    border-color: #FFD700 !important;
    color: #0a1628 !important;
}

/* Breadcrumbs */
html[data-theme="royal"] .breadcrumb,
html.dark-mode .breadcrumb {
    background: transparent !important;
}

html[data-theme="royal"] .breadcrumb-item a,
html.dark-mode .breadcrumb-item a {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .breadcrumb-item.active,
html.dark-mode .breadcrumb-item.active {
    color: #FFD700 !important;
}

/* Account Panel */
html[data-theme="royal"] .account-panel,
html.dark-mode .account-panel {
    background: linear-gradient(180deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] .account-top-row,
html.dark-mode .account-top-row {
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom-color: rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .account-nav-item,
html.dark-mode .account-nav-item {
    background: rgba(255, 255, 255, 0.03) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .account-nav-item:hover,
html.dark-mode .account-nav-item:hover {
    background: rgba(255, 215, 0, 0.1) !important;
    color: #FFD700 !important;
}

html[data-theme="royal"] .settings-group,
html.dark-mode .settings-group {
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .settings-group-title,
html.dark-mode .settings-group-title {
    color: #FFD700 !important;
}

/* Account Settings Row */
html[data-theme="royal"] .account-settings-row,
html.dark-mode .account-settings-row {
    background: #0a1628 !important;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

html[data-theme="royal"] .setting-label,
html.dark-mode .setting-label {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .language-select,
html.dark-mode .language-select {
    background: #0f1e36 !important;
    border-color: #1e4070 !important;
    color: #ffffff !important;
}

html[data-theme="royal"] .language-select option,
html[data-theme="royal"] .language-select optgroup,
html.dark-mode .language-select option,
html.dark-mode .language-select optgroup {
    background: #0f1e36 !important;
    color: #ffffff !important;
}

html[data-theme="royal"] .btn-reset-all,
html.dark-mode .btn-reset-all {
    background: rgba(255, 215, 0, 0.1) !important;
    border-color: rgba(255, 215, 0, 0.3) !important;
    color: #FFD700 !important;
}

html[data-theme="royal"] .btn-reset-all:hover,
html.dark-mode .btn-reset-all:hover {
    background: rgba(255, 215, 0, 0.2) !important;
}

/* Font Buttons in Settings */
html[data-theme="royal"] .font-btn-sm,
html.dark-mode .font-btn-sm {
    background: #152a4a !important;
    border-color: #1e4070 !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .font-btn-sm:hover,
html.dark-mode .font-btn-sm:hover {
    background: #1e4070 !important;
    color: #FFD700 !important;
    border-color: #FFD700 !important;
}

/* Toggle Switches in Settings */
html[data-theme="royal"] .toggle-switch-sm,
html.dark-mode .toggle-switch-sm {
    background: #1e4070 !important;
}

html[data-theme="royal"] .toggle-switch-sm input:checked + .toggle-slider,
html.dark-mode .toggle-switch-sm input:checked + .toggle-slider {
    background: #FFD700 !important;
}

/* Text Utilities */
html[data-theme="royal"] .text-muted,
html.dark-mode .text-muted {
    color: #6688aa !important;
}

html[data-theme="royal"] .text-primary,
html.dark-mode .text-primary {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] p,
html[data-theme="royal"] span,
html[data-theme="royal"] li,
html.dark-mode p,
html.dark-mode span,
html.dark-mode li {
    color: #c0d0e8;
}

/* Links */
html[data-theme="royal"] a,
html.dark-mode a {
    color: #8aa4c8;
}

html[data-theme="royal"] a:hover,
html.dark-mode a:hover {
    color: #FFD700;
}

/* Dashboard Specific */
html[data-theme="royal"] .dashboard-wrapper,
html.dark-mode .dashboard-wrapper {
    background: #0a1628 !important;
}

html[data-theme="royal"] .dashboard-main,
html.dark-mode .dashboard-main {
    background: #0a1628 !important;
}

html[data-theme="royal"] .welcome-banner,
html.dark-mode .welcome-banner {
    background: linear-gradient(135deg, #0f1e36 0%, #1e4070 50%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15);
}

html[data-theme="royal"] .stat-icon,
html.dark-mode .stat-icon {
    background: rgba(255, 215, 0, 0.1) !important;
    color: #FFD700 !important;
}

html[data-theme="royal"] .quick-action-btn,
html.dark-mode .quick-action-btn {
    background: #0f1e36 !important;
    border: 2px dashed #1e4070 !important;
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .quick-action-btn:hover,
html.dark-mode .quick-action-btn:hover {
    border-color: #FFD700 !important;
    color: #FFD700 !important;
    background: rgba(255, 215, 0, 0.05) !important;
}

html[data-theme="royal"] .activity-icon,
html.dark-mode .activity-icon {
    background: rgba(255, 215, 0, 0.1) !important;
}

/* Gold Accent Elements */
html[data-theme="royal"] .gold-accent,
html[data-theme="royal"] .accent-gold,
html.dark-mode .gold-accent,
html.dark-mode .accent-gold {
    color: #FFD700 !important;
}

/* Scrollbar Styling */
html[data-theme="royal"] ::-webkit-scrollbar,
html.dark-mode ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html[data-theme="royal"] ::-webkit-scrollbar-track,
html.dark-mode ::-webkit-scrollbar-track {
    background: #0a1628;
}

html[data-theme="royal"] ::-webkit-scrollbar-thumb,
html.dark-mode ::-webkit-scrollbar-thumb {
    background: #1e4070;
    border-radius: 5px;
}

html[data-theme="royal"] ::-webkit-scrollbar-thumb:hover,
html.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #2a5298;
}

/* ==========================================================================
   THEME SWITCHER UI COMPONENT
   ========================================================================== */
.theme-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.theme-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.theme-option:hover {
    transform: scale(1.1);
}

.theme-option.active {
    border-color: #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.theme-option.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
}

.theme-option-light {
    background: linear-gradient(135deg, #ffffff 50%, #f5f7fa 50%);
    border-color: #e0e0e0;
}

.theme-option-light.active::after {
    color: #1e3c72;
}

.theme-option-royal {
    background: linear-gradient(135deg, #0a1628 50%, #FFD700 50%);
}

.theme-option-royal.active::after {
    color: #FFD700;
}

/* ==========================================================================
   ACCESSIBILITY PANEL TEXT FIXES
   ========================================================================== */

/* Mobile Accessibility Panel */
html[data-theme="royal"] .mobile-accessibility-panel,
html.dark-mode .mobile-accessibility-panel {
    background: #0f1e36 !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] .accessibility-label,
html.dark-mode .accessibility-label {
    color: #FFD700 !important;
}

html[data-theme="royal"] .accessibility-section,
html.dark-mode .accessibility-section {
    border-color: rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .font-btn,
html.dark-mode .font-btn {
    background: #152a4a !important;
    border-color: #1e4070 !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .font-btn:hover,
html.dark-mode .font-btn:hover {
    background: #1e4070 !important;
    color: #FFD700 !important;
}

/* Desktop Settings Panel */
html[data-theme="royal"] .setting-label,
html.dark-mode .setting-label {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .font-btn-sm,
html.dark-mode .font-btn-sm {
    background: #152a4a !important;
    border-color: #1e4070 !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .font-btn-sm:hover,
html.dark-mode .font-btn-sm:hover {
    background: #1e4070 !important;
    color: #FFD700 !important;
}

/* ==========================================================================
   GENERAL PAGE TEXT FIXES
   ========================================================================== */

/* Ensure all text is readable */
html[data-theme="royal"],
html.dark-mode {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .container,
html[data-theme="royal"] .container-fluid,
html[data-theme="royal"] main,
html[data-theme="royal"] section,
html[data-theme="royal"] article,
html.dark-mode .container,
html.dark-mode .container-fluid,
html.dark-mode main,
html.dark-mode section,
html.dark-mode article {
    color: #c0d0e8;
}

/* Golden hero text */
html[data-theme="royal"] .hero-section h1,
html[data-theme="royal"] .hero-section h2,
html[data-theme="royal"] .hero-title,
html.dark-mode .hero-section h1,
html.dark-mode .hero-section h2,
html.dark-mode .hero-title {
    color: #FFD700 !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

html[data-theme="royal"] .hero-section p,
html[data-theme="royal"] .hero-subtitle,
html.dark-mode .hero-section p,
html.dark-mode .hero-subtitle {
    color: #ffffff !important;
}

/* Lead text */
html[data-theme="royal"] .lead,
html.dark-mode .lead {
    color: #c0d0e8 !important;
}

/* Ensure all paragraphs visible */
html[data-theme="royal"] p,
html.dark-mode p {
    color: #c0d0e8 !important;
}

/* Strong/bold text in gold */
html[data-theme="royal"] strong,
html[data-theme="royal"] b,
html.dark-mode strong,
html.dark-mode b {
    color: #ffffff !important;
}

/* Feature/Info sections */
html[data-theme="royal"] .feature-text,
html[data-theme="royal"] .feature-description,
html[data-theme="royal"] .card-text,
html.dark-mode .feature-text,
html.dark-mode .feature-description,
html.dark-mode .card-text {
    color: #c0d0e8 !important;
}

/* Small text and captions */
html[data-theme="royal"] small,
html[data-theme="royal"] .small,
html[data-theme="royal"] figcaption,
html.dark-mode small,
html.dark-mode .small,
html.dark-mode figcaption {
    color: #8aa4c8 !important;
}

/* Blockquotes */
html[data-theme="royal"] blockquote,
html.dark-mode blockquote {
    border-left-color: #FFD700 !important;
    color: #c0d0e8 !important;
    background: rgba(255, 215, 0, 0.05) !important;
}

/* HR dividers */
html[data-theme="royal"] hr,
html.dark-mode hr {
    border-color: rgba(255, 215, 0, 0.2) !important;
    opacity: 1;
}

/* Labels and small headings */
html[data-theme="royal"] label,
html.dark-mode label {
    color: #c0d0e8 !important;
}

/* Code blocks */
html[data-theme="royal"] code,
html[data-theme="royal"] pre,
html.dark-mode code,
html.dark-mode pre {
    background: #0f1e36 !important;
    color: #FFD700 !important;
    border-color: #1e4070 !important;
}

/* Icons in content */
html[data-theme="royal"] .fa,
html[data-theme="royal"] .fas,
html[data-theme="royal"] .far,
html[data-theme="royal"] .fab,
html.dark-mode .fa,
html.dark-mode .fas,
html.dark-mode .far,
html.dark-mode .fab {
    color: inherit;
}

/* Navigation text in offcanvas/mobile */
html[data-theme="royal"] .offcanvas,
html.dark-mode .offcanvas {
    background: #0a1628 !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .offcanvas .nav-link,
html.dark-mode .offcanvas .nav-link {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .offcanvas .nav-link:hover,
html.dark-mode .offcanvas .nav-link:hover {
    color: #FFD700 !important;
}

/* Site content area */
html[data-theme="royal"] .site-content,
html[data-theme="royal"] .main-content,
html[data-theme="royal"] .page-content,
html.dark-mode .site-content,
html.dark-mode .main-content,
html.dark-mode .page-content {
    background: transparent !important;
    color: #c0d0e8 !important;
}

/* ==========================================================================
   HELLO BUREAUCRAT - ROYAL THEME OVERRIDES
   ========================================================================== */

/* Section Backgrounds */
html[data-theme="royal"] .hb-section-alt,
html.dark-mode .hb-section-alt {
    background: #0f1e36 !important;
}

html[data-theme="royal"] .hb-section-title,
html.dark-mode .hb-section-title {
    color: #ffffff !important;
}

/* Action Cards */
html[data-theme="royal"] .hb-action-card,
html.dark-mode .hb-action-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    color: #ffffff !important;
}

html[data-theme="royal"] .hb-action-card:hover,
html.dark-mode .hb-action-card:hover {
    border-color: #FFD700 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .hb-action-card h3,
html.dark-mode .hb-action-card h3 {
    color: #ffffff !important;
}

html[data-theme="royal"] .hb-action-card p,
html.dark-mode .hb-action-card p {
    color: #8aa4c8 !important;
}

/* Category Cards */
html[data-theme="royal"] .hb-category-card,
html.dark-mode .hb-category-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .hb-category-card:hover,
html.dark-mode .hb-category-card:hover {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
    color: #ffffff !important;
    border-color: #FFD700 !important;
}

html[data-theme="royal"] .hb-category-name,
html.dark-mode .hb-category-name {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .hb-category-card:hover .hb-category-name,
html.dark-mode .hb-category-card:hover .hb-category-name {
    color: #ffffff !important;
}

/* Complaint Cards */
html[data-theme="royal"] .hb-complaint-card,
html.dark-mode .hb-complaint-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .hb-complaint-card:hover,
html.dark-mode .hb-complaint-card:hover {
    border-left-color: #FFD700 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="royal"] .hb-complaint-title a,
html.dark-mode .hb-complaint-title a {
    color: #ffffff !important;
}

html[data-theme="royal"] .hb-complaint-title a:hover,
html.dark-mode .hb-complaint-title a:hover {
    color: #FFD700 !important;
}

html[data-theme="royal"] .hb-complaint-meta,
html.dark-mode .hb-complaint-meta {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .hb-complaint-arrow,
html.dark-mode .hb-complaint-arrow {
    color: #8aa4c8 !important;
}

/* Rating Stars */
html[data-theme="royal"] .hb-rating .fas.fa-star,
html.dark-mode .hb-rating .fas.fa-star {
    color: #FFD700 !important;
}

html[data-theme="royal"] .hb-rating .far.fa-star,
html.dark-mode .hb-rating .far.fa-star {
    color: #1e4070 !important;
}

/* View All Link */
html[data-theme="royal"] .hb-view-all,
html.dark-mode .hb-view-all {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .hb-view-all:hover,
html.dark-mode .hb-view-all:hover {
    color: #FFD700 !important;
}

/* Empty State */
html[data-theme="royal"] .hb-empty-state,
html.dark-mode .hb-empty-state {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .hb-empty-state h3,
html.dark-mode .hb-empty-state h3 {
    color: #ffffff !important;
}

/* Forms & Inputs in Hello Bureaucrat */
html[data-theme="royal"] .hb-form-group label,
html.dark-mode .hb-form-group label {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .hb-form-control,
html.dark-mode .hb-form-control {
    background: #0f1e36 !important;
    border-color: #1e4070 !important;
    color: #ffffff !important;
}

html[data-theme="royal"] .hb-form-control:focus,
html.dark-mode .hb-form-control:focus {
    border-color: #FFD700 !important;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15) !important;
}

/* Detail Pages */
html[data-theme="royal"] .hb-detail-card,
html[data-theme="royal"] .hb-info-card,
html[data-theme="royal"] .hb-bureaucrat-card,
html[data-theme="royal"] .hb-department-card,
html.dark-mode .hb-detail-card,
html.dark-mode .hb-info-card,
html.dark-mode .hb-bureaucrat-card,
html.dark-mode .hb-department-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .hb-detail-card h1,
html[data-theme="royal"] .hb-detail-card h2,
html[data-theme="royal"] .hb-detail-card h3,
html[data-theme="royal"] .hb-detail-card h4,
html.dark-mode .hb-detail-card h1,
html.dark-mode .hb-detail-card h2,
html.dark-mode .hb-detail-card h3,
html.dark-mode .hb-detail-card h4 {
    color: #ffffff !important;
}

/* Response Times / Metrics */
html[data-theme="royal"] .hb-metric-card,
html.dark-mode .hb-metric-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .hb-metric-value,
html.dark-mode .hb-metric-value {
    color: #FFD700 !important;
}

html[data-theme="royal"] .hb-metric-label,
html.dark-mode .hb-metric-label {
    color: #8aa4c8 !important;
}

/* Tables in Hello Bureaucrat */
html[data-theme="royal"] .hb-table,
html.dark-mode .hb-table {
    background: #0f1e36 !important;
}

html[data-theme="royal"] .hb-table thead th,
html.dark-mode .hb-table thead th {
    background: #0a1628 !important;
    color: #FFD700 !important;
    border-color: #1e4070 !important;
}

html[data-theme="royal"] .hb-table tbody td,
html.dark-mode .hb-table tbody td {
    color: #c0d0e8 !important;
    border-color: #1e4070 !important;
}

html[data-theme="royal"] .hb-table tbody tr:hover,
html.dark-mode .hb-table tbody tr:hover {
    background: rgba(255, 215, 0, 0.05) !important;
}

/* Sidebar Panels */
html[data-theme="royal"] .hb-sidebar,
html[data-theme="royal"] .hb-filter-panel,
html.dark-mode .hb-sidebar,
html.dark-mode .hb-filter-panel {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .hb-filter-title,
html.dark-mode .hb-filter-title {
    color: #FFD700 !important;
}

/* Pagination */
html[data-theme="royal"] .hb-pagination .page-link,
html.dark-mode .hb-pagination .page-link {
    background: #0f1e36 !important;
    border-color: #1e4070 !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .hb-pagination .page-link:hover,
html.dark-mode .hb-pagination .page-link:hover {
    background: #152a4a !important;
    color: #FFD700 !important;
}

html[data-theme="royal"] .hb-pagination .page-item.active .page-link,
html.dark-mode .hb-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #c9a600 0%, #FFD700 100%) !important;
    border-color: #FFD700 !important;
    color: #0a1628 !important;
}

/* ==========================================================================
   GLOBAL SITE ELEMENTS - ROYAL THEME OVERRIDES
   ========================================================================== */

/* Feature Cards (used across multiple pages) */
html[data-theme="royal"] .feature-card,
html.dark-mode .feature-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    border-left: 4px solid #FFD700 !important;
    color: #ffffff !important;
}

html[data-theme="royal"] .feature-card:hover,
html.dark-mode .feature-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .feature-title,
html.dark-mode .feature-title {
    color: #ffffff !important;
}

html[data-theme="royal"] .feature-description,
html.dark-mode .feature-description {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .feature-icon,
html.dark-mode .feature-icon {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

/* Section Titles */
html[data-theme="royal"] .section-title,
html.dark-mode .section-title {
    color: #ffffff !important;
}

/* Bootstrap Utility Classes */
html[data-theme="royal"] .bg-light,
html.dark-mode .bg-light {
    background: #0f1e36 !important;
}

html[data-theme="royal"] .bg-white,
html.dark-mode .bg-white {
    background: #0f1e36 !important;
}

html[data-theme="royal"] .bg-secondary,
html.dark-mode .bg-secondary {
    background: #152a4a !important;
}

/* ==========================================================================
   ABOUT PAGE - ROYAL THEME OVERRIDES
   ========================================================================== */

/* Mission Banner */
html[data-theme="royal"] .mission-banner,
html.dark-mode .mission-banner {
    background: linear-gradient(135deg, #0a1628 0%, #0f1e36 100%) !important;
    border-bottom: 2px solid rgba(255, 215, 0, 0.25) !important;
}

html[data-theme="royal"] .mission-banner .mission-card,
html.dark-mode .mission-banner .mission-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
    border-left: 4px solid #FFD700 !important;
}

html[data-theme="royal"] .mission-banner .section-title,
html.dark-mode .mission-banner .section-title {
    color: #FFD700 !important;
}

html[data-theme="royal"] .mission-banner .mission-tagline,
html.dark-mode .mission-banner .mission-tagline {
    color: #FFD700 !important;
}

html[data-theme="royal"] .mission-banner p,
html.dark-mode .mission-banner p {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .mission-banner .lead,
html.dark-mode .mission-banner .lead {
    color: #c0d0e8 !important;
}

/* Highlight Card */
html[data-theme="royal"] .highlight-card,
html.dark-mode .highlight-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.2) !important;
    border-left: 4px solid #FFD700 !important;
}

html[data-theme="royal"] .highlight-card h3,
html[data-theme="royal"] .highlight-card h4,
html.dark-mode .highlight-card h3,
html.dark-mode .highlight-card h4 {
    color: #FFD700 !important;
}

html[data-theme="royal"] .highlight-card p,
html.dark-mode .highlight-card p {
    color: #c0d0e8 !important;
}

/* bg-light overrides */
html[data-theme="royal"] .bg-light,
html.dark-mode .bg-light {
    background: #0f1e36 !important;
}

/* Home Page Specific */
html[data-theme="royal"] .accountability-section,
html.dark-mode .accountability-section {
    background: #0f1e36 !important;
    border-left-color: #FFD700 !important;
}

html[data-theme="royal"] .impact-list li,
html.dark-mode .impact-list li {
    border-bottom-color: rgba(255, 215, 0, 0.1) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .impact-list li strong,
html.dark-mode .impact-list li strong {
    color: #ffffff !important;
}

html[data-theme="royal"] .vision-text,
html.dark-mode .vision-text {
    color: #c0d0e8 !important;
}

/* Lead Text */
html[data-theme="royal"] .lead,
html.dark-mode .lead {
    color: #c0d0e8 !important;
}

/* Section Containers */
html[data-theme="royal"] section,
html.dark-mode section {
    background-color: transparent;
}

/* Sidebar Widgets */
html[data-theme="royal"] .sidebar-widget,
html.dark-mode .sidebar-widget {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .sidebar-widget-title,
html.dark-mode .sidebar-widget-title {
    color: #FFD700 !important;
    border-color: #FFD700 !important;
}

/* Sticky Ad Container */
html[data-theme="royal"] .sticky-ad-container,
html.dark-mode .sticky-ad-container {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] .sticky-ad-text h4,
html.dark-mode .sticky-ad-text h4 {
    color: #ffffff !important;
}

html[data-theme="royal"] .sticky-ad-text p,
html.dark-mode .sticky-ad-text p {
    color: #8aa4c8 !important;
}

/* Backend Cards (Admin areas) */
html[data-theme="royal"] .backend-card,
html.dark-mode .backend-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .backend-card h1,
html[data-theme="royal"] .backend-card h2,
html[data-theme="royal"] .backend-card h3,
html[data-theme="royal"] .backend-card h4,
html[data-theme="royal"] .backend-card h5,
html.dark-mode .backend-card h1,
html.dark-mode .backend-card h2,
html.dark-mode .backend-card h3,
html.dark-mode .backend-card h4,
html.dark-mode .backend-card h5 {
    color: #ffffff !important;
}

/* Dashboard Components */
html[data-theme="royal"] .dash-card,
html.dark-mode .dash-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .welcome-banner,
html.dark-mode .welcome-banner {
    background: linear-gradient(135deg, #0f1e36 0%, #1e4070 50%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
}

/* News/Article Cards */
html[data-theme="royal"] .news-card,
html[data-theme="royal"] .article-card,
html.dark-mode .news-card,
html.dark-mode .article-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .news-card h3,
html[data-theme="royal"] .news-card h4,
html[data-theme="royal"] .article-card h3,
html[data-theme="royal"] .article-card h4,
html.dark-mode .news-card h3,
html.dark-mode .news-card h4,
html.dark-mode .article-card h3,
html.dark-mode .article-card h4 {
    color: #ffffff !important;
}

/* Stat Boxes */
html[data-theme="royal"] .stat-box,
html.dark-mode .stat-box {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .stat-value,
html.dark-mode .stat-value {
    color: #FFD700 !important;
}

html[data-theme="royal"] .stat-label,
html.dark-mode .stat-label {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .stat-icon,
html.dark-mode .stat-icon {
    background: rgba(255, 215, 0, 0.1) !important;
    color: #FFD700 !important;
}

/* Poll Cards */
html[data-theme="royal"] .poll-card,
html.dark-mode .poll-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

/* Classifieds Cards */
html[data-theme="royal"] .classified-card,
html[data-theme="royal"] .ad-card,
html.dark-mode .classified-card,
html.dark-mode .ad-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

/* Events Cards */
html[data-theme="royal"] .event-card,
html.dark-mode .event-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

/* Info/Panel Boxes */
html[data-theme="royal"] .info-box,
html[data-theme="royal"] .panel-box,
html[data-theme="royal"] .content-box,
html.dark-mode .info-box,
html.dark-mode .panel-box,
html.dark-mode .content-box {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    color: #c0d0e8 !important;
}

/* Profile Sections */
html[data-theme="royal"] .profile-card,
html[data-theme="royal"] .profile-section,
html.dark-mode .profile-card,
html.dark-mode .profile-section {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

/* Generic White Background Override */
html[data-theme="royal"] [style*="background: #fff"],
html[data-theme="royal"] [style*="background:#fff"],
html[data-theme="royal"] [style*="background: white"],
html[data-theme="royal"] [style*="background:white"],
html[data-theme="royal"] [style*="background-color: #fff"],
html[data-theme="royal"] [style*="background-color:#fff"],
html.dark-mode [style*="background: #fff"],
html.dark-mode [style*="background:#fff"],
html.dark-mode [style*="background: white"],
html.dark-mode [style*="background:white"],
html.dark-mode [style*="background-color: #fff"],
html.dark-mode [style*="background-color:#fff"] {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
}

/* Override inline light backgrounds */
html[data-theme="royal"] [style*="background: #f"],
html[data-theme="royal"] [style*="background:#f"],
html.dark-mode [style*="background: #f"],
html.dark-mode [style*="background:#f"] {
    background: #0f1e36 !important;
}

/* ==========================================================================
   MUNICIPALITY PAGES - ROYAL THEME OVERRIDES
   ========================================================================== */

/* Info Panel */
html[data-theme="royal"] .info-panel,
html.dark-mode .info-panel {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    border-left: 4px solid #FFD700 !important;
}

html[data-theme="royal"] .info-panel h3,
html[data-theme="royal"] .info-panel h4,
html.dark-mode .info-panel h3,
html.dark-mode .info-panel h4 {
    color: #ffffff !important;
}

html[data-theme="royal"] .info-panel p,
html[data-theme="royal"] .info-panel span,
html.dark-mode .info-panel p,
html.dark-mode .info-panel span {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .info-panel .contact-label,
html.dark-mode .info-panel .contact-label {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .info-panel .contact-value,
html.dark-mode .info-panel .contact-value {
    color: #ffffff !important;
}

/* Stat Cards */
html[data-theme="royal"] .stat-card,
html.dark-mode .stat-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    border-left: 4px solid #FFD700 !important;
}

html[data-theme="royal"] .stat-card::before,
html.dark-mode .stat-card::before {
    background: linear-gradient(90deg, #FFD700, #1e4070) !important;
}

html[data-theme="royal"] .stat-title,
html.dark-mode .stat-title {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .stat-number,
html.dark-mode .stat-number {
    color: #FFD700 !important;
}

html[data-theme="royal"] .stat-change,
html.dark-mode .stat-change {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .stat-change.positive,
html.dark-mode .stat-change.positive {
    color: #4ade80 !important;
}

/* Services Section */
html[data-theme="royal"] .services-section,
html.dark-mode .services-section {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    border-left: 4px solid #FFD700 !important;
}

html[data-theme="royal"] .services-title,
html.dark-mode .services-title {
    color: #FFD700 !important;
}

/* Service Items */
html[data-theme="royal"] .service-item,
html.dark-mode .service-item {
    background: rgba(15, 30, 54, 0.8) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    border-left: 3px solid #FFD700 !important;
}

html[data-theme="royal"] .service-item:hover,
html.dark-mode .service-item:hover {
    background: rgba(21, 42, 74, 0.9) !important;
    border-color: rgba(255, 215, 0, 0.3) !important;
}

html[data-theme="royal"] .service-name,
html.dark-mode .service-name {
    color: #ffffff !important;
}

html[data-theme="royal"] .service-desc,
html.dark-mode .service-desc {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .service-icon,
html.dark-mode .service-icon {
    color: #FFD700 !important;
}

/* Stats Grid Background */
html[data-theme="royal"] .stats-grid,
html.dark-mode .stats-grid {
    background: transparent !important;
}

/* Municipality Description */
html[data-theme="royal"] .municipality-description,
html.dark-mode .municipality-description {
    color: #c0d0e8 !important;
}

/* Contact Details */
html[data-theme="royal"] .contact-details,
html.dark-mode .contact-details {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .contact-item i,
html.dark-mode .contact-item i {
    color: #FFD700 !important;
}

/* Rating Section */
html[data-theme="royal"] .rating-section,
html.dark-mode .rating-section {
    background: rgba(15, 30, 54, 0.8) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
    border-radius: 10px;
}

html[data-theme="royal"] .rating-text,
html.dark-mode .rating-text {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .rating-number,
html.dark-mode .rating-number {
    color: #FFD700 !important;
}

html[data-theme="royal"] .rating-stars i,
html.dark-mode .rating-stars i {
    color: #FFD700 !important;
}

/* Modals */
html[data-theme="royal"] .modal-content,
html.dark-mode .modal-content {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .modal-header,
html.dark-mode .modal-header {
    background: linear-gradient(135deg, #0a1628 0%, #0f1e36 100%) !important;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] .modal-title,
html.dark-mode .modal-title {
    color: #FFD700 !important;
}

html[data-theme="royal"] .modal-footer,
html.dark-mode .modal-footer {
    background: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .modal-body label,
html.dark-mode .modal-body label {
    color: #c0d0e8 !important;
}

/* Form Controls - General */
html[data-theme="royal"] .form-control,
html[data-theme="royal"] .form-select,
html.dark-mode .form-control,
html.dark-mode .form-select {
    background: #0f1e36 !important;
    border-color: #1e4070 !important;
    color: #ffffff !important;
}

html[data-theme="royal"] .form-control:focus,
html[data-theme="royal"] .form-select:focus,
html.dark-mode .form-control:focus,
html.dark-mode .form-select:focus {
    border-color: #FFD700 !important;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] .form-label,
html.dark-mode .form-label {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .form-check-label,
html.dark-mode .form-check-label {
    color: #c0d0e8 !important;
}

/* Text Muted Override */
html[data-theme="royal"] .text-muted,
html.dark-mode .text-muted {
    color: #6688aa !important;
}

/* Coat of Arms / Municipality Logo Container */
html[data-theme="royal"] .coat-of-arms-lg,
html.dark-mode .coat-of-arms-lg {
    background: rgba(10, 22, 40, 0.8) !important;
    border: 2px solid rgba(255, 215, 0, 0.3) !important;
}

/* Admin Manage Button */
html[data-theme="royal"] .admin-manage-btn,
html.dark-mode .admin-manage-btn {
    background: rgba(255, 215, 0, 0.9) !important;
    color: #0a1628 !important;
}

html[data-theme="royal"] .admin-manage-btn:hover,
html.dark-mode .admin-manage-btn:hover {
    background: #FFD700 !important;
}

/* Municipality Gateway / List Cards */
html[data-theme="royal"] .municipality-card,
html.dark-mode .municipality-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .municipality-card:hover,
html.dark-mode .municipality-card:hover {
    border-color: rgba(255, 215, 0, 0.3) !important;
}

html[data-theme="royal"] .municipality-card h3,
html[data-theme="royal"] .municipality-card h4,
html.dark-mode .municipality-card h3,
html.dark-mode .municipality-card h4 {
    color: #ffffff !important;
}

html[data-theme="royal"] .municipality-card p,
html.dark-mode .municipality-card p {
    color: #c0d0e8 !important;
}

/* Province Badge */
html[data-theme="royal"] .province-badge,
html.dark-mode .province-badge {
    background: rgba(255, 215, 0, 0.15) !important;
    color: #FFD700 !important;
    border: 1px solid rgba(255, 215, 0, 0.3) !important;
}

/* Search/Filter Containers */
html[data-theme="royal"] .search-container,
html[data-theme="royal"] .filter-container,
html.dark-mode .search-container,
html.dark-mode .filter-container {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

/* News List/Detail on Municipality */
html[data-theme="royal"] .news-item,
html.dark-mode .news-item {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .news-item:hover,
html.dark-mode .news-item:hover {
    border-color: rgba(255, 215, 0, 0.25) !important;
}

/* Small text utilities */
html[data-theme="royal"] small,
html.dark-mode small {
    color: #6688aa !important;
}

html[data-theme="royal"] small a,
html.dark-mode small a {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] small a:hover,
html.dark-mode small a:hover {
    color: #FFD700 !important;
}

/* List items */
html[data-theme="royal"] .list-unstyled li,
html.dark-mode .list-unstyled li {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .list-unstyled li strong,
html.dark-mode .list-unstyled li strong {
    color: #ffffff !important;
}
/* ==========================================================================
   SOLUTIONS PAGE - ROYAL THEME OVERRIDES
   ========================================================================== */

/* Benefit Cards */
html[data-theme="royal"] .benefit-card,
html.dark-mode .benefit-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="royal"] .benefit-card:hover,
html.dark-mode .benefit-card:hover {
    border-color: rgba(255, 215, 0, 0.3) !important;
}

html[data-theme="royal"] .benefit-card h3,
html.dark-mode .benefit-card h3 {
    color: #ffffff !important;
}

html[data-theme="royal"] .benefit-card p,
html.dark-mode .benefit-card p {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .benefit-icon,
html.dark-mode .benefit-icon {
    background: linear-gradient(135deg, #FFD700 0%, #c9a600 100%) !important;
    color: #0a1628 !important;
}

/* Feature Showcase Section */
html[data-theme="royal"] .feature-showcase,
html.dark-mode .feature-showcase {
    background: linear-gradient(180deg, #0a1628 0%, #0f1e36 100%) !important;
}

html[data-theme="royal"] .feature-content h3,
html.dark-mode .feature-content h3 {
    color: #FFD700 !important;
}

html[data-theme="royal"] .feature-content p,
html.dark-mode .feature-content p {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .feature-list li,
html.dark-mode .feature-list li {
    color: #c0d0e8 !important;
}

/* Trust Section */
html[data-theme="royal"] .trust-section,
html.dark-mode .trust-section {
    background: #0a1628 !important;
}

html[data-theme="royal"] .trust-item,
html.dark-mode .trust-item {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="royal"] .trust-content h4,
html.dark-mode .trust-content h4 {
    color: #FFD700 !important;
}

html[data-theme="royal"] .trust-content p,
html.dark-mode .trust-content p {
    color: #c0d0e8 !important;
}

/* CTA Section */
html[data-theme="royal"] .cta-section,
html.dark-mode .cta-section {
    background: linear-gradient(180deg, #0f1e36 0%, #0a1628 100%) !important;
}

html[data-theme="royal"] .cta-form,
html.dark-mode .cta-form {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="royal"] .cta-form h3,
html.dark-mode .cta-form h3 {
    color: #FFD700 !important;
}

html[data-theme="royal"] .cta-form .subtitle,
html.dark-mode .cta-form .subtitle {
    color: #c0d0e8 !important;
}

/* ==========================================================================
   GLOBAL WHITE BACKGROUND OVERRIDES
   ========================================================================== */

/* py-5 sections that might have white background */
html[data-theme="royal"] section.py-5,
html.dark-mode section.py-5 {
    background: transparent !important;
}

/* Generic .card without specific overrides */
html[data-theme="royal"] .card:not(.account-card):not(.stat-card),
html.dark-mode .card:not(.account-card):not(.stat-card) {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .card-body,
html.dark-mode .card-body {
    background: transparent !important;
}

html[data-theme="royal"] .card-title,
html.dark-mode .card-title {
    color: #ffffff !important;
}

html[data-theme="royal"] .card-text,
html.dark-mode .card-text {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .card p,
html.dark-mode .card p {
    color: #c0d0e8 !important;
}

/* Feature icon backgrounds */
html[data-theme="royal"] .feature-icon,
html.dark-mode .feature-icon {
    background: linear-gradient(135deg, #FFD700 0%, #c9a600 100%) !important;
    color: #0a1628 !important;
}

/* Lead text */
html[data-theme="royal"] .lead,
html.dark-mode .lead {
    color: #c0d0e8 !important;
}

/* Page section backgrounds */
html[data-theme="royal"] section[class*="section"],
html.dark-mode section[class*="section"] {
    background-color: transparent !important;
}

/* Shadow boxes */
html[data-theme="royal"] .shadow,
html[data-theme="royal"] .shadow-sm,
html[data-theme="royal"] .shadow-lg,
html.dark-mode .shadow,
html.dark-mode .shadow-sm,
html.dark-mode .shadow-lg {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
}

/* Rounded containers with white bg */
html[data-theme="royal"] .rounded[style*="background"],
html.dark-mode .rounded[style*="background"] {
    background: #152a4a !important;
}

/* Text colors for common elements */
html[data-theme="royal"] h1, html[data-theme="royal"] h2, 
html[data-theme="royal"] h3, html[data-theme="royal"] h4,
html[data-theme="royal"] h5, html[data-theme="royal"] h6,
html.dark-mode h1, html.dark-mode h2, 
html.dark-mode h3, html.dark-mode h4,
html.dark-mode h5, html.dark-mode h6 {
    color: #ffffff;
}

html[data-theme="royal"] .section-title,
html.dark-mode .section-title {
    color: #FFD700 !important;
}

/* Override any inline white backgrounds */
html[data-theme="royal"] [style*="background: white"],
html[data-theme="royal"] [style*="background:white"],
html[data-theme="royal"] [style*="background:#fff"],
html[data-theme="royal"] [style*="background: #fff"],
html.dark-mode [style*="background: white"],
html.dark-mode [style*="background:white"],
html.dark-mode [style*="background:#fff"],
html.dark-mode [style*="background: #fff"] {
    background: #152a4a !important;
}

/* Contact Page Cards */
html[data-theme="royal"] .contact-card,
html.dark-mode .contact-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

/* Advertise Page Cards */
html[data-theme="royal"] .advertise-card,
html[data-theme="royal"] .pricing-card,
html.dark-mode .advertise-card,
html.dark-mode .pricing-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .pricing-card h4,
html.dark-mode .pricing-card h4 {
    color: #FFD700 !important;
}

html[data-theme="royal"] .pricing-card .price,
html.dark-mode .pricing-card .price {
    color: #FFD700 !important;
}

/* Info boxes */
html[data-theme="royal"] .info-box,
html.dark-mode .info-box {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    border-left: 4px solid #FFD700 !important;
}

/* Alert boxes (non-Bootstrap) */
html[data-theme="royal"] .alert-box,
html.dark-mode .alert-box {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
}

/* Well containers */
html[data-theme="royal"] .well,
html.dark-mode .well {
    background: #0f1e36 !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

/* Jumbotron */
html[data-theme="royal"] .jumbotron,
html.dark-mode .jumbotron {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
}

/* Panel containers */
html[data-theme="royal"] .panel,
html.dark-mode .panel {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .panel-heading,
html.dark-mode .panel-heading {
    background: rgba(255, 215, 0, 0.08) !important;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15) !important;
    color: #FFD700 !important;
}

html[data-theme="royal"] .panel-body,
html.dark-mode .panel-body {
    background: transparent !important;
    color: #c0d0e8 !important;
}

/* Box containers */
html[data-theme="royal"] .box,
html.dark-mode .box {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

/* Wrapper containers */
html[data-theme="royal"] .content-wrapper,
html.dark-mode .content-wrapper {
    background: transparent !important;
}

/* Main content areas */
html[data-theme="royal"] .main-content,
html[data-theme="royal"] main,
html.dark-mode .main-content,
html.dark-mode main {
    background: transparent !important;
}

/* Container backgrounds */
html[data-theme="royal"] .container-fluid,
html.dark-mode .container-fluid {
    background: transparent !important;
}

/* Row backgrounds with justify-content-center (from screenshot) */
html[data-theme="royal"] .row.justify-content-center,
html.dark-mode .row.justify-content-center {
    background: transparent !important;
}

/* Light backgrounds */
html[data-theme="royal"] .bg-white,
html.dark-mode .bg-white {
    background: #152a4a !important;
}

/* Footer - ensure no white sections */
html[data-theme="royal"] footer,
html[data-theme="royal"] .footer,
html.dark-mode footer,
html.dark-mode .footer {
    background: #0a1628 !important;
}

/* ==========================================================================
   DASHBOARD / PROFILE PAGE - ROYAL THEME OVERRIDES
   ========================================================================== */

/* Dashboard Container */
html[data-theme="royal"] .dashboard-container,
html.dark-mode .dashboard-container {
    background: linear-gradient(180deg, #0a1628 0%, #0f1e36 100%) !important;
}

/* Stat Cards */
html[data-theme="royal"] .stat-card,
html.dark-mode .stat-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="royal"] .stat-card:hover,
html.dark-mode .stat-card:hover {
    border-color: rgba(255, 215, 0, 0.25) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="royal"] .stat-label,
html.dark-mode .stat-label {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .stat-number,
html[data-theme="royal"] .stat-number-large,
html.dark-mode .stat-number,
html.dark-mode .stat-number-large {
    color: #FFD700 !important;
}

html[data-theme="royal"] .stat-sublabel,
html.dark-mode .stat-sublabel {
    color: #6688aa !important;
}

html[data-theme="royal"] .progress-value,
html.dark-mode .progress-value {
    color: #FFD700 !important;
}

html[data-theme="royal"] .progress-circle::before,
html.dark-mode .progress-circle::before {
    background: #0f1e36 !important;
}

/* Quick Action Cards */
html[data-theme="royal"] .quick-action-card,
html.dark-mode .quick-action-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="royal"] .quick-action-card:hover,
html.dark-mode .quick-action-card:hover {
    border-color: rgba(255, 215, 0, 0.3) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="royal"] .action-label,
html.dark-mode .action-label {
    color: #c0d0e8 !important;
}

/* Dashboard Cards */
html[data-theme="royal"] .dashboard-card,
html.dark-mode .dashboard-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="royal"] .dashboard-card .card-header,
html.dark-mode .dashboard-card .card-header {
    background: rgba(255, 215, 0, 0.05) !important;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .dashboard-card .card-header h5,
html.dark-mode .dashboard-card .card-header h5 {
    color: #FFD700 !important;
}

html[data-theme="royal"] .dashboard-card .card-body,
html.dark-mode .dashboard-card .card-body {
    background: transparent !important;
}

/* Activity Timeline */
html[data-theme="royal"] .activity-item,
html.dark-mode .activity-item {
    border-bottom-color: rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .activity-item:hover,
html.dark-mode .activity-item:hover {
    background: rgba(255, 215, 0, 0.05) !important;
}

html[data-theme="royal"] .activity-text,
html.dark-mode .activity-text {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .activity-text a,
html.dark-mode .activity-text a {
    color: #FFD700 !important;
}

/* Events List */
html[data-theme="royal"] .event-item,
html.dark-mode .event-item {
    border-bottom-color: rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .event-title,
html.dark-mode .event-title {
    color: #ffffff !important;
}

html[data-theme="royal"] .event-meta,
html.dark-mode .event-meta {
    color: #8aa4c8 !important;
}

/* Polls List */
html[data-theme="royal"] .poll-item,
html.dark-mode .poll-item {
    border-bottom-color: rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .poll-title,
html.dark-mode .poll-title {
    color: #ffffff !important;
}

html[data-theme="royal"] .poll-meta,
html.dark-mode .poll-meta {
    color: #8aa4c8 !important;
}

/* Empty State */
html[data-theme="royal"] .empty-state,
html.dark-mode .empty-state {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .empty-state i,
html.dark-mode .empty-state i {
    color: #6688aa !important;
}

html[data-theme="royal"] .empty-state p,
html.dark-mode .empty-state p {
    color: #8aa4c8 !important;
}

/* Profile Info Cards */
html[data-theme="royal"] .profile-info-card,
html.dark-mode .profile-info-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .profile-info-card h5,
html[data-theme="royal"] .profile-info-card h6,
html.dark-mode .profile-info-card h5,
html.dark-mode .profile-info-card h6 {
    color: #FFD700 !important;
}

html[data-theme="royal"] .profile-info-card p,
html[data-theme="royal"] .profile-info-card .info-text,
html.dark-mode .profile-info-card p,
html.dark-mode .profile-info-card .info-text {
    color: #c0d0e8 !important;
}

/* Profile Edit Modal */
html[data-theme="royal"] .modal-content,
html.dark-mode .modal-content {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] .modal-header,
html.dark-mode .modal-header {
    background: linear-gradient(135deg, #0a1628 0%, #0f1e36 100%) !important;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] .modal-title,
html.dark-mode .modal-title {
    color: #FFD700 !important;
}

html[data-theme="royal"] .modal-footer,
html.dark-mode .modal-footer {
    background: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .btn-close,
html.dark-mode .btn-close {
    filter: invert(1) !important;
}

/* Nav Tabs / Pills in Profile */
html[data-theme="royal"] .nav-tabs,
html.dark-mode .nav-tabs {
    border-bottom-color: rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] .nav-tabs .nav-link,
html.dark-mode .nav-tabs .nav-link {
    color: #8aa4c8 !important;
    border-color: transparent !important;
}

html[data-theme="royal"] .nav-tabs .nav-link:hover,
html.dark-mode .nav-tabs .nav-link:hover {
    color: #FFD700 !important;
    border-color: rgba(255, 215, 0, 0.2) rgba(255, 215, 0, 0.2) transparent !important;
}

html[data-theme="royal"] .nav-tabs .nav-link.active,
html.dark-mode .nav-tabs .nav-link.active {
    color: #FFD700 !important;
    background: rgba(255, 215, 0, 0.1) !important;
    border-color: rgba(255, 215, 0, 0.2) rgba(255, 215, 0, 0.2) transparent !important;
}

html[data-theme="royal"] .nav-pills .nav-link,
html.dark-mode .nav-pills .nav-link {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .nav-pills .nav-link:hover,
html.dark-mode .nav-pills .nav-link:hover {
    color: #FFD700 !important;
    background: rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .nav-pills .nav-link.active,
html.dark-mode .nav-pills .nav-link.active {
    background: linear-gradient(135deg, #FFD700 0%, #c9a600 100%) !important;
    color: #0a1628 !important;
}

/* Tab Content */
html[data-theme="royal"] .tab-content,
html.dark-mode .tab-content {
    background: transparent !important;
}

html[data-theme="royal"] .tab-pane,
html.dark-mode .tab-pane {
    color: #c0d0e8 !important;
}

/* List Groups */
html[data-theme="royal"] .list-group-item,
html.dark-mode .list-group-item {
    background: rgba(15, 30, 54, 0.6) !important;
    border-color: rgba(255, 215, 0, 0.1) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .list-group-item:hover,
html.dark-mode .list-group-item:hover {
    background: rgba(21, 42, 74, 0.8) !important;
}

html[data-theme="royal"] .list-group-item.active,
html.dark-mode .list-group-item.active {
    background: linear-gradient(135deg, #FFD700 0%, #c9a600 100%) !important;
    border-color: #FFD700 !important;
    color: #0a1628 !important;
}

/* Info Labels */
html[data-theme="royal"] .info-label,
html.dark-mode .info-label {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .info-value,
html.dark-mode .info-value {
    color: #ffffff !important;
}

/* Section Titles in Profile */
html[data-theme="royal"] .profile-section-title,
html.dark-mode .profile-section-title {
    color: #FFD700 !important;
}

/* Profile Header */
html[data-theme="royal"] .profile-header,
html.dark-mode .profile-header {
    background: linear-gradient(135deg, #0a1628 0%, #0f1e36 100%) !important;
}

/* Profile Sidebar */
html[data-theme="royal"] .profile-sidebar,
html.dark-mode .profile-sidebar {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

/* Profile Main Content */
html[data-theme="royal"] .profile-main,
html.dark-mode .profile-main {
    background: transparent !important;
}

/* Address / Vehicle / Child / Education Cards in Profile */
html[data-theme="royal"] .address-card,
html[data-theme="royal"] .vehicle-card,
html[data-theme="royal"] .child-card,
html[data-theme="royal"] .education-card,
html.dark-mode .address-card,
html.dark-mode .vehicle-card,
html.dark-mode .child-card,
html.dark-mode .education-card {
    background: rgba(15, 30, 54, 0.8) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    border-left: 3px solid #FFD700 !important;
}

html[data-theme="royal"] .address-card h6,
html[data-theme="royal"] .vehicle-card h6,
html[data-theme="royal"] .child-card h6,
html[data-theme="royal"] .education-card h6,
html.dark-mode .address-card h6,
html.dark-mode .vehicle-card h6,
html.dark-mode .child-card h6,
html.dark-mode .education-card h6 {
    color: #ffffff !important;
}

html[data-theme="royal"] .address-card p,
html[data-theme="royal"] .vehicle-card p,
html[data-theme="royal"] .child-card p,
html[data-theme="royal"] .education-card p,
html.dark-mode .address-card p,
html.dark-mode .vehicle-card p,
html.dark-mode .child-card p,
html.dark-mode .education-card p {
    color: #c0d0e8 !important;
}

/* PPP Survey Card */
html[data-theme="royal"] .ppp-survey-card,
html.dark-mode .ppp-survey-card {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
}

/* Messages Card */
html[data-theme="royal"] .message-card,
html.dark-mode .message-card {
    background: rgba(15, 30, 54, 0.8) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .message-card.unread,
html.dark-mode .message-card.unread {
    border-left: 3px solid #FFD700 !important;
    background: rgba(255, 215, 0, 0.05) !important;
}

html[data-theme="royal"] .message-subject,
html.dark-mode .message-subject {
    color: #ffffff !important;
}

html[data-theme="royal"] .message-preview,
html.dark-mode .message-preview {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .message-date,
html.dark-mode .message-date {
    color: #6688aa !important;
}

/* Notifications */
html[data-theme="royal"] .notification-item,
html.dark-mode .notification-item {
    background: rgba(15, 30, 54, 0.8) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .notification-item.unread,
html.dark-mode .notification-item.unread {
    border-left: 3px solid #FFD700 !important;
}

/* ==========================================================================
   ADDITIONAL ALERT & FORM STYLES
   ========================================================================== */

/* Alert Light - Common white background alert */
html[data-theme="royal"] .alert-light,
html.dark-mode .alert-light {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border-color: rgba(255, 215, 0, 0.15) !important;
    color: #c0d0e8 !important;
}

/* Alert Primary */
html[data-theme="royal"] .alert-primary,
html.dark-mode .alert-primary {
    background: rgba(30, 60, 114, 0.4) !important;
    border-color: rgba(30, 60, 114, 0.6) !important;
    color: #c0d0e8 !important;
}

/* Alert Secondary */
html[data-theme="royal"] .alert-secondary,
html.dark-mode .alert-secondary {
    background: rgba(108, 117, 125, 0.2) !important;
    border-color: rgba(108, 117, 125, 0.4) !important;
    color: #c0d0e8 !important;
}

/* Alert Dark - Override to be visible */
html[data-theme="royal"] .alert-dark,
html.dark-mode .alert-dark {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(255, 215, 0, 0.2) !important;
    color: #ffffff !important;
}

/* Ensure all alert text content is visible */
html[data-theme="royal"] .alert strong,
html[data-theme="royal"] .alert b,
html[data-theme="royal"] .alert h1,
html[data-theme="royal"] .alert h2,
html[data-theme="royal"] .alert h3,
html[data-theme="royal"] .alert h4,
html[data-theme="royal"] .alert h5,
html[data-theme="royal"] .alert h6,
html[data-theme="royal"] .alert p,
html[data-theme="royal"] .alert li,
html[data-theme="royal"] .alert span,
html.dark-mode .alert strong,
html.dark-mode .alert b,
html.dark-mode .alert h1,
html.dark-mode .alert h2,
html.dark-mode .alert h3,
html.dark-mode .alert h4,
html.dark-mode .alert h5,
html.dark-mode .alert h6,
html.dark-mode .alert p,
html.dark-mode .alert li,
html.dark-mode .alert span {
    color: inherit !important;
}

/* Alert close button */
html[data-theme="royal"] .alert .btn-close,
html[data-theme="royal"] .btn-close,
html.dark-mode .alert .btn-close,
html.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
}

/* Form Validation - Invalid Feedback */
html[data-theme="royal"] .invalid-feedback,
html.dark-mode .invalid-feedback {
    color: #f87171 !important;
}

html[data-theme="royal"] .valid-feedback,
html.dark-mode .valid-feedback {
    color: #4ade80 !important;
}

/* Form validation state - Invalid */
html[data-theme="royal"] .is-invalid,
html[data-theme="royal"] .was-validated :invalid,
html.dark-mode .is-invalid,
html.dark-mode .was-validated :invalid {
    border-color: #ef4444 !important;
}

html[data-theme="royal"] .is-invalid:focus,
html[data-theme="royal"] .was-validated :invalid:focus,
html.dark-mode .is-invalid:focus,
html.dark-mode .was-validated :invalid:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 0.25rem rgba(239, 68, 68, 0.25) !important;
}

/* Form validation state - Valid */
html[data-theme="royal"] .is-valid,
html[data-theme="royal"] .was-validated :valid,
html.dark-mode .is-valid,
html.dark-mode .was-validated :valid {
    border-color: #22c55e !important;
}

/* Django Errorlist styling */
html[data-theme="royal"] .errorlist,
html[data-theme="royal"] ul.errorlist,
html.dark-mode .errorlist,
html.dark-mode ul.errorlist {
    color: #f87171 !important;
    background: transparent !important;
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

html[data-theme="royal"] .errorlist li,
html.dark-mode .errorlist li {
    color: #f87171 !important;
    padding: 0.25rem 0;
}

/* Generic card with white background override */
html[data-theme="royal"] .card,
html[data-theme="royal"] .card-body,
html.dark-mode .card,
html.dark-mode .card-body {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border-color: rgba(255, 215, 0, 0.1) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .card-header,
html.dark-mode .card-header {
    background: rgba(0, 0, 0, 0.3) !important;
    border-bottom-color: rgba(255, 215, 0, 0.15) !important;
    color: #ffffff !important;
}

html[data-theme="royal"] .card-footer,
html.dark-mode .card-footer {
    background: rgba(0, 0, 0, 0.2) !important;
    border-top-color: rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] .card-title,
html.dark-mode .card-title {
    color: #ffffff !important;
}

html[data-theme="royal"] .card-subtitle,
html.dark-mode .card-subtitle {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .card-text,
html.dark-mode .card-text {
    color: #c0d0e8 !important;
}

/* Background utility class overrides */
html[data-theme="royal"] .bg-white,
html[data-theme="royal"] .bg-light,
html.dark-mode .bg-white,
html.dark-mode .bg-light {
    background: #0f1e36 !important;
}

html[data-theme="royal"] .bg-body,
html.dark-mode .bg-body {
    background: #0a1628 !important;
}

/* Text utility class overrides */
html[data-theme="royal"] .text-dark,
html.dark-mode .text-dark {
    color: #ffffff !important;
}

html[data-theme="royal"] .text-body,
html.dark-mode .text-body {
    color: #c0d0e8 !important;
}

/* Select dropdown options */
html[data-theme="royal"] option,
html.dark-mode option {
    background: #0f1e36 !important;
    color: #ffffff !important;
}

/* Popovers, Tooltips */
html[data-theme="royal"] .popover,
html.dark-mode .popover {
    background: #152a4a !important;
    border-color: rgba(255, 215, 0, 0.2) !important;
}

html[data-theme="royal"] .popover-header,
html.dark-mode .popover-header {
    background: #0f1e36 !important;
    color: #FFD700 !important;
    border-bottom-color: rgba(255, 215, 0, 0.15) !important;
}

html[data-theme="royal"] .popover-body,
html.dark-mode .popover-body {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .bs-popover-auto[data-popper-placement^="top"] > .popover-arrow::after,
html[data-theme="royal"] .bs-popover-top > .popover-arrow::after,
html.dark-mode .bs-popover-auto[data-popper-placement^="top"] > .popover-arrow::after,
html.dark-mode .bs-popover-top > .popover-arrow::after {
    border-top-color: #152a4a !important;
}

html[data-theme="royal"] .bs-popover-auto[data-popper-placement^="bottom"] > .popover-arrow::after,
html[data-theme="royal"] .bs-popover-bottom > .popover-arrow::after,
html.dark-mode .bs-popover-auto[data-popper-placement^="bottom"] > .popover-arrow::after,
html.dark-mode .bs-popover-bottom > .popover-arrow::after {
    border-bottom-color: #152a4a !important;
}

html[data-theme="royal"] .tooltip-inner,
html.dark-mode .tooltip-inner {
    background: #0f1e36 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 215, 0, 0.2) !important;
}

/* ===== GLOBAL DARK MODE CATCH-ALL ===== */

/* Nuclear: any element with inline background:white or #fff */
html.dark-mode [style*="background: white"],
html.dark-mode [style*="background:#fff"],
html.dark-mode [style*="background: #fff"],
html.dark-mode [style*="background-color: white"],
html.dark-mode [style*="background-color:#fff"],
html.dark-mode [style*="background-color: #fff"],
html.dark-mode [style*="background:#ffffff"],
html.dark-mode [style*="background: #ffffff"],
html.dark-mode [style*="background-color:#ffffff"],
html.dark-mode [style*="background-color: #ffffff"] {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border-color: rgba(255, 215, 0, 0.1) !important;
    color: #e0e0e0 !important;
}

/* Text inside overridden white containers */
html.dark-mode [style*="background: white"] h1,
html.dark-mode [style*="background: white"] h2,
html.dark-mode [style*="background: white"] h3,
html.dark-mode [style*="background: white"] h4,
html.dark-mode [style*="background: white"] h5,
html.dark-mode [style*="background: #fff"] h1,
html.dark-mode [style*="background: #fff"] h2,
html.dark-mode [style*="background: #fff"] h3,
html.dark-mode [style*="background: #fff"] h4,
html.dark-mode [style*="background: #fff"] h5,
html.dark-mode [style*="background:#fff"] h1,
html.dark-mode [style*="background:#fff"] h2,
html.dark-mode [style*="background:#fff"] h3,
html.dark-mode [style*="background:#fff"] h4,
html.dark-mode [style*="background:#fff"] h5 {
    color: #FFD700 !important;
}

html.dark-mode [style*="background: white"] p,
html.dark-mode [style*="background: white"] span,
html.dark-mode [style*="background: white"] li,
html.dark-mode [style*="background: white"] td,
html.dark-mode [style*="background: white"] label,
html.dark-mode [style*="background: #fff"] p,
html.dark-mode [style*="background: #fff"] span,
html.dark-mode [style*="background: #fff"] li,
html.dark-mode [style*="background:#fff"] p,
html.dark-mode [style*="background:#fff"] span,
html.dark-mode [style*="background:#fff"] li {
    color: #c0d0e8 !important;
}

/* Named card classes across all pages */
html.dark-mode .manifesto-card,
html.dark-mode .manifesto-item,
html.dark-mode .featured-card,
html.dark-mode .filter-section,
html.dark-mode .promise-card,
html.dark-mode .promise-detail-card,
html.dark-mode .discussion-card,
html.dark-mode .comment-card,
html.dark-mode .comment-item,
html.dark-mode .reply-item,
html.dark-mode .voter-guide-card,
html.dark-mode .why-vote-card,
html.dark-mode .sidebar-card,
html.dark-mode .main-content-card,
html.dark-mode .highlight-card,
html.dark-mode .empty-state,
html.dark-mode .solution-card,
html.dark-mode .kpi-card,
html.dark-mode .strategy-card,
html.dark-mode .news-card,
html.dark-mode .category-card,
html.dark-mode .trending-card,
html.dark-mode .survey-card,
html.dark-mode .ppp-card,
html.dark-mode .analytics-card,
html.dark-mode .overview-card,
html.dark-mode .placeholder-card,
html.dark-mode .enquiry-card,
html.dark-mode .form-card,
html.dark-mode .delete-card,
html.dark-mode .content-panel,
html.dark-mode .info-card,
html.dark-mode .search-panel,
html.dark-mode .submit-card,
html.dark-mode .guide-step {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    color: #e0e0e0 !important;
}

/* Headings inside dark cards */
html.dark-mode .manifesto-card h3, html.dark-mode .manifesto-card h4,
html.dark-mode .manifesto-item h3, html.dark-mode .featured-card h3,
html.dark-mode .promise-card h4, html.dark-mode .promise-body h4,
html.dark-mode .sidebar-card h3, html.dark-mode .main-content-card h2,
html.dark-mode .main-content-card h3, html.dark-mode .highlight-card h4,
html.dark-mode .solution-card h3, html.dark-mode .news-card h3,
html.dark-mode .kpi-card h3, html.dark-mode .strategy-card h3,
html.dark-mode .why-vote-card .vote-stat,
html.dark-mode .section-title {
    color: #FFD700 !important;
}

/* Body text inside dark cards */
html.dark-mode .manifesto-card p, html.dark-mode .manifesto-item p,
html.dark-mode .featured-card p, html.dark-mode .promise-card p,
html.dark-mode .sidebar-card p, html.dark-mode .main-content-card p,
html.dark-mode .highlight-card p, html.dark-mode .solution-card p,
html.dark-mode .news-card p, html.dark-mode .kpi-card p,
html.dark-mode .strategy-card p, html.dark-mode .why-vote-card .vote-text,
html.dark-mode .comment-text, html.dark-mode .comment-meta {
    color: #c0d0e8 !important;
}

/* Muted text */
html.dark-mode .scope-badge, html.dark-mode .scope-tag,
html.dark-mode .manifesto-scope, html.dark-mode .manifesto-views,
html.dark-mode .results-count, html.dark-mode .party-name,
html.dark-mode .promise-party, html.dark-mode .promise-rating {
    color: #8aa4c8 !important;
}

/* Form inputs globally */
html.dark-mode .form-control,
html.dark-mode .form-select,
html.dark-mode textarea.form-control {
    background-color: #0f1e36 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 215, 0, 0.15) !important;
}

html.dark-mode .form-control:focus,
html.dark-mode .form-select:focus {
    border-color: #FFD700 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 215, 0, 0.15) !important;
}

html.dark-mode .form-control::placeholder {
    color: #8aa4c8 !important;
}

/* Pagination */
html.dark-mode .pagination .page-link {
    background: #152a4a !important;
    color: #c0d0e8 !important;
    border-color: rgba(255, 215, 0, 0.1) !important;
}

html.dark-mode .pagination .page-item.active .page-link {
    background: #1e3c72 !important;
    border-color: #FFD700 !important;
    color: white !important;
}

/* Tables */
html.dark-mode .table { color: #e0e0e0 !important; }
html.dark-mode .table th { background: #0f1e36 !important; color: #FFD700 !important; border-color: rgba(255, 215, 0, 0.1) !important; }
html.dark-mode .table td { border-color: rgba(255, 215, 0, 0.08) !important; }
html.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(255, 215, 0, 0.03) !important; color: #e0e0e0 !important; }

/* Modals */
html.dark-mode .modal-content { background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important; border: 1px solid rgba(255, 215, 0, 0.15) !important; color: #e0e0e0 !important; }
html.dark-mode .modal-header { border-bottom-color: rgba(255, 215, 0, 0.15) !important; }
html.dark-mode .modal-header .modal-title { color: #FFD700 !important; }
html.dark-mode .modal-footer { border-top-color: rgba(255, 215, 0, 0.15) !important; }

/* List groups */
html.dark-mode .list-group-item { background: #152a4a !important; border-color: rgba(255, 215, 0, 0.08) !important; color: #e0e0e0 !important; }

/* Party elements */
html.dark-mode .party-filter-btn { background: #152a4a !important; border-color: rgba(255, 215, 0, 0.15) !important; color: #c0d0e8 !important; }
html.dark-mode .party-filter-btn:hover { border-color: #FFD700 !important; color: #FFD700 !important; }
html.dark-mode .party-logo, html.dark-mode .party-mini-badge, html.dark-mode .party-logo-hero, html.dark-mode .party-logo-large { background: #0f1e36 !important; }

/* Dropdowns */
html.dark-mode .dropdown-menu { background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important; border: 1px solid rgba(255, 215, 0, 0.15) !important; }
html.dark-mode .dropdown-item { color: #c0d0e8 !important; }
html.dark-mode .dropdown-item:hover { background: rgba(255, 215, 0, 0.1) !important; color: #FFD700 !important; }

/* Menu Hub Pages */
html[data-theme="royal"] .menu-surface,
html.dark-mode .menu-surface {
    background: linear-gradient(145deg, #152a4a 0%, #0f1e36 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.12) !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="royal"] .rail-title,
html.dark-mode .rail-title {
    color: #8aa4c8 !important;
}

html[data-theme="royal"] .section-jump-list a,
html[data-theme="royal"] .feature-link-list a,
html.dark-mode .section-jump-list a,
html.dark-mode .feature-link-list a {
    background: rgba(10, 22, 40, 0.55) !important;
    border: 1px solid rgba(255, 215, 0, 0.1) !important;
    color: #c0d0e8 !important;
    box-shadow: none !important;
}

html[data-theme="royal"] .section-jump-list a:hover,
html[data-theme="royal"] .feature-link-list a:hover,
html.dark-mode .section-jump-list a:hover,
html.dark-mode .feature-link-list a:hover {
    background: rgba(21, 42, 74, 0.92) !important;
    border-color: rgba(255, 215, 0, 0.28) !important;
    color: #FFD700 !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22) !important;
}

html[data-theme="royal"] .page-section-card h2,
html[data-theme="royal"] .menu-page-cta h2,
html.dark-mode .page-section-card h2,
html.dark-mode .menu-page-cta h2 {
    color: #ffffff !important;
}

html[data-theme="royal"] .page-section-card p,
html[data-theme="royal"] .menu-page-cta p,
html[data-theme="royal"] .menu-point-list,
html[data-theme="royal"] .menu-inline-links,
html[data-theme="royal"] .menu-inline-links a,
html.dark-mode .page-section-card p,
html.dark-mode .menu-page-cta p,
html.dark-mode .menu-point-list,
html.dark-mode .menu-inline-links,
html.dark-mode .menu-inline-links a {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .section-card-kicker,
html.dark-mode .section-card-kicker {
    color: #FFD700 !important;
}

html[data-theme="royal"] .menu-page-cta,
html.dark-mode .menu-page-cta {
    background: linear-gradient(135deg, rgba(10, 22, 40, 0.86), rgba(30, 64, 112, 0.52)) !important;
}

html[data-theme="royal"] .page-section-card:target,
html.dark-mode .page-section-card:target {
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.38), 0 18px 45px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="royal"] .contact-highlight,
html[data-theme="royal"] .audience-side,
html.dark-mode .contact-highlight,
html.dark-mode .audience-side {
    background: linear-gradient(135deg, rgba(10, 22, 40, 0.86), rgba(30, 64, 112, 0.42)) !important;
    border-color: rgba(255, 215, 0, 0.18) !important;
}

html[data-theme="royal"] .adviser-topic,
html.dark-mode .adviser-topic {
    background: rgba(10, 22, 40, 0.55) !important;
    border-color: rgba(255, 215, 0, 0.1) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .mission-banner,
html.dark-mode .mission-banner {
    background: linear-gradient(135deg, #0f1e36 0%, #1e3c72 100%) !important;
    border-bottom-color: #FFD700 !important;
}

html[data-theme="royal"] .mission-card,
html.dark-mode .mission-card {
    background: rgba(10, 22, 40, 0.78) !important;
    color: #e8eef9 !important;
    border: 1px solid rgba(255, 215, 0, 0.12) !important;
}

html[data-theme="royal"] .mission-tagline,
html.dark-mode .mission-tagline {
    color: #FFD700 !important;
}

html[data-theme="royal"] .about-highlight-card,
html.dark-mode .about-highlight-card {
    background: linear-gradient(135deg, rgba(10, 22, 40, 0.78), rgba(30, 64, 112, 0.38)) !important;
    border-color: rgba(255, 215, 0, 0.18) !important;
}

html[data-theme="royal"] .about-illustration,
html.dark-mode .about-illustration {
    background: rgba(10, 22, 40, 0.55) !important;
}

html[data-theme="royal"] .demo-credentials,
html.dark-mode .demo-credentials {
    background: rgba(10, 22, 40, 0.55) !important;
    border-color: rgba(255, 215, 0, 0.1) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .demo-tab,
html.dark-mode .demo-tab {
    background: rgba(10, 22, 40, 0.76) !important;
    border-color: rgba(255, 215, 0, 0.1) !important;
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .demo-tab:hover,
html.dark-mode .demo-tab:hover {
    color: #ffffff !important;
}

html[data-theme="royal"] .demo-tab[data-demo="investors"].is-active,
html.dark-mode .demo-tab[data-demo="investors"].is-active {
    color: #10233f !important;
}

html[data-theme="royal"] .sitemap-links li,
html.dark-mode .sitemap-links li {
    border-bottom-color: rgba(255, 215, 0, 0.1) !important;
}

html[data-theme="royal"] .sitemap-links a,
html.dark-mode .sitemap-links a {
    color: #c0d0e8 !important;
}

html[data-theme="royal"] .showcase-proof,
html.dark-mode .showcase-proof,
html[data-theme="royal"] .demo-feature-card,
html.dark-mode .demo-feature-card {
    background: rgba(10, 22, 40, 0.5) !important;
    border-color: rgba(255, 215, 0, 0.12) !important;
}

/* Tabs */
html.dark-mode .nav-tabs .nav-link { color: #c0d0e8 !important; }
html.dark-mode .nav-tabs .nav-link.active { background: #152a4a !important; color: #FFD700 !important; border-color: rgba(255, 215, 0, 0.2) rgba(255, 215, 0, 0.2) transparent !important; }

/* Badges */
html.dark-mode .badge.bg-light { background: #152a4a !important; color: #c0d0e8 !important; }

/* Reaction buttons */
html.dark-mode .reaction-btn { background: #0f1e36 !important; border-color: rgba(255, 215, 0, 0.15) !important; color: #c0d0e8 !important; }
html.dark-mode .reaction-btn:hover, html.dark-mode .reaction-btn.active { border-color: #FFD700 !important; background: rgba(255, 215, 0, 0.1) !important; }

/* Border color fixes */
html.dark-mode .border-bottom, html.dark-mode .border-top,
html.dark-mode [style*="border-top: 1px"], html.dark-mode [style*="border-bottom: 1px"] {
    border-color: rgba(255, 215, 0, 0.1) !important;
}

/* View links */
html.dark-mode .view-link, html.dark-mode .view-btn, html.dark-mode .back-link { color: #FFD700 !important; }
