/* Settings-specific component styles. Tokens (:root vars, reset, .app
   shell) live in shared/tokens.css — this file only holds markup that's
   genuinely specific to this app, per the brief's design-system split.
   Header/person-picker chrome duplicated verbatim from Inventory's copy,
   same "own copy per Pages project" convention as everywhere else. */

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(243,236,225,0.92);
  backdrop-filter: blur(8px);
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.wordmark {
  display: flex; align-items: center; gap: 8px;
  font-size: 22px; letter-spacing: 0.2px;
  margin: 0 0 4px;
  text-decoration: none;
}
.wordmark .underline { position: relative; }
.wordmark .underline::after {
  content: ""; position: absolute; left: 2px; right: -4px; bottom: -4px;
  height: 6px; background: var(--timber); opacity: 0.28;
  border-radius: var(--r-pill); transform: rotate(-0.6deg);
}
.header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.subtitle { font-size: 12.5px; color: var(--ink-soft); margin: 0; }

main { padding: 20px; display: flex; flex-direction: column; gap: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { font-size: 17px; margin: 0; }
.count { font-size: 12px; color: var(--ink-soft); }

.empty-state { border: 1.5px dashed var(--border); border-radius: var(--r-md); padding: 22px 16px; text-align: center; color: var(--ink-soft); }
.empty-state .headline { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.empty-state .sub { font-size: 12.5px; }

.btn-primary { background: var(--timber); color: #fff; border: none; border-radius: var(--r-pill); padding: 12px 20px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--timber-dark); }
.modal-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cream-card); color: var(--timber); border: 1.5px solid var(--timber);
  border-radius: var(--r-pill); padding: 10px 18px; font-weight: 600; font-size: 13.5px;
  text-decoration: none; cursor: pointer;
}
.modal-secondary:hover { background: var(--timber-tint); }

/* ---------- Person picker ---------- */
.person-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--cream-card); display: flex; align-items: center; justify-content: center; color: var(--timber);
}
.person-sheet {
  position: fixed; inset: 0; background: rgba(58,46,36,0.35); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.person-sheet[hidden] { display: none; }
.person-sheet .panel {
  background: var(--cream-card); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 20px;
  width: 100%; max-width: 480px; box-shadow: var(--shadow-lg);
}
.person-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.person-option {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: var(--cream-bg); text-align: left;
}
.person-option.selected { border-color: var(--timber); background: var(--timber-tint); }
.person-option .avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; }

/* ---------- Generic card ---------- */
.settings-card {
  background: var(--cream-card); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px; box-shadow: var(--shadow-sm);
}
.settings-card-sub { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 12px; }

/* ---------- Recently Deleted ---------- */
.deleted-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--cream-card); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 14px; margin-bottom: 8px;
}
.deleted-row-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.deleted-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); font-weight: 700; }
.deleted-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deleted-when { font-size: 11px; color: var(--ink-soft); }
.deleted-actions { display: flex; gap: 6px; flex: none; }
.deleted-actions button {
  border: 1.5px solid var(--border); background: var(--cream-bg); border-radius: var(--r-pill);
  padding: 6px 12px; font-size: 11.5px; font-weight: 600; color: var(--ink-soft);
}
.deleted-actions .restore-btn { border-color: var(--timber); color: var(--timber); }
.deleted-actions .restore-btn:hover { background: var(--timber-tint); }
.deleted-actions .purge-btn:hover { border-color: var(--cat-terracotta); color: var(--cat-terracotta); }

/* ---------- Spend dashboard ---------- */
.spend-totals { display: flex; gap: 18px; margin-bottom: 14px; }
.spend-totals .stat { display: flex; flex-direction: column; }
.spend-totals .stat .num { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.spend-totals .stat .label { font-size: 11px; color: var(--ink-soft); }
.spend-table { width: 100%; border-collapse: collapse; }
.spend-table th, .spend-table td { text-align: left; padding: 7px 6px; font-size: 12.5px; border-bottom: 1px solid var(--border); }
.spend-table th { color: var(--ink-soft); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- People / appearance + quiet hours ---------- */
.person-settings-card {
  background: var(--cream-card); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.person-settings-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.person-settings-head .avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--cream-bg); color: var(--timber); }
.person-settings-head .name { font-family: var(--font-display); font-weight: 700; font-size: 15px; }

.swatch-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.icon-swatch {
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--cream-bg); display: flex; align-items: center; justify-content: center; color: var(--timber);
}
.icon-swatch.selected { border-color: var(--timber); background: var(--timber-tint); }
.theme-swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
}
.theme-swatch.selected { border-color: var(--ink); }
.theme-swatch.timber { background: #8B5A3C; }
.theme-swatch.sage { background: #8A9A5B; }
.theme-swatch.terracotta { background: #C1683C; }
.theme-swatch.ochre { background: #C0923C; }
.theme-swatch.blue { background: #6E8CA0; }
.theme-swatch.plum { background: #8C6B8A; }

.quiet-hours-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.quiet-hours-row label { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.quiet-hours-row input[type="time"] {
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 8px;
  font-family: var(--font-body); font-size: 13px; background: var(--cream-bg); color: var(--ink);
}
.digest-toggle-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12.5px; color: var(--ink-soft); }

.switch { position: relative; width: 40px; height: 22px; border-radius: var(--r-pill); border: none; background: var(--border); padding: 0; flex: none; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform var(--fast) var(--ease); box-shadow: var(--shadow-sm); }
.switch.on { background: var(--timber); }
.switch.on .knob { transform: translateX(18px); }

.person-save-row { display: flex; align-items: center; gap: 10px; }
.save-status { font-size: 11.5px; color: var(--ink-soft); }

/* ---------- Notification bell (step 9) ----------
   Duplicated verbatim from the other three apps' app.css, same
   convention as the JS module behind it. */
.header-actions { display: flex; align-items: center; gap: 8px; }

.notif-btn {
  position: relative;
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--cream-card); display: flex; align-items: center; justify-content: center;
  color: var(--timber); cursor: pointer;
}
.notif-badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: var(--r-pill); background: var(--cat-terracotta); color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 300px; max-height: 380px;
  overflow-y: auto; background: var(--cream-card); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); z-index: 60; padding: 4px 0;
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.notif-panel-head .link { font-size: 11.5px; text-transform: none; letter-spacing: 0; font-weight: 600; background: none; border: none; color: var(--timber); }
.notif-empty { padding: 16px 14px; font-size: 12.5px; color: var(--ink-soft); text-align: center; }
.notif-row { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.notif-row-body { flex: 1; }
.notif-title { font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.notif-body { font-size: 12px; color: var(--ink-soft); margin: 0 0 2px; }
.notif-when { font-size: 10.5px; color: var(--ink-soft); margin: 0; opacity: 0.8; }
.notif-dismiss { border: none; background: transparent; color: var(--ink-soft); font-size: 11px; cursor: pointer; padding: 2px 4px; border-radius: 50%; }
.notif-dismiss:hover { background: var(--timber-tint); color: var(--timber); }
