/* ============================================================
   Moneyis Tracker — styles.css
   Clarity Dashboard Design System
   Segoe UI · #eff6fc bg · #0078d4 accent · #1b1b1b text
   ============================================================ */

/* ── TOKENS ── */
:root {
  /* Brand / accent */
  --accent:         #0078d4;   /* Clarity blue */
  --accent-hover:   #006cbe;
  --accent-light:   #e8f3fb;
  --green:          #107c10;   /* MS-style green */
  --green-light:    #dff6dd;
  --green-dark:     #0a5e0a;
  --red:            #d13438;   /* MS-style red */
  --red-light:      #fde7e9;
  --gold:           #ca5010;
  --gold-light:     #fff4ce;
  --purple:         #7c4dff;
  --purple-light:   #f0f0ff;

  /* Clarity backgrounds */
  --bg:             #ffffff;
  --bg-app:         #eff6fc;   /* Exact Clarity page bg */
  --bg-subtle:      #f8f9fb;   /* Inner row bg (like user-stat) */
  --bg-muted:       #f3f4f6;
  --border:         #e8e8e8;   /* Clarity card border */
  --border-mid:     #d1d5db;
  --border-light:   #f0f0f0;   /* Clarity inner dividers */

  /* Clarity text */
  --text-head:      #1b1b1b;   /* Exact Clarity heading */
  --text-body:      #333333;
  --text-muted:     #555555;
  --text-faint:     #888888;
  --text-link:      #0078d4;

  /* Shadows — very subtle like Clarity */
  --shadow-sm:    0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 2px 8px rgba(0,0,0,.06);
  --shadow-lg:    0 8px 24px rgba(0,0,0,.08);
  --shadow-modal: 0 20px 40px rgba(0,0,0,.12);

  /* Radii */
  --r-card:   8px;
  --r-btn:    4px;
  --r-input:  4px;

  /* Font — Clarity uses Segoe UI */
  --font-display: 'Segoe UI', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:    'Segoe UI', 'Plus Jakarta Sans', system-ui, sans-serif;

  --trans: 140ms ease;
  --header-h: 56px;

  /* Navy kept for modal titles */
  --navy:       #1b1b1b;
  --navy-mid:   #2d2d2d;
  --blue:       #0078d4;
  --blue-light: #e8f3fb;
}

/* ── DARK MODE ── */
[data-theme="dark"] {
  --bg:           #1F2937;
  --bg-app:       #111827;
  --bg-subtle:    #1F2937;
  --bg-muted:     #374151;
  --border:       #374151;
  --border-mid:   #4B5563;
  --border-light: #2d3748;

  --text-head:    #F9FAFB;
  --text-body:    #D1D5DB;
  --text-muted:   #9CA3AF;
  --text-faint:   #6B7280;

  --accent-light: #1e3a5f;
  --purple-light: #1a1040;
  --green-light:  #0a2e0a;
  --red-light:    #2d0a0a;
  --gold-light:   #2d1800;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.3);
  --shadow-md:    0 4px 12px rgba(0,0,0,.3);
  --shadow-lg:    0 10px 40px rgba(0,0,0,.4);
}

/* ── RESET ── */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-body);
  background: var(--bg-app);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── CLARITY HEADER ── */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
}

/* LEFT: Brand */
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: 20px;
}

.brand-logo { font-size: 1.4rem; line-height: 1; }

.brand-text { display: flex; flex-direction: column; }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-head);
  letter-spacing: -.2px;
  line-height: 1.1;
}

[data-theme="dark"] .brand-name { color: #fff; }

.brand-tagline {
  font-size: .62rem;
  color: var(--text-faint);
  letter-spacing: .01em;
  white-space: nowrap;
}

/* CENTER: Nav — Clarity underline-tab style */
.header-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
  height: 100%;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: var(--text-faint);
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--trans);
  white-space: nowrap;
  height: 100%;
}

.nav-btn:hover { color: var(--text-body); background: #f8f8f8; }
[data-theme="dark"] .nav-btn:hover { background: var(--bg-muted); }

.nav-btn--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* RIGHT: Icon buttons — Clarity top-right style */
.header-icons {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-icon-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  background: none;
  border: none;
  border-radius: var(--r-btn);
  cursor: pointer;
  color: var(--text-faint);
  font-family: var(--font-body);
  font-size: .62rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--trans);
  white-space: nowrap;
}

.header-icon-btn:hover { background: var(--bg-muted); color: var(--text-head); }

.header-autosave {
  font-size: .72rem;
  color: var(--text-faint);
  padding: 0 8px;
  white-space: nowrap;
}

/* Settings Dropdown */
.dropdown-menu {
  position: fixed;
  top: calc(var(--header-h) + 4px);
  right: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  min-width: 210px;
  overflow: hidden;
  animation: dropdown-in .13s ease;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: block; width: 100%; padding: 10px 16px;
  text-align: left; font-family: var(--font-body); font-size: .84rem;
  color: var(--text-body); background: none; border: none; cursor: pointer;
  transition: background var(--trans); text-decoration: none;
}
.dropdown-item:hover { background: var(--bg-muted); }
.dropdown-item--field { cursor: default; }
.dropdown-item--field:hover { background: none; }

/* ── NL BANNER ── */
.nl-banner {
  background: #f0f4f8;
  border-bottom: 1px solid #d8e6f0;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text-muted);
}

[data-theme="dark"] .nl-banner {
  background: #1a2744;
  border-color: #2d4a7a;
  color: #93b8d8;
}

.nl-banner-text { flex: 1; min-width: 200px; text-align: center; }
.nl-banner-dismiss {
  background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-size: 1rem; line-height: 1; padding: 4px;
  opacity: .6; transition: opacity var(--trans);
}
.nl-banner-dismiss:hover { opacity: 1; }

/* ── OFFLINE BANNER ── */
.offline-banner {
  background: var(--gold-light); border-bottom: 1px solid #f0c060;
  padding: 8px 24px; text-align: center;
  font-size: .82rem; color: #5c3800;
}

/* ── MAIN LAYOUT ── */
main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px 60px;
  width: 100%;
}

/* ── DASHBOARD SECTIONS ── */
.dashboard-section { margin-bottom: 16px; }

/* ── METRIC CARDS — Clarity top-row style ── */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.metric-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px 18px 16px 22px;  /* extra left for the accent bar */
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--trans);
}

.metric-card:hover { box-shadow: var(--shadow-md); }

/* Left accent bar — single, intentional color signal */
.metric-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: var(--r-card) 0 0 var(--r-card);
}
.metric-card--income::before  { background: var(--green); }
.metric-card--expense::before { background: var(--red); }
.metric-card--balance::before { background: var(--accent); }

/* Icon pill — tinted, small, top-right */
.metric-card__icon {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}
.metric-card--income  .metric-card__icon { background: var(--green-light); }
.metric-card--expense .metric-card__icon { background: var(--red-light); }
.metric-card--balance .metric-card__icon { background: var(--accent-light); }

.metric-card__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-card__value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-head);
  line-height: 1.15;
  letter-spacing: -.5px;
  margin-bottom: 5px;
}

.metric-card__change {
  font-size: 12px;
  color: var(--text-faint);
  min-height: 16px;
}

.metric-card__change.positive { color: var(--green); }
.metric-card__change.negative { color: var(--red); }

/* Remove old top-border accent and bottom sparkline */
.metric-card__sparkline { display: none; }

/* ── 3-COLUMN GRID ── */
.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start; /* mobile default: natural height */
}

/* ── EQUAL CARD HEIGHTS: desktop & iPad only (≥769px) ── */
@media (min-width: 769px) {
  .grid-3col {
    align-items: stretch; /* override: all cells same height */
  }

  /* Cards must fill their grid cell fully */
  .grid-3col > .dash-card {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  /* All card body areas grow to fill remaining card height */
  .grid-3col > .dash-card > .chart-area,
  .grid-3col > .dash-card > .wallet-list,
  .grid-3col > .dash-card > .subscriptions-list,
  .grid-3col > .dash-card > #upcoming-bills-list,
  .grid-3col > .dash-card > .budget-progress,
  .grid-3col > .dash-card > .goals-list,
  .grid-3col > .dash-card > .networth-wrap,
  .grid-3col > .dash-card > .pace-wrap {
    flex: 1;
    min-height: 0;
  }
  /* cashflow-wrap is nested inside #upcoming-bills-list */
  .grid-3col > .dash-card > #upcoming-bills-list {
    display: flex;
    flex-direction: column;
  }
  .grid-3col > .dash-card > #upcoming-bills-list > .cashflow-wrap {
    flex: 1;
    min-height: 0;
  }
}

/* ── 2/3-COLUMN GRID ── */
.grid-1-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .grid-1-2 { grid-template-columns: 1fr; }
}

/* FORM TABS */
.form-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
}
.form-tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--trans);
}
.form-tab:hover { color: var(--text-head); background: var(--bg); }
.form-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg);
}
[data-theme="dark"] .form-tabs { background: var(--bg-muted); }
[data-theme="dark"] .form-tab--active { background: var(--bg); }

/* ── DASHBOARD CARDS — Clarity panel style ── */
.dash-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  transition: box-shadow var(--trans);
}

.dash-card:hover { box-shadow: var(--shadow-md); }

/* Card header — exact Clarity panel-header anatomy */
.dash-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border-light);
  gap: 8px;
}

.dash-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-head);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-card__sub {
  font-size: 11px;
  color: var(--text-faint);
}

/* Type badges */
.type-badge {
  font-size: .68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
}
.type-badge--income  { background: var(--green-light); color: var(--green-dark); }
.type-badge--expense { background: var(--red-light);   color: var(--red); }

/* ── MINI FORM (inside income/expense cards) ── */
.mini-form {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── FORM (edit modal) ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 8px 0;
}

.field--wide { grid-column: 1 / -1; }

/* ── FIELDS ── */
.field { display: flex; flex-direction: column; gap: 4px; }

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.required { color: var(--red); }

.field-input {
  background: var(--bg-subtle);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-input);
  padding: 7px 11px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-head);
  width: 100%;
  transition: border-color var(--trans), box-shadow var(--trans);
  appearance: none;
  -webkit-appearance: none;
  height: 34px;
}

.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,120,212,.12);
}

.field-input.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(209,52,56,.12);
}

.field-input::placeholder { color: var(--text-faint); }

[data-theme="dark"] .field-input {
  background: var(--bg-muted);
  color: var(--text-head);
  border-color: var(--border-mid);
}
[data-theme="dark"] .field-input:focus { border-color: var(--accent); }

.field-select { cursor: pointer; }

.field-error {
  font-size: 11px;
  color: var(--red);
  min-height: 14px;
}

/* Input prefix */
.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
  user-select: none;
}
.field-input--prefixed { padding-left: 26px; }

/* Radio group */
.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-label { cursor: pointer; }
.radio-label input { display: none; }
.radio-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 13px;
  font-size: .8rem; font-weight: 500;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-btn);
  background: var(--bg-subtle);
  color: var(--text-muted);
  transition: all var(--trans);
  white-space: nowrap;
}
.radio-label input:checked + .radio-btn {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* Recurring */
.recurring-label {
  flex-direction: row; align-items: center; gap: 8px;
  font-size: .82rem; cursor: pointer; text-transform: none;
  letter-spacing: 0; font-weight: 500; color: var(--text-body);
}
.recurrence-options { margin-top: 6px; }

/* Form actions */
.form-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px;
  padding-top: 16px; border-top: 1px solid var(--border);
}

/* Mini form bottom button */
.dash-card form { display: flex; flex-direction: column; }
.dash-card form .btn { margin: 0 18px 18px; width: calc(100% - 36px); border-radius: var(--r-btn); }

/* ── BUTTONS — Clarity style ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  padding: 6px 16px; border-radius: var(--r-btn); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: all var(--trans);
  white-space: nowrap; line-height: 1; min-height: 34px;
}
.btn:active { transform: scale(.97); }

/* Primary — Clarity blue */
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 2px 8px rgba(0,120,212,.25); }

/* Outline */
.btn--outline {
  background: var(--bg); color: var(--text-body);
  border-color: var(--border-mid);
}
.btn--outline:hover { border-color: var(--text-body); background: var(--bg-subtle); }
[data-theme="dark"] .btn--outline { color: var(--text-head); }
[data-theme="dark"] .btn--outline:hover { border-color: var(--text-head); background: var(--bg-muted); }

.btn--ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn--ghost:hover { color: var(--text-body); background: var(--bg-muted); }
.btn--danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn--danger:hover { background: #b02020; }
.btn--full { width: 100%; }
.btn--sm { padding: 5px 12px; font-size: .76rem; min-height: 28px; }

/* Income / Expense specific */
.btn--income { background: var(--green); color: #fff; border-color: var(--green); }
.btn--income:hover { background: var(--green-dark); box-shadow: 0 2px 8px rgba(16,124,16,.25); }
.btn--expense { background: var(--red); color: #fff; border-color: var(--red); }
.btn--expense:hover { background: #b02020; box-shadow: 0 2px 8px rgba(209,52,56,.2); }

/* ── CHARTS ── */
.chart-area {
  padding: 16px 18px 20px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chart-area--bar { min-height: 220px; }

.chart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 8px; width: 100%;
}
.chart-empty__icon { font-size: 2rem; }
.chart-empty__title { font-size: .88rem; font-weight: 600; color: var(--text-head); }
.chart-empty__body { font-size: .78rem; color: var(--text-muted); line-height: 1.5; }

.threshold-progress { width: 100%; margin-top: 8px; }
.threshold-bar { height: 5px; background: var(--bg-muted); border-radius: 99px; overflow: hidden; }
.threshold-bar__fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.threshold-label { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }

/* ── WALLET BALANCES ── */

/* ── SUBSCRIPTIONS LIST ── */
.subscriptions-list { padding: 10px 18px 14px; }

.sub-empty { text-align: center; padding: 24px 16px; }

.sub-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
}
.sub-item:last-child { border-bottom: none; }

.sub-icon {
  width: 34px; height: 34px;
  background: var(--purple-light); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
}

.sub-info { flex: 1; min-width: 0; }
.sub-name { font-size: .84rem; font-weight: 600; color: var(--text-head); }
.sub-meta { font-size: .72rem; color: var(--text-muted); }

.sub-amount {
  font-size: .88rem; font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}

.sub-badge {
  font-size: .65rem; font-weight: 700; padding: 2px 7px;
  border-radius: 99px;
  background: var(--red-light); color: var(--red);
}

/* ── CONTACT EMBED ── */
.contact-embed { padding: 18px; }
.contact-embed__text { font-size: .82rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 14px; }
.contact-embed__email {
  font-size: .85rem; background: var(--bg-muted);
  padding: 8px 12px; border-radius: 6px; margin-bottom: 14px;
  font-family: monospace; color: var(--text-body);
}
.contact-embed__actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.contact-embed__links { font-size: .72rem; color: var(--text-faint); }
.contact-embed__links a { color: var(--text-muted); text-decoration: underline; }
.contact-embed__links a:hover { color: var(--accent); }

/* ── TRANSACTION LIST ── */
.dash-card__header .list-controls {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}

.search-wrap {
  position: relative; display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 9px;
  color: var(--text-faint); pointer-events: none;
}
.search-input {
  background: var(--bg-subtle); border: 1px solid var(--border-mid);
  border-radius: var(--r-input); padding: 5px 30px 5px 28px;
  font-family: var(--font-body); font-size: .8rem; color: var(--text-head);
  width: 180px; height: 30px;
  transition: border-color var(--trans), width var(--trans);
}
.search-input:focus { outline: none; border-color: var(--accent); width: 220px; }
.search-kbd-hint {
  position: absolute; right: 8px;
  font-size: .65rem; color: var(--text-faint);
  background: var(--bg-muted); padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--border);
}

/* SEARCH CLEAR BUTTON FIX */
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: searchfield-cancel-button;
  cursor: pointer;
}

[data-theme="dark"] .search-input { background: var(--bg-muted); }

.filter-select {
  background: var(--bg-subtle); border: 1px solid var(--border-mid);
  border-radius: var(--r-input); padding: 0 8px;
  font-family: var(--font-body); font-size: .78rem; color: var(--text-body);
  height: 30px; cursor: pointer;
  transition: border-color var(--trans);
}
.filter-select:focus { outline: none; border-color: var(--accent); }
[data-theme="dark"] .filter-select { background: var(--bg-muted); color: var(--text-head); }

/* Empty state */
.empty-state {
  text-align: center; padding: 48px 24px;
}
.empty-state__icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state__title { font-size: 1rem; font-weight: 600; color: var(--text-head); margin-bottom: 6px; }
.empty-state__body { font-size: .82rem; color: var(--text-muted); line-height: 1.6; }

/* Transaction items */
.tx-date-group { }
.tx-date-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-faint);
  padding: 10px 18px 6px;
}
.tx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 18px;
  border-top: 1px solid var(--border-light);
  transition: background var(--trans);
}
.tx-item:hover { background: var(--bg-subtle); }
.tx-item.new-item { animation: tx-pop .3s cubic-bezier(.34,1.56,.64,1); }
@keyframes tx-pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.tx-cat-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
}
.tx-cat-icon--income  { background: var(--green-light); }
.tx-cat-icon--expense { background: var(--purple-light); }

.tx-info { flex: 1; min-width: 0; }
.tx-desc {
  font-size: .84rem; font-weight: 600;
  color: var(--text-head);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tx-cat { font-size: 11px; color: var(--text-muted); }
.tx-amount {
  font-size: .88rem; font-weight: 700; white-space: nowrap;
  min-width: 80px; text-align: right;
}
.tx-amount.income  { color: var(--green); }
.tx-amount.expense { color: var(--red); }

.tx-edit, .tx-delete {
  background: none; border: none; cursor: pointer;
  color: var(--text-faint); padding: 6px 4px;
  font-size: .9rem; border-radius: 4px;
  transition: all var(--trans); flex-shrink: 0;
}
.tx-edit:hover   { color: var(--accent); background: var(--accent-light); }
.tx-delete:hover { color: var(--red); background: var(--red-light); }

.tx-recurring-badge {
  display: inline-flex; align-items: center;
  font-size: .65rem; color: var(--text-muted); margin-left: 4px;
}
.tx-recurring-badge--auto {
  background: var(--bg-muted); border-radius: 4px; padding: 1px 5px; font-size: .62rem;
}

/* Performance warning */
.perf-warning {
  background: var(--gold-light); border-bottom: 1px solid #f0c060;
  padding: 8px 18px; font-size: .78rem; color: #5c3800;
}

/* ── BUDGET PROGRESS ── */
.budget-progress { padding: 14px 18px; }
.budget-empty { font-size: .82rem; color: var(--text-muted); padding: 8px 0; }
.btn-link { background: none; border: none; cursor: pointer; color: var(--accent); font-size: inherit; text-decoration: underline; }
.budget-row { margin-bottom: 14px; }
.budget-row:last-child { margin-bottom: 0; }
.budget-row__header { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; color: var(--text-body); }
.budget-row__amounts { font-weight: 600; }
.budget-row__amounts.over { color: var(--red); }
.budget-bar { height: 8px; background: var(--bg-muted); border-radius: 99px; overflow: hidden; }
.budget-bar__fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.budget-bar__fill.warn { background: var(--gold); }
.budget-bar__fill.over { background: var(--red); }
.budget-row__footer { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Budget modal */
.budget-fields { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.budget-field-row { display: flex; flex-direction: column; gap: 4px; }
.budget-field-label { font-size: .8rem; font-weight: 600; color: var(--text-body); }
.budget-input-prefix { font-size: .8rem; }

/* ── MODALS ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4); backdrop-filter: blur(3px);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fade-in .15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg); border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-modal); padding: 36px 32px;
  max-width: 440px; width: 100%; position: relative;
  animation: modal-up .2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modal-up { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

.modal-icon { font-size: 2.2rem; margin-bottom: 12px; }
.modal-title {
  font-size: 1.3rem; font-weight: 600;
  color: var(--text-head); letter-spacing: -.3px; margin-bottom: 10px;
}
[data-theme="dark"] .modal-title { color: #fff; }
.modal-body { font-size: .88rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 22px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--text-faint); padding: 6px;
  border-radius: 4px; transition: all var(--trans);
}
.modal-close:hover { color: var(--text-head); background: var(--bg-muted); }
.modal-skip {
  display: block; width: 100%; margin-top: 12px; padding: 8px;
  background: none; border: none; cursor: pointer;
  font-size: .8rem; color: var(--text-faint); text-align: center;
  transition: color var(--trans);
}
.modal-skip:hover { color: var(--text-muted); }
.modal-fine { font-size: .72rem; color: var(--text-faint); text-align: center; margin-top: 10px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-checklist {
  list-style: none; margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.modal-checklist li { font-size: .84rem; color: var(--text-body); }

/* Google Drive Modal */
.modal--drive { max-width: 500px; }
.drive-steps { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; }
.drive-step {
  display: flex; gap: 14px; align-items: flex-start;
  font-size: .84rem; color: var(--text-body); line-height: 1.6;
}
.drive-step code { background: var(--bg-muted); padding: 1px 5px; border-radius: 4px; font-size: .8em; }
.drive-step__num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .76rem; font-weight: 600; flex-shrink: 0; margin-top: 2px;
}
.drive-why {
  display: flex; align-items: center; gap: 10px;
  background: var(--accent-light); border-radius: 6px; padding: 10px 14px;
  margin-top: 4px;
}
[data-theme="dark"] .drive-why { background: rgba(0,120,212,.12); }
.drive-why__badge { font-size: .72rem; font-weight: 700; color: var(--accent); white-space: nowrap; }
.drive-why__text { font-size: .8rem; color: var(--text-body); line-height: 1.5; }

/* Newsletter form */
.newsletter-form { display: flex; flex-direction: column; gap: 10px; }
.nl-field { display: flex; flex-direction: column; gap: 4px; }
.nl-field input[type="email"] {
  background: var(--bg-subtle); border: 1px solid var(--border-mid);
  border-radius: var(--r-input); padding: 9px 13px;
  font-family: var(--font-body); font-size: .88rem; color: var(--text-head);
  width: 100%; transition: border-color var(--trans), box-shadow var(--trans);
}
.nl-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,120,212,.12); }
.nl-field input.invalid { border-color: var(--red); }
.nl-error { font-size: 11px; color: var(--red); min-height: 14px; }

/* Pro insights */
.insights-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.insight-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-subtle); border-radius: 6px; padding: 12px 14px;
}
.insight-icon { font-size: 1.3rem; flex-shrink: 0; }
.insight-desc { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }
.insights-lock-overlay { position: relative; }
.insights-lock-content {
  text-align: center; padding: 24px;
  background: linear-gradient(to bottom, rgba(249,250,251,0), var(--bg-subtle));
  border-radius: 8px; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.lock-icon { font-size: 2rem; }
.lock-desc { font-size: .82rem; color: var(--text-muted); }
.pro-nudge-box {
  background: var(--gold-light); border: 1px solid #f0c060;
  border-radius: 6px; padding: 12px 14px; font-size: .84rem;
  color: #5c3800; line-height: 1.6;
}

/* ── TOAST ── */
#toast-container {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 400; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.toast {
  background: #1b1b1b; color: #fff;
  padding: 10px 18px; border-radius: 6px;
  font-size: .82rem; font-weight: 500;
  box-shadow: var(--shadow-lg); max-width: 360px; text-align: center;
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast--fade { opacity: 0; transition: opacity .28s ease; }
.toast--success { border-left: 3px solid var(--green); }
.toast--error   { border-left: 3px solid var(--red); }
.toast--info    { border-left: 3px solid var(--accent); }
.toast--warn    { border-left: 3px solid var(--gold); }
.toast--undo { cursor: pointer; }
.toast-undo-btn {
  background: none; border: none; cursor: pointer;
  color: #93b8d8; font-weight: 700; text-decoration: underline; padding: 0 4px;
}
.toast-countdown { color: #888; font-size: .75rem; margin-left: 4px; }

/* ── ONBOARDING TOUR ── */
.tour-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  z-index: 250; pointer-events: none;
}
.tour-tooltip {
  position: fixed; z-index: 260; width: 320px;
  background: var(--bg); border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-modal); padding: 22px;
}
.tour-step-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.tour-title { font-size: 1rem; font-weight: 600; color: var(--text-head); margin-bottom: 8px; }
.tour-body { font-size: .84rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; }
.tour-actions { display: flex; justify-content: space-between; align-items: center; }
.tour-nav { display: flex; gap: 8px; }
.tour-dots { display: flex; gap: 6px; margin-top: 14px; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-mid); }
.tour-dot.active { background: var(--accent); }

/* ── PRO BANNER ── */
.pro-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #1b1b1b;
  color: #fff; padding: 12px 24px;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  font-size: .84rem; font-weight: 500; z-index: 80;
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
  border-top: 1px solid #333;
}

/* ── DEMO BANNER ── */
.demo-banner {
  background: var(--bg);
  border: 1px solid var(--gold);
  border-left: 4px solid var(--gold);
  border-radius: var(--r-card);
  padding: 12px 20px;
  font-size: .85rem;
  color: var(--text-head);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px 0; /* Adds spacing below it */
  box-shadow: var(--shadow-sm);
}
.demo-tooltip {
  position: absolute; top: -32px; left: 50%; transform: translateX(-50%);
  background: #1b1b1b; color: #fff; padding: 5px 10px;
  border-radius: 6px; font-size: .72rem; white-space: nowrap; z-index: 10;
}
.demo-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: #1b1b1b;
}

/* ── SMART NL CARD ── */
.smart-nl-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-card); box-shadow: var(--shadow-sm);
  padding: 14px 18px; margin-bottom: 16px;
}
.smart-nl-card__body {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; font-size: .84rem;
}
.smart-nl-card__icon { font-size: 1.3rem; flex-shrink: 0; }
.smart-nl-card__actions { display: flex; gap: 8px; }

/* Share milestone */
.share-milestone {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-card); box-shadow: var(--shadow-sm);
  padding: 14px 18px; margin-bottom: 16px;
}
.share-milestone__body { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; font-size: .84rem; }
.share-milestone__icon { font-size: 1.3rem; flex-shrink: 0; }
.share-milestone__sub { font-size: .78rem; color: var(--text-muted); display: block; }
.share-milestone__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-milestone--fade { opacity: 0; transition: opacity .28s; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .grid-3col { grid-template-columns: repeat(2, 1fr); }
  .metric-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .header-nav { display: none; }
  .grid-3col { grid-template-columns: 1fr; }
  .metric-cards { grid-template-columns: 1fr; gap: 10px; }
  main { padding: 12px 12px 80px; }
  .header-inner { padding: 0 16px; }
  .header-icons .header-icon-btn span { display: none; }
  .metric-card__value { font-size: 1.6rem; }
  .list-controls { gap: 4px; }
  .search-input { width: 140px; }
}

@media (max-width: 480px) {
  .modal { padding: 28px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

/* ── NL SHAKE ── */
@keyframes nl-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* ── GOAL TRACKING ── */
.goals-list { padding: 10px 18px 14px; }

.goal-empty {
  text-align: center; padding: 28px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.goal-empty__icon { font-size: 2rem; }
.goal-empty__text { font-size: .82rem; color: var(--text-muted); }

.goal-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.goal-item:last-child { border-bottom: none; }
.goal-item--done { opacity: .75; }

.goal-item__header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}

.goal-emoji { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }

.goal-meta { flex: 1; min-width: 0; }
.goal-name {
  font-size: .88rem; font-weight: 600; color: var(--text-head);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.goal-amounts {
  font-size: .76rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px;
}
.goal-sep { opacity: .5; }

.goal-deadline {
  font-size: .68rem; font-weight: 700; padding: 1px 7px;
  border-radius: 99px; background: var(--accent-light); color: var(--accent);
}
.goal-deadline--urgent { background: var(--gold-light); color: #5c3800; }
.goal-deadline--overdue { background: var(--red-light); color: var(--red); }

.goal-actions-inline { display: flex; gap: 4px; flex-shrink: 0; }

.goal-add-btn, .goal-edit-btn, .goal-delete-btn {
  background: none; border: 1px solid var(--border-mid);
  border-radius: 4px; cursor: pointer;
  font-size: .8rem; padding: 3px 8px; color: var(--text-muted);
  transition: all var(--trans); line-height: 1;
}
.goal-add-btn { font-weight: 700; font-size: .9rem; }
.goal-add-btn:hover    { background: var(--green-light); color: var(--green-dark); border-color: var(--green); }
.goal-edit-btn:hover   { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.goal-delete-btn:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

.goal-bar-wrap { display: flex; align-items: center; gap: 10px; }
.goal-bar {
  flex: 1; height: 8px;
  background: var(--bg-muted); border-radius: 99px; overflow: hidden;
}
.goal-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.goal-bar__fill--done { background: var(--green); }
.goal-pct {
  font-size: .72rem; font-weight: 700; color: var(--text-muted);
  min-width: 32px; text-align: right;
}

.goal-remain { font-size: .74rem; color: var(--text-faint); margin-top: 4px; }
.goal-remain--done { color: var(--green); font-weight: 600; }

/* Goal modal tweaks */
#goal-emoji-input { text-align: center; }

/* Pro modal close always above lock overlay */
#pro-modal .modal-close { z-index: 10; position: absolute; }
.insights-lock-overlay { position: relative; z-index: 1; pointer-events: auto; }

/* ══════════════════════════════════════════
   CLARITY SUPPLEMENTAL — additions & fixes
   ══════════════════════════════════════════ */

/* ── WALLET BALANCES card body ── */
.wallet-list {
  padding: 12px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wallet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
}
.wallet-item:last-child { border-bottom: none; }

.wallet-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
}

.wallet-info { flex: 1; min-width: 0; }
.wallet-name  { font-size: .84rem; font-weight: 600; color: var(--text-head); }
.wallet-label { font-size: 11px; color: var(--text-muted); }

.wallet-amount {
  font-size: .88rem; font-weight: 700;
  color: var(--text-head); white-space: nowrap;
}
.wallet-amount.positive { color: var(--green); }
.wallet-amount.negative { color: var(--red); }

/* ── NL Banner — Clarity filter-bar style ── */
.nl-banner .btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  font-size: .78rem;
  padding: 5px 14px;
  min-height: 28px;
}

/* ── Clarity info-icon (ⓘ) helper ── */
.info-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: #e0e0e0; color: #666;
  font-size: 9px; font-weight: 700; cursor: help;
  flex-shrink: 0; vertical-align: middle;
}

/* ── Clarity-style panel action "⋯" menu button ── */
.card-menu-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-size: 16px;
  padding: 2px 6px; border-radius: 4px;
  transition: all var(--trans); line-height: 1;
}
.card-menu-btn:hover { background: var(--bg-muted); color: var(--text-body); }

/* ── Clarity session/insight row (inside cards) ── */
.card-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: var(--bg-subtle);
  font-size: 13px;
}
.card-row__icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
}
.card-row__icon--green  { background: var(--green-light); }
.card-row__icon--blue   { background: var(--accent-light); }
.card-row__icon--purple { background: var(--purple-light); }
.card-row__icon--gold   { background: var(--gold-light); }
.card-row__label { flex: 1; font-weight: 500; color: var(--text-body); }
.card-row__value { font-weight: 700; color: var(--text-head); }

/* ── Clarity-style stacked progress bar ── */
.clarity-bar {
  height: 8px; border-radius: 99px;
  background: var(--bg-muted); overflow: hidden;
  margin: 8px 0 4px;
}
.clarity-bar__fill {
  height: 100%; border-radius: 99px;
  transition: width .4s ease;
}
.clarity-bar__fill--green  { background: var(--green); }
.clarity-bar__fill--blue   { background: var(--accent); }
.clarity-bar__fill--red    { background: var(--red); }
.clarity-bar__fill--gold   { background: var(--gold); }

/* ── Transaction list date-group divider label ── */
.tx-date-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint);
  padding: 10px 18px 5px;
  background: var(--bg-app);
}

/* metric-card top-border accent removed — left bar via ::before now handles color identity */

/* ── Dark mode adjustments for Clarity tokens ── */
[data-theme="dark"] .tx-date-label { background: var(--bg-app); }
[data-theme="dark"] .dash-card__title { color: var(--text-head); }
[data-theme="dark"] .metric-card__label { color: var(--text-muted); }
[data-theme="dark"] .card-row { background: var(--bg-muted); }
[data-theme="dark"] .info-icon { background: #374151; color: var(--text-muted); }

/* Metric card icon pill — dark mode tints */
[data-theme="dark"] .metric-card--income  .metric-card__icon { background: var(--green-light); }
[data-theme="dark"] .metric-card--expense .metric-card__icon { background: var(--red-light); }
[data-theme="dark"] .metric-card--balance .metric-card__icon { background: var(--accent-light); }

/* Net worth & pace dark mode */
[data-theme="dark"] .networth-headline  { background: var(--bg-muted); border-color: var(--border-mid); }
[data-theme="dark"] .networth-item      { border-color: var(--border); }
[data-theme="dark"] .networth-add-btn   { border-color: var(--border-mid); color: var(--text-faint); }
[data-theme="dark"] .pace-stat          { background: var(--bg-muted); border-color: var(--border); }
[data-theme="dark"] .cashflow-balance-row { background: var(--bg-muted); border-color: var(--border-mid); }
[data-theme="dark"] .cashflow-result    { background: var(--bg-muted); border-color: var(--border-mid); }

/* ── Clarity header divider (between brand and nav) ── */
.header-divider {
  width: 1px; height: 24px;
  background: var(--border-mid);
  margin: 0 8px;
  flex-shrink: 0;
}

/* ── Empty sub-card state — Clarity centered style ── */
.sub-empty {
  text-align: center;
  padding: 24px 16px;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
}
.sub-empty .chart-empty__icon { font-size: 1.8rem; }
.sub-empty .chart-empty__body {
  font-size: .78rem; color: var(--text-muted); line-height: 1.5;
}

/* ── Goal tracking modal ── */
#goal-emoji-input { text-align: center; }

/* ── Focus ring uses Clarity blue ── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Form submit check icon ── */
.submit-check { display: none; }

/* ── Dropdown item: settings currency ── */
#settings-currency.filter-select {
  height: 32px; font-size: .8rem;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* ── CASH FLOW PROJECTION ── */
.cashflow-wrap {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Starting balance input row */
.cashflow-balance-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
}

.cashflow-balance-row label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.cashflow-balance-input {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-head);
  min-width: 0;
  outline: none;
}

.cashflow-balance-input:focus { color: var(--accent); }

/* Timeline track */
.cashflow-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.cashflow-timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-light);
  border-radius: 2px;
}

.cashflow-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 7px 0;
  position: relative;
}

.cashflow-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-mid);
  margin-top: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  margin-left: 11px;
}

.cashflow-dot--due    { background: var(--red); }
.cashflow-dot--today  { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.cashflow-dot--28     { background: var(--green); box-shadow: 0 0 0 3px var(--green-light); }

.cashflow-info {
  flex: 1;
  min-width: 0;
}

.cashflow-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-head);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cashflow-date {
  font-size: .7rem;
  color: var(--text-faint);
  margin-top: 1px;
}

.cashflow-amount {
  font-size: .84rem;
  font-weight: 700;
  white-space: nowrap;
}

.cashflow-amount--debit  { color: var(--red); }
.cashflow-amount--credit { color: var(--green); }

/* Projected balance callout */
.cashflow-result {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cashflow-result__label {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cashflow-result__amount {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green);
}

.cashflow-result__amount--negative { color: var(--red); }

.cashflow-empty {
  text-align: center;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cashflow-empty__icon { font-size: 1.8rem; }
.cashflow-empty__body { font-size: .78rem; color: var(--text-muted); line-height: 1.5; }

[data-theme="dark"] .cashflow-balance-row { background: var(--bg-muted); }
[data-theme="dark"] .cashflow-balance-input { color: var(--text-head); }
[data-theme="dark"] .cashflow-result { background: var(--bg-muted); }

/* ── NET WORTH CARD ── */
.networth-wrap {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.networth-headline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.networth-headline__amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-head);
  letter-spacing: -.5px;
  line-height: 1;
}

.networth-headline__amount--negative { color: var(--red); }

.networth-headline__label {
  font-size: .72rem;
  color: var(--text-faint);
  font-weight: 500;
}

.networth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1; /* pushes .networth-add-row to the bottom of the card */
  align-content: start;
}

.networth-col__label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}

.networth-col--assets   .networth-col__label { color: var(--green); }
.networth-col--debts    .networth-col__label { color: var(--red); }

.networth-col__total {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text-head);
  margin-bottom: 6px;
}

.networth-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  color: var(--text-muted);
  padding: 3px 0;
  border-bottom: 1px solid var(--border-light);
}

.networth-item:last-child { border-bottom: none; }
.networth-item__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 6px; }
.networth-item__val  { font-weight: 600; color: var(--text-body); white-space: nowrap; }

.networth-add-row {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.networth-add-btn {
  flex: 1;
  font-size: .73rem;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 4px;
  border: 1px dashed var(--border-mid);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: all var(--trans);
  text-align: center;
}

.networth-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ── SPENDING PACE CARD ── */
.pace-wrap {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pace-headline {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.pace-headline__pct {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1;
}

.pace-headline__pct--ok       { color: var(--green); }
.pace-headline__pct--warn     { color: var(--gold); }
.pace-headline__pct--over     { color: var(--red); }

.pace-headline__sub {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Double-bar track: day progress vs spend progress */
.pace-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pace-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pace-bar-row__label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  width: 32px;
  flex-shrink: 0;
  text-align: right;
}

.pace-bar {
  flex: 1;
  height: 7px;
  border-radius: 99px;
  background: var(--bg-muted);
  overflow: hidden;
  position: relative;
}

.pace-bar__fill {
  height: 100%;
  border-radius: 99px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

.pace-bar__fill--day   { background: var(--border-mid); }
.pace-bar__fill--ok    { background: var(--green); }
.pace-bar__fill--warn  { background: var(--gold); }
.pace-bar__fill--over  { background: var(--red); }

.pace-bar-row__val {
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
  text-align: left;
}

.pace-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pace-stat {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 8px 10px;
}

.pace-stat__label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  margin-bottom: 2px;
}

.pace-stat__val {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-head);
}

.pace-verdict {
  font-size: .78rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-left: 3px solid var(--border-mid);
  padding-left: 10px;
  margin-top: auto; /* pins verdict to the card bottom */
}

.pace-verdict--ok   { border-left-color: var(--green); }
.pace-verdict--warn { border-left-color: var(--gold); }
.pace-verdict--over { border-left-color: var(--red); }
