/* Layout específico do dashboard (estilo Mobills) */

.main {
  padding-bottom: 16px;
}

.filters {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px 0;
}

/* Card principal de saldo */
.balance-card {
  margin: 12px 16px 0;
}

.balance-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.balance-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 6px 0 10px;
}

.balance-io {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.io.income {
  color: var(--green);
}

.io.expense {
  color: var(--red);
}

/* Cards por membro da família */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin: 12px 16px 0;
}

.member-card {
  text-align: center;
  padding: 12px 8px;
}

.member-emoji {
  font-size: 1.4rem;
}

.member-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 4px 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-value {
  font-size: 0.92rem;
  font-weight: 700;
}

/* Gráfico donut de categorias */
.chart-card {
  margin: 12px 16px 0;
}

.chart-card h2,
.tx-card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.donut-wrapper {
  display: flex;
  align-items: center;
  gap: 18px;
}

.donut {
  width: 136px;
  height: 136px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-hole {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-total {
  font-size: 0.82rem;
  font-weight: 700;
}

.donut-caption {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.donut-legend {
  list-style: none;
  flex: 1;
  min-width: 0;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.85rem;
}

.donut-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.donut-legend-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-legend-pct {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* Card de insight */
.insight-card {
  margin: 12px 16px 0;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  box-shadow: none;
}

.insight-card .insight-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.insight-card p {
  font-size: 0.85rem;
  color: #065f46;
}
/* ==========================================================================
   Cards de Resumo — Dashboard (adicionar ao final de dashboard.css)
   ========================================================================== */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 12px 16px 0;
}

.summary-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 12px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.summary-card:active {
  transform: scale(0.98);
}

.summary-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.summary-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.summary-value {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.2;
}

.summary-var {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Cores específicas por tipo de card */
.summary-balance .summary-value {
  color: #3b82f6;
}

.summary-income .summary-value {
  color: var(--green-dark);
}

.summary-expense .summary-value {
  color: var(--red);
}

.summary-savings .summary-value {
  color: #8b5cf6;
}

/* Variação positiva/negativa */
.summary-var.var-up {
  color: var(--green-dark);
}

.summary-var.var-down {
  color: var(--red);
}

/* Animação de entrada */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.summary-card {
  animation: slideUp 0.4s ease both;
}

.summary-card:nth-child(1) { animation-delay: 0s; }
.summary-card:nth-child(2) { animation-delay: 0.05s; }
.summary-card:nth-child(3) { animation-delay: 0.1s; }
.summary-card:nth-child(4) { animation-delay: 0.15s; }

/* Desktop: 4 colunas */
@media (min-width: 640px) {
  .summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   Saldo Atual clicável + drilldown de contas (estilo Mobills)
   ========================================================================== */

.summary-balance.clickable {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.summary-balance.clickable:hover {
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.summary-balance.clickable:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}

.chevron.open {
  transform: rotate(180deg);
}

.accounts-panel {
  margin: 10px 16px 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  animation: slideUp 0.25s ease both;
}

.accounts-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.accounts-updated {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  text-align: right;
}

.account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.account-emoji {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.account-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 7px;
  background: #ffffff;
  padding: 2px;
  display: block;
}

.account-info {
  flex: 1;
  min-width: 0;
}

.account-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-updated {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.account-balance {
  font-size: 0.92rem;
  font-weight: 700;
  flex-shrink: 0;
}

.accounts-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}
