/* Organization Management UI polish (loaded after management.css and dnr-regions.css) */

/* Header: make "Back to UWSP" a quieter text link so it doesn't compete with the mode badge */
.page-header .uwsp-home-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.25rem 0;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
}

.page-header .uwsp-home-btn:hover,
.page-header .uwsp-home-btn:focus-visible {
    background: transparent;
    text-decoration-thickness: 2px;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Slim, sticky search action bar */
.search-actions.search-actions-slim {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-actions-hint {
    margin: 0;
    color: #4b5563;
    font-size: 0.8rem;
}

.search-actions-hint kbd {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0 0.3rem;
    color: #1f2937;
    font-size: 0.75rem;
}

.search-actions-buttons {
    display: flex;
    gap: 0.75rem;
    margin-left: auto;
}

/* Advanced Filters count pill */
.toggle-count.has-count {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: #0072B2;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Organization types: compact wrapping chips spanning the full form width */
.form-group:has(> .checkbox-list.organization-types) {
    grid-column: 1 / -1;
}

.checkbox-list.organization-types {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: none;
    background: none;
}

.checkbox-list.organization-types .checkbox-item {
    position: relative;
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 100%;
    align-items: center;
    margin: 0;
    padding: 0;
    min-height: 0;
    border: none;
    background: none;
    box-shadow: none;
}

.checkbox-list.organization-types .checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.checkbox-list.organization-types .checkbox-item label {
    display: inline-flex !important;
    width: auto !important;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0.25rem 0.65rem;
    border: 1px solid #9ca3af;
    border-radius: 999px;
    background: #fff;
    color: #1f2937;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    white-space: nowrap;
}

.checkbox-list.organization-types .checkbox-item label::before {
    content: "+";
    font-weight: 700;
    color: #4b5563;
}

.checkbox-list.organization-types .checkbox-item label:hover {
    border-color: #0072B2;
}

.checkbox-list.organization-types .checkbox-item input:checked + label {
    background: #005a8c;
    border-color: #005a8c;
    color: #fff;
}

.checkbox-list.organization-types .checkbox-item input:checked + label::before {
    content: "\2713";
    color: #fff;
}

.checkbox-list.organization-types .checkbox-item input:focus-visible + label {
    outline: 2px solid #0072B2;
    outline-offset: 2px;
}

/* Include expired sits under Contact Type */
.include-expired-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.include-expired-item label {
    margin: 0;
    font-weight: 500;
}

/* Consistent selection-control buttons */
.county-toggle-btn,
.county-actions .btn-link,
.selected-counties-header .btn-link {
    font-weight: 600;
}

.county-actions .btn-link,
.selected-counties-header .btn-link,
.county-map-summary-clear {
    color: #005a8c;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.15rem 0.25rem;
}

.county-actions .btn-link:focus-visible,
.selected-counties-header .btn-link:focus-visible,
.county-map-summary-clear:focus-visible {
    outline: 2px solid #0072B2;
    outline-offset: 2px;
}

/* Larger sidebar map (expanded modal overrides these in dnr-regions.css) */
.county-map-widget:not(.expanded-map) .county-map-content.show {
    min-height: 380px;
}

.county-map-widget:not(.expanded-map) #wisconsinCountyMap {
    height: 380px;
    min-height: 380px;
}

/* Selected-county text summary under the map */
.county-map-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.85rem;
    color: #1f2937;
}

.county-map-summary-clear[hidden] {
    display: none;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 768px) {
    .search-actions.search-actions-slim {
        position: static;
    }

    .search-actions-hint {
        display: none;
    }

    .search-actions-buttons {
        width: 100%;
        justify-content: stretch;
    }

    .search-actions-buttons .btn {
        flex: 1;
    }

    .county-map-widget:not(.expanded-map) #wisconsinCountyMap {
        height: 300px;
        min-height: 300px;
    }
}
