:root {
  color-scheme: light dark;
  /* marque */
  --bleu-fonce: #2e6d92;
  --bleu-fonce-2: #245a78;
  --bleu-clair: #85b5d6;
  --bleu-pale: #e8f1f8;
  /* surfaces et texte */
  --fond: #f5f8fb;
  --carte: #ffffff;
  --bordure: #e2eaf1;
  --texte: #1f3344;
  --texte-2: #586f81;
  --sur-primaire: #ffffff;
  --logo-fond: #ffffff;
  /* états */
  --vert: #3d8761;
  --vert-pale: #e6f2ea;
  --rouge: #c25554;
  --rouge-pale: #f7e6e6;
  --attention: #a35f00;
  --attention-pale: #f6ecd7;
  --neutre-pale: #eef1f4;
  --teal: #1f8f7e;
  /* forme */
  --ombre: 0 1px 2px rgba(20, 50, 75, 0.05), 0 6px 20px rgba(20, 50, 75, 0.07);
  --ombre-fine: 0 1px 4px rgba(0, 0, 0, 0.08);
  --rayon: 18px;
  --rayon-s: 12px;
  /* typographie */
  --police: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --t-xs: 12px; --t-sm: 13px; --t-base: 14.5px; --t-lg: 17px; --t-xl: 22px;
  --duree: 0.15s;
}
/* Mode sombre : suit le système, ou le choix fait dans Réglages (data-theme sur <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='clair']) {
    --bleu-fonce: #62a3cc; --bleu-fonce-2: #7fb5d8; --bleu-clair: #3f7ca3; --bleu-pale: #1d3446;
    --fond: #0e1822; --carte: #16232e; --bordure: #25374a; --texte: #e7eff6; --texte-2: #9db2c3;
    --sur-primaire: #0b1620;
    --vert: #56b585; --vert-pale: #17352a; --rouge: #e5807e; --rouge-pale: #3b2022;
    --attention: #e3a64a; --attention-pale: #3a2d15; --neutre-pale: #213140; --teal: #4cc3b0;
    --ombre: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 20px rgba(0, 0, 0, 0.28);
    --ombre-fine: 0 1px 4px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme='sombre'] {
  color-scheme: dark;
  --bleu-fonce: #62a3cc; --bleu-fonce-2: #7fb5d8; --bleu-clair: #3f7ca3; --bleu-pale: #1d3446;
  --fond: #0e1822; --carte: #16232e; --bordure: #25374a; --texte: #e7eff6; --texte-2: #9db2c3;
  --sur-primaire: #0b1620;
  --vert: #56b585; --vert-pale: #17352a; --rouge: #e5807e; --rouge-pale: #3b2022;
  --attention: #e3a64a; --attention-pale: #3a2d15; --neutre-pale: #213140; --teal: #4cc3b0;
  --ombre: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 20px rgba(0, 0, 0, 0.28);
  --ombre-fine: 0 1px 4px rgba(0, 0, 0, 0.4);
}
:root[data-theme='clair'] { color-scheme: light; }

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/app/inter-var.woff2') format('woff2');
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: var(--police);
  font-variant-numeric: tabular-nums;
  background: var(--fond);
  color: var(--texte);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---- entête ---- */
#entete {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px calc(14px - 6px);
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, var(--fond) 82%, transparent);
}
.marque { display: flex; align-items: center; gap: 10px; }
.logo { width: 40px; height: 40px; background: var(--logo-fond); border-radius: 12px; box-shadow: var(--ombre); padding: 5px; }
.nom { font-size: 21px; font-weight: 700; letter-spacing: 0.4px; color: var(--bleu-fonce); }
.btn-texte {
  border: none; background: none; color: var(--texte-2);
  font-size: 14px; cursor: pointer; padding: 8px;
}

/* ---- navigation basse ---- */
#navigation {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: var(--carte);
  border-top: 1px solid var(--bleu-pale);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
}
#navigation a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--texte-2); font-size: 10.5px;
  padding: 4px 2px; border-radius: 12px; flex: 1 1 0; min-width: 0;
}
#navigation a svg { width: 23px; height: 23px; }
#navigation a.actif { color: var(--bleu-fonce); font-weight: 600; }
.cache { display: none !important; }

/* ---- fil d'Ariane (global, au-dessus de la vue) ---- */
.fil-ariane {
  max-width: 760px; width: 100%; margin: 0 auto;
  padding: 0 10px 2px; font-size: 12.5px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  color: var(--texte-2);
}
.fil-ariane button {
  border: none; background: none; padding: 3px 2px; cursor: pointer;
  font: inherit; color: var(--bleu-fonce); font-weight: 600;
  text-decoration: underline dotted var(--bleu-pale) 2px; text-underline-offset: 3px;
}
.fil-ariane button:disabled, .fil-ariane .courant {
  color: var(--texte-2); font-weight: 600; text-decoration: none; cursor: default;
}
.fil-ariane .sep { color: var(--texte-2); opacity: .6; }
@media (min-width: 640px) {
  .fil-ariane { padding-left: 16px; padding-right: 16px; }
}

/* ---- structure ---- */
#vue { flex: 1; padding: 8px 10px calc(90px + env(safe-area-inset-bottom)); max-width: 760px; width: 100%; margin: 0 auto; }
@media (min-width: 640px) {
  #vue { padding-left: 16px; padding-right: 16px; }
}

h1 { font-size: 22px; color: var(--bleu-fonce); margin: 10px 0 4px; }
.sous-titre { color: var(--texte-2); font-size: 13.5px; margin-bottom: 16px; }

/* ---- cartes & tuiles ---- */
.carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 18px; margin-bottom: 14px; }
.grille-tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.tuile {
  background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 16px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 8px; min-height: 118px;
  transition: transform 0.12s ease;
  border: 1px solid transparent;
}
.tuile:active { transform: scale(0.97); }
.tuile .icone {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bleu-pale); color: var(--bleu-fonce);
}
.tuile .icone svg { width: 21px; height: 21px; }
.tuile .titre { font-size: 12.5px; font-weight: 600; color: var(--texte-2); letter-spacing: 0.3px; text-transform: uppercase; }
.tuile .valeur { font-size: 24px; font-weight: 700; color: var(--bleu-fonce); line-height: 1.1; }
.tuile .detail { font-size: 12.5px; color: var(--texte-2); }
.tuile.boutons { justify-content: space-between; }
.tuile.boutons .rangee { display: flex; gap: 8px; }

/* ---- boutons ---- */
.btn {
  border: none; border-radius: 14px; padding: 11px 14px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--bleu-pale); color: var(--bleu-fonce);
  transition: transform 0.1s ease;
}
.btn:active { transform: scale(0.96); }
.btn.primaire { background: var(--bleu-fonce); color: var(--sur-primaire); }
.btn.clair { background: var(--bleu-clair); color: var(--sur-primaire); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-texte:hover { color: var(--bleu-fonce); }

/* ---- formulaire login ---- */
#vue.login { display: flex; flex-direction: column; justify-content: center; min-height: 85dvh; }
.logo-login { width: 92px; height: 92px; margin: 0 auto 14px; background: var(--logo-fond); border-radius: 26px; box-shadow: var(--ombre); padding: 12px; }
h1.titre-login { text-align: center; margin: 0 0 4px; }
input[type='password'], input[type='text'] {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--bleu-pale);
  font-size: 16px; outline: none; background: var(--carte); color: var(--texte);
}
input:focus { border-color: var(--bleu-clair); }
.champ { margin-bottom: 12px; }

/* ---- balance ---- */
.soldes { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.solde-bloc { text-align: center; padding: 14px 6px; }
.solde-bloc .montant { font-size: 19px; font-weight: 700; color: var(--bleu-fonce); }
.solde-bloc .etiquette { font-size: 12px; color: var(--texte-2); }
.solde-bloc.positif .montant { color: var(--vert); }
.solde-bloc.negatif .montant { color: var(--rouge); }
.montant-positif { color: var(--vert); font-weight: 600; }
.montant-negatif { color: var(--rouge); font-weight: 600; }
.ligne-grise { opacity: 0.45; }
.montant-gris { color: var(--texte-2); font-weight: 500; }

section.mouvements h2 { font-size: 15px; color: var(--bleu-fonce); margin: 18px 2px 8px; }
.ligne-mvt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--carte); border-radius: 14px; padding: 12px 16px; margin-bottom: 7px;
  box-shadow: var(--ombre);
}
.ligne-mvt .gauche { min-width: 0; }
.ligne-mvt .nom-mvt { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-mvt .detail-mvt { font-size: 12px; color: var(--texte-2); }
.ligne-mvt .montant-mvt { font-weight: 700; white-space: nowrap; }

/* ---- événements ---- */
.barre-outils { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.barre-outils select, .barre-outils .seg { font-size: 13px; }
.seg { display: inline-flex; border-radius: 12px; background: var(--bleu-pale); padding: 3px; }
.seg button {
  border: none; background: none; padding: 7px 13px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--texte-2); cursor: pointer;
}
.seg button.actif { background: var(--carte); color: var(--bleu-fonce); box-shadow: var(--ombre-fine); }
select {
  border: 1.5px solid var(--bleu-pale); border-radius: 12px; padding: 8px 10px;
  background: var(--carte); color: var(--texte); outline: none;
}
.navigateur { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.navigateur .periode { font-weight: 700; color: var(--bleu-fonce); font-size: 15px; }
.btn-nav {
  width: 38px; height: 38px; border-radius: 12px; border: none;
  background: var(--bleu-pale); color: var(--bleu-fonce); font-size: 17px; cursor: pointer;
}

/* (les styles de l'agenda sont plus bas : section « agenda ») */
.evt-date {
  min-width: 46px; text-align: center; background: var(--bleu-pale);
  border-radius: 10px; padding: 6px 4px;
}
.evt-date .jour { font-size: 17px; font-weight: 700; color: var(--bleu-fonce); line-height: 1; }
.evt-date .mois { font-size: 11px; color: var(--texte-2); text-transform: uppercase; }
.badge-type {
  font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--bleu-fonce); color: var(--sur-primaire); white-space: nowrap;
}
.badge-type.coaching { background: var(--bleu-clair); }

/* ---- upload ---- */
.file-invisible { display: none; }
.zone-upload {
  border: 2px dashed var(--bleu-clair); border-radius: var(--rayon);
  padding: 26px 16px; text-align: center; color: var(--texte-2); font-size: 14px;
  background: var(--carte); margin-bottom: 14px; cursor: pointer;
}
.zone-upload.avec-fichier { border-style: solid; color: var(--bleu-fonce); font-weight: 600; }
.apercu { max-width: 130px; max-height: 130px; border-radius: 12px; margin: 10px auto 0; display: block; }
.bandeau-ok { background: var(--vert-pale); color: var(--vert); border-radius: 14px; padding: 13px 16px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.bandeau-err { background: var(--rouge-pale); color: var(--rouge); border-radius: 14px; padding: 13px 16px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.compteur-candidats { font-size: 12.5px; color: var(--texte-2); margin: 12px 2px 8px; }

/* ---- batchs ---- */
.flux-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--carte); border-radius: 14px; padding: 13px 16px; margin-bottom: 8px; box-shadow: var(--ombre); }
.flux-ligne .nom-flux { font-weight: 700; font-size: 14.5px; }
.flux-ligne .desc-flux { font-size: 12px; color: var(--texte-2); margin-top: 2px; }
.flux-ligne .etat-flux { font-size: 11.5px; margin-top: 4px; }
.statut { display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 700; font-size: 11.5px; }
.statut.ok { background: var(--vert-pale); color: var(--vert); }
.statut.erreur { background: var(--rouge-pale); color: var(--rouge); }
.statut.en-cours { background: var(--bleu-pale); color: var(--bleu-fonce); }
.statut.passif { background: var(--neutre-pale); color: var(--texte-2); }
.mini { font-size: 12px; color: var(--texte-2); }

/* ---- divers ---- */
.charge { text-align: center; color: var(--texte-2); padding: 40px 0; font-size: 14px; }
.erreur-page { text-align: center; color: var(--rouge); padding: 30px 10px; font-weight: 600; }

/* ---- indicateurs de chargement (spinner + skeleton) ---- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.spinner {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--bleu-pale); border-top-color: var(--bleu-fonce);
  animation: spin 0.7s linear infinite;
}
.charge-bloc { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--texte-2); padding: 34px 0; font-size: 14px; }
.skeleton { background: var(--bleu-pale); animation: pulse 1.2s ease-in-out infinite; }
.skel-ligne { height: 56px; border-radius: 12px; margin-bottom: 6px; }
.skel-tuile { min-height: 118px; border-radius: var(--rayon); }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
#vue.page-enter { animation: page-in 0.18s ease; }
@media (prefers-reduced-motion: reduce) {
  .spinner, .skeleton, #barre-rbt.monte, #vue.page-enter { animation: none; }
}
@media (min-width: 640px) {
  .grille-tuiles { grid-template-columns: 1fr 1fr; }
  .colonne-jour { min-height: 300px; }
}

/* ---- remboursements (RBT) ---- */
.ligne-rbt {
  display: flex; align-items: center; gap: 10px;
  background: var(--bleu-pale); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px;
  cursor: pointer; font-size: 14px;
}
.ligne-rbt input[type='checkbox'] { width: 20px; height: 20px; accent-color: var(--bleu-fonce); flex: none; }
.ligne-rbt:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.ligne-rbt .gauche { min-width: 0; display: flex; flex-direction: column; }
.ligne-rbt .nom-mvt { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-rbt .detail-mvt { font-size: 12px; color: var(--texte-2); }
.ligne-rbt .montant-mvt { font-weight: 700; white-space: nowrap; margin-left: auto; }
.rbt-tout {
  display: flex; align-items: center; gap: 10px; padding: 6px 2px 8px;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--texte);
}
.rbt-tout input { width: 20px; height: 20px; accent-color: var(--bleu-fonce); flex: none; }
#barre-rbt {
  position: fixed; left: 0; right: 0; bottom: calc(52px + env(safe-area-inset-bottom)); z-index: 15;
  background: var(--carte); border-top: 1px solid var(--bleu-pale); box-shadow: var(--ombre);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--texte-2);
}
#barre-rbt.actif { color: var(--texte); }
@keyframes barre-monte { from { transform: translateY(110%); } to { transform: translateY(0); } }
#barre-rbt.monte { animation: barre-monte 0.22s ease; }
#barre-rbt .btn-principal {
  border: none; background: var(--bleu-fonce); color: var(--sur-primaire); font-weight: 700; font-size: 14px;
  border-radius: 12px; padding: 11px 16px; cursor: pointer;
}
#barre-rbt .btn-principal:disabled { background: var(--bleu-pale); color: var(--texte-2); cursor: not-allowed; }
.btn-payer {
  border: none; background: var(--vert); color: var(--sur-primaire); font-weight: 700; font-size: 14px;
  border-radius: 12px; padding: 11px 16px; cursor: pointer;
}
.btn-secondaire {
  border: 1px solid var(--bleu-fonce); color: var(--bleu-fonce); background: none; font-weight: 600; font-size: 14px;
  border-radius: 12px; padding: 10px 14px; cursor: pointer; text-decoration: none; display: inline-block;
}

/* ===== projection budgétaire ===== */
.titre-graphe { font-size: 15px; color: var(--bleu-fonce); margin: 0 0 10px; }
.graphe { width: 100%; height: auto; display: block; }
.graphe-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.graphe-scroll .graphe { min-width: 340px; }
.legende { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--texte-2); }
.legende span { display: inline-flex; align-items: center; gap: 5px; }
.legende i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.tab-proj { width: 100%; border-collapse: collapse; font-size: 12px; }
.tab-proj th, .tab-proj td { padding: 6px 7px; text-align: right; white-space: nowrap; }
.tab-proj th { color: var(--texte-2); font-weight: 600; border-bottom: 1px solid var(--bleu-pale); }
.tab-proj th:first-child, .tab-proj td:first-child { text-align: left; }
.tab-proj td { border-bottom: 1px solid var(--bleu-pale); }
.tab-proj tr.mois-courant { background: var(--bleu-pale); }

/* ===== projection : tableau cliquable + panneau détail ===== */
.td-clic { cursor: pointer; text-decoration: underline dotted var(--bleu-pale) 2px; text-underline-offset: 3px; }
.td-clic.actif { background: var(--bleu-pale); border-radius: 6px; text-decoration: none; font-weight: 700; }
.carte-interne { background: var(--bleu-pale); border-radius: 12px; padding: 12px 14px; }
.liste-detail { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.liste-detail li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--bordure); }
.liste-detail li:last-child { border-bottom: none; }
.lien-detail { color: var(--bleu-fonce); text-decoration: none; font-weight: 600; }
.lien-detail:active, .lien-detail:hover { text-decoration: underline; }

/* ===== paiements mensuels (salaire + loyer) ===== */
.mensuel-ecart {
  display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap;
  background: var(--attention-pale); border-radius: 10px; padding: 8px 10px;
}
.mensuel-ecart input[type='number'] {
  width: 120px; padding: 7px 10px; border-radius: 10px;
  border: 1px solid var(--bleu-pale); font-size: 14px;
}

/* ---- statistiques ---- */
.filtres-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filtres-stats select { flex: 1 1 160px; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--bleu-pale); background: var(--carte); font-size: 14px; }
.grille-kpi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 14px; }
.kpi-val { font-size: 20px; font-weight: 700; margin: 2px 0; }
.titre-bloc { font-size: 15px; margin: 0 0 10px; }
.tab-scroll { overflow-x: auto; }
.tab-stats { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tab-stats th { text-align: left; font-weight: 600; color: var(--texte-2); font-size: 12px; padding: 4px 6px; }
.tab-stats td { padding: 8px 6px; border-top: 1px solid var(--bleu-pale); }
.tab-stats .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tab-stats tr.total td { font-weight: 700; }
.kpi-cliquable { cursor: pointer; border: 1px solid transparent; }
.kpi-cliquable.ouvert, .kpi-cliquable:hover { border-color: var(--bleu-fonce); }

/* ===== v82 : réorganisation de la navigation ===== */
.btn-reglages {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: var(--texte-2); text-decoration: none;
}
.btn-reglages svg { width: 22px; height: 22px; }
.btn-reglages:hover, .btn-reglages:focus-visible { color: var(--bleu-fonce); background: var(--bleu-pale); outline: none; }

#navigation a { position: relative; font-size: 11.5px; }
#navigation a svg { width: 24px; height: 24px; }
.pastille-nav {
  position: absolute; top: -1px; left: calc(50% + 6px);
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  background: var(--rouge); color: var(--sur-primaire); font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
}
.pastille-nav.info { background: var(--bleu-fonce); }

.sous-onglets { max-width: 760px; width: 100%; margin: 0 auto; padding: 4px 10px 2px; }
.sous-onglets .seg { display: flex; width: 100%; }
.sous-onglets .seg a {
  flex: 1; text-align: center; text-decoration: none; padding: 8px 6px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--texte-2);
}
.sous-onglets .seg a.actif { background: var(--carte); color: var(--bleu-fonce); box-shadow: var(--ombre-fine); }
@media (min-width: 640px) { .sous-onglets { padding-left: 16px; padding-right: 16px; } }

/* ===== réglages ===== */
.liste-reglages { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 2px 16px; margin-bottom: 14px; }
.ligne-reglage {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 0; border: none; background: none; width: 100%; text-align: left;
  font: inherit; color: var(--texte); text-decoration: none; cursor: pointer;
}
.ligne-reglage + .ligne-reglage { border-top: 1px solid var(--bleu-pale); }
.ligne-reglage .nom-reglage { font-weight: 600; font-size: 14.5px; }
.ligne-reglage .detail-reglage { font-size: 12.5px; color: var(--texte-2); margin-top: 2px; }
.ligne-reglage .etat-reglage { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ligne-reglage .etat-reglage.ok { color: var(--vert); }
.ligne-reglage .etat-reglage.ko { color: var(--rouge); }
.ligne-reglage .etat-reglage.neutre { color: var(--texte-2); }
.ligne-reglage:focus-visible { outline: 2px solid var(--bleu-clair); outline-offset: 2px; border-radius: 8px; }

/* ===== accueil dynamique ===== */
.accueil-salut { margin: 6px 2px 12px; }
.accueil-salut .jour { font-size: 12.5px; color: var(--texte-2); }
.accueil-salut .bonjour { font-size: 20px; font-weight: 700; color: var(--bleu-fonce); }
.accueil-chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.carte-chiffre {
  display: block; min-width: 0; text-decoration: none; color: inherit;
  background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 14px;
  border: 1px solid transparent; transition: transform .12s ease;
}
.carte-chiffre:active { transform: scale(0.98); }
.carte-chiffre:focus-visible { outline: 2px solid var(--bleu-clair); outline-offset: 2px; }
.carte-chiffre .haut { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--texte-2); }
.carte-chiffre .chiffre { font-size: 22px; font-weight: 700; color: var(--bleu-fonce); margin: 8px 0 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.carte-chiffre .pied { font-size: 12px; color: var(--texte-2); }
.carte-chiffre.positif { background: var(--vert-pale); }
.carte-chiffre.positif .haut, .carte-chiffre.positif .chiffre, .carte-chiffre.positif .pied { color: var(--vert); }
.carte-chiffre.negatif { background: var(--rouge-pale); }
.carte-chiffre.negatif .haut, .carte-chiffre.negatif .chiffre, .carte-chiffre.negatif .pied { color: var(--rouge); }
.carte-chiffre .pied.alerte { color: var(--rouge); font-weight: 600; }
.carte-chiffre .pied.bon { color: var(--vert); font-weight: 600; }

.titre-section { font-size: 12.5px; font-weight: 600; color: var(--texte-2); margin: 14px 2px 7px; display: flex; justify-content: space-between; align-items: center; }
.titre-section button { border: none; background: none; color: var(--bleu-fonce); font: inherit; font-weight: 600; cursor: pointer; padding: 2px 0; }
.ligne-accueil {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; width: 100%; text-align: left;
  background: var(--carte); border-radius: 14px; padding: 11px 14px; margin-bottom: 7px; box-shadow: var(--ombre);
  border: none; font: inherit; cursor: pointer;
}
.ligne-accueil:focus-visible { outline: 2px solid var(--bleu-clair); outline-offset: 2px; }
.ligne-accueil .puce {
  width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--bleu-pale); color: var(--bleu-fonce); font-weight: 700; font-size: 14px;
}
.ligne-accueil .puce svg { width: 19px; height: 19px; }
.ligne-accueil .puce.danger { background: var(--rouge-pale); color: var(--rouge); }
.ligne-accueil .puce.alerte { background: var(--attention-pale); color: var(--attention); }
.ligne-accueil .puce.vert { background: var(--vert-pale); color: var(--vert); }
.ligne-accueil .corps { min-width: 0; flex: 1; }
.ligne-accueil .titre { font-weight: 600; font-size: 14.5px; }
.ligne-accueil .detail { font-size: 12.5px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-accueil .droite { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ligne-accueil .fleche { color: var(--texte-2); opacity: .6; flex: none; }
.bloc-nouveaux { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 2px 14px; margin-bottom: 7px; }
.bloc-nouveaux .ligne-accueil { box-shadow: none; padding-left: 0; padding-right: 0; margin: 0; border-radius: 0; background: none; cursor: default; }
.bloc-nouveaux .ligne-accueil + .ligne-accueil { border-top: 1px solid var(--bleu-pale); }
.etat-batchs { display: flex; align-items: center; gap: 8px; margin: 12px 4px 4px; font-size: 12.5px; color: var(--texte-2); text-decoration: none; }
.etat-batchs i { width: 9px; height: 9px; border-radius: 50%; background: var(--vert); flex: none; }
.etat-batchs.ko i { background: var(--rouge); }
.etat-batchs.ko { color: var(--rouge); font-weight: 600; }
.actions-rapides { display: flex; gap: 8px; margin: 14px 0 6px; }
.actions-rapides .btn { flex: 1; padding: 13px 14px; }
.skel-chiffre { min-height: 98px; border-radius: var(--rayon); }
@media (prefers-reduced-motion: reduce) { .carte-chiffre { transition: none; } }

[hidden] { display: none !important; }

/* ===== v83 : finitions (bordures, survol, focus, icônes, utilitaires) ===== */
.carte, .tuile, .ligne-mvt, .evt-ligne, .kpi, .flux-ligne, .colonne-jour, .cellule-jour,
.ligne-accueil, .bloc-nouveaux, .liste-reglages, .carte-chiffre { border: 1px solid var(--bordure); }
.bloc-nouveaux .ligne-accueil { border: none; }
.bloc-nouveaux .ligne-accueil + .ligne-accueil { border-top: 1px solid var(--bordure); }
button.ligne-mvt { font: inherit; color: inherit; width: 100%; text-align: left; cursor: pointer; }

button, a, .btn, .seg button, .ligne-mvt, .evt-ligne, .carte-chiffre, .ligne-accueil, .flux-ligne {
  transition: background-color var(--duree), border-color var(--duree), color var(--duree), transform var(--duree), filter var(--duree);
}
:focus-visible { outline: 2px solid var(--bleu-clair); outline-offset: 2px; }
input:focus-visible, select:focus-visible { outline: none; }
input:focus, select:focus { border-color: var(--bleu-clair); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bleu-clair) 30%, transparent); }
@media (hover: hover) {
  .btn:hover { filter: brightness(0.96); }
  .btn.primaire:hover { background: var(--bleu-fonce-2); filter: none; }
  .ligne-mvt:hover, .evt-ligne:hover, .ligne-accueil:hover, .carte-chiffre:hover, .flux-ligne:hover, .cellule-jour:hover { border-color: var(--bleu-clair); }
  #navigation a:hover { color: var(--bleu-fonce); }
  .seg button:hover:not(.actif), .sous-onglets .seg a:hover:not(.actif) { color: var(--bleu-fonce); }
  .btn-nav:hover { filter: brightness(0.95); }
}
@media (prefers-reduced-motion: reduce) {
  button, a, .btn, .ligne-mvt, .evt-ligne, .carte-chiffre, .ligne-accueil { transition: none; }
}

/* icônes (remplacent les emojis) */
.ico { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.22em; flex: none; }
.ico svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico:not(:last-child) { margin-right: 0.3em; }

/* utilitaires (remplacent des style="" répétés dans app.js) */
.mt-3 { margin-top: 3px; } .mt-4 { margin-top: 4px; } .mt-6 { margin-top: 6px; } .mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; } .mt-14 { margin-top: 14px; }
.mb-6 { margin-bottom: 6px; } .mb-8 { margin-bottom: 8px; }
.clicable { cursor: pointer; }
.txt-2 { color: var(--texte-2); }
.txt-2-sm { color: var(--texte-2); font-size: 13.5px; }
.txt-attention { color: var(--attention); }
.t-droite { text-align: right; }
.rangee-flex { display: flex; gap: 8px; flex-wrap: wrap; }
.resume-clic { cursor: pointer; font-weight: 700; padding: 4px 0; }
.titre-maj { font-size: 13px; font-weight: 600; color: var(--bleu-fonce); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }

/* ===== agenda (v84) : calendrier à pastilles + liste d'événements teintée ===== */
.formation { --c: var(--bleu-fonce); }
.coaching { --c: var(--teal); }
.pt { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--bleu-fonce)); flex: none; }
.agenda-carte { padding: 12px 12px 4px; }
.agenda-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.agenda-titre { flex: 1; border: none; background: none; font: inherit; font-size: 15px; font-weight: 700; color: var(--bleu-fonce); text-transform: capitalize; cursor: pointer; padding: 8px; border-radius: 10px; }
.agenda-titre.hors-periode::after { content: ' · aujourd’hui'; font-weight: 500; font-size: 12px; color: var(--texte-2); text-transform: none; }
.agenda-noms, .agenda-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.agenda-noms span { text-align: center; font-size: 12px; font-weight: 600; color: var(--texte-2); padding: 4px 0; }
.ag-jour {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 46px; padding: 4px 0 6px; border: none; border-radius: 12px; background: none; color: var(--texte);
  font: inherit; cursor: pointer;
}
.ag-jour .ag-num { font-size: 14.5px; font-weight: 500; line-height: 1; }
.ag-jour .ag-nom { font-size: 11px; font-weight: 600; color: var(--texte-2); text-transform: capitalize; line-height: 1; }
.ag-jour .ag-pts { display: flex; gap: 3px; height: 7px; }
.ag-jour .ag-pts .pt { width: 6px; height: 6px; }
.ag-jour.hors-mois { opacity: 0.4; }
.ag-jour.aujourdhui:not(.choisi) { background: var(--bleu-pale); color: var(--bleu-fonce); }
.ag-jour.aujourdhui .ag-num { font-weight: 700; }
.ag-jour.choisi { background: var(--bleu-fonce); color: var(--sur-primaire); }
.ag-jour.choisi .ag-nom { color: var(--sur-primaire); opacity: 0.85; }
.ag-jour.choisi .pt { background: var(--sur-primaire); }
@media (hover: hover) { .ag-jour:hover:not(.choisi) { background: var(--bleu-pale); } }
.agenda-bande .ag-jour { min-height: 60px; }
.agenda-legende { display: flex; justify-content: center; gap: 18px; font-size: 12px; color: var(--texte-2); padding: 10px 0 12px; }
.agenda-legende span { display: inline-flex; align-items: center; gap: 6px; }
.agenda-pied { border-top: 1px solid var(--bordure); margin: 0 -12px; padding: 12px 12px 10px; }
.agenda-pied-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 2px 8px; font-weight: 700; font-size: 14px; text-transform: capitalize; }
.agenda-pied-titre .txt-2 { font-size: 12.5px; font-weight: 500; text-transform: none; }
.agenda-groupe { margin-bottom: 14px; }
.agenda-liste { margin-top: 4px; }
.evt-carte {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--texte); cursor: pointer;
  margin-bottom: 7px; padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--c) 11%, var(--carte));
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
}
.evt-carte .evt-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.evt-carte .evt-titre { font-weight: 600; font-size: 14px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.evt-carte .evt-meta { font-size: 12.5px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evt-carte .evt-statut { font-size: 12px; font-weight: 600; color: var(--c); white-space: nowrap; }
.evt-carte.passe { opacity: 0.6; }
@media (hover: hover) { .evt-carte:hover { border-color: var(--c); } }
@media (min-width: 640px) { .ag-jour { min-height: 56px; } }

/* séances d'un coaching (annuler / reprogrammer) */
.seance { padding: 12px 0; }
.seance + .seance { border-top: 1px solid var(--bordure); }
.seance-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seance-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.seance-actions .btn { padding: 8px 12px; font-size: 13px; }
.btn.danger { color: var(--rouge); background: var(--rouge-pale); }
.seance-reprog { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.seance-reprog input[type='date'] { width: auto; flex: 1 1 100%; padding: 9px 12px; border-radius: 12px; border: 1.5px solid var(--bleu-pale); background: var(--carte); color: var(--texte); font: inherit; }
.seance.annulee .seance-date { text-decoration: line-through; }
.seance.annulee .nom-mvt { color: var(--texte-2); }

.seance-ajout { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--bordure); }
.seance-ajout > .btn { width: 100%; }
#liste-seances:empty { display: none; }

.btn-lien { background: none; border: 0; color: var(--texte-2, #5b6b7d); cursor: pointer; padding: 2px 6px; font-size: 14px; }
.btn-lien:hover { color: #c0392b; }
