/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background-color: #f7f9f9;
  color: #333;
}

/* NAVBAR */
nav {
  background-color: #78c043;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav h1 {
  font-size: 1.8rem;
}

nav .nav-links a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

/* CARDS */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 2rem;
}

.card {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
}

.card h3 {
  margin-bottom: 0.5rem;
  color: #4a7c2b;
}

/* FORM */
.form-section {
  background-color: white;
  margin: 2rem;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.form-section form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.form-section label {
  font-weight: bold;
}

.form-section input, .form-section select, .form-section button {
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.form-section button {
  background-color: #78c043;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.form-section button:hover {
  background-color: #639b33;
}

/* HISTORY */
.history-section {
  margin: 2rem;
}

.history-section table {
  width: 100%;
  border-collapse: collapse;
}

.history-section th, .history-section td {
  border: 1px solid #ddd;
  padding: 0.8rem;
  text-align: center;
}

.history-section th {
  background-color: #78c043;
  color: white;
}

.status-green {
  background: #e6f9e6;
  color: #1a6f1a;
  border: 1px solid #8fce8f;
}

.status-yellow {
  background: #fffbe6;
  color: #7a6500;
  border: 1px solid #ffe080;
}

.status-red {
  background: #ffe6e6;
  color: #b84a4a;
  border: 1px solid #ff9999;
}

.status-none {
  background: #f5f5f5;
  color: #777;
  border: 1px solid #ddd;
}

.days-left-card.status-green {
  border-left: 4px solid #4caf50;
}

.days-left-card.status-yellow {
  border-left: 4px solid #ffb300;
}

.days-left-card.status-red {
  border-left: 4px solid #f44336;
}

.table-days-left.status-green {
  background: #e6f9e6;
  color: #1a6f1a;
}

.table-days-left.status-yellow {
  background: #fffbe6;
  color: #7a6500;
}

.table-days-left.status-red {
  background: #ffe6e6;
  color: #b84a4a;
}

.record-status.received {
  color: #1a6f1a;
  font-weight: 700;
}
.record-status.pending {
  color: #b37300;
  font-weight: 700;
}
.record-status.unknown {
  color: #666;
  font-weight: 700;
}

/* AUTH */
.auth-container {
  width: min(450px, 90%);
  margin: 4rem auto;
  background: white;
  padding: 2rem;
  border-radius: 9px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
}
.auth-container h2 { margin-bottom: 1rem; }
.auth-container form { display: grid; gap: 0.8rem; }
.auth-container input, .auth-container select, .auth-container button {
  width: 100%;
  padding: 0.6rem;
  border-radius: 5px;
  border: 1px solid #ccc;
}
.auth-container button {
  background: #78c043;
  color: #fff;
  font-weight: 700;
}

/* DETAIL VIEW */
.detail-section {
  margin: 2rem;
  max-width: 600px;
}

/* FARMER HEADER */
.farmer-header {
  margin: 2rem;
  padding: 1rem;
  background: linear-gradient(135deg, #78c043 0%, #639b33 100%);
  color: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.farmer-header h2 {
  margin: 0;
  font-size: 1.8rem;
}

.detail-section {
  margin: 2rem;
  max-width: 600px;
}

.detail-card {
  background-color: white;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.detail-card h3 {
  color: #4a7c2b;
  margin-bottom: 1rem;
  border-bottom: 2px solid #78c043;
  padding-bottom: 0.5rem;
}

.detail-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid #eee;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row label {
  font-weight: bold;
  color: #666;
}

.detail-row span {
  color: #333;
}

.detail-row.days-row {
  padding: 1rem;
  border-radius: 4px;
  grid-template-columns: 150px 1fr;
}

.detail-row.days-row span {
  font-size: 1.1rem;
  font-weight: bold;
}

.back-link {
  display: inline-block;
  margin-top: 1rem;
  color: #78c043;
  text-decoration: none;
  font-weight: bold;
}

.back-link:hover {
  text-decoration: underline;
}

.view-btn {
  color: white;
  background-color: #78c043;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: bold;
  display: inline-block;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.view-btn:hover {
  background-color: #639b33;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

.view-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}