        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        /* ═══════════════════════════════════════════════════
           BRANDING CLASSES
           ═══════════════════════════════════════════════════ */
        
        /* EmperiaL / EmpiRa'EL brand styling - purple italic */
        .emperial-brand {
            color: #8b5cf6 !important;
            font-style: italic !important;
            font-weight: bold;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
            background: linear-gradient(135deg, #581c87, #000000, #166534);
            color: white;
            min-height: 100vh;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 2rem;
        }
        
        /* Top Navigation */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: rgba(0, 0, 0, 0.95);
            backdrop-filter: blur(10px);
            padding: 0.75rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 2000;
            border-bottom: 1px solid rgba(251, 191, 36, 0.3);
        }
        
        .nav-logo {
            font-size: 1.2rem;
            font-weight: bold;
            color: #fbbf24;
        }
        
        .nav-right {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .nav-btn {
            background: linear-gradient(45deg, #fbbf24, #10b981);
            color: black;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: transform 0.2s;
        }
        
        .nav-btn:hover {
            transform: scale(1.05);
        }
        
        .user-avatar {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            background: linear-gradient(45deg, #fbbf24, #10b981);
            display: flex;
            align-items: center;
            justify-content: center;
            color: black;
            font-weight: bold;
            cursor: pointer;
        }
        
        .body-content {
            margin-top: 70px;
        }
        
        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            z-index: 3000;
            overflow-y: auto;
            padding: 2rem;
        }
        
        .modal.active {
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        .modal-content {
            background: linear-gradient(135deg, #581c87, #000000, #166534);
            border: 3px solid #fbbf24;
            border-radius: 20px;
            padding: 2rem;
            max-width: 600px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
        }
        
        .modal-close {
            position: absolute;
            top: 10px;
            right: 15px;
            background: none;
            border: none;
            color: #fbbf24;
            font-size: 1.5rem;
            cursor: pointer;
        }
        
        .modal-title {
            color: #fbbf24;
            font-size: 1.8rem;
            margin-bottom: 1.5rem;
            text-align: center;
        }
        
        /* Form Styles */
        .form-group {
            margin-bottom: 1.5rem;
        }
        
        .form-label {
            color: #fbbf24;
            font-weight: bold;
            display: block;
            margin-bottom: 0.5rem;
        }
        
        .form-input, .form-select, .form-textarea {
            width: 100%;
            padding: 0.75rem;
            border: 2px solid #fbbf24;
            border-radius: 8px;
            background: rgba(0, 0, 0, 0.5);
            color: white;
            font-size: 1rem;
        }
        
        .form-textarea {
            min-height: 100px;
            resize: vertical;
        }
        
        .form-input:focus, .form-select:focus, .form-textarea:focus {
            outline: none;
            border-color: #10b981;
            box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
        }
        
        .btn {
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: transform 0.2s;
            font-size: 1rem;
        }
        
        .btn:hover {
            transform: scale(1.05);
        }
        
        .btn-primary {
            background: linear-gradient(45deg, #fbbf24, #10b981);
            color: #111827;
        }
        
        .btn-primary-light {
            background: linear-gradient(135deg, #fbbf24, #f59e0b);
            color: #111827;
        }
        
        .btn-secondary {
            background: rgba(251, 191, 36, 0.2);
            border: 2px solid #fbbf24;
            color: #fbbf24;
        }
        
        .btn-danger {
            background: linear-gradient(45deg, #dc2626, #991b1b);
            color: white;
        }
        
        /* Login Type Selector */
        .login-types {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
            margin-bottom: 2rem;
        }
        
        .login-type-card {
            background: rgba(0, 0, 0, 0.5);
            border: 2px solid rgba(251, 191, 36, 0.3);
            border-radius: 15px;
            padding: 1.5rem;
            cursor: pointer;
            transition: all 0.3s;
            text-align: center;
        }
        
        .login-type-card:hover, .login-type-card.active {
            border-color: #fbbf24;
            background: rgba(251, 191, 36, 0.1);
            transform: translateY(-3px);
        }
        
        .login-type-icon {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
        }
        
        .login-type-title {
            color: #fbbf24;
            font-weight: bold;
            font-size: 1.1rem;
        }
        
        /* Block Styles */
        .block {
            background: rgba(0, 0, 0, 0.3);
            border: 2px solid rgba(251, 191, 36, 0.3);
            border-radius: 15px;
            padding: 2rem;
            margin-bottom: 2rem;
        }
        
        .block-title {
            color: #fbbf24;
            font-size: 1.8rem;
            margin-bottom: 1rem;
            text-align: center;
        }
        
        /* Cards Grid */
        .cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 0.75rem;
        }
        
        /* Compact cards for dashboard - fits more on screen */
        .cards-grid-compact {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 0.5rem;
        }
        
        .card {
            background: rgba(0, 0, 0, 0.4);
            border: 2px solid rgba(251, 191, 36, 0.3);
            border-radius: 10px;
            padding: 0.75rem;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .card:hover {
            border-color: #fbbf24;
            transform: translateY(-2px);
        }
        
        .card[draggable="true"] {
            cursor: grab;
            user-select: none;
        }
        
        .card[draggable="true"]:active {
            cursor: grabbing;
        }
        
        .card-icon {
            font-size: 1.75rem;
            margin-bottom: 0.5rem;
            text-align: center;
        }
        
        .card-title {
            color: #fbbf24;
            font-size: 0.85rem;
            margin-bottom: 0.25rem;
            font-weight: bold;
            text-align: center;
        }
        
        .card-desc {
            color: #d1d5db;
            font-size: 0.7rem;
            text-align: center;
        }
        
        /* Table Styles */
        .table-container {
            overflow-x: auto;
        }
        
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 1rem;
        }
        
        th, td {
            padding: 0.75rem;
            text-align: left;
            border-bottom: 1px solid rgba(251, 191, 36, 0.2);
        }
        
        th {
            background: rgba(251, 191, 36, 0.1);
            color: #fbbf24;
            font-weight: bold;
        }
        
        tr:hover {
            background: rgba(251, 191, 36, 0.05);
        }
        
        /* Alert/Message Styles */
        .alert {
            padding: 1rem;
            border-radius: 8px;
            margin-bottom: 1rem;
        }
        
        .alert-success {
            background: rgba(16, 185, 129, 0.2);
            border: 2px solid #10b981;
            color: #6ee7b7;
        }
        
        .alert-error {
            background: rgba(220, 38, 38, 0.2);
            border: 2px solid #dc2626;
            color: #fca5a5;
        }
        
        .alert-info {
            background: rgba(147, 51, 234, 0.2);
            border: 2px solid #9333ea;
            color: #c4b5fd;
        }
        
        /* Loading Spinner */
        .spinner {
            border: 3px solid rgba(251, 191, 36, 0.3);
            border-top: 3px solid #fbbf24;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 2rem auto;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        /* Password Toggle */
        .password-container {
            position: relative;
        }
        
        .password-toggle {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            cursor: pointer;
            color: #fbbf24;
            font-size: 1.2rem;
            padding: 5px;
            user-select: none;
        }
        
        .password-toggle:hover {
            color: #10b981;
        }
        
        /* Breadcrumb Navigation */
        .breadcrumb {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            padding: 0.75rem;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 8px;
            border: 1px solid rgba(251, 191, 36, 0.2);
        }
        
        .breadcrumb-item {
            color: #d1d5db;
            text-decoration: none;
            transition: color 0.2s;
        }
        
        .breadcrumb-item:hover {
            color: #fbbf24;
        }
        
        .breadcrumb-item.active {
            color: #fbbf24;
            font-weight: bold;
        }
        
        .breadcrumb-separator {
            color: #6b7280;
        }
        
        /* Bottom Navigation */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.98), rgba(0, 0, 0, 0.92));
            backdrop-filter: blur(12px);
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: stretch;
            border-top: 2px solid rgba(251, 191, 36, 0.4);
            z-index: 1999;
            box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
        }
        
        /* Add padding to body to prevent content from being hidden */
        body {
            padding-bottom: 70px;
        }
        
        .bottom-nav-links {
            display: flex;
            gap: 0;
            width: 100%;
            max-width: 600px;
            justify-content: space-around;
        }
        
        .bottom-nav-link {
            color: #9ca3af;
            text-decoration: none;
            font-size: 0.75rem;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 0.75rem 1rem;
            border-radius: 0;
            min-width: 70px;
        }
        
        .bottom-nav-link:hover {
            color: #fbbf24;
            background: rgba(251, 191, 36, 0.1);
        }
        
        .bottom-nav-link.active {
            color: #fbbf24;
            background: rgba(251, 191, 36, 0.15);
        }
        
        .bottom-nav-icon {
            font-size: 1.5rem;
            margin-bottom: 0.25rem;
        }
        
        .bottom-nav-label {
            font-size: 0.7rem;
            font-weight: 500;
        }
        
        /* Help Button */
        .help-button {
            position: fixed;
            bottom: 100px;
            left: 30px;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: linear-gradient(45deg, #fbbf24, #10b981);
            color: black;
            border: none;
            font-size: 1.8rem;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(251, 191, 36, 0.5);
            z-index: 1998;
            transition: transform 0.2s;
        }
        
        .help-button:hover {
            transform: scale(1.1);
        }
        
        /* Access Badge */
        .access-badge {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.85rem;
            font-weight: bold;
            margin-left: 0.5rem;
        }
        
        .access-badge.granted {
            background: rgba(16, 185, 129, 0.2);
            color: #10b981;
            border: 1px solid #10b981;
        }
        
        .access-badge.locked {
            background: rgba(220, 38, 38, 0.2);
            color: #dc2626;
            border: 1px solid #dc2626;
        }
        
        .access-badge.upgrade {
            background: rgba(251, 191, 36, 0.2);
            color: #fbbf24;
            border: 1px solid #fbbf24;
        }
        
        /* Hierarchical Access Indicator */
        .access-hierarchy {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem;
            background: rgba(88, 28, 135, 0.3);
            border-radius: 8px;
            margin-bottom: 1rem;
            border: 1px solid rgba(147, 51, 234, 0.5);
        }
        
        .access-hierarchy-icon {
            font-size: 1.5rem;
        }
        
        /* Forgot Password Link */
        .forgot-password-link {
            display: block;
            text-align: center;
            margin-top: 1rem;
            color: #10b981;
            text-decoration: none;
            font-size: 0.9rem;
        }
        
        .forgot-password-link:hover {
            color: #fbbf24;
            text-decoration: underline;
        }
        
        /* Hide/Show */
        .hidden {
            display: none !important;
        }
        
        /* Responsive Design - All Screen Sizes */
        
        /* Large Desktop (1400px+) */
        @media (min-width: 1400px) {
            .container {
                max-width: 1300px;
            }
        }
        
        /* Desktop (1200px - 1399px) */
        @media (max-width: 1399px) {
            .container {
                max-width: 1100px;
            }
        }
        
        /* Small Desktop / Tablet Landscape (992px - 1199px) */
        @media (max-width: 1199px) {
            .container {
                max-width: 960px;
                padding: 1rem;
            }
            
            .card-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }
        
        /* Tablet Portrait (768px - 991px) */
        @media (max-width: 991px) {
            .container {
                max-width: 720px;
            }
            
            .card-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            
            /* Header text responsive */
            .header-title-main {
                font-size: 3rem !important;
            }
            
            .header-title-sub {
                font-size: 2rem !important;
            }
        }
        
        /* Mobile Landscape / Small Tablet (576px - 767px) */
        @media (max-width: 767px) {
            .login-types {
                grid-template-columns: 1fr;
            }
            
            .top-nav {
                padding: 0.5rem 1rem;
            }
            
            .container {
                padding: 1rem;
                max-width: 100%;
            }
            
            .nav-logo {
                font-size: 0.9rem;
            }
            
            .nav-btn, .btn {
                padding: 0.4rem 0.8rem;
                font-size: 0.85rem;
            }
            
            /* Flag image responsive */
            .flag-image {
                max-width: 350px !important;
            }
            
            /* Header text responsive */
            .header-title-main {
                font-size: 2.5rem !important;
                letter-spacing: 0.02em !important;
            }
            
            .header-title-sub {
                font-size: 1.8rem !important;
            }
            
            .card-grid {
                grid-template-columns: 1fr 1fr;
                gap: 0.75rem;
            }
            
            .card {
                padding: 1rem;
            }
            
            .card-icon {
                font-size: 1.5rem;
            }
            
            .card-title {
                font-size: 0.9rem;
            }
            
            .card-desc {
                font-size: 0.75rem;
            }
            
            /* Modal responsive */
            .modal-content {
                max-width: 95vw !important;
                margin: 1rem;
                max-height: 90vh;
                overflow-y: auto;
            }
            
            /* App Control tabs responsive */
            .control-tabs {
                flex-wrap: wrap;
            }
            
            .control-tabs button {
                font-size: 0.75rem;
                padding: 0.4rem 0.6rem;
            }
        }
        
        /* Mobile Portrait (up to 575px) */
        @media (max-width: 575px) {
            .top-nav {
                flex-wrap: wrap;
                gap: 0.5rem;
                padding: 0.5rem;
            }
            
            .nav-logo {
                font-size: 0.8rem;
                width: 100%;
                text-align: center;
            }
            
            .nav-right {
                width: 100%;
                justify-content: center;
                gap: 0.5rem;
            }
            
            .nav-btn, .btn {
                padding: 0.35rem 0.6rem;
                font-size: 0.8rem;
            }
            
            /* Flag image responsive */
            .flag-image {
                max-width: 280px !important;
            }
            
            /* Header text responsive */
            .header-title-main {
                font-size: 2rem !important;
                letter-spacing: 0.01em !important;
            }
            
            .header-title-sub {
                font-size: 1.4rem !important;
            }
            
            .header-quote {
                font-size: 1rem !important;
            }
            
            .header-tagline {
                font-size: 0.9rem !important;
            }
            
            .header-membership {
                font-size: 0.85rem !important;
            }
            
            .card-grid {
                grid-template-columns: 1fr;
                gap: 0.75rem;
            }
            
            .card {
                padding: 0.75rem;
            }
            
            /* Block sections responsive */
            .block {
                padding: 1rem;
                margin-bottom: 1rem;
            }
            
            .block-title {
                font-size: 1.1rem;
            }
            
            /* Bottom nav responsive */
            .bottom-nav {
                padding: 0.5rem;
            }
            
            .bottom-nav-btn {
                padding: 0.5rem;
                min-width: 50px;
            }
            
            .bottom-nav-btn span:first-child {
                font-size: 1.2rem;
            }
            
            .bottom-nav-btn span:last-child {
                font-size: 0.6rem;
            }
            
            /* AI Chat widget responsive */
            #aiChatWindow {
                width: calc(100vw - 20px) !important;
                max-width: none !important;
                left: 10px !important;
                right: 10px !important;
                bottom: 80px !important;
                height: 400px !important;
            }
            
            #aiChatToggle {
                width: 50px !important;
                height: 50px !important;
                bottom: 15px !important;
                right: 15px !important;
            }
            
            /* Help button responsive */
            .help-button {
                width: 50px !important;
                height: 50px !important;
                bottom: 15px !important;
                left: 15px !important;
                font-size: 1.5rem !important;
            }
        }
        
        /* Extra Small Mobile (up to 375px) */
        @media (max-width: 375px) {
            .nav-logo {
                font-size: 0.7rem;
            }
            
            .header-title-main {
                font-size: 1.6rem !important;
            }
            
            .header-title-sub {
                font-size: 1.2rem !important;
            }
            
            .flag-image {
                max-width: 240px !important;
            }
        }

        /* ═══════════════════════════════════════════════════
           GLOBAL READABILITY FIXES - V24.9.33
           Ensure all text is readable on dark backgrounds
           ═══════════════════════════════════════════════════ */
        
        /* Override dark text colors to be lighter on dark backgrounds */
        .card-desc, 
        .desc-text,
        small,
        .text-muted,
        .text-secondary {
            color: #d1d5db !important;
        }
        
        /* Ensure form labels and inputs are readable */
        .form-label {
            color: #e5e7eb !important;
        }
        
        /* Fix any purple text that's too dark */
        .emperial-brand {
            color: #a78bfa !important; /* Lighter purple for better contrast */
        }
        
        /* Ensure all paragraphs have good contrast */
        p {
            color: #e5e7eb;
        }
        
        /* Fix gray text to be more readable */
        [style*="color: #6b7280"],
        [style*="color:#6b7280"] {
            color: #9ca3af !important;
        }
        
        /* Scrollbar styling for all scrollable areas */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        
        ::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.3);
            border-radius: 4px;
        }
        
        ::-webkit-scrollbar-thumb {
            background: linear-gradient(135deg, #fbbf24, #10b981);
            border-radius: 4px;
        }
        
        ::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(135deg, #f59e0b, #059669);
        }
        
        /* Ensure all pages have proper scrolling */
        #loggedInContent {
            max-height: calc(100vh - 80px);
            overflow-y: auto;
            padding-bottom: 100px; /* Space for floating widgets */
        }
        
        /* Fix navigation breadcrumb text */
        .breadcrumb-item {
            color: #e5e7eb;
        }
        
        .breadcrumb-item.active {
            color: #fbbf24;
        }
        
        .breadcrumb-separator {
            color: #6b7280;
        }


        /* ═══════════════════════════════════════════════════
           MOBILE RESPONSIVE FIXES - V24.9.34
           Fix text overflow, overlapping elements, spacing
           ═══════════════════════════════════════════════════ */

        /* Role Switcher Bar - ensure scrollable without clipping */
        @media (max-width: 768px) {
            #roleSwitcherBar {
                padding: 0.35rem 0.5rem !important;
            }
            #roleSwitcherBar > div {
                gap: 0.35rem !important;
            }
            #roleSwitcherButtons {
                -ms-overflow-style: none;
                scrollbar-width: none;
            }
            #roleSwitcherButtons::-webkit-scrollbar {
                display: none;
            }
            #roleSwitcherButtons button {
                font-size: 0.65rem !important;
                padding: 0.2rem 0.5rem !important;
                white-space: nowrap;
                flex-shrink: 0;
            }
        }

        /* Version badge - smaller on mobile, avoid overlap */
        @media (max-width: 575px) {
            body > div:first-child {
                font-size: 8px !important;
                padding: 2px 5px !important;
                top: 38px !important;
                right: 5px !important;
                opacity: 0.8;
            }
            
            /* Modal content responsive */
            .modal-content {
                margin: 0.5rem !important;
                max-width: calc(100vw - 1rem) !important;
                max-height: 90vh !important;
            }
            
            /* Form inputs shouldn't overflow */
            .form-input, input[type="text"], input[type="email"], input[type="password"], select, textarea {
                max-width: 100% !important;
                box-sizing: border-box !important;
            }
            
            /* Cards grid single column on mobile */
            .cards-grid {
                grid-template-columns: 1fr !important;
            }
            
            /* Logged in content needs more bottom padding for role switcher + nav */
            #loggedInContent {
                padding-bottom: 140px !important;
            }
            
            /* Floating bubble positioning - avoid overlap with role switcher */
            .draggable-bubble, .floating-bubble {
                bottom: 130px !important;
            }
        }

        /* Ensure text wrapping in card descriptions */
        .card-desc, .card-title {
            word-wrap: break-word;
            overflow-wrap: break-word;
            hyphens: auto;
        }

        /* Tables responsive */
        @media (max-width: 768px) {
            table {
                display: block;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
            .bottom-nav-link {
                min-width: 50px !important;
                padding: 0.5rem 0.4rem !important;
            }
            .bottom-nav-icon {
                font-size: 1.25rem !important;
            }
            .bottom-nav-label {
                font-size: 0.6rem !important;
            }
        }


        /* SA Edit Mode indicator */
        body.sa-edit-mode::after {
            content: 'SA EDIT MODE ACTIVE';
            position: fixed;
            top: 5px;
            left: 50%;
            transform: translateX(-50%);
            background: #a78bfa;
            color: white;
            padding: 2px 12px;
            border-radius: 12px;
            font-size: 0.65rem;
            font-weight: 700;
            z-index: 99999;
            letter-spacing: 0.05em;
            pointer-events: none;
        }
