/* ============================================================
   InvestAI - Professional Finance Platform CSS
   Bloomberg / TradingView / XP Investimentos Style
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-primary:    #0a0e1a;
  --bg-secondary:  #0f1629;
  --bg-card:       #141b2d;
  --bg-card-hover: #1a2235;
  --border:        rgba(255,255,255,0.06);
  --border-accent: rgba(0,212,255,0.2);
  --text-primary:  #e8ecf1;
  --text-secondary:#8b9dc3;
  --text-muted:    #4a5568;
  --accent:        #00d4ff;
  --gain:          #00c853;
  --loss:          #ff3d57;
  --warning:       #ffb300;
  --neutral:       #607d8b;
  --sidebar-width: 220px;
  --ticker-height: 36px;
  --header-height: 52px;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #33deff; }

button { cursor: pointer; font-family: inherit; }

/* ============================================================
   TICKER TAPE
   ============================================================ */
.ticker-tape {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--ticker-height);
  background: #080c17;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ticker-content {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker-scroll 80s linear infinite;
  gap: 0;
}

.ticker-content:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  border-right: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  height: var(--ticker-height);
}

.ticker-item .t-symbol {
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

.ticker-item .t-price {
  color: var(--text-primary);
}

.ticker-item .t-change {
  font-weight: 600;
  font-size: 11px;
}

.ticker-item .t-change.pos { color: var(--gain); }
.ticker-item .t-change.neg { color: var(--loss); }

/* ============================================================
   MAIN HEADER / NAV
   ============================================================ */
.main-header {
  position: sticky;
  top: var(--ticker-height);
  z-index: 150;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: var(--sidebar-width);
  padding-right: 20px;
  border-right: 1px solid var(--border);
}

.header-brand .brand-logo {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #0a0e1a;
}

.header-brand .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.header-brand .brand-tag {
  font-size: 9px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 16px;
  flex: 1;
}

.header-nav a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.01em;
}

.header-nav a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.header-nav a.active {
  color: var(--accent);
  background: rgba(0,212,255,0.08);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.header-clock {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 110px;
  text-align: right;
}

.header-clock .clock-time {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
}

.market-status-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.open   { background: var(--gain); box-shadow: 0 0 6px var(--gain); animation: pulse-dot 2s infinite; }
.status-dot.closed { background: var(--loss); }
.status-dot.pre    { background: var(--warning); animation: pulse-dot 2s infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.btn-logout-header {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}

.btn-logout-header:hover {
  border-color: var(--loss);
  color: var(--loss);
}

/* ============================================================
   LAYOUT: SIDEBAR + MAIN
   ============================================================ */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--ticker-height) - var(--header-height));
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: sticky;
  top: calc(var(--ticker-height) + var(--header-height));
  height: calc(100vh - var(--ticker-height) - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-section {
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-section-title {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Mini market overview in sidebar */
.sidebar-market-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  transition: background 0.1s;
}

.sidebar-market-item:hover { background: rgba(255,255,255,0.03); }

.sidebar-market-item .sm-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sidebar-market-item .sm-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.sidebar-market-item .sm-change {
  font-size: 10.5px;
  font-weight: 600;
}

/* Sidebar nav links */
.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 1px;
}

.sidebar-nav-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.sidebar-nav-link.active {
  color: var(--accent);
  background: rgba(0,212,255,0.08);
}

.sidebar-nav-link .nav-icon { font-size: 14px; width: 18px; }

/* Sidebar mini action cards */
.sidebar-card-mini {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 6px;
  transition: border-color 0.15s;
}

.sidebar-card-mini:hover { border-color: var(--border-accent); }

.sidebar-card-mini .scm-type {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.sidebar-card-mini .scm-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.sidebar-card-mini .scm-sub {
  font-size: 10px;
  color: var(--text-secondary);
}

/* ── Main content ── */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 20px 24px;
  overflow-x: hidden;
}

/* ============================================================
   STAT CARDS (Portfolio Summary)
   ============================================================ */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.4;
}

.stat-card.gain-card::before { background: var(--gain); }
.stat-card.loss-card::before { background: var(--loss); }

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.stat-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-value.green { color: var(--gain); }
.stat-value.red   { color: var(--loss); }
.stat-value.cyan  { color: var(--accent); }

.stat-sub {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   ACTION CARDS (Mentor Ativo)
   ============================================================ */
.action-cards-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  min-width: 260px;
  max-width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.action-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.action-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.action-card-type {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 7px;
  border-radius: 3px;
}

.action-card-type.alerta   { background: rgba(255,179,0,0.12); color: var(--warning); }
.action-card-type.oportunidade { background: rgba(0,200,83,0.12); color: var(--gain); }
.action-card-type.rebalanceamento { background: rgba(0,212,255,0.12); color: var(--accent); }
.action-card-type.noticia  { background: rgba(96,125,139,0.15); color: var(--neutral); }

.action-card-ticker {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}

.action-card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.action-card-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.action-card-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 11px;
}

.action-card-metric .metric-label { color: var(--text-muted); }
.action-card-metric .metric-value { font-weight: 700; color: var(--text-primary); }
.action-card-metric .metric-value.green { color: var(--gain); }
.action-card-metric .metric-value.red   { color: var(--loss); }

.action-card-buttons {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.btn-action {
  flex: 1;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid;
  transition: all 0.15s;
}

.btn-action.primary {
  background: rgba(0,212,255,0.1);
  border-color: rgba(0,212,255,0.3);
  color: var(--accent);
}

.btn-action.primary:hover {
  background: rgba(0,212,255,0.2);
  border-color: var(--accent);
}

.btn-action.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-action.secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.btn-action.dismiss {
  flex: 0;
  padding: 6px 8px;
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-action.dismiss:hover {
  border-color: var(--loss);
  color: var(--loss);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab-btn {
  padding: 9px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
  letter-spacing: 0.01em;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.02);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   DATA TABLES
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table thead tr {
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table th.right, .data-table td.right { text-align: right; }
.data-table th.center, .data-table td.center { text-align: center; }

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.015);
}

.data-table tbody tr:hover {
  background: rgba(255,255,255,0.04);
  cursor: pointer;
}

.data-table td {
  padding: 9px 12px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.ticker-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ticker-cell .tk-symbol {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}

.ticker-cell .tk-name {
  font-size: 10.5px;
  color: var(--text-secondary);
}

.price-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.price-change.positive { color: var(--gain); }
.price-change.negative { color: var(--loss); }
.price-change.neutral  { color: var(--neutral); }

.price-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.price-badge.positive { background: rgba(0,200,83,0.12); color: var(--gain); }
.price-badge.negative { background: rgba(255,61,87,0.12); color: var(--loss); }

/* ============================================================
   BADGE TIPOS (Asset Types)
   ============================================================ */
.badge-tipo {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-tipo.acoes, .badge-tipo.acao   { background: rgba(59,130,246,0.15); color: #5b9cf6; }
.badge-tipo.fii, .badge-tipo.fiis    { background: rgba(0,200,83,0.12); color: var(--gain); }
.badge-tipo.cripto, .badge-tipo.crypto { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-tipo.rf, .badge-tipo.renda-fixa { background: rgba(139,92,246,0.15); color: #a78bfa; }
.badge-tipo.etf                       { background: rgba(236,72,153,0.15); color: #f472b6; }

/* ============================================================
   SEMAPHORE DOTS (Watchlist)
   ============================================================ */
.semaphore-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.semaphore-dot.verde   { background: var(--gain); box-shadow: 0 0 5px var(--gain); }
.semaphore-dot.amarelo { background: var(--warning); box-shadow: 0 0 5px var(--warning); }
.semaphore-dot.vermelho{ background: var(--loss); box-shadow: 0 0 5px var(--loss); }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
  background: linear-gradient(90deg, var(--warning), var(--gain));
}

/* ============================================================
   MARKET INDEX CARDS (Noticias page)
   ============================================================ */
.market-indices-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.market-index-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px 14px;
  transition: all 0.15s;
  cursor: default;
}

.market-index-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.market-index-card .mic-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.market-index-card .mic-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin-bottom: 3px;
}

.market-index-card .mic-change {
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.market-index-card .mic-change.pos { color: var(--gain); }
.market-index-card .mic-change.neg { color: var(--loss); }

/* ============================================================
   CARDS (Generic)
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

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

.card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.section-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
}

.section-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ============================================================
   NEWS CARDS
   ============================================================ */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px 14px;
  transition: background 0.15s, border-left-color 0.15s;
}

.news-card:hover {
  background: var(--bg-card-hover);
  border-left-color: #33deff;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.news-source {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 1px 6px;
  border-radius: 2px;
  background: rgba(0,212,255,0.1);
  color: var(--accent);
}

.news-time {
  font-size: 10.5px;
  color: var(--text-muted);
}

.news-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 4px;
}

.news-title a { color: var(--text-primary); }
.news-title a:hover { color: var(--accent); }

.news-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.news-filter-btn {
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.news-filter-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

.news-filter-btn.active {
  background: rgba(0,212,255,0.1);
  border-color: var(--border-accent);
  color: var(--accent);
}

/* ============================================================
   AI ANALYSIS BANNER
   ============================================================ */
.ai-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

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

.ai-banner-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.ai-scenario-badge {
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.ai-scenario-badge.otimista  { background: rgba(0,200,83,0.15); color: var(--gain); }
.ai-scenario-badge.neutro    { background: rgba(255,179,0,0.15); color: var(--warning); }
.ai-scenario-badge.pessimista{ background: rgba(255,61,87,0.15); color: var(--loss); }

.ai-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

.ai-points { display: flex; flex-direction: column; gap: 4px; }

.ai-point {
  font-size: 12px;
  color: var(--text-secondary);
  padding-left: 12px;
  position: relative;
}

.ai-point::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ============================================================
   CENARIOS PAGE - 4-column comparison
   ============================================================ */
.cenarios-comparison {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.cenario-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.cenario-col.selected {
  border-color: var(--accent);
}

.cenario-col:hover { border-color: var(--border-accent); }

.cenario-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
}

.cenario-col-header .cc-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.cenario-col-header .cc-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.cenario-col-header .cc-risk {
  font-size: 10.5px;
  font-weight: 600;
  margin-top: 2px;
}

.cc-risk.low    { color: var(--gain); }
.cc-risk.medium { color: var(--warning); }
.cc-risk.high   { color: var(--loss); }

.cenario-col-body { padding: 12px 14px; }

.cenario-alloc-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
  gap: 1px;
}

.cenario-alloc-bar .cab-rf  { background: #5b9cf6; }
.cenario-alloc-bar .cab-fii { background: var(--gain); }
.cenario-alloc-bar .cab-rv  { background: #f59e0b; }
.cenario-alloc-bar .cab-crypto { background: #f472b6; }

.alloc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}

.alloc-row:last-child { border-bottom: none; }

.alloc-row .ar-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.alloc-row .ar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.alloc-row .ar-pct {
  font-weight: 700;
  color: var(--text-primary);
}

.cenario-result {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.cenario-result .cr-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.cenario-result .cr-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--gain);
  font-variant-numeric: tabular-nums;
}

.cenario-result .cr-total {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Transfer recommendations */
.transfer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-bottom: 20px;
}

.transfer-table th, .transfer-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}

.transfer-table th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
}

.transfer-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.transfer-tag.tirar  { background: rgba(255,61,87,0.12); color: var(--loss); }
.transfer-tag.colocar{ background: rgba(0,200,83,0.12); color: var(--gain); }
.transfer-tag.manter { background: rgba(91,156,246,0.12); color: #5b9cf6; }
.transfer-tag.urgente{ background: rgba(255,179,0,0.12); color: var(--warning); }

/* SELIC Simulator */
.selic-simulator {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.selic-inputs {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 14px 0;
  flex-wrap: wrap;
}

.selic-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.selic-input-group label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.selic-input-group input[type="range"] {
  width: 200px;
  height: 4px;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.selic-input-group input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.selic-value-display {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.selic-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.selic-result-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.selic-result-card .src-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.selic-result-card .src-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--gain);
  font-variant-numeric: tabular-nums;
}

.selic-result-card .src-change {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ============================================================
   SMARTMONEY PAGE
   ============================================================ */
.whale-alert {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: background 0.15s;
}

.whale-alert:hover { background: var(--bg-card-hover); }

.whale-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

.whale-body { flex: 1; min-width: 0; }

.whale-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.whale-ticker {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}

.whale-time {
  font-size: 10.5px;
  color: var(--text-muted);
}

.whale-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.whale-amount {
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
  font-variant-numeric: tabular-nums;
}

/* Insider card */
.insider-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 15px;
  margin-bottom: 8px;
  transition: background 0.15s;
}

.insider-card:hover { background: var(--bg-card-hover); }

.insider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.insider-company {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.insider-type-badge {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.insider-type-badge.compra { background: rgba(0,200,83,0.12); color: var(--gain); }
.insider-type-badge.venda  { background: rgba(255,61,87,0.12); color: var(--loss); }

.insider-title { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.insider-date  { font-size: 10.5px; color: var(--text-muted); }
.insider-link  { font-size: 11px; color: var(--accent); }

/* ============================================================
   PLANO PAGE - Stepper
   ============================================================ */
.stepper {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding: 0 10px;
}

.step-item {
  display: flex;
  align-items: center;
  flex: 1;
}

.step-item:last-child { flex: 0; }

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  flex-shrink: 0;
  transition: all 0.2s;
}

.step-circle.done {
  background: rgba(0,200,83,0.15);
  border-color: var(--gain);
  color: var(--gain);
}

.step-circle.active {
  background: rgba(0,212,255,0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.step-info {
  display: flex;
  flex-direction: column;
  margin-left: 8px;
}

.step-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.step-sublabel {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.step-connector {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 10px;
}

.step-connector.done { background: var(--gain); opacity: 0.4; }

/* Accordion */
.accordion { display: flex; flex-direction: column; gap: 6px; }

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.accordion-header:hover { background: rgba(255,255,255,0.03); }

.accordion-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-icon {
  color: var(--text-muted);
  font-size: 10px;
  transition: transform 0.2s;
}

.accordion-item.open .accordion-icon { transform: rotate(180deg); }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  border-top: 0px solid var(--border);
}

.accordion-item.open .accordion-body {
  max-height: 600px;
  border-top-width: 1px;
}

.accordion-inner { padding: 14px 16px; }

.guide-step {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.guide-step:last-child { border-bottom: none; }

.guide-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,212,255,0.1);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.guide-step-content strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.guide-step-content p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 5px;
  margin-bottom: 6px;
  transition: background 0.15s;
}

.checklist-item:hover { background: rgba(255,255,255,0.04); }

.checklist-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent);
}

.checklist-item label {
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  flex: 1;
}

.checklist-item input:checked + label {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Profile selector */
.profile-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.btn-profile {
  flex: 1;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-secondary);
  text-align: left;
  transition: all 0.15s;
}

.btn-profile:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.btn-profile.active {
  background: rgba(0,212,255,0.08);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-profile .bp-title {
  font-size: 13px;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.btn-profile .bp-sub {
  font-size: 10.5px;
  font-weight: 500;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.modal.open { display: flex; }

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px;
  max-width: 680px;
  width: 90%;
  max-height: 88vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-content.large { max-width: 920px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close:hover { border-color: var(--loss); color: var(--loss); }

/* Period tabs in modal */
.period-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}

.period-btn {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.period-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

.period-btn.active {
  background: rgba(0,212,255,0.1);
  border-color: var(--border-accent);
  color: var(--accent);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 44px;
  width: 100%;
  max-width: 400px;
}

.login-brand {
  text-align: center;
  margin-bottom: 30px;
}

.login-brand .lb-logo {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: #0a0e1a;
  margin-bottom: 12px;
}

.login-brand .lb-name {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.login-brand .lb-sub {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label,
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.form-group input,
.form-input {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
  box-sizing: border-box;
}

.form-group input:focus,
.form-input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 2px rgba(0,212,255,0.08);
}

/* Primary action button (login, submit) */
.btn-primary,
.btn-login {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #0a0e1a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 4px;
}

.btn-primary:hover,
.btn-login:hover {
  background: #33ddff;
  transform: translateY(-1px);
}

.btn-primary:disabled,
.btn-login:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-login:hover { background: #33deff; }

/* ============================================================
   LOADING / ERROR STATES
   ============================================================ */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.07);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-state {
  padding: 20px;
  background: rgba(255,61,87,0.08);
  border: 1px solid rgba(255,61,87,0.2);
  border-radius: 6px;
  color: var(--loss);
  font-size: 12.5px;
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* ============================================================
   PAGE HEADER (sub-pages)
   ============================================================ */
.page-header {
  margin-bottom: 20px;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ============================================================
   DISTRIBUTION BAR
   ============================================================ */
.dist-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  gap: 1px;
  margin: 10px 0;
}

/* ============================================================
   CRYPTO GRID
   ============================================================ */
.crypto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.crypto-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px;
  transition: all 0.15s;
}

.crypto-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.crypto-card .cc-symbol {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  margin-bottom: 1px;
}

.crypto-card .cc-name {
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.crypto-card .cc-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin-bottom: 3px;
}

.crypto-card .cc-change {
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   CHART CONTAINER
   ============================================================ */
.chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

/* ============================================================
   PORTFOLIO DONUT CHART SECTION
   ============================================================ */
.portfolio-chart-section {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

/* ============================================================
   SCROLLBARS (webkit)
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary   { color: var(--text-primary); }
.text-accent    { color: var(--accent); }
.text-gain      { color: var(--gain); }
.text-loss      { color: var(--loss); }
.text-warning   { color: var(--warning); }

.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fs-11  { font-size: 11px; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }

.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

.w-full { width: 100%; }
.overflow-hidden { overflow: hidden; }

.tabular { font-variant-numeric: tabular-nums; }
.mono    { font-family: 'Courier New', monospace; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .stat-cards-row { grid-template-columns: 1fr 1fr; }
  .market-indices-grid { grid-template-columns: repeat(4, 1fr); }
  .cenarios-comparison { grid-template-columns: repeat(2, 1fr); }
  .selic-results-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-chart-section { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { display: none; }
  .stat-cards-row { grid-template-columns: 1fr; }
  .market-indices-grid { grid-template-columns: repeat(2, 1fr); }
  .cenarios-comparison { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .main-content { padding: 12px 14px; }
  .crypto-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-btns { flex-direction: column; }
}
