:root {
    --bg-base: #0f1115;
    --bg-surface: #1a1d24;
    --bg-surface-hover: #232730;
    --bg-elevated: #282c35;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --accent-color: #8b5cf6;
    
    --border-color: #2e3340;
    
    --sidebar-width: 260px;
    --header-height: 64px;
    
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-elevated: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --border-color: #e2e8f0;
}

[data-theme="light"] .nav-link.active {
    color: var(--primary-color);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

a { text-decoration: none; color: inherit; }
button { background: none; border: none; cursor: pointer; font-family: inherit; }

/* Layout Structure */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: transform 0.3s ease;
}

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

.logo-box {
    width: 32px; height: 32px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 12px 12px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: var(--bg-surface-hover);
    color: #fff;
    font-weight: 500;
}

.user-profile {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    height: var(--header-height);
    background-color: rgba(26, 29, 36, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* Glass & Utilities */
.glass-panel {
    background: rgba(26, 29, 36, 0.5);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
}

[data-theme="light"] .glass-panel {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .top-header {
    background-color: rgba(255, 255, 255, 0.8);
}

.text-muted { color: var(--text-muted); }
.text-lg { font-size: 1.125rem; font-weight: 600; }
.heading-1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.5px; }

/* Mobile Responsiveness */
.mobile-menu-btn { display: none; color: var(--text-primary); font-size: 1.5rem; }

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .mobile-menu-btn {
        display: block;
    }
    .top-header, .page-content {
        padding: 16px;
    }
}
/* Sidebar Dropdown */
.sidebar-dropdown .dropdown-menu { display: none; padding-left: 32px; font-size: 0.85rem; }
.sidebar-dropdown .dropdown-menu.show { display: block; }
.sidebar-dropdown .dropdown-menu a { display: block; padding: 8px 12px; color: var(--text-secondary); text-decoration: none; border-radius: var(--radius-md); transition: 0.2s; margin-bottom: 2px; }
.sidebar-dropdown .dropdown-menu a:hover, .sidebar-dropdown .dropdown-menu a.active { color: var(--primary-color); background: rgba(59, 130, 246, 0.1); }
.dropdown-toggle { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.dropdown-toggle .chevron { font-size: 0.7rem; transition: transform 0.2s; }
.dropdown-toggle.open .chevron { transform: rotate(180deg); }