/* ===== GEOFARM STYLES ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0f0a;
  --bg2: #111811;
  --bg3: #161e16;
  --card: #131a13;
  --border: #1e2e1e;
  --green: #4ade80;
  --green2: #22c55e;
  --green3: #16a34a;
  --yellow: #facc15;
  --red: #f87171;
  --blue: #60a5fa;
  --text: #e8f5e8;
  --text2: #9ab89a;
  --accent: #4ade80;
  --font-head: 'Syne', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-head);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(74,222,128,0.07) 0%, transparent 60%);
}

/* NAVBAR */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.9rem 2rem;
  background: rgba(10,15,10,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-brand { display: flex; align-items: center; gap: 0.5rem; }
.nav-icon { font-size: 1.4rem; }
.nav-title { font-size: 1.2rem; font-weight: 800; color: var(--green); letter-spacing: 0.05em; }
.nav-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text2); margin-left: auto; }
.health-badge {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.3rem 0.8rem;
}
.hb-label { font-size: 0.6rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.1em; }
.hb-value { font-family: var(--font-mono); font-size: 1rem; color: var(--green); font-weight: 700; }

/* HERO */
.hero {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 2rem;
}
.hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; line-height: 1.1; }
.hero h1 .accent { color: var(--green); }
.hero-sub { color: var(--text2); font-family: var(--font-mono); font-size: 0.8rem; margin-top: 0.8rem; }
.hero-stats { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat-pill {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.8rem 1.4rem; min-width: 90px;
  transition: border-color 0.3s;
}
.stat-pill:hover { border-color: var(--green3); }
.sp-val { font-family: var(--font-mono); font-size: 1rem; color: var(--green); font-weight: 700; }
.sp-label { font-size: 0.65rem; color: var(--text2); text-transform: uppercase; margin-top: 0.2rem; }

/* DASHBOARD GRID */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* CARD */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.2s;
}
.card:hover { border-color: var(--green3); transform: translateY(-2px); }
.card--wide { grid-column: span 2; }
@media (max-width: 700px) { .card--wide { grid-column: span 1; } }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.card-header h2 { font-size: 1rem; font-weight: 600; color: var(--text); }
.card-tag {
  font-family: var(--font-mono); font-size: 0.6rem;
  background: rgba(74,222,128,0.1); color: var(--green);
  border: 1px solid rgba(74,222,128,0.2);
  padding: 0.2rem 0.6rem; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* NDVI GRID */
.ndvi-wrap { display: flex; flex-direction: column; gap: 0.8rem; }
.ndvi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.ndvi-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.65rem;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ndvi-cell:hover { transform: scale(1.15); box-shadow: 0 4px 16px rgba(0,0,0,0.5); z-index: 2; }
.ndvi-legend { display: flex; align-items: center; gap: 0.5rem; font-size: 0.7rem; color: var(--text2); }
.legend-bar {
  flex: 1; height: 8px; border-radius: 4px;
  background: linear-gradient(to right, #7f1d1d, #dc2626, #facc15, #84cc16, #22c55e, #15803d);
}

/* HEALTH RING */
.health-ring-wrap {
  display: flex; align-items: center; justify-content: center;
  position: relative; width: 140px; height: 140px; margin: 0 auto 1rem;
}
.health-ring { width: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg3); stroke-width: 10; }
.ring-fg {
  fill: none; stroke: var(--green); stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1);
}
.ring-label {
  position: absolute; display: flex; flex-direction: column; align-items: center;
}
.ring-label span { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; color: var(--green); }
.ring-label small { font-size: 0.6rem; color: var(--text2); text-transform: uppercase; }
.health-status { text-align: center; font-size: 0.85rem; color: var(--text2); }

/* DISEASE */
.disease-list { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 1rem; }
.disease-item {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.8rem 1rem;
}
.di-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.di-name { font-size: 0.9rem; font-weight: 600; }
.di-zone { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text2); }
.di-bar-wrap { background: var(--bg); border-radius: 4px; height: 6px; overflow: hidden; }
.di-bar { height: 100%; border-radius: 4px; transition: width 1s ease; }
.di-conf { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text2); text-align: right; margin-top: 0.2rem; }
.sev-none .di-bar { background: var(--green2); }
.sev-low .di-bar { background: var(--yellow); }
.sev-medium .di-bar { background: #f97316; }
.sev-high .di-bar { background: var(--red); }

.btn-scan {
  width: 100%; padding: 0.6rem;
  background: transparent; border: 1px solid var(--green3);
  color: var(--green); border-radius: 8px;
  cursor: pointer; font-family: var(--font-head); font-size: 0.85rem;
  transition: background 0.2s;
}
.btn-scan:hover { background: rgba(74,222,128,0.1); }

/* SOIL */
.soil-bars { display: flex; flex-direction: column; gap: 0.9rem; }
.soil-item label { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text2); margin-bottom: 0.3rem; }
.soil-item label span { font-family: var(--font-mono); color: var(--green); }
.soil-track { background: var(--bg); border-radius: 4px; height: 8px; overflow: hidden; }
.soil-fill { height: 100%; border-radius: 4px; transition: width 1.2s ease; }

/* CROP */
.crop-list { display: flex; flex-direction: column; gap: 0.8rem; }
.crop-item {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.8rem;
}
.crop-rank { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text2); min-width: 20px; }
.crop-info { flex: 1; }
.crop-name { font-size: 0.9rem; font-weight: 600; }
.crop-reason { font-size: 0.7rem; color: var(--text2); margin-top: 0.15rem; }
.crop-score { font-family: var(--font-mono); font-size: 1rem; color: var(--green); font-weight: 700; }

/* YIELD */
.yield-display { display: flex; flex-direction: column; gap: 1.2rem; }
.yield-row { display: flex; justify-content: space-between; align-items: flex-end; }
.yield-val { font-family: var(--font-mono); font-size: 2rem; color: var(--green); }
.yield-label { font-size: 0.75rem; color: var(--text2); }
.yield-vs { font-size: 0.7rem; color: var(--text2); font-family: var(--font-mono); }
.yield-progress { background: var(--bg); border-radius: 6px; height: 12px; overflow: hidden; }
.yield-bar { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--green3), var(--green)); transition: width 1.5s ease; }
.yield-eff { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text2); text-align: right; }

/* STRATEGY */
.strategy-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 600px) { .strategy-wrap { grid-template-columns: 1fr; } }
.strategy-inputs { display: flex; flex-direction: column; gap: 1.2rem; }
.strategy-inputs label { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.82rem; color: var(--text2); }
.strategy-inputs input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 3px; background: var(--bg);
  outline: none; cursor: pointer;
}
.strategy-inputs input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--green); cursor: pointer;
}
.strategy-inputs span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--green); }
.strategy-result { display: flex; flex-direction: column; gap: 1.2rem; justify-content: center; }
.sr-metric { background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.5rem; }
.sr-val { display: block; font-family: var(--font-mono); font-size: 1.5rem; color: var(--green); }
.sr-label { font-size: 0.7rem; color: var(--text2); text-transform: uppercase; }

/* AI ASSISTANT */
.ai-wrap { display: flex; flex-direction: column; gap: 1rem; }
.ai-chat {
  height: 220px; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.7rem;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.ai-msg { max-width: 80%; padding: 0.6rem 1rem; border-radius: 12px; font-size: 0.85rem; line-height: 1.5; }
.ai-msg--bot { background: var(--bg3); border: 1px solid var(--border); align-self: flex-start; }
.ai-msg-