/* Layout & Sidenav Structure */
#layoutSidenav {
    display: flex;
}

#layoutSidenav_nav {
    width: 220px;
    min-height: calc(100vh - 56px);
    transition: margin 0.25s ease-in-out;
    flex-shrink: 0;
    background-color: #1e293b !important; /* Forces solid dark theme on desktop & mobile */
}

#layoutSidenav_content {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 56px);
    overflow: hidden;
}

/* Sidebar Toggled States */
.sb-sidenav-toggled #layoutSidenav_nav {
    margin-left: -220px;
}

/* Mobile Responsiveness for Sidebar */
@media (max-width: 991.98px) {
    #layoutSidenav_nav {
        position: fixed;
        z-index: 1038;
        top: 56px;
        bottom: 0;
        margin-left: -220px;
    }
    .sb-sidenav-toggled #layoutSidenav_nav {
        margin-left: 0;
    }
}

/* Typography & Colors */
.fs-7 { font-size: 0.75rem; }
.text-gray-300 { color: #dddfeb !important; }
.text-gray-800 { color: #5a5c69 !important; }

.nav-pills .nav-link {
    border-radius: 0.35rem;
    transition: all 0.15s ease-in-out;
    color: #e2e8f0 !important; /* Crisp, high-contrast text color */
}

.nav-pills .nav-link.active {
    background-color: #0d6efd !important;
    color: #fff !important;
}

.nav-pills .nav-link:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

/* Stat Cards & Component Customization */
.stat-card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.stat-card-clickable { cursor: pointer; }
.stat-card-clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.member-photo { width: 45px; height: 45px; object-fit: cover; border-radius: 50%; }
.avatar-placeholder {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #64748b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}


/* Searchable member picker in the Record Payment modal */
.member-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1065;
    max-height: min(45vh, 280px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    margin-top: 2px;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.member-search-results[hidden] {
    display: none !important;
}

.member-search-results .list-group-item {
    min-height: 44px;
    display: flex;
    align-items: center;
    text-align: left;
    white-space: normal;
    touch-action: manipulation;
}

#pMemberInput {
    -webkit-appearance: none;
}
