:root {
  --bg: #f4f8f2;
  --panel: #ffffff;
  --primary: #1f7a4d;
  --primary-dark: #125c39;
  --accent: #d9f0de;
  --text: #1d2d1f;
  --muted: #5d6c62;
  --danger: #c94d49;
  --warning: #d39c2d;
  --shadow: 0 10px 30px rgba(20, 52, 34, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #123d2b;
  color: white;
  padding: 16px 28px;
  gap: 16px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2fbf71, #1a6d46);
  font-weight: 700;
  font-size: 1.4rem;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.nav a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

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

.btn-su {
  background: #143c2d;
  color: white;
}

.btn-secondary {
  background: #e8f4ed;
  color: var(--primary-dark);
}

.btn-danger {
  background: #dc4c4c;
  color: white;
  padding: 8px 10px;
  font-size: 0.8rem;
}

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

.btn-logout {
  background: #f4f7f5;
  color: var(--danger);
  border: 1px solid #f1caca;
  font-weight: 700;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions form {
  margin: 0;
}

.upload-list-wrap {
  margin-top: 20px;
  border-top: 1px solid #edf1ee;
  padding-top: 18px;
}

.upload-list-wrap h3 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.upload-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f7faf7;
  border-radius: 10px;
  border: 1px solid #ebf1eb;
}

.upload-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.upload-meta strong,
.upload-meta small {
  word-break: break-word;
}

.inline-form {
  margin: 0;
}

.report-image-caption {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f3faf5;
  border: 1px solid #dfeee2;
}

.report-image-caption strong {
  display: inline-block;
  margin-right: 6px;
}

.report-image-caption p {
  margin: 8px 0 0;
  color: var(--text);
  line-height: 1.5;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #dff5e6, #eef9f1);
  border-radius: 18px;
  padding: 36px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 3vw, 3rem);
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--panel);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-box .label {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.stat-box strong {
  font-size: 2rem;
}

.panel {
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
}

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

.panel-header h2,
.panel-header h3,
.page-header h1 {
  margin: 0;
}

.activity-list,
.inline-list,
.report-list,
.summary-stack ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-list li,
.report-list li,
.inline-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf2ee;
}

.activity-list li:last-child,
.report-list li:last-child,
.inline-list li:last-child {
  border-bottom: none;
}

.tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
}

.tag.plot { background: #e7f5ec; color: var(--primary-dark); }
.tag.planting { background: #e7f0fe; color: #1c4ca3; }
.tag.maintenance { background: #fff1d9; color: #945f00; }
.tag.result { background: #fbe7dd; color: #8d4e2a; }

.auth-card {
  max-width: 440px;
  margin: 60px auto;
  background: var(--panel);
  padding: 28px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.card-header {
  margin-bottom: 20px;
}

.card-header h1 {
  margin: 10px 0 0;
}

.login-mode-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-user {
  background: #eaf6ee;
  color: var(--primary-dark);
}

.mode-super {
  background: #fdf1d8;
  color: #7d5a10;
}

.login-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.switch-login {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #edf2ee;
  color: var(--muted);
  font-size: 0.95rem;
}

.switch-login a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.stack-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #dce7de;
  border-radius: 10px;
  font: inherit;
  background: #fbfcfb;
}

input[type="date"] {
  min-height: 48px;
  color: var(--text);
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  width: 18px;
  height: 18px;
  filter: invert(27%) sepia(31%) saturate(714%) hue-rotate(109deg) brightness(90%) contrast(92%);
}

.note-box {
  margin-top: 18px;
  background: #f2faf5;
  border: 1px solid #d8efd9;
  border-radius: 10px;
  padding: 14px;
  color: var(--text);
}

.report-image-frame {
  margin-top: 12px;
}

.report-image-frame img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid #e4efe6;
  background: #f8faf8;
}

.flash-stack {
  margin-bottom: 20px;
}

.flash {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.flash.success {
  background: #eaf9ee;
  color: #165635;
  border: 1px solid #c9eccd;
}

.flash.error {
  background: #fff0f0;
  color: #8e2d2d;
  border: 1px solid #f1caca;
}

.dashboard-grid,
.admin-grid,
.panel-report-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.form-panel {
  min-height: 100%;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

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

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

.summary-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.page-header {
  margin: 12px 0 20px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eaf9ee;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-panel {
  margin-top: 28px;
}

.summary-card {
  background: #f9fbf9;
  border: 1px solid #edf2ee;
  border-radius: 14px;
  padding: 18px;
}

.summary-card h3 {
  margin-top: 0;
  margin-bottom: 14px;
}

.inline-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 0;
}

.inline-list li small {
  color: var(--muted);
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .userbox {
    width: 100%;
    justify-content: space-between;
  }

  input[type="date"] {
    min-height: 52px;
    font-size: 1rem;
  }
}
