/* ═══════════════════════════════════════════════════════════════
   SALDO — Layout split (gráfico + detalhamento lado a lado)
   ═══════════════════════════════════════════════════════════════ */

/* Wrapper externo do card de composição */
#panel-4 .saldo-card {
  background: #fff;
  border: 0.5px solid #e4e8ee;
  border-radius: 14px;
  overflow: hidden;
}

/* Cabeçalho: título + chips */
#panel-4 .saldo-mini-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Chips ────────────────────────────────────────────────────── */
#panel-4 .saldo-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

#panel-4 .saldo-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

#panel-4 .saldo-chip-pos { background: #e8f7ef; color: #0d7a4e; }
#panel-4 .saldo-chip-pos::before { background: #0d7a4e; }

#panel-4 .saldo-chip-neg { background: #fdecec; color: #c62828; }
#panel-4 .saldo-chip-neg::before { background: #c62828; }

#panel-4 .saldo-chip-net { background: #fff4df; color: #b26a00; }
#panel-4 .saldo-chip-net::before { background: #b26a00; }

/* ── Layout split: gráfico + detalhamento ─────────────────────── */
#panel-4 .saldo-split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

#panel-4 .saldo-chart-area {
  border-right: 0.5px solid #e4e8ee;
  width: 100%;
  height: 320px;
  min-height: 320px;
}

#panel-4 #chart-4-composicao {
  width: 100%;
  height: 320px;
}

/* ── Painel de detalhamento ───────────────────────────────────── */
#panel-4 .saldo-detail-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

#panel-4 .saldo-detail-head {
  padding: 13px 16px 10px;
  border-bottom: 0.5px solid #e4e8ee;
  flex-shrink: 0;
}

#panel-4 .saldo-detail-head-title {
  font-size: 12px;
  font-weight: 600;
  color: #1a2332;
  margin: 0;
}

#panel-4 .saldo-detail-head-sub {
  font-size: 10px;
  color: #8a97a8;
  margin: 2px 0 0;
}

/* ── Grupos (Entradas / Deduções) ─────────────────────────────── */
#panel-4 .saldo-group {
  border-bottom: 0.5px solid #e4e8ee;
}

#panel-4 .saldo-group-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #a0aab6;
  padding: 8px 16px 4px;
}

/* ── Linhas de item ───────────────────────────────────────────── */
#panel-4 .saldo-drow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  gap: 8px;
}

#panel-4 .saldo-drow + .saldo-drow {
  border-top: 0.5px solid #f0f3f6;
}

#panel-4 .saldo-drow-child {
  padding: 5px 16px 5px 22px;
  background: #fafbfc;
}

#panel-4 .saldo-drow-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

#panel-4 .saldo-drow-name {
  font-size: 11.5px;
  color: #2c3a4a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#panel-4 .saldo-drow-child .saldo-drow-name {
  font-size: 11px;
  color: #6b7a8d;
}

#panel-4 .saldo-drow-val {
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

#panel-4 .saldo-drow-child .saldo-drow-val {
  font-size: 11px;
  font-weight: 400;
}

/* ── Ícones ───────────────────────────────────────────────────── */
#panel-4 .saldo-row-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#panel-4 .saldo-row-icon svg {
  width: 12px;
  height: 12px;
}

#panel-4 .saldo-drow-child .saldo-row-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
}

#panel-4 .saldo-drow-child .saldo-row-icon svg {
  width: 10px;
  height: 10px;
}

#panel-4 .saldo-icon-gr  { background: #e8f7ef; stroke: #0d7a4e; }
#panel-4 .saldo-icon-gr svg { stroke: #0d7a4e; }

#panel-4 .saldo-icon-rd  { background: #fdecec; }
#panel-4 .saldo-icon-rd svg { stroke: #c62828; }

#panel-4 .saldo-icon-am  { background: #fff4df; }
#panel-4 .saldo-icon-am svg { stroke: #b26a00; }

#panel-4 .saldo-icon-mu  { background: #f1f3f6; }
#panel-4 .saldo-icon-mu svg { stroke: #8a97a8; }

#panel-4 .saldo-icon-final { background: #e8f7ef; }
#panel-4 .saldo-icon-final svg { stroke: #0d7a4e; }

/* ── Linha de total deduções ──────────────────────────────────── */
#panel-4 .saldo-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #f7f8fa;
  border-top: 0.5px solid #e4e8ee;
}

#panel-4 .saldo-total-label {
  font-size: 11px;
  font-weight: 500;
  color: #6b7a8d;
}

#panel-4 .saldo-total-val {
  font-size: 11px;
  font-weight: 600;
}

/* ── Linha final: saldo líquido ───────────────────────────────── */
#panel-4 .saldo-final-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-top: 0.5px solid #d0d8e2;
  margin-top: auto;
}

#panel-4 .saldo-final-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

#panel-4 .saldo-final-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #0d7a4e;
}

#panel-4 .saldo-final-val {
  font-size: 13px;
  font-weight: 600;
  color: #0d7a4e;
}

/* ── Cores de valor ───────────────────────────────────────────── */
#panel-4 .saldo-val-gr { color: #0d7a4e; }
#panel-4 .saldo-val-rd { color: #c62828; }
#panel-4 .saldo-val-mu { color: #8a97a8; }

/* ── Estado de loading ────────────────────────────────────────── */
#panel-4 .saldo-loading-msg {
  padding: 16px;
  color: #8a97a8;
  font-size: 12px;
}

/* ── Responsivo: empilha abaixo de 700px ──────────────────────── */
@media (max-width: 700px) {
  #panel-4 .saldo-split {
    grid-template-columns: 1fr;
  }
  #panel-4 .saldo-chart-area {
    border-right: none;
    border-bottom: 0.5px solid #e4e8ee;
  }
}#panel-4 .chart-card {
  margin-top: 0;
}#chart-5-comparativo {
  width: 100%;
  height: 340px;
  min-height: 340px;
}

#panel-5 .chart-card {
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
}

#panel-5 .cc-head {
  align-items: center;
  margin-bottom: 8px;
}

#panel-5 .cc-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

#panel-5 .cc-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}
