/* Kopernikus GIS - Web2 Styles */

/* =============================================
   RESET & BASE
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2C3E50;
    --secondary-color: #3498DB;
    --success-color: #27AE60;
    --warning-color: #F39C12;
    --danger-color: #E74C3C;
    --light-bg: #ECF0F1;
    --dark-bg: #34495E;
    --text-color: #2C3E50;
    --border-color: #BDC3C7;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* parcela.html: širi layout da mapa ~3/4 ekrana */
.container--wide {
    max-width: min(96vw, 1800px);
}
.page-parcela .grid-2col--map-wide #map {
    height: min(86vh, 900px);
}

/* =============================================
   HEADER
   ============================================= */
.header {
    background: white;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    padding: 30px 0;
}

.header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header .subtitle {
    color: #7F8C8D;
    font-size: 1.1rem;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card h2, .card h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h3 {
    font-size: 1.3rem;
}

/* =============================================
   PARCEL INFO
   ============================================= */
.parcel-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.parcel-info h2 {
    color: white;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item .label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.info-item .value {
    font-size: 1.4rem;
    font-weight: bold;
}

/* =============================================
   INDEX SELECTOR
   ============================================= */
.index-selector {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.index-btn {
    flex: 1;
    min-width: 150px;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.index-btn:hover {
    border-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.index-btn.active {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
    color: white;
}

.index-btn .icon {
    font-size: 2rem;
}

.index-btn .name {
    font-size: 1.2rem;
    font-weight: bold;
}

.index-btn .desc {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* =============================================
   DATE SELECTOR
   ============================================= */
.date-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.date-selector-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.date-selector-row .date-btn {
    flex: 1;
    min-width: 0;
}

@media (min-width: 521px) {
    .date-selector-row {
        flex-wrap: nowrap;
    }
}

.date-selector-placeholder {
    font-size: 0.95rem;
    color: #888;
    padding: 12px 0;
}

/* Indeks + datum u jednom redu */
.index-date-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    gap: 16px;
    align-items: stretch;
    margin-bottom: 20px;
}
.index-date-row > .card {
    margin-bottom: 0;
}
.index-date-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1rem;
}
.index-date-row .index-selector {
    gap: 8px;
}
.index-date-row .index-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 8px;
}
.index-date-row .raw-cal {
    max-width: 192px;
    width: 192px;
    box-shadow: none;
    border-color: #e8eef3;
    padding: 7px;
}
.index-date-row .raw-cal-layout {
    width: 100%;
}
@media (max-width: 520px) {
    .raw-cal-layout {
        flex-direction: column;
    }
}
@media (max-width: 900px) {
    .index-date-row {
        grid-template-columns: 1fr;
    }
}

.date-btn {
    flex: 1;
    min-width: 120px;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.date-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.date-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.date-btn .name {
    font-size: 1.05rem;
    font-weight: bold;
}

.date-btn .sub {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* Raw TIFF month calendar (parcela.html) */
.raw-cal-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
}
.raw-cal {
    width: 192px;
    max-width: 192px;
    flex-shrink: 0;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 7px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.raw-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 5px;
}
.raw-cal-title {
    font-weight: 700;
    font-size: 0.74rem;
    color: #1f2937;
    text-transform: capitalize;
}
.raw-cal-nav-btn {
    width: 22px;
    height: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    color: #334155;
    padding: 0;
}
.raw-cal-nav-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}
.raw-cal-weekdays,
.raw-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.raw-cal-weekdays {
    margin-bottom: 3px;
}
.raw-cal-weekdays span {
    text-align: center;
    font-size: 0.58rem;
    font-weight: 700;
    color: #94a3b8;
    padding: 0;
}
.raw-cal-day {
    aspect-ratio: 1;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.62rem;
    font-weight: 600;
    cursor: default;
    padding: 0;
    min-height: 0;
}
.raw-cal-day.empty {
    visibility: hidden;
}
.raw-cal-day.has-scene {
    background: #f0fdf4;
    color: #166534;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px #bbf7d0;
}
.raw-cal-day.has-scene:hover {
    background: #dcfce7;
}
.raw-cal-day.has-scene.on-disk,
.raw-cal-day.has-scene.is-valid {
    background: #86efac;
    color: #14532d;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px #22c55e;
}
.raw-cal-day.has-scene.active,
.raw-cal-day.has-tiff.active,
.raw-cal-day.has-scene.is-valid.active {
    background: #059669;
    color: #fff;
    box-shadow: none;
}
.raw-cal-day.has-tiff {
    background: #ecfdf5;
    color: #047857;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px #a7f3d0;
}
.raw-cal-day.has-tiff:hover {
    background: #d1fae5;
}
.raw-cal-day.has-tiff.active {
    background: #059669;
    color: #fff;
    box-shadow: none;
}
.raw-cal-day.muted {
    opacity: 0.55;
}
.raw-cal-hint {
    margin-top: 0;
    margin-bottom: 2px;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.raw-cal-hint-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.raw-cal-hint-count {
    color: #94a3b8;
    margin-top: 2px;
    padding-left: 20px;
    font-size: 0.8rem;
}
.raw-cal-hint-note {
    margin: 8px 0 0;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #94a3b8;
    max-width: 20rem;
}
.raw-cal-swatch {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 3px;
    flex-shrink: 0;
}
.raw-cal-swatch.has-scene {
    background: #f0fdf4;
    box-shadow: inset 0 0 0 1px #86efac;
}
.raw-cal-swatch.on-disk,
.raw-cal-swatch.is-valid {
    background: #86efac;
    box-shadow: inset 0 0 0 1px #22c55e;
}

/* =============================================
   GRID LAYOUTS
   ============================================= */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

/* parcela.html: mapa ~3/4, Trenutno stanje ~1/4 */
.grid-2col--map-wide {
    grid-template-columns: 3fr 1fr;
    align-items: start;
}
.grid-2col--map-wide .map-panel {
    min-width: 0;
}
.grid-2col--map-wide .current-stats-panel {
    min-width: 0;
}
.stats-grid--stack {
    grid-template-columns: 1fr;
}
.stats-grid--stack .stat-card {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
}
.stats-grid--stack .stat-value {
    font-size: 1.45rem;
}
.current-stats-panel .map-legend {
    margin-top: 16px;
}
.iot-sensors-toggle {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}
.iot-sensors-btn {
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    color: #1a3a5c;
    border: 1px solid #c5d0dc;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.iot-sensors-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}
.iot-sensors-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.zone-distribution-card {
    width: 100%;
    margin-bottom: 25px;
}
.zone-distribution-card .zone-distribution {
    margin-top: 0;
}
.iot-charts-card {
    width: 100%;
    margin-bottom: 25px;
}
.iot-charts-prikaz {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 10px 0 12px;
}
.iot-charts-prikaz-label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}
.iot-charts-range {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.iot-charts-range-btn {
    padding: 6px 12px;
    border: 1px solid #c5d0dc;
    background: #fff;
    color: #1a3a5c;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.iot-charts-range-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}
.iot-charts-range-btn.active {
    background: #166534;
    border-color: #166534;
    color: #fff;
}
.iot-charts-range-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}
.iot-charts-status {
    margin: 0 0 14px;
    font-size: 12px;
    color: #666;
}
.iot-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}
.iot-chart-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px 10px;
    background: #fff;
}
.iot-chart-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}
.iot-chart-head strong {
    font-size: 1rem;
}
.iot-chart-type {
    margin-left: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #166534;
    background: #dcfce7;
    border-radius: 999px;
    padding: 2px 8px;
}
.iot-chart-meta {
    font-size: 11px;
    color: #6b7280;
}
.iot-chart-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.iot-chart-pill {
    font-size: 11px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 4px 8px;
    color: #334155;
}
.iot-chart-pill-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}
.iot-chart-canvas-wrap {
    position: relative;
    height: 220px;
}

@media (max-width: 1024px) {
    .grid-2col {
        grid-template-columns: 1fr;
    }
    .grid-2col--map-wide {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   MAP
   ============================================= */
#map {
    height: 500px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
}

/* Klizači za transparentnost NDVI, NDMI, NDRE */
.index-opacity-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 12px 0;
    margin-bottom: 10px;
    background: var(--light-bg);
    border-radius: 8px;
    padding: 15px;
}
.opacity-slider {
    flex: 1;
    min-width: 100px;
}
/* Jedan klizač u punoj širini panela (npr. NDRE Zone, RGB oblaci) */
.opacity-slider--wide {
    flex: 1 1 100%;
    min-width: 100%;
}
.opacity-slider label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}
.opacity-slider input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 3px;
}
/* Dron RGB + NDVI u istom redu */
.dron-opacity-row {
    flex: 1 1 100%;
    display: flex;
    gap: 20px;
    min-width: 100%;
}
.dron-opacity-row .opacity-slider {
    flex: 1;
    min-width: 120px;
}
.opacity-slider label .opacity-hint {
    font-weight: 400;
    color: var(--text-muted, #666);
}
.opacity-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--secondary-color);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.map-legend {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
}

.map-legend h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.legend-color {
    width: 30px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.2);
}

/* =============================================
   STATS
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #7F8C8D;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* =============================================
   ZONE DISTRIBUTION
   ============================================= */
.zone-distribution {
    margin-top: 20px;
}

.zone-distribution h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.zone-bar {
    display: flex;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.zone-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.zone-segment:hover {
    opacity: 0.8;
}

.zone-segment.red {
    background: #E74C3C;
}

.zone-segment.yellow {
    background: #F39C12;
}

.zone-segment.green {
    background: #27AE60;
}

.zone-explanation {
    margin-top: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #555;
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
.zone-explanation strong {
    font-size: inherit;
    font-weight: 600;
}
.zone-explanation em {
    font-size: inherit;
}

/* =============================================
   CHART
   ============================================= */
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}
#timeSeriesChart {
    width: 100% !important;
    height: 100% !important;
}

.chart-actions {
    margin-top: 15px;
}

.chart-actions .btn {
    padding: 10px 20px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.chart-actions .btn:hover {
    background: #2980b9;
}

.chart-actions .btn-primary {
    background: var(--secondary-color);
}

/* =============================================
   RECOMMENDATIONS
   ============================================= */
.recommendations {
    background: #FFF9F0;
    border-left: 4px solid var(--warning-color);
}

.recommendation-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recommendation-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.recommendation-item .icon {
    font-size: 1.5rem;
}

.recommendation-item strong {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.recommendation-item p {
    margin: 0;
    color: #7F8C8D;
}

/* =============================================
   TABLE
   ============================================= */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

table thead {
    background: var(--primary-color);
    color: white;
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:hover {
    background: var(--light-bg);
}

table tbody tr.loading td {
    text-align: center;
    padding: 30px;
    color: #7F8C8D;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    background: white;
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.footer p {
    margin: 5px 0;
    color: var(--primary-color);
}

.footer .small {
    font-size: 0.9rem;
    color: #7F8C8D;
}

/* =============================================
   LOADING OVERLAY
   ============================================= */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 1.2rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .index-selector {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #map {
        height: 350px;
    }
}

/* =============================================
   CROP HISTORY
   ============================================= */
.crop-history-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.crop-history-head h3 {
    margin: 0;
    flex: 1 1 auto;
    min-width: 200px;
}

.crop-history-reset-btn {
    flex-shrink: 0;
    font-size: 0.875rem;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #c9ccd1;
    background: #fafafa;
    cursor: pointer;
    color: #333;
    font-family: inherit;
}

.crop-history-reset-btn:hover:not(:disabled) {
    background: #eee;
    border-color: #b0b4bb;
}

.crop-history-reset-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.crop-history-subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.crop-history-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crop-season-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 14px 16px;
    transition: box-shadow 0.2s, transform 0.15s;
}

.crop-season-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.crop-season-card.current-season {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.crop-season-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.crop-icon {
    font-size: 2rem;
    line-height: 1;
}

.crop-season-info {
    flex: 1;
}

.crop-season-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.badge-current {
    display: inline-block;
    background: #22c55e;
    color: white;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 4px;
    letter-spacing: 0.5px;
}

.crop-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
}

.crop-confidence {
    font-size: 1.3rem;
    font-weight: 800;
    min-width: 52px;
    text-align: center;
    border-radius: 8px;
    padding: 4px 8px;
    line-height: 1.2;
}

.conf-high {
    color: #16a34a;
    background: rgba(34, 197, 94, 0.12);
}

.conf-med {
    color: #ca8a04;
    background: rgba(234, 179, 8, 0.12);
}

.conf-low {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

.crop-season-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 6px;
}

.crop-detail .detail-label {
    color: #888;
}

.crop-evidence {
    margin: 6px 0 0 0;
    padding-left: 18px;
    font-size: 0.8rem;
    color: #777;
    line-height: 1.5;
}

.crop-evidence li {
    margin-bottom: 2px;
}

.crop-confirm-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e0e0e0;
}

.crop-confirm-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
}

.crop-yield-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

.crop-yield-label {
    font-size: 0.8rem;
    color: #444;
    font-weight: 600;
    white-space: nowrap;
}

.crop-yield-label abbr {
    text-decoration: none;
    border-bottom: 1px dotted #999;
    cursor: help;
}

.crop-yield-input {
    width: 5.5rem;
    padding: 4px 8px;
    font-size: 0.85rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
}

.crop-yield-input:focus {
    border-color: #0d9488;
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

.crop-yield-btn {
    padding: 4px 12px;
    background: #0d9488;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.crop-yield-btn:hover {
    background: #0f766e;
}

.crop-yield-compare {
    margin: 10px 0 0;
    padding: 10px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #14532d;
}

.crop-yield-compare--note {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.crop-yield-compare-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #166534;
}

.crop-yield-compare--note .crop-yield-compare-title {
    color: #475569;
}

.crop-yield-compare-list {
    margin: 0;
    padding-left: 18px;
}

.crop-yield-compare-list li {
    margin-bottom: 4px;
}

.crop-yield-compare .lbl {
    font-weight: 600;
    color: #15803d;
}

.crop-yield-compare--note .lbl {
    color: #64748b;
}

.crop-yield-compare .sub {
    font-size: 0.78rem;
    color: #4d7c4f;
    font-weight: 500;
}

.crop-yield-compare-footnote {
    margin-top: 8px;
    font-size: 0.74rem;
    color: #3f6212;
    font-style: italic;
}

.crop-yield-compare--note .crop-yield-compare-footnote {
    color: #94a3b8;
    font-style: normal;
}

.crop-confirm-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #444;
    user-select: none;
}

.crop-confirm-cb,
.crop-wrong-cb {
    width: 18px;
    height: 18px;
    accent-color: #dc2626;
    cursor: pointer;
}

.crop-confirm-text {
    font-weight: 600;
}

.crop-confirm-hint {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.35;
    margin: 0;
    padding-left: 0;
}

.crop-correct-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.crop-correct-select {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
    min-width: 160px;
    cursor: pointer;
}

.crop-correct-select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

.crop-correct-btn {
    padding: 5px 14px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.crop-correct-btn:hover {
    background: #2563eb;
}

.crop-saved-msg {
    font-size: 0.85rem;
    font-weight: 600;
    color: #16a34a;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.crop-advice-btn-row {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.crop-advice-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #1a3a5c, #2563eb);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

.crop-advice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37,99,235,0.35);
}

@media (max-width: 768px) {
    .crop-season-header {
        flex-wrap: wrap;
    }
    .crop-season-details {
        flex-direction: column;
        gap: 4px;
    }
    .crop-confirm-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =============================================
   UTILITIES
   ============================================= */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* =============================================
   POLJE 3 — Bodenproben
   ============================================= */
.p3-map-title-note {
    display: inline;
    font-weight: 600;
    font-size: 0.85em;
    color: #5d4037;
    margin-left: 8px;
}
.p3-param-btns {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
@media (max-width: 800px) {
    .p3-param-btns {
        grid-template-columns: repeat(2, 1fr);
    }
}
.p3-param-cell {
    background: #fff;
    border: 2px solid #cfd8dc;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}
.p3-param-cell.active {
    border-color: #5d4037;
    box-shadow: 0 2px 10px rgba(93, 64, 55, 0.2);
    background: #efebe9;
}
.p3-param-btn {
    border: none;
    background: transparent;
    width: 100%;
    padding: 14px 10px 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    color: #37474f;
    text-align: center;
}
.p3-param-cell.active .p3-param-btn {
    color: #3e2723;
}
.p3-param-unit {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #78909c;
    margin-top: 4px;
}
.p3-param-opacity {
    padding: 0 10px 10px;
}
.p3-param-opacity label {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: #78909c;
    font-weight: 600;
    margin-bottom: 2px;
}
.p3-param-opacity input[type="range"] {
    width: 100%;
    margin: 0;
    accent-color: #5d4037;
    cursor: pointer;
}
.p3-map-wrap {
    position: relative;
}
.p3-map-legend {
    position: absolute;
    bottom: 32px;
    left: 12px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    font-size: 12px;
    color: #333;
    min-width: 150px;
    pointer-events: none;
}
.p3-map-status {
    font-size: 0.82rem;
    color: #666;
    padding: 8px 4px 0;
    margin: 0 0 8px;
}
.p3-analiza-hero {
    background: linear-gradient(135deg, #5d4037 0%, #8d6e63 45%, #2e7d32 100%);
    color: #fff;
    border-radius: 16px;
    padding: 22px 26px;
    margin: 8px 0 14px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: start;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}
.p3-analiza-hero h3 {
    color: #fff;
    font-size: 1.45rem;
    margin: 0 0 8px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}
.p3-analiza-lead {
    opacity: 0.92;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 44rem;
    margin: 0;
    color: #fff;
}
.p3-analiza-date {
    text-align: right;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 12px;
    padding: 14px 18px;
    min-width: 160px;
    color: #fff;
}
.p3-analiza-date-lbl {
    font-size: 0.72rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.p3-analiza-date-val {
    font-size: 1.45rem;
    font-weight: 800;
    margin-top: 4px;
}
.p3-analiza-date-sub {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 4px;
}
@media (max-width: 720px) {
    .p3-analiza-hero {
        grid-template-columns: 1fr;
    }
    .p3-analiza-date {
        text-align: left;
    }
}
.p3-section-divider {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
    margin: 8px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}
.p3-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
@media (max-width: 900px) {
    .p3-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.p3-stat-card {
    background: #f7f9fb;
    border: 1px solid #e0e6ec;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}
.p3-stat-name {
    font-size: 0.78rem;
    color: #607d8b;
    font-weight: 700;
}
.p3-stat-avg {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1a3a5c;
    margin: 4px 0;
}
.p3-stat-rng {
    font-size: 0.75rem;
    color: #78909c;
}
.p3-insight {
    padding: 14px 18px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 0.92rem;
    line-height: 1.55;
}
.p3-insight.success {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
}
.p3-insight.warning {
    background: #fff8e1;
    border-left: 4px solid #f9a825;
}
.p3-insight.info {
    background: #e3f2fd;
    border-left: 4px solid #1565c0;
}
.p3-samples-table-wrap {
    margin-top: 8px;
}
.p3-samples-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.p3-samples-table th,
.p3-samples-table td {
    border: 1px solid #dde4ec;
    padding: 7px 8px;
    text-align: center;
}
.p3-samples-table th {
    background: #efebe9;
    color: #3e2723;
}
.p3-samples-table td:first-child,
.p3-samples-table th:first-child {
    text-align: left;
}
.p3-advice-note {
    font-size: 0.82rem;
    color: #777;
    margin-top: 12px;
}

/* =============================================
   POLJE 3 — Meteo (Pančevo OP + Open-Meteo)
   ============================================= */
.p3-meteo-station {
    margin-top: 14px;
}
.p3-meteo-station-err {
    font-size: 0.82rem;
    color: #888;
    margin: 8px 0 0;
}
.p3-meteo-station-compact {
    padding: 12px;
}
.p3-meteo-station-compact .parcel-meteo-station-name {
    font-size: 1.05rem;
}
.current-stats-panel .parcel-meteo-station-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.current-stats-panel .parcel-meteo-station-metrics div {
    padding: 6px;
}
.parcel-meteo-meta {
    font-size: 0.78rem;
    color: #888;
    margin: 0 0 12px;
}
.parcel-meteo-forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}
.p3-forecast-row {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
@media (max-width: 900px) {
    .p3-forecast-row {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}
.parcel-meteo-day {
    background: #f0f7ff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
    font-size: 0.78rem;
}
.parcel-meteo-wd-date { color: #666; margin-bottom: 4px; font-weight: 600; }
.parcel-meteo-wd-desc { color: #333; margin-bottom: 4px; min-height: 2.2em; }
.parcel-meteo-wd-temp { font-weight: 800; color: #1a3a5c; font-size: 0.9rem; }
.parcel-meteo-wd-rain { color: #1565c0; margin-top: 4px; }
.parcel-meteo-wd-wind { color: #666; margin-top: 2px; font-size: 0.72rem; }
.parcel-meteo-wd-alert { color: #c62828; font-size: 0.68rem; margin-top: 4px; line-height: 1.3; }
.parcel-meteo-nearest {
    background: #f8faf8;
    border: 1px solid #c8e6c9;
    border-radius: 12px;
    padding: 16px;
}
.parcel-meteo-station-role {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #2e7d32;
    margin-bottom: 4px;
}
.parcel-meteo-station-name { font-size: 1.15rem; font-weight: 800; color: #1a3a5c; }
.parcel-meteo-station-id { font-size: 0.78rem; color: #888; margin-bottom: 4px; }
.parcel-meteo-station-read {
    font-size: 0.8rem;
    color: #1565c0;
    margin-bottom: 8px;
}
.parcel-meteo-station-read strong { font-weight: 700; color: #0d47a1; }
.parcel-meteo-station-read--na { color: #999; }
.parcel-meteo-station-dist { font-size: 0.82rem; color: #555; margin-bottom: 10px; }
.parcel-meteo-station-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}
.parcel-meteo-station-metrics div {
    background: #fff;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    border: 1px solid #e8e8e8;
}
.parcel-meteo-station-metrics span { display: block; font-size: 0.72rem; color: #888; }
.parcel-meteo-station-metrics strong { font-size: 0.95rem; color: #2e7d32; }
.parcel-meteo-station-note { font-size: 0.82rem; color: #666; }
.p3-forecast-card {
    width: 100%;
    margin-bottom: 25px;
}
.p2-dron-sensors-block {
    margin-bottom: 28px;
}
.p2-dron-sensors-block:last-child {
    margin-bottom: 0;
}
.p2-dron-sensors-block-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: var(--primary-color, #2c5282);
}
.p2-dron-sensors-block-meta {
    margin: 0 0 12px;
}

.p3-dron-sensors-card {
    width: 100%;
    margin-bottom: 25px;
}
.p3-dron-sensors-table-wrap {
    margin-top: 10px;
}
.p3-dron-sensors-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.p3-dron-sensors-table th,
.p3-dron-sensors-table td {
    border: 1px solid #e5e7eb;
    padding: 10px 8px;
    vertical-align: top;
    text-align: left;
}
.p3-dron-sensors-table th {
    background: #f0f4f8;
    font-weight: 600;
    color: #1a3a5c;
}
.p3-dron-sensors-table tbody tr.p3-dron-sensors-data:nth-child(4n + 1) {
    background: #fff;
}
.p3-dron-sensors-table tbody tr.p3-dron-sensors-data:nth-child(4n + 3) {
    background: #fafbfc;
}
.p3-dron-sensors-explain-row td {
    background: #f8fafc;
    border-top: none;
    padding: 6px 10px 12px;
}
.p3-dron-sensors-explain {
    font-size: inherit;
    line-height: 1.45;
    color: #4b5563;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
.p3-dron-sensors-explain strong {
    color: #374151;
    font-weight: 600;
    font-size: inherit;
}
.p3-dron-sensors-metrics {
    line-height: 1.55;
}
.p3-dron-metric-pill {
    display: inline-block;
    margin: 0 10px 6px 0;
    white-space: nowrap;
}
.p3-dron-sensors-note {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #b45309;
    line-height: 1.4;
}
.p3-dron-sensors-lab-meta {
    margin: 14px 0 6px;
    font-size: 0.85rem;
    color: #4b5563;
}
.p3-dron-sensors-comment {
    margin: 0 0 4px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #374151;
}
.p3-dron-sensors-summary {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #c7d2e0;
    border-radius: 8px;
    background: #f0f6fb;
}
.p3-dron-sensors-summary-title {
    margin: 0 0 10px;
    font-size: 1rem;
    color: #1a3a5c;
    font-weight: 600;
}
.p3-dron-sensors-summary-intro {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #374151;
}
.p3-dron-sensors-summary-heading {
    margin: 10px 0 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a3a5c;
}
.p3-dron-sensors-summary-list {
    margin: 0 0 8px;
    padding-left: 1.25rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #374151;
}
.p3-dron-sensors-summary-rec {
    margin-bottom: 0;
}
.p3-dron-sensors-muted {
    color: #888;
    font-size: 0.9rem;
}
.p3-dron-sensors-err {
    color: #c0392b;
    font-size: 0.9rem;
}
@media (max-width: 900px) {
    .p3-dron-sensors-table { font-size: 0.8rem; min-width: 580px; }
    .p3-dron-sensors-table th,
    .p3-dron-sensors-table td {
        padding: 8px 6px;
    }
    .p3-dron-sensors-explain-row td {
        font-size: 0.8rem;
    }
    .p3-dron-metric-pill { display: block; margin-right: 0; white-space: normal; }
}

/* parcela.html — mobil: bez horizontalnog scroll-a cele stranice */
@media (max-width: 768px) {
    .page-parcela {
        overflow-x: hidden;
    }
    .page-parcela .container,
    .page-parcela .container--wide {
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }
    .page-parcela .header {
        padding: 20px 0;
        margin-bottom: 16px;
    }
    .page-parcela .header h1 {
        font-size: 1.45rem;
        line-height: 1.25;
    }
    .page-parcela .header .subtitle {
        font-size: 0.95rem;
    }
    .page-parcela .card {
        padding: 16px;
        margin-bottom: 16px;
    }
    .page-parcela .card:hover {
        transform: none;
    }
    .page-parcela .p3-dron-sensors-card,
    .page-parcela .p3-dron-sensors-table-wrap,
    .page-parcela .p3-samples-table-wrap,
    .page-parcela .table-responsive {
        max-width: 100%;
    }
    .page-parcela .p3-dron-sensors-summary,
    .page-parcela .p3-dron-sensors-explain {
        word-break: break-word;
    }
    .page-parcela .p3-dron-sensors-table {
        font-size: 0.75rem;
    }
    .page-parcela .p3-dron-sensors-explain-row td {
        font-size: 0.7rem;
        line-height: 1.4;
    }
    .page-parcela .p3-samples-table {
        font-size: 0.75rem;
    }
    .page-parcela .zone-explanation {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    .page-parcela .p3-dron-sensors-summary-intro,
    .page-parcela .p3-dron-sensors-summary-list,
    .page-parcela .p3-dron-sensors-comment {
        font-size: 0.75rem;
    }
    .page-parcela .index-date-row .raw-cal {
        max-width: 100%;
        width: 100%;
    }
    .page-parcela .grid-2col--map-wide #map {
        height: min(55vh, 420px);
    }
}

.tamis-portal-nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.65rem 1.25rem 0;
}

.tamis-portal-nav a {
    font-size: 0.88rem;
    font-weight: 600;
    color: #2d6a4f;
    text-decoration: none;
}

.tamis-portal-nav a:hover {
    text-decoration: underline;
}
