/* ==========================================================================
   CGT-VIVEST — 59-parametres.css — PARAMÈTRES DU SYNDICAT (refonte-cgt, lot 17)
   --------------------------------------------------------------------------
   Balisage : assets/js/public.js —
   - #settings : renderSettings (page .cgt-par-page, rubriques .sm-settings-tab
     + .cgt-par-onglet, panneaux .sm-settings-tab-content, sections numérotées
     .cgt-par-section, barre d'enregistrement .cgt-par-barre), initSettingsTabs ;
   - Banque : renderPaymentGateways, renderGatewayConfig (corps de
     #sm-payment-gateway-section) ;
   - Application : renderFirebaseConfig (#firebase-config-container), testGroqAPI
     (#groq-test-result, .cgt-par-statut) ;
   - Système : renderBackupsList (#sm-backups-list), copyCronUrl,
     regenerateCronKey, migratePrivateDocuments (#sm-migration-result-modal),
     showUploadBackupModal (#sm-upload-backup-modal), confirmations (.cgt-par-
     confirmation dans .cgt-confirmation).
   AUCUN style en ligne ni couleur en dur dans le rendu : clair et sombre suivent
   les jetons (00-tokens.css). Les nuances affichées par la charte (rouge, jaune,
   encre) sont les PRIMITIVES de la marque : constantes dans les deux thèmes.

   Composition « affiche militante en 2,5D » :
   - rubriques en navigation : colonne papier à tranche sur bureau (la rubrique
     ouverte passe à l'ENCRE, filet rouge), grille de « tampons » sur tablette et
     téléphone (la rubrique ouverte est enfoncée dans sa tranche) ; chaque
     rubrique porte la couleur d'une rubrique de cgt.fr ([data-sup-rub], 53 § 0) :
     syndicat = actualité, banque = document, charte = communiqué,
     application = agenda, système = encre ;
   - sections papier à filet de la rubrique, numéro sur pavé d'encre à tranche
     rouge (.cgt-gst-numero, 58), titre Figtree 400 + un mot en Besley rouge ;
   - la charte CGT est FIGÉE : logo officiel en autocollant, nuancier, couleurs
     des rubriques, bannière « verrou » — plus de sélecteur de couleur ;
   - barre d'enregistrement collante au pied, papier à filet fort.

   Composants RÉUTILISÉS (pas de doublon) : .cgt-titre-ecran / .cgt-accent /
   .cgt-libelle (10-theme) ; boutons, champs, interrupteurs, cartes, bannières
   .sm-alert, états vides, modales, confirmations .cgt-confirmation
   (30-composants) ; dessin de .sm-switch partagé avec le profil (48 § 6) ;
   rubriques [data-sup-rub] (53 § 0) ; étiquette .cgt-fac-etat (54) ; chiffres
   .cgt-chiffre (30 § 23), registre .cgt-cpt-ligne, pavé .cgt-cpt-date, alertes
   .cgt-cpt-alerte, chargement .cgt-cpt-chargement, état vide .cgt-cpt-vide
   (56) ; numéro de section .cgt-gst-numero (58).

   Poids : écran neuf, sélecteurs simples ; :not(#cgt) seulement contre une
   règle plus lourde de 30-composants (cartes). !important : aucun.
   Mouvement : translate / opacity seulement (bascule de rubrique, tampon),
   coupé par prefers-reduced-motion. Pas de color-mix(), pas de backdrop-filter,
   pas de :has().
   ========================================================================== */


/* ==========================================================================
   1. PAGE ET EN-TÊTE
   ========================================================================== */
.cgt-par-page{
  display:flex;
  flex-direction:column;
  gap:28px;
  width:100%;
  max-width:1400px;                 /* gabarit commun des écrans de gestion (revue D) */
  margin:0 auto;
  padding:4px 0 0;
  box-sizing:border-box;
  font-family:var(--police-texte);
  color:var(--texte);
}
.cgt-par-page *, .cgt-par-page *::before, .cgt-par-page *::after{ box-sizing:border-box; }

.cgt-par-titre.cgt-titre-ecran{ margin:0; }
.cgt-par-chapo{
  margin:14px 0 0;
  max-width:64ch;
  font-size:var(--fs-16);
  line-height:var(--lh-corps);
  color:var(--texte-2);
}

/* Corps : rubriques à gauche, formulaire à droite (bureau) */
.cgt-par-corps{
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  gap:24px;
  align-items:start;
}
@media (min-width: 1025px){
  .cgt-par-corps{ grid-template-columns:300px minmax(0, 1fr); gap:36px; }
  .cgt-par-nav{ position:sticky; top:24px; }
}
.cgt-par-form{ display:flex; flex-direction:column; gap:0; min-width:0; margin:0; }


/* ==========================================================================
   2. RUBRIQUES (onglets) — .sm-settings-tab (initSettingsTabs) + .cgt-par-onglet
   ========================================================================== */
.cgt-par-onglets{ display:flex; flex-direction:column; margin:0; padding:0; }

.cgt-par-onglet{
  position:relative;
  display:flex;
  align-items:center;
  gap:14px;
  width:100%;
  min-height:var(--cible-tactile);
  margin:0;
  padding:14px 16px 14px 14px;
  font-family:var(--police-texte);
  text-align:left;
  color:var(--texte);
  background:var(--papier);
  border:0;
  border-radius:0;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}
.cgt-par-onglet:focus-visible{ outline:2px solid var(--focus); outline-offset:-2px; z-index:1; }
.cgt-par-onglet-picto{
  flex:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  font-size:16px;
  background:var(--rub-plein);
  color:var(--rub-sur);
  box-shadow:3px 3px 0 0 var(--tranche);
  translate:0 0;
  transition:translate var(--duree-3) var(--courbe-ressort), box-shadow var(--duree-2) var(--courbe-simple);
}
.cgt-par-onglet-texte{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.cgt-par-onglet-titre{ font-size:var(--fs-16); font-weight:var(--fw-800); line-height:1.25; }
.cgt-par-onglet-desc{ font-size:var(--fs-13); line-height:1.35; color:var(--texte-3); }

/* Bureau : colonne papier à tranche ; la rubrique ouverte passe à l'encre */
@media (min-width: 1025px){
  .cgt-par-onglets{
    background:var(--papier);
    border:1px solid var(--filet);
    box-shadow:var(--relief-1);
  }
  .cgt-par-onglet{ border-bottom:1px solid var(--filet); border-left:5px solid transparent; }
  .cgt-par-onglet:last-child{ border-bottom:0; }
  .cgt-par-onglet.active{
    color:var(--texte-inverse);
    background:var(--papier-inverse);
    border-left-color:var(--cgt-rouge);
    border-bottom-color:var(--papier-inverse);
  }
  .cgt-par-onglet.active .cgt-par-onglet-desc{ color:var(--bande-texte-2); }
  /* Le pictogramme de la rubrique ouverte est « tamponné » : enfoncé dans sa tranche */
  .cgt-par-onglet.active .cgt-par-onglet-picto{ translate:3px 3px; box-shadow:0 0 0 0 var(--tranche); }
}
@media (min-width: 1025px) and (hover: hover){
  .cgt-par-onglet:not(.active):hover{ background:var(--papier-2); }
  .cgt-par-onglet:not(.active):hover .cgt-par-onglet-picto{ translate:-1px -1px; box-shadow:4px 4px 0 0 var(--tranche); }
}

/* Tablette et téléphone : grille de « tampons » (3 par rangée ; à 5 rubriques,
   3 + 2 — toutes visibles, sans défilement caché : leçon de la revue C) */
@media (max-width: 1024px){
  .cgt-par-onglets{
    display:grid;
    grid-template-columns:repeat(6, minmax(0, 1fr));
    gap:10px;
    padding:0 3px 3px 0;              /* place de la tranche */
  }
  .cgt-par-onglet{
    grid-column:span 2;
    flex-direction:column;
    justify-content:center;
    gap:8px;
    min-height:88px;
    padding:12px 6px 10px;
    text-align:center;
    border:1px solid var(--filet-fort);
    box-shadow:3px 3px 0 0 var(--tranche);
    translate:0 0;
    transition:translate var(--duree-3) var(--courbe-ressort);
  }
  .cgt-par-onglets[data-nombre="5"] .cgt-par-onglet:nth-child(n+4){ grid-column:span 3; }
  .cgt-par-onglet-picto{ width:34px; height:34px; font-size:14px; box-shadow:2px 2px 0 0 var(--tranche); }
  .cgt-par-onglet-titre{ font-size:var(--fs-14); line-height:1.2; }
  .cgt-par-onglet-desc{ display:none; }
  .cgt-par-onglet:active{ translate:3px 3px; box-shadow:0 0 0 0 var(--tranche); transition-duration:0ms; }
  .cgt-par-onglet.active{
    color:var(--texte-inverse);
    background:var(--papier-inverse);
    border-color:var(--papier-inverse);
    box-shadow:inset 0 -4px 0 0 var(--cgt-rouge);
    translate:3px 3px;
  }
  /* Revue D : même dessin pour les 5 tampons (pictogramme au-dessus du libellé),
     la 2e rangée ne fait qu'élargir ses cellules */
  .cgt-par-onglets[data-nombre="5"] .cgt-par-onglet{ min-height:80px; }
}


/* ==========================================================================
   3. PANNEAUX — une rubrique à la fois ; bascule en cascade (cgt-motion.js)
   ========================================================================== */
.cgt-par-panneau{ display:none; min-width:0; }
.cgt-par-panneau.active{ display:flex; flex-direction:column; gap:28px; }
.cgt-par-panneau:focus{ outline:none; }


/* ==========================================================================
   4. SECTIONS — papier à filet de la rubrique, numéro d'encre, titre accentué
   ========================================================================== */
.cgt-par-section{ margin:0 4px 4px 0; padding:24px 28px 28px; min-width:0; }
.cgt-par-section.cgt-carte:not(#cgt){ border-top:5px solid var(--rub); }
/* Rubrique « encre » (Système) : filet d'encre franc plutôt que gris */
.cgt-par-page [data-sup-rub="encre"]:is(.cgt-par-section, .cgt-par-bloc, .cgt-par-reglage){ --rub:var(--texte); }
.cgt-par-section-tete{
  display:flex;
  align-items:flex-start;
  gap:16px;
  margin:0 0 22px;
  padding:0 0 18px;
  border-bottom:1px solid var(--filet);
}
.cgt-par-numero.cgt-gst-numero{ width:44px; height:44px; font-size:var(--fs-16); }
.cgt-par-section-intitule{ display:flex; flex-direction:column; gap:4px; min-width:0; padding-top:2px; }
.cgt-par-section-titre{
  margin:0;
  font-family:var(--police-texte);
  font-size:clamp(1.375rem, 1.1875rem + .5vw, 1.625rem);   /* 24 px dès 1 025 px (V3-07) */
  font-weight:var(--fw-400);
  line-height:1.2;
  letter-spacing:var(--ls-accent);
  color:var(--texte);
}
/* Sous 24 px, le mot d'accent quitte --accent-titre (#F03E3E : 3,46:1 sur la table, réservé
   à 24 px et plus par la charte) pour --lien (4,91 / 5,46:1) — V3-07. */
@media (max-width: 1024px){ .cgt-par-section-titre{ --accent-titre:var(--lien); } }
.cgt-par-section-chapo{ margin:0; font-size:var(--fs-14); line-height:1.45; color:var(--texte-3); }
.cgt-par-section-corps{ display:flex; flex-direction:column; gap:20px; min-width:0; }


/* ==========================================================================
   5. CHAMPS — rangées, polices techniques, lecture seule
   ========================================================================== */
.cgt-par-page .sm-form-group{ display:flex; flex-direction:column; gap:7px; min-width:0; margin:0; }
.cgt-par-page .sm-form-group > label{ margin:0; }
.cgt-par-page .sm-form-group > .sm-form-help{ display:block; margin:0; }
.cgt-par-page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select, textarea):not(.cgt-par-lecture > *){
  width:100%;
  min-height:48px;
  margin:0;
  padding:var(--pad-champ);
  font-size:var(--fs-16);
  line-height:1.4;
  border-width:2px;
  border-style:solid;
}
.cgt-par-page textarea{ min-height:0; resize:vertical; }
.cgt-par-page select{ padding-right:36px; }
.cgt-par-page .sm-form-help a{ color:var(--lien); font-weight:var(--fw-700); }
.cgt-par-page .sm-form-help a:hover{ color:var(--lien-survol); }

.cgt-par-rangee{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:20px 22px;
  align-items:start;
}
.cgt-par-rangee--cp{ grid-template-columns:minmax(0, 12rem) minmax(0, 1fr); }
.cgt-par-rangee--iban{ grid-template-columns:minmax(0, 2fr) minmax(0, 1fr); }
.cgt-par-rangee--essai{ align-items:end; }

/* Police technique (IBAN, clés, URL) : les champs reçoivent leur police de
   30-composants (font-family:var(--police-texte), sélecteur très lourd) ; on
   redéfinit la VARIABLE sur le champ plutôt que de surenchérir. */
.cgt-par-mono{ --police-texte:var(--police-mono); font-family:var(--police-mono); letter-spacing:.02em; }
.cgt-par-page .cgt-par-mono{ font-size:var(--fs-15); }
.cgt-par-majuscules{ text-transform:uppercase; }
.cgt-par-majuscules::placeholder{ text-transform:none; }
/* Revue D : l'exemple (placeholder) reste en Figtree — la police technique est
   réservée à la saisie (« Ex.  :  » s'étirait en chasse fixe). --cgt-par-police
   garde la police du texte, que .cgt-par-mono redéfinit sur le champ. */
.cgt-par-page{ --cgt-par-police:var(--police-texte); }
.cgt-par-mono::placeholder{ font-family:var(--cgt-par-police); letter-spacing:normal; }
.cgt-par-mono-texte{ font-family:var(--police-mono); font-size:var(--fs-14); overflow-wrap:anywhere; }
.cgt-par-requis{ color:var(--lien); font-weight:var(--fw-800); }
/* Lecture seule (confédération, nom composé) : champ « intégré » (.cgt-champ-integre,
   30-composants § 2 — le dessin des champs saisissables ne s'y pose pas), cadre en
   pointillés sur le papier creusé, cadenas à droite : on voit que ça ne se saisit pas. */
.cgt-par-lecture{
  position:relative;
  display:flex;
  align-items:center;
  min-width:0;
  background:var(--papier-2);
  border:2px dashed var(--filet-fort);
}
.cgt-par-lecture > input[readonly]{
  flex:1 1 auto;
  width:100%;
  min-width:0;
  min-height:44px;
  margin:0;
  padding:var(--pad-champ);
  padding-right:44px;
  font-size:var(--fs-16);
  line-height:1.4;
  color:var(--texte-2);
  background:transparent;
  border:0;
  box-shadow:none;
  outline:none;
  cursor:default;
}
.cgt-par-lecture > i{
  position:absolute;
  right:16px;
  top:50%;
  margin-top:-7px;
  font-size:14px;
  line-height:1;
  color:var(--texte-indice);
  pointer-events:none;
}


/* ==========================================================================
   6. RÉGLAGES — texte + interrupteur (dessin : 48-profil § 6)
   ========================================================================== */
.cgt-par-reglage{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  min-width:0;
  padding:16px 18px;
  background:var(--papier-2);
  border:1px solid var(--filet);
  border-left:5px solid var(--rub);
}
.cgt-par-reglage-texte{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.cgt-par-reglage-titre{ font-size:var(--fs-16); font-weight:var(--fw-800); line-height:1.3; color:var(--texte); }
.cgt-par-reglage-detail{ font-size:var(--fs-14); line-height:1.4; color:var(--texte-3); }
.cgt-par-interrupteur.sm-switch{ flex:none; margin:0; cursor:pointer; }
/* Les réglages posés dans un bloc : pas de second fond */
.cgt-par-bloc .cgt-par-reglage{ background:var(--papier); border-left-width:1px; border-left-color:var(--filet); }

/* Réglages suspendus (sauvegarde automatique coupée) : champs désactivés */
.cgt-par-inactif{ opacity:.55; }


/* ==========================================================================
   7. BLOCS — sous-ensembles d'une section (passerelle, automatisation,
      compte de service, clé VAPID, planification…), dépliants <details>
   ========================================================================== */
.cgt-par-bloc{
  display:flex;
  flex-direction:column;
  gap:16px;
  min-width:0;
  margin:0;
  padding:18px 20px 20px;
  background:var(--papier-2);
  border:1px solid var(--filet);
  border-left:5px solid var(--rub);
}
.cgt-par-bloc-tete{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 14px; }
.cgt-par-bloc-titre{
  margin:0;
  font-family:var(--police-texte);
  font-size:var(--fs-18);
  font-weight:var(--fw-800);
  line-height:1.3;
  letter-spacing:var(--ls-titre);
  color:var(--texte);
}
.cgt-par-bloc-texte{ margin:0; font-size:var(--fs-14); line-height:1.5; color:var(--texte-2); }
.cgt-par-bloc-texte code{ font-family:var(--police-mono); font-size:.95em; }
.cgt-par-bloc > .cgt-fac-etat{ align-self:flex-start; }
.cgt-par-etiquettes{ display:inline-flex; flex-wrap:wrap; gap:6px; }

/* Dépliant : le sommaire est la tête du bloc (chevron dessiné, pas d'icône) */
.cgt-par-details{ gap:0; padding:0; }
.cgt-par-details-titre{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:var(--cible-tactile);
  padding:14px 18px;
  font-size:var(--fs-16);
  font-weight:var(--fw-800);
  line-height:1.3;
  color:var(--texte);
  list-style:none;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.cgt-par-details-titre::-webkit-details-marker{ display:none; }
.cgt-par-details-titre::before{
  content:"";
  flex:none;
  width:9px;
  height:9px;
  margin:0 2px 0 3px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  rotate:-45deg;
  transition:rotate var(--duree-3) var(--courbe-sortie);
}
.cgt-par-details[open] > .cgt-par-details-titre::before{ rotate:45deg; }
.cgt-par-details-titre:focus-visible{ outline:2px solid var(--focus); outline-offset:-2px; }
@media (hover: hover){ .cgt-par-details-titre:hover{ background:var(--papier-3); } }
.cgt-par-details-corps{ display:flex; flex-direction:column; gap:16px; padding:4px 20px 20px; }

/* Fiche dt/dd (compte de service) */
.cgt-par-fiche{ display:flex; flex-direction:column; gap:8px; margin:0; }
.cgt-par-fiche > div{ display:grid; grid-template-columns:7rem minmax(0, 1fr); gap:12px; align-items:baseline; }
.cgt-par-fiche dt{ font-size:var(--fs-12); font-weight:var(--fw-700); letter-spacing:var(--ls-majuscules); text-transform:uppercase; color:var(--texte-3); }
.cgt-par-fiche dd{ margin:0; font-size:var(--fs-15); font-weight:var(--fw-700); color:var(--texte); overflow-wrap:anywhere; }


/* ==========================================================================
   8. ACTIONS, ESSAIS, STATUTS, CODE
   ========================================================================== */
.cgt-par-actions{ display:flex; flex-wrap:wrap; align-items:center; gap:12px 14px; }
.cgt-par-actions--essai{ padding-top:4px; }
.cgt-par-note{ margin:0; font-size:var(--fs-13); line-height:1.45; color:var(--texte-3); }
.cgt-par-note i{ color:var(--texte-indice); margin-right:4px; }

/* Essai (clé IA) : bouton + résultat sur la même ligne que le modèle */
.cgt-par-essai{ display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; min-height:48px; }
.cgt-par-resultat:empty{ display:none; }

/* Statut : pictogramme + libellé (jamais la couleur seule) */
.cgt-par-statut{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:5px 12px 5px 10px;
  font-size:var(--fs-14);
  font-weight:var(--fw-700);
  line-height:1.35;
  color:var(--texte-2);
  background:var(--papier-3);
  border:1px solid var(--filet-fort);
  border-left-width:4px;
}
.cgt-par-statut i{ flex:none; font-size:14px; }
.cgt-par-statut[data-etat="ok"]{ color:var(--succes-texte); background:var(--succes-fond); border-color:var(--succes-bord); border-left-color:var(--cgt-cyan-plein); }
.cgt-par-statut[data-etat="ko"]{ color:var(--erreur-texte); background:var(--erreur-fond); border-color:var(--erreur-bord); border-left-color:var(--cgt-rouge); }
.cgt-par-statut[data-etat="attente"] i{ color:var(--accent-titre); }

/* Dernière exécution du cron */
.cgt-par-derniere{ display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; }

/* Champ + bouton à icône seule (copier, régénérer) */
.cgt-par-copie{ display:flex; align-items:stretch; gap:10px; min-width:0; }
.cgt-par-copie input{ flex:1 1 auto; min-width:0; }
.cgt-par-copie .sm-btn.sm-btn-icon{ flex:none; width:48px; height:48px; min-width:48px; font-size:16px; }
/* Le libellé caché reste lu : pas de marge d'icône */
.cgt-par-page .sm-btn-icon i{ margin:0; }

/* Code (crontab, webhook) : bande d'encre, police technique */
.cgt-par-code{
  display:block;
  margin:0;
  padding:12px 14px;
  font-family:var(--police-mono);
  font-size:var(--fs-13);
  line-height:1.5;
  color:var(--bande-texte);
  background:var(--bande);
  border-left:4px solid var(--cgt-jaune);
  overflow-x:auto;
  white-space:nowrap;
  -webkit-overflow-scrolling:touch;
}
.cgt-par-bloc .cgt-par-code#cgt-par-webhook{ white-space:normal; overflow-wrap:anywhere; }

/* Chargement dans une section */
.cgt-par-chargement.cgt-cpt-chargement{ min-height:120px; }

/* Jour du prélèvement (masqué par l'attribut hidden quand l'automatisation est coupée) */
.cgt-par-jour{ max-width:18rem; }
.cgt-par-jour[hidden]{ display:none; }

/* Liste « Comment ça… » : pictogrammes de rubrique */
.cgt-par-points{ display:flex; flex-direction:column; gap:12px; margin:0; padding:0; list-style:none; }
.cgt-par-point{ display:flex; align-items:flex-start; gap:12px; min-width:0; }
.cgt-par-point-picto{
  flex:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  font-size:13px;
  background:var(--rub-plein);
  color:var(--rub-sur);
  box-shadow:2px 2px 0 0 var(--tranche);
}
.cgt-par-point-texte{ padding-top:4px; font-size:var(--fs-15); line-height:1.45; color:var(--texte-2); }
.cgt-par-point-texte strong{ font-weight:var(--fw-800); color:var(--texte); }
.cgt-par-points-titre{ margin:6px 0 -4px; }

/* Bannières (réutilisées : .cgt-cpt-alerte) — espacement dans la page */
.cgt-par-page .cgt-cpt-alerte.sm-alert{ margin:0; }
.cgt-par-page .cgt-cpt-alerte.sm-alert strong{ font-weight:var(--fw-800); }
.cgt-par-page .cgt-cpt-alerte.sm-alert .cgt-cpt-liste{ font-size:var(--fs-14); line-height:1.5; }

/* Piles : sous-blocs remplis par le JS (passerelle, Firebase) */
.cgt-par-pile{ display:flex; flex-direction:column; gap:16px; min-width:0; }
.cgt-par-etat.sm-alert > div > strong{ display:block; font-size:var(--fs-16); }


/* ==========================================================================
   9. LA CHARTE CGT (figée) — logo officiel, nuancier, rubriques, verrou
   ========================================================================== */
.cgt-par-charte{
  display:grid;
  grid-template-columns:auto minmax(0, 1fr);
  gap:22px 32px;
  align-items:center;
}
.cgt-par-charte-logo{ display:flex; flex-direction:column; align-items:center; gap:12px; margin:0; }
/* Autocollant : pastille blanche (règle de la charte sur fond coloré ou sombre),
   contour et tranche d'encre ; le logo n'est jamais retouché */
.cgt-par-charte-pastille{
  display:flex;
  align-items:center;
  justify-content:center;
  width:132px;
  height:132px;
  padding:16px;
  background:var(--cgt-blanc);
  border:2px solid var(--cgt-noir);
  box-shadow:5px 5px 0 0 var(--cgt-noir);
  rotate:-2deg;
  transition:rotate var(--duree-4) var(--courbe-ressort);
}
.cgt-par-charte-pastille img{ display:block; width:auto; height:100%; max-width:100%; object-fit:contain; }
@media (hover: hover){ .cgt-par-charte-logo:hover .cgt-par-charte-pastille{ rotate:0deg; } }
.cgt-par-charte-logo figcaption{ display:flex; flex-direction:column; align-items:center; gap:2px; text-align:center; }
.cgt-par-charte-legende{ font-size:var(--fs-13); line-height:1.35; color:var(--texte-3); }
:root[data-theme="dark"] .cgt-par-charte-pastille{ border-color:var(--cgt-blanc); box-shadow:5px 5px 0 0 var(--tranche); }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .cgt-par-charte-pastille{ border-color:var(--cgt-blanc); box-shadow:5px 5px 0 0 var(--tranche); }
}

/* Nuancier : trois primitives de la marque, constantes dans les deux thèmes */
.cgt-par-nuancier{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:16px;
  margin:0;
  padding:0;
  list-style:none;
}
.cgt-par-nuance{ display:flex; flex-direction:column; gap:10px; min-width:0; }
.cgt-par-nuance-pastille{
  display:block;
  height:64px;
  border:2px solid var(--bord-bouton-2);
  box-shadow:3px 3px 0 0 var(--tranche);
}
.cgt-par-nuance[data-nuance="rouge"] .cgt-par-nuance-pastille{ background:var(--cgt-rouge); }
.cgt-par-nuance[data-nuance="jaune"] .cgt-par-nuance-pastille{ background:var(--cgt-jaune); }
.cgt-par-nuance[data-nuance="encre"] .cgt-par-nuance-pastille{ background:var(--cgt-noir); }
.cgt-par-nuance-texte{ display:flex; flex-direction:column; gap:1px; min-width:0; }
.cgt-par-nuance-texte strong{ font-size:var(--fs-15); font-weight:var(--fw-800); line-height:1.3; color:var(--texte); }
.cgt-par-nuance-texte code{ font-family:var(--police-mono); font-size:var(--fs-13); color:var(--texte-2); }
.cgt-par-nuance-texte span{ font-size:var(--fs-13); line-height:1.35; color:var(--texte-3); }

/* Couleurs des rubriques : barre arc-en-ciel en tête, puis les six noms */
.cgt-par-rubriques{ display:flex; flex-direction:column; gap:12px; padding-top:18px; border-top:1px solid var(--filet); }
.cgt-par-rubriques > .cgt-libelle{ margin:0; }
.cgt-par-rubriques-liste{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:0;
  padding:0;
  list-style:none;
}
.cgt-par-rubriques-liste li{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 12px 6px 8px;
  font-size:var(--fs-14);
  font-weight:var(--fw-700);
  line-height:1.3;
  color:var(--texte);
  background:var(--papier);
  border:1px solid var(--filet-fort);
  box-shadow:2px 2px 0 0 var(--tranche);
}
.cgt-par-rubrique-carre{ flex:none; width:16px; height:16px; background:var(--rub); }

.cgt-par-verrou.sm-alert > i:first-child{ margin-top:2px; }


/* ==========================================================================
   10. SAUVEGARDES — registre de la comptabilité (.cgt-cpt-ligne, 56)
   ========================================================================== */
.cgt-par-sauvegardes{ display:flex; flex-direction:column; gap:12px; min-width:0; }
.cgt-par-sauvegardes-titre{ margin:6px 0 0; }
.cgt-par-registre{ margin:0; padding:0; list-style:none; }
.cgt-par-registre .cgt-cpt-ligne{ --cpt-col-montant:6.5rem; --cpt-col-actions:10rem; }
.cgt-par-taille{ font-size:var(--fs-14); }
.cgt-par-taille .sm-badge{ font-variant-numeric:tabular-nums; text-transform:none; }
.cgt-par-espace{ padding-left:2px; }
.cgt-par-sauvegardes .cgt-cpt-vide.sm-empty-state:not(#cgt){ padding:28px 16px 12px; }


/* ==========================================================================
   11. BARRE D'ENREGISTREMENT — collée au pied de la zone de défilement
   ========================================================================== */
/* Revue D : un élément collant s'arrête au bord du CONTENU de la zone qui défile
   (.sm-content-area), donc au-dessus de son padding-bottom — 40 px sur bureau,
   70 px sur tablette (public.css, !important). Le formulaire glissait sous la barre
   puis réapparaissait dessous, en tranches coupées.
   --cgt-par-pied = ce padding : la barre descend jusqu'au bord de l'écran (bottom
   négatif). --cgt-par-pied-page = le padding-bottom de #sm-page-content (40 px,
   gabarit) : avec les deux en marge négative, la fin du défilement tombe au pied de
   la barre (sinon, en fin de formulaire, elle remontait de 40 px sur un vide).
   Téléphone : barre non collante, les deux à 0. */
.cgt-par-barre{
  --cgt-par-pied:40px;
  --cgt-par-pied-page:40px;
  position:sticky;
  bottom:calc(-1 * var(--cgt-par-pied));
  z-index:var(--z-collant);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px 24px;
  margin:28px 0 calc(-1 * (var(--cgt-par-pied) + var(--cgt-par-pied-page)));
  padding:16px 20px;
  background:var(--papier);
  border:1px solid var(--filet-fort);
  border-top:4px solid var(--cgt-rouge);
  box-shadow:0 -10px 24px -12px rgba(var(--cgt-noir-rgb), .28);
}
@media (min-width: 769px) and (max-width: 1024px){
  .cgt-par-barre{ --cgt-par-pied:70px; }
}
.cgt-par-barre-texte{ margin:0; max-width:52ch; font-size:var(--fs-14); line-height:1.4; color:var(--texte-2); }
.cgt-par-barre .sm-btn{ flex:none; }
:root[data-theme="dark"] .cgt-par-barre{ box-shadow:0 -12px 28px -10px rgba(0,0,0,.7); }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .cgt-par-barre{ box-shadow:0 -12px 28px -10px rgba(0,0,0,.7); }
}


/* ==========================================================================
   12. MODALES ET CONFIRMATIONS DU LOT
   ========================================================================== */
/* Contenu riche d'une confirmation (liste, champ, alerte) : aligné à gauche */
.cgt-confirmation .cgt-par-confirmation{ display:flex; flex-direction:column; gap:12px; text-align:left; }
.cgt-confirmation .cgt-par-confirmation p{ margin:0; }
.cgt-confirmation .cgt-par-confirmation ul{ margin:0; padding-left:20px; line-height:1.55; }
.cgt-confirmation .cgt-par-confirmation .sm-form-group{ display:flex; flex-direction:column; gap:7px; margin:4px 0 0; }
.cgt-confirmation .cgt-par-confirmation .sm-input{ width:100%; min-height:48px; padding:var(--pad-champ); font-size:var(--fs-16); border-width:2px; border-style:solid; }
.cgt-confirmation .cgt-par-confirmation .sm-alert{ margin:0; text-align:left; }

/* Résultat de la migration */
.cgt-par-migration .cgt-confirmation-message p{ margin:0 0 8px; }
.cgt-par-migration .cgt-confirmation-message p:last-child{ margin-bottom:0; }
.cgt-par-migration-erreurs{ font-weight:var(--fw-700); color:var(--erreur-texte); }

/* Importer une sauvegarde */
.cgt-par-import .sm-modal-container{ max-width:520px; }
.cgt-par-import .sm-modal-body{ display:flex; flex-direction:column; gap:18px; }
.cgt-par-import .sm-form-group{ display:flex; flex-direction:column; gap:8px; margin:0; }
.cgt-par-fichier.sm-input{
  width:100%;
  padding:14px;
  font-family:var(--police-texte);
  font-size:var(--fs-15);
  color:var(--texte);
  background:var(--papier-2);
  border:2px dashed var(--bord-champ);
  border-radius:0;
  cursor:pointer;
}
.cgt-par-fichier.sm-input:focus-visible{ outline:2px solid var(--focus); outline-offset:2px; }
.cgt-par-fichier::file-selector-button{
  margin-right:12px;
  padding:8px 14px;
  font-family:var(--police-texte);
  font-weight:var(--fw-700);
  color:var(--texte);
  background:var(--papier);
  border:2px solid var(--bord-bouton-2);
  box-shadow:2px 2px 0 0 var(--tranche-bouton);
  cursor:pointer;
}


/* ==========================================================================
   13. MOUVEMENT — coupé en mouvement réduit
   ========================================================================== */
@media (prefers-reduced-motion: reduce){
  .cgt-par-onglet, .cgt-par-onglet-picto, .cgt-par-charte-pastille,
  .cgt-par-details-titre::before{ transition:none; }
  .cgt-par-charte-pastille{ rotate:0deg; }
}


/* ==========================================================================
   14. ADAPTATIONS — tablette, téléphone
   ========================================================================== */
@media (max-width: 1024px){
  .cgt-par-page{ gap:22px; }
}
@media (max-width: 768px){
  .cgt-par-page{ gap:20px; padding-top:0; }
  .cgt-par-chapo{ margin-top:10px; font-size:var(--fs-15); }
  .cgt-par-panneau.active{ gap:20px; }
  .cgt-par-section{ padding:18px 16px 20px; }
  .cgt-par-section-tete{ gap:12px; margin-bottom:18px; padding-bottom:14px; }
  .cgt-par-numero.cgt-gst-numero{ width:38px; height:38px; font-size:var(--fs-15); }
  .cgt-par-section-titre{ font-size:var(--fs-20); }
  .cgt-par-section-corps{ gap:18px; }
  .cgt-par-rangee,
  .cgt-par-rangee--iban{ grid-template-columns:minmax(0, 1fr); gap:18px; }
  .cgt-par-rangee--cp{ grid-template-columns:minmax(0, 7.5rem) minmax(0, 1fr); gap:14px; }
  .cgt-par-reglage{ padding:14px; gap:14px; }
  .cgt-par-reglage-titre{ font-size:var(--fs-15); }
  .cgt-par-reglage-detail{ font-size:var(--fs-13); }
  .cgt-par-bloc{ padding:16px 14px 16px; }
  .cgt-par-details{ padding:0; }
  .cgt-par-details-titre{ padding:12px 14px; }
  .cgt-par-details-corps{ padding:4px 14px 16px; }
  .cgt-par-actions .sm-btn{ flex:1 1 auto; justify-content:center; }
  .cgt-par-copie .sm-btn.sm-btn-icon{ width:48px; }

  .cgt-par-charte{ grid-template-columns:minmax(0, 1fr); justify-items:center; }
  .cgt-par-nuancier{ width:100%; gap:12px; }
  .cgt-par-nuance-pastille{ height:52px; }
  .cgt-par-charte-pastille{ width:112px; height:112px; padding:14px; }

  .cgt-par-registre .cgt-cpt-ligne{ --cpt-col-actions:auto; }
  /* Actions à icône seule : carrés de 44 px alignés à droite (étirés, elles
     ressemblaient à des champs vides) */
  .cgt-par-registre .cgt-cpt-ligne-actions{ justify-content:flex-end; gap:12px; }
  .cgt-par-registre .cgt-cpt-ligne-actions .sm-btn.sm-btn-icon{ flex:none; width:44px; height:44px; min-width:44px; min-height:44px; }

  /* Téléphone : #sm-page-content est coupé en largeur (overflow-x:hidden, public.css),
     ce qui en fait le conteneur de défilement des éléments collants — la barre ne
     peut pas y coller au pied de l'écran. Elle ferme donc simplement le formulaire. */
  .cgt-par-barre{
    --cgt-par-pied:0px;
    --cgt-par-pied-page:0px;
    position:relative;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    margin-top:20px;
    padding:12px 12px;
  }
  .cgt-par-barre-texte{ font-size:var(--fs-13); text-align:center; max-width:none; }
  .cgt-par-barre .sm-btn{ width:100%; justify-content:center; }
}
@media (max-width: 380px){
  .cgt-par-nuancier{ grid-template-columns:minmax(0, 1fr); }
  .cgt-par-nuance{ flex-direction:row; align-items:center; }
  .cgt-par-nuance-pastille{ flex:none; width:56px; height:44px; }
}
