/**
 * SESSIONVAULT - LAYOUT CSS
 * --------------------------------------------------------
 * TABLE OF CONTENTS:
 * --------------------------------------------------------
 * 1. App Root & Sidebar
 * 2. Navigation
 * 3. Main Content Area & Topbar
 * 4. Responsive Overrides (Mobile Shell)
 * ========================================================
 */

/* ======================================================== */
/* 1. APP ROOT & SIDEBAR                                    */
/* ======================================================== */
#app-root {
    display: none;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
    overflow-y: auto;
}

.brand-wrapper {
    margin-bottom: 24px;
    padding: 0 8px 24px 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex-shrink: 0;
}

.brand svg {
    width: 200px;
    height: 60px;
    max-width: 100%;
}

.brand-practice-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1;
    letter-spacing: 0.3px;
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    line-height: 1.3;
}


/* ======================================================== */
/* 2. NAVIGATION                                            */
/* ======================================================== */
.nav-container {
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.nav-link.active {
    background-color: var(--accent);
    color: #ffffff;
}


/* ======================================================== */
/* 3. MAIN CONTENT AREA & TOPBAR                            */
/* ======================================================== */
.main-frame {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    background-color: var(--bg-app);
}

.top-bar {
    min-height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 12px;
}

.content-box {
    padding: 32px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    min-width: 0;
}

.split-pane {
    display: grid;
    grid-template-columns: 400px minmax(0, 1fr);
    gap: 24px;
}

.section-view {
    display: none;
}

.section-view.active-view {
    display: block;
}


/* ======================================================== */
/* 4. RESPONSIVE OVERRIDES (MOBILE SHELL)                   */
/* ======================================================== */
@media (min-width: 1001px) {
    .mobile-nav-toggle {
        display: none;
    }
}

@media (max-width: 1024px) {
    .split-pane {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1000px) {
    #app-root {
        flex-direction: column;
        height: 100%;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 16px;
        flex-shrink: 0;
        position: relative;
    }

    .brand-wrapper {
        margin-bottom: 12px;
        padding-bottom: 8px;
        flex-direction: row;
        /* Logical property: start */
        text-align: start;
        align-items: center;
        justify-content: flex-start;
        /* Logical property: padding-inline-start */
        padding-inline-start: 48px;
        gap: 12px;
        border-bottom: none;
    }

    .brand {
        width: auto;
        flex-shrink: 0;
        justify-content: flex-start;
    }

    .brand svg {
        width: 140px;
        height: auto;
    }

    .brand-practice-title {
        font-size: 0.85rem;
        /* Logical margin and padding */
        margin-inline-start: auto;
        padding-inline-end: 16px;
        /* Logical text-align */
        text-align: end;
        color: #ffffff;
    }

    .sidebar-top-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--sidebar-hover);
        border-radius: 8px;
        cursor: pointer;
        flex-shrink: 0;
        position: absolute;
        /* Logical inset */
        inset-inline-start: 16px;
        top: 16px;
    }

    .mobile-nav-toggle svg {
        width: 22px;
        height: 22px;
        stroke: #fff;
    }

    .nav-container {
        display: none;
        flex-direction: column;
        margin-top: 12px;
    }

    .nav-container.nav-open {
        display: flex;
    }

    .top-bar {
        padding: 12px 16px;
    }

    .content-box {
        padding: 16px;
        padding-bottom: 100px;
    }

    .split-pane {
        grid-template-columns: 1fr;
    }
}