:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-sidebar: #0d1220;
    --bg-topbar: #0b1022;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --neon-blue: #00d4ff;
    --neon-green: #00ff88;
    --neon-purple: #a855f7;
    --neon-pink: #ff2d95;
    --neon-yellow: #fbbf24;
    --neon-red: #ff4757;
    --border-color: #1e293b;
    --hover-bg: #1e293b;
    --positive: #00ff88;
    --negative: #ff4757;
    --glow-blue: 0 0 10px rgba(0, 212, 255, 0.3);
    --glow-green: 0 0 10px rgba(0, 255, 136, 0.3);
}

[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-sidebar: #f8fafc;
    --bg-topbar: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --neon-blue: #0284c7;
    --neon-green: #059669;
    --neon-purple: #7c3aed;
    --neon-pink: #db2777;
    --neon-yellow: #d97706;
    --neon-red: #dc2626;
    --border-color: #e2e8f0;
    --hover-bg: #f1f5f9;
    --positive: #059669;
    --negative: #dc2626;
    --glow-blue: 0 1px 3px rgba(2, 132, 199, 0.15);
    --glow-green: 0 1px 3px rgba(5, 150, 105, 0.15);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* ── Top Bar ── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-logo img {
    height: 30px;
}

.topbar-logo span {
    color: var(--neon-blue);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.topbar-user:hover {
    background: var(--hover-bg);
}

.topbar-user i {
    font-size: 1.3rem;
    color: var(--neon-blue);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--neon-blue);
    color: var(--neon-blue);
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 52px;
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 15px 0;
    overflow-y: auto;
    z-index: 999;
}

.sidebar-section {
    padding: 8px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-top: 10px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar a:hover {
    background: var(--hover-bg);
    color: var(--neon-blue);
    border-left-color: var(--neon-blue);
}

.sidebar a.active {
    background: var(--hover-bg);
    color: var(--neon-blue);
    border-left-color: var(--neon-blue);
    font-weight: 600;
}

.sidebar a i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

/* ── Main Content ── */
.main-content {
    margin-left: 240px;
    margin-top: 52px;
    padding: 24px;
    height: calc(100vh - 52px);
    overflow-y: auto;
    background: var(--bg-primary);
}

/* ── Cards ── */
.neon-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.neon-card:hover {
    border-color: var(--neon-blue);
}

.neon-card .card-title {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.neon-card .card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.neon-card .card-change {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 4px;
}

.card-change.positive { color: var(--positive); }
.card-change.negative { color: var(--negative); }

/* ── Tables ── */
.neon-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.neon-table thead th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 1px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.neon-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.neon-table tbody tr:hover {
    background: var(--hover-bg);
}

.neon-table .positive { color: var(--positive); }
.neon-table .negative { color: var(--negative); }

/* ── Badges ── */
.neon-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.neon-badge.blue { background: rgba(0,212,255,0.15); color: var(--neon-blue); }
.neon-badge.green { background: rgba(0,255,136,0.15); color: var(--neon-green); }
.neon-badge.purple { background: rgba(168,85,247,0.15); color: var(--neon-purple); }
.neon-badge.pink { background: rgba(255,45,149,0.15); color: var(--neon-pink); }
.neon-badge.yellow { background: rgba(251,191,36,0.15); color: var(--neon-yellow); }
.neon-badge.red { background: rgba(255,71,87,0.15); color: var(--neon-red); }

/* ── Stat Bars ── */
.stat-bar-bg {
    background: var(--bg-secondary);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ── Chart Container ── */
.chart-container {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Page Title ── */
.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

/* ── Placeholder ── */
.placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    color: var(--text-muted);
}

.placeholder-page i {
    font-size: 4rem;
    margin-bottom: 16px;
    color: var(--neon-blue);
    opacity: 0.4;
}

.placeholder-page h3 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}
