/* Folha de estilo principal do AWFin (area logada + base compartilhada
   com apresentacao.css e auth.css, que dependem das variaveis abaixo).
   Tema unico, escuro ("dark-first") - nao ha bloco de tema claro, o
   :root ja define as cores finais direto. */

:root {
  --bg-0: #120a1f;
  --bg-1: #180f28;
  --panel: #1c1230;
  --panel-2: #221836;
  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.05);
  --text-hi: #f3eefc;
  --text-mid: #b9aed0;
  --text-low: #8375a0;

  --accent: #d946ef;
  --accent-2: #9333ea;
  --accent-soft: rgba(217, 70, 239, 0.15);

  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.15);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, 0.15);
  --amber: #fbbf24;
  --blue: #60a5fa;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 9px;

  --shadow-lg: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

/* O atributo [hidden] tem a mesma especificidade de uma classe (.btn,
   .dashboard-block etc.), entao qualquer componente que declare seu
   proprio "display" depois dele no cascade silenciosamente o ignora.
   Essa regra garante que [hidden] sempre vence, em qualquer elemento. */
[hidden] { display: none !important; }

/* Icone do cofre (Metas Financeiras) - sempre branco, em qualquer contexto
   de cor que o envolva (nav, cards de stat, cabecalhos de painel). */
.icone-cofre-branco { color: #ffffff !important; }

html {
  overflow-x: hidden;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  max-width: 100%;
  background: var(--bg-0);
  color: var(--text-hi);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { max-width: 100%; }

h1, h2, h3 { font-family: "Sora", "Inter", sans-serif; margin: 0; }

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(650px circle at 12% -5%, rgba(217, 70, 239, 0.22), transparent 60%),
    radial-gradient(550px circle at 90% 10%, rgba(96, 165, 250, 0.14), transparent 60%),
    radial-gradient(700px circle at 50% 110%, rgba(147, 51, 234, 0.18), transparent 60%),
    var(--bg-0);
}

/* ---------- Fundo animado: rede de particulas + linha de tendencia ----------
   Compartilhado entre as telas de login/cadastro e o dashboard. */
.bg-particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.bg-trend-line {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 42%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
}

.bg-trend-dot {
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.9));
}

@media (prefers-reduced-motion: reduce) {
  .bg-trend-dot { display: none; }
}

/* ---------- Menu mobile (hamburguer + drawer) ---------- */
/* So aparece em telas estreitas (ver @media max-width:900px mais abaixo) -
   em telas largas a navegacao fica na sidebar fixa, sem drawer nenhum. */
.mobile-topbar {
  display: none;
}

.btn-mobile-menu {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text-hi);
  cursor: pointer;
  flex-shrink: 0;
}
.btn-mobile-menu svg { width: 19px; height: 19px; }
.btn-mobile-menu:hover { background: var(--panel); }

.mobile-topbar-brand {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-hi);
}

.drawer-backdrop {
  display: none;
}

/* ---------- App shell / Sidebar ---------- */
.app-shell {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 260px;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 26px 20px;
  background: var(--panel);
  border-right: 1px solid var(--border-soft);
  backdrop-filter: blur(6px);
}

.sidebar-brand { margin-bottom: 30px; }

.main-content { flex: 1; min-width: 0; }

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  box-shadow: 0 8px 22px -6px rgba(217, 70, 239, 0.55);
}

.brand-mark svg { display: block; }

@keyframes awfin-sheen {
  0%, 100% { opacity: 0.07; }
  50% { opacity: 0.22; }
}
.brand-mark ellipse { animation: awfin-sheen 3.2s ease-in-out infinite; }

.brand h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.brand p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-low); }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

.badge-live {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-mid);
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.btn-painel-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  color: var(--amber);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-painel-admin:hover { background: rgba(251, 191, 36, 0.18); border-color: rgba(251, 191, 36, 0.5); }
.btn-painel-admin svg { width: 14px; height: 14px; }
.btn-painel-admin[hidden] { display: none; }

.user-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.user-name-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 4px;
  margin: -4px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.user-name-btn:hover { background: var(--panel-2); }
.user-name-btn:hover .user-name { color: var(--accent); }

.user-avatar-mini {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
}
.user-avatar-mini img { width: 100%; height: 100%; object-fit: cover; }

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-mid);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-low);
  cursor: pointer;
}
.btn-logout svg { width: 15px; height: 15px; }
.btn-logout:hover { color: var(--red); border-color: rgba(251, 113, 133, 0.4); background: var(--red-soft); }

/* ---------- Toggle Pessoal / Empresa ---------- */
.espaco-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.espaco-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-low);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.espaco-btn svg { width: 14px; height: 14px; }
.espaco-btn:hover { color: var(--text-hi); }
.espaco-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px -4px rgba(217, 70, 239, 0.6);
}

/* ---------- Tabs (sidebar nav) ---------- */
.tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tabs-grupo {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-low);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: 10px;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  text-align: left;
  width: 100%;
}

.tab-btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.tab-btn:hover { color: var(--text-hi); background: var(--panel-2); }

.tab-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px rgba(217, 70, 239, 0.6);
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- Sub-abas (ex.: Renda Variavel / Renda Fixa dentro de Investimentos) ---------- */
.seg-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.seg-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-low);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.seg-btn svg { width: 15px; height: 15px; }

.seg-btn:hover { color: var(--text-hi); }

.seg-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px rgba(217, 70, 239, 0.6);
}

.subtab-panel { display: none; }
.subtab-panel.is-active { display: block; }

@media (max-width: 900px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    padding: 12px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(6px);
  }

  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(10, 6, 20, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }

  .app-shell { flex-direction: column; padding-top: 62px; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    max-width: 85vw;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 12px 0 32px -12px rgba(0, 0, 0, 0.5);
  }
  .sidebar.is-open { transform: translateX(0); }

  .tab-btn { width: 100%; }

  body.drawer-aberto { overflow: hidden; }
}

.badge-live .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
  animation: awfin-pulso-anel 2s ease-out infinite;
}

@keyframes awfin-pulso-anel {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------- Layout ---------- */
.layout {
  position: relative;
  z-index: 2;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 40px 64px;
}

.content-header { margin-bottom: 24px; }

.content-header h1 {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-hi);
}

.content-header-subtitulo {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-mid);
}
.content-header-subtitulo[hidden] { display: none; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.stat-card {
  position: relative;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.stat-icon {
  position: absolute;
  top: 20px;
  right: 22px;
  width: 20px;
  height: 20px;
  color: var(--text-low);
  opacity: 0.8;
}
.stat-renda .stat-icon { color: var(--blue); }
.stat-despesa .stat-icon { color: var(--red); }
.stat-saldo .stat-icon { color: var(--green); }

.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background: radial-gradient(220px circle at 100% 0%, var(--glow, transparent), transparent 70%);
  pointer-events: none;
  animation: awfin-respirar 4s ease-in-out infinite;
}

@keyframes awfin-respirar {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}

@media (prefers-reduced-motion: reduce) {
  .stat-card::after, .badge-live .dot, .brand-mark ellipse, .dashboard-block::after, .dashboard-block { animation: none; }
}

.stat-renda { --glow: rgba(96, 165, 250, 0.25); }
.stat-despesa { --glow: rgba(251, 113, 133, 0.25); }
.stat-saldo { --glow: rgba(52, 211, 153, 0.25); }

.stat-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-low);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  display: block;
  margin-top: 10px;
  font-family: "Sora", sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stat-trend {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-low);
}

.stat-saldo.negative .stat-value { color: var(--red); }
.stat-saldo:not(.negative) .stat-value { color: var(--green); }

/* ---------- Grid principal ---------- */
.grid-main {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  align-items: start;
}

.col-right { display: flex; flex-direction: column; gap: 20px; }

.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 20px 22px 16px;
}

.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.panel-head h2 svg { width: 17px; height: 17px; color: var(--accent); flex: none; }

.btn {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn svg { width: 14px; height: 14px; }

.btn-add {
  padding: 8px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px rgba(217, 70, 239, 0.6);
}

.btn-add:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -6px rgba(217, 70, 239, 0.75); }

/* Botao de conversao (checkout/assinar): formato pilula + glow pulsando,
   pra chamar atencao na decisao de compra. So a box-shadow anima (nao o
   transform) pra nao brigar com o lift do :hover acima - ver nota historica
   sobre animation "travar" transform contra :hover na cascata do CSS. */
.btn-cta-pulse {
  border-radius: 999px;
  animation: ctaPulseGlow 2.4s ease-in-out infinite;
}
@keyframes ctaPulseGlow {
  0%, 100% { box-shadow: 0 6px 16px -6px rgba(217, 70, 239, 0.55), 0 0 0 0 rgba(217, 70, 239, 0.35); }
  50% { box-shadow: 0 10px 26px -4px rgba(217, 70, 239, 0.8), 0 0 0 7px rgba(217, 70, 239, 0.16); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-cta-pulse { animation: none; }
}

.panel-head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.btn-outline {
  padding: 8px 14px;
  color: var(--text-hi);
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.btn-pill {
  padding: 10px 20px;
  color: var(--text-hi);
  background: linear-gradient(180deg, var(--panel), var(--bg-1));
  border: 1px solid rgba(217, 70, 239, 0.4);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(217, 70, 239, 0.08), 0 4px 14px rgba(107, 33, 168, 0.25);
}
.btn-pill:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(217, 70, 239, 0.18), 0 6px 18px rgba(107, 33, 168, 0.35);
  transform: translateY(-1px);
}
.btn-pill:active { transform: translateY(0); }

.cartoes-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cartoes-toolbar h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
}
.cartoes-toolbar h2 svg { width: 18px; height: 18px; color: var(--accent); }

.panel-cartao { margin-bottom: 20px; }
.panel-cartao:last-child { margin-bottom: 0; }

.cartao-subtotal {
  font-size: 12px;
  color: var(--text-low);
  white-space: nowrap;
}

/* ---------- Fatura do mes ---------- */
.fatura-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  margin: 0 22px 18px;
  border-radius: var(--radius-md);
  background: var(--amber-soft, rgba(251, 191, 36, 0.12));
  border: 1px solid rgba(251, 191, 36, 0.3);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.fatura-banner.paga {
  background: var(--green-soft);
  border-color: rgba(52, 211, 153, 0.3);
}

.fatura-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--amber);
}
.fatura-banner.paga .fatura-label { color: var(--green); }

.fatura-valor {
  font-family: "Sora", sans-serif;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  color: var(--text-hi);
}

.fatura-sub { font-size: 11.5px; color: var(--text-low); margin-top: 2px; }

.fatura-toggle-group { display: flex; align-items: center; gap: 8px; flex: none; }
.fatura-toggle-text { font-size: 11.5px; font-weight: 600; color: var(--text-mid); }

.fatura-atraso {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -6px 22px 18px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.35);
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
}
.fatura-atraso svg { width: 15px; height: 15px; flex: none; }

.quitadas-collapse {
  margin: 4px 22px 20px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.quitadas-collapse summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-low);
  user-select: none;
}
.quitadas-collapse summary::-webkit-details-marker { display: none; }
.quitadas-collapse summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
}
.quitadas-collapse[open] summary::before { transform: rotate(90deg); }
.quitadas-collapse summary:hover { color: var(--text-mid); }
.quitadas-collapse .table-wrap { margin-top: 10px; opacity: 0.85; }

.cartoes-vazio {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-low);
  font-size: 13px;
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.tabela-vazia-cell {
  padding: 30px !important;
  text-align: center;
  color: var(--text-low);
  font-size: 13px;
}

.hint-importar {
  margin: 0 0 18px;
  padding: 0;
  font-size: 12.5px;
  color: var(--text-low);
}

/* ---------- Investimentos ---------- */
.select-detalhe {
  width: 100%;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-1, rgba(255, 255, 255, 0.04));
  color: var(--text-hi);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.select-detalhe:hover { border-color: var(--accent); }
.select-detalhe option { background: var(--panel); color: var(--text-hi); text-transform: none; }

/* Alterna o tipo de grafico (linha/barra) num painel - mesmo par de botoes
   reaproveitavel em qualquer grafico que ofereça as duas visualizações. */
.chart-tipo-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 8px;
  background: var(--bg-1, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
}
.chart-tipo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-low);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.chart-tipo-btn svg { width: 14px; height: 14px; }
.chart-tipo-btn:hover { color: var(--text-hi); }
.chart-tipo-btn.is-active { background: var(--accent); color: #fff; }

.select-rf { min-width: 118px; text-transform: none; font-weight: 600; margin-bottom: 4px; }

.input-data-rf {
  min-width: 128px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-hi);
  font-family: inherit;
  font-size: 11.5px;
  color-scheme: dark;
}
.input-data-rf:hover, .input-data-rf:focus { border-color: var(--accent); outline: none; }

#tbl-renda-fixa td:first-child { min-width: 170px; }

/* ---------- Dashboard ---------- */
/* Flexbox (nao grid) de proposito: cada card pode ficar hidden dependendo
   dos dados do usuario (ver renderDashboardCards), entao a quantidade de
   cards VISIVEIS varia e pode ser impar. Um grid de 2 colunas deixaria uma
   celula vazia (fantasma) ao lado do ultimo card sozinho numa linha; com
   flex-wrap ele so' ocupa a linha inteiro sem sobrar buraco nenhum. */
.dashboard-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}
.dashboard-blocks > * {
  flex: 1 1 calc(50% - 10px);
  min-width: 320px;
}

@keyframes dashboardBlockEntrada {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dashboard-block {
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  animation: dashboardBlockEntrada 0.5s ease both;
}
.dashboard-block[hidden] { display: none; }
.dashboard-block:nth-child(2) { animation-delay: 0.05s; }
.dashboard-block:nth-child(3) { animation-delay: 0.1s; }
.dashboard-block:nth-child(4) { animation-delay: 0.15s; }
.dashboard-block:nth-child(5) { animation-delay: 0.2s; }
.dashboard-block:nth-child(6) { animation-delay: 0.25s; }
.dashboard-block:nth-child(7) { animation-delay: 0.3s; }

.dashboard-block::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  background: radial-gradient(260px circle at 100% 0%, var(--block-glow, transparent), transparent 70%);
  pointer-events: none;
  animation: awfin-respirar 4s ease-in-out infinite;
  transition: opacity 0.3s ease, background 0.4s ease;
}

.dashboard-block .panel-head,
.dashboard-block .block-stats { position: relative; z-index: 1; }

.dashboard-block .panel-head { flex: none; padding-bottom: 10px; }
.dashboard-block .panel-head h2 { font-size: 16px; }
.dashboard-block .panel-head h2 svg {
  width: 19px;
  height: 19px;
  color: var(--block-color, var(--accent));
  transition: filter 0.3s ease;
}

.dashboard-block:hover {
  transform: translateY(-5px);
  border-color: var(--block-color, var(--accent));
  box-shadow: 0 20px 40px -16px var(--block-glow-strong, rgba(217, 70, 239, 0.4)), var(--shadow-lg);
}
.dashboard-block:hover::after {
  opacity: 1;
  animation-play-state: paused;
  background: radial-gradient(360px circle at 100% 0%, var(--block-glow-strong, transparent), transparent 78%);
}
.dashboard-block:hover .panel-head h2 svg {
  filter: drop-shadow(0 0 6px var(--block-color, var(--accent)));
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-block { transition: border-color 0.3s ease, box-shadow 0.3s ease; }
  .dashboard-block:hover { transform: none; }
}

.dashboard-block-blue { --block-glow: rgba(96, 165, 250, 0.22); --block-glow-strong: rgba(96, 165, 250, 0.45); --block-color: var(--blue); }
.dashboard-block-amber { --block-glow: rgba(251, 191, 36, 0.2); --block-glow-strong: rgba(251, 191, 36, 0.42); --block-color: var(--amber); }
.dashboard-block-teal { --block-glow: rgba(217, 70, 239, 0.24); --block-glow-strong: rgba(217, 70, 239, 0.48); --block-color: var(--accent); }
.dashboard-block-green { --block-glow: rgba(52, 211, 153, 0.22); --block-glow-strong: rgba(52, 211, 153, 0.45); --block-color: var(--green); }
.dashboard-block-red { --block-glow: rgba(251, 113, 133, 0.22); --block-glow-strong: rgba(251, 113, 133, 0.45); --block-color: var(--red); }

.block-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 6px 24px 22px;
}

.block-stat {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 3px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}
.block-stat:last-child { border-bottom: none; padding-bottom: 0; }
.block-stat-label { grid-column: 1; grid-row: 1 / span 2; }
.block-stat-value { grid-column: 2; grid-row: 1; justify-self: end; }

.block-stat-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-low);
}
.block-stat-label svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--block-color, var(--accent));
  opacity: 0.85;
}
.block-stat-value {
  font-size: 21px;
  font-weight: 800;
  font-family: "Sora", "Inter", sans-serif;
  color: var(--text-hi);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.block-stat-value.valor-positivo { color: var(--green); }
.block-stat-value.valor-negativo { color: var(--red); }

.block-stat-variacao {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-low);
  white-space: nowrap;
}
.block-stat-variacao svg { width: 11px; height: 11px; flex: none; }
.block-stat-variacao.valor-positivo { color: var(--green); }
.block-stat-variacao.valor-negativo { color: var(--red); }

/* ---------- Insight do Dashboard ---------- */
.dashboard-insight {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 24px 24px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-hi);
}
.dashboard-insight[hidden] { display: none; }

.dashboard-block-subtitulo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 24px 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-low);
}
.dashboard-block-subtitulo svg { width: 13px; height: 13px; color: var(--block-color, var(--red)); }

.chart-area-dashboard-block {
  position: relative;
  height: 150px;
  margin: 0 12px 18px;
}
.dashboard-insight svg { width: 16px; height: 16px; flex: none; }

.dashboard-insight-alerta { border-color: rgba(251, 113, 133, 0.35); background: var(--red-soft); }
.dashboard-insight-alerta svg { color: var(--red); }
.dashboard-insight-atencao { border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.1); }
.dashboard-insight-atencao svg { color: var(--amber); }
.dashboard-insight-positivo { border-color: rgba(52, 211, 153, 0.35); background: var(--green-soft); }
.dashboard-insight-positivo svg { color: var(--green); }
.dashboard-insight-info { border-color: rgba(96, 165, 250, 0.35); background: rgba(96, 165, 250, 0.1); }
.dashboard-insight-info svg { color: var(--blue); }

/* ---------- Card "Gastos Fixos do Mes" (Dashboard) ---------- */
.gastos-fixos-lista {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px 18px;
  max-height: 280px;
  overflow-y: auto;
}

.gastos-fixos-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.gastos-fixos-item:hover { background: var(--panel-2); }

.gastos-fixos-item-icone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--block-color, var(--accent));
}
.gastos-fixos-item-icone svg { width: 16px; height: 16px; }

.gastos-fixos-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.gastos-fixos-item-nome { font-size: 13.5px; font-weight: 600; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gastos-fixos-item-sub { font-size: 11.5px; color: var(--text-low); }

.gastos-fixos-item-valor { font-size: 13.5px; font-weight: 700; color: var(--text-hi); font-variant-numeric: tabular-nums; white-space: nowrap; }

.gastos-fixos-item-vencido .gastos-fixos-item-icone { background: var(--red-soft); color: var(--red); }
.gastos-fixos-item-vencido .gastos-fixos-item-sub { color: var(--red); }

.gastos-fixos-item-breve .gastos-fixos-item-icone { background: rgba(251, 191, 36, 0.14); color: var(--amber); }
.gastos-fixos-item-breve .gastos-fixos-item-sub { color: var(--amber); }

.gastos-fixos-item-pago { opacity: 0.55; }
.gastos-fixos-item-pago .gastos-fixos-item-nome { text-decoration: line-through; text-decoration-color: var(--green); }

.gastos-fixos-vazio {
  margin: 4px 24px 20px;
  font-size: 12.5px;
  color: var(--text-low);
  line-height: 1.5;
}

@media (max-width: 600px) {
  .dashboard-blocks > * { flex-basis: 100%; }
  .block-stat-value { font-size: 18px; }
}

/* ---------- Configuracoes (perfil / assinatura) ---------- */
.config-panel { padding-bottom: 24px; margin-bottom: 20px; }

.config-subseccao { padding-top: 8px; padding-bottom: 14px; }

.config-foto-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px 22px;
}

.config-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 26px;
  font-weight: 700;
  overflow: hidden;
}
.config-avatar img { width: 100%; height: 100%; object-fit: cover; }

.config-foto-acoes { display: flex; gap: 10px; flex-wrap: wrap; }

.config-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 0 22px 4px;
}

.config-field { display: flex; flex-direction: column; gap: 6px; }
.config-field span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-low);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.config-field input,
.config-field textarea {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-hi);
  font: inherit;
  font-size: 13.5px;
  resize: vertical;
}
.config-field input:focus,
.config-field textarea:focus { outline: none; border-color: var(--accent); }
.config-field input:disabled { color: var(--text-low); cursor: not-allowed; opacity: 0.7; }

.config-form-actions {
  display: flex;
  justify-content: flex-end;
  padding: 18px 22px 0;
}

.config-assinatura-atual {
  display: flex;
  gap: 40px;
  padding: 0 22px 18px;
  flex-wrap: wrap;
}

.planos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.assinatura-garantia {
  margin: 18px 2px 0;
  color: var(--text-low);
  font-size: 12.5px;
  line-height: 1.6;
}
.assinatura-garantia svg {
  width: 15px;
  height: 15px;
  color: var(--green);
  vertical-align: -3px;
  margin-right: 6px;
}
.assinatura-garantia a { color: var(--accent); font-weight: 600; text-decoration: none; }
.assinatura-garantia a:hover { text-decoration: underline; }

/* ---------- Compartilhamento de conta ---------- */
.compartilhamento-explicacao {
  margin: 0 22px 18px;
  color: var(--text-low);
  font-size: 13px;
  line-height: 1.6;
}

.compartilhamento-form {
  display: flex;
  gap: 10px;
  margin: 0 22px 20px;
}
.compartilhamento-form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-hi);
  font-size: 13.5px;
}
.compartilhamento-form input:focus { outline: none; border-color: var(--accent); }

.convite-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-soft);
}
.convite-card:last-child { border-bottom: none; }
.convite-card-info { display: flex; flex-direction: column; gap: 2px; }
.convite-card-info strong { font-size: 13.5px; color: var(--text-hi); }
.convite-card-info span { font-size: 12px; color: var(--text-low); }
.convite-card-acoes { display: flex; gap: 8px; }

.paywall-convites {
  max-width: 480px;
  margin: 20px auto 0;
}
.paywall-convites .convite-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.plano-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.plano-card-label { font-size: 13px; font-weight: 700; color: var(--text-low); text-transform: uppercase; letter-spacing: 0.05em; }
.plano-card-valor { font-family: "Sora", "Inter", sans-serif; font-size: 34px; font-weight: 800; color: var(--text-hi); }
.plano-card-valor span { font-size: 13px; font-weight: 600; color: var(--text-low); }
.plano-card-destaque {
  align-self: center;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.plano-card-cpf-input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-hi);
  font: inherit;
  font-size: 13.5px;
  text-align: center;
}
.plano-card-cpf-input:focus { outline: none; border-color: var(--accent); }

.assinatura-empresa-secao { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--border); }
.assinatura-empresa-cabecalho { margin-bottom: 18px; }
.assinatura-empresa-cabecalho h2 { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; }
.assinatura-empresa-cabecalho h2 svg { width: 18px; height: 18px; color: var(--accent); }
.assinatura-empresa-cabecalho p { margin: 6px 0 0; color: var(--text-mid); font-size: 13px; }

.badge-assinatura-ativa, .badge-assinatura-trial { background: var(--green-soft); color: var(--green); }
.badge-assinatura-pendente { background: rgba(251, 191, 36, 0.15); color: var(--amber); }
.badge-assinatura-inadimplente, .badge-assinatura-cancelada { background: var(--red-soft); color: var(--red); }

@media (max-width: 900px) {
  .config-form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .config-form-grid { grid-template-columns: 1fr; }
  .config-foto-row { flex-direction: column; align-items: flex-start; }
}

/* ---------- Metas Financeiras (grid de cards) ---------- */
.metas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.meta-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: linear-gradient(180deg, var(--panel), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.meta-card-head { display: flex; align-items: center; justify-content: space-between; }
.meta-card-head .ativo-logo-placeholder { width: 36px; height: 36px; }
.meta-card-head .ativo-logo-placeholder svg { width: 18px; height: 18px; }

.meta-card-nome {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-hi);
  outline: none;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
}

.meta-card-progress { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }

.meta-card-valores { display: flex; align-items: baseline; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-hi); }
.meta-card-sep { font-size: 11.5px; color: var(--text-low); font-weight: 400; }

.meta-card-banco {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-low);
}
.meta-card-banco select { flex: 1; max-width: 160px; }

.meta-card-data {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-low);
  margin-top: auto;
}
.meta-card-data input { flex: 1; max-width: 140px; }

/* ---------- Assinaturas ---------- */
.cartao-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-mid);
}
.cartao-badge .color-chip { cursor: default; }


.cotacoes-status {
  font-size: 11.5px;
  color: var(--text-low);
  white-space: nowrap;
}

.ativo-cell { display: flex; align-items: center; gap: 10px; }
.ativo-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.06);
  flex: none;
}
.ativo-logo-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(217, 70, 239, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.ativo-ticker { font-weight: 700; color: var(--text-hi); }
.ativo-tipo { font-size: 11px; color: var(--text-low); margin-top: 1px; }
.ativo-nome { font-size: 11px; color: var(--text-low); margin-top: 1px; }

.valor-positivo { color: var(--green); }
.valor-negativo { color: var(--red); }

.valor-atual-cell { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.valor-atual-icone { width: 14px; height: 14px; flex: none; }

.meta-wrap { display: flex; flex-direction: column; gap: 5px; min-width: 130px; }
.meta-label { font-size: 11px; color: var(--text-low); }
.meta-label strong { color: var(--text-mid); font-weight: 600; }

#stat-inv-atual-card.negative .stat-value { color: var(--red); }
#stat-inv-atual-card:not(.negative) #stat-inv-ganho { color: var(--green); }
#stat-inv-atual-card.negative #stat-inv-ganho { color: var(--red); }
#stat-inv-rent-card.negative .stat-value { color: var(--red); }
#stat-inv-rent-card:not(.negative) .stat-value { color: var(--green); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; padding: 0 10px 14px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-low);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-mid);
  vertical-align: middle;
}

.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.col-valor { text-align: right; }
.data-table td.col-valor { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-hi); font-weight: 500; }
.data-table td.col-valor.valor-positivo { color: var(--green); }
.data-table td.col-valor.valor-negativo { color: var(--red); }
.col-pago, .col-actions { text-align: center; width: 56px; }
.col-vencimento { text-align: center; width: 80px; }

.cell-editable {
  outline: none;
  border-radius: 6px;
  padding: 3px 6px;
  margin: -3px -6px;
}
.cell-editable:hover { background: rgba(255, 255, 255, 0.04); }
.cell-editable:focus { background: rgba(217, 70, 239, 0.12); box-shadow: 0 0 0 1px var(--accent); }

.item-cell { display: flex; align-items: center; gap: 10px; color: var(--text-hi); font-weight: 500; }

.row-icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--text-low);
  transition: color 0.15s ease;
}
.data-table tbody tr:hover .row-icon { color: var(--accent); }

.color-chip {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.row-paid { opacity: 0.55; }
.row-paid .item-cell { text-decoration: line-through; text-decoration-color: var(--green); }

/* Toggle "pago" */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  transition: 0.2s;
}
.slider::before {
  content: "";
  position: absolute;
  height: 14px; width: 14px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(16px); }

.row-total td {
  padding-top: 14px;
  font-weight: 700;
  color: var(--text-hi);
  border-top: 1px solid var(--border);
  border-bottom: none;
}
.row-total td:first-child { text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.05em; color: var(--text-low); }
.row-total td:nth-child(2) { text-align: right; font-size: 16px; color: var(--accent); }

.btn-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-low);
  cursor: pointer;
  line-height: 1;
  padding: 5px;
  border-radius: 6px;
}
.btn-del svg { width: 14px; height: 14px; }
.btn-del:hover { color: var(--red); background: var(--red-soft); }

.panel-full { margin-top: 20px; }

/* ---------- Progresso (parcelas) ---------- */
.col-progresso { width: 160px; }

.progress-wrap { display: flex; flex-direction: column; gap: 5px; min-width: 130px; }

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.3s ease;
}

.progress-fill.is-complete { background: linear-gradient(90deg, #22a374, var(--green)); }
.progress-fill.is-recorrente { background: linear-gradient(90deg, #2f7fd6, var(--blue)); }
.progress-fill.is-atencao { background: linear-gradient(90deg, #c9930f, var(--amber)); }
.progress-fill.is-estourou { background: linear-gradient(90deg, #d94f5c, var(--red)); }

.progress-label {
  font-size: 11.5px;
  color: var(--text-low);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge svg { width: 11px; height: 11px; }

.badge-quitado { background: var(--green-soft); color: var(--green); }
.badge-andamento { background: rgba(217, 70, 239, 0.15); color: var(--accent); }
.badge-recorrente { background: rgba(96, 165, 250, 0.15); color: var(--blue); }

.badge-origem-renda { background: var(--green-soft); color: var(--green); }
.badge-origem-despesa { background: var(--red-soft); color: var(--red); }
.badge-origem-cartao { background: rgba(96, 165, 250, 0.15); color: var(--blue); }
.badge-origem-renda_fixa { background: rgba(217, 70, 239, 0.15); color: var(--accent); }
.badge-origem-importado { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }

.extrato-vazio {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-low);
  font-size: 13px;
  line-height: 1.6;
}

.empresa-em-construcao {
  max-width: 460px;
  margin: 60px auto 0;
  padding: 40px 32px;
  text-align: center;
  background: linear-gradient(180deg, var(--panel), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.empresa-em-construcao-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}
.empresa-em-construcao-icone svg { width: 26px; height: 26px; }
.empresa-em-construcao h2 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.empresa-em-construcao p { color: var(--text-mid); font-size: 13.5px; line-height: 1.6; margin: 0; }

.empresa-paywall {
  max-width: 480px;
  margin: 60px auto 0;
  padding: 44px 36px;
  text-align: center;
  background: linear-gradient(180deg, var(--panel), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.empresa-paywall-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}
.empresa-paywall-icone svg { width: 26px; height: 26px; }
.empresa-paywall h2 { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.empresa-paywall p { color: var(--text-mid); font-size: 13.5px; line-height: 1.65; margin: 0 0 24px; }

/* ---------------------------------------------------------------- SARAH - */
.sarah-chat-wrap {
  display: flex;
  flex-direction: column;
  max-width: 780px;
  margin: 0 auto;
  height: calc(100vh - 160px);
  min-height: 520px;
}

.sarah-chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 16px;
}
.sarah-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.sarah-avatar svg { width: 22px; height: 22px; }
.sarah-chat-header h2 { font-size: 18px; font-weight: 700; }
.sarah-chat-header p { margin: 2px 0 0; color: var(--text-mid); font-size: 13px; }

.sarah-mensagens {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 4px 12px;
}

/* Mensagens do bot ficam alinhadas a esquerda com o avatar antes do texto;
   as do usuario ficam a direita com o mesmo HTML (avatar + bolha), so
   invertendo a ordem visual via flex-direction: row-reverse - evita
   duplicar o markup para os dois lados da conversa. */
.sarah-mensagem { display: flex; gap: 10px; max-width: 88%; }
.sarah-mensagem-bot { align-self: flex-start; }
.sarah-mensagem-user { align-self: flex-end; flex-direction: row-reverse; }

.sarah-mensagem-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.sarah-mensagem-avatar svg { width: 15px; height: 15px; }

.sarah-mensagem-bolha {
  padding: 11px 15px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.sarah-mensagem-bot .sarah-mensagem-bolha {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  color: var(--text-hi);
  border-top-left-radius: 4px;
}
.sarah-mensagem-user .sarah-mensagem-bolha {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06251f;
  font-weight: 500;
  border-top-right-radius: 4px;
}

.sarah-mensagem-acoes { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sarah-mensagem-acao {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 5px 11px;
  width: fit-content;
}
.sarah-mensagem-acao svg { width: 12px; height: 12px; flex: none; }

.sarah-mensagem-digitando .sarah-mensagem-bolha { display: flex; align-items: center; gap: 4px; padding: 14px 16px; }
/* Os 3 pontinhos usam a MESMA animacao, so' com animation-delay escalonado
   (0, 0.15s, 0.3s) - e' isso que cria o efeito de "onda" em vez de todos
   pulsarem juntos. */
.sarah-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-low);
  animation: sarahDigitando 1.2s ease-in-out infinite;
}
.sarah-dot:nth-child(2) { animation-delay: 0.15s; }
.sarah-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes sarahDigitando {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .sarah-dot { animation: none; }
}

.sarah-sugestoes { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
.sarah-sugestao-chip {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-mid);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.sarah-sugestao-chip:hover { border-color: var(--accent); color: var(--accent); }

.sarah-form { display: flex; gap: 10px; padding-top: 10px; }
.sarah-form input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-hi);
  font-size: 14px;
  font-family: inherit;
}
.sarah-form input::placeholder { color: var(--text-low); }
.sarah-form input:focus { outline: none; border-color: var(--accent); }
.sarah-form button {
  flex: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
}
.sarah-form button svg { width: 17px; height: 17px; }

@media (max-width: 600px) {
  .sarah-chat-wrap { height: calc(100vh - 220px); }
  .sarah-mensagem { max-width: 96%; }
}

.cartoes-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.cartao-chip-empresa {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.cartao-chip-empresa .color-chip { width: 12px; height: 12px; border-radius: 50%; flex: none; cursor: pointer; }
.cartao-chip-empresa .cell-editable { font-size: 12.5px; font-weight: 600; outline: none; }
.cartao-chip-empresa .btn-del {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-low);
  cursor: pointer;
  border-radius: 50%;
}
.cartao-chip-empresa .btn-del:hover { color: var(--red); background: var(--red-soft); }
.cartao-chip-empresa .btn-del svg { width: 12px; height: 12px; }

.fluxo-caixa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.fluxo-card {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.fluxo-card-titulo {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-low);
  margin-bottom: 10px;
}
.fluxo-card-saldo { font-family: "Sora", sans-serif; font-size: 26px; font-weight: 700; margin-bottom: 14px; }
.fluxo-card-linha {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-mid);
  padding: 6px 0;
  border-top: 1px solid var(--border-soft);
}
.fluxo-card-linha:first-of-type { border-top: none; }

.fluxo-caixa-nota {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-low);
  font-size: 12.5px;
  line-height: 1.6;
}
.fluxo-caixa-nota svg { width: 15px; height: 15px; color: var(--accent); flex: none; margin-top: 2px; }

.dre-breakdown { padding: 22px 24px; }
.dre-linha {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
  color: var(--text-mid);
}
.dre-linha span:last-child { font-weight: 600; color: var(--text-hi); }
.dre-linha-total { border-bottom: 1px solid var(--border); font-weight: 600; }
.dre-linha-total span:first-child { color: var(--text-hi); }
.dre-linha-resultado { border-bottom: none; padding-top: 16px; font-size: 15px; }
.dre-linha-resultado span:first-child { color: var(--text-hi); font-weight: 700; }

.conciliacao-form-panel { padding: 24px; margin-bottom: 18px; }
.conciliacao-explicacao { margin: 0 0 18px; color: var(--text-mid); font-size: 13px; line-height: 1.6; max-width: 62ch; }
.conciliacao-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.conciliacao-form .auth-field { flex: 1; min-width: 220px; gap: 6px; }
.conciliacao-form .auth-field input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 13px;
  color: var(--text-hi);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}
.conciliacao-form .auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.conciliacao-form .btn { height: 40px; }

.conciliacao-resultado {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.6;
}
.conciliacao-resultado.bateu { background: var(--green-soft); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.25); }
.conciliacao-resultado.nao-bateu { background: var(--red-soft); color: var(--red); border: 1px solid rgba(251, 113, 133, 0.25); }

/* ---------- Toggle recorrente ---------- */
.btn-recorrente {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-low);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-recorrente svg { width: 12px; height: 12px; }

.btn-recorrente:hover { background: rgba(96, 165, 250, 0.18); color: var(--blue); }
.btn-recorrente.is-on { background: rgba(96, 165, 250, 0.18); color: var(--blue); }
.btn-recorrente.is-on:hover { background: rgba(251, 113, 133, 0.18); color: var(--red); }

/* ---------- Grafico ---------- */
@keyframes panelChartEntrada {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-chart {
  background:
    radial-gradient(circle at 22% 15%, rgba(96, 165, 250, 0.1), transparent 50%),
    radial-gradient(circle at 78% 15%, rgba(251, 113, 133, 0.1), transparent 50%),
    linear-gradient(180deg, var(--panel), var(--bg-1));
  animation: panelChartEntrada 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .panel-chart { animation: none; }
}
.panel-chart .chart-area {
  height: 260px;
  padding: 4px 22px 22px;
  position: relative;
}

.panel-evolucao .btn-recorrente { width: 28px; height: 28px; }
.panel-evolucao .btn-recorrente svg { width: 14px; height: 14px; }

/* Luminosidade pulsante em todos os graficos (Comparativo, Raio-X, Evolucao, Cotacao do Dia) */
@keyframes awfin-luminosidade {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(217, 70, 239, 0.16)); }
  50% { filter: drop-shadow(0 0 20px rgba(217, 70, 239, 0.45)); }
}

.chart-area canvas {
  animation: awfin-luminosidade 3.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .chart-area canvas { animation: none; }
}

.chart-area-gauges {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
}

.gauge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.gauge-ring-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  filter: drop-shadow(0 0 14px rgba(217, 70, 239, 0.18));
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 10px;
}

.gauge-valor {
  font-family: "Sora", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-hi);
  line-height: 1.2;
}

.gauge-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-low);
}

@media (max-width: 480px) {
  .chart-area-gauges { flex-wrap: wrap; }
  .gauge-ring-wrap { width: 120px; height: 120px; }
}

/* Versao compacta do anel de progresso, usada nos cards de Metas
   Financeiras (aba e mini-widget do Dashboard) - cards mais estreitos que
   o painel de gauges do Orcamento, onde .gauge-ring-wrap tem 148px. */
.meta-gauge-wrap {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 0 10px rgba(217, 70, 239, 0.14));
}
.meta-gauge-wrap .gauge-valor { font-size: 13px; }

/* ---------- Mini-widget de Metas no Dashboard ---------- */
.dashboard-metas-mini { padding: 0 24px 22px; }

.dashboard-metas-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.dashboard-metas-mini-head .dashboard-block-subtitulo { margin: 0; }

.dashboard-metas-paginacao {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-low);
  font-variant-numeric: tabular-nums;
}

.dashboard-metas-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text-low);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.dashboard-metas-nav:hover:not(:disabled) { color: var(--text-hi); background: var(--border-soft); }
.dashboard-metas-nav:disabled { opacity: 0.35; cursor: default; }
.dashboard-metas-nav svg { width: 13px; height: 13px; }

.dashboard-metas-lista { display: flex; gap: 16px; }

.dashboard-meta-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.dashboard-meta-item-nome {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-hi);
  max-width: 100%;
}
.dashboard-meta-item-nome .color-chip { flex: none; }

.dashboard-meta-item-valor { font-size: 11px; color: var(--text-low); }

.dashboard-meta-item-banco {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--text-low);
}
.dashboard-meta-item-banco svg { width: 11px; height: 11px; }

.grid-graficos-investimentos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 20px;
  margin-bottom: 20px;
}

.panel-radar {
  position: relative;
  margin-bottom: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(217, 70, 239, 0.12), transparent 62%),
    var(--panel);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}
/* Mesmo hover (elevar + brilho na borda) E o mesmo brilho pulsante de
   canto (::after + awfin-respirar) dos .dashboard-block, pra nao destoar
   quando um panel-radar (Alocacao do Patrimonio, Evolucao Financeira)
   fica lado a lado com eles no Dashboard. */
.panel-radar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  background: radial-gradient(260px circle at 100% 0%, rgba(217, 70, 239, 0.22), transparent 70%);
  pointer-events: none;
  animation: awfin-respirar 4s ease-in-out infinite;
  transition: opacity 0.3s ease, background 0.4s ease;
}
.panel-radar .panel-head, .panel-radar .chart-area-radar { position: relative; z-index: 1; }
.panel-radar:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px -16px rgba(217, 70, 239, 0.4), var(--shadow-lg);
}
.panel-radar:hover::after {
  opacity: 1;
  animation-play-state: paused;
  background: radial-gradient(360px circle at 100% 0%, rgba(217, 70, 239, 0.45), transparent 78%);
}
@media (prefers-reduced-motion: reduce) {
  .panel-radar { transition: border-color 0.3s ease, box-shadow 0.3s ease; }
  .panel-radar:hover { transform: none; }
  .panel-radar::after { animation: none; }
}
.chart-area-radar {
  height: 380px;
  padding: 4px 22px 22px;
  position: relative;
}

.dre-simples-panel .stats-row { margin: 0 22px 4px; }
.chart-area-dre-simples {
  height: 220px;
  padding: 12px 22px 22px;
  position: relative;
}

.select-periodo { width: auto; min-width: 110px; }

.chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: var(--text-low);
  background: rgba(11, 18, 32, 0.35);
  border-radius: var(--radius-md);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.chart-loading.is-visible { opacity: 1; }

/* ---------- Modal de importacao ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 4, 14, 0.72);
  backdrop-filter: blur(3px);
}
.modal-overlay[hidden] { display: none; }

.modal-box {
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--panel), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-box-compacto { max-width: 460px; }

.ler-boleto-modo {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 0;
}
.ler-boleto-modo input[type="file"] {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: var(--bg-1);
  color: var(--text-hi);
  font-size: 13px;
}

.ler-boleto-resultado { padding: 4px 0 14px; }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.modal-head h2 svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.modal-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-low); }

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-low);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 8px;
}
.btn-close:hover { color: var(--text-hi); background: rgba(255, 255, 255, 0.06); }

.modal-body { overflow-y: auto; padding: 6px 22px; }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--border-soft);
}

.col-check { width: 34px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.status-pill.novo { background: var(--green-soft); color: var(--green); }
.status-pill.atualizar { background: rgba(96, 165, 250, 0.15); color: var(--blue); }
.status-pill.ja_existe { background: rgba(255, 255, 255, 0.08); color: var(--text-low); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 11px 20px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-hi);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsivo ---------- */

/* Tablets e desktops estreitos: 2a coluna sobe pra baixo, stats se reorganizam sozinhos */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .grid-graficos-investimentos { grid-template-columns: minmax(0, 1fr); }
  .stats-row { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .topbar, .layout { padding-left: 20px; padding-right: 20px; }
}

/* Tablets em pe / celulares grandes */
@media (max-width: 768px) {
  .layout { padding: 24px 16px 48px; }
  .topbar { padding: 16px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-mark svg { width: 38px; height: 38px; }
  .brand h1 { font-size: 17px; }

  .panel-head { padding: 16px 16px 12px; }
  .panel-head-actions { width: 100%; }
  .table-wrap { padding: 0 8px 12px; }

  .modal-overlay { padding: 12px; }
  .modal-box { max-height: 90vh; }
  .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .modal-body { padding: 6px 16px; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
}

/* Celulares */
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; }
  .stat-card { padding: 18px 20px; }
  .stat-value { font-size: 25px; }

  .user-name { max-width: 84px; }
  .badge-live { padding: 7px; }
  .badge-live-text { display: none; }

  .panel-head h2 { font-size: 14.5px; }
  .cartoes-toolbar h2 { font-size: 15px; }

  .btn { font-size: 12px; padding: 8px 12px; }
  .btn-outline { padding: 8px 12px; }

  .data-table { font-size: 12.5px; }
  .data-table thead th { padding: 8px 10px; font-size: 10.5px; }
  .data-table td { padding: 8px 10px; }

  .btn-del { padding: 7px; }
  .color-chip { width: 12px; height: 12px; }
  .switch { width: 38px; height: 22px; }
  .slider::before { height: 16px; width: 16px; }
  .switch input:checked + .slider::before { transform: translateX(16px); }
}

/* Celulares pequenos */
@media (max-width: 420px) {
  .layout { padding: 18px 12px 36px; }
  .topbar { padding: 12px; gap: 10px; }
  .brand { gap: 10px; }
  .brand p { font-size: 11px; }
  .stat-value { font-size: 22px; }
  .stat-card { padding: 16px; }
  .panel-head { padding: 14px 14px 10px; }
  .cartoes-toolbar { margin-bottom: 12px; }
}

/* Scrollbar */
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
