.user-page-layout { align-items: stretch; }
.user-sidebar-col { align-self: stretch; }
.user-sidebar-card {
    height: 100%;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.user-sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.4rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
}

.user-sidebar-heading-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    border: 1px solid rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.user-sidebar-heading-content {
    min-width: 0;
    display: flex;
    align-items: center;
    flex: 1;
}

.user-sidebar-heading-actions {
    display: none;
    margin-left: auto;
}

.user-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    color: #475569;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.user-sidebar-toggle:hover {
    background: #fff;
    color: #0f172a;
    border-color: rgba(96, 165, 250, 0.22);
}

.user-sidebar-toggle:focus,
.user-sidebar-toggle:focus-visible,
.user-sidebar-toggle:active {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.14);
}

.user-sidebar-toggle i {
    font-size: 0.95rem;
    line-height: 1;
    transition: transform 0.24s ease;
}

.user-sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.user-sidebar-heading-icon i {
    font-size: 1.1rem;
    line-height: 1;
}

.user-sidebar-nav-wrap {
    padding: 0.95rem;
}

.user-sidebar-nav {
    gap: 0.45rem;
}

.user-sidebar-nav .list-group-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    border: 0;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.5);
    color: #334155;
    font-weight: 500;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.user-sidebar-nav .list-group-item i {
    width: 1rem;
    flex: 0 0 1rem;
    text-align: center;
    font-size: 0.98rem;
}

.user-sidebar-nav .list-group-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-sidebar-nav .list-group-item:hover {
    background: rgba(248, 250, 252, 0.96);
    color: #0f172a;
    transform: translateX(2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.user-sidebar-nav .list-group-item.active {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    color: #0f172a;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14);
}

.user-sidebar-nav .list-group-item.active i,
.user-sidebar-nav .list-group-item.active span {
    color: inherit;
}

@media (min-width: 800px) {
    .user-sidebar-card { min-height: 800px; }
}

@media (max-width: 767.98px) {
    .user-sidebar-col {
        display: block !important;
        margin-bottom: 1rem;
    }

    .user-sidebar-card {
        min-height: auto;
        height: auto;
        border-radius: 14px;
        box-shadow: none;
    }

    .user-sidebar-heading {
        justify-content: space-between;
        padding: 1rem;
    }

    .user-sidebar-heading-actions,
    .user-sidebar-toggle {
        display: inline-flex;
    }

    .user-sidebar-heading-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 12px;
    }

    .user-sidebar-title {
        font-size: 1rem;
    }

    .user-sidebar-nav-wrap {
        padding: 1rem 1rem;
        max-height: 80vh;
        opacity: 1;
        overflow: hidden;
        transition: max-height 0.28s ease, opacity 0.2s ease, padding 0.2s ease;
    }

    .user-sidebar-nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.65rem;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.2rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .user-sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .user-sidebar-nav .list-group-item {
        flex: 0 0 auto;
        min-width: max-content;
        padding: 0.72rem 0.9rem;
        border-radius: 999px !important;
        border: 1px solid rgba(148, 163, 184, 0.22);
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
        justify-content: center;
        gap: 0.45rem;
    }

    .user-sidebar-nav .list-group-item:hover {
        transform: translateY(-1px);
    }

    .user-sidebar-nav .list-group-item.active {
        border-color: transparent;
        box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
    }

    .user-sidebar-card.is-mobile-collapsed .user-sidebar-heading {
        border-bottom: 0;
    }

    .user-sidebar-card.is-mobile-collapsed .user-sidebar-nav-wrap {
        max-height: 0;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    .user-sidebar-card.is-mobile-expanded .user-sidebar-heading {
        border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    }

    .user-sidebar-card.is-mobile-expanded .user-sidebar-nav-wrap {
        max-height: 80vh;
        overflow: visible;
    }

    .user-sidebar-card.is-mobile-expanded .user-sidebar-toggle {
        background: rgba(239, 246, 255, 0.96);
        border-color: rgba(96, 165, 250, 0.22);
        color: #2563eb;
    }

    .user-sidebar-card.is-mobile-expanded .user-sidebar-toggle i,
    .user-sidebar-toggle[aria-expanded="true"] i {
        transform: rotate(180deg);
    }
}

[data-bs-theme="dark"] .user-sidebar-card {
    border-color: rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

[data-bs-theme="dark"] .user-sidebar-heading {
    border-bottom-color: rgba(148, 163, 184, 0.1);
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.96));
}

[data-bs-theme="dark"] .user-sidebar-heading-icon {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
    border-color: rgba(96, 165, 250, 0.14);
    color: #93c5fd;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .user-sidebar-title {
    color: #f8fafc;
}

[data-bs-theme="dark"] .user-sidebar-nav-wrap {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0));
}

[data-bs-theme="dark"] .user-sidebar-nav .list-group-item {
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(30, 41, 59, 0.58);
    color: #cbd5e1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

[data-bs-theme="dark"] .user-sidebar-nav .list-group-item i {
    color: #93c5fd;
}

[data-bs-theme="dark"] .user-sidebar-nav .list-group-item:hover {
    border-color: rgba(96, 165, 250, 0.18);
    background: rgba(30, 41, 59, 0.92);
    color: #f8fafc;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

[data-bs-theme="dark"] .user-sidebar-nav .list-group-item.active {
    border-color: rgba(96, 165, 250, 0.1);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.18), rgba(15, 23, 42, 0.98));
    color: #f8fafc;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.18);
}

[data-bs-theme="dark"] .user-sidebar-nav .list-group-item.active i,
[data-bs-theme="dark"] .user-sidebar-nav .list-group-item.active span,
[data-bs-theme="dark"] .user-sidebar-nav .list-group-item:hover i,
[data-bs-theme="dark"] .user-sidebar-nav .list-group-item:hover span {
    color: inherit;
}

[data-bs-theme="dark"] .user-sidebar-toggle {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(30, 41, 59, 0.82);
    color: #cbd5e1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

[data-bs-theme="dark"] .user-sidebar-toggle:hover {
    border-color: rgba(96, 165, 250, 0.24);
    background: rgba(30, 41, 59, 0.96);
    color: #f8fafc;
}

[data-bs-theme="dark"] .user-sidebar-toggle:focus,
[data-bs-theme="dark"] .user-sidebar-toggle:focus-visible,
[data-bs-theme="dark"] .user-sidebar-toggle:active {
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.16);
}

@media (max-width: 767.98px) {
    [data-bs-theme="dark"] .user-sidebar-card {
        box-shadow: none;
    }

    [data-bs-theme="dark"] .user-sidebar-nav .list-group-item {
        border-color: rgba(148, 163, 184, 0.14);
        background: rgba(30, 41, 59, 0.9);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    }

    [data-bs-theme="dark"] .user-sidebar-card.is-mobile-expanded .user-sidebar-heading {
        border-bottom-color: rgba(148, 163, 184, 0.1);
    }

    [data-bs-theme="dark"] .user-sidebar-card.is-mobile-expanded .user-sidebar-toggle {
        border-color: rgba(96, 165, 250, 0.2);
        background: rgba(37, 99, 235, 0.18);
        color: #dbeafe;
    }
}
