/* === ONGLETS === */

.finances-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  gap: var(--space-1);
  margin-bottom: var(--space-5);
}

.finances-tab {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  min-height: 40px;
}

.finances-tab.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* === BILAN TOTAL === */

.finances-total-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16,185,129,0.06) 100%);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
  text-align: center;
}

.finances-total-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.finances-total-amount {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.finances-total-amount.positive { color: var(--accent); }
.finances-total-amount.negative { color: var(--error); }

/* === CARTES COMPTES === */

.finances-accounts-scroll {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-5);
  scrollbar-width: none;
}

.finances-accounts-scroll::-webkit-scrollbar { display: none; }

.finances-account-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex-shrink: 0;
  min-width: 140px;
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.finances-account-chip:hover { border-color: rgba(16,185,129,0.4); transform: translateY(-1px); }
.finances-account-chip.active { border-color: var(--accent); background: var(--accent-subtle); }

.finances-account-chip-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.finances-account-chip-balance {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* === STATS MOIS === */

.finances-month-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.finances-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  text-align: center;
}

.finances-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.finances-stat-value {
  font-size: var(--text-lg);
  font-weight: 800;
  font-family: var(--font-mono);
}

.finances-stat-value.income  { color: var(--accent); }
.finances-stat-value.expense { color: var(--error); }
.finances-stat-value.balance.positive { color: var(--accent); }
.finances-stat-value.balance.negative { color: var(--error); }

/* === GRAPHIQUE DONUT === */

.finances-chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.finances-chart-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.finances-chart-layout {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.finances-chart-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.finances-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.finances-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.finances-legend-name {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finances-legend-amount {
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  white-space: nowrap;
}

/* === COMPARAISON MOIS PRÉCÉDENT === */

.finances-comparison {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.finances-comparison-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.finances-comparison-row:last-child { border-bottom: none; }

.finances-comparison-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.finances-comparison-values {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.finances-comparison-prev {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.finances-comparison-curr {
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: var(--font-mono);
}

.finances-comparison-delta {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
}

.finances-comparison-delta.better { background: var(--accent-subtle); color: var(--accent); }
.finances-comparison-delta.worse  { background: var(--error-subtle);  color: var(--error); }
.finances-comparison-delta.same   { background: var(--bg-primary);    color: var(--text-muted); }

/* === SAISIE RAPIDE === */

.finances-quick-add {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.finances-quick-type-toggle {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  gap: var(--space-1);
  flex-shrink: 0;
}

.finances-type-btn {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.finances-type-btn.active.income  { background: var(--accent-subtle); color: var(--accent); }
.finances-type-btn.active.expense { background: var(--error-subtle);  color: var(--error); }

.finances-quick-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  color: var(--text-primary);
  font-family: var(--font-mono);
  transition: border-color var(--transition-fast);
}

.finances-quick-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.finances-quick-input::placeholder { color: var(--text-muted); font-family: var(--font-sans); }

/* === LISTE TRANSACTIONS === */

.finances-transactions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.finances-tx-date-header {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-3) 0 var(--space-1);
}

.finances-tx-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: border-color var(--transition-fast);
  width: 100%;
  text-align: left;
}

.finances-tx-item:hover { border-color: rgba(16,185,129,0.3); }

.finances-tx-emoji {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

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

.finances-tx-desc {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finances-tx-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.finances-tx-amount {
  font-size: var(--text-base);
  font-weight: 800;
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
}

.finances-tx-amount.income  { color: var(--accent); }
.finances-tx-amount.expense { color: var(--error); }

/* === GESTION COMPTES === */

.finances-accounts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.finances-account-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.finances-account-card-info { flex: 1; }

.finances-account-card-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
}

.finances-account-card-type {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.finances-account-card-balance {
  font-size: var(--text-xl);
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* === MODAL TRANSACTION === */

.finances-type-selector {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.finances-type-option {
  flex: 1;
  padding: var(--space-3);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
}

.finances-type-option:hover { border-color: var(--accent); }
.finances-type-option.active.income  { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent); }
.finances-type-option.active.expense { border-color: var(--error);  background: var(--error-subtle);  color: var(--error); }

.finances-category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}

.finances-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-2) var(--space-1);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  background: transparent;
  transition: all var(--transition-fast);
  min-height: 56px;
}

.finances-cat-btn span:first-child { font-size: 18px; line-height: 1; }
.finances-cat-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.finances-cat-btn.active { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent); font-weight: 600; }

/* === RESPONSIVE === */

@media (max-width: 480px) {
  .finances-month-stats { grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
  .finances-stat-value { font-size: var(--text-base); }
  .finances-chart-layout { flex-direction: column; }
  .finances-category-grid { grid-template-columns: repeat(4, 1fr); }
  .finances-total-amount { font-size: var(--text-3xl); }
}
