/* Basic page styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  margin: 0;
  color: #222;
  background: #f7f7f9;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid #e2e2e5;
  padding: 28px 20px;
  text-align: center;
}

.site-title {
  margin: 0 0 12px 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
  color: #0b3d91;
}

.tabs ul {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: inline-flex;
  gap: 8px;
}

.tab a {
  display: inline-block;
  padding: 8px 14px;
  text-decoration: none;
  color: #0b3d91;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
}

.tab a:hover {
  background: #f0f6ff;
}

.tab.active a {
  background: #0b3d91;
  color: #fff;
  border-color: #0b3d91;
}

.content {
  padding: 24px;
}

@media (min-width: 640px) {
  .site-title {
    font-size: 24px;
  }
}

/* Manage User table */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(11, 61, 145, 0.04);
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eef0f3;
}

.data-table thead th {
  background: #f4f6fb;
  color: #0b3d91;
  font-weight: 600;
}

.controls {
  text-align: right;
  margin-top: 8px;
}

.btn {
  display: inline-block;
  padding: 8px 12px;
  background: #fff;
  color: #0b3d91;
  border: 1px solid #0b3d91;
  border-radius: 6px;
  cursor: pointer;
}

.btn.primary {
  background: #0b3d91;
  color: #fff;
}

.btn:focus {
  outline: 2px solid rgba(11, 61, 145, 0.2);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1200;
}

/* Ensure the HTML 'hidden' attribute actually hides the modal (author rules may override UA defaults) */
.modal[hidden] {
  display: none;
}

.modal-content {
  background: #fff;
  padding: 18px;
  width: 320px;
  max-width: 95%;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.modal-header h3 {
  margin: 0 0 12px 0;
}

.modal-content label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}
.modal-content input[type="text"],
.modal-content select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  margin-top: 4px;
  margin-bottom: 10px;
  border: 1px solid #d8dbe0;
  border-radius: 6px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Dashboard stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 12px 0 20px 0;
}

.stat-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid rgba(11, 61, 145, 0.06);
  padding: 18px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(11, 61, 145, 0.03);
}

.stat-card.farmers {
  border-left: 6px solid #16a34a; /* green */
}
.stat-card.collectors {
  border-left: 6px solid #0b84ff; /* blue */
}
.stat-card.millers {
  border-left: 6px solid #f59e0b; /* amber */
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #0b3d91;
  min-width: 60px;
}

.stat-label {
  color: #4b5563;
  font-size: 13px;
}

.stat-card .stat-meta {
  margin-left: auto;
  text-align: right;
  color: #6b7280;
  font-size: 12px;
}

.stat-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(11, 61, 145, 0.04);
}

.stat-card.farmers .stat-icon {
  background: rgba(16, 185, 129, 0.12);
}
.stat-card.collectors .stat-icon {
  background: rgba(11, 132, 255, 0.1);
}
.stat-card.millers .stat-icon {
  background: rgba(245, 158, 11, 0.08);
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stat-value {
    font-size: 32px;
  }
}
