/* ════════════════════════════════════════════════════════════════════
   ATLAS — Liquid Terminal
   Bloomberg × Apple visionOS · dark-first · mobile-first
   ════════════════════════════════════════════════════════════════════ */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces (dark-first) */
  --bg-base: #0a0d12;          /* deepest */
  --bg-canvas: #0d1117;        /* canvas (slightly elevated) */
  --surface-1: #11151c;        /* panels */
  --surface-2: #161b24;        /* hover panels */
  --surface-glass: rgba(20, 26, 36, 0.62);
  --surface-glass-strong: rgba(13, 17, 23, 0.78);

  /* Border / divider */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --border-accent: rgba(34, 211, 238, 0.28);
  --border-accent-strong: rgba(34, 211, 238, 0.55);

  /* Text */
  --text-primary: #f4f6fb;     /* AAA on dark bg */
  --text-secondary: #a8b3c5;   /* AA+ */
  --text-tertiary: #6b7587;    /* labels */
  --text-disabled: #4a5260;

  /* Brand & semantic */
  --accent: #22d3ee;           /* cyan elétrico */
  --accent-deep: #06b6d4;
  --accent-glow: rgba(34, 211, 238, 0.35);
  --accent-2: #a855f7;         /* violet pra IA */
  --accent-2-glow: rgba(168, 85, 247, 0.35);
  --positive: #34d399;
  --positive-glow: rgba(52, 211, 153, 0.18);
  --negative: #f87171;
  --negative-glow: rgba(248, 113, 113, 0.18);
  --warning: #fbbf24;

  /* Shadows / depth */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.6);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.04) inset;
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.55), 0 1px 0 rgba(255,255,255,0.06) inset;
  --shadow-glow: 0 0 32px rgba(34, 211, 238, 0.18);

  /* Geometry */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  /* Motion */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-snappy: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --rail-width: 232px;
  --tab-height: 76px;
  --header-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* Light mode (toggle opcional via data-theme="light") */
[data-theme="light"] {
  --bg-base: #f4f6fb;
  --bg-canvas: #ebeef5;
  --surface-1: #ffffff;
  --surface-2: #f8fafc;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --surface-glass-strong: rgba(255, 255, 255, 0.88);
  --border-subtle: rgba(15, 23, 42, 0.06);
  --border-medium: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text-primary: #0a0d12;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --shadow-md: 0 4px 16px rgba(15,23,42,0.06), 0 1px 0 rgba(255,255,255,0.8) inset;
  --shadow-lg: 0 12px 48px rgba(15,23,42,0.12);
}

/* ---------- Reset/base ---------- */
* { box-sizing: border-box; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

html, body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'tnum' 1, 'cv11' 1, 'ss01' 1;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

::selection { background: var(--accent-glow); color: var(--text-primary); }

/* Utilities (alguns Tailwind-shaped pra reduzir reescrita do JS) */
.text-emerald-700, .text-positive { color: var(--positive) !important; }
.text-red-700, .text-negative { color: var(--negative) !important; }
.text-amber-700 { color: var(--warning) !important; }
.text-slate-400, .text-slate-500 { color: var(--text-secondary) !important; }
.text-slate-600 { color: var(--text-secondary) !important; }
.text-slate-700, .text-slate-900 { color: var(--text-primary) !important; }
.text-tiny { font-size: 11px; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-mono { font-family: var(--font-mono); }
.tabular-nums {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

/* Tailwind backgrounds que apareçam sobrescritos */
.bg-white, .bg-slate-50 { background: var(--surface-1) !important; }
.bg-slate-100, .bg-slate-200 { background: var(--surface-2) !important; }
.bg-slate-900, .bg-slate-800 { background: var(--bg-canvas) !important; }
.border-slate-200, .border-slate-300 { border-color: var(--border-medium) !important; }

/* ---------- Mesh background ---------- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(at 18% 12%, rgba(34, 211, 238, 0.08) 0px, transparent 45%),
    radial-gradient(at 82% 18%, rgba(168, 85, 247, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 95%, rgba(34, 211, 238, 0.04) 0px, transparent 50%),
    var(--bg-base);
  pointer-events: none;
}
[data-theme="light"] .bg-mesh {
  background:
    radial-gradient(at 18% 12%, rgba(34, 211, 238, 0.08) 0px, transparent 45%),
    radial-gradient(at 82% 18%, rgba(168, 85, 247, 0.05) 0px, transparent 50%),
    var(--bg-base);
}

/* ════════════════════════════════════════════════════════════════════
   APP SHELL
   ════════════════════════════════════════════════════════════════════ */

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) 1fr;
  min-height: 100dvh;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

/* ---------- Nav rail (desktop sidebar) ---------- */
.nav-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  background: linear-gradient(180deg, rgba(13, 17, 23, 0.6), rgba(10, 13, 18, 0.85));
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 18px 10px 14px;
  z-index: 30;
}

@media (max-width: 900px) {
  .nav-rail { display: none; }
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(168, 85, 247, 0.16));
  border: 1px solid var(--border-accent);
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.18), 0 1px 0 rgba(255,255,255,0.08) inset;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1;
}
.brand-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-weight: 500;
}

.nav-sections {
  flex: 1;
  overflow-y: auto;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-sections::-webkit-scrollbar { width: 4px; }

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
  font-weight: 600;
  padding: 14px 10px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 0.18s var(--ease-smooth), color 0.18s var(--ease-smooth);
  text-decoration: none;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}
.nav-link.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.14), rgba(34, 211, 238, 0));
  color: var(--text-primary);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.nav-footer {
  padding: 12px 14px 4px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ════════════════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════════════════ */

.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-height);
  padding: 0 24px;
  padding-top: var(--safe-top);
  height: calc(var(--header-height) + var(--safe-top));

  background: var(--surface-glass-strong);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 640px) {
  .app-header { padding: 0 16px; padding-top: var(--safe-top); }
}

.hdr-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.hdr-back-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.hdr-title-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.hdr-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hdr-pills {
  display: flex;
  gap: 6px;
  align-items: center;
}

@media (max-width: 480px) {
  .hdr-pills .fx-pill { display: none !important; }
}

.status-pill, .fx-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
}
.status-loading {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.28);
}
.status-live {
  background: rgba(52, 211, 153, 0.10);
  color: var(--positive);
  border-color: rgba(52, 211, 153, 0.32);
}
.status-live::before {
  animation: pulse-dot 1.8s var(--ease-smooth) infinite;
  box-shadow: 0 0 8px var(--positive-glow);
}
.status-stale {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border-color: var(--border-medium);
}
.status-partial {
  background: rgba(251, 191, 36, 0.10);
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.24);
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.fx-pill {
  background: rgba(34, 211, 238, 0.06);
  color: var(--text-primary);
  border-color: var(--border-accent);
  font-family: var(--font-mono);
  font-weight: 500;
}
.fx-pill b { color: var(--accent); font-weight: 700; }

.hdr-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════════ */

.btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}
.btn-glass:hover {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.06);
}
.btn-glass:active { transform: scale(0.96); }
.btn-glass:disabled { opacity: 0.5; cursor: wait; }

#refresh-btn { /* Tailwind override */
  background: var(--surface-glass) !important;
  border-color: var(--border-medium) !important;
  color: var(--text-primary) !important;
  border-radius: 10px !important;
  padding: 0 14px !important;
  height: 36px;
}

/* ════════════════════════════════════════════════════════════════════
   VIEW ROOT (canvas)
   ════════════════════════════════════════════════════════════════════ */

.view-root {
  flex: 1;
  padding: 22px 24px calc(24px + var(--tab-height) + var(--safe-bottom));
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (min-width: 901px) {
  .view-root {
    padding-bottom: 32px; /* sem tabbar em desktop */
  }
}

@media (max-width: 640px) {
  .view-root {
    padding: 14px 14px calc(14px + var(--tab-height) + var(--safe-bottom));
    gap: 14px;
  }
}

/* Compatibilidade com classe antiga */
#view-root.p-6 { padding-top: 22px; padding-left: 24px; padding-right: 24px; }
@media (max-width: 640px) {
  #view-root.p-6 { padding-left: 14px; padding-right: 14px; padding-top: 14px; }
}

/* ════════════════════════════════════════════════════════════════════
   PANELS & GLASS CARDS
   ════════════════════════════════════════════════════════════════════ */

.panel {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-md);
  min-width: 0;
  isolation: isolate;
}
.panel::before {
  /* inner highlight (luz vinda de cima) */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%);
}
.panel:has(.table-wrap) { overflow: visible; }

@media (max-width: 640px) {
  .panel { padding: 14px 14px; border-radius: var(--radius-md); }
}

.panel-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- KPI cards ---------- */
.kpi-card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  min-width: 0;
  isolation: isolate;
  transition: border-color 0.25s var(--ease-smooth), transform 0.25s var(--ease-spring);
}
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 35%);
}
.kpi-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s var(--ease-smooth);
}
.kpi-card:hover {
  border-color: var(--border-accent);
}
.kpi-card:hover::after { opacity: 0.7; }

.kpi-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-tertiary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.kpi-label-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ════════════════════════════════════════════════════════════════════
   DATA QUALITY GATE — visual indicators (v1.6.19)
   ════════════════════════════════════════════════════════════════════ */
.quality-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  cursor: help;
  line-height: 1;
}
.quality-ok {
  color: rgb(34, 197, 94);
  background: rgba(34, 197, 94, 0.12);
}
.quality-low {
  color: rgb(251, 191, 36);
  background: rgba(251, 191, 36, 0.18);
}
.quality-invalid {
  color: rgb(239, 68, 68);
  background: rgba(239, 68, 68, 0.18);
}

.quality-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 4px;
  cursor: help;
  background: rgba(34, 211, 238, 0.18);
  color: rgb(103, 232, 249);
  border: 1px solid rgba(34, 211, 238, 0.4);
}
.quality-projection {
  background: rgba(34, 211, 238, 0.18);
  color: rgb(103, 232, 249);
  border: 1px solid rgba(34, 211, 238, 0.4);
}

/* KPI card states reagindo ao gate */
.kpi-card.kpi-invalid .kpi-value {
  color: var(--text-tertiary);
  font-weight: 500;
}
.kpi-card.kpi-invalid .kpi-sub {
  color: rgba(239, 68, 68, 0.85);
  font-style: italic;
}
.kpi-card.kpi-low-confidence {
  border-color: rgba(251, 191, 36, 0.3);
}
.kpi-card.kpi-low-confidence::after {
  background: linear-gradient(90deg, transparent, rgb(251, 191, 36), transparent);
  opacity: 0.5;
}

/* Header Data Quality Pill */
.data-quality-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
.data-quality-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.data-quality-pill .dq-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(148, 163, 184);
  box-shadow: 0 0 8px currentColor;
}
.data-quality-pill[data-status="healthy"] .dq-dot {
  background: rgb(34, 197, 94);
  color: rgb(34, 197, 94);
}
.data-quality-pill[data-status="warning"] .dq-dot {
  background: rgb(251, 191, 36);
  color: rgb(251, 191, 36);
}
.data-quality-pill[data-status="degraded"] .dq-dot {
  background: rgb(239, 68, 68);
  color: rgb(239, 68, 68);
}
.data-quality-pill[data-status="healthy"] { color: rgb(74, 222, 128); }
.data-quality-pill[data-status="warning"] { color: rgb(252, 211, 77); }
.data-quality-pill[data-status="degraded"] { color: rgb(248, 113, 113); }

/* ════════════════════════════════════════════════════════════════════
   NEWS PANEL — Sprint v1.9
   ════════════════════════════════════════════════════════════════════ */
.range-pill-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
  color: #000 !important;
  border-color: transparent !important;
  font-weight: 700;
}

.news-hero {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.news-hero-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.news-hero-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  font-weight: 500;
}
.news-hero-sentiment {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--text-secondary);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.news-card {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s var(--ease-smooth);
}
.news-card:hover {
  border-color: var(--accent);
  background: var(--surface-3, rgba(255, 255, 255, 0.04));
  transform: translateY(-1px);
}

.news-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

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

.news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.news-source {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
}
.news-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: 0;
}

.news-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ════════════════════════════════════════════════════════════════════
   SMART MONEY V2 — chips de influencers (Sprint v2.0)
   ════════════════════════════════════════════════════════════════════ */
.influencer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.influencer-cat {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
}
.influencer-cat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.influencer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.influencer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
.influencer-chip:hover {
  border-color: var(--accent);
  background: rgba(34, 211, 238, 0.08);
  color: var(--text-primary);
}
.influencer-name {
  font-weight: 600;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.influencer-weight {
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 700;
  background: rgba(34, 211, 238, 0.1);
  padding: 1px 5px;
  border-radius: 999px;
}

.audit-card-wide {
  max-width: 800px;
  width: 90vw;
}

/* ════════════════════════════════════════════════════════════════════
   AGENT — Streaming + AssetCard rich component (Sprint v1.9)
   ════════════════════════════════════════════════════════════════════ */
.msg-tools-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--accent);
  font-weight: 600;
  padding: 4px 8px;
  background: rgba(34, 211, 238, 0.08);
  border-radius: 6px;
  margin-bottom: 8px;
}
.msg-tools-live .ld-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.msg-streaming .msg-content-stream {
  /* cursor blink no fim do texto durante stream */
  position: relative;
}
.msg-streaming .msg-content-stream::after {
  content: '▊';
  display: inline-block;
  color: var(--accent);
  animation: blink 1s infinite;
  margin-left: 2px;
  font-size: 0.9em;
  vertical-align: baseline;
}
@keyframes blink { 50% { opacity: 0; } }
.msg-assistant:not(.msg-streaming) .msg-content-stream::after {
  display: none;
}

/* AssetCard within agent panel */
.agent-asset-card {
  margin-top: 14px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.06), rgba(168, 85, 247, 0.05));
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 12px;
}

.aac-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.aac-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.04);
}
.aac-title-block { flex: 1; min-width: 0; }
.aac-ticker {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.aac-name {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.aac-price-block { text-align: right; }
.aac-price {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.aac-change {
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
}
.aac-change.pos { color: rgb(74, 222, 128); }
.aac-change.neg { color: rgb(248, 113, 113); }

.aac-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.aac-stat {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
}
.aac-stat-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}
.aac-stat-value {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.aac-stat-value.pos { color: rgb(74, 222, 128); }
.aac-stat-value.neg { color: rgb(248, 113, 113); }

.aac-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.aac-chart-label {
  font-size: 10px;
  color: var(--text-tertiary);
  font-style: italic;
}
.aac-range-pills {
  display: flex;
  gap: 3px;
}
.aac-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
.aac-pill:hover { color: var(--text-primary); }
.aac-pill-active {
  background: var(--accent);
  color: #000 !important;
  font-weight: 700;
}

.aac-chart {
  width: 100%;
  height: 180px;
  margin-bottom: 10px;
}

.aac-open-btn {
  width: 100%;
  padding: 8px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 8px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
.aac-open-btn:hover {
  background: rgba(34, 211, 238, 0.18);
}

@media (max-width: 480px) {
  .aac-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Smart Money highlight na sidebar (★) — só cor no texto/star, sem background */
.nav-link-highlight {
  color: rgb(196, 181, 253);  /* lilás suave pra dar destaque sem parecer selecionado */
  font-weight: 600;
}
.nav-link-highlight:hover {
  color: rgb(216, 180, 254);
  background: var(--surface-2);
}
/* Active state continua usando o estilo padrão (.nav-link.active) */

/* ════════════════════════════════════════════════════════════════════
   DASHBOARD v2.0 — Top10, AI Daily card, mini-rows
   ════════════════════════════════════════════════════════════════════ */
.dash-mini-list {
  max-height: 360px;
  overflow-y: auto;
}
.dash-mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
}
.dash-mini-row:hover {
  background: rgba(34, 211, 238, 0.06);
}
.dash-mini-row:last-child { border-bottom: none; }
.dash-mini-asset {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.dash-mini-ticker {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* Logo + ticker pill em tabelas (Movers, etc) */
.td-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ════════════════════════════════════════════════════════════════════
   STATUS DOS SERVIÇOS — health check page (Sprint v2.2.0)
   ════════════════════════════════════════════════════════════════════ */
.status-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.status-summary-card {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 14px;
}
.status-summary-card.status-overall-healthy { border-color: rgba(74, 222, 128, 0.4); }
.status-summary-card.status-overall-warning { border-color: rgba(251, 191, 36, 0.4); }
.status-summary-card.status-overall-degraded { border-color: rgba(248, 113, 113, 0.4); }
.status-summary-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.status-summary-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.text-emerald { color: rgb(74, 222, 128); }
.text-amber { color: rgb(252, 211, 77); }
.text-red { color: rgb(248, 113, 113); }

.status-list {
  display: flex;
  flex-direction: column;
}
.status-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}
.status-row:last-child { border-bottom: none; }
.status-row-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
}
.status-dot { font-size: 10px; }
.status-row-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}
.status-latency {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}
.status-sample {
  color: var(--text-secondary);
  font-size: 11.5px;
  font-family: var(--font-mono);
}
.status-error {
  color: rgb(248, 113, 113);
  font-weight: 600;
  cursor: help;
}
.dash-mini-vals {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-mini-vals .pos { color: rgb(74, 222, 128); }
.dash-mini-vals .neg { color: rgb(248, 113, 113); }

#ai-daily-panel {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.05), rgba(168, 85, 247, 0.04));
  border: 1px solid rgba(34, 211, 238, 0.18);
}
#ai-daily-content {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 80px;
}
#ai-daily-content .ai-h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 14px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(34, 211, 238, 0.18);
}
#ai-daily-content .ai-h3:first-child {
  margin-top: 0;
}
#ai-daily-content .ai-list {
  list-style: none;
  padding-left: 0;
  margin: 4px 0 8px 0;
}
#ai-daily-content .ai-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 4px;
  font-size: 12.5px;
  line-height: 1.55;
}
#ai-daily-content .ai-list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
}
#ai-daily-content strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════════════════
   CARTEIRA v2.0 — Header cash + lista família + ações inline
   ════════════════════════════════════════════════════════════════════ */
.cart-header-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.cart-header-card {
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
}
.cart-header-pnl {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.04), rgba(168, 85, 247, 0.03));
}
.cart-hdr-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.cart-hdr-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.cart-hdr-val.pos { color: rgb(74, 222, 128); }
.cart-hdr-val.neg { color: rgb(248, 113, 113); }
.cart-hdr-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.cart-hdr-sub.pos { color: rgb(74, 222, 128); }
.cart-hdr-sub.neg { color: rgb(248, 113, 113); }

.cart-family {
  padding: 12px 14px;
}
.cart-family-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}
.cart-family-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-family-count {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.cart-family-total {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.cart-rows {
  display: flex;
  flex-direction: column;
}
.cart-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.1fr 1fr 110px;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}
.cart-row:last-child { border-bottom: none; }
.cart-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.cart-cell-asset {
  cursor: pointer;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-cell-asset-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.cart-ticker {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.cart-name {
  font-size: 11px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.cart-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.cart-val.pos { color: rgb(74, 222, 128); }
.cart-val.neg { color: rgb(248, 113, 113); }
.cart-sub {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 1px;
  white-space: nowrap;
}
.cart-sub.pos { color: rgb(74, 222, 128); }
.cart-sub.neg { color: rgb(248, 113, 113); }

.cart-cell-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.cart-act-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.cart-act-btn:hover {
  background: rgba(34, 211, 238, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* Mobile: empilhar */
@media (max-width: 720px) {
  .cart-row {
    grid-template-columns: 1.4fr 1fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "asset val pnl"
      "asset qty actions";
    row-gap: 4px;
  }
  .cart-cell-asset { grid-area: asset; }
  .cart-cell-num:nth-of-type(1) { grid-area: val; }
  .cart-cell-num:nth-of-type(2) { grid-area: qty; }
  .cart-cell-num:nth-of-type(3) { grid-area: pnl; }
  .cart-cell-actions { grid-area: actions; justify-content: flex-end; }
}

.kpi-value {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 8px;
  letter-spacing: -0.025em;
  line-height: 1.1;
  /* Sem nowrap/ellipsis: permite números longos quebrarem naturalmente */
  white-space: normal;
  overflow-wrap: break-word;
  word-break: keep-all; /* não quebra dentro de números formatados */
  font-variant-numeric: tabular-nums lining-nums;
  display: block;
  min-width: 0;
  max-width: 100%;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: keep-all;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

/* ════════════════════════════════════════════════════════════════════
   GRID — mobile vira scroll horizontal pros KPIs
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  /* Detecta KPI strips (grid de 4 com kpi-card) e converte */
  .grid.grid-cols-1.md\:grid-cols-2,
  .grid.grid-cols-4-rsp,
  .view-root .grid.gap-4:has(> .kpi-card) {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 14px;
    gap: 10px !important;
    padding-bottom: 6px;
    margin-left: -14px; margin-right: -14px;
    padding-left: 14px; padding-right: 14px;
  }
  .view-root .grid.gap-4:has(> .kpi-card) > .kpi-card {
    flex: 0 0 80%;
    min-width: 240px;
    scroll-snap-align: start;
  }
  /* charts viram coluna única */
  .grid.xl\:grid-cols-2,
  .grid.xl\:grid-cols-3 {
    display: flex !important;
    flex-direction: column !important;
  }
  .xl\:col-span-2 { width: 100%; }
}

/* ════════════════════════════════════════════════════════════════════
   TABLES
   ════════════════════════════════════════════════════════════════════ */

.panel .table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  margin: 0 -20px -18px;
  padding: 0 20px 18px;
  scrollbar-gutter: stable;
}
@media (max-width: 640px) {
  .panel .table-wrap { margin: 0 -14px -14px; padding: 0 14px 14px; }
}

table.atlas {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  min-width: max-content;
  table-layout: auto;
}
table.atlas thead th {
  text-align: left;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 14px;
  white-space: nowrap;
  background: var(--surface-1);
  position: sticky;
  top: 0;
  z-index: 1;
  font-family: var(--font-display);
}
table.atlas tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.atlas tbody tr { transition: background 0.15s var(--ease-smooth); }
table.atlas tbody tr:hover td { background: var(--surface-2); }
table.atlas tbody tr:last-child td { border-bottom: none; }

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-left: 18px !important;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* ════════════════════════════════════════════════════════════════════
   PILLS
   ════════════════════════════════════════════════════════════════════ */

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border: 1px solid var(--border-subtle);
}
.pill.br {
  background: rgba(52, 211, 153, 0.12);
  color: var(--positive);
  border-color: rgba(52, 211, 153, 0.28);
}
.pill.us {
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent);
  border-color: var(--border-accent);
}
.pill.fii {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.28);
}
.pill.etf {
  background: rgba(168, 85, 247, 0.12);
  color: var(--accent-2);
  border-color: rgba(168, 85, 247, 0.32);
}

/* ════════════════════════════════════════════════════════════════════
   TAB BUTTONS / SEGMENTED
   ════════════════════════════════════════════════════════════════════ */

.tab-btn {
  font-size: 11.5px;
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  font-family: var(--font-text);
}
.tab-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}
.tab-btn.tab-active {
  background: rgba(34, 211, 238, 0.14);
  color: var(--text-primary);
  border-color: var(--border-accent);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.2);
}

/* ════════════════════════════════════════════════════════════════════
   AUDIT MODAL & BUTTON
   ════════════════════════════════════════════════════════════════════ */

.audit-btn {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 700;
  border: 1px solid var(--border-medium);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s var(--ease-spring);
}
.audit-btn:hover {
  background: var(--accent);
  color: var(--bg-base);
  border-color: var(--accent);
  transform: scale(1.12);
  box-shadow: 0 0 10px var(--accent-glow);
}

.audit-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: audit-fade 0.22s var(--ease-snappy);
}
.audit-card {
  background: var(--surface-glass-strong);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.04) inset;
  color: var(--text-primary);
  animation: audit-slide 0.32s var(--ease-spring);
}
.audit-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 22px;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition: all 0.15s;
}
.audit-close:hover { background: var(--surface-2); color: var(--text-primary); }

@keyframes audit-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes audit-slide {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ════════════════════════════════════════════════════════════════════
   TOASTS
   ════════════════════════════════════════════════════════════════════ */

.toast-host {
  position: fixed;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 16px);
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 250;
  pointer-events: none;
}
@media (min-width: 901px) {
  .toast-host { bottom: 24px; right: 96px; }
}

.toast {
  background: var(--surface-glass-strong);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.32s var(--ease-spring);
  border-left: 2px solid var(--accent);
  max-width: 360px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ════════════════════════════════════════════════════════════════════
   PLACEHOLDER
   ════════════════════════════════════════════════════════════════════ */

.placeholder-card {
  background: var(--surface-1);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 60px 40px;
  text-align: center;
  color: var(--text-secondary);
}
.placeholder-card h2 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  margin: 6px 0;
  letter-spacing: -0.01em;
}
.placeholder-card p { font-size: 13px; color: var(--text-secondary); }
.placeholder-card .phase {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
  padding: 3px 10px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
}

/* ════════════════════════════════════════════════════════════════════
   CHART CONTAINERS
   ════════════════════════════════════════════════════════════════════ */

div[id^="chart-"] {
  width: 100%;
  min-width: 0;
  position: relative;
}
div[id^="chart-"] > div,
div[id^="chart-"] .js-plotly-plot {
  width: 100% !important;
  max-width: 100% !important;
}
div[id^="chart-"] svg { max-width: 100% !important; }

/* Plotly hover labels — dark glass */
.hovertext, .nsewdrag, .legend {
  font-family: var(--font-text) !important;
}

/* ════════════════════════════════════════════════════════════════════
   BOTTOM TAB BAR (mobile)
   ════════════════════════════════════════════════════════════════════ */

.tab-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 6px 8px calc(6px + var(--safe-bottom));
  background: var(--surface-glass-strong);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 900px) {
  .tab-bar { display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; }
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 10px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s var(--ease-smooth);
  min-height: 56px;
}
.tab-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}
.tab-item.active {
  color: var(--accent);
}
.tab-item.active svg {
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.tab-item:hover { color: var(--text-primary); }

/* Botão "+" central destacado (FAB-in-tab-bar) */
.tab-item-fab {
  position: relative;
}
.tab-item-fab .tab-fab-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 8px 22px rgba(34, 211, 238, 0.45), 0 2px 6px rgba(168, 85, 247, 0.25);
  color: #ffffff;
  margin-top: -22px;
  margin-bottom: 2px;
  transition: transform 0.2s var(--ease-spring);
}
.tab-item-fab .tab-fab-bubble svg {
  width: 24px; height: 24px; color: #ffffff;
  filter: none;
}
.tab-item-fab:active .tab-fab-bubble {
  transform: scale(0.94);
}
.tab-item-fab span:last-child {
  color: var(--text-secondary);
  font-weight: 700;
}

/* Esconde o FAB flutuante quando a tab-bar está visível (mobile) — evita duplicação */
@media (max-width: 900px) {
  #mov-fab.fab-mov { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════════
   BOTTOM SHEET (mobile "Mais")
   ════════════════════════════════════════════════════════════════════ */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s var(--ease-smooth);
}
.sheet-backdrop:not([hidden]) { opacity: 1; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 51;
  background: var(--surface-glass-strong);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-top: 1px solid var(--border-medium);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 8px 0 calc(20px + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.42s var(--ease-spring);
  max-height: 85dvh;
  overflow-y: auto;
}
.sheet.open { transform: translateY(0); }

.sheet-handle {
  width: 38px;
  height: 5px;
  background: var(--border-strong);
  border-radius: 999px;
  margin: 8px auto 4px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.sheet-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.sheet-close {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}

.sheet-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sheet-list .sheet-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  font-weight: 700;
  padding: 14px 14px 6px;
}
.sheet-list a {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  background: transparent;
  text-decoration: none;
  transition: background 0.15s;
  min-height: 44px;
}
.sheet-list a:active { background: var(--surface-2); }

/* ════════════════════════════════════════════════════════════════════
   FAB + MOV FORM
   ════════════════════════════════════════════════════════════════════ */

.fab-mov {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 44;
  width: 50px;
  height: 50px;
  border-radius: 999px;
  background: var(--surface-glass-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.22s var(--ease-spring);
}
.fab-mov:hover {
  transform: scale(1.08);
  border-color: var(--border-accent);
}
.fab-mov:active { transform: scale(0.94); }

@media (max-width: 900px) {
  .fab-mov {
    bottom: calc(var(--tab-height) + var(--safe-bottom) + 14px);
    right: 16px;
  }
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: white;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.32);
  transition: transform 0.18s var(--ease-spring);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(34, 211, 238, 0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: wait; }

/* MOV form */
.mov-form {
  padding: 18px 18px calc(18px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mov-grid-full { grid-column: 1 / -1; }
.mov-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  font-weight: 600;
}
.mov-form input, .mov-form select {
  height: 44px;
  font-size: 15px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-primary);
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 0 12px;
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--font-text);
}
.mov-form input:focus, .mov-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}
.mov-preview {
  background: var(--surface-2);
  border: 1px dashed var(--border-medium);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  display: none;
}
.mov-preview.show { display: block; }
.mov-preview b { color: var(--text-primary); font-weight: 700; }
.mov-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
@media (max-width: 480px) {
  .mov-grid { grid-template-columns: 1fr; }
  .mov-actions button { flex: 1; }
}

/* ════════════════════════════════════════════════════════════════════
   AGENT — FAB & PANEL
   ════════════════════════════════════════════════════════════════════ */

.fab-agent {
  position: fixed;
  right: 24px;
  bottom: calc(24px);
  z-index: 45;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  display: grid;
  place-items: center;
  box-shadow:
    0 14px 36px rgba(34, 211, 238, 0.36),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  cursor: pointer;
  border: none;
  transition: transform 0.25s var(--ease-spring);
  isolation: isolate;
}
.fab-agent:hover { transform: scale(1.08); }
.fab-agent:active { transform: scale(0.94); }
.fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0.35;
  z-index: -1;
  animation: fab-pulse 2.6s var(--ease-smooth) infinite;
}
@keyframes fab-pulse {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.18); opacity: 0; }
}

@media (max-width: 900px) {
  .fab-agent {
    /* sai do bottom-right e some — agente fica no tab bar */
    display: none;
  }
}

.agent-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: 420px;
  max-width: 100vw;
  z-index: 80;
  background: var(--surface-glass-strong);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-left: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.42s var(--ease-spring);
  box-shadow: -32px 0 60px rgba(0,0,0,0.4);
}
.agent-panel.open { transform: translateX(0); }
@media (max-width: 640px) {
  .agent-panel {
    width: 100vw;
    border-left: none;
    border-top: 1px solid var(--border-medium);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    top: auto;
    bottom: 0;
    height: 92dvh;
    transform: translateY(100%);
    z-index: 200;          /* > .tab-bar (40), > sheet-backdrop (50) */
    isolation: isolate;     /* novo stacking context */
  }
  .agent-panel.open {
    transform: translateY(0);
    box-shadow: 0 -32px 60px rgba(0,0,0,0.6);
  }
}

.agent-header {
  padding: 18px 20px 14px;
  padding-top: calc(18px + var(--safe-top));
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.agent-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.agent-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-top: 4px;
}
.agent-btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 11px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}
.agent-btn-ghost:hover { background: var(--surface-2); color: var(--text-primary); }

.agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-input-area {
  border-top: 1px solid var(--border-subtle);
  padding: 12px 14px calc(12px + var(--safe-bottom));
}
.agent-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.agent-suggestions button {
  font-size: 11.5px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.agent-suggestions button:hover {
  background: var(--surface-1);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.agent-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.agent-input {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-text);
  outline: none;
  transition: border-color 0.15s;
}
.agent-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18); }
.agent-input::placeholder { color: var(--text-tertiary); }

.agent-send {
  height: 44px;
  width: 44px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.18s var(--ease-spring);
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.32);
}
.agent-send:active { transform: scale(0.94); }

.agent-hint {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 8px;
  text-align: center;
  letter-spacing: 0.04em;
}

/* Agent messages */
.msg-user {
  display: flex;
  justify-content: flex-end;
}
.msg-user > div {
  max-width: 85%;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: white;
  border-radius: 18px 18px 4px 18px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.20);
}
.msg-assistant {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.msg-assistant > div:last-child {
  max-width: 95%;
  padding: 12px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 18px 18px 18px 4px;
  font-size: 14px;
  line-height: 1.55;
}
.msg-tools {
  font-size: 10px;
  color: var(--text-tertiary);
  font-style: italic;
  padding-left: 4px;
}
.msg-system {
  text-align: center;
  font-size: 10.5px;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 2px 0;
}
.msg-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-style: italic;
  padding: 8px 14px;
}
.ld-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 12px var(--accent-glow);
  animation: ld-pulse 1.2s ease-in-out infinite;
}
@keyframes ld-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

#agent-messages b { color: var(--accent); font-weight: 700; }
#agent-messages code {
  background: var(--surface-2);
  color: var(--accent-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-mono);
}
#agent-messages .agent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin: 8px 0;
}
#agent-messages .agent-table th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-medium);
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
}
#agent-messages .agent-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
#agent-messages .agent-table tr:last-child td { border-bottom: none; }

/* Ticker cell layout (logo + texto) */
.ticker-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ticker-cell-text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* Cards de evolução RF — header com logo */
.rf-evo-card {
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.rf-evo-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 40%);
}
.rf-evo-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rf-evo-ticker {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rf-evo-meta {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rf-evo-method {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.rf-evo-target {
  font-size: 13px;
  font-weight: 700;
  color: var(--positive);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
  margin-top: auto;
}

/* ════════════════════════════════════════════════════════════════════
   FLAGS + ICONS suporte
   ════════════════════════════════════════════════════════════════════ */

.flag, .flag-svg {
  display: inline-block;
  width: 22px;
  height: 15px;
  border-radius: 3px;
  vertical-align: -2px;
  margin-right: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.08);
  flex-shrink: 0;
  overflow: hidden;
}
/* legacy fallback (caso elementos antigos ainda existam) */
.flag-br {
  background: linear-gradient(180deg, #009c3b 0%, #009c3b 60%, #ffdf00 60%, #ffdf00 100%);
}
.flag-us {
  background:
    repeating-linear-gradient(180deg,
      #c8102e 0px, #c8102e 1.5px,
      #fff 1.5px, #fff 3px);
}
/* KPI value alignment com flag */
.kpi-value .flag-svg, .asset-hero-price-value .flag-svg {
  width: 26px;
  height: 18px;
  vertical-align: -3px;
  margin-right: 10px;
}

.nav-link svg, .tab-item svg { flex-shrink: 0; }
.nav-icon {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-link.active .nav-icon { opacity: 1; stroke: var(--accent); }

/* ════════════════════════════════════════════════════════════════════
   ASSET LOGO (E5)
   ════════════════════════════════════════════════════════════════════ */

.asset-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  color: white;
  font-size: 11px;
  letter-spacing: -0.02em;
}
.asset-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}
.asset-logo[data-size="xs"] { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }
.asset-logo[data-size="sm"] { width: 32px; height: 32px; border-radius: 8px; font-size: 12px; }
.asset-logo[data-size="md"] { width: 48px; height: 48px; border-radius: 12px; font-size: 18px; }
.asset-logo[data-size="lg"] { width: 96px; height: 96px; border-radius: 18px; font-size: 36px; }
.asset-logo[data-size="xl"] {
  width: 160px; height: 160px;
  border-radius: 28px;
  font-size: 60px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 0 1px var(--border-medium) inset;
}

/* Hero header (Apple Music style) pra view Por Ativo */
.asset-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
  padding: 24px 24px 28px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-1);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.asset-hero::before {
  content: '';
  position: absolute;
  inset: -40px;
  background-image: var(--hero-bg, none);
  background-size: cover;
  background-position: center;
  filter: blur(60px) saturate(140%) brightness(0.55);
  opacity: 0.7;
  z-index: -2;
  transform: scale(1.4);
}
.asset-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,13,18,0.2) 0%, rgba(10,13,18,0.85) 100%);
  z-index: -1;
}
.asset-hero-row {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.asset-hero-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.asset-hero-ticker {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary);
}
.asset-hero-name {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}
.asset-hero-price {
  text-align: right;
  flex-shrink: 0;
}
.asset-hero-price-value {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.asset-hero-price-day {
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .asset-hero { padding: 18px; min-height: 160px; }
  .asset-hero-row { gap: 14px; }
  .asset-hero-price { text-align: left; width: 100%; }
}

/* ════════════════════════════════════════════════════════════════════
   INFO TIP (E4c)
   ════════════════════════════════════════════════════════════════════ */

.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: help;
  border-bottom: 1px dashed var(--border-medium);
}
.info-tip:hover { color: var(--accent); border-bottom-color: var(--accent); }
.info-tip-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 260px;
  padding: 10px 12px;
  background: var(--surface-glass-strong);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s var(--ease-smooth), transform 0.22s var(--ease-spring);
  z-index: 90;
  box-shadow: var(--shadow-lg);
}
.info-tip:hover .info-tip-bubble,
.info-tip:focus .info-tip-bubble {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
  pointer-events: auto;
}

/* ════════════════════════════════════════════════════════════════════
   GLASS NOS CHARTS — Plotly wrapper (E4d)
   ════════════════════════════════════════════════════════════════════ */

div[id^="chart-"] {
  border-radius: var(--radius-md);
  background:
    radial-gradient(at 25% 0%, rgba(34, 211, 238, 0.04) 0px, transparent 50%),
    radial-gradient(at 80% 100%, rgba(168, 85, 247, 0.03) 0px, transparent 60%);
}
div[id^="chart-"] .modebar { display: none !important; }
div[id^="chart-"] .hovertext path,
div[id^="chart-"] .legend > rect { rx: 6; ry: 6; }

/* ════════════════════════════════════════════════════════════════════
   FOCUS RINGS (acessibilidade)
   ════════════════════════════════════════════════════════════════════ */

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ════════════════════════════════════════════════════════════════════
   MISC OVERRIDES (compatibilidade com Tailwind do JS)
   ════════════════════════════════════════════════════════════════════ */

.mock-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  background: rgba(251, 191, 36, 0.14);
  color: var(--warning);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(251, 191, 36, 0.32);
}

input[type="text"], input[type="number"], select {
  background: var(--surface-2);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font-text);
  outline: none;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}

/* Loading state */
.loading-shimmer {
  background: linear-gradient(90deg,
    var(--surface-1) 0%,
    var(--surface-2) 50%,
    var(--surface-1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Dim overlays Tailwind sobreviventes */
.bg-amber-100 { background: rgba(251, 191, 36, 0.12) !important; color: var(--warning) !important; }
.bg-emerald-100 { background: rgba(52, 211, 153, 0.12) !important; color: var(--positive) !important; }
.bg-red-100 { background: rgba(248, 113, 113, 0.12) !important; color: var(--negative) !important; }

/* ==================================================================
   Smart Money — feed cronológico, heatlist entrando/saindo, modal
   ================================================================== */
.sm-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.sm-trade-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sm-trade-card:hover {
  background: rgba(34, 211, 238, 0.06);
  border-color: rgba(34, 211, 238, 0.25);
  transform: translateY(-1px);
}
.sm-trade-actor {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.sm-actor-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: white;
  font-size: 15px; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.sm-actor-avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.sm-actor-meta { min-width: 0; }
.sm-actor-name {
  font-weight: 600; font-size: 13px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sm-actor-party {
  font-size: 10px; color: var(--text-tertiary);
  letter-spacing: 0.05em;
}
.sm-trade-action {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.sm-kind-pill {
  font-size: 10px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; letter-spacing: 0.06em;
  font-family: var(--font-display);
}
.sm-trade-ticker {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 13px;
}
.sm-trade-meta {
  text-align: right; font-size: 11px;
}
.sm-trade-size {
  font-family: var(--font-mono); font-weight: 600;
  color: var(--text-secondary);
}
.sm-trade-date {
  color: var(--text-tertiary); margin-top: 2px;
  font-family: var(--font-mono);
}

/* Heatlist (entrando/saindo) */
.sm-heat-list {
  display: flex; flex-direction: column; gap: 8px;
}
.sm-heat-row {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 0.9fr;
  gap: 14px; align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--accent, #22d3ee);
  border-radius: 10px;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sm-heat-row:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(2px);
}
.sm-heat-rank {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.sm-heat-ticker {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  color: var(--text-primary); letter-spacing: -0.01em;
}
.sm-heat-actors {
  font-size: 11px; color: var(--text-tertiary);
}
.sm-heat-bar {
  position: relative; height: 22px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.sm-heat-bar-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  border-radius: 6px;
  opacity: 0.32;
  transition: width 0.4s ease-out;
}
.sm-heat-bar-label {
  position: relative; z-index: 1;
  font-family: var(--font-mono); font-size: 11px;
  font-weight: 600; color: var(--text-secondary);
}
.sm-heat-size { text-align: right; }
.sm-heat-size-val {
  font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  color: var(--text-primary);
}
.sm-heat-size-sub {
  font-size: 10px; color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* Guru chips */
.sm-guru-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.sm-guru-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

/* Signal row clicável */
.sm-signal-row { cursor: pointer; transition: background 0.15s; }
.sm-signal-row:hover { background: rgba(34, 211, 238, 0.05); }

/* Modal histórico (reutiliza .audit-modal mas garante centralização) */
#sm-history-modal.audit-modal {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  align-items: center; justify-content: center;
}
#sm-history-modal .audit-content {
  max-width: 640px; max-height: 80vh; overflow-y: auto;
}

/* Mobile: empilhar trade card */
@media (max-width: 640px) {
  .sm-trade-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .sm-trade-meta { text-align: left; }
  .sm-heat-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .sm-heat-size { text-align: left; }
}

/* ====================================================================
   Mobile chart + asset selector fixes
   ==================================================================== */

/* Seletor de ativo (Por Ativo) — tema dark + max-width responsivo */
.asset-selector {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 10px;
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  width: 100%;
  outline: none;
  text-overflow: ellipsis;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.asset-selector:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}
.asset-selector option,
.asset-selector optgroup {
  background: #0f1620;
  color: var(--text-primary);
}
@media (min-width: 768px) {
  .asset-selector { width: auto; min-width: 260px; }
}

/* Charts: garantir container nunca estoura, height fluida */
.panel > div[id^="chart-"] {
  min-height: 240px;
  max-width: 100%;
  overflow: hidden;
}
@media (max-width: 640px) {
  /* Reduz altura dos charts em mobile pra não exigir scroll vertical exagerado */
  .panel > div[id^="chart-"] {
    height: 280px !important;
    min-height: 240px !important;
  }
  /* Donuts/pies em mobile: mais compactos */
  .panel > div[id^="chart-"][data-chart-type="donut"] {
    height: 240px !important;
  }
  /* Panel padding menor pra ganhar largura útil */
  .panel { padding: 16px 12px; }
  .panel-title { margin-bottom: 8px; font-size: 11px; }
  /* Asset hero compacta em mobile */
  .asset-hero { padding: 16px 14px; }
  .asset-hero-row { gap: 12px; }
  .asset-hero-ticker { font-size: 26px !important; }
  .asset-hero-price-value { font-size: 22px !important; }
}

/* O `div` wrapper do Plotly precisa ocupar 100% da width */
.panel .js-plotly-plot,
.panel .js-plotly-plot .plotly,
.panel .js-plotly-plot .main-svg {
  width: 100% !important;
  max-width: 100% !important;
}

/* ====================================================================
   Range pills — zoom temporal no chart Histórico de Preço (view Por Ativo)
   ==================================================================== */
.range-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 8px 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.range-pills::-webkit-scrollbar { display: none; }

.range-pill {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s var(--ease-smooth), color 0.15s, border-color 0.15s;
}
.range-pill:hover {
  color: var(--text-primary);
  border-color: rgba(34, 211, 238, 0.4);
}
.range-pill.active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16) 0%, rgba(168, 85, 247, 0.12) 100%);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.25);
}

/* ====================================================================
   Botão Relatório no header + botão de download dentro do chat agente
   ==================================================================== */

.btn-report {
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.12), rgba(255, 204, 0, 0.06));
  border-color: rgba(255, 204, 0, 0.4);
  color: #FFCC00;
}
.btn-report:hover {
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.20), rgba(255, 204, 0, 0.10));
  border-color: rgba(255, 204, 0, 0.6);
  color: #ffd633;
}
.btn-report svg {
  color: #FFCC00;
}

/* Botão de download dentro da bolha do agente */
.agent-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 9px 14px;
  background: linear-gradient(135deg, #FFCC00 0%, #d4a017 100%);
  color: #000;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(255, 204, 0, 0.25);
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s var(--ease-smooth);
}
.agent-report-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(255, 204, 0, 0.4);
  color: #000;
}
.agent-report-btn:active {
  transform: translateY(0);
}

/* ====================================================================
   Botão "🤖 IA" universal — dispara análise daquele ativo
   ==================================================================== */
.ai-ask-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.16) 0%, rgba(34, 211, 238, 0.10) 100%);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 8px;
  color: var(--accent-2);
  cursor: pointer;
  transition: all 0.18s var(--ease-spring);
  vertical-align: middle;
  margin-left: 6px;
  flex-shrink: 0;
}
.ai-ask-btn:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.32) 0%, rgba(34, 211, 238, 0.22) 100%);
  border-color: var(--accent-2);
  color: #c4a4ff;
  transform: scale(1.08);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.42);
}
.ai-ask-btn:active { transform: scale(0.95); }
.ai-ask-btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

/* ====================================================================
   Smart Money cards reformulados
   - Cards de "Entrando" com glow verde sutil + verdict OPORTUNIDADE
   - Cards de "Saindo" com glow vermelho + verdict RISCO
   - Logo grande + nome empresa + ticker + botão IA + tipo + valor
   ==================================================================== */
.sm-heat-row {
  display: grid;
  grid-template-columns: 110px 2.2fr 2fr 1.2fr;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent, #64748b);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  transition: background 0.2s var(--ease-smooth), transform 0.18s var(--ease-spring);
}
.sm-heat-row:hover {
  background: var(--surface-2);
  transform: translateX(2px);
}
.sm-heat-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 50%, var(--accent-glow, transparent) 0%, transparent 60%);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}
.sm-heat-row > * { position: relative; z-index: 1; }

.sm-heat-verdict {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 6px 10px;
  border-radius: 999px;
  text-align: center;
  font-family: var(--font-display);
}
.sm-heat-entering .sm-heat-verdict {
  background: rgba(16, 185, 129, 0.16);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.sm-heat-exiting .sm-heat-verdict {
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.sm-heat-rank {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sm-heat-info {
  min-width: 0;
  flex: 1;
}
.sm-heat-ticker-line {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sm-heat-ticker {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.sm-heat-company {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.sm-heat-actors {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.sm-heat-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sm-heat-bar-fill {
  height: 8px;
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.4s var(--ease-snappy);
}
.sm-heat-bar-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.sm-heat-size {
  text-align: right;
}
.sm-heat-size-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sm-heat-size-sub {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Mobile: empilha verticalmente */
@media (max-width: 640px) {
  .sm-heat-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }
  .sm-heat-verdict { justify-self: start; }
  .sm-heat-bar { width: 100%; }
  .sm-heat-size { text-align: left; }
}

/* Trade cards (Feed de movimentações) reformulados */
.sm-trade-card {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  margin-bottom: 6px;
  transition: background 0.2s var(--ease-smooth);
}
.sm-trade-card:hover { background: var(--surface-2); }
.sm-trade-buy { border-left-color: #10b981; }
.sm-trade-sell { border-left-color: #ef4444; }
.sm-trade-exchange { border-left-color: #f59e0b; }

.sm-trade-actor {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sm-actor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.sm-actor-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.sm-actor-party {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.sm-trade-action {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sm-trade-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sm-ticker-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sm-ticker-code {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.sm-ticker-name {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.sm-kind-pill {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  border-radius: 999px;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.sm-trade-meta {
  text-align: right;
}
.sm-trade-size {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}
.sm-trade-date {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.sm-trade-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .sm-trade-card {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .sm-trade-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ====================================================================
   Smart Money 3.0 — 4 painéis (Top 10 + Buys + Sells + Personalidades)
   ==================================================================== */

/* ----- Painel 0: Top 10 cards horizontais ----- */
.sm-opp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.sm-opp-card {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent, #64748b);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.18s, transform 0.18s var(--ease-spring);
}
.sm-opp-card:hover {
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
.sm-opp-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, var(--accent-glow, transparent), transparent 60%);
  opacity: 0.18;
  pointer-events: none;
}
.sm-opp-card > * { position: relative; z-index: 1; }

.sm-opp-buy { --accent-glow: rgba(16,185,129,0.4); }
.sm-opp-sell { --accent-glow: rgba(239,68,68,0.4); }

.sm-opp-rank {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-tertiary);
  letter-spacing: -0.02em;
  min-width: 32px;
}
.sm-opp-info { min-width: 0; }
.sm-opp-ticker-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sm-opp-ticker {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.sm-opp-verdict {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 999px;
}
.sm-opp-company {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-opp-actors {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.sm-opp-actors strong { color: var(--text-primary); font-size: 13px; }

.sm-spotlight-tag {
  display: inline-block;
  font-size: 10px;
  background: rgba(251,191,36,0.16);
  color: var(--warning);
  padding: 1px 6px;
  border-radius: 999px;
  margin-right: 3px;
  font-weight: 600;
}

/* ----- Painel 1+2: rank rows expansíveis ----- */
.sm-rank-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sm-rank-row {
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent, #64748b);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  overflow: hidden;
  transition: background 0.18s;
}
.sm-rank-row:hover { background: var(--surface-2); }
.sm-rank-row.expanded { background: var(--surface-2); }

.sm-rank-main {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
}

.sm-rank-toggle {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.sm-rank-toggle:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.sm-rank-info { min-width: 0; }
.sm-rank-ticker-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
}
.sm-rank-ticker-line strong {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.sm-rank-company {
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.sm-rank-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.sm-spotlight-mini {
  color: var(--warning);
  font-weight: 600;
}

.sm-rank-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sm-chart-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(34,211,238,0.3);
  background: rgba(34,211,238,0.08);
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sm-chart-btn:hover {
  background: rgba(34,211,238,0.18);
  transform: scale(1.08);
}

.sm-rank-detail {
  padding: 10px 14px 14px 50px;
  border-top: 1px dashed var(--border-subtle);
}
.sm-rank-detail-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.sm-actors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}
.sm-actor-mini {
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-1);
  position: relative;
}
.sm-actor-mini.spotlight {
  border-color: rgba(251,191,36,0.4);
  background: linear-gradient(135deg, rgba(251,191,36,0.06), transparent);
}
.sm-actor-star {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
}
.sm-actor-mini-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}
.sm-actor-mini-role {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 1px;
}
.sm-actor-mini-value {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 3px;
  font-family: var(--font-mono);
}

/* ----- Painel 3: Personalidades grid + detail ----- */
.sm-personalities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
  margin-bottom: 16px;
}
.sm-person-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-1);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.18s;
}
.sm-person-chip:hover {
  background: var(--surface-2);
  border-color: var(--border-medium);
}
.sm-person-chip.active {
  background: rgba(34,211,238,0.10);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(34,211,238,0.18);
}
.sm-person-chip.spotlight {
  border-color: rgba(251,191,36,0.3);
}
.sm-person-chip.spotlight.active {
  border-color: var(--warning);
  background: rgba(251,191,36,0.08);
  box-shadow: 0 0 14px rgba(251,191,36,0.18);
}
.sm-person-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.sm-person-info { min-width: 0; }
.sm-person-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-person-role {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.sm-personality-detail {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  background: var(--surface-1);
}
.sm-personality-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.sm-personality-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}
.sm-personality-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.sm-personality-trades {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sm-pt-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-1);
  cursor: pointer;
  transition: background 0.18s;
}
.sm-pt-row:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}
.sm-pt-info { min-width: 0; }
.sm-pt-ticker {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}
.sm-pt-company {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.sm-pt-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 999px;
}
.sm-pt-meta { text-align: right; }
.sm-pt-value {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}
.sm-pt-date {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .sm-opp-grid { grid-template-columns: 1fr; }
  .sm-rank-main { grid-template-columns: auto auto 1fr auto; }
  .sm-rank-detail { padding-left: 14px; }
  .sm-personalities-grid { grid-template-columns: 1fr 1fr; }
}

/* Variant menor do botão IA pra dentro de células de tabela */
.ai-btn-inline {
  width: 22px;
  height: 22px;
  margin-left: 8px;
  padding: 0;
}
.ai-btn-inline svg {
  width: 12px;
  height: 12px;
}

/* Tickers em tabelas hover sutil */
table.atlas tbody td.font-semibold[data-ai-btn] {
  transition: color 0.15s;
}
table.atlas tbody td.font-semibold[data-ai-btn]:hover {
  color: var(--accent);
}

/* ─── Cross-reference clickable rows ─── */
.row-clickable {
  cursor: pointer;
  transition: background 0.15s;
}
.row-clickable:hover {
  background: rgba(34, 211, 238, 0.06) !important;
}
.hint-click {
  display: inline-block;
  margin-left: 4px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s var(--ease-spring);
}
.row-clickable:hover .hint-click {
  opacity: 1;
  transform: translateX(2px);
}

/* ─── Asset history timeline (modal) ─── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
}
.timeline-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  transition: background 0.15s;
}
.timeline-row:hover {
  background: rgba(255,255,255,0.06);
}
.timeline-action {
  display: flex;
  align-items: center;
}
.timeline-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
}
.timeline-manager {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 1px;
}
.timeline-meta {
  text-align: right;
  font-family: 'SF Mono', monospace;
}
.timeline-shares {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.timeline-value {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  margin-top: 1px;
}
.timeline-quarter {
  font-size: 9px;
  color: var(--text-tertiary);
  margin-top: 2px;
  text-transform: uppercase;
}

/* ─── Hot Money in/out panels ─── */
.hot-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.hot-row {
  display: grid;
  grid-template-columns: 22px 60px 50px auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s var(--ease-spring);
  font-size: 12px;
}
.hot-row:hover {
  background: rgba(255,255,255,0.06);
  transform: translateX(2px);
}
.hot-rank {
  font-family: 'SF Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: center;
}
.hot-ticker {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.hot-score {
  font-family: 'SF Mono', monospace;
  font-weight: 600;
  text-align: right;
}
.hot-count {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hot-actors {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.hot-actor {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hot-more {
  font-size: 9px;
  color: var(--text-tertiary);
  font-style: italic;
}

/* ─── Audit pill (badge consistência) ─── */
.audit-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s var(--ease-spring), filter 0.15s;
}
.audit-pill:hover { transform: scale(1.05); filter: brightness(1.15); }
.audit-ok {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.32);
}
.audit-warn {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.4);
  animation: audit-pulse 2.4s ease-in-out infinite;
}
@keyframes audit-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(248,113,113,0); }
}

/* ─── Audit modal (info popover sobre consistência) ─── */
.audit-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 220;
  padding: 20px;
  animation: audit-fade 0.22s var(--ease-snappy);
}
.audit-modal-overlay .audit-modal {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: 480px;
  background: var(--surface-glass-strong);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.04) inset;
  color: var(--text-primary);
  animation: audit-slide 0.32s var(--ease-spring);
}
.audit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.audit-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.audit-modal-body code {
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.audit-ok-block {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 12px;
  padding: 12px 14px;
  color: #86efac;
}
.audit-warn-block {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.32);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fca5a5;
}
.audit-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}
.audit-table th, .audit-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}
.audit-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.audit-table td.font-mono {
  font-family: 'SF Mono', 'JetBrains Mono', ui-monospace, monospace;
  text-align: right;
}

/* ════════════════════════════════════════════════════════════════════
   E19 · Validação Qualidade Atlas
   Badge no rodapé de cada resposta da IA + modal de detalhes
   ════════════════════════════════════════════════════════════════════ */

/* ---------- Badge (chip) ---------- */
.validation-badge {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  margin-left: 4px;
  padding: 6px 10px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-medium);
  background: var(--surface-glass);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  color: var(--text-primary);
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s var(--ease-snappy),
              border-color 0.18s var(--ease-snappy), background 0.18s var(--ease-snappy);
  white-space: nowrap;
  align-self: flex-start;
}
.validation-badge:hover {
  transform: translateY(-1px);
  background: var(--surface-glass-strong);
}
.validation-badge:active { transform: translateY(0) scale(0.98); }
.validation-badge:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.35);
}

.validation-badge .vb-icon {
  font-size: 13px;
  line-height: 1;
}
.validation-badge .vb-label {
  font-weight: 600;
  letter-spacing: 0.01em;
}
.validation-badge .vb-sep {
  opacity: 0.45;
  font-weight: 400;
}
.validation-badge .vb-detail {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-feature-settings: "tnum" 1;
  opacity: 0.86;
  letter-spacing: 0;
}

/* Variants */
.validation-badge.is-validated {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.30);
}
.validation-badge.is-validated:hover {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.18);
}

.validation-badge.is-warning {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.34);
}
.validation-badge.is-warning:hover {
  border-color: rgba(245, 158, 11, 0.58);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.20);
}

.validation-badge.is-failed {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.40);
}
.validation-badge.is-failed:hover {
  border-color: rgba(239, 68, 68, 0.65);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.24);
}
.validation-badge.is-failed .vb-icon { color: #ef4444; }

.validation-badge.is-pending {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.08);
  border-color: var(--border-accent);
}
.validation-badge.is-pending .vb-icon {
  display: inline-block;
  animation: vb-pulse 1.4s ease-in-out infinite;
}

@keyframes vb-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50%      { opacity: 1; transform: scale(1.08); }
}

/* Light theme: ajustes de contraste */
[data-theme="light"] .validation-badge.is-validated {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}
[data-theme="light"] .validation-badge.is-warning {
  color: #a16207;
  background: rgba(245, 158, 11, 0.15);
}
[data-theme="light"] .validation-badge.is-failed {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
}

/* Reduced motion: tira a pulsação e transições caprichadas */
@media (prefers-reduced-motion: reduce) {
  .validation-badge { transition: none; }
  .validation-badge:hover { transform: none; }
  .validation-badge.is-pending .vb-icon { animation: none; }
}

/* ---------- Modal ---------- */
.validation-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s var(--ease-snappy);
}
.validation-modal.is-open {
  pointer-events: auto;
  opacity: 1;
}
.validation-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 12, 0.68);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.validation-modal__sheet {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-glass-strong);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  color: var(--text-primary);
  overflow: hidden;
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  transition: transform 0.28s var(--ease-spring), opacity 0.22s var(--ease-snappy);
}
.validation-modal.is-open .validation-modal__sheet {
  transform: none;
  opacity: 1;
}

.validation-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background:
    radial-gradient(circle at 0% 0%, rgba(34, 211, 238, 0.07), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.06), transparent 60%);
}
.validation-modal__header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}
.vm-shield {
  font-size: 16px;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.55));
}
.validation-modal__close {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition: all 0.15s var(--ease-snappy);
}
.validation-modal__close:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}
.validation-modal__close:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.30);
}

.validation-modal__body {
  padding: 20px 22px 22px;
  overflow-y: auto;
  flex: 1;
}

/* Summary block */
.vm-summary { margin-bottom: 18px; }
.vm-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  border: 1px solid var(--border-medium);
}
.vm-status-pill.is-validated { color: #22c55e; background: rgba(34, 197, 94, 0.10); border-color: rgba(34, 197, 94, 0.32); }
.vm-status-pill.is-warning   { color: #fbbf24; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.34); }
.vm-status-pill.is-failed    { color: #fca5a5; background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.40); }
.vm-status-pill.is-pending   { color: var(--accent); background: rgba(34, 211, 238, 0.08); border-color: var(--border-accent); }

.vm-summary-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vm-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
}
.vm-summary-label {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.vm-summary-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-feature-settings: "tnum" 1;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.vm-summary-value.is-pos { color: #22c55e; }
.vm-summary-value.is-neg { color: #fca5a5; }
.vm-summary-value.vm-pending { color: var(--accent); }
.vm-summary-meta {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 400;
  margin-left: 4px;
}
.vm-spinner {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  border-right-color: transparent;
  animation: vm-spin 0.85s linear infinite;
}
@keyframes vm-spin { to { transform: rotate(360deg); } }

/* Section heading */
.vm-section-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin: 18px 0 10px;
}

/* Conferência table */
.validation-table-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-1);
}
.validation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.validation-table thead th {
  text-align: left;
  padding: 8px 12px;
  background: var(--surface-2);
  color: var(--text-tertiary);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-medium);
}
.validation-table thead th.num { text-align: right; }
.validation-table thead th.center { text-align: center; }
.validation-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}
.validation-table tbody tr:last-child td { border-bottom: none; }
.validation-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.validation-table .vm-claim { max-width: 240px; }
.validation-table .vm-real { color: var(--text-secondary); }
.validation-table .num { text-align: right; }
.validation-table .center { text-align: center; }
.validation-table .font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.validation-table .vm-delta { color: var(--text-secondary); }
.validation-table .vm-ok-cell { font-weight: 700; color: #22c55e; }
.validation-table .vm-source code {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--accent-2);
}

.validation-table tr.is-warn { background: rgba(245, 158, 11, 0.06); }
.validation-table tr.is-warn .vm-ok-cell { color: #fbbf24; }
.validation-table tr.is-warn .vm-delta { color: #fbbf24; }
.validation-table tr.is-fail { background: rgba(239, 68, 68, 0.08); }
.validation-table tr.is-fail .vm-ok-cell { color: #ef4444; }
.validation-table tr.is-fail .vm-delta { color: #fca5a5; font-weight: 600; }

/* Empty / error / skeleton states */
.vm-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
}
.vm-error {
  padding: 24px;
  text-align: center;
  border: 1px solid rgba(239, 68, 68, 0.30);
  background: rgba(239, 68, 68, 0.06);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}
.vm-error-icon { font-size: 22px; margin-bottom: 8px; color: #fca5a5; }
.vm-error-text small { display: block; margin-top: 4px; color: var(--text-tertiary); font-size: 11px; }
.vm-retry {
  margin-top: 12px;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--bg-base);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring);
}
.vm-retry:hover { transform: scale(1.04); }
.vm-retry:active { transform: scale(0.96); }

.vm-skeleton-block, .vm-skeleton-row {
  background: linear-gradient(90deg,
    var(--surface-1) 0%,
    var(--surface-2) 50%,
    var(--surface-1) 100%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: vm-shimmer 1.4s ease-in-out infinite;
}
.vm-skeleton-block {
  height: 44px;
  margin-bottom: 10px;
}
.vm-skel-narrow { width: 60%; }
.vm-skeleton-row {
  height: 28px;
  margin-bottom: 6px;
}
@keyframes vm-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* How-it-works expansível */
.vm-howto {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.vm-howto summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  user-select: none;
}
.vm-howto summary:focus-visible {
  outline: none;
  text-decoration: underline;
}
.vm-howto p { margin: 8px 0; }
.vm-howto ul { margin: 6px 0 8px; padding-left: 22px; }
.vm-howto li { margin: 4px 0; }
.vm-howto b { color: var(--text-primary); }

/* Mobile: modal vira full-screen sheet ascendente */
@media (max-width: 720px) {
  .validation-modal { padding: 0; align-items: flex-end; }
  .validation-modal__sheet {
    max-height: 92vh;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
    transform: translateY(100%);
  }
  .validation-modal.is-open .validation-modal__sheet { transform: none; }
  .validation-modal__header { padding: 14px 18px; }
  .validation-modal__header h2 { font-size: 15px; }
  .validation-modal__body { padding: 16px 18px 24px; }
  .validation-table { font-size: 11.5px; }
  .validation-table thead th,
  .validation-table tbody td { padding: 7px 8px; }
  .validation-table .vm-claim { max-width: 140px; }
  .validation-badge { font-size: 12.5px; height: 26px; padding: 5px 9px; }
  .validation-badge .vb-detail { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .validation-modal,
  .validation-modal__sheet { transition: none; }
  .vm-skeleton-block, .vm-skeleton-row { animation: none; }
  .vm-spinner { animation: none; border-right-color: var(--accent); }
}

/* ═══════════════════════════════════════════════════════════════════════
   INVES7-V2 OVERLAY · 2026-05-20
   Direção: Bloomberg + Apple Stocks + Coinbase
   Pure black · Inter pesado · pills filled · sparklines vivas
   Aplicado incremental sobre Liquid Terminal — NÃO substitui acent cyan.
   ═══════════════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
  /* surfaces — pure black, sem tom azulado */
  --bg-base: #000000;
  --bg-canvas: #0F0F13;
  --surface-1: #16161C;
  --surface-2: #1C1C24;
  --surface-glass: rgba(20, 20, 27, 0.78);
  --surface-glass-strong: rgba(8, 8, 12, 0.86);

  /* P&L mais saturado tipo Bloomberg At A Glance */
  --positive: #1FAE5C;
  --positive-soft: #5BD68B;
  --positive-glow: rgba(31, 174, 92, 0.22);
  --negative: #E63946;
  --negative-soft: #FF6973;
  --negative-glow: rgba(230, 57, 70, 0.22);
  --flat: #8E8E93;

  /* novos tokens v2 */
  --pos-bg: rgba(31, 174, 92, 0.13);
  --neg-bg: rgba(230, 57, 70, 0.13);
  --pos-pill-bg: #1FAE5C;
  --neg-pill-bg: #E63946;
  --selected-tab: #5B85F3;
  --gold-accent: #F0A65B;

  /* texto contraste pure black */
  --text-primary: #FFFFFF;
  --text-secondary: #C7C7CC;
  --text-tertiary: #8E8E93;
  --text-disabled: #5C5C66;

  /* borders mais sutis sobre pure black */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.20);
}

/* Inter como display + numeric — sem serif */
[data-theme="dark"] {
  --font-display: "Inter", -apple-system, "SF Pro Text", system-ui, sans-serif;
  --font-text: "Inter", -apple-system, "SF Pro Text", system-ui, sans-serif;
}

/* ──────────────────── TIPOGRAFIA V2 ──────────────────── */

/* Body usa Inter feature settings: tabular, ss01 (Apple-like 0/8) */
body {
  font-family: "Inter", -apple-system, "SF Pro Text", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03", "tnum";
  font-variation-settings: "opsz" 24;
}

/* Hero values massive Inter 700 ao invés de SF Display 800 */
.kpi-value, .hero-value, .ticker-hero {
  font-family: "Inter", -apple-system, system-ui, sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -1.2px !important;
  font-feature-settings: "tnum", "cv11", "ss01";
}

/* H1/H2/H3 pesados tight */
.panel-title, .section-title, h1, h2, h3 {
  font-family: "Inter", -apple-system, system-ui, sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.5px !important;
}

/* Números tabular nums em qualquer lugar */
.tabular, [class*="num"], td[data-numeric], .pl-pos, .pl-neg {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ──────────────────── PILLS FILLED ──────────────────── */

/* Pill positiva (Bloomberg style) */
.pill-pos, .badge-pos-filled, .v2-pos {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--pos-pill-bg);
  color: #FFFFFF;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}

.pill-neg, .badge-neg-filled, .v2-neg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--neg-pill-bg);
  color: #FFFFFF;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}

.pill-pos--sm, .pill-neg--sm { padding: 2px 7px; font-size: 11.5px; }
.pill-pos--lg, .pill-neg--lg { padding: 5px 11px; font-size: 15px; }

/* Pills outline (legacy) ganham backdrop sutil pra ler em pure black */
.delta-pill.pos { background: var(--pos-bg); color: var(--positive-soft); }
.delta-pill.neg { background: var(--neg-bg); color: var(--negative-soft); }

/* ──────────────────── SPARKLINES & PLOTLY V2 ──────────────────── */

/* Cor dos linhas de Plotly continua via JS, mas sparkline SVG inline
   ganha cores vivas */
.sparkline path[stroke="#34d399"], svg.spark path[data-pos] {
  stroke: #34D374 !important;
}
.sparkline path[stroke="#f87171"], svg.spark path[data-neg] {
  stroke: #FF5B68 !important;
}

/* ──────────────────── PANELS / CARDS ──────────────────── */

/* Cards ficam mais minimalistas no pure black */
.panel, .glass-card, .surface-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
}

/* Header sticky pure black com leve glass */
.app-header, .top-bar, .nav-rail {
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-color: var(--border-subtle);
}

/* ──────────────────── ACCENT TAB SELECIONADA ──────────────────── */

/* Tab ativa ganha sublinhado azul Bloomberg */
.tab-active, .segment-active, .nav-link.active {
  border-bottom-color: var(--selected-tab) !important;
  color: var(--text-primary);
}

/* ──────────────────── MESH BACKGROUND OFF ──────────────────── */

/* No pure black, mesh radial perde sentido — desativa */
.bg-mesh {
  opacity: 0.20 !important;
  filter: saturate(0.6) brightness(0.4);
}

/* ──────────────────── HELPERS V2 ──────────────────── */

.v2-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.v2-num {
  font-family: "Inter", -apple-system, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "cv11";
}

.v2-num--hero {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
}

.v2-num--l { font-size: 28px; font-weight: 700; letter-spacing: -0.8px; }
.v2-num--m { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }

.v2-currency-prefix {
  opacity: 0.55;
  font-size: 0.55em;
  font-weight: 600;
  margin-right: 3px;
  vertical-align: 0.18em;
}

/* ──────────────────── PLOTLY OVERRIDES SUBTIS ──────────────────── */

/* Plotly bg transparente pra absorver pure black */
.plotly .main-svg { background: transparent !important; }
.js-plotly-plot .plot-container .plotly { background: transparent !important; }

/* ═══════════════════════════════════════════════════════════════════════
   ASSET DETAIL V2 · hero estilo Apple Stocks + Bloomberg
   ═══════════════════════════════════════════════════════════════════════ */

.asset-hero--v2 {
  padding: 18px 22px 22px;
  gap: 14px;
}

.asset-hero-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Pill "Mercado aberto" estilo Apple */
.market-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.1px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.market-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.market-status--open {
  background: rgba(31, 174, 92, 0.14);
  border: 1px solid rgba(31, 174, 92, 0.28);
  color: var(--positive-soft);
}
.market-status--open .market-status-dot {
  background: var(--positive);
  box-shadow: 0 0 0 3px rgba(31, 174, 92, 0.20);
  animation: market-pulse 2.4s ease-in-out infinite;
}

.market-status--closed {
  background: rgba(142, 142, 147, 0.12);
  border: 1px solid rgba(142, 142, 147, 0.24);
  color: var(--text-tertiary);
}
.market-status--closed .market-status-dot {
  background: var(--text-tertiary);
}

@keyframes market-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(31, 174, 92, 0.20); }
  50% { box-shadow: 0 0 0 5px rgba(31, 174, 92, 0.32); }
}

/* Price row v2 — massive Inter + pill filled juntinhos */
.asset-hero-pricerow {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.asset-hero-price-v2 {
  font-family: "Inter", -apple-system, system-ui, sans-serif;
  font-size: clamp(28px, 4.5vw, 38px);
  font-weight: 800;
  letter-spacing: -1.4px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "cv11", "ss01";
  line-height: 1;
  white-space: nowrap;
}

/* Position strip — glass overlay sobre o blur */
.asset-hero-position-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(22, 22, 28, 0.78);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.asset-hero-pos-cell .v2-eyebrow {
  font-size: 10px;
  letter-spacing: 0.8px;
}

.num-m {
  font-family: "Inter", -apple-system, system-ui, sans-serif;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "cv11", "ss01";
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

/* Atenuar o gradiente do ::after porque temos position strip glass agora */
.asset-hero--v2::after {
  background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.72) 100%);
}

@media (max-width: 640px) {
  .asset-hero--v2 { padding: 14px 16px 18px; }
  .asset-hero-price-v2 { font-size: 26px; letter-spacing: -1px; }
  .asset-hero-position-strip { padding: 10px 12px; gap: 12px; }
  .asset-hero-toprow .market-status { font-size: 11px; padding: 5px 10px; }
}

/* Pill neutral pra valores indisponíveis */
.pill-neutral {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════
   IR · DARF View (Tax)
   Padrão inves7-v2: Inter pesado, pills filled, surface-card, pure black.
   ═══════════════════════════════════════════════════════════════════════ */

.ir-header-block {
  padding: 4px 2px 0;
}
.ir-page-title {
  font-family: "Inter", -apple-system, system-ui, sans-serif;
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -1.2px;
  color: var(--text-primary);
  line-height: 1.1;
  margin-top: 4px;
}
.ir-page-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
  letter-spacing: -0.1px;
}

/* ── Segment control ── */
.ir-segment {
  display: inline-flex;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}
.ir-segment-item {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.1px;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  font-family: inherit;
}
.ir-segment-item:hover { color: var(--text-primary); }
.ir-segment-item.active {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

/* ── Hero DARF ── */
.ir-hero-panel {
  padding: 24px 24px 22px;
}
.ir-hero-flex {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 760px) {
  .ir-hero-flex { grid-template-columns: 1fr; gap: 20px; }
  .ir-hero-panel { padding: 18px 16px 18px; }
}

.ir-hero-eyebrow {
  margin-bottom: 8px;
}

.ir-hero-value {
  font-family: "Inter", -apple-system, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -1.6px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "cv11";
}
.ir-hero-value--owed { color: var(--text-primary); }
.ir-hero-value--zero { color: var(--text-tertiary); }

.ir-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}

.ir-hero-sub {
  font-size: 13px;
  color: var(--text-tertiary);
}
.ir-hero-sub strong {
  color: var(--text-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ir-hero-empty {
  padding: 16px 0;
}
.ir-hero-empty-msg {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

.ir-hero-right {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ir-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  gap: 12px;
}
.ir-stat-row:last-child { border-bottom: none; }
.ir-stat-label {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ir-stat-value {
  font-family: "Inter", -apple-system, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.ir-stat-value--owed { color: var(--text-primary); font-size: 17px; }

.ir-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ir-action-pay {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 9px;
  letter-spacing: -0.1px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}
.ir-action-pay:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ir-action-pay:not(:disabled):hover { transform: translateY(-1px); }

.ir-action-pdf {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0.6;
  cursor: not-allowed;
}
.ir-tag-soon {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 2px;
}

/* Amber pill (entre 3 e 7 dias) */
.ir-pill-amber {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #d97706, #b45309);
  color: #ffffff;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}
.ir-pill-amber.pill-pos--sm { padding: 2px 7px; font-size: 11.5px; }

/* Pill código DARF (cinza glass) */
.ir-pill-code {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: "SF Mono", Menlo, monospace;
  letter-spacing: -0.1px;
}

/* ── Categoria cards ── */
.ir-categorias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.ir-cat-card {
  padding: 16px 18px 14px;
  border-radius: 12px;
}
.ir-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.ir-cat-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  line-height: 1.2;
}
.ir-cat-sub {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.ir-cat-ir {
  font-family: "Inter", -apple-system, system-ui, sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ir-cat-ir--owed { color: var(--text-primary); }
.ir-cat-ir--zero { color: var(--positive-soft); font-size: 14px; font-weight: 700; opacity: 0.85; }

.ir-cat-isencao {
  margin-bottom: 6px;
}

.ir-cat-ativos {
  margin-top: 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.ir-ativo-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 5px 0;
  align-items: baseline;
}
.ir-ativo-ticker {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.ir-ativo-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: -0.1px;
}
.ir-ativo-lucro {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
  text-align: right;
}
.ir-ativo-lucro--pos { color: var(--positive-soft); }
.ir-ativo-lucro--neg { color: var(--negative-soft); }
.ir-ativo-more {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 4px 0 0;
  font-style: italic;
}

.ir-cat-base-legal {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 10px;
  font-style: italic;
  letter-spacing: 0.1px;
  opacity: 0.7;
}

/* ── Alertas ── */
.ir-alerts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ir-alert {
  font-size: 12.5px;
  color: var(--text-secondary);
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
  padding: 8px 12px;
  border-radius: 4px;
  line-height: 1.4;
}
.ir-alert-info {
  background: rgba(59, 130, 246, 0.08);
  border-left-color: #3b82f6;
  color: var(--text-secondary);
}

/* ── Exterior table ── */
.ir-table-total td {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px !important;
}
.ir-base-legal-footer {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: right;
  padding-right: 4px;
}

/* ── Próximos vencimentos grid ── */
.ir-prox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.ir-prox-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 14px 16px;
}
.ir-prox-periodo {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.ir-prox-categoria {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
  letter-spacing: -0.2px;
}
.ir-prox-valor {
  font-family: "Inter", -apple-system, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin-top: 10px;
  line-height: 1;
}
.ir-prox-footer {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.ir-prox-pay {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* ── Empty state ── */
.ir-empty-state {
  text-align: center;
  padding: 28px 16px 24px;
}
.ir-empty-icon {
  font-size: 32px;
  color: var(--positive-soft);
  opacity: 0.55;
  font-weight: 700;
}
.ir-empty-msg {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 6px;
}

/* ── Histórico ── */
.ir-historico-table tbody tr.ir-hist-row {
  cursor: pointer;
  transition: background 120ms ease;
}
.ir-historico-table tbody tr.ir-hist-row:hover {
  background: rgba(255, 255, 255, 0.025);
}
.ir-historico-table tbody tr.ir-hist-row-open {
  background: rgba(255, 255, 255, 0.04);
}
.ir-hist-periodo {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.ir-hist-detail-cell {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px !important;
}
.ir-hist-base-legal {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.ir-hist-base-legal strong { color: var(--text-primary); font-weight: 700; }
.ir-hist-explicacao {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: 6px;
  margin: 0;
  line-height: 1.5;
  overflow-x: auto;
}

/* ── Audit dot (tip) ── */
.ir-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 700;
  cursor: help;
  margin-left: 5px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: border-color 120ms ease, color 120ms ease;
}
.ir-tip:hover {
  border-color: rgba(34, 211, 238, 0.45);
  color: #22d3ee;
}
.ir-tip:focus { outline: 2px solid rgba(34, 211, 238, 0.4); outline-offset: 1px; }

.ir-tip-pop {
  position: absolute;
  z-index: 9999;
  max-width: 300px;
  background: rgba(15, 18, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border-radius: 9px;
  padding: 10px 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  animation: ir-tip-pop-in 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ir-tip-pop-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  letter-spacing: -0.1px;
}
@keyframes ir-tip-pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Light theme overrides ── */
html[data-theme="light"] .ir-stat-row { border-bottom-color: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] .ir-cat-ativos { border-top-color: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] .ir-historico-table tbody tr.ir-hist-row:hover { background: rgba(15, 23, 42, 0.025); }
html[data-theme="light"] .ir-hist-detail-cell { background: rgba(15, 23, 42, 0.025); }
html[data-theme="light"] .ir-tip-pop { background: rgba(255, 255, 255, 0.98); }
html[data-theme="light"] .ir-pill-code { background: rgba(15, 23, 42, 0.05); border-color: rgba(15, 23, 42, 0.08); }

/* ── Mobile ajustes ── */
@media (max-width: 640px) {
  .ir-page-title { font-size: 26px; letter-spacing: -0.8px; }
  .ir-hero-value { font-size: 36px; letter-spacing: -1.2px; }
  .ir-categorias-grid { grid-template-columns: 1fr; }
  .ir-prox-grid { grid-template-columns: 1fr; }
  .ir-hero-actions { width: 100%; }
  .ir-action-pay, .ir-action-pdf { flex: 1 1 auto; justify-content: center; }
  .ir-segment-item { padding: 8px 12px; font-size: 12px; }
  .ir-stat-value { font-size: 14px; }
}
