.members-map-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Map ─────────────────────────────────────────────────────────────────── */

#members-map {
    height: 500px;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 14px rgba(7,7,45,0.07);
}

/* ── Loading overlay ───────────────────────────────────────────────────────── */

.mm-map-shell { position: relative; }

.mm-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 500px;              /* matches #members-map */
    z-index: 1200;             /* above Leaflet panes and controls */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-radius: 12px;
    background: rgba(241,240,244,0.92);
    color: #07072D;
    font-size: 15px;
    font-weight: 600;
    transition: opacity .35s ease, visibility .35s ease;
}
.mm-loading.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mm-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #D3E5EF;
    border-top-color: #FFC500;
    border-radius: 50%;
    animation: mm-spin 0.8s linear infinite;
}
@keyframes mm-spin { to { transform: rotate(360deg); } }

/* ── Filters ─────────────────────────────────────────────────────────────── */

.members-map-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

#members-search {
    width: 100%;
    padding: 9px 36px 9px 16px;
    border: 2px solid #ddd;
    border-radius: 50px;
    font-size: 16px;
    color: #07072D;
    box-sizing: border-box;
    transition: border-color .15s;
    background: #fff;
}
#members-search::placeholder { color: #aaa; }
#members-search:focus {
    outline: none;
    border-color: #FFC500;
}

.clear-search-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #AA8E6F;
    padding: 0;
    line-height: 1;
    display: none;
}
.clear-search-btn:hover { color: #07072D; }

#members-region-filter {
    padding: 9px 38px 9px 16px;
    border: 2px solid #ddd;
    border-radius: 50px;
    font-size: 16px;
    color: #07072D;
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2307072D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    min-width: 160px;
    transition: border-color .15s;
}
#members-region-filter:focus {
    outline: none;
    border-color: #FFC500;
}

/* ── Table Container ─────────────────────────────────────────────────────── */

.members-table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: clip;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(7,7,45,0.07);
    background: #fff;
}

/* ── Table ───────────────────────────────────────────────────────────────── */

#members-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    min-width: 600px;
    background: #fff;
}

#members-table thead tr {
    background: #F1F0F4;
    border-bottom: 1px solid #ddd;
}

#members-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #07072D;
}

/* Sortable headers */
#members-table th.mm-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background .15s;
}
#members-table th.mm-sortable:hover { background: #D3E5EF; }
.mm-sort-ind {
    display: inline-block;
    width: 12px;
    margin-left: 6px;
    color: #AA8E6F;
    font-size: 11px;
    line-height: 1;
    vertical-align: middle;
}
/* Neutral (unsorted) indicator */
#members-table th.mm-sortable .mm-sort-ind::after { content: "\2195"; opacity: .45; }
/* Active column */
#members-table th.mm-sorted-asc  .mm-sort-ind::after { content: "\2191"; opacity: 1; color: #07072D; }
#members-table th.mm-sorted-desc .mm-sort-ind::after { content: "\2193"; opacity: 1; color: #07072D; }

#members-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
    color: #07072D;
    vertical-align: middle;
}

#members-table tbody tr:last-child td {
    border-bottom: none;
}

#members-table tbody tr {
    cursor: pointer;
    transition: background .15s;
}
#members-table tbody tr:hover {
    background: #F9F3ED;
}
#members-table tbody tr.active {
    background: #D3E5EF;
}

#members-table a {
    color: #6699CC;
    text-decoration: none;
    font-weight: 600;
}
#members-table a:hover {
    text-decoration: underline;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */

.members-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.members-pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.members-pagination button {
    padding: 8px 20px;
    border: 2px solid #FFC500;
    border-radius: 50px;
    background: transparent;
    color: #07072D;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.members-pagination button:hover:not(:disabled) {
    background: #FFC500;
}
.members-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.members-pagination select {
    padding: 8px 36px 8px 14px;
    border: 2px solid #ddd;
    border-radius: 50px;
    font-size: 14px;
    color: #07072D;
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2307072D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color .15s;
}
.members-pagination select:focus {
    outline: none;
    border-color: #FFC500;
}

.members-pagination .page-info {
    font-size: 14px;
    color: #555;
}

/* ── Leaflet Popup wrapper ───────────────────────────────────────────────── */

.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(7,7,45,0.14) !important;
    border: 1px solid #ddd;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: auto !important;
}

/* ── Popup inner layout ──────────────────────────────────────────────────── */

.mm-popup {
    padding: 16px 18px 14px;
    min-width: 220px;
    font-family: inherit;
}

.mm-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: #07072D;
    margin-bottom: 10px;
    line-height: 1.1;
}
.mm-popup-title a {
    color: #07072D;
    text-decoration: none;
}
.mm-popup-title a:hover {
    color: #6699CC;
}

.mm-popup-row {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
    line-height: 1.4;
}
.mm-popup-row svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.mm-popup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.mm-popup-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #6699CC;
    text-decoration: none;
}
.mm-popup-link:hover {
    text-decoration: underline;
    color: #6699CC;
}

.mm-popup-region-pill {
    display: inline-block;
    background: #F1F0F4;
    color: #07072D;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 30px;
    white-space: nowrap;
}
