/* ══════════════════════════════════════════════════════════
   Layout — Sidebar, Header, Main Content
   ══════════════════════════════════════════════════════════ */

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-base);
    z-index: 100;
    flex-shrink: 0;
}

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

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: var(--font-size-lg);
    color: white;
    flex-shrink: 0;
}

.sidebar-title {
    font-weight: 700;
    font-size: var(--font-size-md);
    color: var(--text-primary);
    white-space: nowrap;
}

.sidebar-subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md) var(--space-sm);
    overflow-y: auto;
}

.nav-section-title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-md) var(--space-md) var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(6, 182, 212, 0.12);
    color: var(--accent-start);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
}

.nav-item svg,
.nav-item i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg,
.nav-item.active i {
    opacity: 1;
}

.nav-item-text {
    font-size: var(--font-size-base);
    font-weight: 500;
    white-space: nowrap;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-gradient);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

/* ── Sidebar Footer ── */
.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.user-info:hover {
    background: rgba(148, 163, 184, 0.08);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: white;
    flex-shrink: 0;
}

.user-name {
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.user-role {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: capitalize;
}

/* ── Main Content ── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* ── Header ── */
.main-header {
    height: var(--header-height);
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.page-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* ── Content Area ── */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
}

/* ── View Container ── */
.view-container {
    animation: fadeIn 0.3s ease;
    max-width: 1400px;
}

.view-container.full-width {
    max-width: none;
}
