/* Agro-map dashboard — тёмный UI */
body.agro-dashboard-page {
    background: #0b1210;
    color: #e8f0ec;
}

body.agro-dashboard-page .site-header.header-solid {
    background: rgba(11, 18, 16, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.agro-dashboard-page .site-header .nav-link,
body.agro-dashboard-page .site-header .brand,
body.agro-dashboard-page .site-header .top-link {
    color: rgba(244, 250, 247, 0.9);
}

body.agro-dashboard-page main.agro-dashboard {
    padding-top: 140px;
    padding-bottom: 48px;
    min-height: 100vh;
}

.agro-dashboard .section-tag {
    background: rgba(201, 162, 39, 0.15);
    color: #e8c547;
}

.agro-dashboard .section-title-premium {
    color: #f4faf7;
}

.agro-dashboard .section-subtitle-premium {
    color: rgba(232, 240, 236, 0.65) !important;
}

.agro-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    min-height: calc(100vh - 200px);
}

@media (max-width: 991px) {
    .agro-layout {
        grid-template-columns: 1fr;
    }
}

.agro-map-panel {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #111916;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    min-height: 520px;
}

.agro-map-panel #country-map,
.agro-map-panel #region-map {
    width: 100%;
    height: 100%;
    min-height: 520px;
}

.agro-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.agro-card {
    background: linear-gradient(145deg, #141f1a 0%, #0f1613 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.agro-card:hover {
    border-color: rgba(201, 162, 39, 0.25);
}

.agro-card-accent {
    border-left: 4px solid var(--region-accent, #c9a227);
}

.agro-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.agro-stat {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 14px;
}

.agro-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f4faf7;
    line-height: 1.2;
}

.agro-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(232, 240, 236, 0.55);
    margin-top: 4px;
}

.agro-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.agro-filter-chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(232, 240, 236, 0.85);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.agro-filter-chip:hover,
.agro-filter-chip.active {
    background: rgba(201, 162, 39, 0.2);
    border-color: #c9a227;
    color: #f4faf7;
}

.agro-search {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    color: #f4faf7;
    font-size: 0.9rem;
}

.agro-search::placeholder {
    color: rgba(232, 240, 236, 0.4);
}

.agro-search:focus {
    outline: none;
    border-color: #c9a227;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.agro-field-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agro-field-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.agro-field-item:hover,
.agro-field-item.active {
    background: rgba(201, 162, 39, 0.12);
    border-color: rgba(201, 162, 39, 0.35);
}

.agro-field-item .culture-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.agro-placeholder {
    text-align: center;
    padding: 32px 16px;
    color: rgba(232, 240, 236, 0.45);
}

.agro-placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.4;
    margin-bottom: 12px;
}

/* Leaflet overrides */
.agro-map-panel .leaflet-container {
    background: #0d1411;
    font-family: var(--font-text, system-ui, sans-serif);
}

.agro-map-panel .leaflet-control-zoom a {
    background: #1a2620;
    color: #e8f0ec;
    border-color: rgba(255, 255, 255, 0.1);
}

.agro-map-panel .leaflet-control-zoom a:hover {
    background: #243329;
}

.agro-map-float-badges {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.agro-float-badge {
    background: rgba(10, 18, 14, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.8rem;
    color: #e8f0ec;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Country SVG map (maps.php) */
.agro-country-svg-wrap {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.agro-country-svg-wrap .kyrgyzstan-svg-map {
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.5));
}

.agro-country-svg-wrap .region-path {
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 1.5;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    fill-opacity: 0.82;
}

.agro-country-svg-wrap .region-path:hover {
    fill-opacity: 1;
    stroke-width: 2.5;
    filter: brightness(1.15);
}

.agro-country-svg-wrap .region-path.is-selected {
    fill-opacity: 1;
    stroke-width: 3;
    stroke-dasharray: 6 4;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.35));
}

.agro-map-tooltip {
    position: absolute;
    display: none;
    background: rgba(10, 18, 14, 0.94);
    backdrop-filter: blur(12px);
    color: #f4faf7;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 600;
    pointer-events: none;
    max-width: 240px;
}

.agro-map-tooltip h4 {
    margin: 0 0 4px;
    font-size: 0.9rem;
    color: #e8c547;
}

.agro-map-tooltip p {
    margin: 0;
    font-size: 0.78rem;
    opacity: 0.85;
}

/* Leaflet field popup */
.leaflet-popup-content-wrapper.agro-popup {
    background: rgba(10, 18, 14, 0.95);
    color: #f4faf7;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.leaflet-popup-tip.agro-popup-tip {
    background: rgba(10, 18, 14, 0.95);
}

.agro-popup h3 {
    font-size: 1rem;
    margin: 0 0 8px;
    color: #e8c547;
}

.agro-popup .meta {
    font-size: 0.82rem;
    line-height: 1.6;
    opacity: 0.9;
}

.agro-popup .btn-link-field {
    display: inline-block;
    margin-top: 10px;
    color: #e8c547;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.agro-popup .btn-link-field:hover {
    text-decoration: underline;
}

/* Field detail page */
.agro-field-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 991px) {
    .agro-field-detail-grid {
        grid-template-columns: 1fr;
    }
}

.agro-history-table {
    width: 100%;
    font-size: 0.88rem;
}

.agro-history-table th {
    color: rgba(232, 240, 236, 0.5);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.agro-history-table td {
    padding: 12px 8px 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.agro-breadcrumb a {
    color: #e8c547;
    text-decoration: none;
}

.agro-breadcrumb a:hover {
    text-decoration: underline;
}

.agro-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.agro-btn-primary {
    background: linear-gradient(135deg, #c9a227 0%, #a8841a 100%);
    color: #0b1210;
}

.agro-btn-primary:hover {
    filter: brightness(1.08);
    color: #0b1210;
}

.agro-btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: #e8f0ec;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.agro-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.agro-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.agro-status-good { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.agro-status-attention { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.agro-status-critical { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

@keyframes agroFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.agro-fade-in {
    animation: agroFadeIn 0.35s ease forwards;
}

/* Bar chart placeholder */
.agro-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 120px;
    padding-top: 8px;
}

.agro-bar {
    flex: 1;
    border-radius: 6px 6px 0 0;
    min-height: 8px;
    transition: height 0.4s ease;
}

.agro-bar-label {
    font-size: 0.65rem;
    text-align: center;
    color: rgba(232, 240, 236, 0.45);
    margin-top: 6px;
}

/* ── Карта на главной странице ── */
.home-land-fund-section .agro-land-fund-map {
    min-height: 480px;
    height: 480px;
}

.home-land-fund-section .agro-card {
    background: var(--bg-light, #fff);
    border: 1px solid rgba(12, 62, 33, 0.08);
    border-radius: var(--border-radius-md, 16px);
    box-shadow: var(--shadow-md);
}

.home-land-fund-section .agro-land-fund-station-btn {
    color: var(--text-dark, #0f172a);
}

.home-land-fund-section .agro-land-fund-station-btn:hover,
.home-land-fund-section .agro-land-fund-station-btn.is-active {
    color: var(--primary-color, #0c3e21);
    background: rgba(16, 185, 129, 0.1);
    box-shadow: inset 3px 0 0 var(--accent-color, #10b981);
}

.home-land-fund-section .agro-land-fund-legend-title {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted, #475569);
}

/* ── Maps page (светлая тема, как на остальном сайте) ── */
body.maps-page {
    background: var(--bg-alt, #f8faf7);
    color: var(--text-dark, #0f172a);
}

body.maps-page .site-header.header-solid {
    background: rgba(12, 62, 33, 0.97);
    backdrop-filter: var(--glass-blur, blur(14px));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
}

body.maps-page .site-header .nav-link,
body.maps-page .site-header .brand,
body.maps-page .site-header .top-link,
body.maps-page .site-header .dropdown-trigger,
body.maps-page .site-header .country-trigger {
    color: rgba(255, 255, 255, 0.92);
}

body.maps-page .site-header .nav-link:hover,
body.maps-page .site-header .nav-link.active,
body.maps-page .site-header .brand:hover {
    color: #fff;
}

main.maps-page-main {
    padding-top: 140px;
    padding-bottom: 48px;
    min-height: 100vh;
}

.maps-page-main .section-title-premium {
    color: var(--primary-color, #0c3e21);
}

.maps-page-main .section-subtitle-premium {
    color: var(--text-muted, #475569) !important;
}

body.maps-page .agro-card {
    background: var(--bg-light, #ffffff);
    border: 1px solid rgba(12, 62, 33, 0.08);
    border-radius: var(--border-radius-md, 16px);
    box-shadow: var(--shadow-md);
}

body.maps-page .agro-card:hover {
    border-color: rgba(16, 185, 129, 0.35);
}

body.maps-page .agro-land-fund-legend-title {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted, #475569);
}

/* ── Land fund KML map ── */
.agro-land-fund-layout {
    display: grid;
    grid-template-columns: 1fr minmax(220px, 280px);
    gap: 16px;
    align-items: stretch;
}

@media (max-width: 991px) {
    .agro-land-fund-layout {
        grid-template-columns: 1fr;
    }
}

.agro-land-fund-map {
    width: 100%;
    min-height: 560px;
    height: 560px;
    border-radius: var(--border-radius-md, 16px);
    overflow: hidden;
    border: 1px solid rgba(12, 62, 33, 0.1);
    box-shadow: var(--shadow-md);
    background: #e8f0ec;
    z-index: 1;
}

body.maps-page .agro-land-fund-map .leaflet-container {
    background: #e8f0ec;
}

body.maps-page .agro-land-fund-map .leaflet-control-zoom a {
    background: #fff;
    color: var(--primary-color, #0c3e21);
    border-color: rgba(12, 62, 33, 0.12);
}

body.maps-page .agro-land-fund-map .leaflet-control-zoom a:hover {
    background: var(--bg-alt, #f8faf7);
}

body.maps-page .agro-land-fund-map .leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-muted, #475569);
}

.agro-land-fund-legend {
    height: fit-content;
}

.agro-land-fund-stations li {
    margin-bottom: 10px;
}

.agro-land-fund-stations li:last-child {
    margin-bottom: 0;
}

.agro-land-fund-station-btn {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: none;
    background: none;
    text-align: left;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-dark, #0f172a);
    cursor: pointer;
    border-radius: var(--border-radius-sm, 8px);
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.agro-land-fund-station-btn:hover,
.agro-land-fund-station-btn.is-active {
    color: var(--primary-color, #0c3e21);
    background: rgba(16, 185, 129, 0.1);
    box-shadow: inset 3px 0 0 var(--accent-color, #10b981);
}

.agro-land-fund-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 3px;
    border: 1px solid rgba(12, 62, 33, 0.15);
}

.kml-station-marker-wrap {
    background: transparent !important;
    border: none !important;
}

.kml-station-marker-dot {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(12, 62, 33, 0.35);
    cursor: pointer;
}

.kml-plot-popup .leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.kml-plot-popup .leaflet-popup-content {
    margin: 12px 14px;
    min-width: 140px;
}

.kml-plot-popup-inner {
    font-size: 0.9rem;
    color: #0f172a;
}

.kml-plot-popup-title {
    margin: 0 0 8px;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.75;
    line-height: 1.3;
}

.kml-plot-popup-area {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kml-plot-popup-area span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.kml-plot-popup-area strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0c3e21;
}

.kml-station-tooltip {
    max-width: 280px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
    text-align: center;
    border: 1px solid rgba(12, 62, 33, 0.1);
    border-radius: var(--border-radius-sm, 8px);
    padding: 8px 12px;
    background: #fff;
    color: var(--primary-color, #0c3e21);
    box-shadow: var(--shadow-md);
}

.kml-map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 560px;
    padding: 24px;
    color: var(--text-muted, #475569);
    text-align: center;
}

.leaflet-container {
    font-family: var(--font-body, 'Inter', sans-serif);
}

/* Карточки участков под картой */
.maps-stations-info {
    margin-top: 8px;
}

.maps-station-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-light, #fff);
    border: 1px solid rgba(12, 62, 33, 0.08);
    border-radius: var(--border-radius-md, 16px);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.maps-station-card:hover {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: var(--shadow-lg);
}

.maps-station-card__img-wrap {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: var(--bg-alt, #f8faf7);
}

.maps-station-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.maps-station-card__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.maps-station-card__body {
    padding: 22px 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.maps-station-card__title {
    font-family: var(--font-headings, 'Outfit', sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color, #0c3e21);
    margin: 0 0 16px;
    line-height: 1.35;
}

.maps-station-card__meta {
    margin: 0 0 20px;
    flex: 1;
}

.maps-station-card__row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px 12px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.maps-station-card__row:last-child {
    margin-bottom: 0;
}

.maps-station-card__row dt {
    margin: 0;
    font-weight: 600;
    color: var(--text-muted, #475569);
}

.maps-station-card__row dd {
    margin: 0;
    color: var(--text-dark, #0f172a);
}

.maps-station-card__row dd a {
    color: var(--accent-color, #10b981);
    font-weight: 600;
    text-decoration: none;
}

.maps-station-card__row dd a:hover {
    color: var(--accent-hover, #059669);
    text-decoration: underline;
}

.maps-station-card__map-btn {
    align-self: flex-start;
    border: none;
    border-radius: var(--border-radius-sm, 8px);
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    color: #fff;
    background: var(--primary-color, #0c3e21);
    transition: background 0.2s ease, transform 0.2s ease;
}

.maps-station-card__map-btn:hover {
    background: var(--primary-light, #165c34);
}

@media (max-width: 575px) {
    .maps-station-card__row {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .maps-station-card__img-wrap {
        height: 180px;
    }
}
