:root, [data-theme="light"] {
    --macodex-bg: #ffffff;
    --macodex-sidebar-bg: #f8f9fa;
    --macodex-text: #333333;
    --macodex-accent: #0088ff;
    --macodex-border: #e0e0e0;
    --macodex-card-bg: #ffffff;
}

[data-theme="dark"] {
    --macodex-bg: #0a192f;
    --macodex-sidebar-bg: #112240;
    --macodex-text: #ccd6f6;
    --macodex-accent: #00d2ff;
    --macodex-border: #233554;
    --macodex-card-bg: #112240;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: 'Inter', sans-serif; overflow-x: hidden; }

#macodex-app { background: var(--macodex-bg); color: var(--macodex-text); min-height: 100vh; }

/* TOP BAR */
.macodex-top-bar {
    position: fixed; top: 0; left: 0; right: 0; height: 60px;
    background: var(--macodex-sidebar-bg);
    border-bottom: 1px solid var(--macodex-border);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px; z-index: 1100;
}

.macodex-top-left { display: flex; align-items: center; gap: 15px; }

.macodex-logo { font-weight: 900; color: var(--macodex-accent); cursor: pointer; font-size: 1.2rem; letter-spacing: 1px; }

.macodex-top-right { display: flex; align-items: center; gap: 20px; }

.macodex-top-icon { font-size: 1.2rem; cursor: pointer; }

.macodex-user-pill { 
    display: flex; align-items: center; gap: 10px; cursor: pointer; 
    padding-left: 15px; border-left: 1px solid var(--macodex-border);
}

.user-info-desktop { text-align: right; line-height: 1.2; }
.user-name { font-size: 0.85rem; font-weight: bold; }
.user-firm { font-size: 0.7rem; color: #888; }

.macodex-avatar {
    width: 35px; height: 35px; border-radius: 50%;
    background: var(--macodex-accent); color: #0a192f;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 0.85rem;
}

/* LAYOUT CONTAINER */
.macodex-dashboard-container {
    display: flex; min-height: 100vh; padding-top: 60px; padding-bottom: 35px;
}

/* SIDEBAR (LEFT) */
.macodex-sidebar {
    width: 250px; background: var(--macodex-sidebar-bg);
    border-right: 1px solid var(--macodex-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto; overflow-x: hidden;
}

.macodex-sidebar.collapsed { width: 0; opacity: 0; pointer-events: none; }

/* RIGHT PANEL */
.macodex-right-panel {
    width: 280px; background: var(--macodex-sidebar-bg);
    border-left: 1px solid var(--macodex-border);
    padding: 20px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.macodex-right-panel.collapsed { width: 0; padding: 0; opacity: 0; pointer-events: none; border-left: 0; }

.macodex-close-panel { background: none; border: 0; color: var(--macodex-text); font-size: 1.5rem; cursor: pointer; }

/* MAIN CONTENT */
.macodex-main-content { flex: 1; padding: 30px; min-width: 0; }

/* NAV ITEMS */
.macodex-nav-item {
    padding: 12px 20px; margin: 5px 10px; border-radius: 10px;
    cursor: pointer; display: flex; align-items: center; gap: 12px;
    font-size: 0.9rem; transition: background 0.2s;
}

.macodex-nav-item:hover { background: rgba(0,210,255,0.05); }
.macodex-nav-item.active { background: var(--macodex-accent); color: #0a192f; font-weight: bold; }

/* CARDS & UI */
.macodex-card {
    background: var(--macodex-card-bg); border: 1px solid var(--macodex-border);
    border-radius: 16px; padding: 20px; margin-bottom: 20px;
}

.macodex-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; margin-top: 20px; }
.macodex-stat-card { background: var(--macodex-sidebar-bg); padding: 15px; border-radius: 12px; text-align: center; border: 1px solid var(--macodex-border); }
.macodex-stat-value { font-size: 1.8rem; font-weight: 800; color: var(--macodex-accent); display: block; }
.macodex-stat-label { font-size: 0.7rem; color: #888; text-transform: uppercase; letter-spacing: 1px; }

/* TRUST METER */
.macodex-trust-meter { width: 100%; height: 8px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; }
.macodex-trust-fill { height: 100%; background: var(--macodex-accent); transition: width 0.5s; }

/* NOTIFICATIONS */
.macodex-notification-bell { position: relative; cursor: pointer; }
.macodex-notification-count {
    position: absolute; top: -5px; right: -8px; background: #ff4d4d; color: white;
    font-size: 9px; padding: 2px 5px; border-radius: 10px; font-weight: bold;
}
.macodex-notification-dropdown {
    position: absolute; top: 40px; right: 0; width: 300px;
    background: var(--macodex-card-bg); border: 1px solid var(--macodex-border);
    border-radius: 12px; display: none; z-index: 1200; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.macodex-notification-dropdown.show { display: block; }
.macodex-notif-item { padding: 15px; border-bottom: 1px solid var(--macodex-border); font-size: 0.85rem; }

/* FORM ELEMENTS */
.macodex-profile-form label { display: block; margin-bottom: 8px; font-size: 0.8rem; color: #888; font-weight: bold; }
.macodex-profile-form input, .macodex-profile-form textarea {
    width: 100%; padding: 12px; margin-bottom: 15px; background: rgba(255,255,255,0.02);
    border: 1px solid var(--macodex-border); color: white; border-radius: 8px;
}
.macodex-payment-btn {
    padding: 12px 20px; background: var(--macodex-accent); color: #0a192f;
    border: 0; border-radius: 10px; font-weight: 800; cursor: pointer; width: 100%;
}

/* MARQUEE */
.macodex-bottom-banner {
    position: fixed; bottom: 0; left: 0; right: 0; height: 35px;
    background: var(--macodex-sidebar-bg); border-top: 1px solid var(--macodex-border);
    display: flex; align-items: center; z-index: 1100;
}
.macodex-banner-label {
    background: var(--macodex-accent); color: #0a192f; padding: 0 15px;
    height: 100%; display: flex; align-items: center; font-weight: 800; font-size: 0.65rem;
}
.macodex-banner-track { flex: 1; overflow: hidden; }
.macodex-banner-content {
    display: flex; white-space: nowrap; animation: macodex-marquee 40s linear infinite;
}
.macodex-banner-content span { padding-right: 150px; font-size: 0.85rem; font-weight: 500; }

@keyframes macodex-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 1024px) {
    .macodex-sidebar {
        position: fixed; left: 0; top: 60px; bottom: 35px; z-index: 1050; width: 260px;
        box-shadow: 15px 0 30px rgba(0,0,0,0.3); transform: translateX(0);
    }
    .macodex-sidebar.collapsed { transform: translateX(-100%); opacity: 1; width: 260px; }
    
    .macodex-right-panel {
        position: fixed; right: 0; top: 60px; bottom: 35px; z-index: 1050; width: 280px;
        box-shadow: -15px 0 30px rgba(0,0,0,0.3); transform: translateX(0);
    }
    .macodex-right-panel.collapsed { transform: translateX(100%); opacity: 1; width: 280px; }
    
    .macodex-main-content { padding: 20px; }
    .user-info-desktop { display: none; }
}

@media (max-width: 768px) {
    .macodex-stats-grid { grid-template-columns: 1fr 1fr; }
    .macodex-booth-grid { grid-template-columns: 1fr 1fr; }
    .macodex-notification-dropdown { position: fixed; left: 10px; right: 10px; width: auto; }
}
