/* GIS & Mapping panel (Farm Map). Classes start with .gis-
   Part of dashboard.html; loaded in number order (01 first). See server/public/dashboard/README.md. */
/* ── GIS & Mapping panel (all rules scoped with .gis-) ───────────── */
.gis-toolbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}
.gis-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.gis-group + .gis-group:not(.gis-group--end) {
    padding-left: 1rem;
    border-left: 1px solid var(--border);
}
.gis-group--end {
    margin-left: auto;
}
.gis-group__label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    font-weight: 600;
}
.gis-tool {
    font-size: 0.82rem;
    padding: 0.4rem 0.7rem;
}
.gis-tool--primary {
    font-weight: 600;
}
.gis-toolbar .btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #1a1410;
}
.gis-toolbar .btn:focus-visible,
.gis-chip-toggle:focus-within,
.gis-camp-card:focus-visible,
.gis-camp-card button:focus-visible,
.gis-camps-tools input:focus-visible,
.gis-camps-tools select:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
.gis-chip-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    background: var(--card);
    user-select: none;
}
.gis-chip-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.gis-chip-toggle:has(input:checked) {
    border-color: var(--green);
    color: var(--text);
    background: color-mix(in srgb, var(--green) 16%, var(--card));
    font-weight: 600;
}
.gis-status {
    font-size: 0.8rem;
}
.gis-pop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1200;
    width: min(340px, 100%);
    padding: 0.8rem 0.9rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.gis-pop__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--text);
}
.gis-pop__input {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted);
    white-space: nowrap;
}
.gis-pop__input input {
    width: 64px;
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}
.gis-pop__hint {
    font-size: 0.75rem;
    margin-top: 0.4rem;
}
.gis-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.gis-stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.8rem;
    min-width: 0;
}
.gis-stat__v {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.gis-stat__l {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.gis-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 1rem;
    align-items: start;
}
.gis-map-card {
    padding: 0;
    overflow: hidden;
    min-width: 0;
}
.gis-map {
    height: 640px;
    width: 100%;
}
.gis-camps-card {
    padding: 0 1rem 1rem;
    max-height: 640px;
    overflow-y: auto;
    min-width: 0;
}
.gis-camps-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--card);
    padding: 1rem 0 0.6rem;
}
.gis-camps-title {
    font-size: 0.95rem;
    color: var(--text);
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.5rem;
}
.gis-count {
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 400;
}
.gis-camps-tools {
    display: flex;
    gap: 0.5rem;
}
.gis-camps-tools input,
.gis-camps-tools select {
    font-size: 0.82rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    min-width: 0;
}
.gis-camps-tools input {
    flex: 1 1 auto;
}
.gis-move-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.gis-move {
    background: var(--surface, #fff);
    color: var(--text);
    border-radius: 10px;
    padding: 1.25rem;
    width: min(420px, 100%);
}
.gis-move h3 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}
.gis-move label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
}
.gis-move select {
    width: 100%;
    margin-top: 0.2rem;
    padding: 0.45rem;
}
.gm-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
}
.gis-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1rem;
    margin: 0.6rem 0;
    font-size: 0.8rem;
    color: var(--muted);
}
.gis-legend__t {
    font-weight: 600;
    color: var(--text);
}
.gis-legend__i i {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: -0.1rem;
}
.gis-health {
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    white-space: nowrap;
    border: 1px solid currentColor;
}
.gis-health--good {
    color: #1d8a38;
}
.gis-health--work {
    color: #a56d00;
}
.gis-health--act {
    color: #c62828;
}
.gis-health--none {
    color: var(--muted);
}
.gis-why {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0.25rem 0 0.1rem;
}
.gis-camp-card {
    border: 1px solid var(--border);
    border-left: 4px solid var(--gis-c, var(--border));
    border-radius: 8px;
    background: var(--surface);
    padding: 0.6rem 0.7rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition:
        background 0.12s,
        border-color 0.12s;
}
.gis-camp-card:hover {
    background: color-mix(in srgb, var(--gis-c, var(--green)) 8%, var(--surface));
}
.gis-camp-card.is-selected {
    border-color: var(--gis-c, var(--green));
    background: color-mix(in srgb, var(--gis-c, var(--green)) 14%, var(--surface));
    box-shadow: 0 0 0 1px var(--gis-c, var(--green));
}
.gis-camp-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.gis-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--dim);
}
.gis-dot--grazing {
    background: var(--gold);
}
.gis-dot--resting {
    background: #4a9ad4;
}
.gis-dot--ready {
    background: var(--green);
}
.gis-camp-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    color: var(--text);
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gis-camp-status {
    flex: 0 0 auto;
    font-size: 0.75rem;
    color: var(--muted);
}
.gis-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}
.gis-pill {
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--muted);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gis-pill strong {
    color: var(--text);
    font-weight: 600;
}
.gis-bar {
    height: 5px;
    border-radius: 3px;
    background: var(--border);
    margin-top: 0.5rem;
    overflow: hidden;
}
.gis-bar > span {
    display: block;
    height: 100%;
    background: #4a9ad4;
}
.gis-bar.is-ready > span {
    background: var(--green);
}
.gis-camp-more {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border);
    cursor: default;
}
.gis-camp-full {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}
.gis-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}
.gis-actions .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.55rem;
}
.gis-actions .gis-danger {
    color: var(--red);
    border-color: var(--red);
    margin-left: auto;
}
.gis-zone {
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    max-width: 100%;
}
.gis-nomatch {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 0.5rem 0;
}
@media (max-width: 900px) {
    .gis-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .gis-map {
        height: min(60vh, 460px);
    }
    .gis-camps-card {
        max-height: none;
    }
    .gis-group + .gis-group:not(.gis-group--end) {
        padding-left: 0;
        border-left: none;
    }
    .gis-group--end {
        margin-left: 0;
    }
    .gis-pop {
        left: 0;
        right: 0;
        width: auto;
    }
}
