/* ==========================================================================
   App Shell Layout (Slate Developer Theme)
   Desktop Sidebar + Main Area + Mobile Bottom Nav
   ========================================================================== */

.app-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
}

/* ---------- Desktop Sidebar ---------- */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    overflow-y: auto;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-badge {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.brand-name {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    background: transparent;
    border-top: none;
    border-bottom: none;
    border-right: none;
    font-family: 'Cairo', sans-serif;
    text-align: left;
}

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

.sidebar-nav-item.active {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
    border-left: 3px solid var(--primary);
}

.sidebar-spacer {
    margin-top: auto;
}

/* ---------- Main Content Area ---------- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-shell:not(:has(.sidebar)) .main-wrapper {
    width: 100%;
}

.top-header {
    height: 64px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.top-header-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* ---------- Mobile Bottom Nav (Hidden on Desktop) ---------- */
.mobile-bottom-nav {
    display: none;
    flex-shrink: 0;
    height: 64px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    padding: 6px 10px;
    border-radius: 10px;
    transition: all 0.15s ease;
}

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

.mobile-nav-btn.active {
    color: var(--primary);
}

.mobile-nav-btn span:first-child {
    font-size: 1.2rem;
    line-height: 1;
}

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 1023px) {
    .sidebar { display: none; }
    .mobile-bottom-nav { display: flex; }
    .main-wrapper .page-container { padding-bottom: 20px; }

    /* Page-level bottom bars (folder tabs) dock at the bottom of the content area */
    .bottom-section {
        flex-shrink: 0;
        border-top: 1px solid var(--border-color);
    }
}
}