:root {
  /* Color Palette - Earthy & Trustworthy */
  --primary: #2d6a4f;
  --primary-light: #40916c;
  --primary-dark: #1b4332;
  --secondary: #ff9f1c;
  --accent: #74c69d;
  --bg-main: #f8f9fa;
  --bg-card: #ffffff;
  --text-main: #1b4332;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --status-pending: #ffc107;
  --status-approved: #28a745;
  --status-sold: #6c757d;
  --status-paid: #007bff;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 48px;
  --space-2xl: 64px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
}

/* Layout Containers */
.app-container {
  width: 100%;
  max-width: 480px; /* Mobile focused for Farmer/Buyer apps */
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-main);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,0.1);
  overflow-x: hidden;
}

.container {
  padding: var(--space-md);
  width: 100%;
}

/* Header */
.app-header {
  background: var(--primary);
  color: white;
  padding: var(--space-md);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: var(--space-sm) 0 calc(var(--space-sm) + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--border-color);
  z-index: 100;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  gap: 4px;
}

.nav-item.active {
  color: var(--primary);
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.05);
  overflow: hidden;
}

.card-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

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

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

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-fab {
  position: fixed;
  bottom: 80px;
  right: calc(50% - 220px);
  width: 60px;
  height: 60px;
  border-radius: 30px;
  background: var(--secondary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 90;
}

@media (max-width: 480px) {
  .btn-fab {
    right: 20px;
  }
}

/* Status Badges */
.badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.badge-pending { background: #fff3cd; color: #856404; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-sold { background: #e2e3e5; color: #383d41; }
.badge-paid { background: #cfe2ff; color: #084298; }

/* Dashboard Extras */
.welcome-section h1 {
  font-size: 1.5rem;
}

.text-primary {
  color: var(--primary);
}

.text-muted {
  color: var(--text-muted);
}

.market-price-list {
  padding: 0;
  overflow: hidden;
}

.price-item {
  padding: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.price-item:last-child {
  border-bottom: none;
}

.price-label {
  font-weight: 700;
}

.price-sublabel {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.price-value {
  font-weight: 700;
  color: var(--primary);
}

.price-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Form Extras */
.input-with-icon {
  position: relative;
}

.input-icon-left {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
}

.input-with-icon .form-input {
  padding-left: 32px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--primary);
  margin-top: 4px;
  font-weight: 500;
}

.location-box {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  background: #f0fdf4;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Grid for highlights */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-lg);
}

.label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.form-input, .form-select {
  width: 100%;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 1rem;
  background: white;
}

.placeholder-image {
  width: 100%;
  aspect-ratio: 16/9;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  color: var(--text-muted);
  border: 2px dashed var(--border-color);
}

.placeholder-image::after {
  content: attr(data-label);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Product Cards for Listings */
.product-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border-color);
}

.product-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: #eee;
  flex-shrink: 0;
}

.product-info {
  flex-grow: 1;
}

.product-chevron {
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.product-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.product-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.product-price {
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Utilities */
.text-center { text-align: center; }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
