/* FarmHub — Iowa Farmer Platform
   Mobile-first, earthy design, readable at arm's length
   ================================================== */

:root {
  --green:       #1a5632;
  --green-light: #2d7a4a;
  --green-pale:  #e8f5ee;
  --brown:       #8B6914;
  --brown-light: #c49a2b;
  --cream:       #fdf8ef;
  --cream-dark:  #f5edda;
  --text:        #1c1c1c;
  --text-muted:  #555;
  --border:      #d4c9b0;
  --white:       #ffffff;
  --red:         #b91c1c;
  --red-light:   #fef2f2;
  --gold:        #d97706;
  --gold-light:  #fffbeb;
  --blue:        #1e3a8a;
  --blue-light:  #eff6ff;
  --shadow:      0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg:   0 4px 20px rgba(0,0,0,0.15);
  --radius:      8px;
  --radius-lg:   12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--cream);
  color: var(--text);
  font-size: 17px;
  line-height: 1.6;
}

/* ---- Nav ---- */
nav {
  background: var(--green);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 16px;
  min-height: 56px;
  gap: 8px;
}
.nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-brand .icon { font-size: 1.3rem; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-left: auto;
  flex-wrap: nowrap;
}
.nav-links a {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  padding: 6px 7px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,0.18);
  color: var(--white);
}
.nav-links a.btn-nav {
  background: var(--brown);
  color: var(--white);
  padding: 6px 12px;
  border-radius: 6px;
  margin-left: 4px;
}
.nav-links a.btn-nav:hover { background: var(--brown-light); }

.nav-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 8px;
}

/* ---- Flash messages ---- */
.flash-messages { max-width: 1100px; margin: 16px auto 0; padding: 0 16px; }
.flash {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flash.success { background: var(--green-pale); color: var(--green); border: 1px solid #a7d7b8; }
.flash.error   { background: var(--red-light); color: var(--red); border: 1px solid #fca5a5; }
.flash.warning { background: var(--gold-light); color: var(--gold); border: 1px solid #fcd34d; }
.flash.info    { background: var(--blue-light); color: var(--blue); border: 1px solid #93c5fd; }

/* ---- Layout ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.container-narrow { max-width: 740px; margin: 0 auto; padding: 24px 16px; }

.page-header {
  background: var(--green);
  color: white;
  padding: 32px 16px;
}
.page-header-inner { max-width: 1100px; margin: 0 auto; }
.page-header h1 { font-size: 1.9rem; font-weight: 700; margin-bottom: 6px; }
.page-header p { opacity: 0.85; font-size: 1.05rem; }

/* ---- Hero (index) ---- */
.hero {
  background: linear-gradient(135deg, var(--green) 0%, #0f3d22 100%);
  color: white;
  padding: 60px 16px 52px;
  text-align: center;
}
.hero-inner { max-width: 860px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -1px;
}
.hero h1 em { color: var(--brown-light); font-style: normal; }
.hero p { font-size: 1.15rem; opacity: 0.9; max-width: 620px; margin: 0 auto 32px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- Stat bar ---- */
.stat-bar {
  background: #0f3d22;
  border-top: 2px solid rgba(255,255,255,0.1);
}
.stat-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0;
}
.stat-item {
  padding: 20px 16px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.stat-item:last-child { border-right: none; }
.stat-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brown-light);
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 0.78rem; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.5px; }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cream-dark);
}
.card-header h3 { font-size: 1rem; font-weight: 700; color: var(--green); }

/* ---- Grid layouts ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: white; }
.btn-primary:hover { background: var(--green-light); box-shadow: 0 4px 12px rgba(26,86,50,0.3); }
.btn-secondary { background: var(--cream-dark); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-brown { background: var(--brown); color: white; }
.btn-brown:hover { background: var(--brown-light); }
.btn-outline { background: transparent; border: 2px solid var(--green); color: var(--green); }
.btn-outline:hover { background: var(--green); color: white; }
.btn-outline-white { background: transparent; border: 2px solid white; color: white; }
.btn-outline-white:hover { background: rgba(255,255,255,0.2); }
.btn-sm { padding: 8px 16px; font-size: 0.88rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-danger { background: var(--red); color: white; }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; color: var(--text); }
.form-label .required { color: var(--red); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,86,50,0.15);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 20px;
  transition: border-color 0.15s, background 0.15s;
}
.checkbox-label:hover { border-color: var(--green); background: var(--green-pale); }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }

/* ---- Progress bar ---- */
.progress-wrap { background: var(--cream-dark); border-radius: 20px; height: 12px; overflow: hidden; margin: 8px 0; }
.progress-bar { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--green), var(--green-light)); transition: width 0.4s; }
.progress-bar.warning { background: linear-gradient(90deg, var(--gold), var(--brown-light)); }
.progress-bar.urgent { background: linear-gradient(90deg, var(--red), #ef4444); }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-green  { background: var(--green-pale); color: var(--green); }
.badge-gold   { background: var(--gold-light); color: var(--gold); }
.badge-red    { background: var(--red-light); color: var(--red); }
.badge-brown  { background: #fdf1d6; color: var(--brown); }
.badge-blue   { background: var(--blue-light); color: var(--blue); }
.badge-gray   { background: #f3f4f6; color: #374151; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--green);
  color: white;
  padding: 12px 14px;
  text-align: left;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 0.95rem; vertical-align: middle; }
tr:hover td { background: var(--green-pale); }
tr:last-child td { border-bottom: none; }
.price-up { color: #16a34a; font-weight: 700; }
.price-down { color: var(--red); font-weight: 700; }

/* ---- Sections ---- */
section { padding: 48px 16px; }
section.alt { background: var(--cream-dark); }
section.dark { background: var(--green); color: white; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-header { margin-bottom: 28px; }
.section-header h2 { font-size: 1.7rem; font-weight: 800; color: var(--green); margin-bottom: 6px; }
section.dark .section-header h2 { color: white; }
.section-header p { color: var(--text-muted); }
section.dark .section-header p { color: rgba(255,255,255,0.8); }

/* ---- Group Buy cards ---- */
.buy-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.buy-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.buy-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.buy-card-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.buy-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.buy-stat { background: var(--cream-dark); border-radius: 6px; padding: 10px 12px; }
.buy-stat-num { font-size: 1.3rem; font-weight: 800; color: var(--green); display: block; }
.buy-stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.savings-callout {
  background: var(--green-pale);
  border: 1px solid #a7d7b8;
  border-radius: 8px;
  padding: 10px 14px;
  text-align: center;
  font-weight: 700;
  color: var(--green);
}
.savings-callout .big { font-size: 1.5rem; display: block; }

/* ---- Equipment image placeholder ---- */
.eq-image {
  background: var(--cream-dark);
  border-radius: var(--radius);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.eq-image-lg { height: 280px; font-size: 6rem; }

/* ---- Listing cards (equipment, market) ---- */
.listing-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.listing-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.listing-card-img {
  background: var(--cream-dark);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  border-bottom: 1px solid var(--border);
}
.listing-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.listing-title { font-size: 0.97rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.listing-price { font-size: 1.3rem; font-weight: 800; color: var(--green); }
.listing-price.market { color: var(--brown); }
.listing-meta { font-size: 0.82rem; color: var(--text-muted); }
.listing-footer { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--cream); }

/* ---- Alert / warning box ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.alert-warning { background: var(--gold-light); border: 1px solid #fcd34d; color: #92400e; }
.alert-danger  { background: var(--red-light); border: 1px solid #fca5a5; color: var(--red); }
.alert-info    { background: var(--blue-light); border: 1px solid #93c5fd; color: var(--blue); }
.alert-success { background: var(--green-pale); border: 1px solid #a7d7b8; color: var(--green); }
.alert-icon { font-size: 1.3rem; flex-shrink: 0; }

/* ---- Weather cards ---- */
.weather-hero {
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  color: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}
.temp-display { font-size: 4.5rem; font-weight: 800; line-height: 1; }
.weather-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.forecast-day {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  border: 1px solid var(--border);
}
.forecast-icon { font-size: 1.8rem; margin-bottom: 4px; display: block; }
.forecast-day-name { font-size: 0.75rem; text-transform: uppercase; font-weight: 700; color: var(--text-muted); }
.forecast-hi { font-weight: 800; color: var(--text); }
.forecast-lo { color: var(--text-muted); font-size: 0.88rem; }

/* ---- Prices ---- */
.price-hero {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
}
.price-big { font-size: 2.4rem; font-weight: 800; color: var(--green); }
.price-change { font-size: 1rem; font-weight: 700; }

/* ---- Community ---- */
.post-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: box-shadow 0.2s;
}
.post-card:hover { box-shadow: var(--shadow-lg); }
.post-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--green); margin-bottom: 8px; line-height: 1.35; }
.post-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-muted); }

/* ---- Sidebar + main layout ---- */
.sidebar-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.sidebar-layout.left { grid-template-columns: 280px 1fr; }

/* ---- Grant cards ---- */
.grant-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.2s;
}
.grant-card:hover { box-shadow: var(--shadow-lg); }
.grant-amount { font-size: 1.35rem; font-weight: 800; color: var(--green); }
.grant-deadline { font-size: 0.85rem; font-weight: 700; color: var(--red); }
.grant-deadline.far { color: var(--text-muted); }

/* ---- Fair cards ---- */
.fair-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: box-shadow 0.2s;
}
.fair-card:hover { box-shadow: var(--shadow-lg); }
.fair-date-block {
  background: var(--green);
  color: white;
  border-radius: var(--radius);
  padding: 10px 14px;
  text-align: center;
  min-width: 60px;
  flex-shrink: 0;
}
.fair-date-block .month { font-size: 0.7rem; text-transform: uppercase; font-weight: 700; opacity: 0.8; }
.fair-date-block .day { font-size: 1.7rem; font-weight: 800; line-height: 1; }

/* ---- Reply thread ---- */
.reply {
  background: var(--cream-dark);
  border-radius: var(--radius);
  padding: 16px;
  border-left: 4px solid var(--green);
  margin-bottom: 12px;
}
.reply-author { font-weight: 700; font-size: 0.9rem; color: var(--green); }
.reply-date { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Resources ---- */
.resource-category { margin-bottom: 36px; }
.resource-category h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.resource-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: box-shadow 0.15s;
}
.resource-item:hover { box-shadow: var(--shadow); }
.resource-item a { font-weight: 700; color: var(--green); text-decoration: none; font-size: 1rem; }
.resource-item a:hover { text-decoration: underline; }
.resource-item p { font-size: 0.88rem; color: var(--text-muted); margin-top: 3px; }

/* ---- Dashboard ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.dash-stat {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
}
.dash-stat .num { font-size: 2rem; font-weight: 800; color: var(--green); display: block; }
.dash-stat .label { font-size: 0.82rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.dash-quick-links { display: flex; flex-wrap: wrap; gap: 10px; }
.dash-quick-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--cream-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.dash-quick-link:hover { background: var(--green-pale); border-color: var(--green); color: var(--green); }

/* ---- Filter sidebar ---- */
.filter-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  position: sticky;
  top: 80px;
}
.filter-panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; color: var(--green); }
.filter-group { margin-bottom: 18px; }
.filter-group h4 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
.filter-link {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  transition: background 0.12s;
}
.filter-link:hover { background: var(--green-pale); color: var(--green); }
.filter-link.active { background: var(--green); color: white; }

/* ---- Footer ---- */
footer {
  background: #0f3d22;
  color: rgba(255,255,255,0.7);
  padding: 40px 16px 24px;
  margin-top: 60px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-brand { font-size: 1.25rem; font-weight: 800; color: white; margin-bottom: 10px; }
footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
footer a:hover { color: white; }
.footer-col h4 { color: white; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; font-size: 0.88rem; }
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-support a { color: var(--brown-light); }

/* ---- Divider ---- */
.divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ---- Text utilities ---- */
.text-green { color: var(--green); }
.text-brown { color: var(--brown); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.85rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }
.fw-800 { font-weight: 800; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ---- Responsive ---- */

@media (max-width: 1200px) {
  .container { max-width: 960px; }
}

@media (max-width: 1024px) {
  .sidebar-layout { grid-template-columns: 1fr; }
  .sidebar-layout.left { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .container { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .sidebar-layout { grid-template-columns: 1fr; }
  .sidebar-layout.left { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-bottom { justify-content: center; text-align: center; }
  .stat-bar-inner { grid-template-columns: repeat(2, 1fr); }
  .stat-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .weather-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2rem; }
  .weather-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--green); padding: 12px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 16px; }
  .nav-menu-toggle { display: block; }
  .hero { padding: 40px 16px 36px; }
  .stat-bar-inner { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .weather-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .buy-stats { grid-template-columns: 1fr 1fr; }
  .fair-card { flex-direction: column; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 0.9rem; }
  .stat-bar-inner { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .weather-grid { grid-template-columns: repeat(2, 1fr); }
  .btn { width: 100%; text-align: center; }
  .hero-cta { flex-direction: column; }
  .page-header h1 { font-size: 1.5rem; }
}

/* ---- Livestock price trends ---- */
.trend-up { color: #1a5632; font-weight: 600; }
.trend-down { color: #b91c1c; font-weight: 600; }
.trend-steady { color: #8B6914; font-weight: 600; }

/* ---- Stat card for livestock/succession ---- */
.stat-card { text-align: center; padding: 20px; }
.stat-card .stat-label { font-size: 0.82rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.stat-card .stat-big { font-size: 2rem; font-weight: 800; color: var(--green); line-height: 1.1; }
.stat-card .stat-trend { font-size: 0.82rem; margin-top: 4px; }

/* ---- Checklist (succession) ---- */
.checklist { display: flex; flex-direction: column; gap: 16px; }
.checklist-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px; background: var(--cream); border-radius: var(--radius);
}
.checklist-box { flex-shrink: 0; padding-top: 2px; }
.checklist-box input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--green); cursor: pointer;
}
.checklist-box label { display: none; }
.checklist-item p { font-size: 0.9rem; }

/* ---- Details/summary ---- */
details summary {
  font-weight: 600; cursor: pointer; padding: 8px 0;
  color: var(--green); user-select: none;
}
details summary:hover { color: var(--green-light); }

/* ---- Table wrap for mobile ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- Print ---- */
@media print {
  nav, footer, .btn, .filter-panel { display: none; }
  body { background: white; }
}
