/* ─── FINFFOLIO — APP STYLES ──────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&family=DM+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #080e1a;
  --surface:   #0f1824;
  --surface2:  #162030;
  --border:    #1e2d42;
  --text:      #e8edf5;
  --muted:     #64748b;
  --green:     #10b981;
  --blue:      #3b82f6;
  --amber:     #f59e0b;
  --red:       #ef4444;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius:    14px;
  --radius-sm: 8px;
}

html, body { height: 100%; background: var(--bg); color: var(--text);
  font-family: var(--font-body); overflow: hidden; }

/* ── APP SHELL ─────────────────────────────────────────────────────────────── */
#app { height: 100vh; display: flex; flex-direction: column; }

/* ── TOP BAR ───────────────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 50; flex-shrink: 0; }
.logo { font-family: var(--font-head); font-size: 1.25rem; font-weight: 800;
  letter-spacing: -0.02em; }
.logo span { color: var(--green); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
#userAvatar { width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--green); }
#userName { font-size: 0.85rem; color: var(--muted); }
.logout-btn { background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; cursor: pointer; }
.logout-btn:hover { border-color: var(--red); color: var(--red); }

/* ── SCREENS ───────────────────────────────────────────────────────────────── */
.screen { display: none; flex: 1; overflow-y: auto; padding: 20px 16px 100px; }
.screen.active { display: block; }

/* ── LOGIN OVERLAY (auth.js appends this to body) ──────────────────────────── */
.login-logo { font-family: var(--font-head); font-size: 3rem; font-weight: 800;
  letter-spacing: -0.04em; line-height: 1; }
.login-logo span { color: var(--green); }
.login-tagline { color: var(--muted); font-size: 1rem; max-width: 280px; line-height: 1.6; }
.login-features { display: flex; flex-direction: column; gap: 10px; text-align: left;
  max-width: 280px; }
.login-feat { display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; color: var(--muted); }
#googleSignInBtn { display: flex; align-items: center; gap: 12px;
  background: white; color: #1a1a1a; border: none; padding: 14px 28px;
  border-radius: 50px; font-size: 1rem; font-weight: 600; cursor: pointer;
  width: 100%; max-width: 280px; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s; }
#googleSignInBtn:hover { transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); }

/* ── BUTTONS ───────────────────────────────────────────────────────────────── */
.btn-primary { background: var(--green); color: #fff; border: none;
  padding: 10px 18px; border-radius: 50px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s; }
.btn-primary:hover { opacity: 0.85; }
.btn-sm { background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 6px; font-size: 0.78rem; cursor: pointer; }
.btn-sm:hover { border-color: var(--green); }
.btn-outline { background: transparent; }
.btn-danger { border-color: var(--red); color: var(--red); background: transparent; }
.btn-danger:hover { background: rgba(239,68,68,0.1); }

/* ── SCREEN HEADER ─────────────────────────────────────────────────────────── */
.screen-header { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; }
.screen-title { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; }

/* ── DASHBOARD ─────────────────────────────────────────────────────────────── */
.corpus-card { background: linear-gradient(135deg,#0d2b1f 0%,#0f2236 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 20px; margin-bottom: 16px; position: relative; overflow: hidden; }
.corpus-card::before { content:''; position:absolute; top:-40px; right:-40px;
  width:160px; height:160px;
  background: radial-gradient(circle,rgba(16,185,129,.12) 0%,transparent 70%); }
.corpus-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 6px; }
.corpus-value { font-family: var(--font-head); font-size: 2.4rem; font-weight: 800;
  letter-spacing: -0.03em; color: var(--green); line-height: 1; }
.corpus-sub { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; }
.stat-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 4px; }
.stat-val { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 500; }
.stat-pct { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

.donut-section { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 24px; }
#donutCanvas { flex-shrink: 0; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 10px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-label { font-size: 0.82rem; color: var(--muted); }
.legend-val { font-family: var(--font-mono); font-size: 0.92rem; margin-left: auto; }

.section-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.section-card-title { font-size: 0.72rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 14px; }

.person-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.person-label { display: flex; align-items: center; gap: 6px;
  min-width: 70px; font-size: 0.82rem; }
.person-dot { width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); flex-shrink: 0; }
.person-bar-wrap { flex: 1; height: 6px; background: var(--surface2);
  border-radius: 3px; overflow: hidden; }
.person-bar { height: 100%;
  background: linear-gradient(90deg, var(--green), #34d399);
  border-radius: 3px; transition: width 0.6s ease; }
.person-val { font-family: var(--font-mono); font-size: 0.8rem;
  min-width: 70px; text-align: right; }

#rebalanceAlert { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.3);
  color: var(--amber); border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 0.83rem; margin-bottom: 16px; display: none; }

/* ── HOLDINGS ──────────────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px;
  overflow-x: auto; padding-bottom: 4px; }
.filter-chip { background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); padding: 6px 14px; border-radius: 20px; font-size: 0.78rem;
  cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.filter-chip.active { background: var(--green); border-color: var(--green); color: #fff; }

.holding-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 10px;
  cursor: pointer; transition: border-color 0.15s; }
.holding-card:hover { border-color: var(--green); }
.holding-top { display: flex; justify-content: space-between; align-items: flex-start; }
.holding-info { flex: 1; min-width: 0; padding-right: 12px; }
.holding-name { font-size: 0.92rem; font-weight: 500; margin: 4px 0 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.holding-person { font-size: 0.75rem; color: var(--muted); }
.holding-value { text-align: right; flex-shrink: 0; }
.val-main { font-family: var(--font-mono); font-size: 1rem; font-weight: 500; }
.val-gain { font-size: 0.75rem; margin-top: 2px; }
.val-sub  { font-size: 0.75rem; color: var(--muted); }
.pos { color: var(--green); } .neg { color: var(--red); }

.asset-badge { font-size: 0.68rem; padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.asset-badge.debt   { background: rgba(59,130,246,.15); color: var(--blue); }
.asset-badge.equity { background: rgba(16,185,129,.15); color: var(--green); }

.holding-detail { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-item span { font-size: 0.72rem; color: var(--muted); }
.detail-item strong { font-family: var(--font-mono); font-size: 0.88rem; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.section-divider { font-size: 0.72rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.1em; padding: 12px 0 8px;
  border-top: 1px solid var(--border); margin-top: 8px; }

/* ── SIP ───────────────────────────────────────────────────────────────────── */
.sip-header { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px; text-align: center; }
.sip-total { font-family: var(--font-head); font-size: 2rem; font-weight: 800;
  color: var(--green); letter-spacing: -0.02em; }
.sip-sub { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.sip-card { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border); }
.sip-card:last-of-type { border-bottom: none; }
.sip-name { font-size: 0.9rem; font-weight: 500; margin-bottom: 2px; }
.sip-meta { font-size: 0.75rem; color: var(--muted); }
.sip-amount { font-family: var(--font-mono); font-weight: 500; color: var(--green); }
.sip-subtotal { display: flex; justify-content: space-between; padding-top: 10px;
  font-size: 0.8rem; color: var(--muted); font-family: var(--font-mono); }

/* ── MANUAL ASSETS ─────────────────────────────────────────────────────────── */
.manual-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center; }
.manual-name { font-size: 0.9rem; font-weight: 500; margin: 4px 0 2px; }
.manual-date { font-size: 0.72rem; color: var(--muted); }
.manual-val  { font-family: var(--font-mono); font-size: 1rem; font-weight: 500;
  text-align: right; margin-bottom: 6px; }
.manual-right { text-align: right; }
.manual-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ── TRANSACTIONS ──────────────────────────────────────────────────────────── */
.tx-row { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px; }
.tx-type { font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 3px 8px; border-radius: 4px; flex-shrink: 0; }
.tx-type.buy, .tx-type.sip { background: rgba(16,185,129,.15); color: var(--green); }
.tx-type.sell { background: rgba(239,68,68,.15); color: var(--red); }
.tx-name { font-size: 0.88rem; font-weight: 500; margin-bottom: 2px; }
.tx-meta { font-size: 0.72rem; color: var(--muted); }
.tx-amount { font-family: var(--font-mono); font-size: 0.9rem; margin-left: auto; flex-shrink: 0; }
.tx-info { flex: 1; min-width: 0; }

/* ── BOTTOM NAV ────────────────────────────────────────────────────────────── */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; padding: 8px 0 16px; z-index: 100; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 16px; cursor: pointer; color: var(--muted);
  transition: color 0.15s; background: none; border: none; }
.nav-item.active { color: var(--green); }
.nav-icon  { font-size: 1.3rem; }
.nav-label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; }

/* ── MODALS ────────────────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 200; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  padding: 24px 20px 40px; }
.modal-header { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; }
.modal-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--muted);
  font-size: 1.4rem; cursor: pointer; padding: 4px; }

.form-group  { margin-bottom: 14px; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label  { display: block; font-size: 0.75rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.form-input, .form-select { width: 100%; background: var(--surface2);
  border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.9rem; font-family: var(--font-body); outline: none; }
.form-input:focus, .form-select:focus { border-color: var(--green); }
.form-select option { background: var(--surface2); }
.form-hint   { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
.btn-submit  { width: 100%; padding: 14px; background: var(--green); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 600;
  cursor: pointer; margin-top: 8px; font-family: var(--font-body); }
.btn-submit:hover { opacity: 0.9; }

/* ── EMPTY STATES ──────────────────────────────────────────────────────────── */
.empty-card { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-card p { margin-bottom: 16px; }
.empty-hint { font-size: 0.8rem; color: var(--muted); padding: 12px 0; }

/* ── TOAST ─────────────────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface2); color: var(--text); padding: 12px 20px;
  border-radius: 8px; font-size: 0.85rem; opacity: 0; transition: all 0.3s;
  z-index: 300; border: 1px solid var(--border); white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); }
.toast.error   { border-color: var(--red); color: var(--red); }

/* ── SCROLLBAR ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
/* ─── PHASE 2 ADDITIONS — append to app.css ────────────────────────────────── */

/* ── SMART FUND SEARCH ─────────────────────────────────────────────────────── */
.fund-drop-item:hover,
.fund-drop-item.active { background: var(--surface); }

.fund-confirm {
  margin-top: 6px;
  font-size: .8rem;
  color: var(--green);
  font-family: 'DM Sans', sans-serif;
  padding: 4px 0;
}

.form-hint-inline {
  font-size: .75rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}

/* ── SIP LOG BANNER ────────────────────────────────────────────────────────── */
.sip-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--amber);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  gap: 10px;
}

.sip-banner--done {
  border-color: var(--green);
  opacity: .75;
}

.sip-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  color: var(--text);
}

.sip-banner-icon { font-size: 1.1rem; }

.btn-amber {
  background: var(--amber);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* ── SIP LOG SCREEN ─────────────────────────────────────────────────────────── */
.siplog-loading {
  padding: 24px;
  color: var(--muted);
  font-size: .88rem;
  text-align: center;
}

.siplog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.siplog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 10px;
}

.siplog-fund {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
  line-height: 1.3;
}

.siplog-person {
  font-size: .78rem;
  color: var(--muted);
  margin: 0;
}

.siplog-amount {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--green);
  text-align: right;
  white-space: nowrap;
  min-width: 80px;
}

.siplog-amount-label {
  font-family: 'DM Sans', sans-serif;
  font-size: .7rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}

.siplog-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

@media (max-width: 400px) {
  .siplog-fields { grid-template-columns: 1fr 1fr; }
  .siplog-field:last-child { grid-column: 1 / -1; }
}

.siplog-field label { font-size: .76rem; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }

.btn-nav-refresh {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: .75rem;
  padding: 1px 5px;
  line-height: 1;
}

.btn-nav-refresh:hover { color: var(--text); border-color: var(--text); }
.btn-nav-refresh:disabled { opacity: .4; cursor: not-allowed; }

.dm-mono { font-family: 'DM Mono', monospace !important; }

/* ── IMPORT SCREEN ─────────────────────────────────────────────────────────── */
.import-wrap { padding-bottom: 32px; }

.import-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.import-desc { font-size: .88rem; color: var(--muted); margin: 0 0 14px; }

.import-template-hint {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.import-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px 20px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  margin-bottom: 20px;
}

.import-drop-zone:hover,
.import-drop-zone.drag-over {
  border-color: var(--green);
  background: rgba(16,185,129,.05);
}

.import-drop-icon { font-size: 2rem; }
.import-drop-text { font-size: .92rem; color: var(--text); font-weight: 500; }
.import-drop-hint { font-size: .78rem; color: var(--muted); }

.import-parsing { padding: 20px; text-align: center; color: var(--muted); font-size: .88rem; }
.import-error   { padding: 14px; background: rgba(239,68,68,.1); border: 1px solid var(--red);
                  border-radius: 8px; color: var(--red); font-size: .88rem; }

.import-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.import-count  { font-size: .88rem; color: var(--text); font-weight: 600; }
.import-dup    { font-size: .82rem; color: var(--amber); }

.import-section-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}

.import-table-wrap { overflow-x: auto; margin-bottom: 8px; }

.import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

.import-table th {
  text-align: left;
  padding: 7px 8px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
}

.import-table td {
  padding: 7px 8px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.import-row-dup td { opacity: .45; }

.import-tag-new  { background: rgba(16,185,129,.15); color: var(--green);
                   font-size: .72rem; padding: 2px 7px; border-radius: 4px; font-weight: 600; }
.import-tag-skip { background: rgba(100,116,139,.15); color: var(--muted);
                   font-size: .72rem; padding: 2px 7px; border-radius: 4px; font-weight: 600; }

.import-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.import-success {
  padding: 14px;
  background: rgba(16,185,129,.1);
  border: 1px solid var(--green);
  border-radius: 8px;
  color: var(--green);
  font-size: .88rem;
  margin-top: 16px;
}

/* ── TIMELINE SCREEN ───────────────────────────────────────────────────────── */
.timeline-wrap { padding-bottom: 32px; }

.timeline-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.view-toggle {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--muted);
  padding: 6px 14px;
  font-size: .82rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: color .15s, background .15s;
}

.toggle-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.timeline-summary { margin-bottom: 20px; }

.tl-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tl-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.tl-stat-label { font-size: .75rem; color: var(--muted); margin-bottom: 4px; }
.tl-stat-val   { font-size: .95rem; font-weight: 700; color: var(--text); font-family: 'DM Mono', monospace; }
.tl-stat-val.pos { color: var(--green); }
.tl-stat-val.neg { color: var(--red); }

.timeline-chart-wrap {
  position: relative;
  height: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

/* ── GENERAL UTILITY ───────────────────────────────────────────────────────── */
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: .85rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

.btn-outline:hover { border-color: var(--text); }

/* ── SETTINGS SCREEN ───────────────────────────────────────────────────────── */
.settings-wrap { padding-bottom: 32px; }

.settings-section { margin-bottom: 24px; }

.settings-section-title {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-row-label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.settings-row-sub {
  font-size: .78rem;
  color: var(--muted);
}

.settings-hint {
  font-size: .76rem;
  color: var(--muted);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  line-height: 1.5;
}

/* ── CAMS IMPORT SCREEN ─────────────────────────────────────────────────────── */
.cams-wrap { padding-bottom: 32px; }

.cams-intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.cams-intro-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.cams-intro-desc {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.cams-intro-steps { display: flex; flex-direction: column; gap: 8px; }

.cams-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.4;
}

.cams-step a { color: var(--green); }

.cams-step-num {
  background: var(--green);
  color: #000;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  margin-top: 1px;
}

.cams-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.cams-parsing {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
}

.cams-preview { margin-bottom: 16px; }

.cams-preview-header {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.cams-preview-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
  min-width: 70px;
}

.cams-stat-val {
  font-family: 'DM Mono', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.cams-stat-val.green { color: var(--green); }
.cams-stat-val.amber { color: var(--amber); }
.cams-stat-val.red   { color: var(--red); }

.cams-stat-label {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 2px;
}

.cams-investor {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 8px;
}

.cams-table-wrap { overflow-x: auto; margin-bottom: 10px; }

.cams-code-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 3px 6px;
}

.cams-match-hint {
  font-size: .78rem;
  color: var(--amber);
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.cams-match-hint a { color: var(--amber); }

.cams-excel-stub {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-top: 16px;
  opacity: .6;
}

.cams-stub-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.cams-stub-desc {
  font-size: .78rem;
  color: var(--muted);
}

/* ─── PHASE 3+ — PERSON TREE, ACCORDION, BREADCRUMB, PERSON DETAIL VIEW ─────── */

/* ── PERSON CARDS — total view (clickable, no sub-accordion) ─────────────────── */
.pt-person {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}
.pt-person:hover { border-color: var(--green); background: rgba(16,185,129,0.03); }

.pt-person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px 10px;
  gap: 10px;
}
.pt-person-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.pt-person-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 700; color: #fff; flex-shrink: 0;
  font-family: var(--font-head);
}
.pt-person-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pt-person-name {
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 5px;
}
.pt-person-link-arrow {
  font-size: 0.72rem;
  color: var(--muted);
  transition: color 0.15s, transform 0.15s;
}
.pt-person:hover .pt-person-link-arrow { color: var(--green); transform: translate(2px,-2px); }

.pt-person-split { display: flex; gap: 8px; font-size: 0.7rem; font-family: var(--font-mono); }
.pt-split-eq  { color: var(--green); }
.pt-split-dbt { color: var(--blue); }

.pt-person-total {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.pt-bar-wrap { height: 2px; background: var(--surface2); margin: 0 14px 10px; }
.pt-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #34d399);
  transition: width 0.6s ease;
}

/* ── PERSON DETAIL — back bar ─────────────────────────────────────────────────── */
.person-view-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px 14px;
}
.person-view-back {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 20px; padding: 6px 14px 6px 10px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; font-family: var(--font-body);
  transition: border-color 0.15s, background 0.15s;
}
.person-view-back:hover { border-color: var(--green); background: rgba(16,185,129,0.06); }
.pv-back-arrow { font-size: 1rem; line-height: 1; }
.person-view-title {
  font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; color: var(--text); flex: 1;
}
.person-view-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff; font-family: var(--font-head); flex-shrink: 0;
}

/* ── EQUITY / DEBT ACCORDION BLOCKS ─────────────────────────────────────────── */
.pt-de-block { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); margin-bottom: 6px; }
.pt-de-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; cursor: pointer; user-select: none; transition: filter 0.12s;
}
.pt-de-equity { background: rgba(16,185,129,0.07); }
.pt-de-debt   { background: rgba(59,130,246,0.07); }
.pt-de-row:hover { filter: brightness(1.14); }

.pt-de-left   { display: flex; align-items: center; gap: 8px; }
.pt-chevron-sm { font-size: 0.75rem; color: var(--muted); width: 12px; flex-shrink: 0; }
.pt-de-dot    { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pt-de-dot.equity { background: var(--green); }
.pt-de-dot.debt   { background: var(--blue); }
.pt-de-label  { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.pt-de-meta   { font-size: 0.72rem; color: var(--muted); }
.pt-de-val    { font-family: var(--font-mono); font-size: 0.88rem; font-weight: 600; }
.pt-de-body   { padding: 4px 8px 6px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }

/* ── SUB-GROUP BLOCKS ─────────────────────────────────────────────────────────── */
.pt-sub-block { border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.pt-sub-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 8px 10px; cursor: pointer; user-select: none;
  background: var(--surface2); transition: background 0.12s; gap: 8px;
}
.pt-sub-row:hover { background: #1a2840; }
.pt-sub-left  { display: flex; align-items: flex-start; gap: 7px; flex: 1; min-width: 0; }
.pt-chevron-xs { font-size: 0.65rem; color: var(--muted); width: 10px; flex-shrink: 0; margin-top: 3px; }
.pt-sub-icon  { font-size: 0.9rem; flex-shrink: 0; margin-top: 1px; }
.pt-sub-info  { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pt-sub-label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.pt-sub-fullform { font-size: 0.72rem; color: var(--muted); font-weight: 400; }
.pt-sub-stats { font-size: 0.7rem; color: var(--muted); font-family: var(--font-mono); }
.pt-sub-val   { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600; flex-shrink: 0; }
.pt-sub-body  { background: var(--surface); padding: 4px 10px 6px; }

/* ── INSTRUMENT ROWS ─────────────────────────────────────────────────────────── */
.pt-instrument-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 6px 2px; border-bottom: 1px solid rgba(30,45,66,0.6); gap: 8px;
}
.pt-instrument-row:last-of-type { border-bottom: none; }
.pt-instr-left  { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pt-instr-name  { font-size: 0.8rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-instr-sub   { font-size: 0.68rem; color: var(--muted); font-family: var(--font-mono); }
.pt-instr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.pt-instr-val   { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; }
.pt-instr-gain  { font-family: var(--font-mono); font-size: 0.68rem; }

.pt-goto-btn {
  display: block; width: 100%; margin-top: 6px;
  background: transparent; border: 1px solid var(--border); color: var(--green);
  border-radius: 6px; padding: 7px 12px; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-body); text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.pt-goto-btn:hover { border-color: var(--green); background: rgba(16,185,129,0.06); }
.pt-empty { font-size: 0.75rem; color: var(--muted); padding: 8px 0; text-align: center; }

/* ── HOLDINGS — person/DE grouping ───────────────────────────────────────────── */
.group-person-header { display:flex; align-items:center; justify-content:space-between; padding:14px 4px 8px; margin-top:8px; }
.group-person-header:first-child { margin-top:0; }
.group-person-left  { display:flex; align-items:center; gap:8px; }
.group-person-dot   { width:10px; height:10px; border-radius:50%; background:var(--green); flex-shrink:0; }
.group-person-name  { font-family:var(--font-head); font-size:1rem; font-weight:700; }
.group-person-total { font-family:var(--font-mono); font-size:.92rem; color:var(--green); font-weight:600; }

.group-de-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:9px 12px; background:var(--surface2); border:1px solid var(--border);
  border-radius:var(--radius-sm); margin-bottom:6px; cursor:pointer;
  transition:border-color 0.15s; user-select:none;
}
.group-de-header:hover { border-color:var(--green); }
.group-de-left  { display:flex; align-items:center; gap:8px; }
.group-de-dot   { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.group-de-dot.equity { background:var(--green); }
.group-de-dot.debt   { background:var(--blue); }
.group-de-label { font-size:.8rem; font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
.group-de-count { font-size:.72rem; color:var(--muted); }
.group-de-right { display:flex; align-items:center; gap:8px; }
.group-de-total { font-family:var(--font-mono); font-size:.85rem; font-weight:600; }
.group-de-chevron { color:var(--muted); font-size:1rem; transition:transform .2s; display:inline-block; }
.group-de-chevron.rotated { transform:rotate(90deg); }
.group-de-body  { margin-bottom:8px; }
.group-de-body.collapsed { display:none; }

/* ── BREADCRUMB BAR ───────────────────────────────────────────────────────────── */
.breadcrumb-bar {
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 12px; background:var(--surface2); border:1px solid var(--border);
  border-radius:var(--radius-sm); margin-bottom:16px; gap:8px;
}
.breadcrumb-trail { display:flex; align-items:center; gap:6px; font-size:.8rem; flex:1; min-width:0; flex-wrap:wrap; }
.bc-root    { color:var(--muted); }
.bc-sep     { color:var(--border); font-size:1rem; }
.bc-current { color:var(--text); font-weight:600; }
.bc-clickable { cursor:pointer; color:var(--green); transition:opacity .15s; }
.bc-clickable:hover { opacity:.75; }
.filter-clear-btn {
  background:transparent; border:1px solid var(--border); color:var(--muted);
  border-radius:20px; padding:4px 10px; font-size:.72rem; cursor:pointer;
  white-space:nowrap; font-family:var(--font-body); transition:border-color .15s,color .15s; flex-shrink:0;
}
.filter-clear-btn:hover { border-color:var(--red); color:var(--red); }
/* ─── PHASE 4 ADDITIONS — append to app.css ────────────────────────────────── */

/* ── GOAL CARDS ─────────────────────────────────────────────────────────────── */
.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 14px;
  margin-bottom: 14px;
}

.goal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.goal-header-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.goal-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }

.goal-title-block { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.goal-name {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.goal-muted { font-size: 0.72rem; color: var(--muted); }

.goal-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.goal-corpus {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green);
}

.goal-retirement-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: rgba(16,185,129,0.12);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.25);
  padding: 2px 7px;
  border-radius: 20px;
}

/* ── GOAL PROGRESS ──────────────────────────────────────────────────────────── */
.goal-progress-wrap {
  height: 5px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.goal-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #34d399);
  border-radius: 3px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.goal-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.goal-pct-badge {
  background: rgba(16,185,129,0.12);
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ── GOAL MINI DONUT ────────────────────────────────────────────────────────── */
.goal-donut-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.goal-donut-svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.goal-donut-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.goal-donut-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.goal-donut-pct {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.goal-donut-empty {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 12px;
  font-style: italic;
}

/* ── GOAL TAGGED ASSETS LIST ────────────────────────────────────────────────── */
.goal-tagged-toggle {
  background: transparent;
  border: none;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.goal-tagged-toggle:hover { opacity: 0.75; }
.goal-tagged-toggle.open::after { content: " ›"; transform: rotate(90deg); display: inline-block; }

.goal-tagged-list {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.goal-tagged-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(30,45,66,0.5);
}
.goal-tagged-row:last-child { border-bottom: none; }

.goal-tagged-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.goal-tagged-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.goal-tagged-person {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.goal-tagged-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.goal-tagged-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
}

.goal-tagged-alloc {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.goal-empty-tagged {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 8px 0;
  text-align: center;
  font-style: italic;
}

/* ── GOAL ALLOCATION SECTION (inside modals) ────────────────────────────────── */
.goal-alloc-section {
  margin-top: 4px;
  margin-bottom: 14px;
}

.goal-alloc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.goal-alloc-hint {
  font-size: 0.7rem;
  color: var(--muted);
  font-style: italic;
}

.goal-alloc-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-alloc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.goal-alloc-name {
  font-size: 0.85rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.goal-alloc-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.goal-alloc-input {
  width: 60px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.88rem;
  font-family: var(--font-mono);
  text-align: right;
  outline: none;
}
.goal-alloc-input:focus { border-color: var(--green); }

.goal-alloc-pct-sym {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.goal-alloc-summary {
  margin-top: 8px;
  font-size: 0.75rem;
  text-align: right;
  min-height: 18px;
}

.goal-alloc-rem  { color: var(--muted); font-family: var(--font-mono); }
.goal-alloc-over { color: var(--amber); font-family: var(--font-mono); font-weight: 600; }
.goal-alloc-loading { font-size: 0.78rem; color: var(--muted); padding: 8px 0; }
.goal-alloc-empty   { font-size: 0.78rem; color: var(--muted); padding: 8px 0; font-style: italic; }

/* ── HOLDING GOAL TAGS (compact pills on holding card) ──────────────────────── */
.holding-goal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.holding-goal-tag {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(16,185,129,0.1);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 20px;
  padding: 1px 7px;
}

/* ─── PHASE 4+ ADDITIONS ────────────────────────────────────────────────────── */

/* ── SUBCATEGORY HEADER (replaces group-de-header) ──────────────────────────── */
.group-subcat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 4px; cursor: pointer;
  transition: border-color 0.15s; user-select: none;
}
.group-subcat-header:hover { border-color: var(--green); }

.group-subcat-left  { display: flex; align-items: center; gap: 8px; }
.group-subcat-chevron {
  color: var(--muted); font-size: 1rem; transition: transform .2s;
  display: inline-block; width: 14px; flex-shrink: 0;
}
.group-subcat-chevron.rotated { transform: rotate(90deg); }
.group-subcat-label { font-size: .82rem; font-weight: 600; }
.group-subcat-count {
  font-size: .72rem; color: var(--muted);
  background: var(--bg); border-radius: 10px;
  padding: 1px 7px;
}
.group-subcat-right { display: flex; align-items: center; gap: 8px; }
.group-subcat-total { font-family: var(--font-mono); font-size: .85rem; font-weight: 600; }

.group-subcat-body  { margin-bottom: 8px; }
.group-subcat-body.collapsed { display: none; }

/* ── SUBCATEGORY GOAL BUTTON ─────────────────────────────────────────────────── */
.subcat-goal-btn {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.subcat-goal-btn:hover {
  border-color: var(--green); color: var(--green);
  background: rgba(16,185,129,0.06);
}
.subcat-goal-btn.has-rule {
  border-style: solid; border-color: var(--green);
  color: var(--green); background: rgba(16,185,129,0.08);
}

/* ── HOLDING GOAL TAG (inline in holding-person line) ───────────────────────── */
.holding-goal-tag {
  font-size: .65rem; font-weight: 600; font-family: var(--font-mono);
  background: rgba(16,185,129,0.1); color: var(--green);
  border: 1px solid rgba(16,185,129,0.2); border-radius: 20px;
  padding: 1px 7px; margin-left: 6px;
}
.holding-goal-tag.subcat-rule {
  background: rgba(59,130,246,0.1); color: var(--blue);
  border-color: rgba(59,130,246,0.2);
}

/* ── SUB-ALLOC MODAL ─────────────────────────────────────────────────────────── */
.suballoc-modal-actions {
  display: flex; gap: 8px; margin-top: 16px;
}
.suballoc-modal-actions .btn-submit {
  flex: 1; margin-top: 0;
}

/* ── GOAL CARD RETIREMENT VARIANT ───────────────────────────────────────────── */
.goal-card-retirement {
  border-color: rgba(16,185,129,0.25);
  background: linear-gradient(160deg, #0d1e16 0%, var(--surface) 100%);
}
