:root {
  --ink: #1a1208;
  --paper: #faf6ef;
  --cream: #f2ead8;
  --gold: #c8963e;
  --gold-light: #e8c47a;
  --gold-pale: #fdf3dc;
  --warm-gray: #8a7d6b;
  --done-green: #3d6b4f;
  --done-bg: #e8f3eb;
  --border: #d9cdb8;
  --shadow: rgba(26,18,8,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  padding: 40px 20px 80px;
  background-image:
    radial-gradient(ellipse at 20% 0%, #f5edd5 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, #f0e6cc 0%, transparent 60%);
}

/* ── Header ── */
.page-header {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
}

.page-header::before {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: var(--gold);
  margin: 0 auto 20px;
}

.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--ink);
  line-height: 1;
}

.page-header h1 span {
  color: var(--gold);
  font-style: italic;
}

.page-header p {
  margin-top: 12px;
  font-size: 15px;
  color: var(--warm-gray);
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* ── Stats ── */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 36px;
}

.stat { text-align: center; }

.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--warm-gray);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

/* ── Add Form ── */
.add-section {
  max-width: 680px;
  margin: 0 auto 40px;
}

.add-form {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 20px var(--shadow);
}

.add-form-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--ink);
}

.input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.input-group {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus,
.input-group select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,150,62,0.12);
  background: white;
}

.input-group input::placeholder { color: var(--warm-gray); }

.note-input {
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.note-input:focus {
  border-color: var(--gold);
  background: white;
}

.note-input::placeholder { color: var(--warm-gray); }

.btn-add {
  padding: 12px 28px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.btn-add:hover { background: #2e2010; transform: translateY(-1px); }
.btn-add:active { transform: translateY(0); }

/* ── Filters ── */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 680px;
  margin: 0 auto 32px;
  justify-content: center;
}

.filter-btn {
  padding: 7px 18px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--warm-gray);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 400;
}

.filter-btn:hover { border-color: var(--gold); color: var(--gold); }
.filter-btn.active { background: var(--ink); border-color: var(--ink); color: white; }

/* ── Board & Cards ── */
.board {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 2px 12px var(--shadow);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: cardIn 0.35s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(26,18,8,0.12); }

.card.done {
  background: var(--done-bg);
  border-color: #b8d9c2;
}

.card.done .card-title { text-decoration: line-through; color: var(--warm-gray); }

/* ── Category Pills ── */
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.cat-adventure { background: #fdecd5; color: #8b5e28; }
.cat-travel    { background: #dceefa; color: #1d5a8a; }
.cat-food      { background: #fce8e8; color: #8a2828; }
.cat-learning  { background: #e8f0fe; color: #2d4d9a; }
.cat-personal  { background: #f0e8fe; color: #5a2d8a; }
.cat-creative  { background: #e8fef0; color: #1a6b3c; }
.cat-other     { background: var(--cream); color: var(--warm-gray); }

.cat-icon { font-size: 13px; }

/* ── Card Content ── */
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 10px;
  word-break: break-word;
}

.card-note {
  font-size: 13px;
  color: var(--warm-gray);
  line-height: 1.6;
  margin-bottom: 14px;
  font-weight: 300;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  gap: 8px;
}

.card.done .card-footer { border-top-color: #b8d9c2; }

.done-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--done-green);
  margin-left: 8px;
}

.done-badge svg { width: 14px; height: 14px; }

/* ── Card Action Buttons ── */
.card-actions { display: flex; gap: 4px; }

.btn-icon {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  color: var(--warm-gray);
}

.btn-icon:hover         { background: var(--cream); color: var(--ink); }
.btn-icon.btn-check:hover  { background: var(--done-bg); color: var(--done-green); }
.btn-icon.btn-delete:hover { background: #fde8e8; color: #8a2828; }
.btn-icon svg { width: 16px; height: 16px; }

.card.done .btn-icon.btn-check { color: var(--done-green); }

/* ── Priority ── */
.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.priority-high { background: #e05252; }
.priority-med  { background: var(--gold); }
.priority-low  { background: #7ab87a; }

.priority-label { font-size: 11px; color: var(--warm-gray); font-weight: 400; }

/* ── Inline Edit Form ── */
.edit-form {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.edit-form.visible { display: flex; }

.edit-form input,
.edit-form select {
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
  transition: border-color 0.2s;
}

.edit-form input:focus,
.edit-form select:focus { border-color: var(--gold); background: white; }

.edit-selects { display: flex; gap: 8px; }
.edit-selects select { flex: 1; }

.edit-btns { display: flex; gap: 8px; }

.btn-save {
  padding: 8px 18px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-save:hover { background: #2e2010; }

.btn-cancel {
  padding: 8px 14px;
  background: transparent;
  color: var(--warm-gray);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-cancel:hover { background: var(--cream); color: var(--ink); }

/* ── Empty State ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--warm-gray);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.4;
}

.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
  opacity: 0.5;
}

.empty-state p { font-size: 14px; font-weight: 300; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .board { grid-template-columns: 1fr; }
  .stats-row { gap: 16px; }
  .stat-num { font-size: 22px; }
}