@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&family=DM+Serif+Display:ital@0;1&display=swap');

/* ─── TOKENS — DARK (default) ─────────────────────────────────── */
:root {
  --red: #C41A1A; --red-dark: #8B0000; --red-glow: rgba(196,26,26,0.2);
  --gold: #F5A623; --gold-dim: rgba(245,166,35,0.12); --gold-glow: rgba(245,166,35,0.25);
  --bg:   #080809; --bg2: #0E0E11; --bg3: #141418; --bg4: #1A1A20; --bg5: #202028;
  --border: rgba(255,255,255,0.06); --border2: rgba(245,166,35,0.25); --border3: rgba(255,255,255,0.12);
  --text: #ECEAE4; --text2: #8A8884; --text3: #4E4D4A;
  --up: #1FC96E; --up-bg: rgba(31,201,110,0.10); --up-glow: rgba(31,201,110,0.2);
  --dn: #E8503A; --dn-bg: rgba(232,80,58,0.10); --dn-glow: rgba(232,80,58,0.2);
  --radius: 10px; --radius-lg: 14px; --radius-xl: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.7);
  --font-display: 'DM Serif Display', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
  color-scheme: dark;
}

/* ─── LIGHT MODE ──────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:   #F5F5F0; --bg2: #FFFFFF; --bg3: #F0F0EA; --bg4: #E8E8E0; --bg5: #DDDDD5;
  --border: rgba(0,0,0,0.08); --border2: rgba(245,166,35,0.35); --border3: rgba(0,0,0,0.15);
  --text: #1A1A18; --text2: #5A5A56; --text3: #9A9A96;
  --up-bg: rgba(31,201,110,0.12); --dn-bg: rgba(232,80,58,0.10);
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
  --gold-dim: rgba(245,166,35,0.15);
  color-scheme: light;
}
[data-theme="light"] body::before { display: none; }
[data-theme="light"] .nav-badge { background: linear-gradient(135deg,#C41A1A,#8B0000); }

/* ─── RESET & BASE ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(196,26,26,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 110%, rgba(245,166,35,0.05) 0%, transparent 50%);
  pointer-events: none; z-index: 0;
}
a { color: inherit; text-decoration: none; }

/* ─── KEYFRAMES ───────────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity:0; transform:translateY(8px) } to { opacity:1; transform:none } }
@keyframes slideDown { from { opacity:0; transform:translateY(-6px) } to { opacity:1; transform:none } }
@keyframes pulse     { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes shimmer   { from{background-position:-200% 0} to{background-position:200% 0} }
@keyframes spin      { to{transform:rotate(360deg)} }
@keyframes glow-gold {
  0%,100%{box-shadow:0 0 12px var(--gold-glow)} 50%{box-shadow:0 0 24px rgba(245,166,35,0.4)}
}
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes count-up { from { opacity:0; transform:scale(0.9) } to { opacity:1; transform:scale(1) } }

/* ─── PAGE LOAD ANIMATION ─────────────────────────────────────── */
.fade-in { animation: fadeIn 0.5s ease both; }
.fade-in-1 { animation: fadeIn 0.5s 0.05s ease both; }
.fade-in-2 { animation: fadeIn 0.5s 0.12s ease both; }
.fade-in-3 { animation: fadeIn 0.5s 0.22s ease both; }
.fade-in-4 { animation: fadeIn 0.5s 0.32s ease both; }
.fade-in-5 { animation: fadeIn 0.5s 0.42s ease both; }

/* ─── NAV ─────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(8,8,9,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex; align-items: center; gap: 1rem; height: 58px;
  animation: slideDown 0.35s ease both;
}
[data-theme="light"] nav { background: rgba(245,245,240,0.92); }

.nav-logo {
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0; margin-right: .5rem;
}
.nav-logo img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; }
.nav-logo span {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--text);
  line-height: 1;
}
.nav-logo span em { color: var(--gold); font-style: italic; }

.nav-links {
  display: flex; gap: 1px; overflow-x: auto; scrollbar-width: none;
  margin: 0 auto; /* centraliza */
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  font-size: 12.5px; font-weight: 600;
  color: var(--text2); padding: 5px 10px;
  border-radius: 7px;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.nav-links a:hover { background: var(--bg3); color: var(--text); }
.nav-links a.active {
  background: var(--bg4);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(245,166,35,0.2);
}

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Theme toggle button */
.theme-toggle {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px;
  transition: var(--transition); flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--border3); background: var(--bg4); }

/* Global search shortcut */
.nav-search-shortcut {
  font-size: 10px; font-family: var(--font-mono);
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px; color: var(--text3);
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  pointer-events: none;
}

.nav-search-wrap { position: relative; }
.nav-search {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 42px 6px 32px;
  font-size: 12.5px;
  color: var(--text);
  width: 190px;
  font-family: var(--font-body);
  transition: var(--transition);
}
.nav-search::placeholder { color: var(--text3); }
.nav-search:focus {
  outline: none; border-color: rgba(245,166,35,0.4);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.08);
  width: 240px;
}
.nav-search:focus ~ .nav-search-shortcut { display: none; }
.nav-search-icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--text3); font-size: 12px; pointer-events: none;
}
.nav-badge {
  background: linear-gradient(135deg, var(--red-dark), #6B0F0F);
  color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 6px;
  letter-spacing: .8px; cursor: pointer;
  border: 1px solid rgba(196,26,26,0.4);
  transition: var(--transition);
}
.nav-badge:hover { background: linear-gradient(135deg, var(--red), var(--red-dark)); }

#nav-search-results {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg2);
  border: 1px solid var(--border3);
  border-radius: 12px;
  width: 320px; max-height: 400px; overflow-y: auto;
  display: none; z-index: 999;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.2s ease both;
}
#nav-search-results::-webkit-scrollbar { width: 4px; }
#nav-search-results::-webkit-scrollbar-track { background: transparent; }
#nav-search-results::-webkit-scrollbar-thumb { background: var(--border3); border-radius: 2px; }

/* ─── TICKER BAR ──────────────────────────────────────────────── */
.ticker-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  height: 34px;
  overflow: hidden;
  position: relative;
}
.ticker-bar::before, .ticker-bar::after {
  content: ''; position: absolute; top: 0; width: 60px; height: 100%;
  z-index: 2; pointer-events: none;
}
.ticker-bar::before { left: 0; background: linear-gradient(90deg, var(--bg2), transparent); }
.ticker-bar::after  { right: 0; background: linear-gradient(-90deg, var(--bg2), transparent); }

.ticker-track {
  display: flex; align-items: center; height: 100%;
  gap: 0;
  animation: ticker-scroll 80s linear infinite;
  width: max-content;
}
.ticker-track:hover { animation-play-state: paused; }

.ticker-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 18px;
  font-family: var(--font-mono); font-size: 11.5px;
  border-right: 1px solid var(--border);
  white-space: nowrap; height: 34px;
}
.ticker-name { color: var(--text3); font-weight: 500; }
.ticker-val  { color: var(--text); font-weight: 600; }

/* ─── INDICES BAR ─────────────────────────────────────────────── */
.indices-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.idx-card {
  padding: .65rem 1.25rem;
  border-right: 1px solid var(--border);
  transition: var(--transition);
  cursor: default;
}
.idx-card:last-child { border-right: none; }
.idx-card:hover { background: var(--bg3); }
.idx-name {
  font-size: 9.5px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 3px;
}
.idx-val {
  font-size: 16px; font-weight: 700;
  font-family: var(--font-mono);
  animation: count-up 0.6s ease both;
}
.idx-chg {
  font-size: 11px; font-family: var(--font-mono);
  margin-top: 1px; font-weight: 500;
}

/* ─── PAGE HERO ───────────────────────────────────────────────── */
.page-hero {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 1.75rem 2rem;
  position: relative; overflow: hidden;
  text-align: center; /* Centralizado */
}
.page-hero::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0; width: 40%;
  background: radial-gradient(ellipse at right, rgba(245,166,35,0.04), transparent 70%);
  pointer-events: none;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 400;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  line-height: 1.1;
}
.page-hero h1 em { color: var(--gold); font-style: italic; }
.page-hero p { font-size: 13px; color: var(--text2); }

/* ─── CONTAINER ───────────────────────────────────────────────── */
.container { max-width: 1400px; margin: 0 auto; padding: 1.75rem 2rem; position: relative; z-index: 1; }
.main-grid { display: grid; grid-template-columns: 1fr 290px; gap: 1.5rem; }

/* ─── MINI CARDS ──────────────────────────────────────────────── */
.mini-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px; margin-bottom: 1.5rem;
}
.mini-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: .85rem 1rem;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.mini-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(245,166,35,0.3), transparent);
  opacity: 0; transition: var(--transition);
}
.mini-card:hover { border-color: var(--border3); transform: translateY(-1px); box-shadow: var(--shadow); }
.mini-card:hover::before { opacity: 1; }
.mini-label {
  font-size: 9.5px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .9px; margin-bottom: 5px;
}
.mini-val {
  font-size: 22px; font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
}
.mini-sub { font-size: 10.5px; margin-top: 3px; color: var(--text3); font-family: var(--font-mono); }

/* ─── SECTION HEADER ──────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-title {
  font-size: 11px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 1.2px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ''; width: 3px; height: 13px;
  background: var(--gold); border-radius: 2px;
  box-shadow: 0 0 8px var(--gold-glow);
}
.section-link { font-size: 11.5px; color: var(--gold); font-weight: 600; transition: var(--transition); }
.section-link:hover { color: #FFBF5C; }

/* ─── TABS — Centralizadas ────────────────────────────────────── */
.tabs {
  display: flex; gap: 3px;
  background: var(--bg2);
  padding: 3px; border-radius: 10px;
  border: 1px solid var(--border);
  width: fit-content;
  margin: 0 auto 1.5rem auto; /* centraliza horizontalmente */
}
.tab {
  padding: 6px 16px; font-size: 12px; font-weight: 600;
  border: none; border-radius: 7px;
  background: transparent; color: var(--text2);
  cursor: pointer; font-family: var(--font-body);
  transition: var(--transition);
  text-transform: uppercase; letter-spacing: .5px;
}
.tab.active {
  background: var(--bg5); color: var(--gold);
  box-shadow: 0 0 0 1px var(--border2), inset 0 1px 0 rgba(255,255,255,0.06);
}
.tab:hover:not(.active) { background: var(--bg3); color: var(--text); }

/* ─── TABLE ───────────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left; font-size: 9.5px; font-weight: 700;
  color: var(--text3); text-transform: uppercase; letter-spacing: .9px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg3); white-space: nowrap;
}
.data-table thead th.r { text-align: right; }
.data-table tbody td {
  padding: 13px 16px; /* linhas maiores */
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text);
}
.data-table tbody td.r {
  text-align: right; font-family: var(--font-mono); font-size: 12px;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; transition: var(--transition); }
.data-table tbody tr:hover td { background: var(--bg3); }
.data-table tbody tr:hover .asset-ticker { color: var(--gold); }

.asset-ticker { font-weight: 700; font-size: 14px; transition: var(--transition); }
.asset-name { font-size: 11.5px; color: var(--text3); margin-top: 2px; }

/* ─── LOGO AVATAR (placeholder quando sem logo) ───────────────── */
.logo-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1A3A5C, #2563a8);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  font-family: var(--font-mono);
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.logo-avatar.gold-av {
  background: linear-gradient(135deg, #3D2800, var(--gold));
  color: #1A0900;
}
.asset-logo {
  width: 32px; height: 32px;
  border-radius: 50%; object-fit: contain;
  background: #fff; flex-shrink: 0;
}
/* Logo wrapper para sidebar e listas menores */
.logo-sm { width: 26px; height: 26px; border-radius: 50%; object-fit: contain; background:#fff; flex-shrink:0; }
.logo-sm-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #1A3A5C, #2563a8);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: #fff;
  font-family: var(--font-mono); flex-shrink: 0;
}

/* ─── PILLS ───────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 2px 7px; border-radius: 5px;
  font-size: 11px; font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.up-pill   { background: var(--up-bg);   color: var(--up); }
.dn-pill   { background: var(--dn-bg);   color: var(--dn); }
.gold-pill { background: var(--gold-dim); color: var(--gold); }

.up { color: var(--up); }
.dn { color: var(--dn); }
.gold { color: var(--gold); }

/* ─── CARD ────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  transition: var(--transition);
}
.card:hover { border-color: var(--border3); }

/* ─── CHART PANEL ─────────────────────────────────────────────── */
.chart-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}
.chart-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.chart-ticker {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 400;
  letter-spacing: 0.5px; line-height: 1;
}
.chart-logo-wrap {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.chart-logo-img {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: contain; background: #fff; flex-shrink: 0;
}
.chart-logo-av {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #1A3A5C, #2563a8);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  font-family: var(--font-mono); flex-shrink: 0;
}
.chart-price {
  font-family: var(--font-mono); font-size: 18px; font-weight: 600;
  margin-top: 4px; display: flex; align-items: center; gap: 8px;
}
.chart-meta { font-size: 11px; color: var(--text3); margin-top: 4px; }

.range-btn {
  padding: 4px 8px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: var(--text2);
  cursor: pointer; font-family: var(--font-body);
  transition: var(--transition);
}
.range-btn:hover  { border-color: var(--border3); color: var(--text); }
.range-btn.active { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }

.chart-stats {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 8px; margin-top: 1rem;
}
.chart-stat {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px; padding: .6rem .85rem;
  transition: var(--transition);
}
.chart-stat:hover { border-color: var(--border3); }
.chart-stat-label {
  font-size: 9.5px; color: var(--text3);
  text-transform: uppercase; letter-spacing: .7px;
  margin-bottom: 3px; font-weight: 700;
}
.chart-stat-val {
  font-size: 14px; font-weight: 700;
  font-family: var(--font-mono);
}

/* ─── CHART INTERACTION — pin e seleção ───────────────────────── */
.chart-pin-info {
  background: rgba(17,17,19,0.95); border: 1px solid rgba(245,166,35,0.5);
  border-radius: 8px; padding: 8px 12px;
  font-family: var(--font-mono); font-size: 12px;
  position: absolute; z-index: 10; pointer-events: none;
  min-width: 150px;
}
.chart-range-overlay {
  position: absolute; top: 0; bottom: 0;
  background: rgba(245,166,35,0.08);
  border-left: 1px solid rgba(245,166,35,0.5);
  border-right: 1px solid rgba(245,166,35,0.5);
  pointer-events: none;
}

/* ─── FAVORITAR / WATCHLIST ───────────────────────────────────── */
.btn-fav {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 14px;
  font-size: 13px; font-weight: 700; font-family: var(--font-body);
  color: var(--text2); cursor: pointer;
  transition: var(--transition);
}
.btn-fav:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.btn-fav.active { background: var(--gold-dim); color: var(--gold); border-color: var(--border2); }

/* ─── SCORE FUNDAMENTALISTA ───────────────────────────────────── */
.score-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 800; font-family: var(--font-mono);
  letter-spacing: .5px;
}
.score-a { background: rgba(31,201,110,0.15); color: var(--up); }
.score-b { background: rgba(245,166,35,0.15); color: var(--gold); }
.score-c { background: rgba(232,80,58,0.12); color: var(--dn); }

/* ─── ALERTA DE PREÇO ─────────────────────────────────────────── */
.alert-badge {
  background: var(--gold-dim); color: var(--gold);
  border: 1px solid var(--border2);
  border-radius: 6px; padding: 2px 8px;
  font-size: 10px; font-weight: 700; font-family: var(--font-mono);
}

/* ─── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.mover-item {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.mover-item:last-child { border-bottom: none; }
.mover-item:hover { padding-left: 4px; }
.mover-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.mover-ticker { font-size: 13px; font-weight: 700; }
.mover-name   { font-size: 11px; color: var(--text3); margin-top: 1px; }
.mover-price  { font-size: 12.5px; font-family: var(--font-mono); font-weight: 600; }
.mover-chg    { font-size: 11px; font-family: var(--font-mono); margin-top: 1px; }

/* ─── RANK ────────────────────────────────────────────────────── */
.rank-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.rank-item:last-child { border-bottom: none; }
.rank-item:hover { padding-left: 4px; }
.rank-num { font-size: 10px; font-weight: 700; color: var(--text3); width: 14px; text-align: center; }
.rank-bar-wrap { flex: 1; }
.rank-bar-top  { display: flex; justify-content: space-between; margin-bottom: 5px; }
.rank-bar-ticker { font-size: 12px; font-weight: 700; }
.rank-bar-val    { font-size: 12px; font-family: var(--font-mono); color: var(--gold); }
.rank-bar        { height: 3px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.rank-bar-fill   {
  height: 100%;
  background: linear-gradient(90deg, rgba(196,26,26,0.8), var(--gold));
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* ─── AGENDA ──────────────────────────────────────────────────── */
.agenda-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.agenda-item:last-child { border-bottom: none; }
.agenda-item:hover { padding-left: 4px; }
.agenda-ticker { font-size: 13.5px; font-weight: 700; }
.agenda-type   { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; margin-top: 1px; }
.agenda-date   { font-size: 11px; font-family: var(--font-mono); color: var(--text2); text-align: center; }
.agenda-date small { display: block; color: var(--text3); font-size: 10px; margin-top: 1px; }
.agenda-value  { font-size: 15px; font-weight: 700; font-family: var(--font-mono); color: var(--gold); text-align: right; }
.agenda-yield  { font-size: 11px; color: var(--text3); text-align: right; }

/* ─── BANNER ──────────────────────────────────────────────────── */
.banner {
  background: linear-gradient(135deg, rgba(139,0,0,0.4), rgba(14,3,3,0.6));
  border: 1px solid rgba(196,26,26,0.35);
  border-radius: var(--radius-lg);
  padding: .9rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  position: relative; overflow: hidden;
}
.banner::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 0% 50%, rgba(196,26,26,0.15), transparent 60%);
  pointer-events: none;
}
.banner-icon { font-size: 24px; flex-shrink: 0; }
.banner h3 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.banner p  { font-size: 12px; color: var(--text2); }
.banner-btn {
  margin-left: auto; flex-shrink: 0;
  background: var(--gold); color: #0A0A0A;
  font-size: 12px; font-weight: 800;
  padding: 7px 16px; border-radius: 8px; border: none;
  cursor: pointer; font-family: var(--font-body);
  transition: var(--transition); white-space: nowrap;
  letter-spacing: .3px;
}
.banner-btn:hover { background: #FFB835; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(245,166,35,0.4); }

/* ─── FILTROS ─────────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 1rem; align-items: center;
}
.filter-input {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 12px;
  font-size: 13px; color: var(--text); font-family: var(--font-body);
  transition: var(--transition);
}
.filter-input:focus  { outline: none; border-color: rgba(245,166,35,0.4); box-shadow: 0 0 0 3px rgba(245,166,35,0.07); }
.filter-select {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 12px;
  font-size: 13px; color: var(--text); font-family: var(--font-body);
  cursor: pointer; transition: var(--transition);
  -webkit-appearance: none; appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234E4D4A'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.filter-select:focus { outline: none; border-color: rgba(245,166,35,0.4); }

/* ─── CALCULADORA ─────────────────────────────────────────────── */
.calc-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
}
.calc-label {
  font-size: 11px; font-weight: 700; color: var(--text2);
  margin-bottom: 6px; display: block;
  text-transform: uppercase; letter-spacing: .6px;
}
.calc-input {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 14px; font-size: 16px;
  font-family: var(--font-mono); color: var(--text);
  margin-bottom: 1rem; transition: var(--transition);
}
.calc-input:focus { outline: none; border-color: rgba(245,166,35,0.4); box-shadow: 0 0 0 3px rgba(245,166,35,0.07); }
.calc-result {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin-top: 1rem;
}
.calc-result-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 4px; }
.calc-result-val   { font-size: 28px; font-weight: 800; font-family: var(--font-mono); color: var(--gold); }
.calc-btn {
  width: 100%; background: linear-gradient(135deg, var(--red-dark), var(--red));
  color: #fff; font-size: 14px; font-weight: 700;
  padding: 12px; border: none; border-radius: 9px;
  cursor: pointer; font-family: var(--font-body);
  transition: var(--transition); margin-top: .25rem;
  letter-spacing: .3px;
}
.calc-btn:hover { background: linear-gradient(135deg, var(--red), #D62020); transform: translateY(-1px); box-shadow: 0 4px 14px var(--red-glow); }

/* ─── LOADING STATE ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 5px;
}
.loading-dot {
  display: inline-block; width: 5px; height: 5px;
  border-radius: 50%; background: var(--gold);
  animation: pulse 1.2s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: .2s; }
.loading-dot:nth-child(3) { animation-delay: .4s; }

/* ─── STATUS INDICATORS ───────────────────────────────────────── */
.status-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; flex-shrink: 0;
}
.status-ok   { background: var(--up); box-shadow: 0 0 6px var(--up-glow); animation: pulse 2s ease-in-out infinite; }
.status-warn { background: var(--gold); box-shadow: 0 0 6px var(--gold-glow); }
.status-err  { background: var(--dn); box-shadow: 0 0 6px var(--dn-glow); }

/* ─── SCROLLBARS ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg5); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border3); }

/* ─── FOOTER ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem; padding: 1.5rem 2rem;
  text-align: center; font-size: 12px;
  color: var(--text3); position: relative; z-index: 1;
}
footer em { color: var(--gold); font-style: normal; }

/* ─── UTILITY ─────────────────────────────────────────────────── */
.mt-1  { margin-top: .5rem;  }
.mt-2  { margin-top: 1rem;   }
.mt-3  { margin-top: 1.5rem; }
.mb-1  { margin-bottom: .5rem;  }
.mb-2  { margin-bottom: 1rem;   }
.mb-3  { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: .5rem; }

/* ─── TOOL GRID ───────────────────────────────────────────────── */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.carteira-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.carteira-item:last-child { border-bottom: none; }
.carteira-item:hover { padding-left: 4px; }

/* ─── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 4rem 2rem;
}
.empty-state-icon {
  font-size: 40px; margin-bottom: 1rem; opacity: .6;
}
.empty-state h2 { font-size: 18px; font-weight: 700; margin-bottom: .5rem; }
.empty-state p  { color: var(--text3); margin-bottom: 1.5rem; font-size: 14px; }

/* ─── CRIPTOS ─────────────────────────────────────────────────── */
.crypto-grid {
  display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem;
}
.crypto-logo {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: contain; flex-shrink: 0;
}

/* ─── NEWS FEED ───────────────────────────────────────────────── */
.news-item {
  padding: 10px 0; border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { padding-left: 4px; }
.news-title { font-size: 12.5px; font-weight: 600; line-height: 1.4; margin-bottom: 3px; }
.news-meta  { font-size: 10.5px; color: var(--text3); }

/* ─── ALERTA MODAL ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; animation: fadeIn .2s ease both;
}
.modal-box {
  background: var(--bg2); border: 1px solid var(--border3);
  border-radius: var(--radius-xl); padding: 1.75rem;
  min-width: 320px; max-width: 420px; width: 90%;
  box-shadow: var(--shadow-lg);
  animation: slideDown .25s ease both;
}

/* ─── MOBILE ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-grid    { grid-template-columns: 1fr; }
  .crypto-grid  { grid-template-columns: 1fr; }
  .sidebar      { display: none; }
  .mini-cards   { grid-template-columns: repeat(2, 1fr); }
  .chart-stats  { grid-template-columns: repeat(2, 1fr); }
  .indices-bar  { grid-template-columns: repeat(3, 1fr); }
  .indices-bar .idx-card:nth-child(4),
  .indices-bar .idx-card:nth-child(5) { display: none; }
  .tool-grid { grid-template-columns: 1fr; }
  .nav-search { width: 140px; }
}
@media (max-width: 600px) {
  .container { padding: 1rem; }
  .nav-links  { display: none; }
  .page-hero h1 { font-size: 26px; }
  .mini-cards { grid-template-columns: 1fr 1fr; }
  .chart-stats { grid-template-columns: 1fr 1fr; }
  .page-hero { padding: 1.25rem 1rem; text-align: center; }
  .tabs { margin: 0 auto 1rem auto; }
}
