:root {
    --bg: #f7f6f3;
    --card: #ffffff;
    --border: #e4e1d8;
    --text: #1f1e1b;
    --text-muted: #6b6a63;
    --accent: #2f6f5e;
    --accent-light: #e4f1ec;
    --amber: #b6791a;
    --amber-light: #fbf0dd;
    --red: #b23b3b;
    --red-light: #fbe9e9;
    --gray-light: #f0efeb;
    --radius: 10px;
  }
  [data-theme="dark"] {
    --bg: #1b1a17;
    --card: #242320;
    --border: #37352f;
    --text: #eeece6;
    --text-muted: #a19e93;
    --accent: #5fae95;
    --accent-light: #223b32;
    --amber: #e0a941;
    --amber-light: #3a2e12;
    --red: #e06767;
    --red-light: #3a1f1f;
    --gray-light: #2c2b27;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
  }
  .app { max-width: 760px; margin: 0 auto; padding: 24px 20px 80px; }
  .topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
  .topbar h1 { font-size: 20px; font-weight: 600; margin: 0; }
  .topbar .sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
  .icon-btn {
    background: none; border: 1px solid var(--border); border-radius: 8px;
    padding: 6px 10px; cursor: pointer; color: var(--text); font-size: 13px;
  }
  .icon-btn:hover { background: var(--gray-light); }
  nav.tabs {
    display: flex; gap: 4px; overflow-x: auto; margin-bottom: 20px;
    border-bottom: 1px solid var(--border); padding-bottom: 0;
  }
  nav.tabs button {
    background: none; border: none; padding: 10px 12px; font-size: 13px;
    color: var(--text-muted); cursor: pointer; white-space: nowrap;
    border-bottom: 2px solid transparent; font-weight: 500;
  }
  nav.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
  .card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 20px; margin-bottom: 14px;
  }
  .card h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
  .card h3 { font-size: 13px; font-weight: 600; margin: 16px 0 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
  label { display: block; font-size: 12px; color: var(--text-muted); margin: 10px 0 4px; }
  input, textarea, select {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px;
    background: var(--bg); color: var(--text); font-size: 14px; font-family: inherit;
  }
  textarea { resize: vertical; min-height: 50px; }
  .row { display: flex; gap: 10px; }
  .row > * { flex: 1; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  button.primary {
    background: var(--accent); color: #fff; border: none; border-radius: 7px;
    padding: 9px 16px; font-size: 13px; font-weight: 500; cursor: pointer; margin-top: 12px;
  }
  button.primary:hover { opacity: 0.9; }
  button.secondary {
    background: none; border: 1px solid var(--border); border-radius: 7px;
    padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--text); margin-top: 12px;
  }
  button.secondary:hover { background: var(--gray-light); }
  .status-pill {
    display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500;
    padding: 3px 9px; border-radius: 20px;
  }
  .status-on_track { background: var(--accent-light); color: var(--accent); }
  .status-needs_attention { background: var(--amber-light); color: var(--amber); }
  .status-off_track { background: var(--red-light); color: var(--red); }
  .status-not_started { background: var(--gray-light); color: var(--text-muted); }
  .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
  .dot-on_track { background: var(--accent); }
  .dot-needs_attention { background: var(--amber); }
  .dot-off_track { background: var(--red); }
  .dot-not_started { background: var(--text-muted); }
  .category-block {
    border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
  }
  .category-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
  .category-head strong { font-size: 14px; }
  .goal-item, .expense-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px;
  }
  .goal-item:first-of-type, .expense-item:first-of-type { border-top: none; }
  .goal-item .left { display: flex; align-items: center; gap: 8px; flex: 1; }
  .goal-item input[type=checkbox] { width: auto; }
  .goal-item.completed .title { text-decoration: line-through; color: var(--text-muted); }
  .small-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px;
    padding: 2px 6px;
  }
  .small-btn:hover { color: var(--red); }
  .muted { color: var(--text-muted); font-size: 13px; }
  .empty { color: var(--text-muted); font-size: 13px; padding: 10px 0; text-align: center; }
  .budget-bar-track { background: var(--gray-light); border-radius: 6px; height: 8px; overflow: hidden; margin-top: 6px; }
  .budget-bar-fill { height: 100%; background: var(--accent); border-radius: 6px; }
  .budget-bar-fill.over { background: var(--red); }
  .priorities-list { list-style: none; padding: 0; margin: 0; }
  .priorities-list li {
    padding: 8px 10px; background: var(--gray-light); border-radius: 7px; margin-bottom: 6px; font-size: 13px;
  }
  .mood-row { display: flex; gap: 8px; margin: 6px 0 4px; }
  .mood-btn {
    flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
    font-size: 20px; cursor: pointer;
  }
  .mood-btn.selected { border-color: var(--accent); background: var(--accent-light); }
  .checkbox-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; }
  .checkbox-row input { width: auto; }
  .month-picker { font-size: 13px; color: var(--text-muted); }
  .quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
  .quick-actions button { flex: 1; min-width: 130px; }
  .note-list { font-size: 13px; }
  .note-list .note { padding: 6px 0; border-top: 1px solid var(--border); }
  .note-list .note:first-child { border-top: none; }
  .note-date { color: var(--text-muted); font-size: 11px; }
  select { cursor: pointer; }
  .month-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 14px; font-size: 15px; }
  .progress-card .progress-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--text-muted); }
  .progress-card .progress-head strong { font-size: 18px; color: var(--text); }
  .goal-item .status-pill { flex: none; }
