/* style.css - Mestregistratie & Nutriëntenbeheer Mts. Van der Vorst */

:root {
  --primary: #2d6a4f;
  --primary-hover: #1b4332;
  --primary-light: #e8f5e9;
  --accent: #d4a373;
  --bg: #f4f6f8;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: #ffffff;
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  background: transparent;
}

.vdv-logo-svg {
  width: 56px;
  height: 56px;
  display: block;
}

.brand h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.85rem;
  color: #d1fae5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.year-selector-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.year-selector-box label {
  font-size: 0.85rem;
  font-weight: 600;
}

.year-select {
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-sand {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-nv {
  background-color: #fee2e2;
  color: #b91c1c;
}

.badge-area {
  background-color: #e0e7ff;
  color: #3730a3;
}

.badge-proforma {
  background-color: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.badge-success {
  background-color: #dcfce7;
  color: #15803d;
}

.badge-warning {
  background-color: #fef3c7;
  color: #b45309;
}

.badge-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* Banners */
.proforma-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fed7aa;
  border-left: 5px solid #ea580c;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.sample-warning-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-left: 5px solid #d97706;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.proforma-banner-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.proforma-banner-icon {
  font-size: 1.6rem;
  color: #ea580c;
}

.proforma-banner-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 0.15rem;
}

.proforma-banner-desc {
  font-size: 0.85rem;
  color: #c2410c;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #ffffff;
}

a.btn {
  color: #ffffff !important;
  text-decoration: none;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

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

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

.btn-secondary {
  background-color: #64748b;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #475569;
}

.btn-excel {
  background-color: #107c41;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-excel:hover {
  background-color: #0b582e;
}

.btn-outline-light {
  background: #ffffff;
  color: var(--primary-hover) !important;
  font-weight: 700;
  border: 1px solid #ffffff;
}

.btn-outline-light:hover {
  background: #f0fdf4;
  color: var(--primary) !important;
}

.btn-success {
  background-color: var(--green);
  color: #ffffff;
}

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

.btn-danger-soft {
  background-color: #ef4444;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-weight: 600;
}

.btn-danger-soft:hover {
  background-color: #dc2626;
  color: #ffffff;
}

.btn-outline-light {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* Main Layout */
.main-container {
  max-width: 1440px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.card-n { border-top: 4px solid #10b981; }
.card-animal { border-top: 4px solid #8b5cf6; }
.card-fert { border-top: 4px solid #3b82f6; }
.card-p { border-top: 4px solid #f59e0b; }

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.kpi-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #4b5563;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}

.status-groen { background: #dcfce7; color: #166534; }
.status-oranje { background: #fef3c7; color: #92400e; }
.status-rood { background: #fee2e2; color: #991b1b; }

.kpi-main-val {
  font-size: 2rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.val-unit {
  font-size: 1rem;
  font-weight: 600;
  color: #6b7280;
}

.kpi-sub-val {
  font-size: 0.85rem;
  font-weight: 500;
  color: #4b5563;
  margin-bottom: 0.75rem;
}

.progress-bar-container {
  background: #e5e7eb;
  height: 8px;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease, background 0.4s ease;
}

.kpi-footer-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
  border-top: 1px solid #f3f4f6;
  padding-top: 0.5rem;
}

.fert-equivalents {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: #f8fafc;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.fert-eq-item {
  display: flex;
  justify-content: space-between;
}

/* Tabs */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-btn {
  background: transparent;
  border: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: #6b7280;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #ffffff;
  border-radius: 8px 8px 0 0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Content Box */
.content-box {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.box-header {
  margin-bottom: 1.25rem;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 0.75rem 0.85rem;
  border-bottom: 2px solid #e2e8f0;
}

.data-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.data-table tr:hover {
  background: #f8fafc;
}

/* Map Layout */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

#farmMap {
  height: 550px !important;
  min-height: 550px;
  width: 100%;
  border-radius: 8px;
  background: #1e293b;
  z-index: 1;
}

.map-container-box {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.75rem;
}

/* Header Sample Status Button */
.btn-sample-status {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.btn-sample-status.status-valid {
  background-color: #065f46;
  color: #ecfdf5 !important;
  border-color: #34d399;
}

.btn-sample-status.status-valid:hover {
  background-color: #047857;
}

.btn-sample-status.status-warning {
  background-color: #92400e;
  color: #fef3c7 !important;
  border-color: #f59e0b;
}

.btn-sample-status.status-warning:hover {
  background-color: #b45309;
}

.btn-sample-status.status-expired {
  background-color: #991b1b;
  color: #fee2e2 !important;
  border-color: #f87171;
}

.btn-sample-status.status-expired:hover {
  background-color: #b91c1c;
}

@media (max-width: 1024px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
}

.map-sidebar {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 580px;
}

.quick-parcel-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.quick-parcel-item {
  background: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}

.quick-parcel-item:hover {
  border-color: var(--primary);
  background: #f0fdf4;
}

.parcel-card-empty {
  background: #ffffff;
  padding: 1rem;
  border-radius: 6px;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  font-size: 0.85rem;
}

.parcel-card-active {
  background: #ffffff;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #86efac;
  box-shadow: var(--shadow-sm);
}

.parcel-metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid #f1f5f9;
}

/* Forms */
.form-box {
  background: #ffffff;
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .grid-2col, .grid-3col {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: #374151;
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.input-with-unit {
  display: flex;
  align-items: center;
}

.input-with-unit .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.unit-tag {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-left: none;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* Dropzone */
.dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover {
  border-color: var(--primary);
  background: #f0fdf4;
}

.dropzone-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.dropzone-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none; /* Standaard verborgen */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.modal.active {
  display: flex !important;
}

.modal-content {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 650px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  color: var(--primary-hover);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
}

.modal-close:hover {
  color: #1e293b;
}
