/* ==========================================================================
   Mosolo Cash — Espace membre
   Direction : tableau de bord fintech clair (gris perle, cartes blanches très
   arrondies, vert lime en accent, vert profond pour les actions).
   Règles : grille 8 pt · 60/30/10 · 4 tailles de texte · chiffres tabulaires ·
   actions principales dans la zone du pouce (barre d'onglets sur mobile).
   ========================================================================== */
:root {
  /* 60 % neutre */
  --bg: #e9eae6;
  --canvas: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #f6f7f3;
  --line: #ecede8;
  /* 30 % complément */
  --ink: #111410;
  --ink-2: rgba(17, 20, 16, .8);
  --muted: rgba(17, 20, 16, .5);
  /* 10 % accent */
  --lime: #b8ee76;
  --lime-2: #cff59f;
  --lime-3: #e6f9cf;
  --forest: #1c4a1d;
  --forest-2: #143814;
  --primary: var(--forest);
  --primary-600: var(--forest-2);
  --primary-700: #1c4a1d;
  --primary-50: #eef9e0;
  --primary-100: #dff4c4;
  --primary-rgb: 28, 74, 29;
  /* sens */
  --success: #17a34a;
  --success-50: #e3f7e9;
  --danger: #e5484d;
  --danger-50: #fdeaea;
  --warning: #f97316;
  --warning-50: #fff1e6;
  --info: #3b6fe0;
  --info-50: #e9effc;
  --violet: #7c5cf0;
  --violet-50: #efebfd;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --sh-sm: 0 1px 2px rgba(28, 40, 20, .04);
  --sh-md: 0 16px 32px -16px rgba(28, 40, 20, .18);
  --sh-primary: inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 20px -10px rgba(28, 74, 29, .55);
  --tabbar: 72px;
  --font: "Urbanist", "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  /* 4 tailles */
  --t-xs: .78rem;
  --t-sm: .92rem;
  --t-lg: 1.25rem;
  --t-xl: clamp(2.25rem, 6vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; font-size: var(--t-sm); -webkit-font-smoothing: antialiased; font-weight: 500; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid rgba(28, 74, 29, .35); outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes pop { 0% { transform: scale(.92); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(184, 238, 118, .7); } 50% { box-shadow: 0 0 0 12px rgba(184, 238, 118, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes drawRing { from { stroke-dashoffset: var(--len); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* --- Ossature : toile arrondie centrée, navigation en pilules ------------------------- */
.shell { min-height: 100vh; padding: 24px; }
.frame { max-width: 1280px; margin: 0 auto; background: var(--canvas); border-radius: var(--r-xl); min-height: calc(100vh - 48px); padding: 24px 32px 48px; box-shadow: 0 30px 60px -40px rgba(28, 40, 20, .35); }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.greet { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; background: linear-gradient(145deg, var(--lime), #8fd65a); color: var(--forest); box-shadow: 0 0 0 3px #fff; }
.greet h1 { font-size: 1.6rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.greet small { display: block; font-size: var(--t-xs); color: var(--muted); font-weight: 600; }
.topnav { margin: 0 auto; display: flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: 999px; box-shadow: var(--sh-sm); }
.topnav a { padding: 8px 16px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: var(--t-sm); transition: background .2s, color .2s; white-space: nowrap; }
.topnav a:hover { color: var(--ink); }
.topnav a.active { background: var(--lime); color: var(--forest); }
.top-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.pill-btn { height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--surface); border: 0; box-shadow: var(--sh-sm); cursor: pointer; font-weight: 700; color: var(--ink); position: relative; }
.pill-btn .dot { position: absolute; top: 10px; left: 24px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 24px; flex-wrap: wrap; }
.page-title h2 { font-size: var(--t-lg); font-weight: 600; }
.content { animation: fadeUp .35s ease both; }
.tabbar, .mobile-only { display: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface); border: 0; cursor: pointer; color: var(--ink); box-shadow: var(--sh-sm); position: relative; }
.icon-btn.soft { background: var(--surface-2); box-shadow: none; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* --- Boutons (pilules) -------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 600; font-size: var(--t-sm); cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary, .btn-dark { background: var(--forest); color: #fff; box-shadow: var(--sh-primary); }
.btn-primary:hover, .btn-dark:hover { background: var(--forest-2); }
.btn-lime { background: var(--lime); color: var(--forest); }
.btn-lime:hover { background: var(--lime-2); }
.btn-light { background: transparent; border-color: var(--forest); color: var(--forest); }
.btn-light:hover { background: var(--primary-50); }
.btn-ghost { background: transparent; color: var(--forest); }
.btn-ghost:hover { background: var(--primary-50); }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1ebe5a; }
.btn-danger { background: var(--danger-50); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: var(--t-xs); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }
.btn.is-busy::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.round-cta { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--forest); font-size: 1.4rem; transition: transform .2s; flex: none; }
.round-cta:hover { transform: rotate(-12deg) scale(1.05); }

/* --- Cartes -------------------------------------------------------------------------------- */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 24px 24px 16px; }
.card-head h2 { font-size: var(--t-lg); font-weight: 600; flex: 1; }
.card-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); color: var(--ink); flex: none; background: var(--surface); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 32px 0 16px; }
.section-title h2 { font-size: var(--t-lg); font-weight: 600; }
.section-title a { color: var(--forest); font-weight: 700; font-size: var(--t-sm); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > *, .frame > *, .shell > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: var(--t-sm); }
.tiny { font-size: var(--t-xs); }
.strong { font-weight: 700; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }
.num, .amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.fade-in > * { animation: fadeUp .45s ease both; }
.fade-in > *:nth-child(2) { animation-delay: .05s; }
.fade-in > *:nth-child(3) { animation-delay: .1s; }
.fade-in > *:nth-child(4) { animation-delay: .15s; }

/* --- Rangée héro du tableau de bord ------------------------------------------------ */
.dash-top { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.dash-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.balance { padding: 24px; display: flex; flex-direction: column; gap: 24px; min-height: 272px; position: relative; }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; }
.seg button { border: 0; background: transparent; padding: 6px 16px; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.seg .flag { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .6rem; background: var(--forest); color: var(--lime); font-weight: 800; }
.acct { text-align: right; }
.acct small { display: block; font-size: var(--t-xs); color: var(--muted); }
.acct b { font-size: var(--t-lg); font-weight: 600; letter-spacing: .02em; display: inline-flex; gap: 8px; align-items: center; }
.acct button { border: 0; background: none; cursor: pointer; color: var(--muted); }
.big-label { font-size: var(--t-sm); color: var(--muted); font-weight: 600; }
.big-amount { font-size: var(--t-xl); font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.05; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.big-amount .cur { font-size: .45em; color: var(--muted); font-weight: 600; }
.masked .amount-value { filter: blur(10px); user-select: none; }
.balance-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: auto; flex-wrap: wrap; }

.lime-card { background: var(--lime); border-radius: var(--r-lg); padding: 24px; position: relative; overflow: hidden; color: var(--forest); display: flex; flex-direction: column; gap: 16px; min-height: 272px; }
.lime-card::after { content: ""; position: absolute; right: -40px; top: -30px; width: 220px; height: 220px; background: rgba(255, 255, 255, .22); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.lime-card > * { position: relative; z-index: 1; }
.tag-dark { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 16px; border-radius: 999px; background: var(--forest); color: var(--lime); font-weight: 700; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; }
.tag-dark i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--forest); }
.lime-amount { font-size: clamp(1.9rem, 4.6vw, 2.6rem); font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chip-white { background: #fff; color: var(--success); font-size: var(--t-xs); font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; }
.tile { background: rgba(255, 255, 255, .45); border-radius: var(--r-md); padding: 12px 16px; }
.tile small { display: flex; justify-content: space-between; font-size: var(--t-xs); font-weight: 600; opacity: .8; }
.tile b { display: flex; align-items: center; gap: 8px; font-size: var(--t-lg); font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Anneau segmenté (progression) */
.donut { position: relative; width: 200px; height: 200px; margin: 8px auto 16px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 14; stroke-linecap: round; }
.donut .track { stroke: #e6e8e2; }
.donut .val { stroke: var(--lime); animation: drawRing 1.1s ease-out both; }
.donut .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .center b { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.donut .center small { font-size: var(--t-xs); font-weight: 700; }
.hint-pill { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 auto 16px; width: fit-content; padding: 6px 16px; border-radius: 999px; border: 1.5px solid var(--line); font-size: var(--t-xs); font-weight: 600; }
.legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: var(--t-xs); }
.legend-grid span { display: flex; align-items: center; gap: 8px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-grid span.on { color: var(--ink); font-weight: 700; }
.month-pill { padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 600; font-size: var(--t-xs); background: var(--surface); }
.goal { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; font-weight: 700; }
.goal .line { width: 72px; height: 6px; border-radius: 99px; background: var(--warning); }
.prog-list { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.prog-item .top { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t-xs); color: var(--muted); margin-bottom: 8px; }
.prog-item .top b { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.prog-item.on .top span { color: var(--ink); font-weight: 700; }
.prog-item.on .top b { color: var(--ink); }

/* Barres de progression */
.bar { height: 10px; background: #e9ebe5; border-radius: 999px; overflow: visible; position: relative; }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--lime); transition: width .8s ease; position: relative; }
.bar span[data-p]::after { content: attr(data-p); position: absolute; right: -4px; top: 50%; transform: translateY(-50%); background: var(--forest); color: var(--lime); font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.bar.ok span { background: #8fd65a; }
.bar-legend { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--muted); margin-top: 8px; gap: 8px; }

/* --- Héro générique (pages secondaires) -------------------------------------------- */
.hero { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--lime); color: var(--forest); padding: 24px; }
.hero::after { content: ""; position: absolute; right: -50px; top: -40px; width: 200px; height: 200px; background: rgba(255, 255, 255, .25); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.hero > * { position: relative; z-index: 1; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hero-hello { font-size: var(--t-sm); opacity: .75; }
.hero-name { font-size: var(--t-lg); font-weight: 700; }
.hero-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .55); font-size: var(--t-xs); font-weight: 700; }
.hero-label { margin-top: 16px; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; display: flex; align-items: center; gap: 8px; opacity: .85; }
.hero-amount { font-size: var(--t-xl); font-weight: 500; font-variant-numeric: tabular-nums; }
.hero-secondary { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 16px; }
.hero-secondary div { font-size: var(--t-xs); opacity: .85; }
.hero-secondary strong { display: block; font-size: var(--t-sm); font-variant-numeric: tabular-nums; opacity: 1; }
.eye { background: rgba(0, 0, 0, .05); border: 0; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; color: var(--ink); display: grid; place-items: center; }

/* Actions rapides */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: var(--r-md); background: var(--surface); font-weight: 600; font-size: var(--t-xs); text-align: center; transition: transform .2s, box-shadow .2s; box-shadow: var(--sh-sm); }
.quick a:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.quick i { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; }
.qi-orange { background: var(--warning-50); color: var(--warning); }
.qi-green { background: var(--lime-3); color: var(--forest); }
.qi-violet { background: var(--violet-50); color: var(--violet); }
.qi-blue { background: var(--info-50); color: var(--info); }

/* Bandeaux */
.banner { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--r-md); margin-top: 16px; }
.banner i.lead { font-size: 1.2rem; }
.banner .grow { flex: 1; }
.banner-danger { background: var(--danger-50); color: #9f1d22; }
.banner-warning { background: var(--warning-50); color: #9a3d07; }
.banner-info { background: var(--info-50); color: #1f3f8f; }
.banner-success { background: var(--lime-3); color: var(--forest); }

/* Cartes d'épargne */
.saving { padding: 24px; display: flex; flex-direction: column; gap: 16px; transition: transform .2s, box-shadow .2s; }
.saving:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.saving-head { display: flex; align-items: center; gap: 12px; }
.saving-head h3 { font-size: var(--t-sm); font-weight: 700; }
.saving-type { font-size: var(--t-xs); color: var(--muted); font-weight: 600; }
.ring { --p: 0; --size: 64px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--lime) calc(var(--p) * 1%), #e9ebe5 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-size: var(--t-xs); font-weight: 700; }
.ring.ok { background: conic-gradient(#8fd65a calc(var(--p) * 1%), #e9ebe5 0); }
.ring.lg { --size: 104px; }
.ring.lg::before { inset: 10px; }
.ring.lg span { font-size: var(--t-lg); }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.kv div { background: var(--surface-2); border-radius: var(--r-sm); padding: 12px; min-width: 0; }
.kv dt { font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kv dd { margin: 4px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--lime-3); color: var(--forest); font-size: var(--t-xs); font-weight: 700; }
.next.late { background: var(--danger-50); color: var(--danger); }

.turn { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 24px; color: #fff; background: var(--forest); }
.turn::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(184, 238, 118, .5), transparent 70%); }
.turn > * { position: relative; }
.turn .big { font-size: var(--t-lg); font-weight: 700; color: var(--lime); margin: 4px 0; }

/* --- Listes d'opérations -------------------------------------------------------------- */
.list { display: flex; flex-direction: column; padding: 0 12px 12px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); border-bottom: 1px solid var(--line); transition: background .15s; }
.item:last-child { border-bottom: 0; }
a.item:hover, button.item:hover { background: var(--surface-2); }
button.item { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.item.pending { border: 1.5px solid #fdba74; background: #fffaf5; margin: 4px 0; }
.item.pending .item-sub { color: var(--warning); font-weight: 600; }
.item-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 1rem; border: 1.5px solid var(--line); background: var(--surface); }
.item-body { flex: 1; min-width: 0; }
.item-title { font-weight: 600; font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: var(--t-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.item-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.item.unread .item-title::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-left: 8px; vertical-align: middle; }
.mini-actions { display: flex; gap: 8px; }
.mini-actions span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--forest); font-size: .8rem; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.b-success { background: var(--lime-3); color: var(--forest); }
.b-danger { background: var(--danger-50); color: var(--danger); }
.b-warning { background: var(--warning-50); color: var(--warning); }
.b-info { background: var(--info-50); color: var(--info); }
.b-primary { background: var(--surface-2); color: var(--ink); }
.b-muted { background: var(--surface-2); color: var(--muted); }
.b-violet { background: var(--violet-50); color: var(--violet); }

/* --- Calendrier ------------------------------------------------------------------------ */
.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.cal-day { aspect-ratio: 1; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .7rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.cal-day b { font-size: var(--t-sm); color: var(--ink); }
.cal-day.payee { background: var(--lime); color: var(--forest); }
.cal-day.payee b { color: var(--forest); }
.cal-day.partielle { background: linear-gradient(135deg, var(--lime) 50%, var(--surface-2) 50%); }
.cal-day.en_retard { background: var(--danger-50); color: var(--danger); }
.cal-day.en_retard b { color: var(--danger); }
.cal-day.reportee { background: var(--info-50); color: var(--info); }
.cal-day.annulee { opacity: .45; text-decoration: line-through; }
.cal-day.today { box-shadow: 0 0 0 2px var(--forest); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: var(--t-xs); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* --- Formulaires ---------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field label, .label { display: block; font-size: var(--t-xs); font-weight: 700; margin-bottom: 8px; color: var(--ink-2); }
.control { position: relative; }
.control > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input { width: 100%; min-height: 52px; padding: 12px 16px 12px 44px; border: 1.5px solid transparent; border-radius: var(--r-md); background: var(--surface-2); transition: border-color .2s, box-shadow .2s, background .2s; font-size: var(--t-sm); font-weight: 600; }
textarea.input { padding: 16px; min-height: 120px; resize: vertical; }
.control.no-icon .input { padding-left: 16px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231c4a1d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.input:focus { outline: none; background: var(--surface); border-color: var(--forest); box-shadow: 0 0 0 4px rgba(184, 238, 118, .45); }
.input.is-invalid { border-color: var(--danger); background: #fff; }
.hint { font-size: var(--t-xs); color: var(--muted); margin-top: 8px; }
.error { font-size: var(--t-xs); color: var(--danger); margin-top: 8px; font-weight: 700; }
.toggle-pass { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 50%; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--t-sm); color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--forest); flex: none; margin-top: 2px; }
.amount-input { font-size: 2rem; font-weight: 600; min-height: 72px; padding-left: 52px; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 16px; border-radius: 999px; border: 0; background: var(--surface); font-weight: 600; font-size: var(--t-xs); cursor: pointer; color: var(--muted); box-shadow: var(--sh-sm); }
.chip.active, .chip:hover { background: var(--lime); color: var(--forest); }
.choices { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer; background: var(--surface); transition: border-color .2s, background .2s; }
.choice input { accent-color: var(--forest); width: 18px; height: 18px; }
.choice:has(input:checked) { border-color: var(--forest); background: var(--lime-3); }

/* --- Authentification ------------------------------------------------------------------ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px; }
.auth-hero { background: var(--forest); color: #fff; padding: 48px; border-radius: var(--r-xl); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::before { content: ""; position: absolute; width: 420px; height: 420px; right: -140px; top: -120px; background: rgba(184, 238, 118, .16); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.auth-hero > * { position: relative; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: var(--t-lg); }
.brand img { width: 40px; height: 40px; object-fit: contain; }
.brand b { color: var(--lime); font-weight: 700; }
.brand small { display: block; font-size: var(--t-xs); color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.auth-hero .brand small { color: rgba(255, 255, 255, .6); }
.auth-hero .logo-tile { background: #fff; border-radius: 50%; padding: 6px; }
.auth-hero h1 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 500; letter-spacing: -.03em; max-width: 560px; }
.auth-hero h1 em { font-style: normal; color: var(--lime); }
.auth-hero p.lead { color: rgba(255, 255, 255, .72); max-width: 480px; margin-top: 16px; }
.perks { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 12px; }
.perks li { display: flex; gap: 12px; align-items: center; color: rgba(255, 255, 255, .86); }
.perks i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--forest); }
.mock-card { margin-top: 32px; max-width: 380px; border-radius: var(--r-lg); padding: 24px; background: var(--lime); color: var(--forest); }
.mock-card .bar { background: rgba(255, 255, 255, .5); }
.mock-card .bar span { background: var(--forest); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: var(--canvas); border-radius: var(--r-xl); }
.auth-box { width: 100%; max-width: 440px; animation: pop .35s ease both; }
.auth-box h2 { font-size: 2rem; font-weight: 600; }
.auth-box .sub { color: var(--muted); margin: 8px 0 24px; }
.auth-switch { text-align: center; margin-top: 24px; color: var(--muted); }
.auth-switch a { color: var(--forest); font-weight: 700; }
.steps { display: flex; gap: 8px; margin-bottom: 16px; }
.steps span { flex: 1; height: 6px; border-radius: 99px; background: var(--line); }
.steps span.on { background: var(--lime); }

/* --- Reçu (ticket) ------------------------------------------------------------------- */
.ticket { max-width: 480px; margin: 0 auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-md); overflow: hidden; }
.ticket-head { background: var(--lime); color: var(--forest); padding: 32px 24px 24px; text-align: center; position: relative; overflow: hidden; }
.ticket-check { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; background: var(--forest); color: var(--lime); animation: glow 2.4s infinite; position: relative; }
.ticket-amount { font-size: 2.4rem; font-weight: 600; font-variant-numeric: tabular-nums; position: relative; }
.ticket-cut { height: 24px; position: relative; background: radial-gradient(circle at 0 50%, var(--canvas) 12px, transparent 13px) left / 50% 100% no-repeat, radial-gradient(circle at 100% 50%, var(--canvas) 12px, transparent 13px) right / 50% 100% no-repeat; }
.ticket-cut::after { content: ""; position: absolute; left: 24px; right: 24px; top: 50%; border-top: 2px dashed var(--line); }
.ticket-body { padding: 8px 24px 24px; }
.ticket-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); font-size: var(--t-sm); }
.ticket-row span:first-child { color: var(--muted); }
.ticket-row span:last-child { font-weight: 700; text-align: right; }
.verif { margin-top: 16px; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); text-align: center; }
.verif .code { font-size: 1.5rem; font-weight: 700; letter-spacing: .25em; color: var(--forest); font-family: ui-monospace, Menlo, Consolas, monospace; }

/* --- États ---------------------------------------------------------------------------- */
.empty { text-align: center; padding: 40px 24px; color: var(--muted); }
.empty .empty-ico { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--lime-3); color: var(--forest); font-size: 1.6rem; }
.empty h3 { color: var(--ink); font-size: var(--t-sm); font-weight: 700; margin-bottom: 4px; }
.skeleton { border-radius: var(--r-lg); background: linear-gradient(90deg, #eceee8 25%, #f6f7f3 37%, #eceee8 63%); background-size: 800px 100%; animation: shimmer 1.3s infinite linear; }
.sk-hero { height: 272px; }
.sk-line { height: 80px; margin-top: 16px; }
.error-page { max-width: 520px; margin: 40px auto; text-align: center; }

/* --- Toasts & fiches ----------------------------------------------------------------- */
.toasts { position: fixed; z-index: 100; right: 24px; top: 24px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--r-md); background: var(--forest); color: #fff; box-shadow: var(--sh-md); animation: pop .25s ease both; }
.toast i { margin-top: 3px; color: var(--lime); }
.toast.error { background: #3a1214; }
.toast.error i { color: #ff9b9e; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(17, 20, 16, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 24px; animation: fadeUp .2s ease both; }
.sheet { width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: var(--r-lg); animation: pop .25s ease both; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 24px 24px 16px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet-head h2 { flex: 1; font-size: var(--t-lg); }
.sheet-body { padding: 0 24px 24px; }
.grabber { display: none; }

.note { padding: 16px; border-radius: var(--r-md); background: var(--surface-2); font-size: var(--t-sm); color: var(--ink-2); }
.note strong { color: var(--ink); }
.simu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.simu div { padding: 16px; border-radius: var(--r-md); background: var(--lime-3); text-align: center; }
.simu b { display: block; font-size: var(--t-lg); color: var(--forest); font-variant-numeric: tabular-nums; font-weight: 700; }
.simu span { font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.timeline-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.timeline-steps span { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: .72rem; font-weight: 700; color: var(--muted); }
.timeline-steps span.done { background: var(--lime); color: var(--forest); }
.timeline-steps span.current { background: var(--forest); color: var(--lime); }
details.faq { border-bottom: 1px solid var(--line); padding: 16px 0; }
details.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::after { content: "+"; color: var(--forest); font-weight: 800; }
details.faq[open] summary::after { content: "−"; }
details.faq p { margin-top: 8px; color: var(--muted); }
.footer-note { text-align: center; color: var(--muted); font-size: var(--t-xs); margin-top: 32px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .dash-row { grid-template-columns: 1fr 1fr; }
  .dash-row > :last-child { grid-column: 1 / -1; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topnav a { padding: 8px 12px; }
}
@media (max-width: 900px) {
  .shell { padding: 0; }
  .frame { border-radius: 0; padding: 16px 16px calc(var(--tabbar) + 32px); min-height: 100vh; box-shadow: none; }
  .topnav, .desktop-only { display: none; }
  .mobile-only { display: initial; }
  .greet h1 { font-size: var(--t-lg); }
  .avatar { width: 44px; height: 44px; }
  .dash-top, .dash-row, .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .dash-row > :last-child { grid-column: auto; }
  .balance, .lime-card { min-height: 0; }
  .quick { gap: 8px; }
  .quick a { padding: 12px 4px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 50; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); height: var(--tabbar); background: var(--forest); border-radius: 999px; padding: 0 8px; box-shadow: 0 16px 32px -12px rgba(20, 56, 20, .6); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: .68rem; font-weight: 600; color: rgba(255, 255, 255, .6); }
  .tabbar a i { font-size: 1.1rem; }
  .tabbar a.active { color: var(--lime); }
  .tabbar a.fab, .tabbar a.fab.active { width: 56px; height: 56px; margin: auto; border-radius: 50%; background: var(--lime); color: var(--forest); font-size: 0; }
  .tabbar a.fab i { font-size: 1.3rem; }
  .auth { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .auth-hero { border-radius: 0 0 var(--r-xl) var(--r-xl); padding: 24px; }
  .auth-hero .mock-card, .auth-hero .perks { display: none; }
  .auth-hero h1 { font-size: 1.75rem; margin-top: 16px; }
  .auth-form { border-radius: 0; background: transparent; }
  .sheet-backdrop { place-items: end center; padding: 0; }
  .sheet { max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sheetUp .28s cubic-bezier(.2, .8, .2, 1) both; padding-bottom: env(safe-area-inset-bottom); }
  .grabber { display: block; width: 44px; height: 5px; border-radius: 99px; background: #d4d7cf; margin: 8px auto 0; }
  .toasts { left: 16px; right: 16px; top: 16px; max-width: none; }
  .card-pad, .balance, .lime-card, .saving { padding: 16px; }
  .card-head { padding: 16px 16px 8px; }
  .list { padding: 0 4px 8px; }
}
@media (max-width: 420px) {
  .kv { grid-template-columns: 1fr 1fr; }
  .simu div { padding: 12px 4px; }
  .simu b { font-size: 1rem; }
  .simu span { font-size: .62rem; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .legend-grid { grid-template-columns: 1fr; }
}
@media print {
  .topbar, .tabbar, .no-print, .toasts { display: none !important; }
  .shell, .frame { padding: 0; background: #fff; box-shadow: none; }
  .ticket { box-shadow: none; border: 1px solid #ccc; }
}
.big-amount .eye { font-size: 1rem; flex: none; }
.acct button { font-size: .9rem; padding: 4px; }
@media (max-width: 900px) { .balance-actions .round-cta { display: none; } }

/* --- Listes déroulantes Mosolo Cash (remplacent le menu natif) ------------------------ */
.cs-native { position: absolute !important; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.cs { position: relative; }
.cs-trigger { display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; padding-right: 16px; }
.cs-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-placeholder { color: var(--muted); }
.cs-caret { position: static !important; transform: none !important; color: var(--forest) !important; transition: transform .2s; font-size: .8rem; }
.cs.open .cs-caret { transform: rotate(180deg) !important; }
.cs.open .cs-trigger { background: var(--surface); border-color: var(--forest); box-shadow: 0 0 0 4px rgba(184, 238, 118, .45); }
.cs-menu { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 8px); max-height: 320px; overflow-y: auto; padding: 8px; background: var(--surface); border-radius: var(--r-md); box-shadow: 0 24px 48px -16px rgba(20, 40, 16, .28), 0 0 0 1px var(--line); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top; transition: opacity .16s, transform .16s, visibility .16s; overscroll-behavior: contain; }
.cs.up .cs-menu { top: auto; bottom: calc(100% + 8px); transform-origin: bottom; }
.cs.open .cs-menu { opacity: 1; visibility: visible; transform: none; }
.cs-option { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 16px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; color: var(--ink-2); transition: background .12s; }
.cs-option + .cs-option { margin-top: 2px; }
.cs-option:hover, .cs-option.active { background: var(--surface-2); color: var(--ink); }
.cs-option.selected { background: var(--lime-3); color: var(--forest); }
.cs-option.disabled { opacity: .4; pointer-events: none; }
.cs-label { flex: 1; min-width: 0; }
.cs-check { opacity: 0; color: var(--forest); font-size: .85rem; }
.cs-option.selected .cs-check { opacity: 1; }
.control:has(.cs) > i { z-index: 1; }

/* Icone « frais » (main + piece) a la place du billet Font Awesome, partout. */
.fa-money-bill-wave { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; background-color: currentColor; -webkit-mask: url("../images/frais.svg") center / contain no-repeat; mask: url("../images/frais.svg") center / contain no-repeat; }
.fa-money-bill-wave::before { content: none !important; }

/* Avatar sobre (sans dégradé) */
.avatar { background: #dce5dd; color: #2f4a36; font-weight: 600; letter-spacing: .03em; box-shadow: none; }

/* --- Cotiser : devise du montant, blocs selon le moyen, coordonnées bancaires --------- */
.amount-input.has-devise { padding-right: 88px; }
.amount-devise { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); padding: 6px 12px; border-radius: 999px; background: var(--lime-3); color: var(--forest); font-weight: 700; font-size: var(--t-xs); letter-spacing: .04em; pointer-events: none; }
.bloc-moyen { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.bloc-moyen[hidden] { display: none; }
.banque { border-radius: var(--r-md); background: var(--surface-2); padding: 16px; display: grid; gap: 4px; }
.banque-titre { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--forest); margin-bottom: 4px; }
.banque-ligne { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; }
.banque-ligne:first-of-type { border-top: 0; }
.banque-ligne small { display: block; font-size: var(--t-xs); color: var(--muted); }
.banque-ligne b { display: block; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.banque-ligne.motif { background: var(--lime-3); border-radius: var(--r-sm); padding: 8px 12px; border-top: 0; margin-top: 4px; }
.copier { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface); color: var(--forest); cursor: pointer; box-shadow: var(--sh-sm); }
.copier:hover { background: var(--lime); }
.form-alerte { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md); background: var(--danger-50); color: #9f1d22; font-size: var(--t-sm); font-weight: 600; }
.form-alerte[hidden] { display: none; }
