/* ── PORTFOLIO INTELLIGENCE — Production Design ────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@300;400;500&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

:root {
  /* Palette */
  --ink:     #0a0a0c;
  --ink2:    #111115;
  --ink3:    #18181e;
  --ink4:    #222229;
  --ink5:    #2e2e38;
  --border:  rgba(255,255,255,.06);
  --border2: rgba(255,255,255,.11);
  --tx:      #f0efe8;
  --tx2:     #9896a4;
  --tx3:     #55535f;
  --gold:    #c9a84c;
  --gold2:   #e8c96e;
  --teal:    #2dd4bf;
  --coral:   #fb7185;
  --violet:  #a78bfa;
  --green:   #4ade80;
  --red:     #f87171;
  --amber:   #fbbf24;
  --sky:     #38bdf8;

  /* Account colors */
  --c-main:    #c9a84c;
  --c-yuri:    #2dd4bf;
  --c-trading: #fb7185;
  --c-webull:  #f97316;
  --c-moomoo:  #38bdf8;

  /* Typography */
  --serif:  'DM Serif Display', Georgia, serif;
  --sans:   'DM Sans', system-ui, sans-serif;
  --mono:   'DM Mono', 'Fira Code', monospace;

  /* Spacing */
  --r:  6px;
  --r2: 10px;
  --r3: 16px;
  --r4: 22px;

  /* Effects */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow:    0 4px 16px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);
  --glow-gold: 0 0 24px rgba(201,168,76,.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 14px; }

body {
  background: var(--ink);
  color: var(--tx);
  font-family: var(--sans);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(201,168,76,.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(45,212,191,.04) 0%, transparent 50%);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--ink5); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--tx3); }

/* ── NAV ── */
#tnav {
  position: sticky; top: 0; z-index: 200;
  height: 58px;
  background: rgba(10,10,12,.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 2.5rem; gap: 0;
}

.nbrand { display: flex; align-items: center; gap: 12px; margin-right: 2.5rem; flex-shrink: 0; }

.nmark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, rgba(201,168,76,.15), rgba(201,168,76,.06));
  border: 1px solid rgba(201,168,76,.35);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 13px; color: var(--gold); letter-spacing: -.01em;
  box-shadow: var(--glow-gold);
}

.nname {
  font-family: var(--serif); font-size: 16px; color: var(--tx);
  letter-spacing: -.01em;
}

.nlinks { display: flex; gap: 1px; flex: 1; }

.nl {
  padding: 7px 15px;
  font-family: var(--mono); font-size: 10px; font-weight: 400;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--tx3); border-radius: var(--r2);
  cursor: pointer; transition: all .15s ease;
  white-space: nowrap; border: 1px solid transparent;
}
.nl:hover { color: var(--tx2); background: var(--ink3); }
.nl.on {
  color: var(--gold2); background: rgba(201,168,76,.08);
  border-color: rgba(201,168,76,.2);
}

.nstat {
  font-family: var(--mono); font-size: 10px; color: var(--tx3);
  letter-spacing: .08em; white-space: nowrap; flex-shrink: 0;
  padding: 5px 12px; background: var(--ink3);
  border: 1px solid var(--border); border-radius: 20px;
}

/* ── PAGE TRANSITIONS ── */
.pg { display: none; padding: 2.5rem; max-width: 1480px; margin: 0 auto; }
.pg.on { display: block; animation: pgIn .22s ease; }
@keyframes pgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── HERO ── */
.hero {
  padding: 2.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
  position: relative;
}
.hero-eye {
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  color: var(--gold); text-transform: uppercase;
  margin-bottom: .75rem; opacity: .8;
}
.hero-h {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  font-weight: 400; line-height: 1.05;
  letter-spacing: -.02em; margin-bottom: .8rem;
  background: linear-gradient(135deg, var(--tx) 40%, rgba(240,239,232,.55));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-h em {
  font-style: italic; color: var(--gold);
  -webkit-text-fill-color: var(--gold2);
}
.hero-p {
  color: var(--tx2); font-size: 13px; max-width: 540px;
  line-height: 1.75; font-family: var(--sans); font-weight: 300;
}

/* ── NET WORTH WIDGET ── */
#nw-card {
  border-radius: var(--r4);
  background: linear-gradient(135deg, rgba(201,168,76,.06) 0%, rgba(45,212,191,.04) 100%);
  border: 1px solid rgba(201,168,76,.2);
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  position: relative; overflow: hidden;
}
#nw-card::before {
  content: '';
  position: absolute; top: -40%; right: -10%; width: 40%; height: 200%;
  background: radial-gradient(ellipse, rgba(201,168,76,.06), transparent 60%);
  pointer-events: none;
}
/* Net Worth Widget */
#nw-card .card-hd-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.nw-col { display: flex; flex-direction: column; gap: .3rem; min-width: 130px; }
.nw-currency {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--tx3);
}
.nw-amount {
  font-family: var(--mono); font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 500; line-height: 1; letter-spacing: -.03em;
}
.nw-breakdown {
  font-family: var(--mono); font-size: 10px; color: var(--tx3);
  letter-spacing: .02em;
}
.nw-rates .nw-breakdown { line-height: 1.8; }
.nw-divider { width: 1px; background: var(--border2); align-self: stretch; margin: 0 .5rem; }

/* ── METRIC STRIP ── */
.ms {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r3); overflow: hidden;
  margin-bottom: 2.5rem;
}
.mc {
  background: var(--ink2); padding: 1.1rem 1.3rem;
  transition: background .15s;
}
.mc:hover { background: var(--ink3); }
.mc-l {
  font-family: var(--mono); font-size: 9px; letter-spacing: .12em;
  color: var(--tx3); text-transform: uppercase; margin-bottom: .4rem;
}
.mc-v {
  font-family: var(--mono); font-size: 1.45rem; font-weight: 500;
  line-height: 1; letter-spacing: -.025em;
}
.mc-s { font-family: var(--mono); font-size: 9px; color: var(--tx3); margin-top: .3rem; }
.pos { color: var(--green); } .neg { color: var(--red); }
.gold { color: var(--gold2); }

/* ── GRID LAYOUTS ── */
.row { display: grid; gap: 1.5rem; margin-bottom: 1.5rem; }
.r2 { grid-template-columns: 1fr 1fr; }
.r3 { grid-template-columns: 1fr 1fr 1fr; }
.r13 { grid-template-columns: 1fr 3fr; }
.r31 { grid-template-columns: 3fr 1fr; }
@media(max-width:960px) { .r2,.r3,.r13,.r31 { grid-template-columns: 1fr; } }

/* ── CARDS ── */
.card {
  background: var(--ink2);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: 1.5rem 1.75rem;
  transition: border-color .2s;
}
.card:hover { border-color: var(--border2); }
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; flex-wrap: wrap; gap: .5rem;
}
.card-title {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  color: var(--tx3); text-transform: uppercase;
}
.card-sup { font-family: var(--mono); font-size: 9px; color: var(--tx3); }

/* ── CHART ── */
.cw { position: relative; width: 100%; }

/* ── LEGEND ── */
.leg { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1rem; }
.li { display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9px; color: var(--tx2); }
.ld { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.ld-dash { width: 16px; height: 2px; border-radius: 1px; flex-shrink: 0; }

/* ── TABS ── */
.tabs { display: flex; gap: 3px; margin-bottom: 1.75rem; flex-wrap: wrap; }
.tab {
  padding: 7px 16px;
  font-family: var(--mono); font-size: 10px; font-weight: 400;
  letter-spacing: .07em; text-transform: uppercase;
  border: 1px solid var(--border); border-radius: var(--r2);
  cursor: pointer; color: var(--tx3); background: transparent;
  transition: all .14s; white-space: nowrap;
}
.tab:hover { color: var(--tx2); border-color: var(--border2); background: var(--ink3); }
.tab.on {
  color: var(--gold2); border-color: rgba(201,168,76,.35);
  background: rgba(201,168,76,.07);
}
.view-toggle { display: flex; gap: 2px; background: var(--ink3);
  border: 1px solid var(--border); border-radius: var(--r2); padding: 3px; }
.view-toggle .tab { border: none; border-radius: calc(var(--r2) - 2px); background: transparent; }
.view-toggle .tab.on { background: rgba(201,168,76,.1); }

/* ── TABLES ── */
.tw { overflow-x: auto; border-radius: var(--r2); }
table { width: 100%; border-collapse: collapse; font-size: 11px; }

thead th {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  color: var(--tx3); text-transform: uppercase;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-weight: 400; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: color .14s; position: relative;
}
thead th:hover { color: var(--tx2); }
thead th.sort-asc::after  { content: ' ↑'; color: var(--gold); }
thead th.sort-desc::after { content: ' ↓'; color: var(--gold); }
thead th.sort-asc, thead th.sort-desc { color: var(--gold2); }

tbody td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  color: var(--tx); vertical-align: middle; white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: rgba(255,255,255,.025); }
.tr { text-align: right; } .tc { text-align: center; }
.mono { font-family: var(--mono); font-size: 10px; }
.sym {
  font-family: var(--mono); font-weight: 500; font-size: 12px;
  color: var(--gold2); letter-spacing: -.01em;
}

/* ── BADGES ── */
.acct-badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .05em;
  border: 1px solid var(--border2); background: var(--ink3); color: var(--tx2);
  white-space: nowrap;
}
.acct-badge[data-acct="My Main"]    { border-color: rgba(201,168,76,.3);  color: var(--c-main);    background: rgba(201,168,76,.06);  }
.acct-badge[data-acct="Yuri Main"]  { border-color: rgba(45,212,191,.3);  color: var(--c-yuri);   background: rgba(45,212,191,.06);  }
.acct-badge[data-acct="My Trading"] { border-color: rgba(251,113,133,.3); color: var(--c-trading); background: rgba(251,113,133,.06); }
.acct-badge[data-acct="webull"]     { border-color: rgba(249,115,22,.3);  color: var(--c-webull); background: rgba(249,115,22,.06);  }
.acct-badge[data-acct="moomoo"]     { border-color: rgba(56,189,248,.3);  color: var(--c-moomoo); background: rgba(56,189,248,.06);  }

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
}
.pp { background: rgba(74,222,128,.1); color: var(--green); }
.pn { background: rgba(248,113,113,.1); color: var(--red); }
.beat { background: rgba(74,222,128,.1); color: var(--green);
  padding: 2px 7px; border-radius: var(--r); font-family: var(--mono); font-size: 9px; }
.lag  { background: rgba(248,113,113,.1); color: var(--red);
  padding: 2px 7px; border-radius: var(--r); font-family: var(--mono); font-size: 9px; }

/* ── FILTERS ── */
.frow { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 1.25rem; align-items: flex-end; }
.fg { display: flex; flex-direction: column; gap: 5px; }
.fl { font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  color: var(--tx3); text-transform: uppercase; }
.frow select, .frow input {
  background: var(--ink3); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 7px 12px;
  color: var(--tx); font-family: var(--mono); font-size: 10px;
  outline: none; cursor: pointer; min-height: 32px;
  transition: border-color .14s, background .14s;
}
.frow select:focus, .frow input:focus {
  border-color: rgba(201,168,76,.4); background: var(--ink4);
}
.frow input { min-width: 150px; }

/* ── GAINERS / LOSERS ── */
.gl-list { display: flex; flex-direction: column; gap: 2px; }
.gl-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r2);
  transition: background .1s; cursor: default;
}
.gl-row:hover { background: rgba(255,255,255,.03); }
.gl-sym { font-family: var(--mono); font-size: 11px; font-weight: 500; width: 58px; flex-shrink: 0; }
.gl-track { flex: 1; height: 18px; background: var(--ink3); border-radius: 3px; overflow: hidden; position: relative; }
.gl-bar  { height: 100%; border-radius: 3px; transition: width .3s ease; }
.gl-val  { font-family: var(--mono); font-size: 10px; min-width: 86px; text-align: right; flex-shrink: 0; }
.gl-pct  { font-family: var(--mono); font-size: 9px; color: var(--tx3); min-width: 50px; text-align: right; flex-shrink: 0; }

/* ── CAGR CARDS ── */
.cagr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.cagr-card {
  background: var(--ink3); border-radius: var(--r3);
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  transition: border-color .2s, transform .2s;
  position: relative; overflow: hidden;
}
.cagr-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.cagr-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 60%; height: 100%;
  background: radial-gradient(ellipse at 100% 0%, var(--accent-color, rgba(201,168,76,.06)), transparent 60%);
  pointer-events: none;
}
.cagr-acct { font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; margin-bottom: .6rem; }
.cagr-val {
  font-family: var(--serif); font-size: 2.2rem;
  font-weight: 400; line-height: 1; letter-spacing: -.02em; margin-bottom: .3rem;
}
.cagr-cum { font-family: var(--mono); font-size: 10px; color: var(--tx2); }
.cagr-note { font-family: var(--mono); font-size: 9px; color: var(--tx3); margin-top: .35rem; }

/* ── DEPOSIT BARS ── */
.dep-bar-wrap { display: flex; flex-direction: column; gap: 10px; }
.dep-bar-row  { display: flex; align-items: center; gap: 12px; }
.dep-bar-label { font-family: var(--mono); font-size: 10px; width: 90px; flex-shrink: 0; }
.dep-bar-track { flex: 1; height: 24px; background: var(--ink3);
  border-radius: 4px; overflow: hidden; }
.dep-bar-fill  {
  height: 100%; border-radius: 4px;
  display: flex; align-items: center; padding: 0 10px;
  transition: width .4s ease;
}
.dep-bar-fill span { font-family: var(--mono); font-size: 9px; white-space: nowrap; overflow: hidden; }
.dep-bar-val  { font-family: var(--mono); font-size: 10px; min-width: 100px; text-align: right; flex-shrink: 0; }
.dep-bar-gain { font-family: var(--mono); font-size: 10px; min-width: 80px; text-align: right; flex-shrink: 0; }

/* ── PCTBAR ── */
.pctbar { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.pctbar-track { width: 44px; height: 3px; background: var(--ink4);
  border-radius: 2px; overflow: hidden; }
.pctbar-fill { height: 100%; border-radius: 2px; }

/* ── PAGINATION ── */
.pgbtn {
  padding: 5px 11px; background: var(--ink3);
  border: 1px solid var(--border); border-radius: var(--r);
  font-family: var(--mono); font-size: 9px; color: var(--tx2);
  cursor: pointer; transition: all .14s;
}
.pgbtn:hover { border-color: var(--border2); color: var(--tx); }
.pgbtn.on { border-color: rgba(201,168,76,.4); color: var(--gold2); background: rgba(201,168,76,.07); }
.pginfo { font-family: var(--mono); font-size: 10px; color: var(--tx3); }

/* ── CURR TAG ── */
.curr-tag {
  font-size: 8px; padding: 1px 5px; border-radius: 3px;
  background: var(--ink4); color: var(--tx3); margin-left: 4px;
  vertical-align: middle; font-family: var(--mono); letter-spacing: .05em;
}

/* ── FOOTER ── */
footer {
  text-align: center; padding: 3rem 2rem;
  color: var(--tx3); font-family: var(--mono);
  font-size: 9px; letter-spacing: .12em;
  border-top: 1px solid var(--border); margin-top: 3rem;
}

/* ── EMPTY STATE ── */
.empty {
  text-align: center; padding: 3rem;
  color: var(--tx3); font-family: var(--mono); font-size: 11px;
}

/* ── POSITIONS ── */
.pos-section { margin-bottom: 2rem; }
.pos-header {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 1.25rem;
  background: var(--ink3); border: 1px solid var(--border);
  border-radius: var(--r3) var(--r3) 0 0;
  margin-bottom: 0;
}
.pos-header + .card { border-radius: 0 0 var(--r3) var(--r3); padding-top: 0; border-top: none; }
.pos-acct-name { font-family: var(--serif); font-size: 1.1rem; letter-spacing: -.01em; }
.pos-stat { font-family: var(--mono); font-size: 9px; color: var(--tx3); }
.pos-stat strong { color: var(--tx); }

/* ── MONTHLY CHART ── */
.monthly-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width:768px) { .monthly-grid { grid-template-columns: 1fr; } }
.chart-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--tx3); margin-bottom: .5rem;
}
