/* ==========================================================================
   Cookie Cash 🍪 — Design System Fintech & Ultra User-Friendly
   ========================================================================== */

:root {
  /* Typographie */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Palette Principale (Thème Clair) */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;
  --border-card: rgba(226, 232, 240, 0.9);
  --border-focus: #10b981;

  /* Textes */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #94a3b8;

  /* Couleurs Sémantiques */
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-light: #ecfdf5;
  --primary-text: #065f46;

  --expense: #f43f5e;
  --expense-hover: #e11d48;
  --expense-light: #fff1f2;
  --expense-text: #9f1239;

  --income: #10b981;
  --income-light: #ecfdf5;

  --savings: #3b82f6;
  --savings-hover: #2563eb;
  --savings-light: #eff6ff;
  --savings-text: #1e40af;

  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-text: #92400e;

  /* Rayons & Ombres */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 10px 30px -5px rgba(15, 23, 42, 0.06), 0 4px 10px -2px rgba(15, 23, 42, 0.02);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);

  --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-body: #090d16;
  --bg-card: #111726;
  --bg-subtle: #1b2337;
  --bg-hover: #1e283e;
  --border-card: rgba(255, 255, 255, 0.08);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;

  --primary: #10b981;
  --primary-light: rgba(16, 185, 129, 0.15);
  --primary-text: #6ee7b7;

  --expense: #fb7185;
  --expense-light: rgba(244, 63, 94, 0.15);
  --expense-text: #fda4af;

  --income: #34d399;
  --income-light: rgba(16, 185, 129, 0.15);

  --savings: #60a5fa;
  --savings-light: rgba(59, 130, 246, 0.15);
  --savings-text: #bfdbfe;

  --warning: #fbbf24;
  --warning-light: rgba(245, 158, 11, 0.15);
  --warning-text: #fde68a;

  --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Mode confidentialité : floute les montants si activé */
body.privacy-mode .money-value,
body.privacy-mode .metric-num,
body.privacy-mode .hero-balance-amt,
body.privacy-mode .metric-value,
body.privacy-mode .recent-amt,
body.privacy-mode .tx-amount-text,
body.privacy-mode .donut-center-value,
body.privacy-mode .legend-amount,
body.privacy-mode .budget-amounts,
body.privacy-mode .goal-amounts,
body.privacy-mode .sub-item-amt,
body.privacy-mode .preview-amt {
  filter: blur(8px);
  user-select: none;
  transition: filter 0.2s ease;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.app-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  transition: background-color 0.25s ease;
}

.header-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.brand-badge-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: transform 0.2s ease;
}

.brand:hover .brand-badge-logo {
  transform: rotate(6deg) scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.month-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  font-size: 0.88rem;
  font-weight: 600;
}

.month-pill select {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  font-weight: 700;
}

.btn-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-icon-circle:hover {
  background-color: var(--bg-subtle);
  transform: translateY(-1px);
}

.btn-cta-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: var(--transition-smooth);
}

.btn-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-plus {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

/* Onglets de navigation desktop */
.app-nav {
  background-color: var(--bg-card);
  border-top: 1px solid rgba(226, 232, 240, 0.5);
}

[data-theme="dark"] .app-nav {
  border-top-color: var(--border-card);
}

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar {
  display: none;
}

.nav-item {
  padding: 0.8rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  color: var(--text-main);
}

.nav-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* ==========================================================================
   Conteneur Principal
   ========================================================================== */

.app-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 5rem;
}

/* ==========================================================================
   Hero Banner & Reste à vivre (Accueillant & Friendly)
   ========================================================================== */

.hero-dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}

.hero-dashboard-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
  pointer-events: none;
  border-radius: var(--radius-full);
}

.hero-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.hero-greeting h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.hero-balance-display {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.hero-balance-amt {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.1;
}

.hero-balance-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.daily-allowance-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary-light);
  color: var(--primary-text);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.daily-allowance-pill.warning {
  background-color: var(--warning-light);
  color: var(--warning-text);
  border-color: rgba(245, 158, 11, 0.2);
}

.daily-allowance-pill.danger {
  background-color: var(--expense-light);
  color: var(--expense-text);
  border-color: rgba(244, 63, 94, 0.2);
}

/* 3 Grands Boutons d'Action Rapides (Ultra Conviviaux) */
.quick-action-trio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-card);
}

.btn-action-tile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-smooth);
}

.btn-action-tile:hover {
  transform: translateY(-2px);
}

.btn-action-tile.tile-expense {
  background-color: var(--expense-light);
  color: var(--expense-text);
  border-color: rgba(244, 63, 94, 0.2);
}

.btn-action-tile.tile-income {
  background-color: var(--income-light);
  color: var(--primary-text);
  border-color: rgba(16, 185, 129, 0.2);
}

.btn-action-tile.tile-savings {
  background-color: var(--savings-light);
  color: var(--savings-text);
  border-color: rgba(59, 130, 246, 0.2);
}

.tile-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

[data-theme="dark"] .tile-icon {
  background-color: rgba(0, 0, 0, 0.2);
}

.tile-text strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
}

.tile-text small {
  font-size: 0.78rem;
  opacity: 0.85;
}

/* ==========================================================================
   Cartes Métriques du Mois
   ========================================================================== */

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.card-stat-clean {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-soft);
  transition: var(--transition-smooth);
}

.card-stat-clean:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-icon-bubble {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon-bubble.bubble-income { background-color: var(--income-light); }
.stat-icon-bubble.bubble-expense { background-color: var(--expense-light); }
.stat-icon-bubble.bubble-savings { background-color: var(--savings-light); }
.stat-icon-bubble.bubble-net { background-color: var(--bg-subtle); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-num {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-foot {
  font-size: 0.76rem;
  color: var(--text-sub);
}

/* ==========================================================================
   Grilles & Panneaux Principaux
   ========================================================================== */

.grid-2-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.panel-white {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.panel-header-clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.panel-header-clean h3 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tag-badge {
  font-size: 0.78rem;
  font-weight: 700;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Règle 50 / 30 / 20 (Simple & Pédagogique)
   ========================================================================== */

.rule-503020-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-card);
}

.rule-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.rule-pillar {
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rule-pillar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.rule-pillar-title {
  font-size: 0.88rem;
  font-weight: 700;
}

.rule-pillar-target {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rule-gauge-track {
  width: 100%;
  height: 8px;
  background-color: rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

[data-theme="dark"] .rule-gauge-track {
  background-color: rgba(255, 255, 255, 0.08);
}

.rule-gauge-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.fill-needs { background-color: #3b82f6; }
.fill-wants { background-color: #ec4899; }
.fill-savings { background-color: #10b981; }

.rule-pillar-foot {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

/* ==========================================================================
   Activity Feed (Flux d'opérations moderne style smartphone)
   ========================================================================== */

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
  transition: var(--transition-smooth);
}

.activity-item:hover {
  background-color: var(--bg-hover);
  transform: translateX(2px);
}

.activity-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.activity-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.activity-details strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.activity-details small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.activity-right {
  text-align: right;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tx-amount-text {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tx-amount-text.income { color: var(--income); }
.tx-amount-text.expense { color: var(--expense); }
.tx-amount-text.savings { color: var(--savings); }

/* ==========================================================================
   Vue Transactions Enrichie
   ========================================================================== */

.tx-view-header {
  margin-bottom: 1.5rem;
}

.tx-search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1rem;
}

.tx-search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.tx-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chip-filter {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background-color: var(--bg-card);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.chip-filter:hover {
  background-color: var(--bg-subtle);
}

.chip-filter.active {
  background-color: var(--text-main);
  color: var(--bg-card);
  border-color: var(--text-main);
}

/* ==========================================================================
   Modales & Formulaires Conviviaux
   ========================================================================== */

dialog {
  margin: auto;
  border: none;
  background: transparent;
  padding: 0;
  max-width: 500px;
  width: calc(100% - 2rem);
  outline: none;
}

dialog::backdrop {
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-modal);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.btn-close-modal:hover {
  background-color: var(--bg-subtle);
}

/* Type Pill Selector */
.type-pill-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background-color: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-lg);
}

.type-pill {
  padding: 0.65rem 0.5rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: var(--transition-smooth);
}

.type-pill.active[data-type="expense"],
.type-pill.active[data-subtype="subscription"] {
  background-color: var(--expense);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.3);
}

.type-pill.active[data-type="income"] {
  background-color: var(--income);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.type-pill.active[data-type="savings"],
.type-pill.active[data-subtype="loan"] {
  background-color: var(--savings);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

/* Grand affichage du montant au centre */
.amount-input-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
}

.currency-symbol {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-muted);
}

.amount-big-input {
  border: none;
  background: transparent;
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  max-width: 260px;
  outline: none;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

/* Grille de bulles de catégories */
.category-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.45rem;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  margin-top: 0.4rem;
}

.category-chip {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  background-color: var(--bg-card);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-align: left;
  transition: var(--transition-smooth);
}

.category-chip:hover {
  background-color: var(--bg-subtle);
}

.category-chip.selected {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-text);
  font-weight: 700;
}

.form-row {
  margin-bottom: 1.1rem;
}

.form-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.input-clean, .select-clean {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  background-color: var(--bg-card);
  outline: none;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.input-clean:focus, .select-clean:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.helper-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  display: block;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn-primary-large {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: var(--transition-smooth);
}

.btn-primary-large:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-subtle {
  background: var(--bg-subtle);
  border: none;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.btn-subtle:hover {
  color: var(--text-main);
  background-color: var(--border-card);
}

/* Modale de Bienvenue */
.modal-welcome-card {
  text-align: center;
}

.welcome-emoji-hero {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
}

.welcome-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.welcome-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  background-color: var(--bg-subtle);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.welcome-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.wf-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.welcome-feature-item strong {
  display: block;
  font-size: 0.92rem;
}

.welcome-feature-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* ==========================================================================
   Navigation Mobile Inférieure
   ========================================================================== */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-card);
  padding: 0.4rem 0.75rem calc(0.4rem + env(safe-area-inset-bottom));
  z-index: 50;
  justify-content: space-around;
  align-items: center;
  backdrop-filter: blur(12px);
}

.mobile-nav-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.35rem;
}

.mobile-nav-btn.active {
  color: var(--primary);
}

.mobile-nav-icon { font-size: 1.25rem; }
.mobile-nav-label { font-size: 0.7rem; font-weight: 600; }

.mobile-nav-btn-center {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 300;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  margin-top: -16px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .app-nav { display: none; }
  .mobile-bottom-nav { display: flex; }
  .app-container { padding-bottom: 6rem; }
  .header-container { padding: 0.75rem 1rem; }
  .brand-name { font-size: 1.1rem; }
  .brand-subtitle { display: none; }
  .month-pill { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
}

/* ==========================================================================
   Graphique Donut & Graphique Barres (Charts)
   ========================================================================== */

.donut-chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 0.5rem 0;
}

@media (min-width: 640px) {
  .donut-chart-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
  }
}

.donut-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  flex-shrink: 0;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.chart-segment {
  cursor: pointer;
  transition: stroke-width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, filter 0.2s ease;
}

.chart-segment:hover,
.chart-segment.highlighted {
  stroke-width: 42px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  width: 130px;
}

.donut-center-emoji {
  font-size: 1.8rem;
  line-height: 1.1;
  margin-bottom: 2px;
}

.donut-center-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-center-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.donut-center-sub {
  font-size: 0.72rem;
  color: var(--text-sub);
  font-weight: 600;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.84rem;
}

.legend-item:hover,
.legend-item.active {
  background-color: var(--bg-subtle);
  transform: translateX(3px);
}

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

.legend-emoji {
  font-size: 1rem;
}

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

.legend-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background-color: var(--bg-card);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
}

.legend-amount {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.88rem;
}

/* Bar Chart */
.bar-chart-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.5rem 0;
}

.bar-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  height: 180px;
  padding-top: 10px;
  border-bottom: 2px solid var(--border-card);
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  justify-content: flex-end;
}

.bar-columns {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 100%;
  max-width: 44px;
  height: calc(100% - 24px);
  justify-content: center;
}

.bar-col {
  flex: 1;
  border-radius: 4px 4px 0 0;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
  min-height: 4px;
}

.bar-col:hover {
  filter: brightness(1.15);
}

.bar-income { background-color: var(--income); }
.bar-expense { background-color: var(--expense); }
.bar-savings { background-color: var(--savings); }

.bar-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.bar-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dot-income {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--income);
}

.dot-expense {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--expense);
}

.dot-savings {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--savings);
}

/* ==========================================================================
   Conseils & Recommandations (Tips)
   ========================================================================== */

.tips-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tip-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  border-left: 4px solid transparent;
  background-color: var(--bg-subtle);
}

.tip-card.tip-success {
  background-color: var(--income-light);
  border-left-color: var(--income);
}

.tip-card.tip-warning {
  background-color: var(--warning-light);
  border-left-color: var(--warning);
}

.tip-card.tip-info {
  background-color: var(--savings-light);
  border-left-color: var(--savings);
}

.tip-card.tip-danger {
  background-color: var(--expense-light);
  border-left-color: var(--expense);
}

.tip-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.tip-body strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.tip-body p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   Abonnements, Charges fixes & Crédits
   ========================================================================== */

.badge-cancel-reminder {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--warning-light);
  color: var(--warning-text);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  margin-top: 0.3rem;
}

.badge-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.badge-sub {
  background-color: var(--expense-light);
  color: var(--expense-text);
}

.badge-loan {
  background-color: var(--savings-light);
  color: var(--savings-text);
}

.sub-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.sub-item:hover {
  background-color: var(--bg-hover);
}

.sub-item.sub-loan {
  border-left: 3px solid var(--savings);
}

.sub-item-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sub-emoji {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.sub-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sub-item-amt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   Budgets & Objectifs (Grilles, Cartes & Jauges)
   ========================================================================== */

.budgets-grid, .goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.budget-card, .goal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: var(--transition-smooth);
}

.budget-card:hover, .goal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.budget-card.status-over {
  border-color: rgba(244, 63, 94, 0.4);
  background: linear-gradient(to bottom, var(--expense-light), var(--bg-card) 50%);
}

.budget-card.status-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(to bottom, var(--warning-light), var(--bg-card) 50%);
}

.budget-card-head, .goal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.budget-cat-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.budget-amounts, .goal-amounts {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.budget-amt-spent {
  font-size: 1.3rem;
  font-weight: 800;
}

.budget-amt-max {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.budget-pct {
  font-size: 0.85rem;
  font-weight: 800;
}

.budget-pct.status-ok { color: var(--primary); }
.budget-pct.status-warning { color: var(--warning); }
.budget-pct.status-over { color: var(--expense); }

.progress-bar-track {
  width: 100%;
  height: 8px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.progress-bar-fill.status-ok { background-color: var(--primary); }
.progress-bar-fill.status-warning { background-color: var(--warning); }
.progress-bar-fill.status-over { background-color: var(--expense); }
.progress-bar-fill.progress-savings { background-color: var(--savings); }

.budget-card-foot, .goal-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Import CSV & Outils
   ========================================================================== */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tool-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.tool-icon {
  font-size: 2rem;
  line-height: 1;
}

.tool-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.csv-dropzone {
  border: 2px dashed var(--primary);
  background-color: var(--primary-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.csv-dropzone:hover, .csv-dropzone.drag-over {
  background-color: rgba(16, 185, 129, 0.15);
  transform: scale(1.01);
}

.drop-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.drop-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.csv-preview-box {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.csv-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-card);
  font-size: 0.85rem;
  gap: 0.5rem;
}

.preview-badge-count {
  display: inline-block;
  background-color: var(--primary-light);
  color: var(--primary-text);
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
}

/* Boutons utilitaires */
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.btn-outline {
  background: var(--bg-card);
  border-color: var(--border-card);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-subtle);
}

.btn-danger-outline {
  background: var(--bg-card);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--expense);
}

.btn-danger-outline:hover {
  background-color: var(--expense-light);
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  background-color: var(--bg-subtle);
}

.icon-btn.text-danger:hover {
  background-color: var(--expense-light);
}

.w-full {
  width: 100%;
}

