:root {
    --bg-base: #0a0a0c;
    --sidebar-bg: rgba(18, 18, 22, 0.7);
    --panel-bg: rgba(25, 25, 30, 0.6);
    --gold: #D4AF37;
    --goldborder:rgba(212,175,55,.28);--gold-glow: rgba(212, 175, 55, 0.2);
    --t1: #F5F5F7;
    --t2: #A1A1AA;
    --border: rgba(255, 255, 255, 0.08);
    --radius: 12px;
    --green: #10B981;
    --red: #EF4444;
}

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

body {
    background: var(--bg-base);
    color: var(--t1);
    font-family: 'DM Sans', sans-serif;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.brand-name {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, #fff, #999);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--t2);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--t1);
}

.nav-item.active {
    background: var(--goldborder:rgba(212,175,55,.28);--gold-glow);
    color: var(--gold);
    border-left: 3px solid var(--gold);
}

.vault-glow {
    position: relative;
    overflow: hidden;
}
.vault-glow::after {
    content: ''; position: absolute; top:0; left:-100%; width: 50%; height:100%;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.1), transparent);
    animation: sweep 4s infinite linear;
}
@keyframes sweep { 100% { left: 200%; } }


.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.03);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.u-av {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gold);
    color: #000;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
}
.u-info { line-height: 1.2; }
.u-name { font-size: 13px; font-weight: 700; }
.u-tier { font-size: 11px; color: var(--gold); }

/* MAIN WORKSPACE */
.main-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
}

.topbar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    border-bottom: 1px solid var(--border);
    background: rgba(10,10,12,0.5);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.page-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--t1);
}

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

select {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--t1);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    outline: none;
}

.btn-icon {
    position: relative;
    background: none; border: none; font-size: 20px; cursor: pointer; color: var(--t2); transition: 0.2s;
}
.btn-icon:hover { color: var(--gold); }
.notif-dot {
    position: absolute; top:0; right:0; width:8px; height:8px; background: var(--gold); border-radius:50%;
}

.btn-outline-small {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--t2);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s;
}
.btn-outline-small:hover {
    border-color: var(--gold); color: var(--gold);
}
.btn-gold {
    background: linear-gradient(135deg, #D4AF37, #FDE047);
    color: #000;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(212,175,55,0.3); }

/* PANELS */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.panel {
    display: none;
}
.panel.active {
    display: block;
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 24px;
}
.sc-icon { font-size: 24px; margin-bottom: 12px; }
.sc-val { font-size: 32px; font-weight: 700; font-family: 'Syne', sans-serif; margin-bottom: 4px; }
.sc-lbl { font-size: 13px; color: var(--t2); margin-bottom: 16px; }
.sc-trend { font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 4px; display: inline-block; }
.sc-trend.positive { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.sc-trend.netural { background: rgba(255, 255, 255, 0.05); color: var(--t2); }

/* CHART */
.chart-container {
    padding: 24px;
    margin-bottom: 40px;
}
.cc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.cc-header h3 { font-size: 16px; font-weight: 600; }
.live-pulse { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--gold); font-weight: 700; }
.live-pulse span { width: 8px; height: 8px; background: var(--gold); border-radius: 50%; box-shadow: 0 0 10px var(--gold); animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

/* VAULT */
.vault-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    margin-bottom: 24px;
    border-left: 4px solid var(--gold);
}
.vh-ic { font-size: 40px; }
.vault-hero h2 { margin-bottom: 8px; font-family: 'Syne', sans-serif; }
.vault-hero p { color: var(--t2); font-size: 14px; }

.vault-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.v-item { padding: 20px; }
.vi-head { display: flex; justify-content: space-between; margin-bottom: 12px; }
.vi-head h4 { font-size: 15px; font-weight: 600; }
.badge.success { background: rgba(16, 185, 129, 0.1); color: var(--green); padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.vi-mask { font-family: 'JetBrains Mono', monospace; font-size: 14px; letter-spacing: 0.1em; color: var(--gold); background: rgba(0,0,0,0.3); padding: 12px; border-radius: 8px; margin-bottom: 16px; border: 1px solid rgba(212,175,55,0.2); }
.vi-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--t2); }

/* SWARM */
.swarm-roster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.sa-card { padding: 24px; text-align: center; }
.sa-av { font-size: 48px; margin-bottom: 16px; }
.sa-card h3 { font-family: 'Syne', sans-serif; font-size: 18px; margin-bottom: 4px; }
.sa-card p { font-size: 13px; color: var(--t2); margin-bottom: 20px; }
.sa-metrics { display: flex; justify-content: space-around; background: rgba(0,0,0,0.2); padding: 12px; border-radius: 8px; margin-bottom: 20px; }
.m-val { display: block; font-weight: 700; font-size: 16px; color: var(--t1); }
.m-lbl { font-size: 10px; color: var(--t2); text-transform: uppercase; letter-spacing: 0.05em; }
.sa-status.on { font-size: 12px; font-weight: 700; color: var(--green); display: flex; align-items: center; justify-content: center; gap: 6px; }
.sa-status.on .dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; box-shadow: 0 0 8px var(--green); }

/* RSP */
/* Hamburger button */
.hamburger-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--t1);
    font-size: 24px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: 0.2s;
    line-height: 1;
}
.hamburger-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Mobile close button inside sidebar */
.sidebar-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 16px;
    background: none;
    border: none;
    color: var(--t2);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 1001;
    transition: 0.2s;
}
.sidebar-close:hover {
    color: var(--gold);
}

@media(max-width: 900px) {
    .hamburger-btn { display: block; }
    .sidebar-close { display: block; }
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        z-index: 1000;
        height: 100vh;
        transition: left 0.3s ease;
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar-overlay.active {
        display: block;
    }
    .stats-grid, .vault-grid, .swarm-roster { grid-template-columns: 1fr; }
    .topbar { padding: 0 20px; }
    .content-area { padding: 20px; }
    .vault-hero { flex-direction: column; text-align: center; }
    .vault-hero button { margin: 16px auto 0; }
}
