/* ============================================================
   Paroisse Saint-André — panneau d'administration
   ============================================================ */
:root{
  --ink:#1f242b; --muted:#6b7280; --gold:#b07d4f; --gold-dark:#96653c;
  --cream:#faf7f1; --paper:#fff; --line:#e5e0d8; --blue:#33404d;
  --sans:"Inter",-apple-system,"Segoe UI",Roboto,sans-serif;
}
body.mode-admin{font-family:var(--sans);color:var(--ink);background:var(--cream);line-height:1.55}
body.mode-admin a{color:var(--gold-dark)}

/* --- barre supérieure (colorée selon le site administré : --site-accent) --- */
.admin-topbar{display:flex;align-items:center;gap:1rem;
  background:var(--site-accent,var(--blue));color:#fff;padding:.7rem 1.2rem;position:sticky;top:0;z-index:20;
  box-shadow:inset 0 -3px 0 rgba(255,255,255,.25)}
.admin-brand{color:#fff;font-weight:600;display:flex;align-items:center;gap:.5rem;white-space:nowrap}
.admin-brand:hover{color:#fff;opacity:.85}
.brand-mark{color:#fff}
.admin-site-chip{background:rgba(255,255,255,.22);border:1px solid rgba(255,255,255,.3);
  color:#fff;font-size:.78rem;font-weight:600;padding:.3rem .7rem;border-radius:20px;white-space:nowrap}
.admin-topbar-right{display:flex;align-items:center;gap:.9rem;font-size:.9rem}
.admin-view-site,.admin-logout{color:#e6ebf0;text-decoration:underline;text-underline-offset:3px}
.admin-view-site:hover,.admin-logout:hover{color:#fff}
.admin-user{opacity:.85}
/* Liens de la barre supérieure : blancs sur le fond coloré
   (spécificité supérieure à `body.mode-admin a`, qui rendrait le marron) */
body.mode-admin .admin-topbar a{color:#fff}
body.mode-admin .admin-topbar a:hover{color:#fff;opacity:.85}
/* sélecteur de site (1962 / 1969) — en tête du bloc de droite, à l'extrême droite */
.admin-site-switch{display:flex;align-items:center;gap:.45rem;color:#c4cdd5;font-size:.85rem;margin-left:auto}
.admin-site-switch select{background:#28323c;color:#fff;border:1px solid rgba(255,255,255,.25);
  border-radius:8px;padding:.4rem .6rem;font-size:.85rem;font-family:inherit;cursor:pointer}
.admin-site-switch select:focus{outline:2px solid var(--gold);outline-offset:1px}

/* --- disposition --- */
.admin-layout{display:grid;grid-template-columns:220px 1fr;min-height:calc(100vh - 52px)}
.admin-side{background:var(--paper);border-right:1px solid var(--line);padding:1rem .6rem}
.admin-search{margin:0 0 .8rem;padding:0 .2rem}
.admin-search input{width:100%;box-sizing:border-box;padding:.5rem .7rem;border:1px solid var(--line);
  border-radius:10px;font:inherit;background:#fff}
.admin-nav{display:flex;flex-direction:column;gap:.2rem}
/* lot 56 : secret 2FA (saisie manuelle dans l'app d'authentification) */
.totp-secret{display:block;margin:.5rem 0;padding:.7rem .9rem;background:var(--cream);border:1px solid var(--line);
  border-radius:10px;word-break:break-all;letter-spacing:.06em}
.admin-nav-toggle{display:none} /* visible en mobile/PWA (grille de tuiles réductible) */
.admin-nav-link{display:flex;align-items:center;gap:.6rem;padding:.65rem .8rem;border-radius:10px;
  color:var(--ink-soft,#3a414b);font-weight:500}
.admin-nav-link:hover{background:var(--cream);color:var(--gold-dark)}
.admin-nav-link.is-active{background:var(--site-accent,var(--gold));color:#fff}
.admin-nav-group{margin:.8rem .8rem .15rem;font-size:.68rem;font-weight:700;letter-spacing:.09em;
  text-transform:uppercase;color:var(--ink-soft);opacity:.75}
.admin-nav-group:first-child{margin-top:.15rem}
.ani{width:20px;text-align:center;opacity:.9}
.admin-main{padding:1.6rem 2rem 3rem;max-width:1000px}
.admin-flashwrap{margin-bottom:1rem}

/* --- titre / barres --- */
.admin-h1{font-size:1.7rem;margin:.2rem 0 1rem;font-family:"Fraunces",Georgia,serif}
.admin-h2{font-size:1.15rem;margin:1.8rem 0 .8rem;color:var(--ink)}
.admin-bar{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.page-search{display:flex;align-items:center;gap:.4rem;flex:1 1 260px;max-width:420px}
.page-search input[type=search]{flex:1 1 auto;min-width:0;padding:.5rem .7rem;border:1px solid var(--line);
  border-radius:9px;font:inherit;background:#fff}
.page-search input[type=search]:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 3px rgba(176,125,79,.15)}

/* --- flash (admin) --- */
.flash{padding:.7rem 1rem;border-radius:10px;font-size:.92rem;margin-bottom:.5rem}
.flash-ok{background:#e7f6ec;color:#1e6b3a;border:1px solid #bfe6cd}
.flash-err{background:#fdeaea;color:#a52a2a;border:1px solid #f3c1c1}
.flash-warn{background:#fff6e5;color:#8a6116;border:1px solid #f0dca8}

/* --- boutons (redéfinis pour admin) --- */
.btn{display:inline-block;padding:.6rem 1rem;border-radius:9px;font-weight:600;font-size:.9rem;
  border:1px solid var(--line);background:var(--paper);color:var(--ink);cursor:pointer;text-decoration:none;transition:.15s}
.btn:hover{border-color:var(--gold);color:var(--gold-dark)}
.btn-primary{background:#fff;border-color:var(--gold);color:var(--ink)}
.btn-primary:hover{background:var(--gold-soft);border-color:var(--gold-dark);color:var(--gold-dark)}
.btn-danger{background:#fff;border-color:#e2b3b3;color:#a52a2a}
.btn-danger:hover{background:#a52a2a;border-color:#a52a2a;color:#fff}
.btn-sm{padding:.35rem .7rem;font-size:.82rem}
.btn-block{display:block;width:100%;text-align:center}
.inline-form{display:inline}

/* --- tableaux --- */
.admin-table{width:100%;border-collapse:collapse;background:var(--paper);border:1px solid var(--line);
  border-radius:12px;overflow:hidden;margin:1rem 0}
.admin-table th,.admin-table td{padding:.7rem .8rem;text-align:left;border-bottom:1px solid var(--line);font-size:.92rem}
.admin-table thead th{background:var(--cream);font-weight:600;color:var(--ink)}
.admin-table tbody tr:last-child td{border-bottom:0}
.admin-table tbody tr:hover{background:#fbf9f5}
.mono{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.85em}
.muted{color:var(--muted)}
.strong{font-weight:600}
.ta-r{text-align:right}

/* --- étiquettes --- */
.tag{display:inline-block;padding:.15rem .5rem;border-radius:20px;font-size:.75rem;font-weight:600;background:var(--cream);border:1px solid var(--line)}
.tag-warn{background:#fdecec;border-color:#e8b4b4;color:#8a2f2f}
.tag-home{background:#fdeede;color:var(--gold-dark)}
.tag-grid{background:#e8f0f3;color:#3a6273}
.tag-page{background:#eef1ee;color:#4a6a4a}
.tag-superadmin{background:#f3e8f7;color:#6b3fa0}
.tag-admin{background:#e8f0f3;color:#3a6273}
.tag-user{background:#eef1ee;color:#4a6a4a}
.tag-paid{background:#eef1ee;color:#4a6a4a}

/* --- stat cards --- */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem;margin:1rem 0}
.stat-card{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:1.2rem;text-align:center;box-shadow:0 6px 20px -14px rgba(0,0,0,.2)}
.stat-num{display:block;font-size:2.4rem;font-weight:700;color:var(--gold);font-family:"Fraunces",Georgia,serif}
.stat-label{color:var(--muted);font-size:.9rem}

/* --- statistiques : histogramme 30 jours + barres de part de trafic (CSS pur, sans JS) --- */
.stats-filter{margin:.6rem 0 1rem}
.spark{display:flex;align-items:flex-end;gap:2px;height:130px;padding:.75rem;
  background:var(--paper);border:1px solid var(--line);border-radius:12px}
.spark-bar{flex:1 1 0;min-width:3px;background:var(--gold);border-radius:3px 3px 0 0;min-height:2px;
  position:relative;transition:background .15s}
.spark-bar:hover,.spark-bar:focus-visible{background:var(--gold-dark);outline:none}
.spark-tip{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:5px;
  background:var(--ink);color:#fff;font-size:.72rem;font-weight:600;padding:.2rem .5rem;border-radius:6px;
  white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;z-index:2}
.spark-bar:hover .spark-tip,.spark-bar:focus-visible .spark-tip{opacity:1}
.spark-x{display:flex;justify-content:space-between;font-size:.74rem;color:var(--muted);margin-top:.35rem;padding:0 .2rem}
.bar-track{height:9px;background:var(--cream);border:1px solid var(--line);border-radius:6px;overflow:hidden}
.bar-fill{height:100%;background:var(--gold);border-radius:5px 0 0 5px;min-width:2px}

/* --- formulaires --- */
.admin-form{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:1.2rem;margin-bottom:1rem}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:.9rem 1rem}
.field{display:flex;flex-direction:column;gap:.3rem;font-size:.9rem}
.field>span{font-weight:600;color:var(--ink)}
.field>span small{font-weight:400;color:var(--muted)}
.field-wide{grid-column:1/-1}
.field-check{flex-direction:row;align-items:center;gap:.5rem}
.field input[type=text],.field input[type=password],.field input[type=email],
.field input[type=url],.field input[type=date],.field input[type=number],
.field input[type=search],
.field select,.field textarea{width:100%;padding:.6rem .7rem;border:1px solid var(--line);border-radius:9px;
  font-family:inherit;font-size:.92rem;background:#fff}
.field textarea{resize:vertical}
.field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 3px rgba(176,125,79,.15)}
/* lot 51 : cases « Couleurs liturgiques » (chants) — pastille + libellé */
.couleur-checks{display:flex;flex-wrap:wrap;gap:.4rem 1.1rem}
.couleur-check{display:inline-flex;align-items:center;gap:.4rem;font-weight:400;color:var(--ink-soft);
  cursor:pointer;padding:.35rem .55rem;border:1px solid var(--line);border-radius:20px;background:#fff}
.couleur-check:hover{border-color:var(--gold)}
.couleur-check input{margin:0}
.couleur-check i{width:.85rem;height:.85rem;border-radius:50%;display:inline-block;border:1px solid rgba(0,0,0,.18)}
.form-actions{display:flex;gap:.6rem;margin-top:1rem;flex-wrap:wrap}
/* aides sous les champs (explications) */
.field-help{display:block;font-size:.8rem;line-height:1.45;color:var(--muted);font-weight:400;margin-top:.1rem}
.slug-preview{display:block;font-size:.82rem;color:var(--muted);font-weight:400;margin-top:.15rem}
.pages-hint{font-size:.85rem;margin:.2rem 0 .4rem}
.page-caret{color:var(--muted);font-weight:400}
.page-indent{display:inline-block}
tr.depth-1 td{background:#fbf9f5}
tr.depth-2 td{background:#f7f4ee}

/* --- enregistrements (details) --- */
.record{background:var(--paper);border:1px solid var(--line);border-radius:12px;margin-bottom:.7rem;overflow:hidden}
.record summary{cursor:pointer;padding:.8rem 1rem;font-weight:600;list-style:none;display:flex;justify-content:space-between;align-items:center;gap:1rem}
.record summary::-webkit-details-marker{display:none}
.record summary::before{content:"▸";color:var(--muted);margin-right:.4rem;transition:.2s}
.record[open] summary::before{transform:rotate(90deg)}
.rec-meta{color:var(--muted);font-weight:400;font-size:.85rem}

/* --- bulletin du mois --- */
.bulletin-current{display:grid;gap:1rem}
.bulletin-now{display:flex;align-items:center;gap:1rem;flex-wrap:wrap}
.bulletin-now-ico{font-size:2.4rem;line-height:1}
.bulletin-now-thumb{width:80px;height:auto;border-radius:8px;border:1px solid var(--line)}
.bulletin-now-meta{flex:1;min-width:0}
.tag-shared{background:#e8e2d2;color:#5c5340}
.tag-site{background:#e3ecf2;color:#33566b}
/* Cadre rouge = contenu diffusé sur les deux sites (visibilité) */
.bulletin-shared-frame,.shared-frame{border:2px solid #b0413e !important;
  box-shadow:0 0 0 3px rgba(176,65,62,.12)}
.tag-conf{background:#efe4ef;color:#6b4a6e}
.tag-pending{background:#fdf1dc;color:#8a5b12}
.tag-expired{background:#fbe9e7;color:#a13327;margin-left:.4rem}

/* --- Inscriptions --- */
.reg-filters{display:flex;gap:1rem;align-items:flex-end;flex-wrap:wrap}
.reg-sums{display:grid;grid-template-columns:1fr 1fr;gap:1.2rem;align-items:start;margin-top:1.2rem}
@media (max-width:900px){.reg-sums{grid-template-columns:1fr}}

/* --- Encart liturgique (admin/litcal) --- */
.litcal-today{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
.litcal-sw{display:inline-block;width:1rem;height:1rem;border-radius:50%;
  border:1px solid rgba(0,0,0,.2);vertical-align:-2px;margin-right:.3rem}
.litcal-sw-lg{width:1.7rem;height:1.7rem;vertical-align:-4px}

/* --- connexion (bare) --- */
/* colonne centrée : le slot de message est AU-DESSUS de la carte (une ligne
   « row » plaçait le slot vide à côté de la carte et la poussait à droite,
   surtout en PWA/mobile) */
.bare-wrap{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:1.5rem;background:radial-gradient(1200px 600px at 50% -10%, #3b4a59, var(--blue))}
/* espace réservé au message d'erreur : la carte ne bouge pas quand il apparaît */
.bare-wrap .flash-slot{width:100%;max-width:420px;min-height:3.7rem;margin-bottom:.8rem;
  display:flex;flex-direction:column;justify-content:flex-end}
.bare-wrap .flash{width:100%;margin:0 auto;text-align:center}
.login-card{width:100%;max-width:420px;background:var(--paper);border-radius:18px;overflow:hidden;
  box-shadow:0 30px 60px -25px rgba(0,0,0,.5)}
.login-head{background:linear-gradient(135deg, var(--blue) 0%, #232d36 100%);color:#fff;
  text-align:center;padding:1.8rem 1.5rem 1.4rem;position:relative}
.login-head::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;
  background:linear-gradient(90deg, var(--gold), #e7c9a5)}
.login-head .brand-mark{display:inline-flex;align-items:center;justify-content:center;
  width:56px;height:56px;border-radius:50%;background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.25);font-size:1.7rem;color:var(--gold)}
.login-title{font-family:"Fraunces",Georgia,serif;font-size:1.45rem;margin:.8rem 0 .2rem;color:#fff}
.login-sub{color:#c9d4dd;font-size:.9rem;margin:0}
.login-card .login-form{padding:1.6rem 1.8rem;display:grid;gap:1rem}
/* message d'erreur DANS le formulaire (entre mot de passe et bouton) ;
   espace réservé : la carte ne change jamais de forme */
.login-flash-slot{min-height:3.7rem;display:flex;flex-direction:column;justify-content:center}
.login-card .login-form .flash{margin:0;text-align:center}
.login-card .field{display:flex;flex-direction:column;gap:.3rem;font-size:.9rem}
.login-card .field>span{font-weight:600;color:var(--ink)}
.login-card .field input{width:100%;padding:.75rem .85rem;border:1px solid var(--line);border-radius:10px;font-size:.95rem}
.login-card .field input:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 3px rgba(176,125,79,.18)}
.login-note{color:var(--muted);font-size:.78rem;line-height:1.5;margin:0;padding:0 1.8rem 1rem}
.login-back{text-align:center;padding:0 1rem 1.4rem}
.login-back a{color:var(--muted);font-size:.85rem}

/* --- Statistiques : navigateurs / systèmes côte à côte --- */
.stats-2col{display:grid;grid-template-columns:1fr 1fr;gap:1.4rem 2rem;align-items:start}

/* --- responsive admin (PWA mobile) --- */
@media (max-width:900px){.stats-2col{grid-template-columns:1fr}}
@media (max-width:760px){
  /* barre supérieure : deux lignes au lieu de déborder, et non épinglée
     — ligne 1 : marque + sélecteur de site (à droite)
        ligne 2 : actions (voir le site, compte, déconnexion) */
  .admin-topbar{position:static;flex-wrap:wrap;gap:.5rem .9rem;padding:.6rem .9rem}
  .admin-site-chip{display:none} /* redondant avec le sélecteur de site */
  .admin-topbar-right{width:100%;justify-content:flex-end;flex-wrap:wrap;row-gap:.35rem}
  .admin-user{max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  /* bouton « ☰ Menu » : réduit / réaffiche la grille de tuiles (état mémorisé) */
  .admin-nav-toggle{display:flex;align-items:center;justify-content:center;gap:.4rem;
    width:100%;padding:.5rem .7rem;margin-bottom:.45rem;border:1px solid var(--line);border-radius:10px;
    background:var(--cream);color:var(--ink-soft,#3a414b);font:600 .85rem var(--sans);cursor:pointer}
  .admin-nav-toggle:hover{border-color:var(--gold);color:var(--gold-dark)}
  .admin-side.nav-collapsed{padding-bottom:.5rem}
  .admin-side.nav-collapsed .admin-nav{display:none}
  /* menu latéral → grille de tuiles (même système que le menu en tuile du site public)
     — align-self:start : le panneau ne s'étire pas sur toute la hauteur (pas de
       bloc blanc vide quand le menu est réduit, ni de trou sous les tuiles) */
  .admin-layout{grid-template-columns:1fr}
  .admin-side{align-self:start;border-right:0;border-bottom:1px solid var(--line);padding:.6rem .7rem}
  .admin-nav{display:grid;grid-template-columns:repeat(4,1fr);gap:.4rem}
  .admin-nav-link{position:relative;flex-direction:column;align-items:center;gap:.2rem;
    padding:.55rem .2rem .45rem;text-align:center;font-size:.78rem;line-height:1.15;white-space:normal}
  .admin-nav-link .ani{font-size:1.3rem;line-height:1}
  .admin-nav-link .nav-badge{position:absolute;top:3px;right:5px;margin:0;min-width:17px;
    padding:0 .3rem;font-size:.68rem;line-height:1.4}
  .admin-nav-group{grid-column:1/-1;margin:.55rem 0 .1rem;text-align:center;letter-spacing:.09em}
  .admin-main{padding:1rem .9rem 2.5rem}
  .form-grid{grid-template-columns:1fr}
  .admin-bar{flex-direction:column;align-items:flex-start;gap:.5rem}
  .page-search{flex:1 1 auto;max-width:none;width:100%}
  /* tableaux : défilement horizontal sans écrasement des lignes */
  .admin-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .admin-table thead,.admin-table tbody{display:table;width:100%}
  .admin-table th,.admin-table td{white-space:nowrap}
  .admin-table th:last-child,.admin-table td:last-child{white-space:normal}
}

/* --- Choral : lignes moment/chant du formulaire --- */
.choral-songs{display:grid;gap:.45rem;max-width:760px;margin-bottom:.8rem}
.choral-song-row{display:grid;grid-template-columns:1fr 1.4fr;gap:.5rem}
.choral-song-row input{width:100%;padding:.6rem .7rem;border:1px solid var(--line);border-radius:9px;font:inherit;background:#fff}
.choral-song-row input:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 3px rgba(176,125,79,.15)}
@media (max-width:640px){.choral-song-row{grid-template-columns:1fr}}

/* --- Messages de contact --- */
.tag-unread{background:#fbeaea;color:#b0413e;border:1px solid #eec6c5}
.msg-card{max-width:820px;margin:0 0 .8rem}
.msg-unread{border-left:4px solid #b0413e;background:#fdf7f7}
.msg-head{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin-bottom:.3rem}
.msg-subject{font-weight:600;color:var(--ink-soft)}
.msg-head .admin-bar-right{margin-left:auto;display:flex;gap:.4rem}
.msg-contact{margin:.2rem 0;font-size:.85rem}
.msg-body{line-height:1.55;color:var(--ink)}

/* --- Choral : suppression de ligne moment/chant + aperçu de la feuille --- */
.choral-song-row{grid-template-columns:1fr 1.4fr auto}
.song-del{align-self:center;padding:.4rem .65rem;line-height:1;color:var(--muted)}
.song-del:hover{color:#b0413e;border-color:#b0413e}
.sheet-preview{display:none;max-width:760px;margin:1.2rem 0 0;padding:1.4rem 1.6rem;background:#fff;
     border:1px solid var(--line);border-radius:12px;box-shadow:0 2px 10px rgba(0,0,0,.05)}
.sheet-preview.is-open{display:block}
.sheet-preview .sheet-kicker{color:var(--gold);text-transform:uppercase;letter-spacing:.12em;font-size:.72rem;font-weight:700;margin:0 0 .3rem}
.sheet-preview .sheet-title{font-family:"Fraunces",Georgia,serif;font-size:1.5rem;margin:0 0 .4rem}
.sheet-preview .sheet-note{color:var(--muted);margin:0 0 .8rem}
/* lot 49 : moment — chant sur une ligne, texte en dessous (même rendu que la feuille publique) */
.sheet-preview .sheet-list{list-style:none;margin:0;padding:0;display:grid;gap:1rem}
.sheet-preview .sheet-song-line{margin:0;font-weight:700}
.sheet-preview .sheet-chant-note{font-size:.8rem;color:var(--muted);font-weight:400;margin:.2rem 0 0}
.sheet-preview .sheet-chant-text{font:inherit;white-space:pre-wrap;margin:.4rem 0 0;line-height:1.5;color:#5a554b}
/* lot 56 : refrain — en gras, saut de ligne avant les versets (cf. feuille publique) */
.sheet-preview .sheet-chant-refrain-label{margin:.7rem 0 0;font-size:.78rem;font-weight:700;letter-spacing:.09em;
  text-transform:uppercase;color:var(--muted)}
.sheet-preview .sheet-chant-text.sheet-chant-refrain{font-weight:700;color:#3f3a31;margin-bottom:1rem}
.chant-view-text.chant-refrain,.print-text.chant-refrain{font-weight:700;margin-bottom:1rem}
.sheet-preview .sheet-partition{margin-top:.4rem}
.sheet-preview .sheet-partition a{color:var(--gold);font-weight:600}

/* --- Saint du jour : aperçu du portrait --- */
.saint-form-thumb{display:block;width:110px;height:auto;border-radius:10px;border:1px solid var(--line);
     box-shadow:0 2px 8px rgba(0,0,0,.08);margin-bottom:.6rem}

/* --- Lot 14 --- */
/* badge « non visualisé » du menu admin (entrées nouvelles depuis le dernier passage) */
.nav-badge{margin-left:auto;min-width:22px;padding:.05rem .5rem;border-radius:11px;text-align:center;
     background:#c0392b;color:#fff;font-size:.75rem;font-weight:700;line-height:1.5}
.admin-nav-link.is-active .nav-badge{background:#fff;color:#c0392b}
/* affiche d'un événement (aperçu dans le formulaire) */
.event-form-thumb{display:block;width:96px;height:auto;border-radius:10px;border:1px solid var(--line);
     box-shadow:0 2px 8px rgba(0,0,0,.08);margin-bottom:.5rem}

/* --- Lot 20 --- */
/* page « Aide » : sommaire + sections */
.aide-toc{display:flex;flex-wrap:wrap;gap:.3rem .9rem;font-size:.85rem;margin:.4rem 0 1.2rem}
.aide-toc a{white-space:nowrap}
.aide-section{margin:0 0 1.7rem;padding-bottom:1.2rem;border-bottom:1px dashed var(--line)}
.aide-section:last-child{border-bottom:none}
.aide-section h2{margin:0 0 .5rem;font-size:1.12rem}
.aide-section p{margin:.35rem 0}
.aide-list{margin:.35rem 0 .5rem;padding-left:1.2rem}
.aide-list li{margin:.25rem 0}

/* ---- Banque d'images : sélecteur de vignettes (événements) ---- */
/* lot 52 : boîte de hauteur limitée (défilement vertical) + champ de recherche par titre */
.img-pick-search{width:100%;padding:.5rem .7rem;border:1px solid var(--line);border-radius:9px;font:inherit;font-size:.85rem;color:var(--ink);background:#fff;margin-top:.35rem}
.img-pick-search:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 3px var(--gold-soft)}
.img-pick-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:.5rem;margin-top:.55rem;max-height:340px;overflow-y:auto;padding-right:.3rem;scrollbar-width:thin}
.img-pick{position:relative;display:block;border:2px solid var(--line);border-radius:10px;padding:.4rem;background:#fff;cursor:pointer;transition:border-color .15s, box-shadow .15s}
.img-insert{width:100%;font:inherit;text-align:left;color:inherit;appearance:none}   /* vignette cliquable « insérer dans le contenu » (éditeur de page) */
.img-pick:hover{border-color:var(--gold)}
.img-pick input[type=radio]{position:absolute;opacity:0;pointer-events:none}
.img-pick:has(input:checked){border-color:var(--gold-dark);box-shadow:0 0 0 3px var(--gold-soft)}
.img-pick.is-selected{border-color:var(--gold-dark);box-shadow:0 0 0 3px var(--gold-soft)}
.img-pick.is-current{border-color:var(--gold-dark)}
.img-pick-thumb{display:block;height:72px;overflow:hidden;border-radius:7px;background:var(--paper)}
.img-pick-thumb img{width:100%;height:100%;object-fit:cover;transition:transform .2s}
.img-pick:hover .img-pick-thumb img{transform:scale(1.15)}
.img-pick-title{display:block;margin-top:.3rem;font-size:.72rem;line-height:1.25;color:var(--ink-soft);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.img-pick-zoom{position:absolute;top:.3rem;right:.3rem;font-size:.78rem;line-height:1;background:rgba(255,255,255,.92);border:1px solid var(--line);border-radius:7px;padding:.12rem .3rem;text-decoration:none}
.img-pick-hint{margin:.5rem 0 0;font-size:.8rem}
.img-pick-confirm{margin:.45rem 0 0;font-size:.8rem}

/* Toast « ✓ … » — confirmation d'insertion d'image dans un éditeur TinyMCE (admin) */
.sta-tm-toast{position:fixed;bottom:1.2rem;left:50%;transform:translate(-50%,1rem);opacity:0;transition:opacity .3s, transform .3s;background:#2b2118;color:#fff;padding:.55rem 1.05rem;border-radius:9px;font-size:.85rem;z-index:1200;pointer-events:none;box-shadow:0 4px 14px rgba(0,0,0,.25);max-width:90vw}
.sta-tm-toast.show{opacity:1;transform:translate(-50%,0)}
.sta-tm-toast-warn{background:#8a3030}

/* ---- Banque d'images : page de gestion ---- */
.bank-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:.8rem;margin-top:1rem}
.bank-item{border:1px solid var(--line);border-radius:12px;padding:.6rem;background:#fff;display:flex;flex-direction:column;gap:.45rem}
.bank-thumb{display:block;height:120px;border-radius:8px;overflow:hidden;background:var(--paper)}
.bank-thumb img{width:100%;height:100%;object-fit:cover;transition:transform .2s}
.bank-thumb:hover img{transform:scale(1.08)}
.bank-title{margin:0;font-size:.82rem;font-weight:600;line-height:1.35;min-height:2.7em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}
.bank-retit{display:flex;gap:.35rem}
.bank-retit input[type=text]{flex:1 1 auto;min-width:0;padding:.35rem .5rem;border:1px solid var(--line);border-radius:7px;font:inherit;font-size:.8rem}
.bank-retit input[type=text]:focus{outline:none;border-color:var(--gold)}
.bank-file{font-size:.68rem;margin:0;word-break:break-all}
/* referencement (lot 43) : chips 📅/📚/📄 sous la vignette */
.bank-usage{margin:0;display:flex;flex-wrap:wrap;gap:.3rem}
.bank-usage-chip{display:inline-block;font-size:.68rem;font-weight:600;padding:.15rem .45rem;
  border-radius:20px;background:var(--cream);border:1px solid var(--line);color:var(--ink);
  text-decoration:none;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bank-usage-chip:hover{background:#f3ead9;border-color:var(--gold)}
.bank-del{text-align:right}

/* ---- Banque d'images : renommage en 2 temps (JS) ----
   Sans JS (pas de classe is-renaming-capable) le champ reste visible et le bouton
   « ✓ Enregistrer » soumet directement — repli fonctionnel. */
.bank-item.is-renaming-capable .bank-title-input{display:none}
.bank-item.is-renaming-capable .bank-save-btn,.bank-item.is-renaming-capable .bank-cancel-btn{display:none}
.bank-item.is-renaming-capable.is-renaming .bank-title-input{display:block;flex:1 1 auto;min-width:0}
.bank-item.is-renaming-capable.is-renaming .bank-rename-btn{display:none}
.bank-item.is-renaming-capable.is-renaming .bank-save-btn,.bank-item.is-renaming-capable.is-renaming .bank-cancel-btn{display:inline-block}

/* ---- Dons : blocs distincts (Clés Stripe + une carte par type) ---- */
.don-block{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:1rem 1.1rem;margin:0 0 1rem}
.don-block-title{margin:0 0 .8rem}
.don-card{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:1rem 1.1rem;margin:0 0 .9rem}
.don-prices-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem}
@media (max-width:700px){.don-prices-grid{grid-template-columns:1fr 1fr}}
.don-card-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin:0 0 .8rem}
.don-card-title{font-weight:600;font-size:1rem;color:var(--ink)}
.don-card-toggle{margin:0}
.don-card .form-grid{margin:0}
/* Simulateur de reçu (lot 36) : aperçu (réutilise .sheet-* de site.css) + cellules actions */
.don-sim-preview{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:1.2rem 1.3rem;margin:.5rem 0 1rem}
.don-sim-preview .sheet-table{margin:0 auto}
.sim-messe{grid-column:1/-1}
.row-actions{white-space:nowrap}
.row-actions .inline-form{display:inline;margin:0}
/* Demandes (sur place) — ligne de filtres type / site d'origine */
.req-filters{display:flex;gap:1rem;align-items:flex-end;flex-wrap:wrap;margin-bottom:1rem}
.req-sub{font-size:.82rem;margin-top:.2rem}
/* Bibliothèque (lot 42) : gestion des genres (pastilles) + tag livre du mois */
.genre-manage{display:flex;flex-wrap:wrap;gap:.5rem;margin:0 0 .8rem}
.genre-chip{display:inline-flex;align-items:center;gap:.45rem;background:var(--gold-soft);
  border:1px solid #e3d5bf;border-radius:20px;padding:.2rem .55rem .2rem .8rem;font-size:.85rem;font-weight:600}
.genre-chip .chip-x{border:none;background:transparent;cursor:pointer;color:inherit;
  font-size:.8rem;line-height:1;padding:0 .25rem;border-radius:10px}
.genre-chip .chip-x:hover{background:#d9c3a3}
.genre-add{display:flex;gap:.6rem;align-items:center;margin-bottom:1.2rem}
.genre-add input{max-width:420px;width:100%;padding:.6rem .7rem;border:1px solid var(--line);
  border-radius:9px;font-family:inherit;font-size:.92rem;background:#fff}
.genre-add input:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 3px rgba(176,125,79,.15)}
.tag-month{background:#fdf3dc;border-color:#e8d9a8;color:#8a6a1a}

/* Lot 55 — feuille de chant : case « Publier » juste au-dessus du bouton d'enregistrement */
.sheet-pub-check{margin:0 0 .8rem}
/* Lot 55 — documents joints : champs d'édition masqués par défaut (✎ / ⇪ Remplacer) */
.doc-edit-form[hidden]{display:none}
.doc-edit-toggle{margin-left:.4rem}
/* Lot 55 — fiche d'un chant : présentation en carte */
.chant-card{background:var(--paper);border:1px solid var(--line);border-radius:12px;
  padding:1.3rem 1.5rem 1.5rem;margin-top:.6rem;max-width:900px}
.chant-card-head{border-bottom:1px solid var(--line);padding-bottom:.9rem;margin-bottom:1rem}
.chant-card-title{margin-bottom:.2rem}
.chant-card-note{margin:.2rem 0 .6rem;color:var(--muted);font-size:.95rem}
.chant-card-tags{margin:0}
.chant-card-sec{margin-top:1.2rem}
.chant-card-sec:first-child{margin-top:0}
.chant-card-h{font-size:1.05rem;margin-bottom:.6rem;border-bottom:1px solid var(--line);padding-bottom:.35rem}
.chant-view-text{background:#fbf9f5;border:1px solid var(--line);border-radius:9px;padding:1rem 1.1rem;
  font-size:.95rem;line-height:1.65;white-space:pre-wrap;word-break:break-word;overflow-x:auto}
.chant-view-partition{max-width:420px;width:100%;height:auto;border:1px solid var(--line);border-radius:9px;background:#fff}
.chant-part-title{margin-top:.4rem}

/* Lot 60 — Newsletter : bloc « Envoi » du formulaire + ajout rapide d'un inscrit */
.nl-sendbox{border:1px solid var(--line);border-radius:10px;padding:.9rem 1.1rem;margin:1.1rem 0;
  display:grid;gap:.7rem;background:var(--cream)}
.nl-sendbox legend{font-weight:600;font-size:.95rem;padding:0 .4rem;color:var(--gold-dark)}
.nl-add{margin:.6rem 0 1rem}
.nl-add-row{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center}
.nl-add-row input{flex:1;min-width:220px;max-width:380px}
