:root {
  --bg: #000; --bg2: #0a0a0a; --card: #111; --card2: #161616; --fg: #fff; --muted: #8f8f8f; --line: #262626; --soft: #1c1c1c;
  --up: #22c55e; --down: #ef4444; --up-soft: rgba(34,197,94,.12); --down-soft: rgba(239,68,68,.12);
  --radius: 10px; --side: 220px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.45; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.1rem; } h3 { font-size: .95rem; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .xs { font-size: .75rem; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }
.up::before { content: "▲ "; font-size: .7em; } .down::before { content: "▼ "; font-size: .7em; } .flat::before { content: "— "; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: .75rem; font-weight: 500; }
.pill.up { background: var(--up-soft); } .pill.down { background: var(--down-soft); } .pill.flat { background: var(--soft); }
.hide-values .money { filter: blur(6px); user-select: none; }

/* shell */
.shell { display: flex; min-height: 100dvh; }
.side { width: var(--side); flex: none; border-right: 1px solid var(--line); background: var(--bg2); position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 20px 14px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .95rem; padding: 0 8px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--fg); color: var(--bg); display: grid; place-items: center; font-weight: 800; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.side nav a svg { width: 20px; height: 20px; }
.side nav a:hover { color: var(--fg); background: var(--soft); }
.side nav a.active { color: var(--fg); background: var(--soft); box-shadow: inset 3px 0 0 var(--fg); }
.side-foot { margin-top: auto; padding: 0 8px; }
.content { flex: 1; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; background: rgba(0,0,0,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.crumb { font-weight: 600; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; } .icon-btn:hover { background: var(--soft); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--fg); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: .9rem; text-transform: uppercase; }
main { padding: 24px; max-width: 1180px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .between { justify-content: space-between; }
.section { margin-top: 28px; } .section > .row { margin-bottom: 12px; }

/* hero + tiles */
.hero { background: linear-gradient(135deg, var(--card2), var(--bg2)); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.hero .label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hero .big { font-size: 2.4rem; font-weight: 700; margin-top: 4px; letter-spacing: -0.02em; line-height: 1.1; }
.hero .sub { margin-top: 8px; }
/* patrimônio em cima; abaixo, três colunas iguais separadas por filetes */
.hero .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.hero .hero-stats > div { padding: 0 20px; border-left: 1px solid var(--line); }
.hero .hero-stats > div:first-child { padding-left: 0; border-left: 0; }
.hero .hero-stats .k { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.hero .hero-stats .v { font-weight: 600; font-size: 1.3rem; margin-top: 4px; letter-spacing: -0.01em; }
.hero .hero-stats .xs { margin-top: 2px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tiles.mkt6 { grid-template-columns: repeat(6, 1fr); } .tile.mkt .value { font-size: 1.05rem; }
.mktrow { padding: 10px 0; border-top: 1px solid var(--line); } .mktrow:first-of-type { border-top: 0; } .mktrow .chart { height: 150px; margin-top: 6px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile .value { font-size: 1.3rem; font-weight: 600; margin-top: 4px; }
.tile .sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.two { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h3 { margin-bottom: 10px; }

/* donut */
.donut { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.donut svg { width: 120px; height: 120px; fill: none; stroke: none; }
.legend { display: grid; gap: 6px; font-size: .85rem; }
.legend div { display: flex; align-items: center; gap: 8px; } .legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .pct { margin-left: auto; color: var(--muted); }

/* product cards */
.cat { margin-top: 24px; }
.cat h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cat h2 .count { font-size: .8rem; color: var(--muted); font-weight: 400; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: var(--muted); transform: translateY(-1px); }
.pcard .t { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pcard .name { font-weight: 600; line-height: 1.25; } .pcard .mgr { font-size: .8rem; color: var(--muted); }
.pcard .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: .72rem; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: var(--muted); }
.tag.r1 { color: var(--up); border-color: var(--up); } .tag.r2 { color: #eab308; border-color: #eab308; } .tag.r3 { color: var(--down); border-color: var(--down); }
.tag.y { color: var(--fg); border-color: var(--fg); }
.tag.lock, .badge.lock { color: #eab308; border-color: #eab308; display: inline-flex; align-items: center; gap: 4px; }
.tag svg, .badge svg, .tile.locked .label svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -1px; }
.tile.locked { border-color: #eab308; } .tile.locked .label { color: #eab308; }
.notice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #eab308; border-radius: 8px; padding: 10px 12px; font-size: .85rem; color: var(--fg); } .notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: #eab308; fill: none; stroke: currentColor; stroke-width: 2; }
.keys { grid-template-columns: 1.4fr 1fr auto; }
code.key { display: block; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: .85rem; word-break: break-all; user-select: all; }
.ep { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; } .ep:first-of-type { border-top: 0; padding-top: 0; }
pre.code { margin: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: .8rem; line-height: 1.5; overflow-x: auto; white-space: pre; }
.langs { display: flex; gap: 4px; flex-wrap: wrap; } .lang { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 4px 10px; font-size: .8rem; cursor: pointer; } .lang.on { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.ep pre { margin: 4px 0 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: .78rem; overflow-x: auto; white-space: pre; }
.pcard .foot { display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.pcard .foot .k { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pcard .foot .v { font-weight: 600; }

/* lists */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list .item { display: grid; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.list .item:first-child { border-top: 0; }
.list a.item:hover { background: var(--soft); }
.list .head { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg2); padding: 8px 16px; }
.funds .item { grid-template-columns: 1.8fr 1fr 1fr 1fr .8fr; }
.movs .item { grid-template-columns: 1.6fr 1fr 1fr; }
.ticker { font-weight: 600; } .name { font-size: .82rem; color: var(--muted); }
.right { text-align: right; white-space: nowrap; }
.badge { display: inline-block; border: 1px solid var(--fg); border-radius: 999px; padding: 1px 8px; font-size: .75rem; }
.badge.soft { border-color: var(--line); color: var(--muted); }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; color: var(--muted); }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.mov-ico { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.mov-ico.aporte, .mov-ico.entrada { background: var(--up-soft); color: var(--up); } .mov-ico.resgate, .mov-ico.saida { background: var(--down-soft); color: var(--down); }
.mov-ico svg { width: 16px; height: 16px; }
.movline { display: flex; align-items: center; gap: 12px; }

/* forms */
.form { display: grid; gap: 10px; align-content: start; }
.form label { display: grid; gap: 4px; font-size: .82rem; color: var(--muted); }
input, select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); outline: none; }
input:focus, select:focus { border-color: var(--fg); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--fg); background: var(--fg); color: var(--bg); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); } .btn.ghost:hover { background: var(--soft); opacity: 1; }
.btn.sm { padding: 6px 10px; font-size: .85rem; }
.btn.link { border: 0; background: none; color: var(--muted); padding: 4px 6px; font-weight: 500; } .btn.link:hover { color: var(--fg); opacity: 1; }
.btn.up { background: var(--up); border-color: var(--up); color: #000; } .btn.down { background: var(--down); border-color: var(--down); color: #fff; }
.btn.up::before, .btn.down::before { content: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.msg { font-size: .85rem; margin-top: 6px; } .msg.err { color: var(--down); font-weight: 500; } .msg.ok { color: var(--up); }
.tabs { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.tabs button { flex: 1; padding: 9px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-weight: 500; }
.tabs button.on { background: var(--fg); color: var(--bg); }
.preview { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; font-size: .9rem; background: var(--bg); }
.info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; }
.info .k { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; } .info .v { font-weight: 500; }
details.adv summary { cursor: pointer; color: var(--muted); font-size: .85rem; }

/* chart */
.chart { width: 100%; height: 200px; display: block; }
.chart .line { fill: none; stroke: var(--fg); stroke-width: 1.6; } .chart .line.up { stroke: var(--up); } .chart .line.down { stroke: var(--down); }
.chart .area { stroke: none; fill: url(#g-up); } .chart .area.down { fill: url(#g-down); }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart text { font-size: 11px; fill: var(--muted); stroke: none; }
.spark { width: 80px; height: 26px; } .spark path { fill: none; stroke-width: 1.4; }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at top, #151515, #000 60%); }
.login form { width: 100%; max-width: 360px; display: grid; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.login .brand { justify-content: center; margin-bottom: 8px; font-size: 1.05rem; }
.login .tag-line { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 8px; }

/* mobile */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; width: auto; border-right: 0; border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 10; }
  .side .brand, .side-foot { display: none; }
  .side nav { flex-direction: row; justify-content: space-around; }
  .side nav a { flex-direction: column; gap: 3px; font-size: .7rem; padding: 6px 10px; }
  .side nav a.active { box-shadow: none; background: transparent; }
  .topbar { padding: 0 16px; }
  main { padding: 16px 16px 90px; }
  .hero { padding: 18px; } .hero .big { font-size: 1.9rem; }
  .hero .hero-stats { grid-template-columns: 1fr; gap: 14px; margin-top: 16px; padding-top: 16px; }
  .hero .hero-stats > div { padding: 0; border-left: 0; display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'k v' 'x v'; align-items: center; column-gap: 12px; }
  .hero .hero-stats .k { grid-area: k; } .hero .hero-stats .v { grid-area: v; margin-top: 0; font-size: 1.1rem; } .hero .hero-stats .xs { grid-area: x; margin-top: 0; }
  .tiles, .tiles.mkt6 { grid-template-columns: 1fr 1fr; } .tile .value { font-size: 1.1rem; }
  .two, .grid2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .funds .item { grid-template-columns: 1.6fr 1fr .8fr; }
  .movs .item { grid-template-columns: 1.6fr 1fr 1fr; }
  .hide-m { display: none !important; }
}
@media (min-width: 861px) and (max-width: 1100px) { .cards { grid-template-columns: 1fr 1fr; } .tiles.mkt6 { grid-template-columns: repeat(3, 1fr); } }
