/* ── NAV ────────────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 64px;
  background: rgba(10,13,15,.9); backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border); transition: background .2s;
}
nav.scrolled { background: rgba(10,13,15,.98); }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo-mark { width: 32px; height: 32px; background: var(--ink-90); border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.nav-logo-text { font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--t1); }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a { font-size: 13px; font-weight: 500; color: var(--t2); text-decoration: none; letter-spacing: .04em; transition: color .2s; }
.nav-links a:hover { color: var(--t1); }
.nav-links a.active { color: var(--moss-bright); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.btn-ghost-nav { font-size: 13px; font-weight: 600; color: var(--t2); background: none; border: 1px solid var(--border); padding: 8px 18px; border-radius: var(--r); cursor: pointer; text-decoration: none; transition: all .2s; }
.btn-ghost-nav:hover { color: var(--t1); border-color: rgba(255,255,255,.18); }
.btn-cta-nav { font-size: 13px; font-weight: 700; color: #fff; background: var(--moss); border: none; padding: 9px 20px; border-radius: var(--r); cursor: pointer; text-decoration: none; transition: background .2s; }
.btn-cta-nav:hover { background: var(--moss-bright); }
.nav-hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; background: none; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; padding: 0 10px; }
.nav-hamburger span { display: block; height: 1.5px; background: var(--t2); border-radius: 99px; transition: all .25s; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); background: var(--t1); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); background: var(--t1); }
.nav-drawer { position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: rgba(10,13,15,.97); backdrop-filter: blur(24px); z-index: 190; display: flex; flex-direction: column; padding: 32px 24px 40px; transform: translateX(100%); transition: transform .3s cubic-bezier(.16,1,.3,1); overflow-y: auto; border-top: 1px solid var(--border); }
.nav-drawer.open { transform: translateX(0); }
.drawer-link { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--border); font-size: 22px; font-family: 'Fraunces', serif; font-weight: 700; color: var(--t2); text-decoration: none; }
.drawer-link span { font-size: 18px; color: var(--moss-bright); }
.drawer-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
body.drawer-open { overflow: hidden; }

/* ── USER MENU DROPDOWN ────────────────────────────────────────── */
.nav-user-menu { position: relative; }
.nav-user-btn { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--border); padding: 6px 12px 6px 6px; border-radius: 99px; cursor: pointer; transition: all .2s; }
.nav-user-btn:hover { background: rgba(255,255,255,.08); }
.nav-user-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--moss); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.nav-user-name { font-size: 13px; font-weight: 600; color: var(--t1); max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-dropdown { position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px; background: var(--ink-90); border: 1px solid var(--border); border-radius: var(--r); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .18s; box-shadow: 0 12px 32px rgba(0,0,0,.4); }
.nav-user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.nud-item { display: block; width: 100%; text-align: left; padding: 10px 12px; font-size: 13px; color: var(--t2); text-decoration: none; background: none; border: none; border-radius: 8px; cursor: pointer; font-family: inherit; transition: all .15s; }
.nud-item:hover { background: rgba(255,255,255,.05); color: var(--t1); }
.nud-signout { color: #f87171; }
.nud-signout:hover { background: rgba(248,113,113,.08); color: #f87171; }

/* ── BUTTONS ────────────────────────────────────────────────────── */
.btn-primary { display: inline-flex; align-items: center; gap: 8px; padding: 13px 26px; background: var(--moss); color: #fff; border: none; border-radius: var(--r); font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; transition: all .25s; box-shadow: 0 4px 28px var(--moss-glow); letter-spacing: .03em; font-family: inherit; }
.btn-primary:hover { background: var(--moss-bright); transform: translateY(-1px); }
.btn-outline { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; background: transparent; color: var(--t2); border: 1px solid var(--border); border-radius: var(--r); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: all .2s; font-family: inherit; }
.btn-outline:hover { color: var(--t1); border-color: rgba(255,255,255,.2); }

/* ── CARDS ──────────────────────────────────────────────────────── */
.card { background: var(--ink-90); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.card-header { padding: 14px 18px 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--t3); }
.card-action { font-size: 11px; font-weight: 600; color: var(--moss-bright); text-decoration: none; }
.card-body { padding: 16px 18px; }

/* ── METRIC CARDS ───────────────────────────────────────────────── */
.metric-card { background: var(--ink-90); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; }
.mc-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); margin-bottom: 6px; }
.mc-value { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 700; color: var(--t1); line-height: 1; }
.mc-value.positive { color: var(--moss-bright); }
.mc-value.negative { color: #f87171; }
.mc-value.gold { color: var(--gold); }
.mc-sub { font-size: 11px; color: var(--t3); margin-top: 5px; }

/* ── BREAKDOWN ROWS ─────────────────────────────────────────────── */
.breakdown-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.breakdown-row:last-child { border-bottom: none; }
.br-rank { width: 22px; height: 22px; border-radius: 50%; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.br-rank.debt { background: rgba(248,113,113,.15); color: #f87171; }
.br-rank.asset { background: rgba(28,140,82,.15); color: var(--moss-bright); }
.br-rank.income { background: rgba(74,159,228,.15); color: var(--sky); }
.br-body { flex: 1; min-width: 0; }
.br-label { font-size: 13px; font-weight: 600; color: var(--t1); }
.br-sub { font-size: 11px; color: var(--t3); margin-top: 1px; }
.br-bar-bg { height: 3px; background: rgba(255,255,255,.06); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.br-bar-fill { height: 100%; border-radius: 99px; }
.br-val { font-family: 'Fraunces', serif; font-size: 14px; font-weight: 700; color: var(--t1); flex-shrink: 0; text-align: right; }
.br-val.debt { color: #f87171; }
.br-val.asset { color: var(--moss-bright); }

/* ── PRIORITY CARD ──────────────────────────────────────────────── */
.priority-card { background: var(--ink-90); border: 1px solid rgba(28,140,82,.22); border-radius: var(--r-lg); padding: 28px; position: relative; overflow: hidden; }
.priority-card::before { content: ''; position: absolute; top: 0; right: 0; width: 220px; height: 220px; background: radial-gradient(circle at top right, rgba(28,140,82,.1), transparent 60%); }
.pc-tag { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--moss-bright); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.pc-dot { width: 5px; height: 5px; background: var(--moss-bright); border-radius: 50%; animation: blink 2s infinite; }
.pc-title { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 700; color: var(--t1); line-height: 1.25; margin-bottom: 12px; }
.pc-why { font-size: 14px; color: var(--t2); line-height: 1.72; margin-bottom: 20px; max-width: 600px; }
.pc-why strong { color: var(--t1); font-weight: 600; }
.pc-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--border); border-radius: var(--r); overflow: hidden; }
.pc-stat { background: rgba(255,255,255,.03); padding: 14px 16px; }
.pc-stat-label { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); margin-bottom: 4px; }
.pc-stat-val { font-size: 15px; font-weight: 700; color: var(--t1); }
.pc-stat-val.positive { color: var(--moss-bright); }

/* ── HEALTH PANEL ───────────────────────────────────────────────── */
.hp-score-row { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.hp-score { font-family: 'Fraunces', serif; font-size: 48px; font-weight: 700; line-height: 1; }
.hp-score-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); padding-bottom: 8px; }
.hp-bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.hp-fill { height: 100%; border-radius: 99px; transition: width .8s cubic-bezier(.16,1,.3,1); }
.hp-factors { display: flex; flex-direction: column; gap: 9px; }
.hp-factor { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--t2); }
.hp-factor-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.hp-factor-val { margin-left: auto; font-size: 11px; font-weight: 700; }

/* ── CHARTS ─────────────────────────────────────────────────────── */
.chart-wrap { padding: 16px 18px 20px; }
.chart-legend { display: flex; gap: 14px; margin-bottom: 10px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--t2); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
canvas { display: block; width: 100% !important; border-radius: var(--r); }

/* ── FORM ELEMENTS ──────────────────────────────────────────────── */
.field-input, .field-select {
  background: rgba(255,255,255,.05); border: 1.5px solid var(--border);
  border-radius: var(--r); padding: 10px 12px; color: var(--t1);
  font-size: 14px; font-weight: 600; font-family: inherit;
  outline: none; width: 100%; transition: border-color .2s, background .2s;
}
.field-input::placeholder { color: var(--t3); font-weight: 400; }
.field-input:focus, .field-select:focus { border-color: var(--moss-bright); background: rgba(28,140,82,.04); }
.field-select { cursor: pointer; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(240,236,228,.3)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ── FOOTER ─────────────────────────────────────────────────────── */
.site-footer { background: var(--ink-90); border-top: 1px solid var(--border); padding: 44px 64px 32px; }
.footer-inner { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { font-size: 12px; color: var(--t3); text-decoration: none; }
.footer-links a:hover { color: var(--t2); }
.footer-copy { font-size: 11px; color: var(--t3); opacity: .5; }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  nav { padding: 0 24px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-actions .btn-ghost-nav { display: none; }
  .nav-user-name { display: none; }
}
@media (max-width: 768px) {
  nav { padding: 0 20px; height: 60px; }
  .nav-drawer { top: 60px; }
  .site-footer { padding: 32px 24px; }
}
