:root {
  --forest: #24422B;
  --forest-strong: #16281B;
  --sage: #6E9A4E;
  --clay: #A8532B;
  --ground: #F6F1E7;
  --ink: #242824;
  --border: rgba(36, 66, 43, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: ui-sans-serif, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--forest);
  color: #fff;
  flex-wrap: wrap;
  gap: 10px;
}

.site-header .brand {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  font-size: 1.1rem;
}

.site-header nav {
  display: flex;
  gap: 14px;
  align-items: center;
}

.site-header nav a,
.link-button {
  color: #fff;
  text-decoration: none;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

h1 { color: var(--forest-strong); }
h2 { color: var(--forest-strong); font-size: 1.15rem; margin-top: 2rem; }

.stack { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; }
input, select, textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

button, .button {
  display: inline-block;
  background: var(--forest);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  width: fit-content;
}

button.danger { background: var(--clay); margin-top: 12px; }

.settings-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 16px 0 20px; flex-wrap: nowrap; overflow-x: auto; }
.settings-tabs a, .settings-tab-button {
  padding: 8px 10px;
  text-decoration: none;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  white-space: nowrap;
  cursor: pointer;
}
.settings-tabs a.active { border-bottom-color: var(--forest); font-weight: 600; }
.settings-tab-button:hover, .settings-tabs a:hover { color: var(--forest); }

.error { color: var(--clay); font-weight: 600; }
.fine-print { color: #6b6b6b; font-size: 0.85rem; }
.notice-ok { background: #eaf4e6; border-left: 3px solid var(--vert-verger, #315C3A); padding: 10px 14px; border-radius: 4px; }
.notice-info { background: #f2ede1; border-left: 3px solid #a89b7d; padding: 10px 14px; border-radius: 4px; }

.card-row { display: flex; gap: 12px; margin: 16px 0; }
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--forest-strong); }
.stat-label { font-size: 0.82rem; color: #555; }

.due-list, .graft-list, .observation-list { list-style: none; padding: 0; }
.due-list li, .graft-list li { border-bottom: 1px solid var(--border); padding: 10px 0; }
.graft-list a { text-decoration: none; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.badge-pending { background: #E6E0CC; color: #6b5b1f; }
.badge-success { background: #DCEEDC; color: var(--forest-strong); }
.badge-failure { background: #F3DCD3; color: var(--clay); }
.badge-due { background: #F6E2C4; color: #7a4a12; }
.badge-removal { background: #E6D7C3; color: #5a3d1f; }

.tree-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tree-row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}
.tree-row strong { flex-shrink: 0; }
.tree-row span { color: #6b6b6b; font-size: 0.85rem; white-space: nowrap; }
.tree-row .tree-variety { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
.tree-row .tree-age { flex-shrink: 0; }
.tree-row .badge { flex-shrink: 0; font-size: 0.72rem; padding: 3px 8px; }

.photo-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-row img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; }

.stats-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.stats-table th, .stats-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }

.status-form { display: flex; gap: 10px; align-items: center; }
