/* ==========================================================================
   Design Tokens
   ========================================================================== */
:root {
    --bg-color: #030712;
    --sidebar-bg: #090d16;
    --card-bg: rgba(17, 24, 39, 0.45);
    --border-color: rgba(255, 255, 255, 0.06);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --accent-glow: rgba(99, 102, 241, 0.15);
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.05) 0%, transparent 45%);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 2rem 1.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #c084fc 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 1.5rem 0.5rem 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid #6366f1;
    padding-left: calc(0.75rem - 3px);
}

.sidebar-nav a.active {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}

.sidebar-user {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    text-align: left;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    display: block;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    color: #f43f5e;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Main Workspace Content Area */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2.5rem;
    box-sizing: border-box;
    max-width: calc(100% - 260px);
}

.page-header {
    margin-bottom: 2rem;
    text-align: left;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.025em;
}

.page-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0.25rem 0 0;
}

/* Common Elements */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-sizing: border-box;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* Grid Framework */
.grid {
    display: grid;
    gap: 1.5rem;
}
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
    .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-brand-container a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.mobile-brand-container img {
    max-height: 32px;
    max-width: 150px;
    object-fit: contain;
    display: block;
}

.hamburger-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger-btn svg {
    width: 24px;
    height: 24px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 5px 0 20px rgba(0,0,0,0.5);
    }
    body.sidebar-open .mobile-overlay {
        display: block;
    }
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1.25rem;
    }
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .page-title {
        font-size: 1.5rem;
    }
}

body.no-sidebar .main-content {
    margin-left: 0 !important;
    max-width: 100% !important;
    padding: 1.5rem;
}
body.no-sidebar .mobile-header {
    display: none !important;
}