*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#edf3ea;color:#1f2a1f}.topbar{height:64px;padding:0 28px;display:flex;align-items:center;justify-content:space-between;background:#17351f;color:#fff}.brand{color:#fff;font-weight:800;text-decoration:none}.nav{display:flex;gap:18px;align-items:center}.nav a,.nav button{color:#fff;background:transparent;border:none;font:inherit;cursor:pointer;text-decoration:none}.container{max-width:1120px;margin:0 auto;padding:32px 20px}.card{background:#fff;border-radius:18px;padding:28px;margin-bottom:24px;box-shadow:0 12px 32px rgba(24,60,35,.08)}.hero-card{padding:48px}.auth-card{max-width:520px;margin:40px auto}.form{display:grid;gap:12px}.form input{width:100%;padding:12px 14px;border:1px solid #d3dfcf;border-radius:12px;font:inherit}.btn{display:inline-block;padding:12px 18px;border:none;border-radius:12px;background:#2f7d32;color:#fff;font-weight:700;cursor:pointer;text-decoration:none}.btn-secondary{background:#e5efe3;color:#1f2a1f}.actions{display:flex;gap:12px;margin-top:20px}.alert{padding:12px 14px;border-radius:12px;background:#fee2e2;color:#7f1d1d;margin-bottom:16px}.map{height:520px;border-radius:16px;overflow:hidden;margin:18px 0;border:1px solid #d3dfcf}.list{display:grid;gap:12px}.list-item{display:flex;justify-content:space-between;gap:16px;padding:16px;border:1px solid #dbe8d7;border-radius:14px;color:inherit;text-decoration:none}.details{display:grid;grid-template-columns:180px 1fr;gap:10px 18px}.details dt{font-weight:800}.inline-form{display:inline}


.muted {
    color: #667266;
}

.status {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 800;
    background: #e5efe3;
}

.status-done {
    background: #dcfce7;
    color: #166534;
}

.status-created,
.status-queued,
.status-searching_data,
.status-preprocessing,
.status-running_model,
.status-generating_result {
    background: #fef9c3;
    color: #854d0e;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.result-card {
    border-radius: 16px;
    padding: 20px;
    display: grid;
    gap: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.result-card span {
    font-weight: 700;
}

.result-card strong {
    font-size: 32px;
}

.result-card-green {
    background: #dcfce7;
    color: #14532d;
}

.result-card-yellow {
    background: #fef9c3;
    color: #713f12;
}

.result-card-red {
    background: #fee2e2;
    color: #7f1d1d;
}

@media (max-width: 760px) {
    .result-grid {
        grid-template-columns: 1fr;
    }
}


.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #dbe8d7;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: #395239;
    font-weight: 800;
    background: #f4f8f2;
}

.btn-small {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 10px;
}

.status {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e5efe3;
    color: #1f2a1f;
    font-size: 12px;
    font-weight: 800;
}

.status-done {
    background: #dcfce7;
    color: #166534;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

.status-created,
.status-queued,
.status-searching_data,
.status-preprocessing,
.status-running_model,
.status-generating_result {
    background: #fef3c7;
    color: #92400e;
}

.notice {
    padding: 14px 16px;
    border-radius: 14px;
    background: #eef6ff;
    color: #1e3a5f;
    margin-top: 20px;
}


.map-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.map-popup {
    background: #ffffff;
    border: 1px solid #dbe8d7;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    padding: 10px 12px;
    min-width: 160px;
    font-size: 13px;
    pointer-events: none;
}

/* Map UX: base layers + place/coordinate search */
.map {
    position: relative;
}

.agro-map-host .ol-zoom {
    top: 112px;
    right: 12px;
    left: auto;
    border-radius: 14px;
    padding: 4px;
}

.agro-map-host .ol-zoom button {
    width: 44px;
    height: 44px;
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    line-height: 40px;
    border-radius: 10px;
}

.agro-map-host .ol-zoom .ol-zoom-out {
    margin-top: 4px;
}

.agro-map-panel {
    position: absolute;
    z-index: 10000;
    top: 12px;
    left: 12px;
    right: 12px;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 10px;
    pointer-events: none;
}

.agro-map-search,
.agro-map-layer-switcher,
.agro-map-search-results {
    pointer-events: auto;
}

.agro-map-search {
    display: flex;
    min-width: 260px;
    max-width: 560px;
    background: #ffffff;
    border: 1px solid #d3dfcf;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.agro-map-search input {
    flex: 1;
    min-width: 0;
    border: none;
    padding: 11px 13px;
    font: inherit;
    outline: none;
}

.agro-map-search button,
.agro-map-layer-switcher button {
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.agro-map-search button {
    padding: 0 14px;
    background: #2f7d32;
    color: #ffffff;
}

.agro-map-layer-switcher {
    justify-self: end;
    display: flex;
    gap: 6px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #d3dfcf;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.agro-map-layer-switcher button {
    padding: 8px 11px;
    border-radius: 10px;
    background: transparent;
    color: #1f2a1f;
}

.agro-map-layer-switcher button.active {
    background: #17351f;
    color: #ffffff;
}

.agro-map-search-results {
    position: absolute;
    z-index: 10001;
    top: 48px;
    left: 0;
    width: min(560px, calc(100% - 130px));
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #d3dfcf;
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.agro-map-search-result {
    width: 100%;
    display: grid;
    gap: 3px;
    padding: 11px 13px;
    border: none;
    border-bottom: 1px solid #edf3ea;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    color: #1f2a1f;
}

.agro-map-search-result:hover {
    background: #f4f8f2;
}

.agro-map-search-result strong {
    font-size: 13px;
    line-height: 1.25;
}

.agro-map-search-result span,
.agro-map-search-empty {
    font-size: 12px;
    color: #667266;
}

.agro-map-search-empty {
    padding: 12px 14px;
}

@media (max-width: 760px) {
    .agro-map-panel {
        grid-template-columns: 1fr;
        right: 10px;
    }

    .agro-map-layer-switcher {
        justify-self: start;
        flex-wrap: wrap;
    }

    .agro-map-search-results {
        width: 100%;
        top: 92px;
    }
}

/* Keep custom search/layer controls above OpenLayers viewport. */
.agro-map-host .agro-map-panel {
    z-index: 10000;
}

.agro-map-panel button {
    user-select: none;
}

.analysis-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 800;
}

.analysis-progress-track {
    width: 100%;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5efe3;
}

.analysis-progress-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: #2f7d32;
    transition: width 0.35s ease;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.field-list-item {
    align-items: center;
}

.field-list-link {
    flex: 1;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: inherit;
    text-decoration: none;
}

.field-list-item .inline-form {
    flex: 0 0 auto;
}

.agro-map-host .agro-map-scale-control {
    position: absolute;
    z-index: 10000;
    pointer-events: none;
    left: auto;
    right: 10px;
    bottom: 30px;
    min-width: 70px;
    padding: 5px 7px 6px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(31, 42, 31, 0.22);
    border-radius: 9px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    text-align: center;
}

.agro-map-scale-label {
    margin-bottom: 3px;
    color: #1f2a1f;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.agro-map-scale-bar {
    height: 6px;
    min-width: 36px;
    border: 2px solid #1f2a1f;
    border-top: 0;
    margin: 0 auto;
}

@media (max-width: 760px) {
    .field-list-item,
    .field-list-link {
        align-items: stretch;
        flex-direction: column;
    }

    .field-list-item .inline-form,
    .field-list-item .inline-form button {
        width: 100%;
    }
}

.agro-map-host .agro-map-focus-control {
    position: absolute;
    z-index: 10000;
    top: 214px;
    right: 12px;
    left: auto;
    padding: 4px;
    border-radius: 14px;
}

.agro-map-host .agro-map-focus-control .agro-map-focus-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2a1f;
    cursor: pointer;
}

.agro-map-host .agro-map-focus-control .agro-map-focus-button:hover:not(:disabled) {
    background: #ffffff;
}

.agro-map-host .agro-map-focus-control .agro-map-focus-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.agro-map-host .agro-map-focus-control .agro-map-focus-button svg {
    width: 25px;
    height: 25px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.agro-map-host .agro-map-focus-control .agro-map-focus-button svg circle:last-child {
    fill: currentColor;
    stroke: none;
}

/* Shared delete confirmation modal */
body.modal-open {
    overflow: hidden;
}

.site-modal[hidden] {
    display: none !important;
}

.site-modal {
    position: fixed;
    z-index: 30000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(15, 23, 18, 0.56);
    backdrop-filter: blur(4px);
}

.site-modal-dialog {
    position: relative;
    width: min(460px, 100%);
    padding: 28px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
    text-align: left;
}

.site-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: #f1f5ef;
    color: #1f2a1f;
    font-size: 24px;
    line-height: 30px;
    cursor: pointer;
}

.site-modal-close:hover {
    background: #e5efe3;
}

.site-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 26px;
    font-weight: 900;
}

.site-modal-dialog h2 {
    margin: 0 36px 10px 0;
    font-size: 24px;
}

.site-modal-dialog p {
    margin: 0;
    color: #475247;
    line-height: 1.5;
}

.site-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.table-actions,
.actions-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.analysis-list-item {
    align-items: center;
}

.analysis-list-link {
    flex: 1;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: inherit;
    text-decoration: none;
}

.analysis-list-item .inline-form {
    flex: 0 0 auto;
}

@media (max-width: 760px) {
    .site-modal {
        align-items: flex-end;
        padding: 12px;
    }

    .site-modal-dialog {
        padding: 24px;
        border-radius: 20px;
    }

    .site-modal-actions,
    .table-actions,
    .actions-wrap,
    .analysis-list-item,
    .analysis-list-link {
        align-items: stretch;
        flex-direction: column;
    }

    .site-modal-actions .btn,
    .table-actions .btn,
    .table-actions .inline-form,
    .table-actions .inline-form button,
    .actions-wrap .btn,
    .actions-wrap .inline-form,
    .actions-wrap .inline-form button,
    .analysis-list-item .inline-form,
    .analysis-list-item .inline-form button {
        width: 100%;
    }
}

.form-warning {
    padding: 12px 14px;
    border-radius: 12px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-weight: 700;
}

.form-warning.is-soft-warning {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fed7aa;
}

.field-limits-summary {
    display: grid;
    gap: 6px;
    margin: 16px 0 0;
    padding: 13px 14px;
    border-radius: 16px;
    background: #f8fbf6;
    border: 1px solid #dbe8d7;
    color: #3b4b3d;
    line-height: 1.4;
}

.field-limits-summary strong {
    color: #17351f;
    font-size: 14px;
}

.field-limits-summary span {
    color: #647067;
    font-size: 13px;
}

.field-geometry-metrics {
    display: grid;
    gap: 7px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fbf6;
    border: 1px solid #dbe8d7;
    color: #344238;
    font-size: 14px;
    line-height: 1.45;
}

.field-geometry-metrics span {
    display: block;
}

.field-geometry-metrics strong {
    color: #17351f;
}

.field-geometry-metrics.is-warning {
    background: #fff7ed;
    border-color: #fed7aa;
}

.field-geometry-metrics.is-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.field-geometry-metrics.is-error strong {
    color: #7f1d1d;
}

.analysis-context-preview {
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8faf5;
    border: 1px solid #dbe8d7;
    color: #344238;
    line-height: 1.55;
}

.page-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.page-title-row .actions {
    margin-top: 0;
    flex-shrink: 0;
}

.btn-disabled {
    cursor: not-allowed;
    opacity: 0.65;
    pointer-events: none;
}

@media (max-width: 760px) {
    .page-title-row {
        flex-direction: column;
        align-items: stretch;
    }
    .page-title-row .actions,
    .page-title-row .actions .btn {
        width: 100%;
    }
}

.interpretation-card,
.analysis-error-card,
.data-quality-card {
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid #dbe8d7;
    background: #f8faf5;
}

.interpretation-card h3,
.analysis-error-card h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.interpretation-active_use_signs {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #14532d;
}

.interpretation-partial_degradation_signs,
.interpretation-mixed_state {
    background: #fffbeb;
    border-color: #fde68a;
    color: #713f12;
}

.interpretation-non_use_signs,
.analysis-error-card {
    background: #fef2f2;
    border-color: #fecaca;
    color: #7f1d1d;
}

.analysis-error-card pre {
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 260px;
    overflow: auto;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.65);
    border: 1px solid rgba(0,0,0,0.08);
}

.quality-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.quality-head strong {
    font-size: 20px;
}

.quality-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 800;
    font-size: 13px;
}

.quality-badge-excellent {
    background: #dcfce7;
    color: #166534;
}

.quality-badge-sufficient,
.quality-badge-high,
.quality-badge-medium {
    background: #e0f2fe;
    color: #075985;
}

.quality-badge-limited,
.quality-badge-low,
.quality-badge-mock,
.quality-badge-mock_with_real_scene_search {
    background: #fef3c7;
    color: #92400e;
}

.quality-badge-not_enough_data {
    background: #fee2e2;
    color: #991b1b;
}

.quality-warning-list {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(254, 243, 199, 0.7);
    border: 1px solid #fde68a;
    color: #713f12;
}

.compact-details {
    grid-template-columns: 180px 1fr;
    margin: 12px 0;
}

.compact-list {
    margin: 0;
    padding-left: 18px;
}

@media (max-width: 760px) {
    .quality-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Dashboard overview */
.dashboard-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    color: #f8fff5;
    background:
        linear-gradient(110deg, rgba(15, 35, 24, 0.96), rgba(31, 74, 42, 0.88)),
        radial-gradient(circle at 86% 16%, rgba(149, 213, 121, 0.35), transparent 30%),
        linear-gradient(135deg, #17351f, #335a37);
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.45;
}

.dashboard-hero-copy,
.dashboard-hero-actions {
    position: relative;
    z-index: 1;
}

.dashboard-hero h1 {
    margin: 8px 0 10px;
    font-size: clamp(32px, 4vw, 52px);
    letter-spacing: 0.04em;
}

.dashboard-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(248, 255, 245, 0.82);
    line-height: 1.6;
}

.eyebrow {
    display: inline-flex;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 900;
    color: #cde6b7;
}

.dashboard-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 190px;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.dashboard-kpi-card {
    display: flex;
    gap: 14px;
    align-items: center;
    min-height: 118px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(47, 125, 50, 0.11);
    box-shadow: 0 12px 28px rgba(24, 60, 35, .06);
}

.dashboard-kpi-icon {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 18px;
    background: #ecf7e7;
    color: #2f7d32;
    font-size: 23px;
    font-weight: 900;
}

.dashboard-kpi-icon-green { background: #dcfce7; color: #166534; }
.dashboard-kpi-icon-yellow { background: #fef3c7; color: #92400e; }
.dashboard-kpi-icon-red { background: #fee2e2; color: #991b1b; }

.dashboard-kpi-card p {
    margin: 0 0 4px;
    color: #5b6b59;
    font-size: 13px;
    font-weight: 700;
}

.dashboard-kpi-card strong {
    display: block;
    font-size: 29px;
    line-height: 1.1;
}

.dashboard-kpi-card small {
    color: #7a8778;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    align-items: start;
}

.dashboard-main,
.dashboard-side {
    min-width: 0;
}

.dashboard-side {
    display: grid;
    gap: 24px;
}

.dashboard-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard-section-head h2 {
    margin: 0 0 4px;
}

.dashboard-section-head p {
    margin: 0;
}

.dashboard-side-head {
    align-items: center;
}

.dashboard-map {
    height: 560px;
    margin: 0;
    border-radius: 18px;
    border-color: rgba(47, 125, 50, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

.dashboard-map-card {
    padding: 22px;
}

.dashboard-map-note {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #dbe8d7;
    border-radius: 14px;
    background: #f6faf4;
    color: #40513f;
    font-size: 14px;
}

.dashboard-map-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    font-size: 12px;
    color: #5b6b59;
}

.dashboard-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    background: #f6faf4;
    border: 1px solid #dbe8d7;
}

.legend-dot,
.dashboard-analysis-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    flex: 0 0 auto;
}

.legend-ok,
.status-dot-ok { background: #2f7d32; }
.legend-warning,
.status-dot-warning,
.status-dot-running { background: #d97706; }
.legend-problem,
.status-dot-problem,
.status-dot-error { background: #dc2626; }
.legend-empty,
.status-dot-no-analysis,
.status-dot-unknown { background: #94a3b8; }

.dashboard-empty-map {
    min-height: 420px;
    display: grid;
    place-items: center;
    text-align: center;
    border: 1px dashed #b8ccb3;
    border-radius: 18px;
    background: #f6faf4;
    padding: 34px;
}

.dashboard-empty-map p {
    margin-top: 0;
    color: #667266;
}

.dashboard-selected-title {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    border-radius: 16px;
    background: #f6faf4;
    border: 1px solid #dbe8d7;
}

.dashboard-selected-title strong {
    display: block;
    font-size: 22px;
    margin-bottom: 4px;
}

.dashboard-selected-title span:not(.dashboard-field-badge) {
    color: #667266;
    font-size: 13px;
}

.dashboard-field-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.badge-ok { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-problem,
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-running { background: #dbeafe; color: #1d4ed8; }
.badge-no-analysis,
.badge-unknown { background: #e2e8f0; color: #475569; }

.dashboard-compact-details {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 10px 14px;
    margin: 18px 0;
    font-size: 14px;
}

.dashboard-compact-details dt {
    color: #667266;
    font-weight: 800;
}

.dashboard-compact-details dd {
    margin: 0;
    font-weight: 700;
}

.dashboard-zone-bars {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.dashboard-zone-bars div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px 10px;
    align-items: center;
}

.dashboard-zone-bars span {
    color: #445445;
    font-weight: 700;
    font-size: 13px;
}

.dashboard-zone-bars strong {
    font-size: 13px;
}

.dashboard-zone-bars i,
.dashboard-health-line i {
    grid-column: 1 / -1;
    display: block;
    height: 7px;
    min-width: 2%;
    max-width: 100%;
    border-radius: 999px;
}

.zone-green,
.dashboard-health-line i { background: #2f7d32; }
.zone-yellow { background: #facc15; }
.zone-red { background: #dc2626; }

.dashboard-insight-box {
    margin: 18px 0 0;
    padding: 14px;
    border-radius: 16px;
    background: #eef6ff;
    border: 1px solid #cfe4ff;
    color: #1f3a5d;
}

.dashboard-insight-box p {
    margin: 7px 0 0;
    font-size: 14px;
    line-height: 1.5;
}

.dashboard-empty-state-small {
    padding: 16px;
    border-radius: 16px;
    background: #f6faf4;
    border: 1px solid #dbe8d7;
}

.dashboard-empty-state-small p {
    color: #667266;
}

.dashboard-side-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.dashboard-data-table tr.is-selected-row td {
    background: #f2f8ee;
}

.dashboard-health-line {
    display: grid;
    min-width: 110px;
    gap: 5px;
}

.dashboard-health-line span {
    font-weight: 900;
    font-size: 13px;
}

.dashboard-actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.dashboard-analysis-list {
    display: grid;
    gap: 10px;
}

.dashboard-analysis-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    background: #f9fcf8;
    border: 1px solid #dbe8d7;
}

.dashboard-analysis-item strong {
    display: block;
    font-size: 14px;
}

.dashboard-analysis-item small {
    display: block;
    color: #667266;
    margin-top: 3px;
}

.dashboard-analysis-item em {
    font-style: normal;
    font-weight: 900;
    color: #2f7d32;
}

.dashboard-map-popup {
    z-index: 9999;
}

@media (max-width: 1280px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .dashboard-hero,
    .dashboard-section-head {
        flex-direction: column;
    }

    .dashboard-hero-actions {
        width: 100%;
    }

    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-map {
        height: 420px;
    }

    .dashboard-map-legend {
        justify-content: flex-start;
    }

    .dashboard-compact-details {
        grid-template-columns: 1fr;
    }
}

body:has(.dashboard-hero) .container {
    max-width: 1520px;
}

/* App shell: left sidebar + compact top header */
.app-shell-body {
    background: #edf3ea;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    background:
        radial-gradient(circle at 100% 0%, rgba(217, 234, 202, 0.75), transparent 30%),
        #edf3ea;
}

.app-sidebar {
    position: sticky;
    top: 0;
    width: 232px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 22px 14px;
    color: #f4fbef;
    background:
        linear-gradient(180deg, rgba(10, 28, 17, 0.98), rgba(23, 53, 31, 0.98)),
        radial-gradient(circle at 20% 10%, rgba(185, 220, 153, 0.18), transparent 28%);
    border-right: 1px solid rgba(255,255,255,0.08);
    box-shadow: 16px 0 40px rgba(11, 26, 16, 0.16);
    z-index: 80;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 2px 16px;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.12em;
}

.app-brand-mark {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
}

.app-brand-mark svg {
    width: 30px;
    height: 30px;
    fill: #f8fff4;
    stroke: #f8fff4;
    stroke-width: 1.25;
}

.app-brand-mark .thin {
    fill: none;
    opacity: 0.8;
}

.app-sidebar-brand strong {
    display: block;
    font-size: 19px;
    line-height: 1.05;
}

.app-sidebar-brand small {
    display: block;
    margin-top: 5px;
    color: rgba(244, 251, 239, 0.72);
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.app-sidebar-nav {
    display: grid;
    gap: 6px;
}

.app-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 13px;
    color: rgba(244, 251, 239, 0.84);
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.app-sidebar-nav a span {
    width: 20px;
    display: inline-grid;
    place-items: center;
    font-size: 18px;
    opacity: 0.92;
}

.app-sidebar-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.09);
    transform: translateX(2px);
}

.app-sidebar-nav a.is-active,
.app-sidebar-nav a.is-active-soft {
    color: #f8fff4;
    background: rgba(209, 229, 193, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.app-sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 16px;
}

.app-plan-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
}

.app-plan-card span,
.app-plan-card small {
    display: block;
    color: rgba(244, 251, 239, 0.68);
    font-size: 12px;
}

.app-plan-card strong {
    display: block;
    margin: 4px 0 10px;
    font-size: 14px;
}

.app-plan-card i {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    overflow: hidden;
}

.app-plan-card i b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #8fc46d;
}

.app-sidebar-copy {
    color: rgba(244, 251, 239, 0.62);
    font-size: 12px;
    padding-left: 4px;
}

.app-workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding: 8px 26px;
    background: rgba(247, 250, 244, 0.86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(47, 125, 50, 0.12);
}

.app-toplinks {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-right: 4px;
}

.app-toplinks a {
    color: #243125;
    text-decoration: none;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.app-toplinks a:hover {
    color: #2f7d32;
}

.app-notification-button {
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #dbe8d7;
    border-radius: 13px;
    background: #fff;
    color: #17351f;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(24, 60, 35, .06);
}

.app-notification-icon {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-notification-button b {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    border: 2px solid #f7faf4;
}

.app-user-menu {
    position: relative;
}

.app-user-menu summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 258px;
    min-height: 48px;
    padding: 5px 10px 5px 5px;
    border: 1px solid #dbe8d7;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(24, 60, 35, .06);
}

.app-user-menu summary::-webkit-details-marker {
    display: none;
}

.app-avatar {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #2f7d32, #17351f);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.app-user-text {
    min-width: 0;
    min-height: 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    line-height: 1.2;
    padding-bottom: 2px;
    overflow: visible;
}

.app-user-text strong {
    max-width: 172px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    line-height: 1.15;
}

.app-user-text small {
    max-width: 172px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #667266;
    font-size: 12px;
    line-height: 1.25;
    padding-bottom: 1px;
}

.app-user-chevron {
    margin-left: auto;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;

    color: #405040;
    line-height: 1;

    transform: translateY(0);
}

.app-user-chevron svg {
    display: block;
    width: 16px;
    height: 16px;

    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 258px;
    padding: 8px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #dbe8d7;
    box-shadow: 0 18px 48px rgba(24, 60, 35, .16);
    z-index: 120;
}

.app-user-dropdown a,
.app-user-dropdown button {
    width: 100%;
    display: block;
    padding: 11px 12px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #1f2a1f;
    text-align: left;
    text-decoration: none;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.app-user-dropdown a:hover,
.app-user-dropdown button:hover {
    background: #eef6ea;
}

.app-content {
    width: 100%;
    max-width: 1520px;
    padding: 24px 28px 42px;
}

.app-shell .card {
    box-shadow: 0 16px 40px rgba(24,60,35,.07);
}

.public-topbar .brand {
    letter-spacing: 0.16em;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .app-sidebar {
        width: 76px;
        padding: 16px 10px;
    }

    .app-sidebar-brand {
        justify-content: center;
        padding-bottom: 10px;
    }

    .app-sidebar-brand span:last-child,
    .app-sidebar-nav a:not(.is-active) span + text,
    .app-sidebar-nav a {
        font-size: 0;
    }

    .app-sidebar-nav a {
        justify-content: center;
        padding: 12px;
    }

    .app-sidebar-nav a span {
        font-size: 22px;
    }

    .app-plan-card,
    .app-sidebar-copy {
        display: none;
    }

    .app-toplinks {
        display: none;
    }
}


@media (max-width: 1100px) {
    .app-topbar {
        min-height: 58px;
        padding: 8px 18px;
    }

    .app-user-menu summary {
        min-width: 220px;
    }

    .app-user-text strong,
    .app-user-text small {
        max-width: 132px;
    }
}

@media (max-width: 760px) {
    .app-shell {
        display: block;
    }

    .app-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .app-sidebar-brand span:last-child {
        display: block;
    }

    .app-sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .app-sidebar-nav a,
    .app-sidebar-nav a:not(.is-active) span + text {
        min-width: max-content;
        font-size: 13px;
    }

    .app-topbar {
        position: static;
        min-height: 56px;
        justify-content: space-between;
        padding: 8px 14px;
        gap: 10px;
    }

    .app-user-menu summary {
        min-width: auto;
        min-height: 42px;
        padding: 4px 8px 4px 4px;
    }

    .app-user-text {
        display: none;
    }

    .app-user-dropdown {
        right: 0;
    }

    .app-avatar {
        width: 36px;
        height: 36px;
    }

    .app-content {
        padding: 20px 14px 34px;
    }
}

.app-brand-mark {
    overflow: hidden;
    width: 54px;
    height: 54px;
    border: none !important;
    border-radius: 18px;
    background: transparent;
    box-shadow: none !important;
}

.app-brand-logo-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}


/* Full fields page + dashboard table footer */
.dashboard-table-footer {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.fields-page-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
}

.fields-page-hero h1 {
    margin: 8px 0 10px;
    font-size: clamp(32px, 4vw, 48px);
}

.fields-page-hero p {
    max-width: 760px;
    line-height: 1.6;
}

.fields-page-actions {
    margin-top: 0;
    flex-shrink: 0;
}

.fields-full-card .dashboard-section-head {
    margin-bottom: 18px;
}

.fields-full-table td:first-child strong {
    font-size: 16px;
}

.fields-empty-state {
    min-height: 300px;
}

.app-brand-mark {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

@media (max-width: 760px) {
    .fields-page-hero {
        flex-direction: column;
    }

    .fields-page-actions,
    .fields-page-actions .btn {
        width: 100%;
    }
}

/* ===== Иконки левого меню ===== */

.app-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-sidebar-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    color: currentColor;
}

.app-sidebar-icon svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Домик для "Обзор" — толще и чуть выше */
.app-sidebar-icon-home {
    transform: translateY(-1px);
}

.app-sidebar-icon-home svg {
    width: 23px;
    height: 23px;
    stroke-width: 2.7;
}

/* Иконка карты — чуть крупнее, как обычная физическая карта */
.app-sidebar-icon-map {
    transform: translateY(-0.5px);
}

.app-sidebar-icon-map svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.4;
}

/* Save field button is shown only after a valid polygon is drawn. */
#save-field-btn[hidden] {
    display: none !important;
}

/* ===== Workflow redesign: add field, launch analysis, result page ===== */
.workflow-page,
.analysis-redesign-page {
    display: grid;
    gap: 22px;
}

.workflow-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #6a7567;
    font-size: 13px;
    font-weight: 700;
}

.workflow-breadcrumbs a {
    color: #335a37;
    text-decoration: none;
}

.workflow-breadcrumbs a:hover {
    color: #2f7d32;
}

.workflow-title-row,
.analysis-hero-redesign {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border: 1px solid rgba(47, 125, 50, 0.12);
    border-radius: 22px;
    background:
        radial-gradient(circle at 90% 8%, rgba(143, 196, 109, 0.18), transparent 30%),
        rgba(255, 255, 255, 0.82);
    box-shadow: 0 16px 38px rgba(24, 60, 35, .07);
}

.workflow-title-row h1,
.analysis-hero-redesign h1 {
    margin: 6px 0 8px;
    font-size: clamp(30px, 3.5vw, 44px);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.workflow-title-row p,
.analysis-hero-redesign p {
    max-width: 760px;
    margin: 0;
    color: #5d6b5a;
    line-height: 1.55;
}

.workflow-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #2f7d32;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.workflow-stepper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    position: relative;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(47, 125, 50, 0.12);
    color: #7b8678;
    box-shadow: 0 12px 28px rgba(24, 60, 35, .05);
}

.workflow-step span {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #e5efe3;
    color: #40513f;
    font-size: 13px;
    font-weight: 900;
}

.workflow-step strong {
    font-size: 14px;
}

.workflow-step.is-active {
    color: #17351f;
    background: #ffffff;
    border-color: rgba(47, 125, 50, 0.25);
}

.workflow-step.is-active span,
.workflow-step.is-done span {
    background: #17351f;
    color: #ffffff;
}

.workflow-step.is-done {
    color: #2f7d32;
}

.workflow-alert {
    margin-bottom: 0;
}

.workflow-layout {
    display: grid;
    gap: 22px;
    align-items: start;
}

.workflow-layout-map-first {
    grid-template-columns: minmax(0, 1fr) 360px;
}

.workflow-layout-side {
    grid-template-columns: minmax(0, 1fr) 380px;
}

.workflow-main-stack {
    display: grid;
    gap: 22px;
    min-width: 0;
}

.workflow-card,
.workflow-side-card,
.analysis-run-card,
.analysis-result-shell,
.analysis-action-card-redesign,
.analysis-quality-redesign,
.analysis-diagnostics-redesign {
    border-radius: 22px;
    border: 1px solid rgba(47, 125, 50, 0.12);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 16px 38px rgba(24, 60, 35, .07);
}

.workflow-card,
.workflow-side-card,
.analysis-action-card-redesign,
.analysis-quality-redesign,
.analysis-diagnostics-redesign {
    padding: 22px;
}

.workflow-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}

.workflow-card-head h2,
.workflow-side-card h2,
.analysis-action-card-redesign h2,
.analysis-quality-redesign h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.workflow-card-head p,
.workflow-side-card p,
.analysis-action-card-redesign p,
.analysis-quality-redesign p {
    margin: 0;
    color: #667266;
    line-height: 1.5;
}

.workflow-map-actions,
.workflow-form-actions,
.analysis-hero-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.workflow-map-shell {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(47, 125, 50, 0.16);
    background: #dfe9dd;
}

.workflow-map {
    margin: 0;
    border: none;
    border-radius: 18px;
}

.workflow-map-large {
    height: 610px;
}

.workflow-mini-map {
    height: 260px;
    margin: 12px 0 16px;
    border-radius: 16px;
}

.workflow-floating-help {
    position: absolute;
    left: 16px;
    bottom: 16px;
    max-width: 260px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(47, 125, 50, 0.12);
    box-shadow: 0 14px 34px rgba(0,0,0,.15);
    backdrop-filter: blur(10px);
}

.workflow-floating-help p {
    margin: 5px 0 0;
    color: #667266;
    font-size: 13px;
    line-height: 1.45;
}

.workflow-side-card {
    position: sticky;
    top: 82px;
}

.workflow-side-icon {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 18px;
    background: #ecf7e7;
    color: #2f7d32;
    font-size: 24px;
    font-weight: 900;
}

.workflow-form {
    margin-top: 18px;
}

.workflow-form input[type="text"],
.workflow-form input[type="date"],
.workflow-date-card input {
    border-color: #dbe8d7;
    background: #fbfdf9;
}

.workflow-primary-btn {
    background: #17351f;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(23, 53, 31, 0.18);
}

.workflow-primary-btn:hover {
    background: #21472b;
}

.workflow-note-blue {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: 16px;
    background: #eef8f6;
    border: 1px solid #cce9df;
    color: #214846;
    line-height: 1.45;
}

.workflow-note-blue span {
    color: #48635e;
    font-size: 13px;
}

.workflow-date-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.workflow-date-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid #dbe8d7;
    background: #f8fbf6;
    font-weight: 800;
}

.workflow-date-card span {
    color: #526252;
    font-size: 13px;
}

.workflow-context-preview {
    display: grid;
    gap: 10px;
    margin: 4px 0;
}

.workflow-context-preview > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #e0ebdd;
}

.workflow-context-preview span {
    color: #667266;
}

.workflow-context-preview b {
    text-align: right;
}

.workflow-details-list {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px 12px;
    margin: 0;
}

.workflow-details-list dt {
    color: #667266;
    font-weight: 800;
}

.workflow-details-list dd {
    margin: 0;
    font-weight: 800;
}

.workflow-analysis-list {
    display: grid;
    gap: 10px;
}

.workflow-analysis-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border-radius: 15px;
    background: #f8fbf6;
    border: 1px solid #dbe8d7;
}

.workflow-analysis-row a {
    display: grid;
    gap: 2px;
    color: inherit;
    text-decoration: none;
}

.workflow-analysis-row a span {
    color: #667266;
    font-size: 13px;
}

.workflow-empty-state {
    padding: 24px;
    border-radius: 18px;
    border: 1px dashed #b8ccb3;
    background: #f8fbf6;
    text-align: center;
}

.workflow-empty-state p {
    color: #667266;
}

/* Analysis result redesign */
.analysis-top-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.analysis-info-tile {
    min-height: 112px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(47, 125, 50, .12);
    box-shadow: 0 12px 28px rgba(24,60,35,.055);
}

.analysis-info-tile span {
    display: block;
    color: #667266;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 8px;
}

.analysis-info-tile strong {
    display: block;
    color: #1f2a1f;
    font-size: 18px;
    line-height: 1.22;
}

.analysis-info-tile small {
    display: block;
    margin-top: 8px;
    color: #7b8778;
}

.analysis-run-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.92), rgba(242,248,238,.9)),
        radial-gradient(circle at 90% 0%, rgba(143,196,109,.22), transparent 34%);
}

.analysis-run-main {
    display: flex;
    align-items: center;
    gap: 24px;
}

.analysis-progress-circle {
    --progress: 0%;
    width: 154px;
    height: 154px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #fff 55%, transparent 56%),
        conic-gradient(#2f7d32 var(--progress), #e5efe3 0);
    box-shadow: inset 0 0 0 1px #dbe8d7, 0 18px 36px rgba(24,60,35,.10);
}

.analysis-progress-circle strong {
    grid-area: 1 / 1;
    font-size: 32px;
    margin-top: -12px;
}

.analysis-progress-circle span {
    grid-area: 1 / 1;
    align-self: end;
    margin-bottom: 34px;
    color: #667266;
    font-size: 12px;
    font-weight: 800;
}

.analysis-run-main h2 {
    margin: 6px 0 8px;
    font-size: 26px;
}

.analysis-run-main p,
.analysis-run-side p {
    color: #667266;
    line-height: 1.55;
}

.analysis-run-side {
    padding: 18px;
    border-radius: 18px;
    background: #eef8f6;
    border: 1px solid #cce9df;
}

.analysis-result-shell {
    padding: 0;
    overflow: hidden;
}

.analysis-tabs-redesign {
    display: flex;
    gap: 0;
    padding: 0 18px;
    border-bottom: 1px solid #dbe8d7;
    background: rgba(255,255,255,.74);
}

.analysis-tabs-redesign a {
    padding: 16px 18px;
    color: #526252;
    text-decoration: none;
    font-weight: 900;
    border-bottom: 3px solid transparent;
}

.analysis-tabs-redesign a.is-active,
.analysis-tabs-redesign a:hover {
    color: #17351f;
    border-bottom-color: #2f7d32;
}

.analysis-map-card-redesign {
    position: relative;
    min-height: 610px;
}

.analysis-map-redesign {
    height: 610px;
    margin: 0;
    border: none;
    border-radius: 0;
}

.analysis-map-side-panel {
    position: absolute;
    z-index: 10000;
    top: 20px;
    left: 20px;
    width: 240px;
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(47,125,50,.12);
    box-shadow: 0 18px 42px rgba(0,0,0,.18);
    backdrop-filter: blur(10px);
}

.analysis-map-side-panel h3 {
    margin: 0 0 6px;
}

.analysis-zone-legend {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.analysis-zone-legend i,
.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.zone-dot-green,
.legend-active { background: #22c55e; }
.zone-dot-yellow,
.legend-medium { background: #facc15; }
.zone-dot-red,
.legend-problem { background: #dc2626; }

.analysis-map-side-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #40513f;
    font-size: 13px;
    font-weight: 800;
}

.analysis-stat-grid-redesign {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.analysis-stat-card {
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(47,125,50,.12);
    background: #fff;
    box-shadow: 0 14px 30px rgba(24,60,35,.06);
}

.analysis-stat-card span {
    display: block;
    color: #667266;
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 10px;
}

.analysis-stat-card strong {
    display: block;
    font-size: 34px;
    line-height: 1;
}

.analysis-stat-card small {
    display: block;
    margin-top: 10px;
    color: #7b8778;
}

.stat-green { background: linear-gradient(180deg, #ffffff, #f0fdf4); }
.stat-yellow { background: linear-gradient(180deg, #ffffff, #fffbeb); }
.stat-red { background: linear-gradient(180deg, #ffffff, #fef2f2); }
.stat-dark { background: linear-gradient(135deg, #17351f, #284b2f); color: #fff; }
.stat-dark span,
.stat-dark small { color: rgba(255,255,255,.72); }

.analysis-interpretation-redesign,
.analysis-quality-redesign,
.analysis-action-card-redesign,
.analysis-scenes-redesign,
.analysis-diagnostics-redesign {
    margin-top: 0;
}

.analysis-quality-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.analysis-quality-grid > div {
    padding: 14px;
    border-radius: 16px;
    background: #f8fbf6;
    border: 1px solid #dbe8d7;
}

.analysis-quality-grid span {
    display: block;
    color: #667266;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 7px;
}

.analysis-quality-grid strong {
    display: block;
    font-size: 16px;
    line-height: 1.25;
}

.analysis-action-card-redesign {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.analysis-diagnostics-redesign summary {
    cursor: pointer;
    font-size: 20px;
    font-weight: 900;
}

.analysis-diagnostics-redesign[open] summary {
    margin-bottom: 18px;
}

.analysis-error-redesign {
    border-radius: 22px;
    padding: 22px;
}

@media (max-width: 1280px) {
    .workflow-layout-map-first,
    .workflow-layout-side,
    .analysis-run-card {
        grid-template-columns: 1fr;
    }

    .workflow-side-card {
        position: static;
    }

    .analysis-top-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .analysis-stat-grid-redesign,
    .analysis-quality-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .workflow-title-row,
    .analysis-hero-redesign,
    .analysis-action-card-redesign,
    .workflow-card-head,
    .analysis-run-main {
        flex-direction: column;
        align-items: stretch;
    }

    .workflow-stepper,
    .workflow-date-grid,
    .analysis-top-metrics,
    .analysis-stat-grid-redesign,
    .analysis-quality-grid {
        grid-template-columns: 1fr;
    }

    .workflow-map-large,
    .analysis-map-redesign,
    .analysis-map-card-redesign {
        height: 430px;
        min-height: 430px;
    }

    .analysis-map-side-panel {
        position: static;
        width: auto;
        margin: 14px;
    }

    .analysis-map-card-redesign {
        display: flex;
        flex-direction: column-reverse;
    }

    .workflow-floating-help {
        position: static;
        max-width: none;
        margin: 12px;
    }

    .analysis-tabs-redesign {
        overflow-x: auto;
        padding: 0 8px;
    }

    .analysis-tabs-redesign a {
        min-width: max-content;
    }

    .workflow-analysis-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}


/* Analysis map state index panel: smaller and lower than search field */
.analysis-map-side-panel {
    top: 82px !important;
    left: 16px !important;
    width: 198px !important;
    gap: 7px !important;
    padding: 11px 12px !important;
    border-radius: 15px !important;
    box-shadow: 0 12px 28px rgba(0,0,0,.16) !important;
}

.analysis-map-side-panel h3 {
    margin: 0 0 3px !important;
    font-size: 15px !important;
}

.analysis-zone-legend {
    grid-template-columns: 9px minmax(0, 1fr) auto !important;
    gap: 6px !important;
    font-size: 11.5px !important;
}

.analysis-zone-legend i,
.legend-color {
    width: 8px !important;
    height: 8px !important;
}

.analysis-zone-legend b {
    font-size: 11.5px !important;
}

.analysis-map-side-panel hr {
    width: 100%;
    margin: 2px 0 !important;
    border: 0;
    border-top: 1px solid #dbe8d7;
}

.analysis-map-side-panel label {
    gap: 6px !important;
    font-size: 11.5px !important;
    line-height: 1.2 !important;
}

.analysis-map-side-panel input[type="checkbox"] {
    width: 12px;
    height: 12px;
}

.dashboard-kpi-icon-fields {
    background: #ecf7e7;
    color: #2f7d32;
    font-size: 27px;
    line-height: 1;
}

@media (max-width: 760px) {
    .analysis-map-side-panel {
        top: 86px !important;
        left: 12px !important;
        width: min(190px, calc(100% - 24px)) !important;
    }
}


/* Quick map search autocomplete */
.agro-map-search-result.is-keyboard-active {
    background: #eaf5e6;
    outline: 2px solid rgba(47, 125, 50, .22);
    outline-offset: -2px;
}

/* ===== Auth pages redesign ===== */
.public-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 12%, rgba(132, 204, 22, .20), transparent 34%),
        radial-gradient(circle at 82% 8%, rgba(47, 125, 50, .18), transparent 30%),
        linear-gradient(135deg, #edf3ea 0%, #f8fbf4 52%, #e3efe0 100%);
}

.public-topbar {
    background: rgba(23, 53, 31, .94);
    backdrop-filter: blur(12px);
    box-shadow: 0 14px 36px rgba(13, 38, 22, .18);
}

.auth-page-shell {
    min-height: calc(100vh - 128px);
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(380px, 520px);
    gap: 28px;
    align-items: stretch;
    padding: 20px 0 34px;
}

.auth-visual-card,
.auth-card-redesign {
    border: 1px solid rgba(47, 125, 50, .13);
    box-shadow: 0 24px 60px rgba(24, 60, 35, .11);
}

.auth-visual-card {
    position: relative;
    min-height: 680px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    padding: 38px;
    border-radius: 30px;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(23, 53, 31, .95), rgba(47, 125, 50, .82)),
        url("/static/img/logo.png") center 72px / 210px 210px no-repeat;
}

.auth-visual-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255,255,255,.055) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: .32;
}

.auth-visual-card::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -120px;
    top: -120px;
    border-radius: 999px;
    background: rgba(190, 242, 100, .18);
    filter: blur(2px);
}

.auth-visual-card > * {
    position: relative;
    z-index: 1;
}

.auth-visual-logo {
    position: absolute;
    top: 34px;
    left: 34px;
    width: 76px;
    height: 76px;
    padding: 8px;
    border-radius: 24px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.24);
    box-shadow: 0 18px 36px rgba(0,0,0,.18);
}

.auth-visual-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 18px;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: 100%;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(47, 125, 50, .10);
    color: #2f7d32;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.auth-visual-card .auth-eyebrow {
    margin-top: 18px;
    background: rgba(255,255,255,.14);
    color: #eaffdf;
    line-height: 1.25;
    white-space: normal;
}

.auth-visual-card h1 {
    max-width: 640px;
    margin: 18px 0 12px;
    font-size: clamp(34px, 4vw, 56px);
    line-height: .98;
    letter-spacing: -.045em;
}

.auth-visual-card p {
    max-width: 560px;
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 17px;
    line-height: 1.6;
}

.auth-visual-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 28px;
}

.auth-visual-grid span {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
}

.auth-visual-grid b {
    font-size: 16px;
}

.auth-visual-grid small {
    color: rgba(255,255,255,.72);
    line-height: 1.35;
}

.auth-card-redesign {
    align-self: center;
    width: 100%;
    margin: 0;
    padding: 30px;
    border-radius: 28px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
}

.auth-form-head h1 {
    margin: 14px 0 8px;
    font-size: clamp(30px, 3vw, 42px);
    line-height: 1.05;
    letter-spacing: -.035em;
    color: #17351f;
}

.auth-form-head p {
    margin: 0;
    color: #60705f;
    line-height: 1.55;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin: 24px 0 20px;
    padding: 5px;
    border-radius: 16px;
    background: #eef6eb;
    border: 1px solid #dbe8d7;
}

.auth-tabs a {
    padding: 11px 12px;
    border-radius: 12px;
    color: #40513f;
    text-align: center;
    text-decoration: none;
    font-weight: 900;
}

.auth-tabs a.is-active {
    background: #17351f;
    color: #fff;
    box-shadow: 0 10px 24px rgba(23, 53, 31, .18);
}

.auth-alert {
    margin-bottom: 18px;
}

.auth-form-redesign {
    gap: 11px;
}

.auth-form-redesign label:not(.auth-remember-row) {
    color: #2b3d2b;
    font-size: 13px;
    font-weight: 900;
}

.auth-form-redesign input[type="text"],
.auth-form-redesign input[type="email"],
.auth-form-redesign input[type="password"] {
    min-height: 48px;
    border: 1px solid #d3dfcf;
    border-radius: 14px;
    background: #fbfdf9;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.auth-form-redesign input:focus {
    border-color: rgba(47, 125, 50, .70);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(47, 125, 50, .11);
}

.auth-form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.auth-form-grid-2 > div {
    display: grid;
    gap: 11px;
}

.auth-remember-row {
    display: flex;
    align-items: center;
    gap: 9px;
    width: max-content;
    max-width: 100%;
    margin: 2px 0 4px;
    color: #40513f;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.auth-remember-row input {
    width: 16px;
    height: 16px;
    accent-color: #2f7d32;
}

.auth-submit-btn {
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    border-radius: 15px;
    font-size: 16px;
    box-shadow: 0 16px 30px rgba(47, 125, 50, .20);
}

.auth-switch-note {
    margin: 20px 0 0;
    color: #60705f;
    text-align: center;
    font-weight: 700;
}

.auth-switch-note a {
    color: #2f7d32;
    font-weight: 900;
    text-decoration: none;
}

.auth-switch-note a:hover {
    text-decoration: underline;
}

@media (max-width: 920px) {
    .auth-page-shell {
        grid-template-columns: 1fr;
    }

    .auth-visual-card {
        min-height: 500px;
        background: linear-gradient(145deg, rgba(23, 53, 31, .95), rgba(47, 125, 50, .82));
    }
}

@media (max-width: 620px) {
    .auth-page-shell {
        padding-top: 8px;
    }

    .auth-visual-card {
        display: none;
    }

    .auth-card-redesign {
        padding: 22px;
        border-radius: 22px;
    }

    .auth-form-grid-2 {
        grid-template-columns: 1fr;
    }
}


.auth-notice {
    padding: 12px 14px;
    border-radius: 14px;
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
    font-weight: 800;
    margin-bottom: 18px;
}

/* ===== Password visibility and strength ===== */
.auth-password-field {
    position: relative;
    width: 100%;
}

.auth-form-redesign .auth-password-field input,
.auth-password-field input {
    width: 100%;
    padding-right: 52px;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 38px;
    height: 38px;
    padding: 0;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #60705f;
    cursor: pointer;
    transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: #17351f;
    background: #eef6eb;
}

.auth-password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 125, 50, .16);
}

.auth-eye {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-eye-closed,
.auth-password-toggle.is-visible .auth-eye-open {
    display: none;
}

.auth-password-toggle.is-visible .auth-eye-closed {
    display: block;
}

.auth-password-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 12px;
    margin: 1px 0 4px;
    padding: 0;
    list-style: none;
    color: #687867;
    font-size: 12px;
    line-height: 1.35;
}

.auth-password-rules li {
    position: relative;
    padding-left: 20px;
}

.auth-password-rules li::before {
    content: "○";
    position: absolute;
    left: 0;
    top: -.05em;
    color: #9aab98;
    font-weight: 900;
}

.auth-password-rules li.is-passed {
    color: #166534;
}

.auth-password-rules li.is-passed::before {
    content: "✓";
    color: #16a34a;
}

.auth-password-rules li.is-failed {
    color: #b42318;
}

.auth-password-rules li.is-failed::before {
    content: "×";
    color: #dc2626;
}

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

@media (max-width: 620px) {
    .auth-password-rules {
        grid-template-columns: 1fr;
    }
}

/* ===== Responsive sidebar fix: tablet collapsed mode + mobile top navigation ===== */
.app-sidebar-brand-text {
    min-width: 0;
    display: block;
}

.app-sidebar-brand-text strong,
.app-sidebar-brand-text small {
    overflow-wrap: anywhere;
}

@media (max-width: 1100px) and (min-width: 761px) {
    .app-shell {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .app-sidebar {
        width: 88px;
        padding: 14px 8px;
        gap: 14px;
        overflow-x: hidden;
    }

    .app-sidebar-brand {
        width: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 0 0 12px;
        text-align: center;
        letter-spacing: 0;
    }

    .app-sidebar-brand .app-brand-mark {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .app-sidebar-brand-text {
        display: block !important;
        max-width: 72px;
        text-align: center;
        line-height: 1;
    }

    .app-sidebar-brand-text strong {
        display: block;
        max-width: 72px;
        color: #fff;
        font-size: 9px;
        line-height: 1.05;
        letter-spacing: 0.08em;
        white-space: normal;
    }

    .app-sidebar-brand-text small {
        display: block;
        max-width: 72px;
        margin-top: 3px;
        color: rgba(244, 251, 239, 0.72);
        font-size: 6.5px;
        line-height: 1.05;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        white-space: normal;
    }

    .app-sidebar-nav {
        gap: 7px;
    }

    .app-sidebar-nav a {
        width: 100%;
        min-height: 46px;
        justify-content: center;
        gap: 0;
        padding: 11px 8px;
        font-size: 0;
        overflow: hidden;
    }

    .app-sidebar-nav a span {
        width: 24px;
        font-size: 22px;
    }

    .app-sidebar-icon {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }

    .app-plan-card,
    .app-sidebar-copy {
        display: none !important;
    }
}

@media (max-width: 760px) {
    .app-shell {
        display: block;
        min-height: 100vh;
    }

    .app-sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        height: auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 10px 12px 8px;
        overflow: hidden;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.10);
        box-shadow: 0 12px 28px rgba(11, 26, 16, 0.18);
        z-index: 90;
    }

    .app-sidebar-brand {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 9px;
        padding: 0;
        text-align: left;
        letter-spacing: 0.08em;
    }

    .app-sidebar-brand .app-brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 13px;
    }

    .app-sidebar-brand-text {
        display: block !important;
        max-width: calc(100vw - 82px);
        min-width: 0;
        text-align: left;
    }

    .app-sidebar-brand-text strong {
        display: block;
        max-width: 100%;
        color: #fff;
        font-size: 14px;
        line-height: 1.05;
        letter-spacing: 0.08em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-sidebar-brand-text small {
        display: block;
        max-width: 100%;
        margin-top: 2px;
        color: rgba(244, 251, 239, 0.72);
        font-size: 8px;
        line-height: 1.1;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-sidebar-nav {
        display: flex;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        margin: 0 -4px;
        padding: 0 4px 2px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .app-sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .app-sidebar-nav a,
    .app-sidebar-nav a:not(.is-active) span + text {
        flex: 0 0 auto;
        width: auto;
        min-width: max-content;
        min-height: 38px;
        justify-content: center;
        gap: 7px;
        padding: 8px 10px;
        font-size: 13px;
        line-height: 1;
        border-radius: 12px;
        white-space: nowrap;
    }

    .app-sidebar-nav a span {
        width: 18px;
        font-size: 16px;
    }

    .app-sidebar-icon {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }

    .app-sidebar-icon svg,
    .app-sidebar-icon-home svg,
    .app-sidebar-icon-map svg {
        width: 18px;
        height: 18px;
    }

    .app-plan-card,
    .app-sidebar-copy {
        display: none !important;
    }

    .app-topbar {
        position: static;
        min-height: 54px;
        padding: 8px 12px;
    }
}

@media (max-width: 420px) {
    .app-sidebar {
        padding: 8px 8px 7px;
        gap: 8px;
    }

    .app-sidebar-brand {
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        text-align: center;
    }

    .app-sidebar-brand .app-brand-mark {
        width: 38px;
        height: 38px;
    }

    .app-sidebar-brand-text {
        max-width: calc(100vw - 18px);
        text-align: center;
    }

    .app-sidebar-brand-text strong {
        font-size: 12px;
        letter-spacing: 0.08em;
    }

    .app-sidebar-brand-text small {
        font-size: 7px;
        letter-spacing: 0.08em;
    }

    .app-sidebar-nav a,
    .app-sidebar-nav a:not(.is-active) span + text {
        min-height: 36px;
        padding: 7px 9px;
        font-size: 12px;
    }

    .app-user-dropdown {
        right: 0;
        max-width: calc(100vw - 20px);
    }
}

/* ===== Funding footer: FSI + University Tech Platform ===== */
.funding-footer {
    margin: auto 0 0;
    padding: 0 32px 26px;
    color: #314033;
}

.funding-footer__inner {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    padding: 18px 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(47, 125, 50, .12);
    box-shadow: 0 16px 38px rgba(24, 60, 35, .08);
}

.funding-footer__text {
    max-width: 760px;
    color: rgba(31, 42, 31, .78);
    font-size: 12.5px;
    line-height: 1.55;
}

.funding-footer__logos {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    min-width: 220px;
}

.funding-footer__logos img {
    display: block;
    width: auto;
    max-width: 186px;
    height: 74px;
    object-fit: contain;
}

.public-body .funding-footer {
    padding-top: 0;
}

@media (max-width: 900px) {
    .funding-footer {
        padding: 0 18px 20px;
    }

    .funding-footer__inner {
        grid-template-columns: 1fr;
        gap: 14px;
        text-align: center;
    }

    .funding-footer__text {
        max-width: none;
    }

    .funding-footer__logos {
        min-width: 0;
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 520px) {
    .funding-footer {
        padding: 0 10px 16px;
    }

    .funding-footer__inner {
        padding: 14px 12px;
        border-radius: 16px;
    }

    .funding-footer__text {
        font-size: 11.5px;
    }

    .funding-footer__logos {
        gap: 10px;
    }

    .funding-footer__logos img {
        max-width: 170px;
        height: 68px;
    }
}

.form-hint {
    margin: -8px 0 12px;
    color: var(--text-muted, #6b7280);
    font-size: 13px;
    line-height: 1.4;
}
