/* CalmInvest — Design System v3 */
/* Dark-primary theme. Carbon Black base. Calm Mint accent. */
/* Inter only — pragmático, legível, orientado a dados */

:root,
:root[data-theme="dark"] {
  /* ── Base (dark-primary) ─────────────────────────────── */
  --c-bg:          #0E1111;   /* Carbon Black — fundo principal */
  --c-surface:     #131918;   /* cards, tabelas */
  --c-surface-alt: #1A2020;   /* zebra, hover rows */
  --c-border:      #2A3232;
  --c-border-soft: #1F2828;

  /* ── Text ───────────────────────────────────────────────── */
  --c-text:        #F7F8F6;   /* Off-White */
  --c-text-muted:  #8A9490;   /* texto secundário */
  --c-text-subtle: #5A6360;   /* labels, captions */

  /* ── Brand accent ───────────────────────────────────────── */
  --c-mint:        #48B992;   /* Calm Mint */
  --c-mint-light:  #7FD3B6;   /* hover */
  --c-mint-deep:   #2E8F73;   /* pressed */
  --c-mint-bg:     rgba(72, 185, 146, 0.10);

  /* ── Semantic ───────────────────────────────────────────── */
  --c-pos:         #48B992;   /* positivo — mint */
  --c-neg:         #D16A5A;   /* negativo — terracotta */

  /* ── Accent ─────────────────────────────────────────────── */
  --c-accent:      #6C8FA3;   /* blue-grey — charts neutros */

  /* ── Semantic aliases (compatibilidade páginas internas) ── */
  --color-bg:           var(--c-bg);
  --color-surface:      var(--c-surface);
  --color-surface-alt:  var(--c-surface-alt);
  --color-text:         var(--c-text);
  --color-text-muted:   var(--c-text-muted);
  --color-border:       var(--c-border);
  --color-border-soft:  var(--c-border-soft);
  --color-primary:      var(--c-mint);
  --color-primary-hover:var(--c-mint-light);
  --color-accent:       var(--c-accent);
  --color-positivo:     var(--c-pos);
  --color-negativo:     var(--c-neg);

  /* Nav */
  --color-nav-bg:    var(--c-bg);
  --color-nav-text:  var(--c-text-muted);
  --color-nav-border:var(--c-border);

  /* Tags */
  --color-tag:      var(--c-mint-bg);
  --color-tag-text: var(--c-mint);

  /* ── Typography ─────────────────────────────────────────── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: var(--font-sans);
  --font:      var(--font-sans);

  /* ── Scale ──────────────────────────────────────────────── */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --max-width: 1120px;
}

:root[data-theme="light"] {
  --c-bg:          #F5F7F4;
  --c-surface:     #FFFFFF;
  --c-surface-alt: #ECF1EE;
  --c-border:      #D7E0DB;
  --c-border-soft: #E6ECE8;

  --c-text:        #14211C;
  --c-text-muted:  #51615A;
  --c-text-subtle: #73827C;

  --c-mint:        #2E8F73;
  --c-mint-light:  #48B992;
  --c-mint-deep:   #226B56;
  --c-mint-bg:     rgba(46, 143, 115, 0.10);

  --c-pos:         #2E8F73;
  --c-neg:         #BF5A49;
  --c-accent:      #58788C;

  --color-bg:           var(--c-bg);
  --color-surface:      var(--c-surface);
  --color-surface-alt:  var(--c-surface-alt);
  --color-text:         var(--c-text);
  --color-text-muted:   var(--c-text-muted);
  --color-border:       var(--c-border);
  --color-border-soft:  var(--c-border-soft);
  --color-primary:      var(--c-mint);
  --color-primary-hover:var(--c-mint-light);
  --color-accent:       var(--c-accent);
  --color-positivo:     var(--c-pos);
  --color-negativo:     var(--c-neg);
  --color-nav-bg:       var(--c-bg);
  --color-nav-text:     var(--c-text-muted);
  --color-nav-border:   var(--c-border);
  --color-tag:          var(--c-mint-bg);
  --color-tag-text:     var(--c-mint);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }
html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

body {
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "ss01", "cv11";
}

a { color: var(--c-mint); }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--c-text);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

/* ── Eyebrow ────────────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-text-subtle);
  margin-bottom: 0.75rem;
}

/* ── Global Nav ─────────────────────────────────────────── */
.nav-global {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-logo {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--c-text);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo-mark {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.nav-logo-text {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--c-text);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}
.nav-links a {
  color: var(--c-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.12s ease;
}
.nav-links a:hover { color: var(--c-text); }
.nav-dropdown { position: relative; }
.nav-dropdown summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-muted);
  transition: color 0.12s ease;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary:hover { color: var(--c-text); }
.nav-dropdown ul {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.4rem 0;
  min-width: 210px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  list-style: none;
  z-index: 200;
}
.nav-dropdown ul li a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--c-text);
  text-decoration: none;
}
.nav-dropdown ul li a:hover { background: var(--c-surface-alt); color: var(--c-text); }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  color: var(--c-text);
  padding: 0.3rem 0.45rem 0.3rem 0.35rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--c-surface);
  border-color: var(--c-text-subtle);
}
.theme-toggle-track {
  position: relative;
  width: 3.4rem;
  height: 1.9rem;
  border-radius: 999px;
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.35rem;
}
.theme-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 0.18rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--c-mint);
  transform: translateY(-50%);
  transition: left 0.18s ease, background 0.18s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
:root[data-theme="light"] .theme-toggle-thumb { left: 1.74rem; }
.theme-toggle-icon {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--c-text-subtle);
}
.theme-toggle-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--c-text);
  padding: 0.25rem 0.5rem;
  margin-left: auto;
}

/* ── Page layout ────────────────────────────────────────── */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.page-intro { color: var(--c-text-muted); margin-bottom: 1.5rem; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.35rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: var(--c-mint);
  color: #0E1111;
  border-color: var(--c-mint);
  font-weight: 600;
}
.btn-primary:hover { background: var(--c-mint-light); border-color: var(--c-mint-light); color: #0E1111; }
.btn-secondary {
  background: transparent;
  color: var(--c-text-muted);
  border-color: var(--c-border);
}
.btn-secondary:hover { border-color: var(--c-text-subtle); color: var(--c-text); }
.btn-ghost {
  background: transparent;
  color: var(--c-mint);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
.btn-ghost:hover { opacity: 0.75; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem);
  max-width: 780px;
}
.hero h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--c-text);
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  line-height: 1.65;
  color: var(--c-text-muted);
  max-width: 560px;
  margin-bottom: 2rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.hero-rule {
  display: block;
  height: 1px;
  background: var(--c-border);
  margin-top: 3rem;
}
.data-ref {
  font-size: 0.82rem;
  color: var(--c-text-subtle);
  margin-top: 1rem;
}

/* ── Section wrapper ────────────────────────────────────── */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) 1.5rem;
}
.section-tight {
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}
.section-head { margin-bottom: 1.75rem; }
.section-head h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
}
.section-head p {
  font-size: 0.975rem;
  color: var(--c-text-muted);
  line-height: 1.65;
  max-width: 600px;
}

/* ── Value props (3 columns) ────────────────────────────── */
.value-props {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.value-prop {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--c-border);
}
.value-prop-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--c-mint-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 0.25rem;
}
.value-prop-icon svg { color: var(--c-mint); }
.value-prop h3 {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.3;
}
.value-prop p {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  line-height: 1.6;
}

/* ── Ranking / section header ───────────────────────────── */
.ranking-section { margin: 0; }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.section-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-text);
  letter-spacing: -0.01em;
}
.ver-todos {
  font-size: 0.85rem;
  color: var(--c-mint);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.85;
  transition: opacity 0.12s ease;
}
.ver-todos:hover { opacity: 1; }

/* ── Quick links ────────────────────────────────────────── */
.quick-links h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 1.25rem;
  background: var(--c-surface);
  text-decoration: none;
  color: var(--c-text);
  transition: background 0.12s ease;
}
.link-card:hover { background: var(--c-surface-alt); }
.link-card strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.link-card strong::after {
  content: "↗";
  font-size: 0.8rem;
  color: var(--c-mint);
  font-weight: 400;
}
.link-card span {
  font-size: 0.8rem;
  color: var(--c-text-subtle);
  line-height: 1.4;
}

/* ── FAQ ────────────────────────────────────────────────── */
.faq { max-width: 720px; }
.faq details {
  border-bottom: 1px solid var(--c-border);
}
.faq details:first-of-type { border-top: 1px solid var(--c-border); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.975rem;
  font-weight: 500;
  color: var(--c-text);
  padding: 1.1rem 0;
  line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.35rem;
  font-weight: 300;
  color: var(--c-text-subtle);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  line-height: 1;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  padding-bottom: 1.1rem;
  color: var(--c-text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 640px;
}

/* ── Company Header ─────────────────────────────────────── */
.company-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 1.25rem 0;
}
.company-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.company-logo {
  border-radius: var(--radius);
  object-fit: contain;
  background: var(--c-surface-alt);
  padding: 4px;
  border: 1px solid var(--c-border);
}
.company-logo-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text-muted);
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.company-name { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; }
.company-metrics { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-left: auto; }
.metric-block { display: flex; flex-direction: column; gap: 2px; }
.metric-label {
  font-size: 0.68rem;
  color: var(--c-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.metric-value {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}
.metric-primary .metric-value { font-size: 1.35rem; }
.company-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; width: 100%; }

/* ── Badges & Tags ──────────────────────────────────────── */
.ticker-badge {
  display: inline-block;
  background: var(--c-mint-bg);
  color: var(--c-mint);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}
.ticker-badge-muted {
  background: var(--c-surface-alt);
  color: var(--c-text-muted);
  margin-left: 0.35rem;
}
.rank-badge {
  display: inline-block;
  background: var(--c-surface-alt);
  color: var(--c-text-subtle);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}
.tag-setor, .tag-indice {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.tag-setor { background: var(--c-mint-bg); color: var(--c-mint); }
.tag-indice { background: var(--c-surface-alt); color: var(--c-text-muted); }

/* ── Tab Navigation ─────────────────────────────────────── */
.tab-nav {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 56px;
  z-index: 90;
}
.tab-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav-inner::-webkit-scrollbar { display: none; }
.tab-nav .tab {
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: var(--c-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
  flex-shrink: 0;
}
.tab-nav .tab:hover { color: var(--c-text); }
.tab-nav .tab-active {
  color: var(--c-text);
  border-bottom-color: var(--c-mint);
  font-weight: 600;
}
@media (max-width: 480px) {
  .tab-nav .tab { padding: 0.75rem 0.85rem; font-size: 0.8rem; }
}

/* ── Metric Hero ────────────────────────────────────────── */
.metric-hero { margin: 1.75rem 0 1.25rem; }
.metric-hero h1 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); margin-bottom: 0.75rem; font-weight: 600; }
.metric-display { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.metric-big {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}
.rank-context { font-size: 1rem; color: var(--c-text-muted); }
.variacao-context { font-size: 0.9rem; color: var(--c-text-muted); }
.fii-metrics-row { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1rem; }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ranking-table, .historico-table, .concorrentes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.ranking-table th, .historico-table th, .concorrentes-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-subtle);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  font-weight: 500;
  background: var(--c-surface);
}
.ranking-table td, .historico-table td, .concorrentes-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--c-border-soft);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  color: var(--c-text);
}
.ranking-table tbody tr:hover td,
.concorrentes-table tbody tr:hover td { background: var(--c-surface-alt); }
.comparison-current-row td { background: rgba(72, 185, 146, 0.05); }

.ranking-table td:nth-child(n+3),
.ranking-table th:nth-child(n+3) { text-align: right; }

.rank-col {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-subtle);
  width: 2.5rem;
  text-align: right;
  padding-right: 1rem;
  font-variant-numeric: tabular-nums;
}

.empresa-cell a {
  text-decoration: none;
  color: var(--c-text);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}
.empresa-cell a:hover .empresa-nome { color: var(--c-mint); }
.empresa-info { display: flex; flex-direction: column; gap: 2px; }
.empresa-nome { font-weight: 500; font-size: 0.9rem; }
.nome-small { font-size: 0.78rem; color: var(--c-text-muted); }

.ticker-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--c-text-subtle);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ranking-table td a,
.historico-table td a,
.concorrentes-table td a {
  color: var(--c-mint);
  text-decoration: none;
}
.ranking-table td a:hover,
.historico-table td a:hover,
.concorrentes-table td a:hover {
  opacity: 0.75;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Color utilities ────────────────────────────────────── */
.positivo { color: var(--c-pos) !important; font-weight: 500; }
.negativo { color: var(--c-neg) !important; font-weight: 500; }

/* ── Section headings (internal pages) ──────────────────── */
.historico-section, .concorrentes-section, .educacional, .chart-section { margin: 2.5rem 0; }
.historico-section h2, .concorrentes-section h2, .educacional h2, .chart-section h2 {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-text-subtle);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c-border);
}
.educacional p { color: var(--c-text-muted); font-size: 0.9rem; margin-top: 0.5rem; line-height: 1.7; }

/* ── Chart ──────────────────────────────────────────────── */
.chart-container {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-height: 220px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
.chart-container canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
.chart-container-bars { min-height: 0; }
.chart-note { font-size: 0.78rem; color: var(--c-text-subtle); margin: -0.25rem 0 0.75rem; }

/* ── Hub nav ────────────────────────────────────────────── */
.nav-links-hub {
  margin: 2rem 0;
  padding: 1.25rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.nav-links-hub ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.nav-links-hub a { color: var(--c-mint); text-decoration: none; font-size: 0.875rem; font-weight: 500; }
.nav-links-hub a:hover { opacity: 0.75; }

/* ── Provenance ─────────────────────────────────────────── */
.provenance-section {
  padding-top: 0;
  padding-bottom: 1rem;
}
.provenance {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--c-surface);
  border-left: 2px solid var(--c-mint);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  line-height: 1.6;
}
.provenance a { color: var(--c-mint); }
.provenance-disclaimer { margin-top: 0.25rem; font-style: italic; }

/* ── Hoje grid ──────────────────────────────────────────── */
.hoje-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.hoje-section h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
.hoje-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hoje-dot-pos { background: var(--c-pos); }
.hoje-dot-neg { background: var(--c-neg); }

/* ── Metodologia / page body ────────────────────────────── */
.page-content h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; margin-bottom: 1.75rem; line-height: 1.15; }
.page-content h2 { font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.75rem; }
.page-content p { color: var(--c-text-muted); margin-bottom: 0.85rem; font-size: 0.95rem; line-height: 1.75; }
.page-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.875rem; }
.page-content th { text-align: left; padding: 0.5rem 0.85rem; background: var(--c-surface-alt); border: 1px solid var(--c-border); font-size: 0.72rem; color: var(--c-text-subtle); text-transform: uppercase; letter-spacing: 0.1em; }
.page-content td { padding: 0.6rem 0.85rem; border: 1px solid var(--c-border); color: var(--c-text-muted); }
.page-content blockquote {
  background: var(--c-surface);
  border-left: 2px solid var(--c-mint);
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  color: var(--c-text-muted);
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-bg);
  padding: 1.5rem 0;
  margin-top: 0;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--c-text);
}
.footer-brand-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-left: auto;
}
.footer-nav a {
  font-size: 0.85rem;
  color: var(--c-text-subtle);
  text-decoration: none;
  transition: color 0.12s ease;
}
.footer-nav a:hover { color: var(--c-text-muted); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--c-text-subtle);
  padding-top: 0.65rem;
  border-top: 1px solid var(--c-border-soft);
}
.footer-disclaimer { font-style: italic; }
/* Legacy aliases */
.footer-top-section, .footer-col, .footer-tagline,
.footer-logo, .footer-logo-text, .footer-copy { /* noop */ }

/* ── Metrics Grid ───────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 2rem;
}
.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem 1rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-top: 2px solid var(--c-border);
  border-radius: var(--radius);
}
.metric-card.metric-primary-card { border-top-color: var(--c-mint); }
.metric-card-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-subtle);
  font-weight: 500;
}
.metric-card-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
.metric-card-value a { color: inherit; text-decoration: none; }
.metric-card-value a:hover { color: var(--c-mint); }

/* ── Info box ───────────────────────────────────────────── */
.info-box {
  background: var(--c-mint-bg);
  border-left: 2px solid var(--c-mint);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.85rem 1rem;
  margin: 1.5rem 0;
}
.info-box p { font-size: 0.9rem; color: var(--c-text); line-height: 1.65; }

/* ── Table footnote ─────────────────────────────────────── */
.table-footnote { font-size: 0.8rem; margin-top: 0.6rem; color: var(--c-text-subtle); }
.table-footnote a { color: var(--c-mint); text-decoration: none; }
.table-footnote a:hover { opacity: 0.75; }

/* ── Sector header ──────────────────────────────────────── */
.setor-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 1.5rem 0 1rem;
}
.setor-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.setor-meta h1 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); font-weight: 600; margin: 0.25rem 0 0.5rem; }
.setor-stats { display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; font-size: 0.875rem; color: var(--c-text-muted); align-items: center; }
.stat-sep { color: var(--c-border); }

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb { font-size: 0.78rem; color: var(--c-text-subtle); margin-bottom: 0.25rem; }
.breadcrumb a { color: var(--c-mint); text-decoration: none; }
.breadcrumb a:hover { opacity: 0.75; }

/* ── Hub section ────────────────────────────────────────── */
.hub-section { margin-bottom: 2.5rem; }
.hub-table .setor-link { text-decoration: none; color: var(--c-text); display: flex; flex-direction: column; gap: 2px; }
.hub-table .setor-link:hover strong { color: var(--c-mint); }

/* ── Company badges ─────────────────────────────────────── */
.company-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.3rem; }
.nivel-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--c-surface-alt);
  color: var(--c-text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.outros-tickers { font-size: 0.78rem; color: var(--c-text-muted); margin-top: 0.25rem; }
.outros-tickers .ticker-link { color: var(--c-mint); text-decoration: none; font-weight: 500; margin-left: 0.25rem; }
.outros-tickers .ticker-link:hover { opacity: 0.75; }
.tag-sep { color: var(--c-text-subtle); margin: 0 0.2rem; }
.tag-subsetor, .tag-segmento { font-size: 0.78rem; color: var(--c-text-muted); }
.tag-website {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--c-text-muted);
  text-decoration: none;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
}
.tag-website:hover { color: var(--c-mint); border-color: var(--c-mint); }

/* FII */
.fii-classificacao { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin: 0.5rem 0; font-size: 0.8rem; }
.tag-tipo-anbima { background: var(--c-surface-alt); color: var(--c-text-muted); border-radius: var(--radius-sm); padding: 2px 8px; font-weight: 500; font-size: 0.75rem; }
.tag-segmento-fii { color: var(--c-mint); text-decoration: none; font-weight: 500; }
.tag-segmento-fii:hover { opacity: 0.75; }

/* ── Sobre empresa ──────────────────────────────────────── */
.sobre-empresa {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.sobre-empresa h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.6rem; }
.sobre-empresa p { color: var(--c-text-muted); font-size: 0.9rem; line-height: 1.65; margin-bottom: 0.65rem; }
.sobre-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.78rem; color: var(--c-text-subtle); border-top: 1px solid var(--c-border); padding-top: 0.65rem; }
.sobre-meta a { color: var(--c-mint); text-decoration: none; }
.sobre-meta a:hover { opacity: 0.75; }

/* ── Nav dropdown divider ───────────────────────────────── */
.nav-divider { border-top: 1px solid var(--c-border); margin-top: 0.4rem; padding-top: 0.4rem; }

/* ── Value-props section bg ─────────────────────────────── */
.section-surface {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .value-props { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 640px) {
  .nav-inner { height: 52px; padding: 0 1rem; gap: 1rem; }
  .nav-links { display: none; }
  .theme-toggle-label { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: 1rem 1.5rem;
    gap: 0.85rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
  }
  .nav-links.open a { color: var(--c-text); }
  .tab-nav { top: 52px; }
  .page-content { padding: 2rem 1.25rem 3rem; }
  .section { padding-left: 1.25rem; padding-right: 1.25rem; }
  .hero { padding: 2rem 0 1.5rem; }
  .company-header-inner { gap: 0.75rem; }
  .company-metrics { margin-left: 0; }
  .hoje-grid { grid-template-columns: 1fr; }
  .links-grid { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; align-items: flex-start; }
  .footer-nav { margin-left: 0; }
  .ranking-table th:nth-child(n+4), .ranking-table td:nth-child(n+4) { display: none; }
}
