/* ==========================================================================
   BUDGÉTUDIANT — feuille unique.
   Mobile d'abord ; thème clair et sombre par prefers-color-scheme.
   ========================================================================== */

:root {
  --bg:        #f1f2f8;
  --card:      #ffffff;
  --text:      #171923;
  --muted:     #6b7280;
  --line:      #e5e7ef;
  --primary:   #4f46e5;
  --primary-2: #7c3aed;
  --on-primary:#ffffff;
  --green:     #16a34a;
  --green-bg:  #dcfce7;
  --red:       #dc2626;
  --red-bg:    #fee2e2;
  --amber:     #d97706;
  --amber-bg:  #fef3c7;
  --shadow:    0 1px 3px rgba(23, 25, 35, .08), 0 8px 24px rgba(23, 25, 35, .06);
  --radius:    16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #101120;
    --card:      #1a1c2e;
    --text:      #edeef5;
    --muted:     #9aa0b5;
    --line:      #2a2d45;
    --primary:   #818cf8;
    --primary-2: #a78bfa;
    --on-primary:#12131f;
    --green:     #4ade80;
    --green-bg:  #14351f;
    --red:       #f87171;
    --red-bg:    #3c1414;
    --amber:     #fbbf24;
    --amber-bg:  #3a2b08;
    --shadow:    0 1px 3px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* Jamais de defilement lateral : sur une app de poche, un debordement
     horizontal coupe les montants — le pire endroit pour perdre des pixels. */
  overflow-x: clip;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------- Barre haute */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  color: #fff;
}
.topbar-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-logo { font-size: 22px; }
.topbar-name { font-weight: 800; letter-spacing: .4px; font-size: 15px; }
.topbar-month {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, .16);
  border-radius: 999px; padding: 3px 6px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.topbar-month .icon-btn { color: #fff; width: 28px; height: 28px; font-size: 18px; }
#month-label { min-width: 96px; text-align: center; text-transform: capitalize; }
.topbar-user {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .18);
  color: #fff; font-weight: 800; font-size: 15px; cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 420px) {
  .topbar-name { display: none; }
}

/* ------------------------------------------------------------- Structure */
.main {
  max-width: 720px; margin: 0 auto;
  padding: 14px 14px calc(120px + env(safe-area-inset-bottom));
}
.view { display: grid; gap: 14px; }
/* Un enfant de grille garde sinon sa largeur de contenu minimale : une rangee
   de puces ou un montant insecable suffisait a elargir TOUTE la colonne et a
   faire deborder chaque vue sur telephone. */
.view > *, .coloc-panel > * { min-width: 0; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 10px;
}
.card-head h2 { font-size: 16px; }
.card-hint { font-size: 12px; color: var(--muted); }
.help { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 14px 0; }

/* minmax(0,1fr) et non 1fr : sans lui, un texte insecable dans une carte
   elargit sa colonne et fait deborder toute la page sur telephone. */
.cards-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px; display: grid; gap: 2px; text-align: center; min-width: 0;
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.stat-value { font-size: clamp(15px, 4.2vw, 22px); font-weight: 800; white-space: nowrap; }
.stat-income  .stat-value { color: var(--green); }
.stat-expense .stat-value { color: var(--red); }
.stat-balance .stat-value.is-neg { color: var(--red); }
.stat-balance .stat-value.is-pos { color: var(--green); }

/* ------------------------------------------------------------- Budget global */
.budget-global { margin-bottom: 14px; }
.budget-global-bar {
  position: relative; height: 14px; border-radius: 999px;
  background: var(--line); overflow: hidden;
}
.budget-global-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width .4s ease;
}
.budget-global-fill.is-over { background: var(--red); }
.budget-global-cursor {
  position: absolute; top: -2px; bottom: -2px; width: 2px;
  background: var(--text); opacity: .5;
}
.budget-global-legend {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted); margin-top: 5px;
}
.budget-global-legend b { color: var(--text); }

/* ------------------------------------------------------------- Lignes budget */
.budget-lines { display: grid; gap: 10px; }
.bline { display: grid; gap: 4px; }
.bline-top { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.bline-cat { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bline-nums { font-size: 13px; color: var(--muted); white-space: nowrap; }
.bline-nums b { color: var(--text); }
.bline-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bline-fill { height: 100%; border-radius: 999px; background: var(--green); transition: width .4s ease; }
.bline.is-warn .bline-fill { background: var(--amber); }
.bline.is-over .bline-fill { background: var(--red); }
.bline.is-free .bline-fill { background: var(--muted); }
.bline-status { font-size: 12px; }
.bline-status.ok   { color: var(--green); }
.bline-status.warn { color: var(--amber); }
.bline-status.over { color: var(--red); font-weight: 700; }
.bline-status.free { color: var(--muted); }

/* ------------------------------------------------------------- Recettes chips */
.income-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.income-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-bg); color: var(--green);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600;
}
.income-chip.is-waiting { background: var(--amber-bg); color: var(--amber); }
.chip-plan { font-weight: 500; opacity: .75; }

/* ------------------------------------------------------------- Previsionnel */
.amount-pos { color: var(--green); }
.amount-neg { color: var(--red); }
.budget-forecast {
  font-size: 13px; color: var(--muted); margin: 8px 0 0;
  border-top: 1px dashed var(--line); padding-top: 8px;
}
.budget-forecast b { color: var(--text); }
.budget-forecast b.amount-pos { color: var(--green); }
.budget-forecast b.amount-neg { color: var(--red); }
.budget-balance { display: grid; gap: 2px; text-align: center; margin-bottom: 14px; }
.budget-balance-amount { font-size: 34px; font-weight: 800; }
.budget-balance-text { font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------------------- Tendance */
.trend { display: flex; gap: 8px; align-items: flex-end; height: 120px; }
.trend-col { flex: 1; display: grid; gap: 3px; align-content: end; justify-items: center; height: 100%; }
.trend-bars { display: flex; gap: 3px; align-items: flex-end; height: 88px; }
.trend-bar { width: 12px; border-radius: 4px 4px 0 0; min-height: 2px; }
.trend-bar.inc { background: var(--green); }
.trend-bar.exp { background: var(--red); opacity: .85; }
.trend-label { font-size: 11px; color: var(--muted); text-transform: capitalize; }

/* ------------------------------------------------------------- Operations */
.filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.filter-toggle { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.filter-toggle[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
.filter-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange, #f59e0b); }
.filters-more { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 430px) {
  .filters-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-more #tx-filter-scope { grid-column: 1 / -1; }
}

.tx-list { display: grid; }
.tx-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid var(--line);
  background: none; border-left: 0; border-right: 0; border-top: 0;
  /* min-width: 0 — pose comme enfant de grille (liste des depenses de coloc),
     la ligne gardait sinon sa largeur de contenu et le montant sortait de l'ecran. */
  width: 100%; min-width: 0; text-align: left; cursor: pointer;
}
.tx-item:last-child { border-bottom: 0; }
.tx-ico {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 19px;
  background: var(--bg);
}
.tx-main { flex: 1; min-width: 0; }
.tx-label { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-amount { font-weight: 800; font-size: 14px; white-space: nowrap; }
.tx-amount.inc { color: var(--green); }
.tx-amount.exp { color: var(--text); }
.tx-badge { font-size: 11px; }

.tx-day-head {
  font-size: 12px; color: var(--muted); font-weight: 700;
  padding: 10px 2px 2px; text-transform: capitalize;
}

/* ------------------------------------------------------------- Budget (form) */
.budget-form { display: grid; gap: 8px; margin-bottom: 12px; }
.bform-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.bform-row:last-child { border-bottom: 0; }
.bform-cat { flex: 1; font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; min-width: 0; }
.bform-cat span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bform-row .bform-input { width: 110px; flex-shrink: 0; text-align: right; }
.budget-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 2px; font-size: 15px;
  border-top: 2px solid var(--line); margin-bottom: 12px;
}

/* ------------------------------------------------------------- Recurrences */
.rec-list { display: grid; }
.rec-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid var(--line);
  background: none; border-left: 0; border-right: 0; border-top: 0;
  width: 100%; text-align: left; cursor: pointer;
}
.rec-item:last-child { border-bottom: 0; }
.rec-item.is-off { opacity: .5; }
.rec-day {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--bg);
  font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.1;
}
.rec-day b { font-size: 15px; color: var(--text); }

/* ------------------------------------------------------------- Admin */
.admin-users { display: grid; }
.admin-user { padding: 12px 2px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.admin-user:last-child { border-bottom: 0; }
.admin-user-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-user-name { font-weight: 700; }
.admin-user-email { color: var(--muted); font-size: 13px; }
.admin-user-meta { font-size: 12px; color: var(--muted); }
.admin-user-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px;
}
.tag-admin { background: var(--amber-bg); color: var(--amber); }
.tag-off { background: var(--red-bg); color: var(--red); }

/* ------------------------------------------------- Frequentation (admin) */
/* Un tableau de bord dense, mais qui tient dans la largeur d'un telephone :
   les classements defilent verticalement, les graphiques horizontalement. */
.tr-block { margin-top: 18px; }
.tr-block:first-child { margin-top: 10px; }
.tr-h {
  font-size: 14px; margin-bottom: 8px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.tr-legend { font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.tr-dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin: 0 3px 0 8px; }
.tr-dot-site { background: var(--primary-2); }
.tr-dot-app  { background: var(--primary); }

.tr-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tr-kpi {
  background: var(--bg); border-radius: 12px; padding: 10px 8px;
  display: grid; gap: 1px; text-align: center; min-width: 0;
}
.tr-kpi b { font-size: clamp(14px, 4vw, 19px); font-weight: 800; }
.tr-kpi span { font-size: 10.5px; color: var(--muted); line-height: 1.25; }

/* Le graphique deborde plutot que de tasser 365 colonnes illisibles ; le JS
   le fait defiler jusqu'a aujourd'hui, qui est le jour qu'on regarde. */
.tr-chart {
  display: flex; gap: 2px; align-items: flex-end;
  height: 122px; padding-bottom: 16px; overflow-x: auto;
}
.tr-chart-hours { height: 82px; }
/* La date est en position absolue : sans cela, une etiquette de 30 px
   imposerait sa largeur a sa colonne et le graphique deborderait pour rien. */
.tr-col { position: relative; flex: 1 1 6px; min-width: 4px; height: 100%; }
.tr-stack { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.tr-bar { width: 100%; border-radius: 3px 3px 0 0; min-height: 1px; }
.tr-bar-site { background: var(--primary-2); }
.tr-bar-app  { background: var(--primary); }
.tr-bar-hour { background: var(--primary); opacity: .8; }
.tr-col-label {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  font-size: 9.5px; line-height: 14px; color: var(--muted); white-space: nowrap;
}

.tr-rows { display: grid; gap: 10px; }
.tr-row { display: grid; gap: 3px; }
.tr-row-top { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; }
.tr-row-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-row-val { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tr-row-sub { font-size: 11.5px; color: var(--muted); }
.tr-row-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.tr-row-bar i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.tr-fill-funnel { background: linear-gradient(90deg, var(--primary), var(--primary-2)) !important; }

.tr-students { display: grid; }
.tr-student { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.tr-student:last-child { border-bottom: 0; }
.tr-student-top { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.tr-foot { margin: 18px 0 0; border-top: 1px dashed var(--line); padding-top: 10px; }

/* ------------------------------------------------------------- Boutons */
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 12px; padding: 10px 16px; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: filter .15s;
}
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary {
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  color: #fff; border: 0;
}
.btn-danger { background: var(--red-bg); color: var(--red); border: 0; }
.btn-ghost { background: none; border: 0; color: var(--primary); padding: 4px 6px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  background: none; border: 0; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 16px;
}
.icon-btn:hover { background: rgba(128, 128, 128, .12); }

/* ------------------------------------------------------------- FABs */
.fabs {
  position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px; z-index: 25;
}
.fab {
  border: 0; border-radius: 50%; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
  display: grid; place-items: center;
}
.fab-primary {
  width: 58px; height: 58px; font-size: 30px; font-weight: 300;
  background: linear-gradient(120deg, var(--primary), var(--primary-2)); color: #fff;
}
.fab-secondary { width: 46px; height: 46px; font-size: 20px; background: var(--card); }
.fab.is-recording { animation: pulse 1.2s infinite; }

/* ------------------------------------------------------------- Nav basse */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav-btn {
  background: none; border: 0; cursor: pointer;
  display: grid; justify-items: center; gap: 1px;
  font-size: 11px; color: var(--muted); padding: 4px 2px; border-radius: 10px;
  flex: 1; min-width: 0;
}
.nav-ico { font-size: 20px; filter: grayscale(1); opacity: .7; }
.nav-btn.is-active { color: var(--primary); font-weight: 700; }
.nav-btn.is-active .nav-ico { filter: none; opacity: 1; }

/* ------------------------------------------------------------- Fenetres */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 25, .55); }
.modal-panel {
  position: relative; width: 100%; max-width: 560px;
  max-height: calc(100dvh - 40px); overflow-y: auto;
  background: var(--card); border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  animation: slide-up .22s ease;
}
@media (min-width: 640px) {
  .modal { place-items: center; }
  .modal-panel { border-radius: 20px; }
}
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h2 { font-size: 17px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.modal-actions .btn { flex: 1; }

/* ------------------------------------------------------------- Formulaires */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text);
  padding: 10px 12px; font: inherit; font-size: 15px;
}
.input:focus { outline: none; border-color: var(--primary); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

.seg { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; gap: 4px; }
.seg-btn {
  flex: 1; border: 0; background: none; border-radius: 9px;
  padding: 8px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--muted);
}
.seg-btn.is-active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
#tx-kind-seg .seg-btn.is-active[data-kind="income"],
#rec-kind-seg .seg-btn.is-active[data-kind="income"] { color: var(--green); }
#tx-kind-seg .seg-btn.is-active[data-kind="expense"],
#rec-kind-seg .seg-btn.is-active[data-kind="expense"] { color: var(--red); }

/* ------------------------------------------------------------- Dictee */
.voice-stage { display: grid; justify-items: center; gap: 10px; padding: 12px 0; }
.voice-orb {
  width: 92px; height: 92px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 38px; display: grid; place-items: center;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  box-shadow: 0 6px 24px rgba(79, 70, 229, .4);
}
.voice-orb.is-recording { animation: pulse 1.2s infinite; }
.voice-orb.is-thinking { animation: spin-soft 1.4s linear infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(79, 70, 229, .45); }
  70%  { box-shadow: 0 0 0 22px rgba(79, 70, 229, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}
@keyframes spin-soft { to { transform: rotate(360deg); } }
.voice-status { text-align: center; color: var(--muted); font-size: 14px; margin: 0; }
.voice-examples { text-align: center; color: var(--muted); font-size: 12.5px; font-style: italic; margin: 0; }
.voice-transcript { text-align: center; font-size: 15px; min-height: 1.2em; margin: 8px 0; }
.voice-comment { font-size: 13px; color: var(--muted); margin: 8px 0; }
.voice-card {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px;
}
.voice-card.is-unsure { border-color: var(--amber); }
.voice-card-main { flex: 1; min-width: 0; }
.voice-card-label { font-weight: 700; font-size: 14px; }
.voice-card-meta { font-size: 12px; color: var(--muted); }
.voice-card-amount { font-weight: 800; white-space: nowrap; }
.voice-card-amount.inc { color: var(--green); }
.cat-icon { font-size: 20px; }

/* ------------------------------------------------------------- Tickets */
.receipt-capture { display: grid; gap: 10px; padding: 8px 0; }
.receipt-live video { width: 100%; border-radius: 14px; background: #000; max-height: 55dvh; object-fit: contain; }
.receipt-live-actions { display: flex; gap: 8px; margin-top: 10px; }
.receipt-live-actions .btn { flex: 1; }
.receipt-preview-box { text-align: center; }
.receipt-preview-box img { max-width: 100%; max-height: 200px; border-radius: 12px; }
.receipt-summary { text-align: center; margin: 10px 0; }
.receipt-merchant { font-weight: 800; font-size: 16px; }
.receipt-meta { color: var(--muted); font-size: 13px; }
.receipt-total { font-size: 26px; font-weight: 800; color: var(--primary); }
.receipt-lines {
  max-height: 180px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0;
}
.receipt-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.receipt-line-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-line-amount { white-space: nowrap; }

/* ------------------------------------------------------------- Profil */
.profile-info { text-align: center; margin-bottom: 14px; }
.profile-name { font-size: 20px; font-weight: 800; margin: 4px 0; }
.profile-email { color: var(--muted); margin: 2px 0; }
.profile-role { font-size: 13px; color: var(--amber); font-weight: 700; margin: 2px 0; }
.profile-install { margin-bottom: 14px; }
.profile-logout { margin: 0; }

/* ------------------------------------------------------------- Toasts */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(140px + env(safe-area-inset-bottom));
  display: grid; gap: 8px; z-index: 90; width: min(92vw, 400px);
}
.toast {
  background: var(--text); color: var(--bg);
  border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); text-align: center;
  animation: slide-up .2s ease;
}
.toast.ok    { background: var(--green); color: #fff; }
.toast.error { background: var(--red); color: #fff; }

/* ------------------------------------------------------------- Connexion */
.login-body {
  min-height: 100dvh; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--primary), var(--primary-2) 60%, #db2777);
  padding: 20px;
}
.login-card {
  width: min(94vw, 400px);
  background: var(--card); border-radius: 22px; box-shadow: var(--shadow);
  padding: 28px 24px; text-align: center;
}
.login-logo { font-size: 44px; }
.login-title { font-size: 22px; letter-spacing: .5px; margin-top: 4px; }
.login-sub { color: var(--muted); font-size: 14px; margin: 6px 0 18px; }
.login-tabs {
  display: flex; background: var(--bg); border-radius: 12px; padding: 4px; gap: 4px;
  margin-bottom: 16px;
}
.login-tab {
  flex: 1; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px;
  padding: 8px; border-radius: 9px;
}
.login-tab.is-active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.login-error {
  background: var(--red-bg); color: var(--red);
  border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600;
}
.login-form { display: grid; gap: 12px; text-align: left; }
.login-form .input, .login-form input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text);
  padding: 11px 12px; font: inherit; font-size: 15px;
}
.login-form input:focus { outline: none; border-color: var(--primary); }
.login-foot { font-size: 13.5px; color: var(--muted); margin-top: 16px; }
.login-next {
  font-size: 13px; color: var(--muted); margin-top: 14px; padding: 10px 12px;
  border-radius: 10px; background: var(--bg); border: 1px dashed var(--line); text-align: left;
}
.login-foot a { color: var(--primary); font-weight: 700; }
.login-info {
  background: var(--green-bg); color: var(--green);
  border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600;
}
.login-legal { margin-top: 10px; font-size: 12px; }
.login-legal a { color: var(--muted); }

/* ------------------------------------------------------------- Divers v2 */
.stat-sub { font-size: 11px; color: var(--muted); }
.cards-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* Suggestions de recurrence */
.suggest-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.suggest-text { flex: 1; min-width: 200px; font-size: 13.5px; }
.suggest-actions { display: flex; gap: 6px; }
.suggest-actions .btn { padding: 6px 14px; font-size: 13px; }

/* Objectifs */
.goals-list { display: grid; gap: 12px; }
.goal { display: grid; gap: 4px; }
.goal-fill { background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.goal.is-done .goal-fill { background: var(--green); }
.goal-actions { display: flex; gap: 4px; }

/* Rapprochement recurrences <-> budget */
.bform-row-wrap { border-bottom: 1px solid var(--line); }
.bform-row-wrap .bform-row { border-bottom: 0; }
.bform-row-wrap:last-child { border-bottom: 0; }
.bform-committed {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  font-size: 12px; color: var(--muted); padding: 0 2px 6px;
}
.bform-committed.is-short { color: var(--red); font-weight: 600; }
.bform-committed .btn { padding: 2px 8px; font-size: 12px; }
.input.is-short { border-color: var(--red); color: var(--red); }

/* Coloc */
.member-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 2px; border-bottom: 1px solid var(--line);
}
.member-row:last-child { border-bottom: 0; }
.member-name { font-weight: 600; font-size: 14px; }
.member-meta { font-size: 12px; color: var(--muted); flex: 1; }
.coloc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.settle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap;
}
.settle-row:last-child { border-bottom: 0; }
.invite-qr { text-align: center; margin: 10px 0; }
.invite-qr canvas {
  width: min(240px, 70vw); height: auto; image-rendering: pixelated;
  border-radius: 8px;
}
.invite-link {
  text-align: center; font-size: 12px; word-break: break-all;
  color: var(--muted); margin: 4px 0 10px;
}

/* Import CSV */
.import-map { grid-template-columns: 1fr 1fr 1fr; }
.table-scroll { overflow-x: auto; margin: 10px 0; }
.import-preview { border-collapse: collapse; width: 100%; font-size: 13px; }
.import-preview th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  color: var(--muted); padding: 4px 8px; border-bottom: 2px solid var(--line);
}
.import-preview td { padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }

/* Bilan */
.bilan-line { font-size: 14px; margin: 10px 0; }

/* Profil v2 */
.profile-section { border-top: 1px solid var(--line); padding: 14px 0; }
.profile-section h3 { font-size: 15px; margin-bottom: 6px; }
.share-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 0; font-size: 14px; flex-wrap: wrap;
}
.share-label { font-weight: 600; }
.share-actions { display: flex; gap: 2px; }
.cat-icon-input { width: 58px; flex-shrink: 0; text-align: center; }
.cat-kind-input { width: 110px; flex-shrink: 0; }
.profile-delete-row { text-align: center; margin-top: 8px; }
.profile-delete-row .btn { color: var(--red); }
.field-row .btn { align-self: end; }

/* Ticket dans la fiche */
.tx-receipt-img { max-width: 100%; border-radius: 12px; margin-top: 8px; }

/* Reponse vocale */
.voice-answer { text-align: center; padding: 10px 0; }
.voice-question { color: var(--muted); font-size: 13px; font-style: italic; margin: 0 0 8px; }
.voice-answer-text { font-size: 16px; font-weight: 600; margin: 0; }

/* Pages legales / suivi */
.legal-page h1 { font-size: 22px; margin: 8px 0 14px; }
.legal-page h2 { font-size: 15px; margin: 14px 0 4px; }

/* ------------------------------------------------------------- Coloc v2 : taches & infos */
.coloc-panel { display: grid; gap: 14px; }
.coloc-seg { margin-bottom: 14px; background: var(--card); box-shadow: var(--shadow); }
.coloc-seg .seg-btn.is-active {
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  color: #fff;
}

.avatar-chip {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  color: #fff; font-weight: 800; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar-img { object-fit: cover; background: var(--line); }
.avatar-big { width: 56px; height: 56px; font-size: 22px; background: var(--primary); }
.member-avatar-row { display: flex; align-items: center; gap: 12px; }
.member-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.member-actions .btn { padding: 5px 10px; font-size: 12.5px; }
.member-row .tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.member-row.is-pending { background: var(--amber-bg); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.tag-pending { background: var(--amber-bg); color: var(--amber); }
.tag-leaving { background: var(--red-bg); color: var(--red); }
.member-depart { color: var(--muted); }
.task-row { cursor: default; }
.chip-done {
  background: var(--green-bg); color: var(--green); border: 0; cursor: pointer;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.chip-todo {
  background: none; border: 1.5px solid var(--line); color: var(--primary); cursor: pointer;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700;
  white-space: nowrap; text-decoration: none;
}
.tag-rotate { background: var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.tag-fixed { background: var(--bg); color: var(--muted); }

.sos-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.sos-chip {
  background: var(--red-bg); border-radius: 12px; padding: 10px 4px;
  display: grid; justify-items: center; gap: 2px; text-decoration: none;
}
.sos-chip b { font-size: 20px; font-weight: 800; color: var(--red); }
.sos-chip span { font-size: 10.5px; color: var(--muted); text-align: center; }
.contact-phone { font-weight: 700; font-size: 14px; color: var(--primary); text-decoration: none; white-space: nowrap; }
.contact-form { margin-top: 10px; }
.info-row { cursor: default; }
.info-row .tx-label { white-space: normal; }
.rule-row { display: flex; gap: 8px; font-size: 14px; padding: 5px 0; }
textarea.input { resize: vertical; font-family: inherit; }

/* ------------------------------------------------------------- L'étudiant, et ses deux portes */
.student-head { display: flex; align-items: center; gap: 12px; padding: 2px 2px 4px; }
.student-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; border: 0; cursor: pointer;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 800; font-size: 19px;
}
.student-id { display: grid; gap: 1px; min-width: 0; }
.student-id b { font-size: 17px; }
.student-line {
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  font-size: 13px; color: var(--muted); text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.student-line.is-todo { color: var(--primary); font-weight: 600; }

.rights-alert {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; cursor: pointer; border-left: 4px solid var(--amber); padding: 13px 14px;
}
.rights-alert-ico { font-size: 25px; }
/* Recette attendue en retard : meme langage visuel que l'alerte droits,
   nuance differente pour distinguer « a demander » de « pas encore recu ». */
.late-alert { border-left-color: var(--red, #dc2626); }
.watch-head { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--amber); margin-top: 10px; }
.rights-alert-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.rights-alert-main b { font-size: 14.5px; }
.rights-alert-main span { font-size: 12.5px; color: var(--muted); }
.rights-alert-go { color: var(--primary); font-size: 20px; font-weight: 700; }

.doors { display: grid; gap: 10px; }
.door {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  border: 0; cursor: pointer; padding: 15px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow); color: #fff;
}
.door-money { background: linear-gradient(120deg, var(--primary), var(--primary-2)); }
.door-life  { background: linear-gradient(120deg, #0f766e, #0891b2); }
.door-ico { font-size: 27px; }
.door-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.door-main b { font-size: 16px; }
.door-main span { font-size: 12.5px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.door-stat { font-weight: 800; font-size: 15px; white-space: nowrap; }

.nav-dot {
  /* Ancre au coin de l'ICONE (centree), pas au bord du bouton : depuis que
     les boutons s'etirent (flex: 1), le bord droit peut etre a 100 px de
     l'icone sur un grand ecran et le point flottait dans le vide. */
  position: absolute; top: 2px; left: calc(50% + 10px);
  width: 8px; height: 8px; border-radius: 50%; background: var(--amber);
}
.nav-btn { position: relative; }

/* ------------------------------------------------------------- Assistant budget */
.wiz-progress { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 14px; }
.wiz-progress-fill {
  height: 100%; border-radius: 999px; transition: width .3s ease;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}
.wiz-line { margin-bottom: 14px; }
.wiz-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.wiz-hint .chip-todo { cursor: pointer; }
.wiz-rec { margin-top: 14px; align-items: flex-start; }
.wiz-actions { flex-wrap: wrap; }
.wiz-quit { text-align: center; margin-top: 10px; font-size: 12px; }

/* Liens géographiques */
.geo-row { text-decoration: none; color: inherit; }
.geo-row .tx-meta { white-space: normal; }

/* Écran « vérifie ta boîte mail » */
.login-sent { text-align: center; padding: 6px 0 4px; }
.login-sent-ico { font-size: 46px; }
.login-sent h2 { font-size: 19px; margin: 8px 0 10px; }
.login-sent p { font-size: 14.5px; color: var(--muted); margin: 0 0 10px; }
.login-sent-note { font-size: 12.5px; }

/* ------------------------------------------------------------- Passerelles entre les portes */
.bridge {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; cursor: pointer; padding: 13px 14px; border-left: 4px solid var(--primary);
}
.bridge-ico { font-size: 24px; }
.bridge-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.bridge-main b { font-size: 14.5px; }
.bridge-main span { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------- Mes droits (non-recours) */
.rights-head .rights-total { text-align: center; margin: 10px 0 6px; display: grid; gap: 2px; }
.rights-total-amount { font-size: 30px; font-weight: 800; color: var(--green); }
.rights-total-text { font-size: 13px; color: var(--muted); }
.rights-disclaimer { font-size: 12px; border-top: 1px dashed var(--line); padding-top: 8px; margin-bottom: 0; }
.rights-group {
  font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
  margin: 18px 2px 8px; color: var(--muted);
}
.rights-group.lvl-likely { color: var(--green); }
.rights-group.lvl-maybe { color: var(--amber); }
.right-card { padding: 14px; margin-bottom: 10px; border-left: 4px solid var(--line); }
.right-card.lvl-likely { border-left-color: var(--green); }
.right-card.lvl-maybe { border-left-color: var(--amber); }
.right-card.lvl-no { opacity: .6; }
.right-card.is-done { opacity: .72; }
.right-top { display: flex; align-items: flex-start; gap: 11px; }
.right-ico { font-size: 23px; }
.right-main { display: grid; gap: 1px; min-width: 0; }
.right-main b { font-size: 15px; }
.right-org { font-size: 12px; color: var(--muted); }
.right-why {
  background: var(--green-bg); color: var(--green); border-radius: 10px;
  padding: 8px 11px; font-size: 13px; margin: 10px 0 8px; font-weight: 500;
}
.lvl-maybe .right-why { background: var(--amber-bg); color: var(--amber); }
.lvl-no .right-why, .lvl-have .right-why { background: var(--bg); color: var(--muted); }
.right-desc { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.right-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.right-actions .btn { padding: 7px 12px; font-size: 13px; text-decoration: none; }
.right-actions .btn.is-on { background: var(--green-bg); color: var(--green); border-color: var(--green); }

/* Pièces requises pour un droit */
.right-docs { margin: 8px 0; display: grid; gap: 4px; }
.right-docs-label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.right-doc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rdoc-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.rdoc-chip.is-ready { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.rdoc-chip.is-missing { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.docs-ready-badge { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--green); background: var(--green-bg); padding: 3px 8px; border-radius: 6px; margin-bottom: 8px; }

/* Mode fin de mois difficile */
.tight-alert { padding: 14px; border-left: 4px solid var(--amber); margin-bottom: 12px; }
.tight-alert.is-critical { border-left-color: var(--red); background: var(--red-bg); }
.tight-alert-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tight-alert-ico { font-size: 26px; }
.tight-alert-main b { font-size: 15px; color: var(--text); }
.tight-alert.is-critical .tight-alert-main b { color: var(--red); }
.tight-alert-main span { font-size: 13px; color: var(--muted); }
.tight-alert-tips { display: grid; gap: 8px; margin-top: 8px; }
.tight-tip { display: flex; align-items: center; gap: 10px; background: var(--card); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; }
.tight-tip .tip-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tight-tip .tip-body b { font-size: 13px; }
.tight-tip .tip-body span { font-size: 12px; color: var(--muted); }

/* Carnet de victoires */
.victories-card { background: var(--green-bg); border: 1px solid var(--green); padding: 14px; margin-bottom: 14px; border-radius: var(--radius); }
.victories-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.victories-trophy { font-size: 32px; }
.victories-stats { display: flex; gap: 12px; justify-content: space-around; background: var(--card); padding: 10px; border-radius: 8px; margin-bottom: 12px; }
.vstat { text-align: center; display: grid; }
.vstat b { font-size: 18px; color: var(--green); }
.vstat span { font-size: 11px; color: var(--muted); }
.victories-list { display: grid; gap: 6px; }
.victory-item { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-top: 1px dashed var(--line); }
.vitem-amount { font-weight: 700; color: var(--green); }

/* Pochette de justificatifs */
.sdocs-card { margin-top: 16px; margin-bottom: 14px; }
.sdocs-list { display: grid; gap: 8px; margin-top: 12px; }
.sdoc-item { display: flex; align-items: center; gap: 12px; background: var(--bg); padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); }
.sdoc-ico { font-size: 24px; }
.sdoc-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sdoc-info b { font-size: 13.5px; }
.sdoc-meta { font-size: 11.5px; color: var(--muted); }
.sdoc-actions { display: flex; align-items: center; gap: 6px; }

/* Un onglet Budget a trois panneaux : le sélecteur peut défiler */
.seg-scroll { overflow-x: auto; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll .seg-btn { white-space: nowrap; flex: 1 0 auto; }
/* Sur petit ecran, des onglets plus compacts pour que les quatre tiennent. */
@media (max-width: 400px) {
  .seg-btn { padding: 8px 6px; font-size: 13px; }
}

/* ------------------------------------------------------------- Liste de courses */
.shop-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.shop-row:last-child { border-bottom: 0; }
.shop-check { background: none; border: 0; cursor: pointer; font-size: 19px; color: var(--primary); padding: 0 2px; }
.shop-label { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.shop-row.is-done .shop-label { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.shop-form { margin-top: 10px; }

/* ------------------------------------------------------------- Chat : sourdine & sondages */
.chat-topbar { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.chat-topbar .chat-threads { border-bottom: 0; flex: 1; min-width: 0; }
.poll { display: grid; gap: 5px; margin-top: 6px; min-width: 200px; }
.poll-opt {
  position: relative; overflow: hidden; border: 1.5px solid var(--line); background: var(--card);
  border-radius: 9px; padding: 6px 10px; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13.5px;
}
.poll-opt-bar { position: absolute; inset: 0 auto 0 0; background: var(--primary); opacity: 0.16; }
.poll-opt.is-mine { border-color: var(--primary); font-weight: 700; }
.poll-opt-label { position: relative; flex: 1; min-width: 0; }
.poll-opt-count { position: relative; font-weight: 700; font-size: 12.5px; color: var(--muted); }
.poll-total { font-size: 11px; color: var(--muted); justify-self: end; }
.bubble-poll { max-width: 92%; }
.bubble-mine .poll-opt { color: var(--text); }

/* ------------------------------------------------------------- Solde d'un membre parti */
.is-left-member { opacity: 0.66; }
.is-left-member .bline-fill { background: var(--muted); }

/* ------------------------------------------------------------- Bilan de l'espace */
.cstats-trend { height: 90px; margin-bottom: 8px; }
.cstats-trend .trend-bars { height: 62px; }
.cstats-h { font-size: 14px; margin: 14px 0 8px; }

/* ------------------------------------------------------------- Selecteur d'espaces */
.coloc-spaces {
  border-bottom: 0; padding-bottom: 0; margin-bottom: 2px;
  /* Plus d'espaces que l'ecran n'en montre : la rangee defile, sans barre. */
  overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap;
}
.coloc-spaces::-webkit-scrollbar { display: none; }

/* ------------------------------------------------------------- Lien de connexion durable */
.loginlink-box { display: grid; gap: 8px; margin-bottom: 10px; }
.loginlink-box code {
  font-size: 12px; word-break: break-all; background: var(--bg);
  padding: 8px 10px; border-radius: 10px;
}

/* ------------------------------------------------------------- Depense coloc : note & decompte */
.split-hint { color: var(--green); font-weight: 600; margin: -4px 0 0; }
#cexp-photo-zone { display: grid; gap: 8px; }

/* ------------------------------------------------------------- Banniere alertes push */
.push-banner {
  display: flex; align-items: center; gap: 12px;
  border-left: 4px solid var(--primary);
  padding: 12px 14px;
}
.push-banner-ico { font-size: 26px; flex-shrink: 0; }
.push-banner-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.push-banner-main b { font-size: 14px; }
.push-banner-main span { font-size: 12.5px; color: var(--muted); }
.push-banner .btn { padding: 8px 14px; font-size: 13px; white-space: nowrap; }

/* ------------------------------------------------------------- Le + de la barre du bas */
.nav-plus {
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  color: #fff; font-size: 30px; font-weight: 300; line-height: 1;
  margin-top: -18px; flex-shrink: 0; align-self: flex-start;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
}
.add-sheet-panel { padding: 10px 10px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 4px; }
.sheet-row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 13px 12px; border-radius: 14px;
}
.sheet-row:hover { background: var(--bg); }
.sheet-ico {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  background: var(--bg); display: grid; place-items: center; font-size: 22px;
}
.sheet-main { display: grid; }
.sheet-main b { font-size: 15px; }
.sheet-main span { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------- Chat de la coloc */
.chat-card { display: flex; flex-direction: column; padding: 10px; height: min(62dvh, 560px); }
.chat-threads {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.thread-chip {
  border: 1.5px solid var(--line); background: none; color: var(--muted); cursor: pointer;
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.thread-chip.is-active {
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  border-color: transparent; color: #fff;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 10px 2px; display: flex; flex-direction: column; gap: 8px; }
.chat-day { text-align: center; font-size: 11.5px; color: var(--muted); margin: 6px 0 2px; text-transform: capitalize; }
.bubble-row { display: flex; align-items: flex-end; gap: 8px; }
.bubble-row.is-mine { justify-content: flex-end; }
.bubble {
  max-width: 78%; background: var(--bg); border-radius: 14px 14px 14px 4px;
  padding: 7px 11px; display: grid; gap: 1px;
}
.bubble-mine {
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  color: #fff; border-radius: 14px 14px 4px 14px;
}
.bubble-from { font-size: 11.5px; font-weight: 700; color: var(--primary); }
.bubble-text { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.bubble-meta { font-size: 10.5px; opacity: 0.65; justify-self: end; display: flex; gap: 6px; align-items: center; }
.bubble-del { background: none; border: 0; color: inherit; cursor: pointer; font-size: 10.5px; padding: 0; opacity: 0.8; }
.chat-composer { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); flex-shrink: 0; }
.chat-composer .input { flex: 1; }
.chat-composer .btn { padding: 10px 16px; }

/* La nav basse accepte le + central et jusqu'a 6 onglets sur petit ecran */
@media (max-width: 500px) {
  .nav-btn { min-width: 0; padding: 4px 5px; font-size: 10px; }
  .nav-plus { width: 48px; height: 48px; margin-top: -16px; }
}

/* ==========================================================================
   PISTE A « Néon campus » — la nuit du site vitrine entre dans l'appli.
   Ciel sombre en haut (avec LE chiffre du jour en jauge), feuille claire qui
   remonte, portes cote a cote, barre flottante en verre. Les tokens (violet,
   teal, rayons) restent ; la police d'affichage n'arrive que sur les grands
   chiffres, auto-hebergee : aucun appel a Google depuis l'appli.
   ========================================================================== */
@font-face {
  font-family: 'Unbounded';
  font-weight: 800; font-style: normal; font-display: swap;
  src: url('fonts/unbounded-800.woff2') format('woff2');
}
:root { --night: #0e0b28; --night-2: #2a1f6e; --sky-text: #ffffff; --sky-muted: #b7aef2; }

/* Barre haute : dans la nuit, sans rupture avec le ciel */
.topbar { background: radial-gradient(120% 140% at 20% -30%, var(--night-2), var(--night) 70%); box-shadow: none; }
.topbar-month { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); font-weight: 700; }

/* Le ciel */
.sky {
  position: relative; overflow: hidden; color: var(--sky-text);
  margin: -14px -14px 0; padding: 14px 20px 62px;
  background: radial-gradient(120% 100% at 20% -20%, var(--night-2), var(--night) 70%);
}
.sky::before, .sky::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none;
  animation: skyglow 8s ease-in-out infinite;
}
.sky::before { width: 260px; height: 260px; background: #7c5cff; opacity: .6; top: -80px; left: -60px; }
.sky::after  { width: 200px; height: 200px; background: #2dd4bf; opacity: .35; top: 60px; right: -70px; animation-delay: -4s; }
.sky-rights { background: radial-gradient(120% 100% at 80% -20%, #1d4d47, var(--night) 70%); }
.sky-rights::before { background: #2dd4bf; left: auto; right: -60px; top: -60px; opacity: .4; }
.sky-rights::after { display: none; }
.sky > * { position: relative; z-index: 1; }
@keyframes skyglow { 0%, 100% { opacity: .45; } 50% { opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .sky::before, .sky::after { animation: none; } .gauge-arc, .gauge-cursor, .rp-fill { transition: none; } }

.sky .student-head { margin: 0; }
.sky .student-avatar { box-shadow: 0 0 24px rgba(124, 92, 255, .6); }
.sky .student-id b { color: #fff; }
.sky .student-line { color: var(--sky-muted); border-bottom-color: rgba(183, 174, 242, .5); }
.sky-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sky-row h2 { margin: 0; font-size: 17px; color: #fff; }
.sky-muted { color: var(--sky-muted); font-size: 13px; margin: 8px 0 0; }
.pill-btn { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: #fff; font-size: 12.5px; padding: 7px 12px; }

/* La jauge */
.gauge-row { display: flex; align-items: center; gap: 18px; margin-top: 22px; }
.gauge { position: relative; width: 148px; height: 148px; flex-shrink: 0; }
.gauge svg { transform: rotate(-90deg); display: block; }
.gauge-track { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 12; }
.gauge-arc {
  fill: none; stroke: url(#gauge-grad); stroke-width: 12; stroke-linecap: round;
  stroke-dasharray: 402; stroke-dashoffset: 402; transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1);
}
.gauge-cursor { fill: #fbbf24; transform-origin: 74px 74px; transition: transform 1.2s cubic-bezier(.2,.8,.2,1); }
.gauge-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge-center b { font-family: 'Unbounded', system-ui, sans-serif; font-weight: 800; font-size: 22px; line-height: 1; display: block; }
.gauge-center span { font-size: 10.5px; color: var(--sky-muted); display: block; margin-top: 4px; line-height: 1.2; }
.gauge-side { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.gauge-label { font-size: 11.5px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--sky-muted); }
.gauge-big {
  font-family: 'Unbounded', system-ui, sans-serif; font-weight: 800; font-size: 28px; line-height: 1.05;
  background: linear-gradient(95deg, #fff, #a5f3fc); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gauge-big small { font-size: 14px; font-weight: 800; }
.gauge-sub { font-size: 12.5px; color: #cfc9f2; }
.gauge-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  background: rgba(45, 212, 191, .15); border: 1px solid rgba(45, 212, 191, .4); color: #99f6e4;
  border-radius: 999px; padding: 5px 10px; font-size: 11.5px; font-weight: 700;
}
.gauge-chip.is-warn { background: rgba(251, 191, 36, .15); border-color: rgba(251, 191, 36, .45); color: #fde68a; }

/* La feuille qui remonte */
.sheet {
  position: relative; z-index: 2; display: grid; gap: 12px;
  background: var(--bg); border-radius: 30px 30px 0 0;
  margin: -40px -14px 0; padding: 18px 14px 0;
}
.sheet > * { min-width: 0; }

/* Alertes en tuiles (plus de filet gauche) */
.rights-alert {
  border-left: 0; border-radius: 18px; padding: 12px 14px;
  background: linear-gradient(120deg, #fff7e6, #fff1d6); box-shadow: 0 8px 24px rgba(217, 119, 6, .14);
}
.rights-alert-ico { width: 42px; height: 42px; border-radius: 13px; background: #fde68a; display: grid; place-items: center; font-size: 21px; flex-shrink: 0; }
.rights-alert-main b { font-size: 14px; }
.rights-alert-main span { color: #92400e; }
.rights-alert-go { width: 30px; height: 30px; border-radius: 50%; background: var(--amber); color: #fff; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.late-alert { background: linear-gradient(120deg, #fff1f1, #ffe4e4); box-shadow: 0 8px 24px rgba(220, 38, 38, .12); }
.late-alert .rights-alert-ico { background: #fecaca; }
.late-alert .rights-alert-main span { color: #991b1b; }
.late-alert .rights-alert-go { background: var(--red); }
@media (prefers-color-scheme: dark) {
  .rights-alert { background: linear-gradient(120deg, #3a2b08, #2c2106); }
  .rights-alert-ico { background: #5a3f0a; }
  .rights-alert-main span { color: #fcd34d; }
  .late-alert { background: linear-gradient(120deg, #3c1414, #2c0f0f); }
  .late-alert .rights-alert-ico { background: #5a1c1c; }
  .late-alert .rights-alert-main span { color: #fca5a5; }
}

/* Les portes, cote a cote */
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.doors:has(#door-life[hidden]) .door-money { grid-column: 1 / -1; }
.door {
  position: relative; overflow: hidden; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  gap: 2px; min-height: 124px; padding: 14px; border-radius: 20px;
}
.door::after { content: ''; position: absolute; width: 90px; height: 90px; border-radius: 50%; background: #fff; opacity: .12; right: -30px; bottom: -30px; }
.door-money { box-shadow: 0 12px 28px rgba(79, 70, 229, .35); }
.door-life { box-shadow: 0 12px 28px rgba(8, 145, 178, .35); }
.door-ico { font-size: 22px; margin-bottom: auto; }
.door-main { width: 100%; }
.door-main b { font-size: 15px; }
.door-main span { font-size: 11.5px; }
.door-stat { position: absolute; top: 12px; right: 14px; font-family: 'Unbounded', system-ui, sans-serif; font-weight: 800; font-size: 13px; }

/* Cartes de la feuille : coins plus doux */
.sheet .card { border-radius: 20px; }

/* Droits : le ciel compte, le parcours donne envie */
.sky .rights-total { text-align: left; margin: 18px 0 0; gap: 4px; justify-items: start; display: grid; }
.sky .rights-total-amount {
  font-family: 'Unbounded', system-ui, sans-serif; font-weight: 800; font-size: 38px; line-height: 1.05;
  background: linear-gradient(95deg, #fff, #99f6e4); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sky .rights-total-text { color: #cfc9f2; }
.sky-rights .gauge-label { color: #99f6e4; }
.rights-progress { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.rp-track { flex: 1; height: 6px; border-radius: 99px; background: rgba(255,255,255,.2); overflow: hidden; }
.rp-fill { height: 100%; width: 0; border-radius: 99px; background: #2dd4bf; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.rights-progress span { font-size: 11.5px; font-weight: 700; color: #99f6e4; white-space: nowrap; }
.sheet .rights-disclaimer { margin: 0 4px; font-size: 12px; }
.right-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--bg); display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.right-card.lvl-likely { border: 1.5px solid #bbf7d0; box-shadow: 0 1px 3px rgba(23,25,35,.08), 0 10px 28px rgba(22,163,74,.12); }
.right-card.lvl-likely .right-ico { background: var(--green-bg); }
.right-why { background: var(--green-bg); color: #166534; border-radius: 14px; padding: 10px 12px; }
@media (prefers-color-scheme: dark) { .right-why { color: #86efac; } .right-card.lvl-likely { border-color: #14532d; } }
.right-actions .btn { border-radius: 999px; }
.right-actions .btn-primary { box-shadow: 0 8px 20px rgba(79, 70, 229, .35); }

/* Barre flottante en verre */
.main { padding-bottom: calc(126px + env(safe-area-inset-bottom)); }
.bottomnav {
  left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom));
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(23, 25, 35, .18); padding: 8px 10px;
}
@media (prefers-color-scheme: dark) {
  .bottomnav { background: rgba(26, 28, 46, .85); border-color: rgba(255,255,255,.08); }
}
.nav-plus {
  width: 56px; height: 56px; margin-top: -30px; font-size: 30px;
  background: linear-gradient(120deg, #7c5cff, #a34bf5);
  box-shadow: 0 10px 30px rgba(124, 92, 255, .6), 0 0 0 5px var(--bg);
}
/* Ajustements apres capture : le montant des droits tenait mal en 38px sur
   390px ; le chiffre de la porte budget faisait doublon avec la jauge. */
.sky .rights-total-amount { font-size: 32px; }
.sky .rights-total-amount small { font-size: 15px; }
#door-money-stat { display: none; }

/* ==========================================================================
   Page de connexion : le volet heros du site, a cote de la carte.
   Pas de style inline possible ici (CSP stricte de login.php) : tout est la.
   ========================================================================== */
.login-body {
  background: radial-gradient(120% 120% at 18% -10%, var(--night-2), var(--night) 62%);
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
}
.login-stage {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 420px);
  gap: 40px; align-items: center; width: 100%; max-width: 1080px;
}
.login-stage .login-card { margin: 0; width: 100%; max-width: 420px; justify-self: center; }

.login-hero { position: relative; overflow: hidden; color: #fff; min-height: 560px; border-radius: 30px; padding: 44px 40px; }
.login-hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(124,92,255,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(124,92,255,.09) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 70% at 40% 40%, #000, transparent); mask-image: radial-gradient(70% 70% at 40% 40%, #000, transparent);
}
.login-hero-glow { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; animation: skyglow 8s ease-in-out infinite; }
.login-hero-glow-a { width: 420px; height: 420px; background: #7c5cff; opacity: .55; top: -140px; left: -120px; }
.login-hero-glow-b { width: 320px; height: 320px; background: #2dd4bf; opacity: .3; bottom: -120px; right: -80px; animation-delay: -4s; }
.login-hero-in { position: relative; z-index: 1; display: grid; gap: 18px; justify-items: start; }
.login-hero-brand { font-family: 'Unbounded', system-ui, sans-serif; font-weight: 800; font-size: 13px; letter-spacing: 1px; }
.login-hero-eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: #c7bfff;
  border: 1px solid rgba(199,191,255,.35); border-radius: 999px; padding: 6px 14px;
}
.login-hero-title { font-family: 'Unbounded', system-ui, sans-serif; font-weight: 800; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.06; margin: 0; }
.login-hero-title span { background: linear-gradient(95deg, #a78bfa, #2dd4bf 55%, #fbbf24); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 16px; font-weight: 600; color: #cfc9f2; }
.login-hero-list li { display: flex; align-items: center; gap: 12px; }
.login-hero-list li::before { content: ''; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; background: linear-gradient(120deg, #a78bfa, #2dd4bf); box-shadow: 0 0 12px rgba(45,212,191,.6); }

/* Les cartes flottantes du site, en clin d'oeil */
.login-hero-cards { position: relative; width: 100%; height: 150px; margin-top: 6px; }
.login-hero-card {
  position: absolute; background: rgba(255,255,255,.96); color: var(--text, #171923);
  border-radius: 16px; padding: 12px 16px; box-shadow: 0 18px 44px rgba(0,0,0,.45);
  animation: heroFloat 7s ease-in-out infinite; font-size: 13px; font-weight: 700;
}
.login-hero-card-rights { left: 0; top: 0; display: grid; gap: 1px; color: #171923; }
.login-hero-card-rights small { font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #7c5cff; }
.login-hero-card-rights b { font-family: 'Unbounded', system-ui, sans-serif; font-size: 20px; color: #16a34a; }
.login-hero-card-rights span { font-size: 11px; color: #666; font-weight: 500; }
.login-hero-card-apl { left: 230px; top: 24px; display: flex; align-items: center; gap: 8px; color: #171923; animation-duration: 9s; }
.login-hero-card-apl i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #dcfce7; font-style: normal; font-size: 12px; }
.login-hero-card-voice { left: 90px; top: 96px; background: rgba(20,17,58,.9); border: 1px solid rgba(124,92,255,.4); color: #d9d4f7; animation: none; }
@keyframes heroFloat { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(-2deg); } }
.login-hero-link { color: #c7bfff; font-weight: 700; font-size: 14px; text-decoration: none; border-bottom: 1px solid rgba(199,191,255,.4); }
.login-hero-link:hover { color: #fff; }

/* Telephone : le volet se resserre a l'essentiel au-dessus de la carte */
@media (max-width: 900px) {
  .login-stage { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .login-hero { min-height: 0; padding: 26px 22px 22px; border-radius: 24px; }
  .login-hero-cards, .login-hero-eyebrow { display: none; }
  .login-hero-title { font-size: 28px; }
  .login-hero-list { font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) { .login-hero-glow, .login-hero-card { animation: none; } }

/* La carte de connexion, dans le meme style que le volet : verre sombre,
   titre en Unbounded, onglets en pilule, champs qui s'allument au focus. */
.login-stage .login-card {
  background: rgba(22, 19, 58, .72); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08);
  padding: 32px 28px; color: #fff;
}
.login-stage .login-logo { font-size: 40px; filter: drop-shadow(0 0 18px rgba(124, 92, 255, .7)); }
.login-stage .login-title {
  font-family: 'Unbounded', system-ui, sans-serif; font-weight: 800; font-size: 19px; letter-spacing: 1px;
  background: linear-gradient(95deg, #fff, #c7bfff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-stage .login-sub { color: #b7aef2; }

.login-stage .login-tabs { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px; padding: 4px; }
.login-stage .login-tab { color: #b7aef2; border-radius: 999px; padding: 9px; box-shadow: none; }
.login-stage .login-tab.is-active { background: linear-gradient(110deg, #7c5cff, #a34bf5); color: #fff; box-shadow: 0 6px 20px rgba(124, 92, 255, .45); }

.login-stage .field > span, .login-stage .login-form label { color: #cfc9f2; font-size: 12.5px; font-weight: 700; }
.login-stage .login-form .input, .login-stage .login-form input {
  background: rgba(10, 8, 31, .6); border: 1.5px solid rgba(255, 255, 255, .12); color: #fff;
  border-radius: 14px; padding: 13px 14px; font-size: 16px;
  transition: border-color .18s, box-shadow .18s;
}
.login-stage .login-form input::placeholder { color: #6f6a94; }
.login-stage .login-form input:focus { border-color: #7c5cff; box-shadow: 0 0 0 4px rgba(124, 92, 255, .25); }
.login-stage .login-form input:-webkit-autofill,
.login-stage .login-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 1000px #16133a inset; caret-color: #fff;
}
.login-stage .login-form button, .login-stage .login-form .btn-primary {
  background: linear-gradient(110deg, #7c5cff, #a34bf5); color: #fff; border: 0; border-radius: 999px;
  padding: 14px; font-weight: 800; font-size: 15.5px; box-shadow: 0 10px 30px rgba(124, 92, 255, .5);
  transition: transform .18s, box-shadow .18s;
}
.login-stage .login-form button:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(124, 92, 255, .6); }
.login-stage .login-form .check, .login-stage .login-form .check span { color: #cfc9f2; }

.login-stage .login-error { background: rgba(220, 38, 38, .18); color: #fca5a5; border: 1px solid rgba(252, 165, 165, .3); border-radius: 14px; }
.login-stage .login-info { background: rgba(45, 212, 191, .14); color: #99f6e4; border: 1px solid rgba(45, 212, 191, .35); border-radius: 14px; }
.login-stage .login-foot { color: #b7aef2; }
.login-stage .login-foot a { color: #fff; }
.login-stage .login-legal a { color: #8f89b8; }
.login-stage .login-sent h2 { color: #fff; }
.login-stage .login-sent p { color: #cfc9f2; }

/* Telephone : la carte prend la largeur, marges reduites, pas de zoom iOS (16px) */
@media (max-width: 900px) {
  .login-body { padding: 14px; align-content: start; }
  .login-stage .login-card { max-width: none; padding: 24px 18px; border-radius: 24px; }
  .login-stage .login-logo { font-size: 34px; }
}
@media (max-width: 380px) {
  .login-stage .login-card { padding: 20px 14px; }
  .login-hero { padding: 22px 18px 18px; }
}

/* ------------------------------------------------------------- Parcours de demarrage */
.btn-sm { padding: 6px 11px; font-size: 13px; }
.journey-card { padding: 14px; border-left: 4px solid var(--primary); margin-bottom: 12px; }
.journey-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.journey-ico { font-size: 26px; }
.journey-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.journey-main b { font-size: 15px; }
.journey-main span { font-size: 13px; color: var(--muted); }
.journey-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.jchip {
  font-size: 12.5px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
}
.jchip.is-done { background: var(--green-bg); border-color: var(--green); color: var(--green); font-weight: 600; }
.journey-progress { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 12px; }
.journey-progress-fill {
  height: 100%; border-radius: 999px; transition: width .3s ease;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.journey-stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.jstep {
  display: grid; justify-items: center; gap: 4px; padding: 8px 4px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  color: var(--muted); font-size: 12px; font-family: inherit; text-align: center;
}
.jstep-num {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; background: var(--card); border: 1px solid var(--line);
}
.jstep.is-current { border-color: var(--primary); color: var(--text); }
.jstep.is-current .jstep-num { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.jstep.is-done { border-color: var(--green); color: var(--green); }
.jstep.is-done .jstep-num { background: var(--green); color: #fff; border-color: var(--green); }
.journey-intro { list-style: none; padding: 0; margin: 12px 0 4px; display: grid; gap: 10px; }
.journey-intro li { display: flex; gap: 12px; align-items: flex-start; }
.journey-intro li > span { font-size: 24px; }
.journey-intro li div { display: grid; gap: 2px; }
.journey-intro li b { font-size: 14.5px; }
.journey-intro li div span { font-size: 13px; color: var(--muted); }
.journey-ok {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin-bottom: 12px;
  border-radius: 12px; background: var(--green-bg); border: 1px solid var(--green);
}
.journey-ok > span { font-size: 22px; font-weight: 800; color: var(--green); }
.journey-ok div { display: grid; gap: 2px; min-width: 0; }
.journey-ok b { color: var(--green); }
.journey-ok div span { font-size: 13px; color: var(--muted); }
.jdocs { display: grid; gap: 8px; margin: 4px 0 8px; }
.jdoc {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; background: var(--bg); border: 1px solid var(--line);
}
.jdoc.is-reco { border-color: var(--primary); }
.jdoc.is-have { border-color: var(--green); background: var(--green-bg); }
.jdoc-ico { font-size: 22px; }
.jdoc-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.jdoc-main b { font-size: 13.5px; }
.jdoc-main b em { font-style: normal; font-size: 11px; color: var(--primary); font-weight: 600; margin-left: 4px; }
.jdoc-main span { font-size: 12px; color: var(--muted); }
.jdoc-ok { font-weight: 800; color: var(--green); font-size: 18px; }
.journey-recap { list-style: none; padding: 0; margin: 10px 0 4px; display: grid; gap: 6px; }
.journey-recap li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.journey-recap li.is-done { color: var(--text); }
.journey-recap li span { width: 22px; text-align: center; font-weight: 800; color: var(--green); }
.journey-actions { flex-wrap: wrap; }
