:root {
    --bg-body: #0f172a;
    --bg-gradient: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    --bg-gradient-size: 400% 400%;
    --glass-bg: #eee1e148;
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(255, 255, 255, 0.37);
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #000000;
    --primary: #09ffd6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --accent: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: #796de7ce;
    background-size: var(--bg-gradient-size);
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body.theme-normal { 
    --bg-gradient: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab); 
    --primary: #3b82f6; 
    --primary-glow: rgba(59,130,246,0.5); 
}
body.theme-dark { 
    --bg-gradient: linear-gradient(-45deg, #1e293b, #0f172a, #334155, #1e293b); 
    --primary: #3b82f6; 
    --primary-glow: rgba(59,130,246,0.5); 
}
body.theme-light { 
    --bg-gradient: linear-gradient(-45deg, #e2e8f0, #f8fafc, #cbd5e1, #e2e8f0); 
    --text-primary: #0f172a; 
    --text-secondary: #334155; 
    --glass-bg: rgba(255,255,255,0.6); 
    --glass-border: rgba(15,23,42,0.1); 
    --primary: #2563eb; 
    --primary-glow: rgba(37,99,235,0.4); 
}
body.theme-glass { 
    --bg-gradient: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a, #1e293b); 
    --primary: #00f2ff; 
    --primary-glow: rgba(0,242,255,0.4); 
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
}

.glass-panel-inner {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
}

.app-wrapper { 
    display: flex; 
    min-height: 100vh; 
    max-width: 1600px; 
    margin: 0 auto; 
    padding: 20px; 
    gap: 20px; 
}

.sidebar { 
    width: 280px; 
    padding: 25px; 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
    animation: slideInLeft 0.5s ease; 
}
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-50px); } to { opacity: 1; transform: translateX(0); } }
.sidebar-header { 
    margin-bottom: 25px; 
}
.logo { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}
.logo-icon { 
    font-size: 2rem; 
    filter: drop-shadow(0 0 8px var(--primary-glow)); 
}
.logo h1 { 
    font-size: 1.5rem; 
    font-weight: 700; 
}

.sidebar-nav { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    margin-bottom: 25px; 
}
.nav-item {
    display: flex; 
    align-items: center; 
    gap: 12px;
    padding: 14px 16px; 
    background: transparent; 
    border: none;
    border-radius: var(--radius-md); 
    color: var(--text-secondary);
    cursor: pointer; 
    font-size: 1rem; 
    font-weight: 500; 
    transition: var(--transition);
    position: relative; 
    overflow: hidden;
}
.nav-item::before { 
    content: ''; 
    position: absolute; 
    left: 0; 
    top: 0; 
    bottom: 0; 
    width: 4px; 
    background: var(--primary); 
    transform: scaleY(0); 
    transition: transform 0.3s; 
}
.nav-item:hover { 
    background: rgba(255,255,255,0.1); 
    color: white; 
}
.nav-item.active { 
    background: rgba(255,255,255,0.15); 
    color: white; 
    font-weight: 600; 
}
.nav-item.active::before { 
    transform: scaleY(1); 
}

.sidebar-section h3 { 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    color: var(--text-muted); 
    margin-bottom: 12px; 
    letter-spacing: 1px; 
    text-align: left; 
}
.category-list { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
}
.category-btn { 
    padding: 6px 12px; 
    background: rgba(255,255,255,0.05); 
    border: 1px solid var(--glass-border); 
    border-radius: var(--radius-sm); 
    color: var(--text-secondary); 
    cursor: pointer; 
    font-size: 0.85rem; 
    transition: var(--transition); 
}
.category-btn:hover { 
    background: rgba(255,255,255,0.15); 
    color: white; 
}
.category-btn.active { 
    background: var(--primary); 
    border-color: var(--primary); 
    color: #050508; 
    font-weight: 700; 
    box-shadow: 0 0 10px var(--primary-glow); 
}

.sidebar-stats { 
    padding: 16px; 
    margin-bottom: 20px; 
}
.sidebar-stats h3 { 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    color: var(--text-muted); 
    margin-bottom: 10px; 
    letter-spacing: 1px; 
}
.stat-row { 
    display: flex; 
    justify-content: space-between; 
    padding: 6px 0; 
    font-size: 0.9rem; 
    color: var(--text-secondary); 
}
.stat-row span:last-child { 
    color: var(--primary); 
    font-weight: 700; 
}

.sidebar-footer { 
    display: flex; 
    gap: 10px; 
    padding-top: 15px; 
    border-top: 1px solid rgba(255,255,255,0.08); 
}
.icon-btn { 
    width: 40px; 
    height: 40px; 
    background: rgba(255,255,255,0.08); 
    border: 1px solid var(--glass-border); 
    border-radius: 50%; 
    cursor: pointer; 
    font-size: 1.2rem; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: var(--transition); 
    color: var(--text-primary); 
}
.icon-btn:hover { 
    background: rgba(255,255,255,0.15); 
    transform: scale(1.1); 
}

.main-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
    animation: fadeIn 0.6s ease; 
}

.kpi-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 20px; 
}
.kpi-card { 
    padding: 25px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
    transition: var(--transition); 
}
.kpi-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 15px 40px rgba(0,0,0,0.4), 0 0 20px var(--primary-glow); 
}
.kpi-icon { 
    font-size: 2rem; 
    margin-bottom: 10px; 
}
.kpi-value { 
    font-size: 2.2rem; 
    font-weight: 800; 
    color: var(--primary); 
    text-shadow: 0 0 20px var(--primary-glow); 
    font-family: 'JetBrains Mono', monospace; 
}
.kpi-label { 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-top: 5px; 
}

.charts-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
}
.chart-card { 
    padding: 25px; 
}
.chart-title { 
    font-size: 1.1rem; 
    font-weight: 700; 
    margin-bottom: 20px; 
    color: var(--text-primary); 
}

.bar-chart { 
    display: flex; 
    align-items: flex-end; 
    gap: 10px; 
    height: 200px; 
    padding-top: 10px; 
}
.bar-col { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 8px; 
    height: 100%; 
    justify-content: flex-end; 
}
.bar { 
    width: 100%; 
    max-width: 40px; 
    background: linear-gradient(180deg, var(--accent), var(--primary)); 
    border-radius: 6px 6px 0 0; 
    min-height: 4px; 
    transition: height 0.5s cubic-bezier(0.4,0,0.2,1); 
    box-shadow: 0 0 10px var(--primary-glow); 
    position: relative; 
}
.bar-value { 
    font-size: 0.7rem; 
    color: var(--text-muted); 
    font-family: monospace; 
}
.bar-label { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
}

.donut-wrap { 
    display: flex; 
    align-items: center; 
    gap: 25px; 
}
.donut-chart { 
    width: 160px; 
    height: 160px; 
    border-radius: 50%; 
    background: conic-gradient(var(--primary) 0deg, var(--text-muted) 0deg); 
    position: relative; 
}
.donut-chart::after { 
    content: ''; 
    position: absolute; 
    inset: 30px; 
    background: var(--bg-body); 
    border-radius: 50%; 
}
.donut-center { 
    position: absolute; 
    inset: 0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.4rem; 
    font-weight: 800; 
    color: white; 
    z-index: 2; 
}
.donut-legend { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}
.legend-item { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 0.85rem; 
    color: var(--text-secondary); 
}
.legend-dot { 
    width: 12px; 
    height: 12px; 
    border-radius: 3px; 
}

.activity-card { 
    padding: 25px; 
}
.activity-list { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}
.activity-item { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    padding: 12px 15px; 
    background: rgba(255,255,255,0.04); 
    border-radius: var(--radius-md); 
    border: 1px solid var(--glass-border); 
}
.activity-icon { 
    font-size: 1.4rem; 
}
.activity-text { 
    flex: 1; 
    font-size: 0.9rem; 
    color: var(--text-secondary); 
}
.activity-text strong { 
    color: var(--text-primary); 
}
.activity-time { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    font-family: monospace; 
}

.theme-menu { 
    position: fixed; 
    top: 70px; 
    right: 20px; 
    background: rgba(15,23,42,0.95); 
    backdrop-filter: blur(15px); 
    border: 1px solid var(--glass-border); 
    border-radius: var(--radius-lg); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
    z-index: 1000; 
    padding: 10px; 
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-10px); 
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1); 
}
.theme-menu:not(.hidden) { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(0); 
}
.theme-menu button { 
    width: 100%; 
    text-align: left; 
    padding: 12px 15px; 
    background: transparent; 
    border: none; 
    color: var(--text-secondary); 
    cursor: pointer; 
    border-radius: var(--radius-sm); 
    transition: var(--transition); 
    font-size: 1rem; 
}
.theme-menu button:hover { 
    background: rgba(255,255,255,0.1); 
    color: white; 
    transform: translateX(5px); 
}

.toast-container { 
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    z-index: 2000; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}
.toast { 
    padding: 16px 24px; 
    background: rgba(15,23,42,0.95); 
    backdrop-filter: blur(10px); 
    color: white; 
    border-radius: var(--radius-md); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
    border-left: 4px solid var(--primary); 
    animation: slideInRight 0.4s cubic-bezier(0.175,0.885,0.32,1.275); 
    max-width: 350px; 
    font-weight: 500; 
}
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.hidden { 
    display: none !important; 
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
::-webkit-scrollbar { 
    width: 8px; 
    height: 8px; 
}
::-webkit-scrollbar-track { 
    background: rgba(255,255,255,0.05); 
}
::-webkit-scrollbar-thumb { 
    background: rgba(255,255,255,0.2); 
    border-radius: 4px; 
}
::-webkit-scrollbar-thumb:hover { 
    background: rgba(255,255,255,0.3); 
}

@media (max-width: 1024px) {
    .app-wrapper { flex-direction: column; }
    .sidebar { width: 100%; }
    .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .donut-wrap { flex-direction: column; }
}

.app-wrapper { max-width: none; padding: 12px; gap: 12px; }
.sidebar { width: 240px; padding: 18px; }
.main-content { padding: 18px; }
.sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-bottom: 12px; padding: 0; border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; background: rgba(255,255,255,0.1); color: white; cursor: pointer; font-size: 1.1rem; }
.sidebar-toggle:hover { background: rgba(255,255,255,0.2); }
.sidebar-collapsed .sidebar { display: none; }
.sidebar-collapsed .main-content { width: 100%; }
@media (max-width: 1024px) {
    .app-wrapper { flex-direction: row; }
    .sidebar { width: 240px; }
}