/* ============================================================
   AFAMILY HQ — Luxury To-Do & Goals Screens
   style-todos-goals.css
   Design language: Apple 1998 × Porsche 1975
   Matches Rewards Vault aesthetic exactly.
   ============================================================ */

/* ============================================================
   SECTION — TO-DO LIST  (#section-todos)
   ============================================================ */

/* ── Hero slab ─────────────────────────────────────────────── */
#section-todos .section-header {
  background: linear-gradient(135deg, #141f33 0%, var(--brand-navy) 55%, #3a1518 100%);
  border-radius: 24px;
  padding: 36px 32px 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Cognac radial glow — top-right */
#section-todos .section-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 240px at 105% -15%, rgba(195,106,45,0.22), transparent 60%),
    radial-gradient(380px 200px at -5% 115%, rgba(90,30,35,0.40), transparent 60%);
  pointer-events: none;
}

/* Cognac 4px left rail */
#section-todos .section-header::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-cognac), #8a4a1f);
  border-radius: 4px 0 0 4px;
}

#section-todos .section-header > * {
  position: relative;
  z-index: 1;
}

/* Hero title block */
.todos-hero-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Fallback: if no wrapper exists, style the raw h1 */
#section-todos .section-header h1.section-title,
#section-todos .section-header .section-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  color: var(--brand-cream);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
  text-shadow: 0 2px 16px rgba(15,22,38,0.35);
}

.todos-hero-subtitle {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-cognac);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  margin-bottom: 2px;
}

/* Add Task button — cognac fill, cream text, pill shape */
#section-todos .section-header .btn-primary,
#section-todos .section-header button.btn {
  background: var(--brand-cognac);
  color: var(--brand-cream);
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
  box-shadow: 0 4px 18px rgba(195,106,45,0.38);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

#section-todos .section-header .btn-primary:hover,
#section-todos .section-header button.btn:hover {
  background: #d47535;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(195,106,45,0.50);
}

/* ── Filter pills (status + person) ────────────────────────── */
/* The .combined-filters bar sits just below the hero slab */
#section-todos .combined-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}

/* Glass pill base for all todo filter buttons */
#section-todos .combined-filters .btn,
#section-todos .combined-filters .btn-small,
#section-todos .combined-filters .todo-filter {
  background: rgba(246,241,232,0.10);
  border: 1px solid rgba(246,241,232,0.20);
  color: var(--brand-cream);
  border-radius: 999px;
  padding: 7px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
  /* Render on the dark hero bg */
  backdrop-filter: blur(8px);
}

/* NOTE: the filter row is outside the hero slab in the DOM, so we
   replicate the dark pill style against the cream page bg */
#section-todos .combined-filters .todo-filter {
  background: var(--brand-paper);
  border: 1.5px solid var(--brand-line);
  color: var(--brand-ink-2);
  backdrop-filter: none;
}

#section-todos .combined-filters .todo-filter:hover {
  border-color: var(--brand-cognac);
  color: var(--brand-cognac);
}

#section-todos .combined-filters .todo-filter.active {
  background: var(--brand-cognac);
  border-color: var(--brand-cognac);
  color: var(--brand-cream);
  box-shadow: 0 4px 14px rgba(195,106,45,0.32);
}

/* Person select — inherit pill look */
#section-todos .combined-filters .filter-select,
#section-todos #todos-person-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--brand-paper);
  border: 1.5px solid var(--brand-line);
  border-radius: 999px;
  padding: 7px 32px 7px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-ink-2);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%238a847a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px;
  outline: none;
  transition: border-color 0.18s;
  height: 36px;
}

#section-todos #todos-person-select:focus,
#section-todos #todos-person-select:hover {
  border-color: var(--brand-cognac);
}

/* Filter separator */
#section-todos .filter-sep {
  width: 1px;
  height: 20px;
  background: var(--brand-line);
  align-self: center;
  flex-shrink: 0;
}

/* ── To-Do list container ───────────────────────────────────── */
#section-todos .todo-list,
#todo-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border: none;
  overflow: visible;
}

/* ── Individual todo item ────────────────────────────────────── */
#section-todos .todo-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--brand-paper);
  border-radius: 16px;
  border: 1px solid var(--brand-line);
  box-shadow: 0 4px 16px rgba(15,22,38,0.06);
  border-bottom: 1px solid var(--brand-line); /* override legacy removal */
  transition: transform 0.18s, box-shadow 0.18s, background 0.15s;
  position: relative;
  overflow: hidden;
}

#section-todos .todo-item:last-child {
  border-bottom: 1px solid var(--brand-line);
}

#section-todos .todo-item:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(15,22,38,0.10);
}

/* Cornerstone 3px left rail cycling */
#section-todos .todo-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}

#section-todos .todo-item:nth-child(4n+1)::before { background: var(--brand-cognac); }
#section-todos .todo-item:nth-child(4n+2)::before { background: var(--brand-emerald); }
#section-todos .todo-item:nth-child(4n+3)::before { background: var(--brand-navy); }
#section-todos .todo-item:nth-child(4n+4)::before { background: var(--brand-burgundy); }

/* Done state — muted, struck */
#section-todos .todo-item.done {
  filter: saturate(0.3) brightness(0.88);
}

#section-todos .todo-item.done .todo-text {
  text-decoration: line-through;
  color: var(--brand-mute);
}

/* ── Checkbox ────────────────────────────────────────────────── */
#section-todos .todo-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid var(--brand-line);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 13px;
  color: transparent;
}

#section-todos .todo-checkbox:hover {
  border-color: var(--brand-cognac);
  background: rgba(195,106,45,0.08);
  transform: scale(1.1);
}

/* Checked: cornerstone cognac fill */
#section-todos .todo-item.done .todo-checkbox {
  background: var(--brand-cognac);
  border-color: transparent;
  color: var(--brand-cream);
  box-shadow: 0 2px 8px rgba(195,106,45,0.36);
  font-size: 12px;
}

/* ── Todo text & main area ───────────────────────────────────── */
#section-todos .todo-main {
  flex: 1;
  min-width: 0;
}

#section-todos .todo-text {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-ink);
  line-height: 1.4;
  display: block;
}

/* ── Meta row (person tag, date, pts chip) ──────────────────── */
#section-todos .todo-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 5px;
}

/* Person tag — per-member colors */
#section-todos .todo-person-tag {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.20em;
  padding: 3px 9px;
  border-radius: 999px;
  line-height: 1;
}

/* Default person tag fallback */
#section-todos .todo-person-tag {
  background: rgba(29,46,74,0.10);
  color: var(--brand-navy);
}

/* Per-member overrides via data flow — we target text content patterns
   by using :has and attribute selectors on the parent li where possible,
   but since the tag text is dynamically injected we use JS-class-agnostic
   selectors. The cleanest approach: style the tags globally here,
   then each member class added by the JS. */

/* Abs = navy */
#section-todos .todo-item[data-person="Abs"] .todo-person-tag,
#section-todos .todo-person-tag.person-abs {
  background: rgba(29,46,74,0.12);
  color: var(--brand-navy);
  border: 1px solid rgba(29,46,74,0.18);
}

/* Anne = burgundy */
#section-todos .todo-item[data-person="Anne"] .todo-person-tag,
#section-todos .todo-person-tag.person-anne {
  background: rgba(90,30,35,0.12);
  color: var(--brand-burgundy);
  border: 1px solid rgba(90,30,35,0.18);
}

/* Lera = cognac */
#section-todos .todo-item[data-person="Lera"] .todo-person-tag,
#section-todos .todo-person-tag.person-lera {
  background: rgba(195,106,45,0.12);
  color: var(--brand-cognac);
  border: 1px solid rgba(195,106,45,0.18);
}

/* Lebari = emerald */
#section-todos .todo-item[data-person="Lebari"] .todo-person-tag,
#section-todos .todo-person-tag.person-lebari {
  background: rgba(35,74,55,0.12);
  color: var(--brand-emerald);
  border: 1px solid rgba(35,74,55,0.18);
}

/* Points chip — cream bg, cognac text */
#section-todos .todo-pts-chip {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-cognac);
  background: rgba(195,106,45,0.09);
  border: 1px solid rgba(195,106,45,0.20);
  padding: 3px 9px;
  border-radius: 999px;
  line-height: 1;
}

/* Date text in meta */
#section-todos .todo-meta > span:not(.todo-person-tag):not(.todo-pts-chip) {
  font-size: 11px;
  color: var(--brand-mute);
  font-weight: 500;
}

/* Notes indicator */
#section-todos .todo-meta [style*="text-light"] {
  font-size: 11px;
  color: var(--brand-mute);
}

/* ── Priority dot ────────────────────────────────────────────── */
#section-todos .priority-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

#section-todos .priority-dot.high   { background: #c0392b; box-shadow: 0 0 5px rgba(192,57,43,0.45); }
#section-todos .priority-dot.medium { background: var(--brand-cognac); }
#section-todos .priority-dot.low    { background: var(--brand-emerald); }

/* ── Right action icons ──────────────────────────────────────── */
#section-todos .todo-meta:last-child {
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}

#section-todos .btn-icon,
#section-todos .reorder-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--brand-mute);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

#section-todos .btn-icon:hover,
#section-todos .reorder-btn:hover {
  background: rgba(195,106,45,0.10);
  color: var(--brand-cognac);
}

#section-todos .btn-icon:disabled,
#section-todos .reorder-btn:disabled {
  opacity: 0.28;
  cursor: default;
}

/* ── Done section header divider ─────────────────────────────── */
#section-todos .todo-done-header {
  list-style: none;
  padding: 18px 4px 8px !important;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-mute);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  border-top: 1px solid var(--brand-line);
  margin-top: 8px;
}

/* ── Empty state ─────────────────────────────────────────────── */
#section-todos .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  text-align: center;
  gap: 10px;
}

#section-todos .empty-state .empty-state-icon {
  font-size: 36px;
  margin-bottom: 4px;
  display: block;
}

#section-todos .empty-state-title,
#section-todos .empty-state {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--brand-navy);
  letter-spacing: -0.02em;
}

#section-todos .empty-state::after {
  content: '';
  /* no pseudo needed — kept for potential future use */
}

/* Inject "All caught up" text style for the li.empty-state */
#todo-list > li.empty-state {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--brand-navy);
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px;
  text-align: center;
  gap: 10px;
  border-radius: 16px;
  background: var(--brand-paper);
  border: 1px solid var(--brand-line);
}

#todo-list > li.empty-state .empty-state-icon {
  font-size: 36px;
  display: block;
}

/* ── Todo notes detail (expanded) ───────────────────────────── */
#section-todos .todo-notes-detail {
  font-size: 12px;
  color: var(--brand-ink-2);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--brand-line);
  line-height: 1.55;
}

/* ── Person filter pills (if rendered as buttons) ───────────── */
#section-todos .todo-person-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

#section-todos .todo-person-filter {
  background: var(--brand-paper);
  border: 1.5px solid var(--brand-line);
  color: var(--brand-ink-2);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font-body);
}

#section-todos .todo-person-filter:hover {
  border-color: var(--brand-cognac);
  color: var(--brand-cognac);
}

#section-todos .todo-person-filter.active {
  background: var(--brand-cognac);
  border-color: var(--brand-cognac);
  color: var(--brand-cream);
  box-shadow: 0 3px 12px rgba(195,106,45,0.30);
}

/* Reorder button group */
#section-todos .idea-reorder-btns {
  display: flex;
  gap: 2px;
}

/* ============================================================
   SECTION — GOALS  (#section-goals)
   ============================================================ */

/* ── Hero slab (emerald dominant) ───────────────────────────── */
#section-goals .section-header,
#plans-goals-panel .section-header {
  background: linear-gradient(135deg, #132a1e 0%, var(--brand-emerald) 55%, #1d2e4a 100%);
  border-radius: 24px;
  padding: 22px 28px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Emerald-tinted glows */
#section-goals .section-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 240px at 105% -15%, rgba(195,106,45,0.14), transparent 60%),
    radial-gradient(380px 200px at -5% 115%, rgba(29,46,74,0.45), transparent 60%);
  pointer-events: none;
}

/* Emerald 4px left rail */
#section-goals .section-header::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #3d7a58, #152e22);
  border-radius: 4px 0 0 4px;
}

#section-goals .section-header > * {
  position: relative;
  z-index: 1;
}

/* Hero title */
#section-goals .section-header h1.section-title,
#section-goals .section-header .section-title,
#section-goals .section-header h2,
#plans-goals-panel .section-header h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--brand-cream) !important;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
  text-shadow: 0 2px 16px rgba(15,22,38,0.40);
}

/* Emerald subtitle label */
.goals-hero-subtitle {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  color: rgba(180,220,195,0.90);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  margin-bottom: 2px;
}

/* Add Goal button — emerald fill, cream text */
#section-goals .section-header .btn-primary,
#section-goals .section-header button.btn {
  background: var(--brand-emerald);
  color: var(--brand-cream);
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
  box-shadow: 0 4px 18px rgba(35,74,55,0.45);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

#section-goals .section-header .btn-primary:hover,
#section-goals .section-header button.btn:hover {
  background: #2d6347;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(35,74,55,0.55);
}

/* ── Combined filter row ─────────────────────────────────────── */
#section-goals .combined-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}

/* Period + person filter pills */
#section-goals .combined-filters .btn,
#section-goals .combined-filters .btn-small,
#section-goals .combined-filters .goal-period-btn,
#section-goals .combined-filters .goal-person-btn {
  background: var(--brand-paper);
  border: 1.5px solid var(--brand-line);
  color: var(--brand-ink-2);
  border-radius: 999px;
  padding: 7px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
}

#section-goals .combined-filters .goal-period-btn:hover,
#section-goals .combined-filters .goal-person-btn:hover {
  border-color: var(--brand-emerald);
  color: var(--brand-emerald);
}

#section-goals .combined-filters .goal-period-btn.active,
#section-goals .combined-filters .goal-person-btn.active {
  background: var(--brand-emerald);
  border-color: var(--brand-emerald);
  color: var(--brand-cream);
  box-shadow: 0 4px 14px rgba(35,74,55,0.32);
}

/* Period + Person selects for goals (dropdown pill style) */
#section-goals .combined-filters .filter-select,
#section-goals #goals-period-select,
#section-goals #goals-person-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--brand-paper);
  border: 1.5px solid var(--brand-line);
  border-radius: 999px;
  padding: 7px 32px 7px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-ink-2);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%238a847a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px;
  outline: none;
  transition: border-color 0.18s;
  height: 36px;
}

#section-goals #goals-person-select:focus,
#section-goals #goals-person-select:hover,
#section-goals #goals-period-select:focus,
#section-goals #goals-period-select:hover {
  border-color: var(--brand-emerald);
}

/* Filter separator */
#section-goals .filter-sep {
  width: 1px;
  height: 20px;
  background: var(--brand-line);
  align-self: center;
  flex-shrink: 0;
}

/* ── Goals list container ────────────────────────────────────── */
#goals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Goal card — cornerstone fill, cream text ───────────────── */
#section-goals .card-item.goal-card,
#goals-list .card-item.goal-card {
  border-radius: 14px !important;
  padding: 14px 16px !important;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(246,241,232,0.08) !important;
  box-shadow: 0 8px 22px rgba(15,22,38,0.18) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  cursor: pointer;
  background: var(--brand-navy);
  color: var(--brand-cream);
}
#section-goals .card-item.goal-card:hover,
#goals-list .card-item.goal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 48px rgba(15,22,38,0.32) !important;
}
#section-goals .card-item.goal-card .card-item-actions,
#goals-list .card-item.goal-card .card-item-actions {
  flex-direction: column !important;
  gap: 4px !important;
  align-items: flex-end !important;
}
#section-goals .card-item.goal-card .idea-reorder-btns,
#goals-list .card-item.goal-card .idea-reorder-btns {
  display: inline-flex !important;
  flex-direction: row !important;
  gap: 2px !important;
}
@media (max-width: 640px) {
  #section-goals .card-item.goal-card,
  #goals-list .card-item.goal-card {
    padding: 12px !important;
    border-radius: 12px !important;
    gap: 10px !important;
  }
}

#section-goals .card-item.goal-card:hover,
#goals-list .card-item.goal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(15,22,38,0.28);
}

/* Cornerstone gradient fills cycling */
#goals-list .goal-card:nth-child(4n+1),
#section-goals #goals-list .goal-card:nth-child(4n+1) {
  background: linear-gradient(160deg, #d4762e 0%, var(--brand-cognac) 50%, #8a4a1f 100%);
}

#goals-list .goal-card:nth-child(4n+2),
#section-goals #goals-list .goal-card:nth-child(4n+2) {
  background: linear-gradient(160deg, #2e5a44 0%, var(--brand-emerald) 55%, #152e22 100%);
}

#goals-list .goal-card:nth-child(4n+3),
#section-goals #goals-list .goal-card:nth-child(4n+3) {
  background: linear-gradient(160deg, #2a4268 0%, var(--brand-navy) 55%, #0f1626 100%);
}

#goals-list .goal-card:nth-child(4n+4),
#section-goals #goals-list .goal-card:nth-child(4n+4) {
  background: linear-gradient(160deg, #7a2a30 0%, var(--brand-burgundy) 55%, #36131a 100%);
}

/* Inner radial highlight */
#section-goals .goal-card::after,
#goals-list .goal-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(340px 140px at 100% -10%, rgba(246,241,232,0.14), transparent 60%);
  pointer-events: none;
}

#section-goals .goal-card > *,
#goals-list .goal-card > * {
  position: relative;
  z-index: 1;
}

/* ── Card info area ──────────────────────────────────────────── */
#section-goals .goal-card .card-item-info,
#goals-list .goal-card .card-item-info {
  flex: 1;
  min-width: 0;
}

/* Goal title — Fraunces cream */
#section-goals .goal-card .card-item-title,
#goals-list .goal-card .card-item-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--brand-cream);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 6px;
}

/* Card meta row */
#section-goals .goal-card .card-item-meta,
#goals-list .goal-card .card-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 11px;
  color: rgba(246,241,232,0.72);
}

/* Category badge — cream glass */
#section-goals .goal-card .goal-cat-badge,
#goals-list .goal-card .goal-cat-badge {
  background: rgba(246,241,232,0.16) !important;
  color: var(--brand-cream) !important;
  border: 1px solid rgba(246,241,232,0.26);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

/* Person tag on goal card */
#section-goals .goal-card .card-item-meta > span:not(.goal-cat-badge),
#goals-list .goal-card .card-item-meta > span:not(.goal-cat-badge) {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(246,241,232,0.60);
  background: rgba(246,241,232,0.10);
  border: 1px solid rgba(246,241,232,0.18);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ── Progress bar ────────────────────────────────────────────── */
#section-goals .goal-card .goal-progress-wrap,
#goals-list .goal-card .goal-progress-wrap {
  background: rgba(246,241,232,0.18);
  border-radius: 99px;
  height: 5px;
  overflow: hidden;
  margin-top: 10px;
}

#section-goals .goal-card .goal-progress-bar,
#goals-list .goal-card .goal-progress-bar {
  height: 100%;
  background: rgba(246,241,232,0.80);
  border-radius: 99px;
  transition: width 0.4s ease;
  min-width: 4px;
  box-shadow: 0 0 8px rgba(246,241,232,0.4);
}

/* Progress percentage text */
#section-goals .goal-card [style*="font-size:11px"],
#goals-list .goal-card [style*="font-size:11px"] {
  color: rgba(246,241,232,0.55) !important;
  font-size: 11px;
  margin-top: 5px;
}

/* ── Status pills ─────────────────────────────────────────────
   These are inline-generated but we can target the .goal-cat-badge
   used for status, or a future .goal-status-pill class.
   We handle status via g.status CSS vars if JS adds a class.      */

/* not-started */
#goals-list .goal-card .goal-status-pill,
#goals-list .goal-card [data-status="not-started"] {
  background: rgba(246,241,232,0.12);
  border: 1px solid rgba(246,241,232,0.22);
  color: rgba(246,241,232,0.75);
}

/* in-progress */
#goals-list .goal-card [data-status="in-progress"] {
  background: rgba(195,106,45,0.30);
  border: 1px solid rgba(195,106,45,0.50);
  color: var(--brand-cream);
}

/* done */
#goals-list .goal-card [data-status="done"] {
  background: rgba(35,74,55,0.45);
  border: 1px solid rgba(35,74,55,0.60);
  color: var(--brand-cream);
}

/* ── Done goals — desaturated ─────────────────────────────────── */
#section-goals .goal-card.goal-done,
#goals-list .goal-card.goal-done {
  filter: saturate(0.25) brightness(0.70);
  transform: none !important;
}

#section-goals .goal-card.goal-done .card-item-title,
#goals-list .goal-card.goal-done .card-item-title {
  opacity: 0.55;
  text-decoration: line-through;
}

#section-goals .goal-card.goal-done .goal-progress-bar,
#goals-list .goal-card.goal-done .goal-progress-bar {
  background: rgba(246,241,232,0.90);
}

/* ── Card actions (icons) ─────────────────────────────────────── */
#section-goals .goal-card .card-item-actions,
#goals-list .goal-card .card-item-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  flex-shrink: 0;
}

#section-goals .goal-card .btn-icon,
#goals-list .goal-card .btn-icon,
#section-goals .goal-card .reorder-btn,
#goals-list .goal-card .reorder-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: rgba(246,241,232,0.10);
  color: rgba(246,241,232,0.65);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

#section-goals .goal-card .btn-icon:hover,
#goals-list .goal-card .btn-icon:hover,
#section-goals .goal-card .reorder-btn:hover,
#goals-list .goal-card .reorder-btn:hover {
  background: rgba(246,241,232,0.22);
  color: var(--brand-cream);
}

#section-goals .goal-card .reorder-btn:disabled,
#goals-list .goal-card .reorder-btn:disabled {
  opacity: 0.20;
  cursor: default;
}

#section-goals .goal-card .idea-reorder-btns,
#goals-list .goal-card .idea-reorder-btns {
  display: flex;
  gap: 2px;
}

/* ── Empty state — Goals ──────────────────────────────────────── */
#goals-list .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 24px;
  text-align: center;
  gap: 12px;
  background: var(--brand-paper);
  border-radius: 20px;
  border: 1px solid var(--brand-line);
}

#goals-list .empty-state .empty-state-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 4px;
}

#goals-list .empty-state {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--brand-emerald);
  letter-spacing: -0.02em;
}

/* CTA button inside goals empty state */
#goals-list .empty-state .btn,
#goals-list .empty-state button {
  background: var(--brand-emerald);
  color: var(--brand-cream);
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(35,74,55,0.35);
  transition: background 0.18s, transform 0.15s;
}

#goals-list .empty-state .btn:hover,
#goals-list .empty-state button:hover {
  background: #2d6347;
  transform: translateY(-2px);
}

/* ── Lera Wisdom Goals block ─────────────────────────────────── */
#section-goals .lera-wisdom-block {
  margin-top: 36px;
}

#section-goals .lera-wisdom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

#section-goals .lera-wisdom-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--brand-ink);
  letter-spacing: -0.02em;
}

#section-goals .lera-wisdom-header .btn {
  background: var(--brand-paper);
  border: 1.5px solid var(--brand-line);
  color: var(--brand-ink-2);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

#section-goals .lera-wisdom-header .btn:hover {
  border-color: var(--brand-emerald);
  color: var(--brand-emerald);
}

/* ============================================================
   SHARED LUXURY LABEL / LABEL UTILITY
   ============================================================ */

.luxury-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.20em;
  color: var(--brand-mute);
}

/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */

/* ── Tablet (≤900px) ─────────────────────────────────────────── */
@media (max-width: 900px) {
  #section-todos .section-header,
  #section-goals .section-header {
    padding: 28px 24px 26px;
    border-radius: 20px;
  }

  #section-todos .section-header h1.section-title,
  #section-goals .section-header h1.section-title,
  #section-todos .section-header .section-title,
  #section-goals .section-header .section-title {
    font-size: 28px;
  }

  #section-todos .todo-item {
    padding: 14px 16px;
    gap: 12px;
  }

  #goals-list .goal-card .card-item-title {
    font-size: 16px;
  }
}

/* ── Mobile (≤640px) ─────────────────────────────────────────── */
@media (max-width: 640px) {
  #section-todos .section-header,
  #section-goals .section-header {
    padding: 22px 18px 20px;
    border-radius: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
  }

  #section-todos .section-header h1.section-title,
  #section-goals .section-header h1.section-title,
  #section-todos .section-header .section-title,
  #section-goals .section-header .section-title {
    font-size: 24px;
  }

  #section-todos .section-header .btn-primary,
  #section-goals .section-header .btn-primary,
  #section-todos .section-header button.btn,
  #section-goals .section-header button.btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 12px 20px;
  }

  #section-todos .combined-filters,
  #section-goals .combined-filters {
    gap: 6px;
    margin-bottom: 16px;
  }

  #section-todos .combined-filters .todo-filter,
  #section-goals .combined-filters .goal-period-btn,
  #section-goals .combined-filters .goal-person-btn {
    padding: 6px 12px;
    font-size: 11px;
  }

  #section-todos .todo-item {
    padding: 13px 14px;
    gap: 10px;
    border-radius: 12px;
  }

  #section-todos .todo-meta {
    gap: 4px;
    flex-wrap: wrap;
  }

  #section-todos .todo-text {
    font-size: 13px;
  }

  #goals-list {
    gap: 10px;
  }

  #goals-list .goal-card,
  #section-goals .goal-card {
    padding: 18px 16px 16px;
    border-radius: 16px;
  }

  #goals-list .goal-card .card-item-title {
    font-size: 15px;
  }

  #goals-list .goal-card .card-item-actions {
    gap: 2px;
  }

  /* Stack the reorder and action buttons on mobile */
  #goals-list .goal-card .idea-reorder-btns {
    flex-direction: row;
  }

  /* Filter sep hidden on very small screens */
  #section-todos .filter-sep,
  #section-goals .filter-sep {
    display: none;
  }

  /* Person select — full width on mobile */
  #section-todos #todos-person-select,
  #section-goals #goals-person-select {
    flex: 1;
    min-width: 120px;
  }

  #todo-list > li.empty-state {
    padding: 36px 16px;
    font-size: 18px;
  }

  #goals-list .empty-state {
    padding: 44px 16px;
    font-size: 18px;
  }
}

/* ── Wide screens (≥1400px) ─────────────────────────────────── */
@media (min-width: 1400px) {
  #section-todos .section-header,
  #section-goals .section-header {
    padding: 44px 40px 38px;
  }

  #section-todos .section-header h1.section-title,
  #section-goals .section-header h1.section-title {
    font-size: 42px;
  }
}


/* ===== DESIGN-V3: row-pattern overrides ===== */
#section-todos .todo-list,
#section-todos #todo-list {
  background: #ffffff !important;
  border: 1px solid rgba(20,25,40,0.07) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
  padding: 0 !important;
  list-style: none !important;
}
#section-todos .todo-item,
#section-todos li.todo-item {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid rgba(20,25,40,0.07) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 12px 14px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}
#section-todos .todo-item:last-child { border-bottom: none !important; }
#section-todos .todo-item::before { display: none !important; }
#section-todos .todo-item:hover { background: rgba(195,106,45,0.04) !important; }
#section-todos .todo-item.done { background: transparent !important; opacity: 0.7; }
#section-todos .todo-item.done .row-title,
#section-todos .todo-item.done .todo-text {
  text-decoration: line-through;
  color: #7c7a78;
}
/* ===== /DESIGN-V3 ===== */
