/* Gestion Église — Likabo Tech */
:root {
  --bleu: #1e3a8a;
  --bleu-2: #2747a8;
  --bleu-clair: #e8eefc;
  --or: #b7791f;
  --or-clair: #fdf3e1;
  --vert: #15803d;
  --vert-clair: #e7f6ec;
  --rouge: #b91c1c;
  --rouge-clair: #fdecec;
  --texte: #1f2937;
  --gris: #6b7280;
  --bord: #e5e7eb;
  --fond: #f4f6fb;
  --blanc: #fff;
  --ombre: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --rayon: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--fond); color: var(--texte); font-size: 15px; line-height: 1.45;
}
a { color: var(--bleu-2); }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.25; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.muted { color: var(--gris); font-size: .88rem; }
.hidden { display: none !important; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Boutons & formulaires ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid transparent; border-radius: 8px; padding: .55rem 1rem;
  font: inherit; font-weight: 600; cursor: pointer; background: var(--bleu); color: #fff;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--bleu-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sec { background: #fff; color: var(--bleu); border-color: #c7d2fe; }
.btn.sec:hover { background: var(--bleu-clair); }
.btn.or { background: var(--or); } .btn.or:hover { background: #9c6419; }
.btn.danger { background: #fff; color: var(--rouge); border-color: #f5c2c2; }
.btn.danger:hover { background: var(--rouge-clair); }
.btn.petit { padding: .3rem .6rem; font-size: .83rem; font-weight: 500; }
.btn.bloc { width: 100%; }
.btn-lien { background: none; border: 0; color: var(--bleu-2); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; color: #374151; }
input, select, textarea {
  width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid #d1d5db; border-radius: 8px;
  background: #fff; color: var(--texte);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #c7d2fe; border-color: var(--bleu-2); }
textarea { min-height: 90px; resize: vertical; }
.champ { margin-bottom: .85rem; }
.grille { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grille-2 { display: grid; gap: .8rem; grid-template-columns: 1fr 1fr; }
.ligne { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.ligne.entre { justify-content: space-between; }
.case { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
.case input { width: auto; }

/* ---------- Pages d'accès ---------- */
.acces {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(160deg, #1e3a8a 0%, #2747a8 55%, #b7791f 140%);
}
.acces-carte { background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.2); padding: 1.8rem; width: 100%; max-width: 440px; }
.acces-carte.large { max-width: 560px; }
.logo { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.2rem; }
.logo-icone { width: 42px; height: 42px; border-radius: 10px; background: var(--bleu); color: #fff; display: grid; place-items: center; font-size: 1.3rem; }
.logo b { display: block; font-size: 1.1rem; }
.logo small { color: var(--gris); }
.msg { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.msg.err { background: var(--rouge-clair); color: var(--rouge); }
.msg.ok { background: var(--vert-clair); color: var(--vert); }
.msg.info { background: var(--bleu-clair); color: var(--bleu); }
.msg.warn { background: var(--or-clair); color: #7c4a0b; }

/* ---------- Structure de l'application ---------- */
.app { display: flex; min-height: 100vh; }
.barre-laterale {
  width: 255px; background: #0f1f4d; color: #cbd5f5; flex-shrink: 0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.barre-laterale .entete { padding: 1rem 1rem .8rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.barre-laterale .entete b { color: #fff; display: block; font-size: 1rem; }
.barre-laterale .entete small { color: #93a4d8; }
.menu-section { padding: .7rem .6rem .2rem; }
.menu-section > span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7d8fc7; padding: 0 .5rem .3rem; }
.menu-section a {
  display: flex; gap: .55rem; align-items: center; padding: .5rem .6rem; border-radius: 8px; color: #dbe3fb;
  text-decoration: none; font-size: .92rem;
}
.menu-section a:hover { background: rgba(255,255,255,.07); }
.menu-section a.actif { background: #2747a8; color: #fff; }
.menu-section a .ico { width: 1.2rem; text-align: center; }
.barre-laterale .pied { margin-top: auto; padding: .8rem 1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .82rem; }
.barre-laterale .pied button { color: #fca5a5; }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.haut {
  background: #fff; border-bottom: 1px solid var(--bord); padding: .7rem 1.2rem; display: flex; align-items: center;
  gap: .8rem; position: sticky; top: 0; z-index: 20;
}
.haut .titre { font-weight: 700; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.burger { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--bleu); padding: 0 .2rem; }
.contenu { padding: 1.2rem; max-width: 1200px; width: 100%; }
.voile { display: none; }

.bandeau { padding: .6rem 1.2rem; font-size: .9rem; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.bandeau.essai { background: var(--or-clair); color: #7c4a0b; }
.bandeau.bloque { background: var(--rouge-clair); color: var(--rouge); }

/* ---------- Cartes & tableaux ---------- */
.carte { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.1rem; box-shadow: var(--ombre); margin-bottom: 1rem; }
.carte > h2:first-child, .carte > h3:first-child { margin-top: 0; }
.kpis { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1rem; }
.kpi { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: .9rem 1rem; box-shadow: var(--ombre); }
.kpi span { display: block; font-size: .8rem; color: var(--gris); }
.kpi b { display: block; font-size: 1.25rem; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.kpi.bleu { border-left: 4px solid var(--bleu); } .kpi.or { border-left: 4px solid var(--or); }
.kpi.vert { border-left: 4px solid var(--vert); } .kpi.rouge { border-left: 4px solid var(--rouge); }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--bord); text-align: left; vertical-align: top; }
th { background: #f8fafc; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #4b5563; }
tr.cliquable { cursor: pointer; } tr.cliquable:hover td { background: #f8faff; }
tfoot td { font-weight: 700; background: #f8fafc; }
.vide { text-align: center; color: var(--gris); padding: 1.5rem; }

.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #eef2ff; color: var(--bleu); }
.badge.vert { background: var(--vert-clair); color: var(--vert); }
.badge.rouge { background: var(--rouge-clair); color: var(--rouge); }
.badge.or { background: var(--or-clair); color: #7c4a0b; }
.badge.gris { background: #f3f4f6; color: #4b5563; }

.onglets { display: flex; gap: .3rem; border-bottom: 1px solid var(--bord); margin-bottom: 1rem; overflow-x: auto; }
.onglets button { background: none; border: 0; padding: .6rem .9rem; font: inherit; font-weight: 600; color: var(--gris); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.onglets button.actif { color: var(--bleu); border-bottom-color: var(--bleu); }

.filtres { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filtres .champ { margin: 0; min-width: 140px; flex: 1; }
.filtres .champ.court { flex: 0 0 auto; }

/* ---------- Modale & toast ---------- */
.modale-fond { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 5vh 12px; overflow-y: auto; }
.modale { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modale.large { max-width: 820px; }
.modale header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--bord); }
.modale header h2 { margin: 0; }
.modale header button { background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--gris); }
.modale .corps { padding: 1.1rem 1.2rem; }
.modale footer { padding: .8rem 1.2rem; border-top: 1px solid var(--bord); display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
#toasts { position: fixed; bottom: 16px; right: 16px; left: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; z-index: 200; pointer-events: none; }
.toast { background: #111827; color: #fff; padding: .7rem 1rem; border-radius: 8px; box-shadow: var(--ombre); max-width: 420px; pointer-events: auto; font-size: .9rem; }
.toast.err { background: var(--rouge); } .toast.ok { background: var(--vert); }

/* ---------- Calendrier ---------- */
.calendrier { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendrier .jour-nom { font-size: .75rem; font-weight: 700; color: var(--gris); text-align: center; padding: .3rem 0; }
.calendrier .jour { background: #fff; border: 1px solid var(--bord); border-radius: 8px; min-height: 92px; padding: .3rem; font-size: .8rem; cursor: pointer; overflow: hidden; }
.calendrier .jour.hors { background: #f9fafb; color: #c0c4cc; cursor: default; }
.calendrier .jour.aujourdhui { border-color: var(--or); box-shadow: inset 0 0 0 1px var(--or); }
.calendrier .jour .n { font-weight: 700; }
.calendrier .evt { display: block; background: var(--bleu-clair); color: var(--bleu); border-radius: 5px; padding: .15rem .3rem; margin-top: .2rem; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendrier .jour.dimanche .n { color: var(--rouge); }

.fiche dl { display: grid; grid-template-columns: 150px 1fr; gap: .35rem .8rem; margin: 0; }
.fiche dt { color: var(--gris); font-size: .85rem; }
.fiche dd { margin: 0; white-space: pre-wrap; }
.entretien { border-left: 3px solid var(--or); background: #fffcf6; padding: .6rem .8rem; border-radius: 0 8px 8px 0; margin-bottom: .6rem; }
.entretien .ligne { font-size: .82rem; color: var(--gris); }
.entretien p { margin: .3rem 0 0; white-space: pre-wrap; }
.doc-contenu { white-space: pre-wrap; line-height: 1.6; background: #fcfcfd; border: 1px solid var(--bord); border-radius: 8px; padding: 1rem; max-height: 60vh; overflow-y: auto; }

/* ---------- Rapport financier (format de la fiche papier) ---------- */
.rapport { background: #fff; border: 1px solid #111; padding: 16px; font-family: 'Times New Roman', Times, serif; color: #000; font-size: 14px; max-width: 820px; margin: 0 auto; }
.rapport .entete-doc { display: flex; gap: 12px; align-items: center; border-bottom: 2px solid #1e3a8a; padding-bottom: 8px; margin-bottom: 10px; }
.rapport .entete-doc img { width: 62px; height: 62px; object-fit: contain; }
.rapport .entete-doc .denom { font-size: 11px; text-transform: uppercase; color: #444; letter-spacing: .03em; }
.rapport .entete-doc .nom { font-size: 1.25rem; font-weight: 700; color: #1e3a8a; }
.rapport .entete-doc .coord { font-size: 11.5px; color: #333; }
.rapport h1 { text-align: center; background: #fce9c4; border: 2px solid #000; padding: .4rem; font-size: 1.6rem; letter-spacing: .03em; margin-bottom: .4rem; }
.rapport .periode { text-align: center; font-weight: 700; font-size: 1.1rem; text-decoration: underline; margin: .4rem 0 .6rem; }
.rapport .eglise-nom { text-align: center; font-weight: 700; font-size: 1rem; }
.rapport table { font-size: 13px; }
.rapport th, .rapport td { border: 1px solid #000; padding: 3px 6px; background: none; text-transform: none; letter-spacing: 0; color: #000; font-size: 13px; }
.rapport th { font-weight: 700; text-align: center; }
.rapport .synthese td:first-child { font-weight: 700; text-align: center; }
.rapport .synthese tr.fort td { font-weight: 700; font-size: 14px; }
.rapport h2 { font-size: 1.1rem; margin: 1rem 0 .3rem; }
.rapport .colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rapport .bloc-titre td { font-weight: 700; border-bottom: 1px solid #000; }
.rapport tr.total td { font-weight: 700; }
.rapport tr.sous td:first-child { padding-left: 18px; font-style: italic; }
.rapport .pied-rapport { margin-top: 1rem; display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.rapport .signatures { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin-top: 2.2rem; text-align: center; font-size: 13px; }
.rapport .signatures div { border-top: 1px solid #000; padding-top: .3rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .barre-laterale { position: fixed; left: -270px; top: 0; bottom: 0; z-index: 60; transition: left .2s; }
  .barre-laterale.ouverte { left: 0; }
  .voile.visible { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; }
  .burger { display: block; }
  .contenu { padding: 16px; }
}
@media (max-width: 640px) {
  .grille-2 { grid-template-columns: 1fr; }
  .fiche dl { grid-template-columns: 1fr; }
  .fiche dt { margin-top: .4rem; }
  .calendrier .jour { min-height: 62px; }
  .calendrier .evt { font-size: 0; padding: 0; height: 6px; }
  .rapport { padding: 8px; }
  .rapport .colonnes { grid-template-columns: 1fr; }
  .rapport th, .rapport td { font-size: 11.5px; padding: 2px 4px; }
  .kpi b { font-size: 1.1rem; }
  h1 { font-size: 1.25rem; }
  .table-mobile thead { display: none; }
  .table-mobile tr { display: block; border: 1px solid var(--bord); border-radius: 8px; margin-bottom: .6rem; background: #fff; }
  .table-mobile td { display: flex; justify-content: space-between; gap: 1rem; border: 0; border-bottom: 1px dashed #eef0f3; text-align: right; }
  .table-mobile td:last-child { border-bottom: 0; }
  .table-mobile td::before { content: attr(data-l); font-weight: 600; color: var(--gris); text-align: left; font-size: .8rem; }
  .table-mobile td.num { justify-content: space-between; }
  .table-mobile tfoot tr { background: #f8fafc; }
}

/* ---------- Impression ---------- */
@media print {
  body { background: #fff; }
  .barre-laterale, .haut, .bandeau, .no-print, #toasts, .voile { display: none !important; }
  .contenu { padding: 0; max-width: none; }
  .carte { border: 0; box-shadow: none; padding: 0; }
  .rapport { border: 0; max-width: none; }
  .rapport .colonnes { grid-template-columns: 1fr 1fr; }
}

/* =====================================================================
   Version 4 : thème bleu nuit & or, tableau de bord, communauté
   ===================================================================== */
:root { --nuit: #0f1f4d; --or-vif: #e0b25a; --or-texte: #8a5a12; }
.haut { background: var(--nuit); color: #fff; border-bottom: 3px solid var(--or-vif); }
.haut .burger { color: #fff; }
.haut .badge { background: var(--or-vif); color: var(--nuit); }
.barre-laterale { background: var(--nuit); }
.menu-section a.actif { background: var(--or-vif); color: var(--nuit); font-weight: 600; }
.menu-section a.actif:hover { background: #e8c070; }

.kpi-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; background: var(--or-clair); flex-shrink: 0; }
.stat { background: #fff; border: 1px solid var(--bord); border-radius: 12px; padding: 1rem; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.stat .tete { display: flex; align-items: center; gap: .6rem; font-weight: 600; color: #334155; }
.stat .tete small { display: block; font-weight: 400; color: var(--gris); font-size: .75rem; }
.stat .gros { font-size: 1.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .sous { font-size: .8rem; color: var(--gris); }
.stat .hausse { color: var(--vert); font-weight: 600; font-size: .8rem; }
.stat.mise-en-avant { background: #eef2fb; border-color: #c9d5f3; }
.devises-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; }
.devises-2 > div { border-left: 1px solid var(--bord); padding-left: .6rem; min-width: 0; }
.devises-2 > div:first-child { border-left: 0; padding-left: 0; }
.devises-2 .code { display: inline-block; font-size: .72rem; font-weight: 600; background: var(--bleu-clair); color: var(--bleu); border-radius: 6px; padding: .05rem .4rem; }
.stats-grille { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 1rem; }
.accueil-grille { display: grid; gap: 1rem; grid-template-columns: 1.4fr 1fr; align-items: start; }
.accueil-grille > * { min-width: 0; }
.carte h2 .lien { font-size: .8rem; font-weight: 500; float: right; }

/* Graphique */
.graphe { position: relative; }
.graphe svg { width: 100%; height: auto; display: block; overflow: visible; }
.graphe .infobulle { position: absolute; pointer-events: none; background: #111827; color: #fff; font-size: .78rem; padding: .4rem .6rem; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -110%); display: none; }
.legende { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: #374151; margin-top: .4rem; }
.legende i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: .35rem; }

/* Mini-calendrier */
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: .78rem; }
.mini-cal .nj { color: var(--gris); font-weight: 600; font-size: .7rem; padding: .2rem 0; }
.mini-cal .j { padding: .3rem 0; border-radius: 50%; aspect-ratio: 1; display: grid; place-items: center; }
.mini-cal .j.culte { background: var(--or-vif); color: var(--nuit); font-weight: 700; cursor: pointer; }
.mini-cal .j.auj { outline: 2px solid var(--bleu-2); }
.evenement { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem 0; border-bottom: 1px solid var(--bord); }
.evenement:last-child { border-bottom: 0; }
.evenement .point { width: 9px; height: 9px; border-radius: 50%; background: var(--or-vif); margin-top: .35rem; flex-shrink: 0; }
.evenement b { display: block; font-size: .9rem; }
.evenement span { font-size: .8rem; color: var(--gris); }

/* Messages */
.message { background: #fff; border: 1px solid var(--bord); border-radius: 12px; padding: .9rem 1rem; margin-bottom: .8rem; box-shadow: var(--ombre); }
.message .entete-msg { display: flex; gap: .6rem; align-items: center; margin-bottom: .4rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bleu); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.avatar.or { background: var(--or-vif); color: var(--nuit); }
.message .entete-msg .qui { flex: 1; min-width: 0; }
.message .entete-msg .qui b { display: block; }
.message .entete-msg .qui span { font-size: .78rem; color: var(--gris); }
.message h3 { margin: .2rem 0 .3rem; }
.message p { margin: .2rem 0; white-space: pre-wrap; }
.message audio { width: 100%; margin-top: .5rem; }
.msg-court { display: flex; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--bord); align-items: center; }
.msg-court:last-child { border-bottom: 0; }
.msg-court .txt { flex: 1; min-width: 0; }
.msg-court .txt b { display: block; font-size: .88rem; }
.msg-court .txt span { display: block; font-size: .8rem; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-court time { font-size: .72rem; color: var(--gris); white-space: nowrap; }
.enregistreur { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; padding: .7rem; }
.enregistreur .rec { width: 12px; height: 12px; border-radius: 50%; background: var(--rouge); animation: clignote 1s infinite; }
@keyframes clignote { 50% { opacity: .2; } }

/* Groupes */
.puces { display: flex; flex-wrap: wrap; gap: .45rem; }
.puce { display: inline-flex; align-items: center; gap: .35rem; background: #f1f5f9; border: 1px solid var(--bord); border-radius: 999px; padding: .25rem .7rem; font-size: .83rem; }
.puce i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.groupe-carte { border-left: 5px solid var(--bleu); }

/* Rendez-vous */
.rdv { display: flex; gap: .7rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--bord); }
.rdv:last-child { border-bottom: 0; }
.rdv .txt { flex: 1; min-width: 0; }
.rdv .txt b { display: block; }
.rdv .txt span { font-size: .8rem; color: var(--gris); }

/* Barre de navigation en bas (téléphone) */
.nav-bas { display: none; }
@media (max-width: 900px) {
  .accueil-grille { grid-template-columns: 1fr; }
  .nav-bas { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--bord); box-shadow: 0 -2px 10px rgba(15,23,42,.06); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .nav-bas a { flex: 1; text-align: center; text-decoration: none; color: #64748b; font-size: .68rem; padding: .3rem 0; border-radius: 8px; }
  .nav-bas a .ico { display: block; font-size: 1.2rem; line-height: 1.3; }
  .nav-bas a.actif { color: var(--nuit); background: #fdf3e1; font-weight: 600; }
  .contenu { padding-bottom: 86px; }
}
@media print { .nav-bas { display: none !important; } }
@media (min-width: 901px) { .stat.large { grid-column: span 2; } }
.mini-cal .j { aspect-ratio: auto; width: 32px; height: 32px; margin: 0 auto; font-size: .8rem; }
@media (min-width: 1200px) { .stats-grille { grid-template-columns: repeat(4, 1fr); grid-auto-flow: dense; } }
@media (max-width: 900px) { #toasts { bottom: 92px; } }

/* =====================================================================
   Version 5 : discussions (groupes & conversations privées avec le pasteur)
   ===================================================================== */
.pastille { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #dc2626; color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; }
.menu-section a .pastille { margin-left: auto; }
.nav-bas a { position: relative; }
.nav-bas a .pastille { position: absolute; top: 0; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; font-size: .65rem; }

.disc { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 150px); min-height: 460px; background: #fff; border: 1px solid var(--bord); border-radius: 14px; overflow: hidden; box-shadow: var(--ombre); }
.disc-liste { border-right: 1px solid var(--bord); overflow-y: auto; background: #fbfcfe; }
.disc-liste-tete { display: flex; flex-direction: column; gap: .5rem; padding: .8rem; border-bottom: 1px solid var(--bord); }
.disc-liste-tete:empty { display: none; }
.disc-section { padding: .8rem .9rem .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gris); }
.disc-item { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .65rem .9rem; border: 0; border-left: 3px solid transparent; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.disc-item:hover { background: #f1f4fa; }
.disc-item.actif { background: var(--or-clair); border-left-color: var(--or-vif); }
.disc-item-txt { flex: 1; min-width: 0; }
.disc-item-txt b, .disc-item-txt span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.disc-item-txt span { font-size: .8rem; color: var(--gris); }
.disc-item-fin { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; flex-shrink: 0; }
.disc-item-fin small { font-size: .72rem; color: var(--gris); }

.disc-fil { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f4f6fb; }
.disc-fil-tete { display: flex; align-items: center; gap: .65rem; padding: .7rem 1rem; background: #fff; border-bottom: 1px solid var(--bord); }
.disc-fil-titre { flex: 1; min-width: 0; }
.disc-fil-titre b { display: block; }
.disc-fil-titre span { font-size: .78rem; color: var(--gris); }
.disc-retour { display: none; font-size: 1.3rem; text-decoration: none; padding: .2rem .4rem; }
.disc-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .45rem; }
.disc-vide { margin: auto; max-width: 360px; text-align: center; color: var(--gris); padding: 2rem 1rem; }
.disc-jour { text-align: center; margin: .6rem 0 .2rem; }
.disc-jour span { background: #e2e8f0; color: #475569; font-size: .72rem; font-weight: 600; padding: .2rem .7rem; border-radius: 999px; }
.bulle { align-self: flex-start; max-width: min(78%, 560px); background: #fff; border: 1px solid var(--bord); border-radius: 4px 14px 14px 14px; padding: .5rem .75rem .35rem; box-shadow: 0 1px 1px rgba(15,23,42,.04); }
.bulle.moi { align-self: flex-end; background: #e6ecfb; border-color: #cfdaf6; border-radius: 14px 4px 14px 14px; }
.bulle-auteur { font-size: .78rem; font-weight: 700; color: var(--bleu); margin-bottom: .15rem; }
.bulle-auteur .badge { font-size: .62rem; padding: .05rem .4rem; vertical-align: 1px; }
.bulle-texte { white-space: pre-wrap; overflow-wrap: anywhere; }
.bulle .zone-audio { margin-top: .3rem; }
.bulle audio { width: 260px; max-width: 100%; height: 40px; }
.bulle-pied { display: flex; justify-content: flex-end; gap: .6rem; align-items: center; font-size: .7rem; color: var(--gris); margin-top: .2rem; }
.bulle-pied .btn-lien { font-size: .7rem; color: var(--rouge); opacity: 0; }
.bulle:hover .bulle-pied .btn-lien, .bulle:focus-within .bulle-pied .btn-lien { opacity: 1; }
@media (hover: none) { .bulle-pied .btn-lien { opacity: .8; } }

.disc-saisie { background: #fff; border-top: 1px solid var(--bord); padding: .6rem .7rem; }
.disc-saisie-ligne { display: flex; align-items: flex-end; gap: .45rem; }
.disc-saisie textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: .6rem .8rem; border-radius: 22px; }
.disc-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--bord); background: #f8fafc; font-size: 1.15rem; cursor: pointer; }
.disc-ico:hover { background: var(--or-clair); }
.disc-ico.enreg { background: var(--rouge-clair); border-color: #fca5a5; }
.disc-saisie .btn { height: 44px; border-radius: 22px; }
.disc-apercu { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: 0 0 .5rem; font-size: .85rem; }
.disc-apercu audio { height: 38px; max-width: 260px; }
.disc-apercu .rec { width: 12px; height: 12px; border-radius: 50%; background: var(--rouge); animation: clignote 1s infinite; }

@media (max-width: 900px) {
  .disc { grid-template-columns: 1fr; height: calc(100vh - 170px); height: calc(100dvh - 170px); border-radius: 12px; }
  .disc .disc-fil { display: none; }
  .disc.fil-ouvert .disc-liste { display: none; }
  .disc.fil-ouvert .disc-fil { display: flex; }
  .disc-retour { display: inline-block; }
  .bulle { max-width: 88%; }
  .disc-saisie .btn { padding: 0 .9rem; }
}
.disc-envoi-ico { display: none; font-size: 1.1rem; }
#disc-envoyer.envoi { opacity: .6; }
@media (max-width: 900px) {
  .disc-envoi-txt { display: none; }
  .disc-envoi-ico { display: inline; }
  .disc-saisie .btn#disc-envoyer { width: 44px; padding: 0; }
  .disc-ico { width: 40px; height: 40px; }
  .disc-saisie-ligne { gap: .35rem; }
}

/* Sélecteur de langue (pages d'accès) */
.barre-langue { display: flex; justify-content: flex-end; margin: -.6rem -.4rem .4rem 0; }
select.choix-langue { width: auto; min-width: 0; padding: .2rem .45rem; font-size: .8rem; border-radius: 6px; border: 1px solid var(--bord); background: #fff; color: inherit; cursor: pointer; }
.barre-laterale .langue-barre { margin: .4rem 0; }
.barre-laterale .langue-barre select { width: 100%; background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); font-size: .82rem; padding: .3rem .5rem; }
.barre-laterale .langue-barre option { color: #111; }

/* =====================================================================
   Espace Super Admin : navigation (retour vers l'application, onglets)
   ===================================================================== */
.haut.sa { flex-wrap: wrap; row-gap: .4rem; }
.nav-sa { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.nav-sa a, .nav-sa button.lien {
  color: #fff; text-decoration: none; padding: .38rem .7rem; border-radius: 8px; font: inherit; font-size: .88rem;
  font-weight: 500; background: none; border: 1px solid rgba(255,255,255,.22); cursor: pointer; white-space: nowrap;
}
.nav-sa a:hover, .nav-sa button.lien:hover { background: rgba(255,255,255,.12); }
.nav-sa button.lien { color: #fca5a5; border-color: rgba(252,165,165,.35); }
@media (max-width: 640px) {
  .haut.sa .titre { flex: 1 1 100%; white-space: normal; }
  .nav-sa { width: 100%; }
  .nav-sa { flex-wrap: nowrap; gap: .3rem; }
  .nav-sa a, .nav-sa button.lien { flex: 1 1 auto; text-align: center; padding: .38rem .4rem; font-size: .8rem; }
}

/* =====================================================================
   Version 11 : mariages et certificat de mariage
   ===================================================================== */
.sous-titre { margin: 1.1rem 0 .5rem; font-size: 1rem; color: var(--bleu); border-bottom: 1px solid #e2e8f0; padding-bottom: .25rem; }
.ligne-photo { display: flex; gap: 1rem; align-items: flex-start; }
.photo-choix { display: flex; flex-direction: column; align-items: center; gap: .35rem; flex: none; width: 110px; }
.photo-choix .btn { width: 100%; text-align: center; }
.photo-choix .btn-lien { font-size: .8rem; }
.photo-ovale { width: 92px; height: 116px; border-radius: 50%; border: 2px dashed #cbd5e1; overflow: hidden; display: grid; place-items: center; background: #f8fafc; color: #94a3b8; font-size: .8rem; }
.photo-ovale img { width: 100%; height: 100%; object-fit: cover; }
.champs-personne { flex: 1; min-width: 0; }
.ligne-parrain { display: grid; grid-template-columns: 110px 170px 1.4fr 1fr auto; gap: .4rem; margin-bottom: .4rem; align-items: center; }
.ligne-parrain select, .ligne-parrain input { min-width: 0; }
.mini-photo { width: 34px; height: 42px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: .5rem; border: 2px solid #e3c277; }
@media (max-width: 700px) {
  .ligne-photo { flex-direction: column; align-items: stretch; }
  .photo-choix { flex-direction: row; width: auto; align-items: center; }
  .photo-choix .btn { width: auto; }
  .ligne-parrain { grid-template-columns: 1fr 1fr; }
  .ligne-parrain input:nth-of-type(1) { grid-column: span 2; }
}

/* Fenêtre d'aperçu du certificat */
#cert-overlay { position: fixed; inset: 0; z-index: 300; background: #0f172a; overflow: auto; display: flex; flex-direction: column; }
.cert-barre { background: #fff; padding: .6rem 1rem; display: flex; flex-direction: column; gap: .35rem; position: sticky; top: 0; z-index: 2; }
.cert-barre small { color: var(--muted, #64748b); }
.cert-option { display: inline-flex; gap: .4rem; align-items: center; font-size: .9rem; white-space: nowrap; }
.cert-option input { width: auto; flex: none; margin: 0; }
.cert-scene { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 12px 8px 24px; }
.cert-echelle { position: relative; overflow: hidden; flex: none; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); background: #fff; }
.cert-echelle .cert { transform-origin: 0 0; }

/* Le certificat : 1120 x 790 px (A4 paysage) */
.cert { position: relative; width: 1120px; height: 790px; overflow: hidden; color: #0f1f4d; background: #f6ecd2;
  font-family: 'EB Garamond', 'Cormorant Garamond', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cert * { box-sizing: border-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cert-fond { position: absolute; inset: 0; background:
  radial-gradient(ellipse at 50% 42%, #fffaf0 0%, #f8efd8 55%, #ecdcb4 100%); }
.cert-fond::after { content: ''; position: absolute; inset: 0; opacity: .5;
  background: radial-gradient(circle at 12% 30%, rgba(201,146,46,.12) 0 90px, transparent 91px), radial-gradient(circle at 90% 70%, rgba(201,146,46,.12) 0 110px, transparent 111px); }
.cert-cadre { position: absolute; inset: 12px; border: 3px solid #c9922e; box-shadow: 0 0 0 1px #f1d27a, 0 0 0 4px #8a5a12 inset; }
.cert-bande { position: absolute; inset: 6px; border: 22px solid #14275f; box-shadow: inset 0 0 0 2px #d9a93e, 0 0 0 2px #d9a93e; }
.cert-angle { position: absolute; width: 124px; height: 124px; }
.cert-angle-svg { width: 100%; height: 100%; display: block; }
.cert-angle.a1 { left: 4px; top: 4px; }
.cert-angle.a2 { right: 4px; top: 4px; transform: scaleX(-1); }
.cert-angle.a3 { left: 4px; bottom: 4px; transform: scaleY(-1); }
.cert-angle.a4 { right: 4px; bottom: 4px; transform: scale(-1, -1); }

.cert-drapeau { position: absolute; left: 82px; top: 74px; width: 188px; height: 134px; padding: 6px; background: linear-gradient(135deg, #f6e19a, #c9922e 50%, #8a5a12); border-radius: 4px; box-shadow: 0 2px 5px rgba(60,40,0,.35); }
.cert-drapeau-in { width: 100%; height: 100%; border: 2px solid #14275f; background: #fff; overflow: hidden; }
.cert-drapeau-in svg { width: 100%; height: 100%; display: block; }
.cert-logo { position: absolute; right: 80px; top: 54px; width: 172px; height: 172px; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 3px #d9a93e, 0 0 0 5px #fff, 0 3px 8px rgba(60,40,0,.3); }
.cert-logo img { width: 100%; height: 100%; object-fit: contain; }

.cert-entete { position: absolute; left: 285px; right: 285px; top: 52px; text-align: center; }
.cert-pays { font: 600 15px/1.2 'Cinzel', 'Trajan Pro', Georgia, serif; letter-spacing: .07em; color: #8a5a12; white-space: nowrap; }
.cert-denom { font: 600 14px/1.2 'Cinzel', Georgia, serif; color: #8a5a12; letter-spacing: .05em; margin-top: 2px; }
.cert-eglise { font-family: 'UnifrakturCook', 'Old English Text MT', 'Palatino Linotype', Georgia, serif; font-weight: 700; line-height: 1.12; white-space: nowrap; margin-top: 4px;
  color: #b07d1e; background: linear-gradient(180deg, #f9e7a0 0%, #d9a93e 45%, #8a5a12 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(90, 50, 0, .35)); }
.cert-sep-svg { display: block; width: 420px; height: 26px; margin: 4px auto 0; }
.cert-sep-svg.bas { position: absolute; left: 350px; top: 288px; margin: 0; }

.cert-titre { position: absolute; left: 280px; top: 232px; width: 560px; height: 52px; background: #d9a93e; clip-path: polygon(0 0, 100% 0, 97% 50%, 100% 100%, 0 100%, 3% 50%); }
.cert-titre span { position: absolute; inset: 3px; background: linear-gradient(180deg, #1c3478, #0f1f4d); clip-path: polygon(0 0, 100% 0, 97% 50%, 100% 100%, 0 100%, 3% 50%);
  display: flex; align-items: center; justify-content: center; font: 700 31px/1 'Cinzel', 'Trajan Pro', Georgia, serif; letter-spacing: .04em; color: #f1d27a; text-shadow: 0 1px 2px rgba(0,0,0,.5); white-space: nowrap; }

.cert-medaillon { position: absolute; left: 80px; top: 250px; width: 250px; height: 312px; padding: 13px; border-radius: 50%;
  background: linear-gradient(135deg, #f6e19a, #c9922e 50%, #8a5a12); outline: 7px dotted #d9a93e; outline-offset: 3px; box-shadow: 0 3px 8px rgba(60,40,0,.35); }
.cert-medaillon.droite { left: auto; right: 80px; }
.cert-ovale { position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #fbf5e4; box-shadow: 0 0 0 2px #8a5a12 inset; }
.cert-ovale img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cert-vide { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; color: #9a7220; }
.cert-vide b { font: 600 22px/1 'EB Garamond', Georgia, serif; }
.cert-vide::after { content: ''; position: absolute; inset: 62px 30px 38px; border: 1px dashed #c8aa62; border-radius: 40% / 30%; }
.cert-appareil { width: 82px; height: 68px; color: #c8aa62; position: relative; z-index: 1; }

.cert-corps { position: absolute; left: 348px; width: 424px; top: 322px; text-align: center; }
.cert-atteste { margin: 0 0 10px; font-size: 17px; font-weight: 600; }
.cert-paire { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 8px; }
.cert-et { width: 22px; font-size: 17px; font-weight: 600; text-align: left; flex: none; }
.cert-nom { flex: 1; min-width: 0; height: 32px; border-bottom: 1.5px solid #0f1f4d; font-size: 21px; font-weight: 600; line-height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.cert-texte { margin: 10px 0 0; font-size: 16.5px; line-height: 1.38; font-weight: 600; }
.cert-texte.bas { margin-top: 22px; }
.cert-corps.dense { top: 316px; }
.cert-corps.dense .cert-atteste { font-size: 15.5px; margin-bottom: 7px; }
.cert-corps.dense .cert-paire { margin-bottom: 6px; }
.cert-corps.dense .cert-texte { font-size: 14.5px; line-height: 1.3; margin-top: 8px; }
.cert-corps.dense .cert-texte.bas { margin-top: 12px; }
.cert-corps.dense .cert-parrains { font-size: 12.5px; margin-top: 6px; }
.cert-parrains { margin: 8px 0 0; font-size: 13.5px; font-style: italic; color: #5a4a1a; line-height: 1.3; }

.cert-signatures { position: absolute; left: 118px; right: 118px; top: 606px; display: grid; gap: 40px; }
.cert-sig { text-align: center; }
.cert-sig-nom { height: 30px; font: 600 23px/30px 'EB Garamond', Georgia, serif; color: #8a5a12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cert-sig-trait { border-top: 1.5px solid #0f1f4d; margin-top: 3px; }
.cert-sig-fonction { margin-top: 6px; font: 700 22px/1.1 'EB Garamond', Georgia, serif; color: #8a5a12; }
.cert-bas { position: absolute; left: 350px; top: 700px; }
.cert-bas .cert-sep-svg { margin: 0; }
.cert-numero { position: absolute; left: 0; right: 0; top: 728px; text-align: center; font: 600 10.5px/1 'Cinzel', Georgia, serif; letter-spacing: .15em; color: #8a5a12; }

@media print {
  body.cert-ouvert > *:not(#cert-overlay) { display: none !important; }
  body.cert-ouvert { background: #fff; margin: 0; }
  body.cert-ouvert #cert-overlay { position: static; background: none; overflow: visible; display: block; }
  #cert-overlay .cert-barre { display: none !important; }
  #cert-overlay .cert-scene { display: block; padding: 0; }
  #cert-overlay .cert-echelle { width: 297mm !important; height: 210mm !important; box-shadow: none; overflow: hidden; page-break-after: avoid; break-after: avoid; }
  #cert-overlay .cert-echelle .cert { transform: scale(1.00225, 1.00468) !important; transform-origin: 0 0; }
}

/* Version 12 — marque Likabo Tech */
.editeur-marque { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--bordure, #e5e7eb); color: var(--muted, #6b7280); font-size: .85rem; }
.editeur-marque span { display: flex; flex-direction: column; line-height: 1.2; }
.editeur-marque b { color: var(--bleu, #1e3a8a); }
.editeur-marque small { font-size: .75rem; }
