/* ========== THÈME ========== */
/* Direction « Rythme » (choisie le 2026-10-02) : fond clair et neutre, encre bleu nuit,
   le bleu MyWallet garde le rôle d'action, le corail signale la dépense. */
:root {
  --paper: #F3F6F8;
  --surface: #FFFFFF;
  --surface-2: #EAF0F4;
  --ink: #102331;
  --ink-soft: #5B6B78;
  --line: #DCE3E9;
  --brand: #2872A1;
  --brand-strong: #1F5A82;
  --brand-soft: rgba(40, 114, 161, 0.1);
  --spend: #D9532C;
  --spend-soft: #FBEDE8;
  --spend-ink: #8A3418;
  --ok: #2E8B5F;
  --ok-soft: #E6F4EC;
  --ok-ink: #1E6B45;
  --warn: #C98404;
  --warn-soft: #FFF2D9;
  --warn-ink: #B4570F;
  --shadow: 0 1px 2px rgba(16, 35, 49, 0.05);
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
}

body.dark-mode {
  --paper: #0F1B24;
  --surface: #172733;
  --surface-2: #1E3241;
  --ink: #E8EEF2;
  --ink-soft: #93A6B3;
  --line: #26394A;
  --brand: #5AA2D1;
  --brand-strong: #7DB7DD;
  --brand-soft: rgba(90, 162, 209, 0.14);
  --spend: #F07A5A;
  --spend-soft: #3A2119;
  --spend-ink: #F6B7A3;
  --ok: #5CC08E;
  --ok-soft: #16352A;
  --ok-ink: #9BE0BD;
  --warn: #E9B44C;
  --warn-soft: #3A2E14;
  --warn-ink: #F2A35E;
  --shadow: none;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
#root { height: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* Icônes dessinées (remplacent les emojis de l'interface) */
.ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ========== AUTH ========== */
.auth-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--paper);
}
.auth-card {
  background: var(--surface); border-radius: 20px; padding: 36px 28px; width: 100%; max-width: 400px;
  border: 1px solid var(--line);
}
.auth-card h1 { text-align: center; margin-bottom: 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.auth-card .subtitle { text-align: center; color: var(--ink-soft); margin-bottom: 28px; font-size: 14px; }
.auth-card .logo { text-align: center; font-size: 44px; margin-bottom: 12px; }

/* ========== FORMULAIRES ========== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.form-input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 16px; background: var(--surface); color: var(--ink);
  transition: border-color 0.15s; outline: none;
}
.form-input:focus { border-color: var(--brand); }
.form-input::placeholder { color: var(--ink-soft); opacity: 0.7; }

.btn {
  padding: 12px 20px; border: none; border-radius: 12px; font-size: 15px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; width: 100%; transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; }
body.dark-mode .btn-primary { color: #0F1B24; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-danger { background: var(--spend); color: #fff; }
.btn-outline-danger { background: transparent; color: var(--spend); border: 1.5px solid var(--spend); }
.btn-outline-danger:hover { background: var(--spend-soft); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; }
.btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: 10px; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-soft); transition: background 0.15s; font-size: 15px;
}
.btn-icon:hover { background: var(--line); }

.auth-link { text-align: center; margin-top: 20px; font-size: 14px; color: var(--ink-soft); }
.auth-link a { color: var(--brand); text-decoration: none; font-weight: 600; cursor: pointer; }
.error-msg { background: var(--spend-soft); color: var(--spend-ink); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; text-align: center; }

.captcha-box {
  background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}
.captcha-question { font-weight: 700; font-size: 18px; white-space: nowrap; color: var(--brand); }
.captcha-box .form-input { width: 80px; text-align: center; padding: 8px; font-weight: 700; }

/* ========== STRUCTURE ========== */
.app-layout { display: flex; flex-direction: column; height: 100vh; }
.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 16px 10px 20px;
  background: var(--paper);
}
.header-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.month-switch { display: flex; align-items: center; gap: 2px; margin-left: -10px; }
.month-switch .month-name {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 132px;
  padding: 6px 8px; border: none; border-radius: 10px; background: none; cursor: pointer;
  font-size: 18px; font-weight: 700; text-transform: capitalize;
}
.month-switch .month-name:hover, .month-switch .month-name:active { background: var(--surface-2); }
.month-switch .month-name .ico { color: var(--ink-soft); }
.icon-btn {
  width: 36px; height: 36px; border: none; border-radius: 10px; background: none;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-soft);
}
.icon-btn:hover { background: var(--surface-2); }
.refresh-btn {
  width: 36px; height: 36px; border: none; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: none; color: var(--ink-soft);
}
.refresh-btn:hover { background: var(--surface-2); }
.refresh-btn.spinning svg { animation: spin 0.6s linear; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.avatar-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 15px;
  display: grid; place-items: center;
}
.avatar-btn.is-active { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--brand); }
.app-content { flex: 1; overflow-y: auto; padding: 4px 20px 110px; }

/* ========== BARRE DU BAS ========== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  padding: 8px 8px max(10px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 0; border: none; background: none; cursor: pointer;
  color: var(--ink-soft); font-size: 11px; font-weight: 600;
}
.nav-item.active { color: var(--brand); }
.nav-add {
  justify-self: center; width: 54px; height: 54px; border: none; border-radius: 18px; cursor: pointer;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(16, 35, 49, 0.22);
  transition: transform 0.1s;
}
.nav-add:active { transform: scale(0.94); }

/* ========== CARTES (pages Charges, Comptes, Calendrier, Réglages) ========== */
.card {
  background: var(--surface); border-radius: 16px; padding: 18px;
  border: 1px solid var(--line); margin-bottom: 14px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-title { font-size: 16px; font-weight: 700; }

.month-selector { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 18px; }
.month-selector button {
  background: none; border: none; cursor: pointer; font-size: 18px; color: var(--brand);
  padding: 8px; border-radius: 10px;
}
.month-selector button:hover { background: var(--brand-soft); }
.month-selector .month-label { font-size: 18px; font-weight: 700; min-width: 180px; text-align: center; }

/* ========== TABLEAU DE BORD ========== */
/* Le reste à vivre et son rythme */
.hero { padding: 10px 0 22px; }
.hero-label { font-size: 15px; color: var(--ink-soft); }
.hero-amount { font-size: 60px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin-top: 2px; }
.hero-amount.is-negative { color: var(--spend); }
/* Le grand chiffre dit l'état du mois : vert s'il tient, orangé si le rythme mène dans le rouge */
.hero-amount.is-ok { color: var(--ok-ink); }
.hero-amount.is-warn { color: var(--warn-ink); }
.hero-cents { font-size: 28px; font-weight: 700; color: var(--ink-soft); letter-spacing: -0.02em; }
.hero-amount.is-negative .hero-cents, .hero-amount.is-ok .hero-cents, .hero-amount.is-warn .hero-cents { color: inherit; opacity: 0.7; }
.hero-daily { font-size: 16px; margin-top: 6px; color: var(--ink-soft); }
.hero-daily strong { color: var(--ink); font-weight: 700; }

.salary-prompt {
  margin: 4px 0 18px; padding: 16px; border-radius: 16px; background: var(--brand-soft);
}
.salary-prompt p { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .form-input { flex: 1; }
.inline-form .btn { width: auto; flex-shrink: 0; }

.pace { margin-top: 36px; }
.pace-track { position: relative; height: 12px; border-radius: 6px; background: var(--line); }
.pace-spent {
  position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--spend);
  transition: width 0.5s var(--ease-out);
}
.pace-spent.is-calm { background: var(--brand); }
.pace-today {
  position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px;
  border-radius: 2px; background: var(--ink);
}
.pace-today span {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pace-legend {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 12px;
  font-size: 13px; color: var(--ink-soft);
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot-spent { background: var(--spend); }
.dot-spent.is-calm { background: var(--brand); }
.dot-time { background: var(--ink); }
.pace-verdict { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.pace-verdict.is-warn { background: var(--spend-soft); color: var(--spend-ink); }
.pace-verdict.is-ok { background: var(--ok-soft); color: var(--ok-ink); }

/* Revenus · charges · dépenses : trois chiffres qui ouvrent le détail */
.split {
  display: grid; grid-template-columns: repeat(3, 1fr); width: 100%;
  padding: 14px 0; border: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: none; cursor: pointer; text-align: left;
}
.split-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.split-item + .split-item { padding-left: 14px; border-left: 1px solid var(--line); }
.split-value { font-size: 17px; font-weight: 700; white-space: nowrap; }
.split-value.is-income { color: var(--ok); }
.split-value.is-spend { color: var(--spend); }
.split-label { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 4px; }
.split-label .ico { transition: transform 0.2s var(--ease-out); }
.split.is-open .split-label .ico { transform: rotate(180deg); }

.detail { padding: 6px 0 4px; border-bottom: 1px solid var(--line); }
.detail-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 15px; }
.detail-row + .detail-row { border-top: 1px dashed var(--line); }
.detail-name { flex: 1; min-width: 0; }
.detail-amount { font-weight: 700; white-space: nowrap; }
.detail-amount.is-plus { color: var(--ok); }
.detail-amount.is-minus { color: var(--spend-ink); }
.detail-total { font-weight: 800; }
.detail-actions { display: flex; gap: 6px; }
.detail-actions .btn-icon { width: 32px; height: 32px; }
.detail-sub { color: var(--ink-soft); font-size: 14px; }
.detail-add { margin: 4px 0 8px; }

/* Fil des dépenses, groupé par jour */
.feed { margin-top: 18px; }
.feed-head { display: flex; justify-content: space-between; align-items: baseline; }
.feed-title { font-size: 17px; font-weight: 700; }
.feed-count { font-size: 13px; color: var(--ink-soft); }
.feed-day { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 16px 0 6px; }
.feed-day::first-letter { text-transform: uppercase; }
.rows { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; border: none; background: none; cursor: pointer; text-align: left;
}
.rows li + li .row { border-top: 1px solid var(--line); }
.row:active { background: var(--surface-2); }
.glyph {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--brand-soft); color: var(--brand);
}
.glyph.is-planned { background: var(--warn-soft); color: var(--warn); }
/* Six teintes, attribuées par nom (voir glyphTint) */
.glyph.tint-0 { background: #E2EDF6; color: #2872A1; }
.glyph.tint-1 { background: #E3F1E9; color: #23704B; }
.glyph.tint-2 { background: #F1E6F7; color: #7B3A91; }
.glyph.tint-3 { background: #FDEBDD; color: #A04A12; }
.glyph.tint-4 { background: #FBE4EC; color: #A3305E; }
.glyph.tint-5 { background: #DDF2F2; color: #1D6E73; }
body.dark-mode .glyph.tint-0 { background: #1B3447; color: #8CC3E8; }
body.dark-mode .glyph.tint-1 { background: #173528; color: #8FD6AE; }
body.dark-mode .glyph.tint-2 { background: #2E2140; color: #C9A2E0; }
body.dark-mode .glyph.tint-3 { background: #3A2716; color: #F1B27E; }
body.dark-mode .glyph.tint-4 { background: #3A1E2A; color: #EFA0BE; }
body.dark-mode .glyph.tint-5 { background: #16343A; color: #87D3D6; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-size: 12px; color: var(--ink-soft); }
.row-amount { font-size: 15px; font-weight: 700; white-space: nowrap; color: var(--spend); }
.row-amount.is-planned { color: var(--warn); }
.feed-empty { padding: 28px 16px; text-align: center; color: var(--ink-soft); font-size: 14px; }

/* ========== FEUILLES (ajout rapide, modification) ========== */
.sheet-layer {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(16, 35, 49, 0.42); animation: fade-in 0.2s ease-out;
}
.sheet {
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 20px max(22px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0; background: var(--surface);
  display: flex; flex-direction: column; align-items: stretch;
  animation: sheet-up 0.32s var(--ease-out);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; flex-shrink: 0; }
.sheet-title { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 14px; }
.sheet-amount { text-align: center; font-size: 52px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.sheet-amount.is-empty { color: var(--ink-soft); }
.sheet-amount span { font-size: 28px; color: var(--ink-soft); }
.sheet-name {
  margin: 10px auto 0; width: 100%; text-align: center; border: none; border-bottom: 1px solid var(--line);
  background: none; color: var(--ink); font: inherit; font-size: 18px; font-weight: 600; padding: 6px 0; outline: none;
}
.sheet-name:focus { border-color: var(--brand); }
.chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.chip {
  padding: 7px 12px; border-radius: 999px; border: 1px dashed var(--line); background: none;
  font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.segmented { display: flex; margin-top: 14px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.segmented button {
  flex: 1; padding: 8px 0; border: none; border-radius: 9px; background: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.segmented button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 35, 49, 0.12); }
.sheet-date { margin-top: 10px; }
.check-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 8px; }
.key {
  padding: 12px 0; border: none; background: none; border-radius: 12px; cursor: pointer;
  font-size: 24px; font-weight: 600; color: var(--ink); display: grid; place-items: center;
}
.key:active { background: var(--surface-2); }
.sheet-error { margin-top: 10px; text-align: center; font-size: 13px; color: var(--spend); }
.sheet-cta { margin-top: 8px; padding: 15px; font-size: 17px; border-radius: 16px; }
.sheet-cta:disabled { opacity: 0.45; cursor: default; }
.sheet-fields { display: flex; flex-direction: column; gap: 12px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ========== BILAN ========== */
.trend { display: inline-block; margin-top: 12px; padding: 7px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.trend.is-ok { background: var(--ok-soft); color: var(--ok-ink); }
.trend.is-warn { background: var(--spend-soft); color: var(--spend-ink); }
.bilan-chart { margin: 4px 0 0; }
.bilan-chart svg { width: 100%; height: auto; overflow: visible; }
.chart-zero { stroke: var(--line); stroke-width: 1; }
.chart-bar { fill: var(--brand); }
.chart-bar.is-best { fill: var(--ok); }
.chart-bar.is-neg { fill: var(--spend); }
.chart-bar.is-current { fill: none; stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 3 3; }
.chart-avg { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart-axis { fill: var(--ink-soft); font-size: 11px; font-weight: 600; text-anchor: middle; }
.chart-axis.is-current { fill: var(--brand); }
.chart-cap { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.split-static { margin-top: 16px; cursor: default; }
.split-value.is-ok { color: var(--ok); }
.split-value.is-neg { color: var(--spend); }
.bilan-row { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 12px 14px; border: none; background: none; cursor: pointer; text-align: left; }
.bilan-rows li + li .bilan-row { border-top: 1px solid var(--line); }
.bilan-row:active { background: var(--surface-2); }
.bilan-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bilan-name { font-size: 15px; font-weight: 600; text-transform: capitalize; }
.bilan-rest { font-size: 15px; font-weight: 700; color: var(--ok); white-space: nowrap; }
.bilan-rest.is-neg { color: var(--spend); }
.bilan-missing { font-size: 13px; color: var(--ink-soft); }
.bilan-bar { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); }
.bilan-fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--brand); }
.bilan-fill.is-high { background: var(--spend); }
.bilan-avg { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); }
.bilan-meta { font-size: 12px; color: var(--ink-soft); }

/* Récap d'un mois (feuille ouverte depuis le Bilan) */
.recap-title { text-align: left; font-size: 20px; text-transform: capitalize; margin-bottom: 8px; }
.recap-head { margin-bottom: 16px; }
.recap-amount { font-size: 44px; }
.recap-amount .hero-cents { font-size: 22px; }
.recap-missing { font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; }
.recap-feed { flex-shrink: 0; }
.row.is-static { cursor: default; }
.row.is-static:active { background: none; }
.recap-edit { margin-top: 16px; flex-shrink: 0; }

/* Choix du mois */
.year-switch { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.year-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.month-cell {
  padding: 14px 4px; border: 1.5px solid transparent; border-radius: 12px; cursor: pointer;
  background: var(--surface-2); font-size: 15px; font-weight: 600; color: var(--ink);
}
.month-cell.is-today { border-color: var(--brand); }
.month-cell.is-selected { background: var(--ink); color: var(--paper); }
.month-today { margin-top: 12px; }

/* ========== PAGE CHARGES ========== */
.category-section { margin-bottom: 12px; }
.category-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; cursor: pointer;
}
.category-left { display: flex; align-items: center; gap: 10px; }
.category-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.category-name { font-weight: 700; font-size: 15px; }
.category-right { display: flex; align-items: center; gap: 12px; }
.category-total { font-weight: 700; font-size: 15px; color: var(--ink); }
.category-arrow { font-size: 14px; color: var(--ink-soft); transition: transform 0.2s; }
.category-arrow.open { transform: rotate(180deg); }
.category-charges { padding: 8px 6px 14px; margin-top: 4px; }
.charge-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px; border-radius: 10px; }
.charge-item:hover { background: var(--surface-2); }
.charge-name { font-size: 14px; flex: 1; }
.charge-amount { font-weight: 700; font-size: 14px; margin-right: 8px; }
.charge-actions { display: flex; gap: 4px; }
.charge-actions button {
  width: 30px; height: 30px; border: none; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink-soft);
}
.charge-actions button:hover { background: var(--line); }
.charge-actions button.delete:hover { background: var(--spend-soft); color: var(--spend); }
.add-charge-form { display: flex; gap: 8px; padding: 12px; background: var(--surface-2); border-radius: 12px; margin-top: 8px; }
.add-charge-form .form-input { padding: 8px 12px; font-size: 14px; border-radius: 10px; }

/* ========== LISTES DE DÉPENSES (calendrier) ========== */
.expense-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.expense-item:last-child { border-bottom: none; }
.expense-info { flex: 1; }
.expense-name { font-weight: 600; font-size: 14px; }
.expense-date { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.expense-amount { font-weight: 700; font-size: 15px; color: var(--ink); margin-right: 8px; }
.expense-planned {
  display: inline-block; background: var(--warn-soft); color: var(--warn); padding: 2px 8px;
  border-radius: 6px; font-size: 11px; font-weight: 600; margin-left: 8px;
}

/* ========== CALENDRIER ========== */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar-header-cell { text-align: center; font-size: 11px; font-weight: 600; color: var(--ink-soft); padding: 6px 0; }
.calendar-day {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 500;
  border: 2px solid transparent; padding: 6px 2px 4px; min-height: 48px; gap: 2px;
}
.calendar-day:hover { background: var(--surface-2); }
.calendar-day.today { border-color: var(--brand); font-weight: 700; }
.calendar-day.other-month { color: var(--line); }
.calendar-day-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.calendar-day-dot.real { background: var(--brand); }
.calendar-day-dot.planned { background: var(--warn); }
.calendar-day-amount { font-size: 9px; color: var(--spend); font-weight: 700; line-height: 1; white-space: nowrap; }

/* ========== MODALES (pages existantes) ========== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(16, 35, 49, 0.45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface); border-radius: 20px; padding: 22px; width: 100%; max-width: 440px;
  max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-soft);
}

/* ========== RÉGLAGES ========== */
.settings-item { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line); }
.settings-item:last-child { border-bottom: none; }
.settings-label { font-weight: 600; font-size: 14px; }
.settings-desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.toggle { width: 48px; height: 28px; background: var(--line); border-radius: 14px; position: relative; cursor: pointer; transition: background 0.2s; border: none; }
.toggle.active { background: var(--brand); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  background: #fff; border-radius: 50%; transition: transform 0.2s var(--ease-out);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}
.toggle.active::after { transform: translateX(20px); }

/* ========== ÉTAT VIDE ========== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.empty-state .icon { font-size: 44px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ========== PETITS ÉCRANS ========== */
@media (max-width: 380px) {
  .app-content { padding-left: 16px; padding-right: 16px; }
  .hero-amount { font-size: 52px; }
  .split-value { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
