/* ==========================================================================
   Client-area shell: left vertical navigation + user avatar chip
   ========================================================================== */

.app-shell {
    display: flex;
    align-items: flex-start;
    gap: 0;
    min-height: 100vh;
}

.app-main {
    flex: 1 1 auto;
    min-width: 0; /* allow content to shrink inside flexbox */
}

/* --- Sidebar ------------------------------------------------------------ */

.client-sidebar {
    flex: 0 0 250px;
    width: 250px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    padding: 7.5rem 0 2rem 0; /* clears the fixed top nav */
    background: linear-gradient(180deg, #662d91 0%, #4a1a6b 100%);
    box-shadow: 2px 0 14px rgba(74, 26, 107, 0.25);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}

.sidebar-section {
    padding: 0.4rem 0.75rem;
}

.sidebar-section + .sidebar-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0.35rem;
    padding-top: 0.75rem;
}

.sidebar-heading {
    display: block;
    color: #ffb014;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09rem;
    padding: 0.25rem 0.75rem 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.45rem;
    margin-bottom: 0.1rem;
    transition: all 0.15s ease;
}

.sidebar-link i {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.15s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
}

.sidebar-link:hover i { color: #ffb014; }

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff !important;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #ffb014;
}

.sidebar-link.active i { color: #ffb014; }

/* --- Mobile: off-canvas sidebar ----------------------------------------- */

.sidebar-toggle-btn {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1045;
    background: linear-gradient(135deg, #662d91, #4a1a6b);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.15rem;
    box-shadow: 0 4px 16px rgba(74, 26, 107, 0.45);
    cursor: pointer;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1039;
}

@media (max-width: 991.98px) {
    .client-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100%;
        z-index: 1040;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        padding-top: 1.25rem;
        width: 270px;
        flex-basis: 270px;
    }

    body.sidebar-open .client-sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop { display: block; }

    .sidebar-toggle-btn { display: inline-flex; align-items: center; justify-content: center; }
}

/* --- User avatar chip in top nav ---------------------------------------- */

.user-chip {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #662d91, #9e40e5);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(102, 45, 145, 0.35);
    flex: 0 0 auto;
}

.user-chip-name {
    font-weight: 600;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .user-chip { padding-left: 0.75rem; }
}

/* Client dashboard visual cleanup */
.client-area .app-shell,
.client-area .app-main {
    background: #f6f8fb;
}

.client-area .client-sidebar {
    background: #fff;
    border-right: 1px solid #e3e8ef;
    box-shadow: 1px 0 10px rgba(15, 23, 42, 0.04);
    scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
}

.client-area .sidebar-section + .sidebar-section {
    border-top-color: #eef2f6;
}

.client-area .sidebar-heading {
    color: #8a95a5;
}

.client-area .sidebar-link {
    color: #344054 !important;
    border-radius: 0.4rem;
}

.client-area .sidebar-link i {
    color: #97a3b3;
}

.client-area .sidebar-link:hover {
    background: #f1f5f9;
    color: #111827 !important;
}

.client-area .sidebar-link:hover i {
    color: #475569;
}

.client-area .sidebar-link.active {
    background: #eef6ff;
    color: #172033 !important;
    box-shadow: inset 3px 0 0 #2563eb;
}

.client-area .sidebar-link.active i {
    color: #2563eb;
}

.client-area .sidebar-toggle-btn {
    background: #263241;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.28);
}
