/* =========================
   APP SHELL
   ========================= */

#app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

/* =========================
   TOP BAR
   ========================= */

#topbar {
    height: 56px;
    background: var(--bg-panel);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gap-md);
    border-bottom: 1px solid #232838;
    position: sticky;
    top: 0;
    z-index: 10;
}

#topbar .logo {
    font-weight: 600;
}

/* =========================
   MAIN LAYOUT
   ========================= */

#layout {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* =========================
   SIDEBAR
   ========================= */

#sidebar {
    width: 220px;
    background: var(--bg-panel);
    border-right: 1px solid #232838;
    display: flex;
    flex-direction: column;
    padding: var(--gap-md);
    gap: var(--gap-sm);
}

/* =========================
   MAIN CONTENT
   ========================= */

#app {
    flex: 1;
    padding: var(--gap-md);
    overflow-y: auto;
}

/* =========================
   VIEW BASE
   ========================= */

.view {
    min-height: 100%;
}

/* =========================
   MOBILE LAYOUT
   ========================= */

@media (max-width: 768px) {

    #layout {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        height: 56px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        border-right: none;
        border-top: 1px solid #232838;
        padding: 0;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 10;
    }

    #app {
        padding-bottom: 72px;
        /* space for bottom nav */
    }
}