.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.6rem;
}

.sidebar-brand span { color: var(--primary); }

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--surface-2);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

.main-wrap {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--topbar-h);
    background: rgba(18, 21, 28, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-title { font-weight: 600; font-size: 1rem; }

.topbar-spacer { flex: 1; }

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.content {
    padding: 1.5rem;
    max-width: 1440px;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-header h1 { font-size: 1.5rem; font-weight: 700; }

.sidebar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    padding: 0.4rem;
    cursor: pointer;
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrap { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 150;
    }
    .sidebar-overlay.show { display: block; }
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow), 0 0 0 1px var(--primary-glow);
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.auth-card .subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
    .grid-2, .grid-4 { grid-template-columns: 1fr; }
}
