/* ─── Design tokens ──────────────────────────────────────── */
:root {
  /* Brand greens */
  --green-900: #0f3a20;
  --green-700: #16502d;   /* ← your logo colour */
  --green-500: #3d6e18;
  --green-100: #e8f2ec;
  --green-50:  #f4faf6;

  /* Complementary — burgundy */
  --burg-700:  #501629;
  --burg-500:  #7a3050;
  --burg-100:  #f2e8eb;

  /* Split-complementary — amber */
  --amber-700: #6b4409;
  --amber-500: #a06c10;
  --amber-100: #f5e6c8;

  /* Analogous — teal */
  --teal-700:  #0a4840;
  --teal-500:  #126050;
  --teal-100:  #e0f2ee;

  /* Neutrals (hue-shifted toward green) */
  --neutral-900: #2c3330;
  --neutral-700: #4a5550;
  --neutral-400: #8a9490;
  --neutral-200: #dde1db;
  --neutral-100: #f0f2f0;
  --neutral-50:  #f6f7f5;   /* page background */
  --white:       #ffffff;

  /* Semantic aliases */
  --color-primary:        var(--green-700);
  --color-primary-dark:   var(--green-900);
  --color-primary-light:  var(--green-100);
  --color-accent:         var(--amber-500);
  --color-danger:         var(--burg-700);
  --color-danger-light:   var(--burg-100);
  --color-success:        var(--green-500);
  --color-success-light:  var(--green-100);
  --color-warning:        var(--amber-500);
  --color-warning-light:  var(--amber-100);
  --color-info:           var(--teal-500);
  --color-info-light:     var(--teal-100);
  --color-text:           var(--neutral-900);
  --color-text-muted:     var(--neutral-700);
  --color-text-faint:     var(--neutral-400);
  --color-border:         var(--neutral-200);
  --color-bg:             var(--neutral-50);
  --color-surface:        var(--white);

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(22,80,45,0.08), 0 1px 2px rgba(22,80,45,0.06);
  --shadow-md: 0 4px 12px rgba(22,80,45,0.10), 0 2px 4px rgba(22,80,45,0.06);
}

/* ─── Reset & base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--color-info); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font-body); cursor: pointer; }

/* ─── Navigation ─────────────────────────────────────────── */
.nav {
  background: var(--green-900);
  padding: 0 .25rem;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-logo {
  width: 48px; height: 48px;
  background: var(--green-700);
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
}
.nav-logo > div {
  background-color: #fff;
  padding: 2px;
  border-radius: 12px;
}
.nav-wordmark {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: 0.01em;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  list-style: none;
}
.nav-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: #fff; font-weight: 500; }

/* ─── Page layout ────────────────────────────────────────── */
.page { max-width: 860px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.section { margin-bottom: 3rem; }
.section-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-text);
  margin-bottom: 0.3rem;
  line-height: 1.25;
}
.section-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

/* ─── Colour swatches ────────────────────────────────────── */
.palette-group { margin-bottom: 1.5rem; }
.palette-group-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-faint);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.swatch {
  flex: 1 1 100px;
  min-width: 90px;
  max-width: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.07);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.swatch-color { height: 64px; }
.swatch-info { padding: 8px 10px; }
.swatch-name { font-size: 0.75rem; font-weight: 500; color: var(--color-text); }
.swatch-hex  { font-size: 0.7rem;  font-family: 'Courier New', monospace; color: var(--color-text-muted); margin-top: 2px; }
.swatch-role { font-size: 0.68rem; color: var(--color-text-faint); margin-top: 1px; }

/* ─── Badge / tag demos ──────────────────────────────────── */
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }
.badge-green  { background: var(--green-100);  color: var(--green-900);  }
.badge-amber  { background: var(--amber-100);  color: var(--amber-700);  }
.badge-burg   { background: var(--burg-100);   color: var(--burg-700);   }
.badge-teal   { background: var(--teal-100);   color: var(--teal-700);   }
.badge-neutral{ background: var(--neutral-100);color: var(--neutral-700);}

/* ─── Alert demos ────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border-left: 3px solid;
  font-size: 0.875rem;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-100); border-color: var(--green-700); color: var(--green-900); }
.alert-warning { background: var(--amber-100); border-color: var(--amber-500); color: var(--amber-700); }
.alert-danger  { background: var(--burg-100);  border-color: var(--burg-700);  color: var(--burg-700);  }
.alert-info    { background: var(--teal-100);  border-color: var(--teal-500);  color: var(--teal-700);  }

/* ─── Buttons ────────────────────────────────────────────── */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  transition: filter 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:hover  { filter: brightness(0.92); }
.btn:active { transform: scale(0.97); }
.btn-primary   { background: var(--green-700);   color: #fff; }
.btn-secondary { background: var(--green-100);   color: var(--green-900); }
.btn-amber     { background: var(--amber-500);   color: #fff; }
.btn-danger    { background: var(--burg-700);    color: #fff; }
.btn-outline   {
  background: transparent;
  color: var(--green-700);
  border: 1.5px solid var(--green-700);
}
.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.btn-sm { padding: 6px 13px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-icon { padding: 9px; border-radius: var(--radius-md); }

/* ─── Form elements (shared) ─────────────────────────────── */
.field { margin-bottom: 1.25rem; }
.field-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}
.field-hint {
  font-size: 0.75rem;
  color: var(--color-text-faint);
  margin-top: 0.3rem;
}
.field-error {
  font-size: 0.75rem;
  color: var(--burg-700);
  margin-top: 0.3rem;
  display: none;
}
.field-error.visible { display: block; }

input[type="text"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(22,80,45,0.12);
}
input.error, select.error, textarea.error {
  border-color: var(--burg-700);
  box-shadow: 0 0 0 3px rgba(80,22,41,0.1);
}
textarea { resize: vertical; min-height: 88px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a9490' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
input[type="checkbox"], input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--green-700);
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  font-size: 0.825rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.radio-chip input { display: none; }
.radio-chip:has(input:checked) {
  border-color: var(--green-700);
  background: var(--green-100);
  color: var(--green-900);
  font-weight: 500;
}
.radio-chip:hover { border-color: var(--green-500); }

/* ─── Card ───────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--green-50);
}
.card-header-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--green-900);
}
.card-header-sub {
  font-size: 0.8rem;
  color: var(--color-text-faint);
  margin-top: 2px;
}
.card-body { padding: 1.5rem; }

/* ─── Two-column form grid ───────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
}
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}

/* ─── Priority colour pills (in form) ───────────────────── */
.priority-swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

/* ─── Todo list (result) ─────────────────────────────────── */
#todo-list { list-style: none; margin-top: 1.25rem; }
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  animation: slideIn 0.2s ease;
}
.todo-item:last-child { border-bottom: none; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.todo-check-wrap {
  padding-top: 2px;
}
.todo-check {
  width: 18px; height: 18px;
  border: 2px solid var(--color-border);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.todo-check.checked {
  background: var(--green-700);
  border-color: var(--green-700);
}
.todo-check.checked::after {
  content: '';
  width: 10px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.todo-content { flex: 1; min-width: 0; }
.todo-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  transition: color 0.15s;
}
.todo-title.done {
  text-decoration: line-through;
  color: var(--color-text-faint);
}
.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.todo-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}
.todo-actions { display: flex; gap: 4px; }
.todo-delete {
  background: none; border: none; padding: 4px;
  color: var(--color-text-faint); cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 1rem; line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.todo-delete:hover { background: var(--burg-100); color: var(--burg-700); }

/* ─── Empty state ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-faint);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; }

/* ─── Stats bar ──────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.stat {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  flex: 1 1 80px;
  text-align: center;
}
.stat-num { font-size: 1.4rem; font-weight: 600; color: var(--green-700); }
.stat-label { font-size: 0.72rem; color: var(--color-text-faint); margin-top: 1px; }

/* ─── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  background: var(--green-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 999;
  max-width: 280px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ─── Page hero ──────────────────────────────────────────── */
.hero {
  background: var(--green-900);
  color: #fff;
  padding: 2.5rem 2rem;
  margin: -2.5rem -1.5rem 2.5rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(22,80,45,0.6);
  pointer-events: none;
}
.hero-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.4rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: 0.6rem;
}
.hero-sub {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  max-width: 480px;
}

/* ─── Responsive tweaks ──────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 2rem 1.25rem; }
}
