/* Clean Anggota Page Styles (Directory Style) */
:root {
    --primary-color: #2563eb;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --surface-white: #ffffff;
}

body.page-anggota {
    background-color: var(--bg-light);
    font-family: 'Inter', sans-serif;
}

/* Force CSS Grid Display */
.directory-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 4rem;
}

/* Rest of CSS remains same, ensuring grid is forced */

/* --- Section Spacing --- */
#members {
    padding-top: 3rem;
    position: relative;
    z-index: 100;
}

/* --- Map & Stats Container --- */
.map-stats-row {
    margin-bottom: 2rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

#wrapper-map {
    height: 400px;
    width: 100%;
    background: #eceff1;
}

#map {
    height: 100%;
    width: 100%;
}

.stats-container {
    padding: 1.5rem;
    height: 400px;
    border-left: 1px solid var(--border-color);
    background: #fff;
    display: flex;
    flex-direction: column;
}

.stats-container h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Statistics Cards --- */
.stats-cards-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.stats-icon.blue {
    background: #eff6ff;
    color: #3b82f6;
}

.stats-icon.purple {
    background: #f3e8ff;
    color: #a855f7;
}

.stats-icon.green {
    background: #f0fdf4;
    color: #22c55e;
}

.stats-icon.orange {
    background: #fff7ed;
    color: #f97316;
}

.stats-info h5 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
}

.stats-info h3 {
    margin: 5px 0 0;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
}

/* --- Interactive Regional Dashboard --- */
.regional-dashboard {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: start;
}

.dashboard-panel {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.panel-header {
    padding: 1rem 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header.green {
    background: #0f9d58;
}

.panel-header.blue {
    background: #2563eb;
}

.panel-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.stat-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}

.stat-list::-webkit-scrollbar {
    width: 6px;
}

.stat-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.stat-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.stat-list-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.stat-list-item:last-child {
    border-bottom: none;
}

.stat-list-item:hover {
    background: #f8fafc;
}

.stat-rank {
    width: 30px;
    color: var(--text-light);
    font-weight: 600;
}

.stat-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-dark);
}

.stat-count {
    background: #ecfdf5;
    color: #059669;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.panel-blue .stat-count {
    background: #eff6ff;
    color: #2563eb;
}

.stat-action {
    margin-left: 1rem;
    font-size: 0.85rem;
    color: #2563eb;
    cursor: pointer;
    font-weight: 600;
}

.stat-action:hover {
    text-decoration: underline;
}

/* --- Search & Filter Bar (Refined Horizontal) --- */
.directory-toolbar {
    background: var(--surface-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 50;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    pointer-events: auto !important;
}

.toolbar-inner-row {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.filter-search-box {
    flex: 2;
    min-width: 250px;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.filter-select-box {
    flex: 1;
    min-width: 200px;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.directory-toolbar .form-group {
    margin-bottom: 0 !important;
}

@media (min-width: 992px) {
    .directory-toolbar .toolbar-inner-row {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }

    .toolbar-inner-row .filter-search-box {
        flex: 2 1 0% !important;
        min-width: 0 !important;
    }

    .toolbar-inner-row .filter-select-box {
        flex: 1 1 0% !important;
        min-width: 0 !important;
    }
}

@media (max-width: 991px) {
    .directory-toolbar .toolbar-inner-row {
        flex-direction: column !important;
        display: flex !important;
        gap: 15px !important;
    }

    .filter-search-box,
    .filter-select-box {
        width: 100% !important;
        flex: auto !important;
    }
}

@media (max-width: 768px) {
    .regional-dashboard {
        grid-template-columns: 1fr !important;
    }

    .stats-cards-row {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 768px) {
    .stats-container {
        border-left: none;
        border-top: 1px solid var(--border-color);
        height: auto;
        padding-bottom: 2rem;
    }

    #wrapper-map {
        height: 300px;
    }
}


.directory-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.directory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.directory-card .card-body {
    padding: 2rem 1.5rem;
    text-align: center;
    flex: 1;
}

.directory-card .avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    border: 3px solid #f1f5f9;
}

.directory-card .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.directory-card .name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.directory-card .id-badge {
    display: inline-block;
    background: #f1f5f9;
    color: var(--text-light);
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    font-family: monospace;
}

.directory-card .info-list {
    text-align: left;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.directory-card .info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.directory-card .info-item i {
    color: #2563eb;
    width: 20px;
    margin-top: 3px;
    flex-shrink: 0;
}