/* Project GIS — map-first dashboard layout */

.gis-filters-panel {
    margin-bottom: 1.25rem;
    overflow: hidden;
    border-radius: var(--dashboard-card-radius, 0.875rem);
    border: 1px solid var(--dashboard-border, #e5e7eb);
    background: #fff;
    box-shadow: 0 4px 18px rgb(15 23 42 / 0.06);
}

.gis-filters-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--dashboard-border, #e5e7eb);
    background: linear-gradient(135deg, #fffbf5 0%, #fff 45%, #f0fdfa 100%);
}

.gis-filters-panel__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    text-align: left;
}

.gis-filters-panel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgb(8 145 178 / 0.28);
}

.gis-filters-panel__icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.gis-filters-panel__title-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.gis-filters-panel__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dashboard-text, #111827);
}

.gis-filters-panel__subtitle {
    font-size: 0.8125rem;
    color: var(--dashboard-text-muted, #6b7280);
}

.gis-filters-panel__badge {
    flex-shrink: 0;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0e7490;
    background: #cffafe;
    border: 1px solid #a5f3fc;
}

.gis-filters-panel__chevron {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    margin-left: auto;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.gis-filters-panel__chevron--open {
    transform: rotate(90deg);
}

.gis-filters-panel__head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gis-filters-active {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(90deg, #eff6ff 0%, #f0fdfa 100%);
    border-bottom: 1px solid #bfdbfe;
}

.gis-filters-active__label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1d4ed8;
}

.gis-filters-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.45rem 0.3rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e40af;
    background: #fff;
    border: 1px solid #bfdbfe;
}

.gis-filters-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 9999px;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1;
}

.gis-filters-chip__remove:hover {
    background: #dbeafe;
}

.gis-filters-active__clear {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.gis-filters-active__clear:hover {
    text-decoration: underline;
}

.gis-filters-panel__body {
    padding: 0;
    background: #f8fafc;
}

.gis-filters-section {
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.gis-filters-section--last {
    border-bottom: none;
}

.gis-filters-section__head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.gis-filters-section__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    color: #fff;
}

.gis-filters-section__icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.gis-filters-section__icon--search {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.gis-filters-section__icon--location {
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

.gis-filters-section__icon--project {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

.gis-filters-section__icon--map {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.gis-filters-section__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
}

.gis-filters-section__desc {
    margin: 0.15rem 0 0;
    font-size: 0.8125rem;
    color: #64748b;
}

.gis-filters-section__body {
    padding-left: 3rem;
}

@media (max-width: 640px) {
    .gis-filters-section__body {
        padding-left: 0;
    }
}

.gis-search-field {
    position: relative;
}

.gis-search-field__icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.125rem;
    height: 1.125rem;
    color: #94a3b8;
    pointer-events: none;
}

.gis-search-field__input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border-radius: 0.75rem;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 0.9375rem;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.gis-search-field__input:focus {
    outline: none;
    border-color: #0891b2;
    background: #fff;
    box-shadow: 0 0 0 3px rgb(8 145 178 / 0.15);
}

.gis-filters-row {
    display: grid;
    gap: 0.875rem 1rem;
}

.gis-filters-row--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gis-filters-row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gis-filters-row--mt {
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .gis-filters-row--3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .gis-filters-row--2 {
        grid-template-columns: 1fr;
    }
}

.gis-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.4rem;
}

.gis-select-wrap {
    position: relative;
}

.gis-select-wrap::after {
    content: '';
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #94a3b8;
    pointer-events: none;
}

.gis-select {
    display: block;
    width: 100%;
    padding: 0.625rem 2rem 0.625rem 0.75rem;
    border-radius: 0.625rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 0.875rem;
    color: #0f172a;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gis-select:focus {
    outline: none;
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgb(8 145 178 / 0.12);
}

.gis-status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gis-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.gis-status-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gis-status-pill__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

.gis-status-pill--all {
    border-style: dashed;
}

.gis-status-pill--active,
.gis-status-pill:has(input:checked) {
    border-color: #0891b2;
    background: #ecfeff;
    color: #0e7490;
    box-shadow: 0 0 0 2px rgb(8 145 178 / 0.12);
}

.gis-status-pill:hover {
    border-color: #94a3b8;
    background: #fff;
}

.gis-quick-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.gis-quick-options--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .gis-quick-options,
    .gis-quick-options--2 {
        grid-template-columns: 1fr;
    }
}

.gis-quick-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.gis-quick-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gis-quick-option__box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: #fff;
}

.gis-quick-option__box svg {
    width: 1.125rem;
    height: 1.125rem;
}

.gis-quick-option__box--green {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.gis-quick-option__box--blue {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.gis-quick-option__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.gis-quick-option__text strong {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #0f172a;
}

.gis-quick-option__text small {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

.gis-quick-option--active,
.gis-quick-option:has(input:checked) {
    border-color: #0891b2;
    background: #ecfeff;
    box-shadow: 0 0 0 2px rgb(8 145 178 / 0.1);
}

.gis-quick-option:hover {
    border-color: #94a3b8;
    background: #fff;
}

.gis-filters-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.gis-filters-footer__hint {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748b;
}

.gis-filters-footer__hint strong {
    color: #0f172a;
    font-weight: 700;
}

.gis-filters-footer__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gis-filters-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: 0.625rem;
    border: 1px solid transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gis-filters-btn svg {
    width: 1rem;
    height: 1rem;
}

.gis-filters-btn--ghost {
    color: #475569;
    background: #fff;
    border-color: #cbd5e1;
}

.gis-filters-btn--ghost:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.gis-filters-btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #0891b2, #0e7490);
    border-color: #0e7490;
    box-shadow: 0 2px 8px rgb(8 145 178 / 0.25);
}

.gis-filters-btn--primary:hover {
    filter: brightness(1.05);
}

@media (max-width: 640px) {
    .gis-filters-panel__head {
        flex-direction: column;
        align-items: stretch;
    }

    .gis-filters-panel__head-actions {
        justify-content: stretch;
    }

    .gis-filters-panel__head-actions .gis-filters-btn {
        flex: 1;
    }

    .gis-filters-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .gis-filters-footer__actions {
        width: 100%;
    }

    .gis-filters-footer__actions .gis-filters-btn {
        flex: 1;
    }
}

.gis-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .gis-layout {
        grid-template-columns: 1fr;
    }
}

.gis-map-panel {
    padding: 0;
    overflow: hidden;
    min-height: 560px;
}

.gis-map-panel__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.875rem 1.125rem;
    border-bottom: 1px solid var(--dashboard-border, #e5e7eb);
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.gis-map-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dashboard-text, #111827);
}

.gis-map-panel__meta {
    margin: 0.15rem 0 0;
    font-size: 0.8125rem;
    color: var(--dashboard-text-muted, #6b7280);
}

.gis-map-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gis-map-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--dashboard-border, #e5e7eb);
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gis-map-btn svg {
    width: 1rem;
    height: 1rem;
}

.gis-map-btn:hover {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

.gis-map-stage {
    position: relative;
    min-height: 520px;
}

.gis-map {
    width: 100%;
    height: 520px;
    z-index: 1;
}

@media (min-width: 1101px) {
    .gis-map {
        height: min(68vh, 680px);
    }
    .gis-map-stage {
        min-height: min(68vh, 680px);
    }
}

.gis-map-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgb(255 255 255 / 0.82);
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.gis-map-loading[hidden] {
    display: none !important;
}

.gis-map-loading__spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top-color: #ea580c;
    border-radius: 50%;
    animation: gis-spin 0.75s linear infinite;
}

@keyframes gis-spin {
    to { transform: rotate(360deg); }
}

.gis-map-empty {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.9375rem;
}

.gis-map-empty[hidden] {
    display: none !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgb(0 0 0 / 0.12);
}

.leaflet-popup-content {
    margin: 0.75rem 0.875rem;
}

.gis-insights {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gis-card {
    overflow: hidden;
}

.gis-card__header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--dashboard-border, #f3f4f6);
    background: #fafafa;
}

.gis-card__title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #374151;
}

.gis-card__body {
    padding: 0.875rem 1rem;
}

.gis-card__body--flush {
    padding: 0;
}

.gis-card__hint {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #6b7280;
}

.gis-empty-note {
    margin: 0;
    font-size: 0.8125rem;
    color: #9ca3af;
}

.gis-status-bars {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.gis-status-bar__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
}

.gis-status-bar__label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #374151;
}

.gis-status-bar__track {
    height: 6px;
    border-radius: 9999px;
    background: #f3f4f6;
    overflow: hidden;
}

.gis-status-bar__fill {
    height: 100%;
    border-radius: 9999px;
    min-width: 2px;
    transition: width 0.3s ease;
}

.gis-geocode-stats {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gis-geocode-stats li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #4b5563;
}

.gis-geocode-stats li strong {
    margin-left: auto;
    color: #111827;
}

.gis-geocode-stats__dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

.gis-geocode-stats__dot--exact {
    background: #2563eb;
}

.gis-geocode-stats__dot--google {
    background: #16a34a;
}

.gis-geocode-stats__dot--approx {
    background: transparent;
    border: 2px dashed #92400e;
}

.gis-dept-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gis-dept-list__item {
    padding: 0.65rem 0.75rem;
    border-radius: 0.625rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border: 1px solid #e2e8f0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gis-dept-list__item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgb(15 23 42 / 0.05);
}

.gis-dept-list__head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.5rem 0.625rem;
}

.gis-dept-list__rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 800;
    line-height: 1;
    color: #0e7490;
    background: #ecfeff;
    border: 1px solid #a5f3fc;
}

.gis-dept-list__item:first-child .gis-dept-list__rank {
    color: #fff;
    background: linear-gradient(135deg, #0891b2, #0e7490);
    border-color: #0e7490;
}

.gis-dept-list__name {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    color: #0f172a;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.gis-dept-list__count {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.05rem;
    flex-shrink: 0;
    min-width: 3rem;
    text-align: right;
}

.gis-dept-list__count strong {
    font-size: 0.9375rem;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.gis-dept-list__count small {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.gis-dept-list__track {
    height: 5px;
    margin-top: 0.5rem;
    border-radius: 9999px;
    background: #e2e8f0;
    overflow: hidden;
}

.gis-dept-list__fill {
    height: 100%;
    border-radius: 9999px;
    min-width: 4px;
    background: linear-gradient(90deg, #0891b2 0%, #22d3ee 100%);
    transition: width 0.35s ease;
}

.gis-dept-list__item:first-child .gis-dept-list__fill {
    background: linear-gradient(90deg, #0e7490 0%, #06b6d4 100%);
}

.gis-legend__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gis-legend__list--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.75rem;
}

.gis-legend__list li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: #4b5563;
}

.gis-legend__swatch {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

.gis-legend__swatch--flagship {
    background: #ea580c;
}

.gis-popup {
    min-width: 220px;
    max-width: 280px;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.gis-popup__title {
    font-weight: 700;
    font-size: 0.9375rem;
    margin: 0 0 0.25rem;
    color: #111827;
}

.gis-popup__meta {
    color: #6b7280;
    margin-bottom: 0.625rem;
    font-size: 0.78rem;
}

.gis-popup__stats {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.2rem 0.75rem;
    margin-bottom: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    background: #f9fafb;
    font-size: 0.78rem;
}

.gis-popup__stats span {
    color: #6b7280;
}

.gis-popup__stats strong {
    color: #111827;
    font-weight: 600;
}

.gis-popup__note {
    font-size: 0.72rem;
    margin: 0.35rem 0 0;
    padding: 0.35rem 0.5rem;
    border-radius: 0.35rem;
}

.gis-popup__note--approx {
    color: #92400e;
    background: #fffbeb;
}

.gis-popup__note--google {
    color: #166534;
    background: #f0fdf4;
}

.gis-popup__actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.gis-popup__link {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.gis-popup__link:hover {
    text-decoration: underline;
}

.gis-marker--approx {
    opacity: 0.9;
}
