/* ─── Tokens ─────────────────────────────────────────────────────────── */
:root {
  --ink:       #1a1a2e;
  --ink-soft:  #4a4a6a;
  --ink-faint: #8888aa;
  --bg:        #f8f7f4;
  --surface:   #ffffff;
  --border:    #e4e2dc;
  --accent:    #2d6a4f;
  --accent-lt: #d8f3dc;
  --gold:      #b5843a;
  --gold-lt:   #fdf3e3;
  --danger:    #c0392b;
  --radius:    10px;
  --shadow:    0 2px 16px rgba(26,26,46,.08);
}

/* ─── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ─── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.4rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.5px;
}
.nav-brand span { color: var(--accent); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: .9rem;
  font-weight: 500;
}
.nav-links a { color: var(--ink-soft); text-decoration: none; transition: color .15s; }
.nav-links a:hover { color: var(--accent); }
.nav-avatar {
  width: 32px; height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
}
.nav-with-badge { display: inline-flex; align-items: center; gap: .35rem; }

/* Avatar circles get their bg color from inline style, but text stays white
   regardless of which palette color is picked. */
.nav-avatar, .skill-avatar, .profile-avatar-lg { color: #fff; }

/* Color picker swatches — used on register and own-profile */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-top: .75rem;
}
.color-picker-label {
  font-size: .82rem;
  color: var(--ink-soft);
  font-weight: 600;
  margin-right: .2rem;
}
.swatch-btn {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform .1s, border-color .15s;
}
.swatch-btn:hover { transform: scale(1.12); }
.swatch-active { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

/* Radio-based swatch on the register form: hide the radio, style the span */
.swatch-radio { display: inline-flex; cursor: pointer; }
.swatch-radio input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.swatch-radio:has(input:checked) .swatch-btn {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px #fff inset;
}
.color-picker-register { margin-top: 0; }

.profile-actions { margin-bottom: .5rem; }

.nav-badge {
  background: #1d4ed8;
  color: #fff;
  border-radius: 99px;
  padding: .05rem .45rem;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.4;
  min-width: 1.1rem;
  text-align: center;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--accent);
  color: #fff;
  padding: .55rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  transition: background .15s, transform .1s;
  text-decoration: none;
}
.btn-primary:hover { background: #245c42; color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--ink-soft);
  padding: .55rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: .9rem;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color .15s;
  text-decoration: none;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; text-align: center; }
.btn-match {
  width: 100%;
  background: var(--gold-lt);
  color: var(--gold);
  border: 1.5px solid #e8c97a;
  border-radius: var(--radius);
  padding: .45rem .9rem;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-match:hover { background: #fdecc8; }
.btn-match-sm {
  background: var(--gold-lt);
  color: var(--gold);
  border: 1.5px solid #e8c97a;
  border-radius: 6px;
  padding: .25rem .65rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-delete {
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: .9rem;
  padding: .1rem .3rem;
  border-radius: 4px;
}
.btn-delete:hover { color: var(--danger); background: #fdecea; }
.btn-accept {
  background: var(--accent-lt);
  color: var(--accent);
  border: 1.5px solid #74c69d;
  border-radius: 6px;
  padding: .35rem .8rem;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
}
.btn-decline {
  background: #fdecea;
  color: var(--danger);
  border: 1.5px solid #f5c6c3;
  border-radius: 6px;
  padding: .35rem .8rem;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
}

/* ─── Flash messages ─────────────────────────────────────────────────── */
.flash-container { max-width: 800px; margin: 1rem auto 0; padding: 0 1.5rem; }
.flash {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: .5rem;
}
.flash-success { background: var(--accent-lt); color: #1b4332; border: 1px solid #74c69d; }
.flash-error   { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c3; }

/* ─── Main ───────────────────────────────────────────────────────────── */
main { flex: 1; }

/* ─── Hero ───────────────────────────────────────────────────────────── */
.hero {
  max-width: 680px;
  margin: 5rem auto 3rem;
  padding: 0 1.5rem;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  background: var(--accent-lt);
  color: var(--accent);
  border-radius: 99px;
  padding: .3rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.hero-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -.5px;
  color: var(--ink);
  margin-bottom: 1.1rem;
}
.hero-title em { color: var(--accent); font-style: normal; }
.hero-sub {
  font-size: 1.1rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2rem; }
.hero-tags { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.tag {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .3rem .85rem;
  font-size: .82rem;
  color: var(--ink-soft);
}

/* ─── Features ───────────────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.feature-card p { color: var(--ink-soft); font-size: .9rem; line-height: 1.6; }

/* ─── Auth ───────────────────────────────────────────────────────────── */
.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 3rem 1.5rem;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}
.auth-card h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
  margin-bottom: .25rem;
}
.auth-sub { color: var(--ink-soft); font-size: .9rem; margin-bottom: 1.75rem; }
.auth-switch { text-align: center; font-size: .88rem; color: var(--ink-soft); margin-top: 1.25rem; }

/* ─── Forms ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: .4rem;
}
.optional { font-weight: 400; color: var(--ink-faint); }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .9rem;
  font-size: .95rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  transition: border-color .15s;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); background: #fff; }

.type-toggle { display: flex; gap: .75rem; flex-wrap: wrap; }
.type-option {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem 1rem;
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: border-color .15s, background .15s;
}
.type-option input[type=radio] { accent-color: var(--accent); }
.type-option:has(input:checked) { border-color: var(--accent); background: var(--accent-lt); }

/* ─── Feed ───────────────────────────────────────────────────────────── */
.feed-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  align-items: start;
}
@media (max-width: 760px) { .feed-layout { grid-template-columns: 1fr; } }

.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 70px;
}
.sidebar h3 { font-size: .95rem; margin-bottom: 1rem; color: var(--ink); }
.want-list { list-style: none; display: flex; flex-direction: column; gap: .75rem; }
.want-list li { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; }
.want-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.want-list p { color: var(--ink-soft); font-size: .82rem; margin-top: .15rem; }

.feed-header { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.feed-header h2 { font-family: 'DM Serif Display', serif; font-size: 1.6rem; }
.search-form { display: flex; gap: .5rem; }
.search-form input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .55rem .9rem;
  font-size: .9rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
}
.search-form input:focus { outline: none; border-color: var(--accent); }
.filter-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .55rem .75rem;
  font-size: .88rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--accent); }

.feed-count {
  font-size: .85rem;
  color: var(--ink-faint);
  margin-bottom: .85rem;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .75rem;
  margin: 2rem 0 1rem;
}
.pager-info { font-size: .85rem; color: var(--ink-soft); }
.pager-disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

.ai-badge {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: .6rem 1rem;
  font-size: .85rem;
  color: #3730a3;
  margin-bottom: 1rem;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.skill-card:hover { box-shadow: 0 4px 24px rgba(26,26,46,.12); transform: translateY(-2px); }
.skill-card-top { display: flex; align-items: center; gap: .7rem; margin-bottom: .85rem; }
.skill-avatar {
  width: 34px; height: 34px;
  background: var(--accent-lt);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.skill-user { font-weight: 600; font-size: .9rem; color: var(--ink); }
.skill-school { display: block; font-size: .78rem; color: var(--ink-faint); }
.skill-name { font-size: 1.05rem; font-weight: 700; margin-bottom: .4rem; }
.skill-desc { font-size: .85rem; color: var(--ink-soft); line-height: 1.5; }

/* ─── Profile ────────────────────────────────────────────────────────── */
.profile-wrap { max-width: 860px; margin: 2.5rem auto; padding: 0 1.5rem; }
.profile-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow);
}
.profile-avatar-lg {
  width: 68px; height: 68px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-meta h2 { font-family: 'DM Serif Display', serif; font-size: 1.75rem; margin-bottom: .25rem; }
.profile-school { color: var(--ink-soft); font-size: .9rem; margin-bottom: .5rem; }
.profile-bio { color: var(--ink-soft); font-size: .9rem; line-height: 1.6; margin-bottom: .75rem; }

.profile-skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 640px) { .profile-skills-grid { grid-template-columns: 1fr; } }

.col-label {
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: .85rem;
}
.teach-label { color: var(--accent); }
.learn-label { color: var(--gold); }

.profile-skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: .75rem;
  box-shadow: var(--shadow);
}
.learn-card { border-color: #f0e0c0; background: var(--gold-lt); }
.profile-skill-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .3rem; }

/* ─── Matches ────────────────────────────────────────────────────────── */
.matches-wrap { max-width: 760px; margin: 2.5rem auto; padding: 0 1.5rem; }
.matches-wrap h2 { font-family: 'DM Serif Display', serif; font-size: 1.75rem; margin-bottom: 2rem; }
.match-section { margin-bottom: 2.5rem; }
.match-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.incoming-title { color: #1d4ed8; }
.accepted-title { color: var(--accent); }
.outgoing-title { color: var(--gold); }

.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow);
}
.incoming-card { border-color: #bfdbfe; }
.accepted-card { border-color: #6ee7b7; }
.match-info { flex: 1; }
.match-user { font-weight: 700; font-size: .95rem; }
.match-school { color: var(--ink-faint); font-size: .8rem; display: block; }
.match-info p { font-size: .88rem; color: var(--ink-soft); margin-top: .3rem; }
.match-actions { display: flex; gap: .5rem; flex-shrink: 0; }

.badge-count {
  background: #1d4ed8;
  color: #fff;
  border-radius: 99px;
  padding: .1rem .55rem;
  font-size: .75rem;
  font-weight: 700;
}
.badge-pending  { background: var(--gold-lt);  color: var(--gold);   border-radius: 6px; padding: .25rem .65rem; font-size: .8rem; font-weight: 600; }
.badge-accepted { background: var(--accent-lt); color: var(--accent); border-radius: 6px; padding: .25rem .65rem; font-size: .8rem; font-weight: 600; }
.badge-declined { background: #fdecea; color: var(--danger); border-radius: 6px; padding: .25rem .65rem; font-size: .8rem; font-weight: 600; }
.badge-connected { background: var(--accent-lt); color: var(--accent); border-radius: 6px; padding: .35rem .85rem; font-size: .85rem; font-weight: 700; }

/* ─── Misc ───────────────────────────────────────────────────────────── */
.empty-hint { font-size: .88rem; color: var(--ink-faint); font-style: italic; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); }
.empty-state p { margin-bottom: 1rem; }

.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .8rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* ═══════════════════════════════════════════════════════
   PHASE 2 — BUDGET BUDDY
   ═══════════════════════════════════════════════════════ */

.budget-wrap { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }

.budget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.budget-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
}
.budget-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.month-picker { margin: 0; }
.month-picker .filter-select { padding: .5rem .75rem; font-size: .85rem; }

.month-label {
  font-size: .9rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}
.month-label a { font-size: .85rem; }

.anomaly-block {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: .9rem;
  line-height: 1.7;
}
.anomaly-title { font-weight: 700; margin-bottom: .4rem; color: #92400e; }

.budget-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
@media (max-width: 600px) { .budget-summary { grid-template-columns: 1fr; } }

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.summary-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-faint); }
.summary-amount { font-family: 'DM Serif Display', serif; font-size: 2rem; }
.income-card  .summary-amount { color: var(--accent); }
.expense-card .summary-amount { color: var(--danger); }
.balance-card.positive .summary-amount { color: var(--accent); }
.balance-card.negative .summary-amount { color: var(--danger); }

.budget-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 820px) { .budget-grid { grid-template-columns: 1fr; } }

.budget-main, .budget-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.section-title {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ink-faint);
  margin-bottom: .75rem;
}

.txn-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: .88rem;
}
.txn-table thead th {
  background: #f4f7fc;
  padding: .65rem 1rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--border);
}
.txn-table tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
.txn-table tbody tr:last-child { border-bottom: none; }
.txn-table tbody tr:hover { background: #fafaf8; }
.txn-table td { padding: .7rem 1rem; vertical-align: middle; }
.txn-date { color: var(--ink-faint); font-size: .82rem; white-space: nowrap; }
.txn-title { font-weight: 500; }
.txn-note { display: block; font-size: .78rem; color: var(--ink-faint); font-style: italic; margin-top: .1rem; }
.txn-amount { font-weight: 700; white-space: nowrap; }
.txn-amount.income  { color: var(--accent); }
.txn-amount.expense { color: var(--danger); }

.cat-badge {
  display: inline-block;
  border-radius: 99px;
  padding: .2rem .65rem;
  font-size: .76rem;
  font-weight: 600;
  border: 1px solid;
}
.cat-badge-empty { color: var(--ink-faint); font-size: .82rem; }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.goals-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.goals-preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.view-all { font-size: .82rem; color: var(--accent); font-weight: 500; }
.goal-mini { margin-bottom: .85rem; }
.goal-mini-top { display: flex; justify-content: space-between; margin-bottom: .3rem; font-size: .85rem; }
.goal-mini-name { font-weight: 600; }
.goal-mini-amt { color: var(--ink-faint); font-size: .8rem; }

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .4s ease;
}
.progress-fill.fill-done { background: var(--gold); }

.cat-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .65rem .9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
}
.cat-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

.goals-wrap { max-width: 900px; margin: 2rem auto; padding: 0 1.5rem; }

.goal-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow);
}
.goal-form-card h3 { font-size: 1.05rem; margin-bottom: 1rem; }
.goal-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: .75rem; align-items: end; }
@media (max-width: 680px) { .goal-form { grid-template-columns: 1fr; } }
.goal-form .form-group { margin-bottom: 0; }

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}
.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.goal-card.goal-done { border-color: #74c69d; background: #f0faf5; }
.goal-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .5rem; }
.goal-card-top h4 { font-size: 1rem; font-weight: 700; }
.goal-deadline { font-size: .82rem; color: var(--ink-faint); margin-bottom: .5rem; }
.goal-amounts { display: flex; align-items: baseline; gap: .3rem; margin-top: .25rem; }
.goal-saved { font-family: 'DM Serif Display', serif; font-size: 1.5rem; color: var(--accent); }
.goal-target { color: var(--ink-faint); font-size: .9rem; }
.goal-pct { font-size: .82rem; color: var(--ink-faint); }


/* ═══════════════════════════════════════════════════════
   PHASE 3 — TRANSFER PLANNER
   ═══════════════════════════════════════════════════════ */

.planner-wrap { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }

.planner-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 820px) { .planner-grid { grid-template-columns: 1fr; } }

.planner-main  { display: flex; flex-direction: column; gap: .5rem; }
.planner-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.gpa-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
@media (max-width: 600px) { .gpa-banner { grid-template-columns: 1fr 1fr; } }

.gpa-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.gpa-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-faint); }
.gpa-value { font-family: 'DM Serif Display', serif; font-size: 1.8rem; color: var(--ink); }
.gpa-high { color: var(--accent); }
.gpa-mid  { color: var(--gold); }
.gpa-low  { color: var(--danger); }

.course-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: .88rem;
  margin-bottom: .5rem;
}
.course-table thead th {
  background: #f4f7fc;
  padding: .6rem .9rem;
  text-align: left;
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--border);
}
.course-table tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
.course-table tbody tr:last-child { border-bottom: none; }
.course-table tbody tr:hover { background: #fafaf8; }
.course-table td { padding: .65rem .9rem; vertical-align: middle; }
.course-name { font-weight: 500; }

.grade-badge {
  display: inline-block;
  border-radius: 6px;
  padding: .15rem .55rem;
  font-size: .8rem;
  font-weight: 700;
}
.grade-A { background: #d8f3dc; color: #1b4332; }
.grade-B { background: #dbeafe; color: #1e3a8a; }
.grade-C { background: #fef9c3; color: #713f12; }
.grade-D { background: #fee2e2; color: #7f1d1d; }
.grade-F { background: #fecaca; color: #991b1b; }

.add-school-form {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem;
}
.add-school-form input {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .55rem .8rem;
  font-size: .88rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  width: 100%;
}
.add-school-form input:focus { outline: none; border-color: var(--accent); background: #fff; }

.school-list { display: flex; flex-direction: column; gap: .85rem; }

.school-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.school-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; }
.school-major   { font-size: .82rem; color: var(--ink-soft); margin-bottom: .2rem; }
.school-deadline { font-size: .8rem; color: var(--ink-faint); margin-bottom: .5rem; }

.prob-bar-wrap { margin-top: .75rem; }
.prob-label {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  color: var(--ink-soft);
  margin-bottom: .3rem;
}
.prob-pct { font-weight: 700; }
.prob-high { color: var(--accent); }
.prob-mid  { color: var(--gold); }
.prob-low  { color: var(--danger); }
.prob-note { font-size: .76rem; color: var(--ink-faint); margin-top: .3rem; }

.fill-high { background: var(--accent); }
.fill-mid  { background: var(--gold); }
.fill-low  { background: var(--danger); }

.community-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}
@media (max-width: 820px) { .community-grid { grid-template-columns: 1fr; } }

.share-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.share-card h3 { font-size: 1.05rem; margin-bottom: 1.1rem; }

.school-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: .85rem;
  box-shadow: var(--shadow);
}
.school-stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6rem;
}
.stat-count { font-size: .78rem; color: var(--ink-faint); }
.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--ink-soft);
  padding: .2rem 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-of-type { border-bottom: none; }

.outcome-pills { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .65rem; }
.pill-admitted   { background: #d8f3dc; color: #1b4332; border-radius: 99px; padding: .15rem .6rem; font-size: .75rem; font-weight: 600; }
.pill-denied     { background: #fee2e2; color: #991b1b; border-radius: 99px; padding: .15rem .6rem; font-size: .75rem; font-weight: 600; }
.pill-waitlisted { background: #fef9c3; color: #713f12; border-radius: 99px; padding: .15rem .6rem; font-size: .75rem; font-weight: 600; }


/* ═══════════════════════════════════════════════════════
   RESPONSIVE — mobile and tablet
   ═══════════════════════════════════════════════════════ */

/* Tables overflow horizontally on narrow screens rather than blowing out the layout */
.txn-table, .course-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Tablet and below */
@media (max-width: 760px) {
  .navbar { padding: .75rem 1rem; gap: .5rem; }
  .nav-links { gap: .65rem; font-size: .85rem; }
  .nav-links a.btn-ghost,
  .nav-links a.btn-primary { padding: .35rem .7rem; font-size: .82rem; }

  .feed-header { flex-direction: column; align-items: stretch; }
  .search-form { width: 100%; }

  .profile-header { padding: 1.5rem; gap: 1rem; }
  .profile-avatar-lg { width: 56px; height: 56px; font-size: 1.6rem; }
  .profile-meta h2 { font-size: 1.4rem; }

  .match-card { flex-direction: column; align-items: stretch; gap: .75rem; }
  .match-actions { justify-content: flex-end; }

  .sidebar { position: static; }
}

/* Small phones */
@media (max-width: 480px) {
  html { font-size: 15px; }

  .navbar { padding: .65rem .85rem; flex-wrap: wrap; }
  .nav-brand { font-size: 1.2rem; }
  .nav-links { gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
  /* Hide secondary nav items on the smallest screens — keep avatar + logout reachable */
  .nav-links a:not(.nav-avatar):not(.btn-ghost):not(.btn-primary) { font-size: .78rem; }

  .hero { margin: 2.5rem auto 2rem; }
  .hero-sub { font-size: 1rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn-primary,
  .hero-actions .btn-ghost { width: 100%; justify-content: center; }

  .auth-card { padding: 1.75rem 1.25rem; }
  .auth-card h2 { font-size: 1.4rem; }

  .budget-wrap, .planner-wrap, .goals-wrap,
  .profile-wrap, .matches-wrap,
  .feed-layout, .features { padding-left: 1rem; padding-right: 1rem; }

  .budget-header h2 { font-size: 1.4rem; }
  .summary-amount { font-size: 1.6rem; }
  .gpa-value { font-size: 1.45rem; }

  .type-toggle { flex-direction: column; }
  .type-option { flex: none; }

  .feature-card { padding: 1.4rem; }

  .flash-container { padding: 0 1rem; }
}
