@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --green-dark: #1a3a2a;
  --green-mid: #2d5a3f;
  --green-light: #4a8c5e;
  --green-pale: #e8f5e9;
  --brown-dark: #3e2723;
  --brown-mid: #5d4037;
  --brown-light: #8d6e63;
  --beige: #f5f0e8;
  --beige-dark: #e8dcc8;
  --gold: #f9a825;
  --red: #d32f2f;
  --red-light: #ffebee;
  --yellow: #fdd835;
  --yellow-light: #fffde7;
  --text: #2c2c2c;
  --text-light: #6b6b6b;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--beige);
  background-image: url('../img/farm-bg.jpg');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(26,58,42,0.88) 0%, rgba(62,39,35,0.82) 100%);
  z-index: -1;
}

/* Layout */
.app { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.1);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header h1 {
  color: var(--white);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.header .subtitle {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 400;
}

.header-nav {
  display: flex;
  gap: 8px;
}

.header-nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.header-nav a:hover, .header-nav a.active {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.card-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--green-dark);
}

.card-value.good { color: var(--green-light); }
.card-value.warn { color: var(--gold); }
.card-value.bad { color: var(--red); }

.card-detail {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Panels */
.panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  border: 1px solid rgba(0,0,0,0.04);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tables */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  padding: 12px 16px;
  background: var(--green-pale);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--green-dark);
  border-bottom: 2px solid var(--green-light);
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

tbody tr:hover {
  background: #fafaf5;
}

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

.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-yellow { background: #fff8e1; color: #f57f17; }
.badge-red { background: #ffebee; color: #c62828; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--green-mid), var(--green-light));
  color: var(--white);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary {
  background: var(--beige);
  color: var(--brown-mid);
  border: 1px solid var(--beige-dark);
}
.btn-secondary:hover { background: var(--beige-dark); }

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

.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

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

.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(74,140,94,0.15);
}

/* Checkboxes grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fafaf5;
  border: 1px solid #eee;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.checkbox-item:hover {
  background: var(--green-pale);
  border-color: var(--green-light);
}

.checkbox-item input:checked + .checkbox-label {
  color: var(--green-dark);
  font-weight: 600;
}

.checkbox-label {
  font-size: 13px;
  user-select: none;
}

.checkbox-label small {
  color: var(--text-light);
  font-weight: 400;
}

/* Tags / chips */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--green-pale);
  color: var(--green-dark);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.tag-remove {
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
}
.tag-remove:hover { opacity: 1; }

/* Progress */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s;
}

.progress-green { background: var(--green-light); }
.progress-yellow { background: var(--gold); }
.progress-red { background: var(--red); }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 14px 20px;
  border-radius: 10px;
  color: var(--white);
  font-weight: 500;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideIn 0.3s;
}

.toast-success { background: var(--green-mid); }
.toast-error { background: var(--red); }

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* Running indicator */
.running-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fff3e0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #e65100;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
