/* ============================================================
   VITALEX — Clean Edition
   Menos ruído. Mais respiro. Toda informação.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  --brand:      #3b82f6;
  --brand-dim:  rgba(59,130,246,0.1);
  --accent:     #06b6d4;
  --green:      #10b981;
  --green-dim:  rgba(16,185,129,0.1);
  --red:        #ef4444;
  --red-dim:    rgba(239,68,68,0.1);
  --gold:       #f59e0b;

  /* Dark surface stack */
  --bg:         #0d1117;
  --surface:    #131924;
  --card:       #161d2c;
  --card2:      #1a2235;
  --hover:      #1e2840;
  --line:       rgba(255,255,255,0.06);
  --line-med:   rgba(255,255,255,0.10);

  /* Text */
  --t1:  #e8edf8;
  --t2:  rgba(232,237,248,0.52);
  --t3:  rgba(232,237,248,0.28);

  /* Nav */
  --nav-h: 54px;
  --nav-bg: rgba(13,17,23,0.9);

  /* Space */
  --r:  10px;
  --rl: 14px;

  /* Shadow — single, soft */
  --sh: 0 2px 12px rgba(0,0,0,0.28);

  --font: 'Outfit', sans-serif;
  --mono: 'DM Mono', monospace;
  --ease: all 0.2s ease;
}

[data-theme="light"] {
  --bg:       #f4f6fb;
  --surface:  #ffffff;
  --card:     #ffffff;
  --card2:    #f8f9fd;
  --hover:    #eef1f9;
  --line:     rgba(0,0,0,0.06);
  --line-med: rgba(0,0,0,0.10);

  --t1:  #0f172a;
  --t2:  #52627a;
  --t3:  #94a3b8;

  --nav-bg: rgba(255,255,255,0.92);
  --sh:     0 2px 12px rgba(0,0,0,0.07);
}

/* ── Reset ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--t1);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background .25s, color .25s;
}

/* ═══════════════════════════
   TOPBAR
═══════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: 24px;
  text-decoration: none;
}

.fm-logo { width: 34px; height: 34px; flex-shrink: 0; }

.topbar-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  border: none;
  background: none;
  white-space: nowrap;
  transition: var(--ease);
  font-family: var(--font);
  position: relative;
}

.nav-item .nav-icon { font-size: 13px; }

.nav-item:hover { background: var(--hover); color: var(--t1); }

.nav-item.active {
  background: var(--brand-dim);
  color: var(--brand);
  font-weight: 600;
}

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

.theme-toggle {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-med);
  background: transparent;
  color: var(--t2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: var(--ease);
  font-family: var(--font);
}
.theme-toggle:hover { background: var(--hover); color: var(--t1); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line-med);
  background: var(--card);
  cursor: pointer;
  transition: var(--ease);
}
.user-chip:hover { border-color: var(--brand); }

.user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand-dim);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-chip-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--t1);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  padding: 6px 13px;
  border-radius: var(--r);
  border: 1px solid var(--line-med);
  background: transparent;
  color: var(--t2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--ease);
}
.btn-logout:hover { background: var(--red-dim); border-color: var(--red); color: var(--red); }

/* ═══════════════════════════
   LAYOUT
═══════════════════════════ */
.app-wrapper {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

.announce-bar {
  background: var(--brand-dim);
  border-bottom: 1px solid var(--line);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--t2);
}

.announce-badge {
  background: var(--brand);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.announce-bar a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  margin-left: auto;
  font-size: 12px;
}

.layout-shell {
  display: grid;
  grid-template-columns: 1fr 256px;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.main-col { min-width: 0; }

/* ═══════════════════════════
   SECTIONS
═══════════════════════════ */
.section { display: none; }
.section.active { display: block; }

.section-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-header { margin-bottom: 20px; }

.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--t1);
  line-height: 1.15;
}

.page-header p {
  font-size: 13px;
  color: var(--t2);
  margin-top: 4px;
}

/* ═══════════════════════════
   BUTTONS
═══════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: var(--r);
  border: none;
  background: var(--brand);
  color: white;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--ease);
  white-space: nowrap;
}
.btn:hover { opacity: .88; }

.btn-ghost {
  background: var(--card2);
  color: var(--t2);
  border: 1px solid var(--line-med);
}
.btn-ghost:hover { background: var(--hover); color: var(--t1); opacity: 1; }

.btn-sm { padding: 5px 11px; font-size: 12px; }

.btn-save {
  flex: 1;
  background: var(--gold);
  color: #0f172a;
  font-weight: 700;
  justify-content: center;
}
.btn-save:hover { opacity: .9; }

.btn-cancel {
  flex: 1;
  background: var(--card2);
  color: var(--t2);
  border: 1px solid var(--line-med);
  justify-content: center;
}
.btn-cancel:hover { background: var(--hover); color: var(--t1); opacity: 1; }

.btn-delete { background: var(--red); font-size: 12px; padding: 6px 11px; margin-top: 8px; }

.btn-secondary-clean {
  background: var(--brand-dim);
  color: var(--brand);
  border: 1px solid rgba(59,130,246,0.2);
}
.btn-secondary-clean:hover { opacity: .85; }

.btn-upload {
  background: var(--card2);
  color: var(--t2);
  border: 1px solid var(--line-med);
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--ease);
}
.btn-upload:hover { background: var(--hover); color: var(--t1); }

/* ═══════════════════════════
   CARD BASE
═══════════════════════════ */
.card-surface {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--rl);
  box-shadow: var(--sh);
}

/* ── Frase banner ── */
.frase-banner {
  background: var(--card);
  border: 1px solid var(--line-med);
  border-left: 3px solid var(--brand);
  color: var(--t1);
  padding: 20px 24px;
  border-radius: var(--rl);
  margin-bottom: 20px;
}

[data-theme="light"] .frase-banner { background: var(--brand-dim); border-color: var(--brand); }

.frase-grande {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  margin: 0;
  color: var(--t1);
}

/* ── Stats / metrics ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}

.stat-card {
  background: var(--card);
  padding: 18px 20px;
  border-radius: var(--rl);
  border: 1px solid var(--line);
  transition: var(--ease);
}
.stat-card:hover { border-color: var(--line-med); background: var(--card2); }

.stat-card h3 {
  font-size: 10px;
  color: var(--t3);
  margin-bottom: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.stat-card .value {
  font-size: 22px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.3px;
}

.stat-card p {
  font-size: 11px;
  color: var(--t2);
  margin: 5px 0 0;
}

/* Níveis containers */
#nivelAtualContainer, #nivelDetalhesContainer,
#nivelGraficoContainer, #nivelProgressaoContainer { margin-top: 20px; }

/* Panel reference */
.panel-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.panel-inline-card {
  background: var(--card);
  border-radius: var(--rl);
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
}

.section-title-card {
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--line-med);
  border-left: 3px solid var(--brand);
  border-radius: var(--rl);
  color: var(--t1);
}

/* ═══════════════════════════
   AD SIDEBAR
═══════════════════════════ */
.ad-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  height: fit-content;
  max-height: calc(100vh - var(--nav-h) - 48px);
  overflow-y: auto;
  scrollbar-width: none;
}
.ad-col::-webkit-scrollbar { display: none; }

.ad-slot {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--rl);
  overflow: hidden;
}

.ad-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--t3);
  padding: 8px 14px 4px;
  border-bottom: 1px solid var(--line);
}

.ad-slot-inner { padding: 12px 14px 16px; }
.ad-slot-logo { font-size: 18px; margin-bottom: 6px; }
.ad-slot-title { font-size: 13px; font-weight: 700; color: var(--t1); margin-bottom: 4px; }
.ad-slot-desc { font-size: 11.5px; color: var(--t2); line-height: 1.5; margin-bottom: 10px; }

.ad-slot-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--r);
  background: var(--brand);
  color: white;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: var(--ease);
}
.ad-slot-btn:hover { opacity: .85; }

.ad-placeholder {
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1.5px dashed var(--line-med);
  border-radius: var(--rl);
  padding: 20px;
  color: var(--t3);
  font-size: 11.5px;
  text-align: center;
  cursor: pointer;
  transition: var(--ease);
}
.ad-placeholder:hover { border-color: var(--brand); color: var(--brand); }
.ad-placeholder span { font-size: 20px; }
.ad-placeholder strong { color: var(--t2); font-size: 12px; }

.sidebar-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--rl);
  overflow: hidden;
}

.sidebar-panel-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--t3);
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--line);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 12.5px;
  color: var(--t2);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: var(--ease);
}
.sidebar-link:last-child { border-bottom: none; }
.sidebar-link:hover { background: var(--hover); color: var(--t1); }
.sidebar-link .sl-icon { font-size: 13px; width: 18px; text-align: center; }
.sidebar-link .sl-arrow { margin-left: auto; font-size: 11px; color: var(--t3); }

/* ═══════════════════════════
   PATRIMÔNIO
═══════════════════════════ */
.patrimonio-graficos-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

#patrimonioPorAnoContainer,
#patrimonioCrescimentoContainer {
  min-height: 320px;
  background: var(--card);
  border-radius: var(--rl);
  border: 1px solid var(--line);
  padding: 18px;
}

.patrimonio-growth-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

.growth-pill {
  background: var(--card);
  border-radius: var(--r);
  padding: 14px 16px;
  border: 1px solid var(--line);
}
.growth-pill .year { font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; margin-bottom: 4px; }
.growth-pill .percent { font-size: 22px; font-weight: 800; color: var(--brand); margin-bottom: 3px; }
.growth-pill .note { font-size: 11px; color: var(--t2); line-height: 1.4; }

.patrimonio-help-text { display: block; color: var(--t2); font-size: 11.5px; margin-top: 5px; line-height: 1.45; }
.patrimonio-icon { font-size: 22px; margin-right: 6px; }

/* ═══════════════════════════
   FINANCEIRO
═══════════════════════════ */
.finance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.finance-card {
  background: var(--card);
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  transition: var(--ease);
}
.finance-card:hover { background: var(--card2); }
.finance-card h4 { font-size: 10px; color: var(--t3); margin-bottom: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.finance-card .amount { font-size: 17px; font-weight: 800; color: var(--t1); }

.finance-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; }
.finance-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.finance-monthly-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 14px; margin: 14px 0; }

.finance-panel-card {
  background: var(--card);
  padding: 16px 18px;
  border-radius: var(--rl);
  border: 1px solid var(--line);
}
.finance-panel-card h4 { color: var(--brand); margin-bottom: 10px; font-size: 13px; font-weight: 700; }

.finance-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.finance-table th, .finance-table td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; }
.finance-table th { background: var(--card2); color: var(--t2); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }

.finance-positive { color: var(--green); font-weight: 700; }
.finance-negative { color: var(--red); font-weight: 700; }
.finance-neutral { color: var(--brand); font-weight: 700; }

.finance-tip-list { display: grid; gap: 8px; }
.finance-tip { padding: 10px 13px; border-radius: var(--r); background: var(--card2); border-left: 2px solid var(--brand); font-size: 12px; line-height: 1.5; color: var(--t2); }

.finance-item-card { background: var(--card); border-radius: var(--r); padding: 14px; border: 1px solid var(--line); }
.finance-item-card.receita { border-left: 2px solid var(--green); }
.finance-item-card.despesa { border-left: 2px solid var(--red); }
.finance-item-card.investimento { border-left: 2px solid var(--brand); }
.finance-item-card h4 { margin: 0 0 8px; color: var(--t1); font-size: 13px; font-weight: 700; }
.finance-item-meta { color: var(--t2); font-size: 11.5px; margin: 3px 0; }
.finance-item-value { font-size: 20px; font-weight: 800; margin: 8px 0; color: var(--t1); }

.finance-tag { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--brand-dim); color: var(--brand); margin-bottom: 6px; }

.finance-list-table-card {
  background: var(--card);
  border-radius: var(--rl);
  padding: 16px 18px;
  margin-top: 14px;
  border: 1px solid var(--line);
}
.finance-list-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.finance-table-scroll { width: 100%; overflow-x: auto; }

.finance-records-table { width: 100%; border-collapse: collapse; min-width: 900px; font-size: 12.5px; }
.finance-records-table th, .finance-records-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.finance-records-table thead th { background: var(--card2); color: var(--t2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.finance-records-table tbody tr:hover { background: var(--hover); }
.finance-records-table .text-right { text-align: right; }
.finance-records-table .text-center { text-align: center; }

.finance-desc-cell { display: inline-block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

.finance-row-tag { display: inline-flex; align-items: center; justify-content: center; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.finance-row-tag.receita { background: var(--green-dim); color: var(--green); }
.finance-row-tag.despesa { background: var(--red-dim); color: var(--red); }
.finance-row-tag.investimento { background: var(--brand-dim); color: var(--brand); }

.finance-actions-inline { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.finance-inline-btn { margin: 0; padding: 5px 9px; font-size: 11px; }

.finance-chart-card {
  background: var(--card);
  border-radius: var(--rl);
  padding: 18px 20px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}
.finance-chart-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.finance-chart-header p { max-width: 760px; color: var(--t2); font-size: 12px; }
.finance-chart-wrap { position: relative; height: 280px; }
.finance-annual-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 12px; }

.finance-insight-card { background: var(--card2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.finance-insight-card h5 { margin: 0 0 5px; color: var(--brand); font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; }
.finance-insight-card .insight-main { font-size: 13px; font-weight: 700; color: var(--t1); line-height: 1.4; }
.finance-insight-card .insight-sub { display: block; margin-top: 3px; color: var(--t2); font-size: 11px; }

/* ═══════════════════════════
   LIVROS
═══════════════════════════ */
#chartsLivros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.chart-container {
  background: var(--card);
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  max-width: 600px;
}

.livros-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  margin: 12px 0;
  table-layout: fixed;
}
.livros-table th, .livros-table td { padding: 10px 12px; text-align: center; border: 1px solid var(--line); word-break: break-word; font-size: 12px; color: var(--t1); }
.livros-table th { background: var(--card2); color: var(--t2); font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.livros-table .media-geral { background: var(--green-dim); font-weight: 700; border-top: 1px solid rgba(16,185,129,0.3); color: var(--green); }

#livrosResumoAnual, #livrosTableContainer,
#nivelAtualContainer, #nivelProgressaoContainer,
#nivelDetalhesContainer, #nivelGraficoContainer { width: 100%; overflow-x: hidden; }

/* ═══════════════════════════
   PESO
═══════════════════════════ */
.peso-layout { display: grid; gap: 12px; align-content: start; }

.peso-resumo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.peso-card {
  background: var(--card);
  border-radius: var(--rl);
  padding: 16px 18px;
  border: 1px solid var(--line);
  transition: var(--ease);
}
.peso-card:hover { background: var(--card2); }
.peso-card h3 { font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; font-weight: 700; }
.peso-card .value { font-size: 22px; font-weight: 800; color: var(--accent); }
.peso-card .helper { margin-top: 5px; color: var(--t2); font-size: 11px; line-height: 1.4; }

#pesoGraficoContainer, #pesoTabelaContainer, #pesoTotaisContainer {
  background: var(--card);
  border-radius: var(--rl);
  padding: 18px;
  border: 1px solid var(--line);
}

.peso-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.peso-toolbar-controls { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.peso-select-year { min-width: 170px; display: flex; flex-direction: column; gap: 4px; }
.peso-select-year label { font-size: 10px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: 0.5px; }
.peso-select-year select { width: 100%; min-height: 38px; border: 1px solid var(--line-med); border-radius: var(--r); padding: 7px 11px; background: var(--bg); color: var(--t1); font-family: var(--font); font-size: 13px; }

.peso-table-wrapper { overflow-x: auto; }
.peso-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.peso-table th, .peso-table td { padding: 10px 12px; text-align: center; border: 1px solid var(--line); font-size: 12px; color: var(--t1); }
.peso-table th { background: var(--card2); color: var(--t2); font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.peso-table .col-obs { text-align: left; }
.peso-empty { text-align: center; color: var(--t3); padding: 36px; font-size: 13px; }

#chartPeso { min-height: 280px; margin-top: 12px; overflow: hidden; }
#chartPeso canvas { width: 100% !important; height: 280px !important; }

/* ═══════════════════════════
   ESTUDOS
═══════════════════════════ */
.tempo-layout { display: grid; gap: 12px; align-content: start; }

#tempoControleContainer {
  background: var(--card);
  border-radius: var(--rl);
  padding: 18px;
  border: 1px solid var(--line);
}

.tempo-header-grid {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.tempo-selector-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: var(--rl);
  padding: 16px;
}

.tempo-display-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 170px;
  border-radius: var(--rl);
  background: var(--card2);
  border: 1px solid var(--line-med);
  border-left: 3px solid var(--brand);
  padding: 20px 22px;
}

.tempo-display-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--t3); font-weight: 700; }

.tempoatividades-display {
  font-family: var(--mono);
  font-size: 48px;
  font-weight: 500;
  color: var(--t1);
  margin: 10px 0 6px;
  letter-spacing: 2px;
}

.tempo-helper-text { font-size: 12px; color: var(--t2); line-height: 1.5; }
.tempo-selector-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tempo-subtitle { font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; margin-bottom: 8px; }

#botoesTempoAtividades { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0 0 !important; }
#tempoatividades .btn { margin-right: 0; }
#tempoatividades .filter-group { margin-top: 0; margin-bottom: 0; }

#tempoFiltrosContainer {
  background: var(--card);
  border-radius: var(--rl);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  overflow: hidden;
}
#tempoFiltrosContainer > div { padding: 14px 16px; border-right: 1px solid var(--line); }
#tempoFiltrosContainer > div:last-child { border-right: none; }

.tempo-periodos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tempo-periodos label { margin: 0 !important; font-size: 12.5px; color: var(--t2); font-weight: 500; display: flex; align-items: center; gap: 5px; cursor: pointer; }

#materiasEstudoPainel {
  background: var(--card);
  border-radius: var(--rl);
  border: 1px solid var(--line);
  overflow: hidden;
}

.estudo-marco-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(210px, 0.8fr);
  gap: 14px;
  padding: 18px;
  background: var(--card);
}

.estudo-marco-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--brand-dim);
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 700;
  margin-bottom: 10px;
}
.estudo-marco-titulo { margin: 0 0 6px; font-size: 20px; line-height: 1.2; color: var(--t1); font-weight: 800; letter-spacing: -0.02em; }
.estudo-marco-slogan { margin: 0 0 7px; font-size: 13px; color: var(--t2); line-height: 1.55; }
.estudo-marco-meta { margin: 0; font-size: 12px; color: var(--brand); font-weight: 600; }
.estudo-marco-mini { display: grid; grid-template-columns: 1fr; gap: 8px; }

.estudo-mini-card {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px 13px;
}
.estudo-mini-card h4 { margin: 0 0 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--t3); font-weight: 700; }
.estudo-mini-card .value { font-size: 18px; font-weight: 800; color: var(--brand); }
.estudo-mini-card p { margin: 4px 0 0; font-size: 11px; color: var(--t2); line-height: 1.4; }

#chartEstudo {
  min-height: 280px;
  overflow: hidden;
  padding: 16px;
  background: var(--card);
  border-radius: var(--rl);
  border: 1px solid var(--line);
}
#chartEstudo canvas { width: 100% !important; height: 260px !important; }

#resumoTempoAtividades {
  display: none;
  padding: 16px 18px;
  background: var(--card);
  border-radius: var(--rl);
  border: 1px solid var(--line);
}
#resumoTempoAtividades h3 { color: var(--brand); margin-bottom: 12px; font-weight: 700; font-size: 14px; }

#atividadesList {
  overflow-x: auto;
  padding: 16px 18px;
  background: var(--card);
  border-radius: var(--rl);
  border: 1px solid var(--line);
}

#tempoatividades .form-group { background: transparent; border-radius: 0; box-shadow: none; padding: 0; margin-bottom: 0; }
#tempoatividades .form-group label,
#tempoatividades .form-group input,
#tempoatividades .form-group select,
#tempoatividades .form-group textarea,
#tempoatividades .filter-btn,
#tempoatividades p,
#tempoatividades td,
#tempoatividades th { font-size: 12px; }
#tempoatividades .tempoatividades-display { font-size: 44px; margin: 8px 0 5px; }
#tempoatividades table { table-layout: fixed; }
#tempoatividades td, #tempoatividades th { word-break: break-word; }

/* ═══════════════════════════
   NÍVEIS / EVOLUÇÃO
═══════════════════════════ */
.evolucao-shell { display: grid; gap: 16px; }

.evolucao-hero {
  background: var(--card);
  border: 1px solid var(--line-med);
  border-left: 3px solid var(--brand);
  border-radius: var(--rl);
  padding: 22px 24px;
  color: var(--t1);
  position: relative;
  overflow: hidden;
}

.evolucao-hero-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.evolucao-kicker { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--brand-dim); color: var(--brand); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; margin-bottom: 10px; }
.evolucao-hero h3 { margin: 0 0 8px; font-size: 22px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; color: var(--t1); }
.evolucao-hero p { margin: 0; max-width: 740px; color: var(--t2); line-height: 1.6; font-size: 13px; }

.evolucao-stage-badge {
  min-width: 190px;
  background: var(--card2);
  border: 1px solid var(--line-med);
  border-radius: var(--rl);
  padding: 14px 16px;
}
.evolucao-stage-badge .label { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--t3); margin-bottom: 4px; font-weight: 700; }
.evolucao-stage-badge .emoji { font-size: 24px; margin-bottom: 4px; }
.evolucao-stage-badge .name { font-size: 16px; font-weight: 800; color: var(--t1); margin-bottom: 5px; }
.evolucao-stage-badge .note { font-size: 11.5px; color: var(--t2); line-height: 1.5; }

.evolucao-mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.evolucao-mini-card { background: var(--card2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.evolucao-mini-card .mini-label { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--t3); margin-bottom: 6px; font-weight: 700; }
.evolucao-mini-card .mini-value { font-size: 17px; font-weight: 800; color: var(--t1); }
.evolucao-mini-card .mini-sub { margin-top: 4px; font-size: 11px; color: var(--t2); line-height: 1.4; }

.evolucao-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.evolucao-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--rl);
  padding: 18px 20px;
  transition: var(--ease);
}
.evolucao-card:hover { background: var(--card2); border-color: var(--line-med); }
.evolucao-card h4 { margin: 0 0 6px; color: var(--brand); font-size: 13px; font-weight: 700; }
.evolucao-card .eyebrow { font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .4px; font-weight: 700; margin-bottom: 6px; }
.evolucao-main-value { font-size: 24px; font-weight: 800; color: var(--t1); letter-spacing: -0.03em; }
.evolucao-level-badge { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 3px 8px; border-radius: 999px; background: var(--brand-dim); color: var(--brand); font-size: 10.5px; font-weight: 700; }
.evolucao-bar-wrap { margin: 12px 0 10px; }
.evolucao-bar-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 11px; color: var(--t3); margin-bottom: 6px; }
.evolucao-bar { height: 6px; background: var(--line-med); border-radius: 999px; overflow: hidden; }
.evolucao-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent) 0%, var(--brand) 100%); transition: width 0.8s ease; }
.evolucao-card p { margin: 0; color: var(--t2); font-size: 12px; line-height: 1.55; }
.evolucao-next-target { margin-top: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--card2); border: 1px solid var(--line); font-size: 12px; color: var(--t2); }
.evolucao-next-target strong { color: var(--t1); }
.evolucao-checklist { display: grid; gap: 7px; margin-top: 12px; }
.evolucao-check-item { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--t2); line-height: 1.5; }
.evolucao-check-icon { width: 18px; height: 18px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.evolucao-check-icon.ok { background: var(--green-dim); color: var(--green); }
.evolucao-check-icon.wait { background: rgba(245,158,11,0.12); color: var(--gold); }

.evolucao-stage-track {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--rl);
  padding: 18px 20px;
}
.evolucao-stage-track h4 { margin: 0 0 12px; color: var(--brand); font-size: 13px; font-weight: 700; }
.evolucao-stage-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }

.evolucao-stage-item {
  border-radius: var(--r);
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--card2);
  transition: var(--ease);
}
.evolucao-stage-item:hover { border-color: var(--line-med); }
.evolucao-stage-item.current { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.06); }
.evolucao-stage-item.done { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.05); }
.evolucao-stage-item.locked { opacity: 0.55; }
.evolucao-stage-item .stage-top { display: flex; justify-content: space-between; gap: 5px; align-items: center; margin-bottom: 6px; }
.evolucao-stage-item .stage-top span:first-child { font-size: 16px; }
.evolucao-stage-item .stage-status { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 2px 6px; border-radius: 999px; }
.evolucao-stage-item.current .stage-status { background: rgba(245,158,11,0.18); color: var(--gold); }
.evolucao-stage-item.done .stage-status { background: var(--green-dim); color: var(--green); }
.evolucao-stage-item.locked .stage-status { background: var(--line-med); color: var(--t3); }
.evolucao-stage-item h5 { margin: 0 0 4px; font-size: 11.5px; color: var(--t1); font-weight: 700; }
.evolucao-stage-item p { margin: 0; font-size: 10.5px; line-height: 1.4; color: var(--t2); }
.evolucao-stage-item .stage-gap { margin-top: 6px; font-size: 10.5px; color: var(--t2); font-weight: 600; }

.hierarquia-card {
  background: var(--card);
  border-radius: var(--rl);
  padding: 18px 20px;
  border: 1px solid var(--line);
}
.hierarquia-card h3 { color: var(--brand); margin-bottom: 12px; font-size: 14px; font-weight: 700; }

/* ── Pyramid ── */
.pyramid-wrapper { display: flex; justify-content: center; align-items: center; padding: 40px 20px; background: var(--card); border-radius: var(--rl); border: 1px solid var(--line); margin: 16px 0; position: relative; }
.pyramid-svg { width: 100%; max-width: 640px; height: 490px; }
.pyramid-text { position: absolute; color: var(--t1); font-weight: 300; font-size: 16px; text-align: center; font-family: 'Georgia', serif; letter-spacing: 1px; }
.pyramid-indicator { position: absolute; width: 16px; height: 16px; background: #ff6b6b; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 8px rgba(255,107,107,0.7); z-index: 10; }
.pyramid-descriptions { margin-top: 24px; max-width: 640px; }
.level-desc { padding: 14px 16px; background: var(--card); border-left: 2px solid var(--line-med); border-radius: var(--r); margin-bottom: 8px; border: 1px solid var(--line); transition: var(--ease); }
.level-desc.active { border-left-color: #ff6b6b; background: rgba(255,107,107,0.05); }
.level-desc h4 { margin: 0 0 5px; color: var(--t1); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; font-family: 'Georgia', serif; }
.level-desc p { margin: 0; color: var(--t2); font-size: 12px; line-height: 1.55; font-family: 'Georgia', serif; }
.level-info { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--brand); font-weight: 600; }

/* ═══════════════════════════
   METAS
═══════════════════════════ */
.metas-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); margin: 12px 0; }
.metas-table th, .metas-table td { padding: 10px 11px; text-align: center; border: 1px solid var(--line); }
.metas-table th { background: var(--card2); color: var(--t2); font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.metas-table td { font-size: 12px; color: var(--t1); }
.metas-table .meta-nome { text-align: left; font-weight: 600; color: var(--brand); font-size: 12px; }
.meta-input { width: 55px; padding: 4px; border: 1px solid var(--line-med); border-radius: 4px; text-align: center; font-family: var(--font); background: var(--bg); color: var(--t1); font-size: 12px; }
.metas-controls { margin-bottom: 14px; }
.metas-ano-section { margin-bottom: 28px; }
.metas-ano-titulo { font-size: 13px; font-weight: 700; color: var(--brand); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }

/* ═══════════════════════════
   MODAL
═══════════════════════════ */
.modal {
  display: none;
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.modal.active { display: flex; }

.modal-content {
  background: var(--surface);
  border: 1px solid var(--line-med);
  border-radius: var(--rl);
  padding: 32px;
  max-width: 500px;
  width: 92%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }

.modal-header { font-size: 16px; font-weight: 800; margin-bottom: 20px; color: var(--brand); }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; color: var(--t2); font-size: 12px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-med);
  border-radius: var(--r);
  font-size: 13px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--t1);
  transition: var(--ease);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-dim);
}
.form-buttons { display: flex; gap: 8px; margin-top: 20px; }

/* Stars */
.star-rating { display: flex; gap: 4px; font-size: 20px; }
.star { cursor: pointer; color: var(--line-med); transition: all .2s; }
.star:hover, .star.active { color: var(--gold); }

/* Photo */
.foto-upload { margin: 14px 0; text-align: center; }
.foto-preview { width: 80px; height: 80px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line-med); margin: 0 auto 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.foto-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Filters */
.filter-group { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-btn { background: var(--card2); color: var(--t2); border: 1px solid var(--line-med); padding: 5px 13px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 12px; font-family: var(--font); transition: var(--ease); }
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn.active { background: var(--brand); color: white; border-color: var(--brand); }

/* Patrimônio section icon */
.patrimonio-icon { font-size: 22px; margin-right: 6px; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-med); border-radius: 4px; }

/* ═══════════════════════════
   RESPONSIVE
═══════════════════════════ */
@media (max-width: 1100px) {
  .layout-shell { grid-template-columns: 1fr; }
  .ad-col { display: none; }
  .evolucao-mini-grid, .evolucao-grid, .evolucao-stage-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --nav-h: 50px; }
  .topbar { padding: 0 14px; }
  .topbar-brand-name { display: none; }
  .nav-item { padding: 5px 9px; font-size: 12px; }
  .layout-shell { padding: 16px 12px 36px; gap: 14px; }
  .patrimonio-graficos-grid, .finance-monthly-grid { grid-template-columns: 1fr; }
  .tempo-header-grid, .estudo-marco-card { grid-template-columns: 1fr; }
  .evolucao-mini-grid, .evolucao-grid, .evolucao-stage-list { grid-template-columns: 1fr; }
  .evolucao-stage-badge { width: 100%; }
  .tempoatividades-display { font-size: 36px; }
  .user-chip-name { display: none; }
  .btn-logout { display: none; }
  .page-header h1 { font-size: 20px; }
}

@media (max-width: 500px) {
  .nav-item span:not(.nav-icon) { display: none; }
}

/* ═══════════════════════════════
   TOAST
═══════════════════════════════ */
.fm-toast {
  position: fixed;
  bottom: 28px;
  right: 24px;
  padding: 11px 18px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  max-width: 320px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.fm-toast-ok  { background: var(--green); color: #fff; }
.fm-toast-err { background: var(--red);   color: #fff; }
.fm-toast-show { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════
   FEEDBACK
═══════════════════════════════ */
.feedback-form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--rl);
  padding: 22px 24px;
}
.feedback-form-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
}

.feedback-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--rl);
  padding: 14px 16px;
  transition: var(--ease);
}
.feedback-card:hover { background: var(--card2); }

.feedback-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.feedback-tipo {
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
  background: var(--brand-dim);
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 999px;
}
.feedback-meta {
  font-size: 11px;
  color: var(--t3);
  flex: 1;
}
.feedback-del {
  background: none;
  border: none;
  color: var(--t3);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--ease);
  font-family: var(--font);
}
.feedback-del:hover { background: var(--red-dim); color: var(--red); }
.feedback-msg {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.55;
  margin: 0;
}

/* ═══════════════════════════════
   RODAPÉ
═══════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 18px 20px;
  margin-top: 0;
}
.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--t1);
}
.footer-copy {
  flex: 1;
  font-size: 12px;
  color: var(--t3);
  text-align: center;
}
.footer-links {
  display: flex;
  gap: 16px;
}
.footer-links a {
  font-size: 12px;
  color: var(--t3);
  text-decoration: none;
  transition: var(--ease);
}
.footer-links a:hover { color: var(--brand); }

@media (max-width: 600px) {
  .site-footer-inner { justify-content: center; text-align: center; }
  .footer-copy { flex: unset; width: 100%; }
}

/* ═══════════════════════════════
   GRÁFICO EVOLUÇÃO — PAINEL
═══════════════════════════════ */
.evolucao-chart-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--rl);
  overflow: hidden;
}

.evolucao-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px 0;
  flex-wrap: wrap;
}

.evolucao-chart-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
}

.evolucao-chart-tabs {
  display: flex;
  gap: 4px;
}

.chart-tab {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-med);
  background: transparent;
  color: var(--t2);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--ease);
}
.chart-tab:hover { background: var(--hover); color: var(--t1); }
.chart-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.evolucao-chart-body { padding: 14px 16px 18px; }

.chart-panel { display: none; }
.chart-panel.active { display: block; }

/* ═══════════════════════════════
   SELETOR DE IDIOMA
═══════════════════════════════ */
.lang-select {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r);
  border: 1px solid var(--line-med);
  background: var(--card);
  color: var(--t1);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--ease);
  outline: none;
}
.lang-select:hover { border-color: var(--brand); }
.lang-select:focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-dim); }

@media (max-width: 500px) {
  .lang-select { display: none; }
}

/* ═══════════════════════════════
   FRASES COM ASPAS (CITAÇÕES)
═══════════════════════════════ */
/* Aspas decorativas — inline, não sobrepostas */
.frase-citacao::before {
  content: '\201C';
  font-family: Georgia, serif;
  font-size: 1.4em;
  line-height: 0;
  vertical-align: -0.3em;
  margin-right: 6px;
  opacity: 0.45;
  color: rgba(255,255,255,0.7);
}
.frase-citacao::after {
  content: '\201D';
  font-family: Georgia, serif;
  font-size: 1.4em;
  line-height: 0;
  vertical-align: -0.3em;
  margin-left: 6px;
  opacity: 0.45;
  color: rgba(255,255,255,0.7);
}
[data-theme="light"] .frase-citacao::before,
[data-theme="light"] .frase-citacao::after {
  color: rgba(255,255,255,0.9);
}

/* ═══════════════════════════════
   PRINT / PDF
═══════════════════════════════ */
@media print {
  .topbar, .announce-bar, .ad-col, .site-footer,
  .section-actions, .btn, .btn-ghost,
  .theme-toggle, .lang-select, .user-chip, .btn-logout,
  #modalSenha, #modal, #modalPerfil { display: none !important; }

  body { background: white !important; color: #0f172a !important; }
  .app-wrapper { padding-top: 0 !important; }
  .layout-shell { grid-template-columns: 1fr !important; padding: 20px !important; }
  .section { display: block !important; }
  .evolucao-card, .stat-card, .finance-card, .peso-card,
  .feedback-card, .finance-chart-card, .finance-panel-card {
    break-inside: avoid;
    border: 1px solid #e5e7eb !important;
    background: white !important;
    box-shadow: none !important;
  }
  .frase-banner { background: #1e3a6e !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  canvas { max-width: 100% !important; }
  .print-header { display: block !important; }
}

.print-header {
  display: none;
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
}

/* ═══════════════════════════════
   USER MENU DROPDOWN
═══════════════════════════════ */
.user-menu {
  position: relative;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  background: var(--surface);
  border: 1px solid var(--line-med);
  border-radius: var(--rl);
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
  z-index: 500;
  overflow: hidden;
  animation: dropIn .18s ease;
}
.user-dropdown.open { display: block; }

@keyframes dropIn {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--t2);
  font-weight: 500;
  cursor: pointer;
  transition: var(--ease);
}
.user-dropdown-item:hover {
  background: var(--hover);
  color: var(--t1);
}
.user-dropdown-item span:first-child {
  font-size: 14px;
  width: 18px;
  text-align: center;
}
.user-dropdown-danger { color: var(--red) !important; }
.user-dropdown-danger:hover { background: var(--red-dim) !important; }

/* ═══════════════════════════════
   AUTH MODAL (LOGIN / CADASTRO)
═══════════════════════════════ */
.auth-modal {
  max-width: 380px;
  width: 92%;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-tabs {
  display: flex;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 3px;
  gap: 3px;
}

.auth-tab {
  flex: 1;
  padding: 7px;
  border: none;
  background: transparent;
  color: var(--t2);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  border-radius: calc(var(--r) - 2px);
  cursor: pointer;
  transition: var(--ease);
}
.auth-tab.active {
  background: var(--brand);
  color: white;
}
.auth-tab:not(.active):hover {
  background: var(--hover);
  color: var(--t1);
}

.auth-erro {
  color: var(--red);
  font-size: 12px;
  min-height: 16px;
  margin-bottom: 6px;
}

.auth-hint {
  text-align: center;
  font-size: 12px;
  color: var(--t3);
  margin-top: 14px;
}
.auth-hint a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
.auth-hint a:hover { text-decoration: underline; }

/* ═══════════════════════════════
   AUTH — GOOGLE + FOTO + DADOS
═══════════════════════════════ */
.auth-modal {
  max-width: 420px;
  width: 94%;
  max-height: 92vh;
  overflow-y: auto;
}

/* Google button placeholder */
.btn-google {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: var(--r);
  border: 1.5px solid var(--line-med);
  background: var(--card2);
  color: var(--t1);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--ease);
  width: 100%;
  justify-content: center;
}
.btn-google:hover { background: var(--hover); border-color: #4285f4; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  color: var(--t3);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Submit button */
.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  padding: 11px;
  font-size: 14px;
}

/* Required asterisk */
.req { color: var(--red); font-size: 11px; }

/* Cadastro photo */
.cad-foto-area {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0 18px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--r);
  border: 1px solid var(--line);
}

.cad-foto-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--card2);
  border: 2px solid var(--line-med);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.cad-foto-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

/* 2-col grid for personal data fields */
.cad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.cad-grid .form-group { margin-bottom: 14px; }

/* Password input wrapper */
.input-pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-pw-wrap input {
  flex: 1;
  padding-right: 38px !important;
}
.btn-eye {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--t3);
  padding: 4px;
  line-height: 1;
  transition: var(--ease);
}
.btn-eye:hover { color: var(--t1); }

/* Password strength */
.pw-strength {
  height: 4px;
  border-radius: 2px;
  margin-top: 6px;
  background: var(--line);
  width: 0%;
  transition: width .3s, background .3s;
}

@media (max-width: 480px) {
  .cad-grid { grid-template-columns: 1fr; }
}

/* ── Auth modal close button ── */
.auth-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--hover);
  color: var(--t2);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--ease);
  line-height: 1;
}
.auth-close-btn:hover { background: var(--red-dim); color: var(--red); }
.auth-modal { position: relative; }
