/* ============================================================
   FARMHUB — MASTER DESIGN SYSTEM (CSS3)
   Premium Modern Agritech Theme (Light & Dark)
   Strictly Vanilla CSS3 — No Tailwind, No Bootstrap
   ============================================================ */

/* CSS Variable Definitions */
:root {
  /* Common Brand Tokens */
  --farm-font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --farm-amber: #D97706;
  --farm-warning: #F59E0B;
  --farm-danger: #E11D48;
  --farm-info: #2563EB;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(18, 61, 40, 0.06);
  --shadow-lg: 0 10px 28px rgba(18, 61, 40, 0.10);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

/* Light Theme (Default: Warm Cream & Deep Forest) */
:root, [data-theme="light"] {
  --bg: #F7F5EF;
  --surface: #FFFFFF;
  --surface-alt: #F1EFE6;
  --forest: #123D28;
  --forest-deep: #0B291A;
  --green: #2F7D4A;
  --green-light: #EBF5EF;
  --green-hover: #26693E;
  --accent: #55D68A;
  --text: #18231D;
  --text-secondary: #3D4F44;
  --muted: #68736B;
  --border: #E0DDD3;
  --border-focus: #2F7D4A;
  --card-bg: #FFFFFF;
  --sidebar-bg: #123D28;
  --sidebar-text: #D6E5DC;
  --sidebar-active: #2F7D4A;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --topbar-bg: #FFFFFF;
  --input-bg: #FFFFFF;
  --hero-gradient: linear-gradient(135deg, #123D28 0%, #1A4D34 100%);
  --hero-text: #FFFFFF;
}

/* Dark Theme (Rich Dark Forest & Glowing Accents) */
[data-theme="dark"] {
  --bg: #0E1712;
  --surface: #15231B;
  --surface-alt: #1B2C22;
  --forest: #1B2C22;
  --forest-deep: #09120D;
  --green: #63B77A;
  --green-light: #1A3324;
  --green-hover: #75C68B;
  --accent: #63B77A;
  --text: #F1F5F2;
  --text-secondary: #C8D8CE;
  --muted: #AAB8AF;
  --border: #304138;
  --border-focus: #63B77A;
  --card-bg: #15231B;
  --sidebar-bg: #0B1610;
  --sidebar-text: #AAB8AF;
  --sidebar-active: #1F382A;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --topbar-bg: #15231B;
  --input-bg: #1B2C22;
  --hero-gradient: linear-gradient(135deg, #182B21 0%, #223D2F 100%);
  --hero-text: #F1F5F2;
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.45);
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--farm-font);
  font-size: 15px;
  line-height: 1.55;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Accessibility Focus Ring */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--farm-amber);
  outline-offset: 2px;
}

/* Headings & Text */
h1, h2, h3, h4 {
  color: var(--text);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

p {
  margin: 0 0 10px;
}

.mu {
  color: var(--muted);
  font-size: 13.5px;
}

/* ============================================================
   APPLICATION LAYOUT (Sidebar + Topbar + Workspace)
   ============================================================ */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Left Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #55D68A, #2F7D4A);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-title {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: #FFFFFF;
  line-height: 1.1;
}

.sidebar-title small {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
}

/* Farm Selector Pill in Sidebar */
.sidebar-farm-badge {
  margin: 14px 16px 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-farm-badge:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-farm-name {
  font-weight: 700;
  color: #FFFFFF;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-farm-crop {
  font-size: 11.5px;
  color: var(--accent);
}

/* Sidebar Navigation Groups */
.sidebar-nav {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 10px 8px;
}

.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: 0;
  width: 100%;
  cursor: pointer;
  transition: var(--transition);
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: #FFFFFF;
}

.nav-link.active {
  background: var(--sidebar-active);
  color: #FFFFFF;
  font-weight: 600;
}

.nav-link-icon {
  font-size: 17px;
  width: 22px;
  text-align: center;
}

/* Sidebar Footer Profile Area */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2F7D4A;
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.user-info {
  line-height: 1.2;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  color: #FFF;
}

.user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

/* Top Utility Bar */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 90;
  box-shadow: var(--shadow-sm);
  transition: left 0.25s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hamburger-btn {
  display: none;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

.field-status-pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(47, 125, 74, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.field-status-pill.offline {
  background: rgba(225, 29, 72, 0.1);
  color: var(--farm-danger);
  border-color: rgba(225, 29, 72, 0.2);
}

.field-status-pill.demo {
  background: rgba(245, 158, 11, 0.12);
  color: #B45309;
  border-color: rgba(245, 158, 11, 0.3);
}

/* Topbar Right Utility Controls */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.util-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.util-btn:hover {
  background: var(--surface-alt);
  border-color: var(--muted);
}

.theme-toggle-btn {
  font-size: 16px;
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Main Content Workspace */
.main-workspace {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 28px 24px 60px;
  flex: 1;
  max-width: 1240px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: margin-left 0.25s ease;
}

.entry-workspace {
  width: min(100%, 1080px);
  margin-left: auto !important;
  margin-right: auto;
}

/* ============================================================
   CARDS, GRIDS & SURFACES
   ============================================================ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(47, 125, 74, 0.3);
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.grid2 {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid3 {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ============================================================
   HERO DECISION CARD ("WHAT SHOULD I DO NOW?")
   ============================================================ */
.hero {
  background: var(--hero-gradient);
  color: var(--hero-text);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  border-left: 10px solid var(--green);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero.LOW { border-left-color: var(--accent); }
.hero.MODERATE { border-left-color: var(--farm-warning); }
.hero.HIGH, .hero.CRITICAL { border-left-color: var(--farm-danger); }

.hero-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-big {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  margin: 10px 0 12px;
  letter-spacing: -0.02em;
}

.hero-window {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 8px;
}

.hero-desc {
  font-size: 14.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 14px;
}

.hero-right-box {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.hero-metric-row b {
  font-size: 22px;
}

/* Progress bar inside hero */
.bar {
  height: 9px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

/* ============================================================
   FARMER-FIRST CORE SECTIONS
   ============================================================ */
.ff-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.ff-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ff-why-list {
  margin: 0;
  padding-left: 20px;
}

.ff-why-list li {
  margin-bottom: 8px;
  font-size: 14.5px;
  color: var(--text);
}

/* Data Used Matrix */
.data-used-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.data-used-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.data-used-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.data-used-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin: 4px 0 2px;
}

.data-used-sub {
  font-size: 12px;
  color: var(--muted);
}

/* Stat & Signal Cards */
.sig-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.sig-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sig-card b {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin: 4px 0 2px;
}

.sig-card span {
  font-size: 12px;
  color: var(--muted);
}

/* Complete Profile Notice Card */
.complete-notice-card {
  background: linear-gradient(135deg, rgba(47, 125, 74, 0.12), rgba(85, 214, 138, 0.08));
  border: 1.5px solid var(--green);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS & CONTROLS
   ============================================================ */
.btn {
  background: var(--green);
  color: #FFFFFF;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn:hover {
  background: var(--green-hover);
  transform: translateY(-1px);
}

.btn.primary-cta {
  background: var(--forest);
  color: #FFFFFF;
  font-size: 16px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.btn.primary-cta:hover {
  background: #1C5438;
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.secondary:hover {
  background: var(--surface-alt);
  border-color: var(--muted);
}

.btn.sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

/* ============================================================
   FORMS & INPUTS
   ============================================================ */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  background-color: var(--input-bg);
  color: var(--text);
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(47, 125, 74, 0.18);
  outline: none;
}

/* ============================================================
   ONBOARDING & CROP SELECTION
   ============================================================ */
.onboarding-screen {
  max-width: 680px;
  margin: 40px auto;
  padding: 32px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.step-indicator {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.step-dot {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
}

.step-dot.active {
  background: var(--green);
}

/* Category Cards Grid */
.category-cards-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin: 16px 0 24px;
}

.cat-card {
  background: var(--surface-alt);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cat-card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}

.cat-card.selected {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--forest);
  box-shadow: 0 4px 12px rgba(47, 125, 74, 0.15);
}

.cat-icon {
  font-size: 32px;
}

.cat-title {
  font-weight: 700;
  font-size: 14px;
}

/* Crop Option Chips Grid */
.crops-chips-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin: 14px 0 20px;
}

.crop-chip {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}

.crop-chip:hover {
  border-color: var(--green);
  background: var(--surface-alt);
}

.crop-chip.selected {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--forest);
  font-weight: 700;
}

.crop-chip small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ============================================================
   MAP CONTAINER & ERROR STATE
   ============================================================ */
#fieldMap {
  height: 320px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.map-error-banner {
  background: var(--surface-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  margin: 10px 0;
}

/* ============================================================
   TABLES & CHARTS
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

td, th {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-alt);
}

tr.now {
  background: var(--green-light);
  font-weight: 600;
}

.chart-canvas-wrap {
  height: 240px;
  position: relative;
  width: 100%;
}

.chart-canvas-tall {
  height: 300px;
  position: relative;
  width: 100%;
}

/* ============================================================
   LANDING PAGE STYLES
   ============================================================ */
.landing-hero {
  text-align: center;
  padding: 60px 20px 40px;
  max-width: 820px;
  margin: 0 auto;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--green-light);
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 18px;
}

.landing-title {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 16px;
}

.landing-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 640px;
  margin: 0 auto 32px;
}

.landing-features-grid {
  display: grid;
  width: 100%;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 960px;
  margin: 50px auto 0;
  text-align: left;
}

.landing-feat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.landing-feat-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

/* ============================================================
   RESPONSIVE DESIGN (Desktop, Tablet, Mobile)
   ============================================================ */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 80px;
  }

  .sidebar-header .sidebar-title,
  .sidebar-farm-badge,
  .nav-group-label,
  .nav-link span:not(.nav-link-icon),
  .user-info {
    display: none;
  }

  .nav-link {
    justify-content: center;
    padding: 12px;
  }

  .sidebar-header {
    justify-content: center;
    padding: 16px 0;
  }

  .sidebar-footer {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 270px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-header .sidebar-title,
  .sidebar-farm-badge,
  .nav-group-label,
  .nav-link span:not(.nav-link-icon),
  .user-info {
    display: block;
  }

  .nav-link {
    justify-content: flex-start;
  }

  .topbar {
    left: 0;
    padding: 0 16px;
  }

  .hamburger-btn {
    display: block;
  }

  .main-workspace {
    margin-left: 0;
    padding: 20px 14px 40px;
  }

  .entry-workspace {
    width: 100%;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .onboarding-screen {
    margin: 16px;
    padding: 20px;
  }
}

/* ============================================================
   FARMHUB — ADVANCED FEATURES & PROFESSIONAL UI ENHANCEMENTS
   ============================================================ */

/* Online / Offline status badge */
.network-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: rgba(85, 214, 138, 0.12);
  color: var(--green);
  border: 1px solid rgba(85, 214, 138, 0.25);
}
.network-status-pill.offline {
  background: rgba(245, 158, 11, 0.12);
  color: var(--farm-warning);
  border-color: rgba(245, 158, 11, 0.25);
}
.network-status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

/* Landing Page Extended Elements */
.landing-trust-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 32px 0 40px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 600;
}
.trust-item span.icon {
  font-size: 18px;
}
.landing-demo-btn {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: var(--transition);
}
.landing-demo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}
.landing-section-title {
  text-align: center;
  margin: 50px 0 16px;
  font-size: 24px;
}
.landing-section-sub {
  text-align: center;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 32px;
  font-size: 14.5px;
}
.vignettes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.vignette-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}
.vignette-card:hover {
  border-color: var(--green);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.faq-accordion {
  max-width: 800px;
  margin: 0 auto 50px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  cursor: pointer;
  transition: var(--transition);
}
.faq-item summary {
  font-weight: 700;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: '+';
  font-size: 18px;
  color: var(--green);
  font-weight: 800;
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  content: '−';
}
.faq-item p {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.6;
}
.landing-footer {
  border-top: 1px solid var(--border);
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 50px;
}

/* Kisaan AI Copilot Floating Drawer & Chat */
.copilot-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #123D28, #2F7D4A);
  color: #FFFFFF;
  border: 2px solid var(--accent);
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(18, 61, 40, 0.35);
  z-index: 1000;
  transition: var(--transition);
}
[data-theme="dark"] .copilot-floating-btn {
  background: linear-gradient(135deg, #1A3324, #2F7D4A);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.copilot-floating-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(18, 61, 40, 0.45);
}
.copilot-floating-btn .copilot-badge {
  background: var(--accent);
  color: #0B291A;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  text-transform: uppercase;
}
.copilot-drawer {
  position: fixed;
  bottom: 86px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  animation: copilotSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes copilotSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.copilot-header {
  padding: 14px 18px;
  background: var(--hero-gradient);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.copilot-header-info b {
  font-size: 15px;
  display: block;
}
.copilot-header-info small {
  font-size: 11.5px;
  color: var(--accent);
}
.copilot-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #FFF;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.copilot-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}
.copilot-msg {
  max-width: 86%;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}
.copilot-msg.bot {
  align-self: flex-start;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
  box-shadow: var(--shadow-sm);
}
.copilot-msg.user {
  align-self: flex-end;
  background: var(--green);
  color: #FFFFFF;
  border-bottom-right-radius: 3px;
}
.copilot-chips {
  padding: 8px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
}
.copilot-chip {
  padding: 5px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.copilot-chip:hover {
  background: var(--green);
  color: #FFFFFF;
  border-color: var(--green);
}
.copilot-input-area {
  padding: 10px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.copilot-input-area input {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
}
.copilot-input-area button {
  padding: 9px 16px;
  border-radius: var(--radius-md);
  background: var(--green);
  color: #FFF;
  border: none;
  font-weight: 700;
  cursor: pointer;
}

/* Command Palette (Ctrl+K) */
.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.cmd-palette-modal {
  width: 580px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: cmdScale 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cmdScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.cmd-input-wrap {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.cmd-input-wrap span.icon {
  font-size: 18px;
  color: var(--muted);
}
.cmd-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--text);
  outline: none !important;
}
.cmd-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}
.cmd-group-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 8px 10px 4px;
}
.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.cmd-item:hover, .cmd-item.active {
  background: var(--surface-alt);
  color: var(--green);
}
.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cmd-item-left span.icon {
  font-size: 18px;
}
.cmd-item-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.cmd-item-desc {
  font-size: 12px;
  color: var(--muted);
}
.cmd-footer {
  padding: 8px 18px;
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

/* 24-Hour Spray Window Radar */
.spray-radar-wrapper {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}
.spray-radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.spray-hour-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  font-size: 12px;
  transition: var(--transition);
}
.spray-hour-box:hover {
  transform: translateY(-2px);
  border-color: var(--green);
}
.spray-hour-time {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.spray-badge {
  display: inline-block;
  padding: 3px 6px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 6px;
}
.spray-badge.optimal {
  background: rgba(85, 214, 138, 0.2);
  color: #166534;
  border: 1px solid rgba(85, 214, 138, 0.4);
}
[data-theme="dark"] .spray-badge.optimal {
  background: rgba(99, 183, 122, 0.2);
  color: #86EFAC;
  border-color: rgba(99, 183, 122, 0.4);
}
.spray-badge.caution {
  background: rgba(245, 158, 11, 0.18);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
[data-theme="dark"] .spray-badge.caution {
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
}
.spray-badge.unsafe {
  background: rgba(225, 29, 72, 0.15);
  color: #BE123C;
  border: 1px solid rgba(225, 29, 72, 0.3);
}
[data-theme="dark"] .spray-badge.unsafe {
  background: rgba(225, 29, 72, 0.25);
  color: #FDA4AF;
}

/* Crop Health Sample Gallery & Visual Scanner */
.sample-leaves-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0 20px;
}
.sample-leaf-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}
.sample-leaf-card:hover {
  border-color: var(--green);
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.sample-leaf-icon {
  font-size: 28px;
  margin-bottom: 6px;
}
.sample-leaf-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.sample-leaf-tag {
  font-size: 11px;
  color: var(--farm-amber);
  margin-top: 2px;
}
.leaf-scanner-container {
  position: relative;
  background: #0D1612;
  border: 2px solid var(--green);
  border-radius: var(--radius-md);
  padding: 24px;
  overflow: hidden;
  text-align: center;
  margin: 16px 0;
}
.leaf-scanner-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #55D68A, transparent);
  box-shadow: 0 0 12px #55D68A;
  animation: scanLine 2s infinite ease-in-out;
}
@keyframes scanLine {
  0% { top: 0%; opacity: 0.3; }
  50% { top: 96%; opacity: 1; }
  100% { top: 0%; opacity: 0.3; }
}

/* Yield & Revenue Predictor */
.yield-calc-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-top: 20px;
}
.yield-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.yield-metric-tile {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.yield-metric-tile small {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  display: block;
}
.yield-metric-tile b {
  font-size: 20px;
  color: var(--green);
  display: block;
  margin: 4px 0 2px;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
}
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 900;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  }
  .mob-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 10px;
    gap: 2px;
    cursor: pointer;
  }
  .mob-nav-btn.active {
    color: var(--green);
    font-weight: 700;
  }
  .mob-nav-btn span.icon {
    font-size: 18px;
  }
  .copilot-floating-btn {
    bottom: 74px;
    right: 16px;
    padding: 10px 14px;
    font-size: 12px;
  }
  .copilot-drawer {
    bottom: 130px;
    right: 12px;
    left: 12px;
    width: auto;
    height: calc(100vh - 190px);
  }
  .main-workspace {
    padding-bottom: 80px !important;
  }
}

/* Toast Notifications */
.farm-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #123D28;
  color: #FFFFFF;
  border: 1px solid var(--accent);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.farm-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
/* ============================================================
   2D & 3D INTERACTIVE VISUALIZATIONS & SATELLITE RADAR
   ============================================================ */

.anim-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.anim-card:hover {
  box-shadow: var(--shadow-md);
}

.canvas-interactive-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0B140F;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
  touch-action: none;
}
.canvas-interactive-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

.sim-controls-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.radar-toggle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.radar-toggle-badge.active {
  background: rgba(37, 99, 235, 0.15);
  color: #2563EB;
  border-color: #2563EB;
}
[data-theme="dark"] .radar-toggle-badge.active {
  background: rgba(96, 165, 250, 0.2);
  color: #93C5FD;
  border-color: #60A5FA;
}

/* Atmospheric Weather Sky Canvas */
.weather-sky-banner {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.weather-sky-banner canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.weather-sky-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 100%);
  color: #FFFFFF;
  pointer-events: none;
}

/* Print Styles */
@media print {
  .sidebar, .topbar, .btn, .util-btn, .copilot-floating-btn, .copilot-drawer, .mobile-bottom-nav {
    display: none !important;
  }
  .main-workspace {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  body {
    background: #FFF !important;
    color: #000 !important;
  }
  .card, .ff-card, .hero {
    box-shadow: none !important;
    border: 1px solid #CCC !important;
    break-inside: avoid;
  }
}
