/* Abas Gráficos, Metas e Config (inclui Custo de Vida). */

/* ─── CHARTS TAB ─── */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.chart-card.full { grid-column: 1 / -1; }
.chart-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--text2); }
.chart-wrap { position: relative; height: 220px; }
.chart-wrap.tall { height: 280px; }
.an-minis { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.an-mini { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: 12px; color: var(--text2); }
.an-mini b { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 16px; color: var(--text); margin-top: 2px; }
.an-block-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); font-weight: 700; margin: 22px 0 10px; }
.an-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.an-kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.an-kpi .l { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-bottom: 8px; }
.an-kpi .v { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; font-weight: 800; }
.an-kpi .v small { font-size: 13px; color: var(--text3); font-weight: 600; }
.an-kpi .s { font-size: 12px; color: var(--text3); margin-top: 5px; line-height: 1.4; }
.an-kpi .bar { height: 6px; background: var(--bg3); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.an-kpi .bar div { height: 100%; border-radius: 4px; }
.an-sub { font-size: 12px; color: var(--text3); margin: -10px 0 14px; line-height: 1.4; }
.an-cats { display: flex; flex-direction: column; gap: 9px; }
.an-cc { display: grid; grid-template-columns: 130px 1fr 112px; gap: 10px; align-items: center; font-size: 13px; }
.an-cc .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-cc .tr { position: relative; height: 12px; background: var(--bg3); border-radius: 6px; }
.an-cc .br { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.an-cc .av { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: 0.7; border-radius: 2px; }
.an-cc .vl { text-align: right; font-weight: 700; font-family: 'Plus Jakarta Sans', sans-serif; white-space: nowrap; }
.an-cc .vl small { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 11px; margin-left: 4px; }
.an-legend { display: flex; gap: 14px; font-size: 11px; color: var(--text3); margin-top: 12px; align-items: center; }
.an-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.an-top { width: 100%; border-collapse: collapse; font-size: 13px; }
.an-top tr { cursor: pointer; }
.an-top tr:hover td { background: var(--hover); }
.an-top td { padding: 8px 4px; border-bottom: 1px solid var(--border); }
.an-top tr:last-child td { border-bottom: none; }
.an-top .n { color: var(--text3); width: 22px; font-weight: 700; }
.an-top .d { color: var(--acc-ink); font-weight: 700; width: 46px; font-size: 12px; }
.an-top .c { color: var(--text3); font-size: 11px; }
.an-top .v { text-align: right; font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif; white-space: nowrap; }
.an-top .cr { font-size: 10px; margin-left: 4px; }
.an-empty { color: var(--text3); font-size: 13px; padding: 20px 0; text-align: center; }
@media (max-width: 900px) { .an-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .an-cc { grid-template-columns: 96px 1fr 92px; } }
.chart-filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-btn {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: transparent; color: var(--text2); font-size: 12px; cursor: pointer;
  transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #0a0a0f; font-weight: 600; }

/* ─── GOALS TAB ─── */
.goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.goal-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; transition: border-color 0.2s; position: relative; overflow: hidden;
}
.goal-card:hover { border-color: var(--border2); }
.goal-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.goal-top-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.goal-icon { font-size: 20px; flex-shrink: 0; }
.goal-info { min-width: 0; }
.goal-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 700; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-deadline { font-size: 11px; color: var(--text3); }
.goal-actions { display: flex; gap: 4px; flex-shrink: 0; }
.goal-owner-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 20px; background: rgba(124,58,237,0.12);
  color: var(--chip-t); border: 1px solid rgba(124,58,237,0.2);
  margin-bottom: 10px; width: fit-content;
}
.goal-amounts { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.goal-current { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 800; color: var(--acc-ink); }
.goal-sep { font-size: 11px; color: var(--text3); }
.goal-target { font-size: 12px; color: var(--text2); font-weight: 500; }
.progress-bar { height: 5px; background: var(--bg3); border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; background: var(--accent); }
.progress-fill.done { background: var(--green); }
.progress-fill.danger { background: var(--warn); }
.goal-footer { display: flex; align-items: center; justify-content: space-between; }
.goal-pct { font-size: 11px; color: var(--text3); }
.goal-status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.goal-status.active { background: rgba(196,241,53,0.1); color: var(--acc-ink); }
.goal-status.done { background: rgba(34,197,94,0.1); color: var(--green); }
.goal-status.late { background: rgba(239,68,68,0.1); color: var(--red); }
.aporte-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.aporte-input {
  flex: 1; padding: 8px 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px; font-family: inherit;
}
.aporte-input:focus { outline: none; border-color: var(--accent3); }
.btn-aporte {
  padding: 8px 14px; background: rgba(6,214,160,0.15); border: 1px solid var(--accent3);
  color: var(--accent3); border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif; transition: all 0.2s; white-space: nowrap;
}
.btn-aporte:hover { background: rgba(6,214,160,0.25); }

/* ─── SETTINGS ─── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.cv-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cv-row { display: flex; gap: 8px; align-items: center; }
.cv-row input { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 10px 12px; font-size: 14px; font-family: inherit; }
.cv-row input:focus { outline: none; border-color: var(--accent); }
.cv-row .cv-name { flex: 1; min-width: 0; }
.cv-row .cv-amount { width: 120px; text-align: right; }
.cv-row .cv-del { background: none; border: none; color: var(--text3); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.cv-row .cv-del:hover { color: var(--red); }
.cv-chev { background: none; border: none; color: var(--text2); width: 24px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 11px; flex-shrink: 0; transition: transform 0.2s; padding: 0; }
.cv-chev.open { transform: rotate(90deg); }
.cv-chev.hide { visibility: hidden; display: inline-block; }
.cv-group { border: 1px solid var(--border); border-radius: 12px; padding: 8px 0; background: var(--hover); }
.cv-group > .cv-row { padding-right: 0; }
.cv-gname { font-weight: 700; }
.cv-gtotal { width: 120px; text-align: right; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 15px; padding: 4px 12px; white-space: nowrap; cursor: pointer; flex-shrink: 0; }
.cv-gtotal small { display: block; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 10px; color: var(--text3); margin-top: 1px; }
.cv-subs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 10px 8px 2px 62px; border-top: 1px solid var(--border); }
.cv-sub input { padding: 8px 10px !important; font-size: 13px !important; }
.cv-addsub { align-self: flex-start; background: none; border: 1px dashed var(--border); color: var(--text2); border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.cv-addsub:hover { border-color: var(--accent); color: var(--acc-ink); }
@media (max-width: 600px) {
  .cv-row .cv-amount, .cv-gtotal { width: 108px; }
  .cv-row input { font-size: 13px; padding: 9px 10px; }
  .cv-subs { padding-left: 24px; }
}
.cv-chart-card { margin-bottom: 16px; }
.cv-rank { width: 30px; flex-shrink: 0; text-align: center; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 15px; color: var(--text3); }
.cv-rank.top { color: var(--acc-ink); }
.cv-valwrap { width: 132px; flex-shrink: 0; text-align: right; }
.cv-row .cv-valwrap .cv-amount { width: 100%; background: transparent; border-color: transparent; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 15px; padding: 2px 12px; }
.cv-row .cv-valwrap .cv-amount:hover { border-color: var(--border); }
.cv-row .cv-valwrap .cv-amount:focus { background: var(--bg3); border-color: var(--accent); }
.cv-valwrap small, .cv-gtotal small { display: block; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 10px; color: var(--text3); padding-right: 12px; }
.cv-gtotal small { padding-right: 0; }
.cv-act { background: none; border: none; color: var(--text3); font-size: 16px; cursor: pointer; width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; }
.cv-act:hover { color: var(--acc-ink); background: var(--bg3); }
.cvc-ticks { position: relative; height: 14px; font-size: 10px; color: var(--text3); margin: 0 2px; }
.cvc-ticks span { position: absolute; transform: translateX(-50%); }
.cvc-ticks span:first-child { transform: none; }
.cvc-ticks span:last-child { transform: translateX(-100%); }
.cvc-total { display: flex; justify-content: space-between; align-items: center; height: 26px; margin-top: 6px; padding: 0 8px; border-radius: 4px; border: 1px solid var(--border); font-size: 11px; font-weight: 800;
  background: repeating-linear-gradient(90deg, var(--border) 0 1px, transparent 1px 10%), var(--bg3); }
.cvc-bar { display: flex; height: 30px; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.cvc-bar div { display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #0a0a0f; overflow: hidden; white-space: nowrap; border-right: 2px solid var(--card); }
.cvc-bar div:last-child { border-right: none; }
.cvc-lbls { position: relative; margin-top: 4px; }
.cvc-l { position: absolute; z-index: 2; background: var(--card); padding: 0 4px; border-radius: 4px; transform: translateX(-50%); text-align: center; font-size: 11px; line-height: 1.25; white-space: nowrap; }
.cvc-l b { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; }
.cvc-l span { color: var(--text3); font-size: 10px; }
@media (max-width: 600px) {
  .cv-chart-card { display: none; }
  .cv-row .cv-valwrap .cv-amount { font-size: 14px; padding: 2px 6px; }
  .cv-valwrap, .cv-gtotal { width: 104px; }
  .cv-valwrap small { padding-right: 6px; }
  .cv-rank { width: 24px; font-size: 13px; }
  .cv-act { width: 24px; }
  .cv-row { gap: 4px; }
}
.cv-empty { font-size: 13px; color: var(--text3); padding: 8px 0; }
.cv-margin-input { width: 44px; background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 2px 4px; font-size: 12px; text-align: center; }
.settings-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
.settings-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.cat-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cat-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--bg3); border-radius: var(--radius-sm); font-size: 13px;
}
.cat-item .cat-color { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.cat-item .cat-name { flex: 1; }
.cat-item .btn-del { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 14px; transition: color 0.2s; }
.cat-item .btn-del:hover { color: var(--red); }
.cat-add-form { display: flex; gap: 8px; }
.cat-add-form input { flex: 1; }
