:root {
  --rpp-green: #0a6e31;
  --rpp-green-dark: #074d22;
  --rpp-green-light: #e8f5ec;
  --rpp-gold: #d4a017;
  --rpp-red: #c8102e;
  --sidebar-width: 240px;

  /* Palette graphiques (categorielle, ordre fixe, validee CVD) */
  --chart-surface: #fcfcfb;
  --chart-text-primary: #0b0b0b;
  --chart-text-secondary: #52514e;
  --chart-muted: #898781;
  --chart-grid: #e1e0d9;
  /* Ordre FIXE, jamais cycle : il est valide, pas choisi a l'oeil.
     L'ordre precedent (bleu, aqua, jaune, vert, violet, rouge, magenta,
     orange) echouait le controle de lisibilite en vision normale sur la paire
     adjacente magenta/orange (Delta E 12,9 < 15 : deux series voisines
     difficiles a distinguer meme sans trouble de la vision des couleurs).
     Celui-ci passe les cinq controles en clair comme en sombre. */
  --chart-series-1: #2a78d6; /* bleu */
  --chart-series-2: #eb6834; /* orange */
  --chart-series-3: #1baf7a; /* aqua */
  --chart-series-4: #eda100; /* jaune */
  --chart-series-5: #e87ba4; /* magenta */
  --chart-series-6: #008300; /* vert */
  --chart-series-7: #6250d6; /* violet */
  --chart-series-8: #e34948; /* rouge */
  --chart-emphasis: #2a78d6;  /* serie mise en avant */
  --chart-deemphasis: #c9cdc6; /* series de contexte (gris de retrait) */
  --chart-good: #0ca30c;
  --chart-warning: #fab219;
  --chart-serious: #ec835a;
  --chart-critical: #d03b3b;
}

body {
  background-color: #f4f7f5;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ---- Navbar ---- */
.rpp-navbar {
  background: linear-gradient(135deg, var(--rpp-green) 0%, var(--rpp-green-dark) 100%);
}
.rpp-logo {
  background: #fff;
  color: var(--rpp-green-dark);
  font-weight: 800;
  border-radius: 6px;
  padding: 2px 8px;
  letter-spacing: 1px;
}
.rpp-logo-lg {
  background: var(--rpp-green);
  color: #fff;
  font-weight: 800;
  border-radius: 12px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.notif-badge {
  position: absolute;
  top: 2px;
  right: -2px;
  font-size: 0.6rem;
}
.avatar-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--rpp-gold);
  color: #3a2d00;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}
.avatar-lg {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--rpp-gold);
  color: #3a2d00;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 2rem;
}
.profile-photo {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--rpp-green-light);
}

/* ---- Layout ---- */
.app-layout {
  display: flex;
  min-height: calc(100vh - 56px);
}
.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e3e7e4;
  overflow: hidden;
  transition: width .2s ease, border-color .2s ease;
}
.app-content {
  flex-grow: 1;
  min-width: 0;
}
.app-layout.sidebar-collapsed .app-sidebar {
  width: 0;
  border-right-color: transparent;
}
.sidebar-toggle-btn {
  border-color: rgba(255,255,255,.5);
}
.sidebar-heading {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #8a8f8c;
  font-weight: 700;
  padding: 12px 16px 4px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.sidebar-nav {
  width: var(--sidebar-width);
}
.sidebar-nav .nav-link {
  color: #33403a;
  padding: 8px 16px;
  border-left: 3px solid transparent;
  font-size: 0.92rem;
  white-space: nowrap;
}
.sidebar-nav .nav-link i { width: 20px; }
.sidebar-nav .nav-link:hover {
  background: var(--rpp-green-light);
}
.sidebar-nav .nav-link.active {
  background: var(--rpp-green-light);
  border-left-color: var(--rpp-green);
  color: var(--rpp-green-dark);
  font-weight: 600;
}

/* ---- Menu lateral mobile (offcanvas) ---- */
#sidebarOffcanvas {
  --bs-offcanvas-width: 280px;
}
#sidebarOffcanvas .offcanvas-header {
  background: linear-gradient(135deg, var(--rpp-green) 0%, var(--rpp-green-dark) 100%);
  color: #fff;
}
#sidebarOffcanvas .sidebar-nav {
  width: 100%;
}

/* ---- Auth pages ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--rpp-green) 0%, var(--rpp-green-dark) 100%);
  padding: 24px;
}
.auth-card {
  background: #fff;
  border-radius: 14px;
  padding: 2.2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.auth-card-lg { max-width: 720px; }

/* ---- Buttons / badges ---- */
.btn-success {
  background-color: var(--rpp-green);
  border-color: var(--rpp-green);
}
.btn-success:hover, .btn-success:focus {
  background-color: var(--rpp-green-dark);
  border-color: var(--rpp-green-dark);
}
.btn-outline-success {
  color: var(--rpp-green);
  border-color: var(--rpp-green);
}
.btn-outline-success:hover {
  background-color: var(--rpp-green);
  border-color: var(--rpp-green);
}

.badge-success { background-color: #1c8a4a; color: #fff; }
.badge-warning { background-color: var(--rpp-gold); color: #3a2d00; }
.badge-info { background-color: #2a7fb8; color: #fff; }
.badge-danger { background-color: var(--rpp-red); color: #fff; }
.badge-secondary { background-color: #7a8078; color: #fff; }
.badge { padding: .4em .65em; }

.role-badge.role-superadmin { background-color: var(--rpp-red); color: #fff; }
.role-badge.role-admin { background-color: #2a7fb8; color: #fff; }
.role-badge.role-responsable_annexe { background-color: #1baf7a; color: #fff; }
.role-badge.role-user { background-color: #7a8078; color: #fff; }

/* ---- Cards / stats ---- */
.card { border: none; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.card-header { background: #fff; border-bottom: 1px solid #eef1ef; font-weight: 600; border-radius: 12px 12px 0 0 !important; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--rpp-green-dark); }
.stat-card .stat-label { font-size: .82rem; color: #6b756f; }
.stat-card { position: relative; }

/* ---- Comments ---- */
.comment-bubble {
  background: #f1f3f2;
  border-radius: 10px;
  padding: 10px 14px;
}
.comment-bubble.comment-admin {
  background: var(--rpp-green-light);
}
.comment-bubble.comment-internal {
  background: #fff4e0;
  border: 1px dashed var(--rpp-gold);
}
.notif-unread { background: var(--rpp-green-light); }

.app-footer {
  background: #fff;
  border-top: 1px solid #e3e7e4;
}

/* Password strength meter */
.pw-strength { height: 5px; border-radius: 3px; transition: all .2s; background: #e3e7e4; }
.pw-strength-bar { height: 100%; border-radius: 3px; transition: all .2s; }

/* =====================================================================
   Pages d'analyse : Statistiques et AsmaIA
   En-tete de page, onglets, tuiles d'indicateur, cartes de graphique.
   ===================================================================== */

/* ---- En-tete de page ---- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, var(--rpp-green-dark) 0%, var(--rpp-green) 70%, #0d8a3e 100%);
  color: #fff;
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.1rem;
  position: relative;
  overflow: hidden;
}
.page-head::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(212, 160, 23, .15);
}
.page-head-main, .page-head-actions { position: relative; z-index: 1; }
.page-head-title { font-size: 1.3rem; font-weight: 700; margin: 0; }
.page-head-sub { margin: .25rem 0 0; font-size: .84rem; opacity: .88; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Onglets segmentes ---- */
.seg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: #fff;
  border: 1px solid #e6ece8;
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 1.3rem;
}
.seg-tab {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  border-radius: 9px;
  padding: .55rem .9rem;
  font-size: .88rem;
  font-weight: 600;
  color: #5d6b62;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.seg-tab:hover { background: var(--rpp-green-light); color: var(--rpp-green-dark); }
.seg-tab.active {
  background: linear-gradient(135deg, var(--rpp-green) 0%, var(--rpp-green-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(10, 110, 49, .3);
}
.seg-tab:focus-visible { outline: 2px solid var(--rpp-gold); outline-offset: 2px; }
.seg-tab .bi { font-size: 1rem; }
@media (max-width: 575.98px) {
  .seg-tab span { display: none; }   /* icone seule : 4 onglets tiennent sur la ligne */
  .seg-tab { flex: 1 1 0; padding: .55rem 0; }
}

.tab-pane[hidden] { display: none; }

/* ---- Barre de filtres (une seule, au-dessus de tout ce qu'elle cadre) ---- */
.stats-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e6ece8;
  border-radius: 12px;
  padding: .6rem .8rem;
  margin-bottom: 1.1rem;
}
.stats-presets { display: flex; flex-wrap: wrap; gap: 3px; }
.stats-preset {
  display: inline-block;
  padding: .32rem .75rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 500;
  color: #4a5750;
  text-decoration: none;
}
.stats-preset:hover { background: var(--rpp-green-light); color: var(--rpp-green-dark); }
.stats-preset.active { background: var(--rpp-green); color: #fff; }
.stats-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.stats-range-label { font-size: .8rem; color: #8c998f; }
.stats-range input[type="date"] { width: auto; border-radius: 8px; }

/* ---- Titres de section ---- */
.stats-section-title {
  font-weight: 700;
  color: var(--rpp-green-dark);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: .74rem;
  margin: 1.6rem 0 .8rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.stats-section-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: #e2eae5;
}
.tab-pane > .stats-section-title:first-child { margin-top: 0; }
.stats-section-note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: #9aa69e;
}

/* ---- Tuiles d'indicateur ---- */
.kpi {
  position: relative;
  background: #fff;
  border: 1px solid #e6ece8;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  height: 100%;
  overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}
.kpi:hover { box-shadow: 0 6px 22px rgba(12, 48, 26, .09); transform: translateY(-1px); }
/* Filet de couleur : un reperage de famille, il ne code aucune valeur. */
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--kpi-ton, var(--rpp-green));
}
.kpi-vert   { --kpi-ton: var(--rpp-green); }
.kpi-bleu   { --kpi-ton: var(--chart-series-1); }
.kpi-orange { --kpi-ton: var(--chart-series-2); }
.kpi-ambre  { --kpi-ton: var(--rpp-gold); }
.kpi-neutre { --kpi-ton: #c9cdc6; }

.kpi-top { display: flex; align-items: center; gap: 8px; margin-bottom: .45rem; }
.kpi-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--kpi-ton) 14%, #fff);
  color: var(--kpi-ton);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  flex: 0 0 auto;
}
.kpi-label { font-size: .78rem; color: #6c7a70; line-height: 1.25; }
.kpi-pct { margin-left: auto; font-weight: 700; color: #15301f; }
/* Chiffres proportionnels (pas tabular-nums) : a cette taille, des chiffres
   de largeur egale font paraitre un nombre comme 121 trop aere. */
.kpi-value {
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.1;
  color: #15301f;
}
.kpi-unit { font-size: .85rem; font-weight: 500; color: #8c998f; margin-left: 2px; }
.kpi-note { font-size: .74rem; color: #9aa69e; margin-top: .4rem; }
.kpi-delta { font-size: .76rem; margin-top: .4rem; font-weight: 600; }
.kpi-delta.is-good { color: #0a7d3c; }
.kpi-delta.is-bad { color: #c0392b; }
.kpi-delta.is-stable { color: #9aa69e; }
.kpi-delta-ref { font-weight: 400; color: #9aa69e; }

/* ---- Jauge : un ratio contre une limite ----
   La piste non remplie est une teinte claire du meme vert que le remplissage,
   pour que l'etat se lise sur toute la largeur de la barre. */
.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--rpp-green-light);
  overflow: hidden;
  margin-top: .55rem;
}
.meter-fill { height: 100%; border-radius: 999px; transition: width .3s; }
.meter-fill.is-good { background: var(--chart-good); }
.meter-fill.is-warning { background: var(--chart-warning); }
.meter-fill.is-critical { background: var(--chart-critical); }

/* ---- Cartes de graphique ---- */
.chart-card {
  height: 100%;
  border: 1px solid #e6ece8;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow .15s;
}
.chart-card:hover { box-shadow: 0 6px 22px rgba(12, 48, 26, .09); }
.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: .85rem 1rem .6rem;
  border-bottom: 1px solid #f0f4f1;
}
.chart-card-heading { min-width: 0; }
.chart-card-title { font-weight: 600; font-size: .92rem; color: #15301f; display: block; }
.chart-card-sub { font-size: .73rem; color: #9aa69e; display: block; }
.chart-card-actions { display: flex; gap: 3px; flex: 0 0 auto; }
.chart-act {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #e2eae5;
  background: #fff;
  color: #6c7a70;
  font-size: .8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s, color .15s, border-color .15s;
}
.chart-act:hover { background: var(--rpp-green-light); color: var(--rpp-green-dark); border-color: #cde5d6; }
.chart-act.active { background: var(--rpp-green); border-color: var(--rpp-green); color: #fff; }

/* Hauteur du corps : elle inclut la bande des libelles d'axe, sinon la carte
   se dote d'un petit ascenseur vertical interne. */
.chart-card-body { position: relative; height: 300px; padding: .9rem 1rem 1rem; }
.chart-card-body.chart-tall { height: 390px; }

/* Etat vide : dire qu'il n'y a pas de donnee, plutot que laisser un cadre
   blanc qui se lit comme un bug ou un chargement bloque. */
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: #b3bdb6;
  font-size: .85rem;
  text-align: center;
  padding: 1rem;
}

/* ---- Vue tableau (equivalent accessible du graphique) ---- */
.chart-table-view {
  position: absolute;
  inset: .9rem 1rem 1rem;
  overflow: auto;
}
.chart-table { font-size: .82rem; margin: 0; }
.chart-table th {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 2px solid var(--rpp-green-light);
  color: var(--rpp-green-dark);
  font-weight: 600;
}
/* Chiffres alignes verticalement : la ou tabular-nums est justifie. */
.chart-table-num { font-variant-numeric: tabular-nums; }

@media print {
  .stats-filters, .chart-card-actions, .page-head-actions, .seg-tabs,
  .app-sidebar, .rpp-navbar, .asmaia-widget { display: none !important; }
  .tab-pane[hidden] { display: block !important; }  /* tout imprimer, pas seulement l'onglet ouvert */
  .chart-card { break-inside: avoid; }
  .page-head { background: none !important; color: #000 !important; }
}


/* ---- AsmaIA (assistante locale) ---- */
.asmaia-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1050;
}
.asmaia-bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--rpp-green) 0%, var(--rpp-green-dark) 100%);
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.asmaia-bubble:hover { filter: brightness(1.1); }
.asmaia-bubble-open { transform: scale(0.92); }

.asmaia-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 460px;
  max-height: 70vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.asmaia-header {
  background: linear-gradient(135deg, var(--rpp-green) 0%, var(--rpp-green-dark) 100%);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.asmaia-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}
.asmaia-title { font-weight: 700; line-height: 1.1; }
.asmaia-subtitle { font-size: .72rem; opacity: .85; }

.asmaia-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f4f7f5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.asmaia-msg {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: .88rem;
  line-height: 1.4;
}
.asmaia-msg-bot {
  align-self: flex-start;
  background: var(--rpp-green-light);
  color: #143b22;
  border-bottom-left-radius: 3px;
}
.asmaia-msg-user {
  align-self: flex-end;
  background: var(--rpp-green);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.asmaia-typing { opacity: .65; font-style: italic; }
.asmaia-link-btn {
  align-self: flex-start;
  font-size: .8rem;
  font-weight: 600;
  color: var(--rpp-green-dark);
  background: #fff;
  border: 1px solid var(--rpp-green-light);
  border-radius: 8px;
  padding: 5px 10px;
  text-decoration: none;
}
.asmaia-link-btn:hover { background: var(--rpp-green-light); }

.asmaia-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-start;
  max-width: 92%;
}
.asmaia-suggestion-btn {
  text-align: left;
  background: #fff;
  border: 1px solid #d7e4db;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: .82rem;
  color: var(--rpp-green-dark);
}
.asmaia-suggestion-btn:hover { background: var(--rpp-green-light); }

.asmaia-form {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid #eef1ef;
  background: #fff;
}
.asmaia-form .form-control { font-size: .88rem; }

@media (max-width: 400px) {
  .asmaia-widget { right: 12px; bottom: 12px; }
  .asmaia-panel { width: calc(100vw - 24px); }
}

/* ---- AsmaIA : module d'analyse & aide a la decision ---- */
.asmaia-synthese-card {
  background: linear-gradient(135deg, var(--rpp-green-light) 0%, #fff 100%);
  border: 1px solid #d7e4db;
}
.asmaia-avatar-lg {
  width: 46px; height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--rpp-green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

/* ---- Carte de membre (impression) ---- */
.carte-page {
  background: #e9edea;
  min-height: 100vh;
  padding: 24px;
}
.cartes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.carte-membre-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.carte-membre {
  width: 85.6mm;
  height: 54mm;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--rpp-green) 0%, var(--rpp-green-dark) 100%);
  color: #fff;
  position: relative;
  padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  page-break-inside: avoid;
  break-inside: avoid;
  overflow: hidden;
}
.carte-membre-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.carte-membre-logo {
  background: #fff;
  color: var(--rpp-green-dark);
  font-weight: 800;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: .72rem;
  letter-spacing: .5px;
}
.carte-membre-logo-img {
  height: 22px;
  max-width: 60px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  padding: 2px 4px;
}
.carte-membre-partyname {
  font-size: .5rem;
  line-height: 1.05;
  opacity: .9;
  text-transform: uppercase;
}
.carte-membre-body {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-grow: 1;
}
.carte-membre-photo {
  width: 58px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid #fff;
  background: #fff;
  flex-shrink: 0;
}
.carte-membre-photo-placeholder {
  width: 58px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 2px solid #fff;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.carte-membre-infos {
  font-size: .64rem;
  line-height: 1.4;
  min-width: 0;
}
.carte-membre-nom {
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.carte-membre-matricule { font-family: 'Courier New', monospace; }
.carte-membre-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
}
.carte-membre-label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .05em;
  opacity: .9;
}
.carte-membre-qr {
  width: 50px;
  height: 50px;
  background: #fff;
  border-radius: 4px;
  padding: 2px;
}

@media print {
  .no-print { display: none !important; }
  .carte-page { background: #fff; padding: 0; min-height: 0; }
  body { margin: 0; }
  .carte-membre { box-shadow: none; }
}

/* ---- RPPChat ---- */
.chat-app {
  display: flex;
  height: calc(100vh - 160px);
  min-height: 480px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  overflow: hidden;
}
.chat-sidebar {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #eef1ef;
}
.chat-sidebar-header {
  background: linear-gradient(135deg, var(--rpp-green) 0%, var(--rpp-green-dark) 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-conversations-list {
  flex-grow: 1;
  overflow-y: auto;
}
.chat-conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: #21281f;
  border-bottom: 1px solid #f4f6f4;
  position: relative;
}
.chat-conv-item:hover { background: var(--rpp-green-light); }
.chat-conv-item.active { background: var(--rpp-green-light); border-left: 3px solid var(--rpp-green); }
.chat-conv-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.chat-conv-avatar-placeholder {
  background: var(--rpp-gold);
  color: #3a2d00;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
}
.chat-conv-info { flex-grow: 1; min-width: 0; }
.chat-conv-nom { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-preview { font-size: .78rem; color: #6b756f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-badge { flex-shrink: 0; }

.chat-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef1ef;
  flex-shrink: 0;
}
.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f7f9f7;
}
.chat-msg-systeme {
  text-align: center;
  font-size: .75rem;
  color: #8a8f8c;
  margin: 10px 0;
}
.chat-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 75%;
  margin: 4px 0;
}
.chat-msg-row-moi {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.chat-msg-avatar-placeholder {
  background: var(--rpp-gold);
  color: #3a2d00;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .7rem;
}
.chat-bulle {
  background: #fff;
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  font-size: .9rem;
}
.chat-bulle-moi {
  background: var(--rpp-green);
  color: #fff;
}
.chat-bulle-nom { font-size: .72rem; font-weight: 700; color: var(--rpp-green-dark); margin-bottom: 2px; }
.chat-bulle-img { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; object-fit: cover; }
.chat-bulle-legende { margin-top: 4px; }
.chat-bulle-fichier {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-size: .85rem;
}
.chat-bulle-fichier i { font-size: 1.4rem; }
.chat-bulle-fichier-nom { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-bulle-fichier-taille { opacity: .75; font-size: .75rem; }
.chat-bulle-heure { font-size: .65rem; opacity: .65; text-align: right; margin-top: 3px; }

.chat-attachment-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  background: #f4f6f4;
  border-top: 1px solid #eef1ef;
  font-size: .85rem;
}
.chat-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #eef1ef;
  flex-shrink: 0;
}
.chat-composer-btn {
  cursor: pointer;
  color: #6b756f;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
}
.chat-composer-btn:hover { color: var(--rpp-green); }

.chat-empty-state {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #8a8f8c;
  text-align: center;
  padding: 24px;
}
.chat-empty-state i { font-size: 3rem; margin-bottom: 10px; }

.chat-membre-checklist {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #eef1ef;
  border-radius: 8px;
}
.chat-membre-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #f4f6f4;
  cursor: pointer;
}
.chat-membre-checkbox-item:hover { background: var(--rpp-green-light); }

@media (max-width: 767.98px) {
  .chat-app { flex-direction: column; height: calc(100vh - 140px); }
  .chat-sidebar { width: 100%; max-height: 40%; border-right: none; border-bottom: 1px solid #eef1ef; }
}

/* ---- Presence (en ligne / vu il y a...) et avatars cliquables ---- */
.chat-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.chat-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2ecc71;
  border: 2px solid #fff;
}
[data-profile-user-id] {
  cursor: pointer;
}

/* ---- Modal profil (mini-fiche membre) ---- */
.chat-profile-header {
  background: linear-gradient(135deg, var(--rpp-green) 0%, var(--rpp-green-dark) 100%);
}
.chat-profile-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
}
.chat-profile-photo-placeholder {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--rpp-gold);
  color: #3a2d00;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.8rem;
}

/* =====================================================================
   Module AsmaIA (analyse et aide a la decision)
   ===================================================================== */
.asmaia-synthese {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(135deg, var(--rpp-green-light) 0%, #f3faf5 100%);
  border: 1px solid #cde5d6;
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  margin-bottom: .5rem;
}
.asmaia-synthese-titre {
  font-weight: 700;
  color: var(--rpp-green-dark);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .35rem;
}
.asmaia-synthese p { font-size: .92rem; line-height: 1.55; color: #24402f; }
.asmaia-avatar-lg {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--rpp-green) 0%, var(--rpp-green-dark) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

/* ---- Alertes ---- */
.asmaia-alerte {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  border: 1px solid #e6ece8;
  border-left: 4px solid #c9cdc6;
  border-radius: 11px;
  background: #fff;
  padding: .8rem 1rem;
  margin-bottom: .6rem;
  font-size: .9rem;
}
.asmaia-alerte > span { flex: 1 1 260px; }
.asmaia-alerte .bi { font-size: 1.1rem; flex: 0 0 auto; }
.asmaia-alerte-danger { border-left-color: var(--chart-critical); }
.asmaia-alerte-danger .bi { color: var(--chart-critical); }
.asmaia-alerte-warning { border-left-color: var(--chart-warning); }
.asmaia-alerte-warning .bi { color: #a97a06; }
.asmaia-alerte-success { border-left-color: var(--chart-good); }
.asmaia-alerte-success .bi { color: var(--chart-good); }
.asmaia-alerte-info { border-left-color: var(--chart-series-1); }
.asmaia-alerte-info .bi { color: var(--chart-series-1); }

/* ---- File d'actions recommandees ---- */
.asmaia-actions { list-style: none; counter-reset: act; padding: 0; margin: 0; }
.asmaia-action {
  display: flex;
  gap: 14px;
  background: #fff;
  border: 1px solid #e6ece8;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: .7rem;
  transition: box-shadow .15s;
}
.asmaia-action:hover { box-shadow: 0 6px 22px rgba(12, 48, 26, .09); }
/* Le rang n'est pas decoratif : il dit par quoi commencer. */
.asmaia-action-rang {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--rpp-green);
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.asmaia-action:first-child .asmaia-action-rang { background: var(--rpp-gold); color: #3a2d00; }
.asmaia-action-corps { min-width: 0; flex: 1 1 auto; }
.asmaia-action-titre { font-weight: 700; color: #15301f; margin-bottom: .25rem; }
.asmaia-action-pourquoi { font-size: .85rem; color: #5d6b62; margin: 0 0 .7rem; line-height: 1.5; }
.asmaia-action-pieds { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.asmaia-puce {
  font-size: .72rem;
  font-weight: 600;
  border-radius: 999px;
  padding: .2rem .6rem;
  border: 1px solid #e2eae5;
  color: #5d6b62;
  background: #f7faf8;
  text-transform: capitalize;
}
.asmaia-puce.is-fort { border-color: #f3c9c4; background: #fdf1ef; color: #a33a2c; }
.asmaia-puce.is-moyen { border-color: #f0e0b0; background: #fdf8ea; color: #7a5c05; }
.asmaia-puce.is-faible { border-color: #cde5d6; background: var(--rpp-green-light); color: var(--rpp-green-dark); }

/* ---- Encart d'explication de methode ---- */
.asmaia-note-intro {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #f7faf8;
  border: 1px dashed #cde5d6;
  border-radius: 12px;
  padding: .85rem 1rem;
  margin-bottom: 1rem;
  font-size: .85rem;
  color: #43564b;
  line-height: 1.5;
}
.asmaia-note-intro .bi { color: var(--rpp-green); font-size: 1.05rem; flex: 0 0 auto; }

/* ---- Simulateur ---- */
.asmaia-sim-range { display: flex; align-items: center; gap: 12px; }
.asmaia-sim-range .form-range { flex: 1 1 auto; }
.asmaia-sim-val {
  font-weight: 700;
  color: var(--rpp-green-dark);
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.asmaia-sim-table th { font-weight: 500; color: #5d6b62; font-size: .85rem; }
.asmaia-sim-table td { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.asmaia-sim-ecart th, .asmaia-sim-ecart td {
  color: var(--rpp-green-dark);
  border-top: 2px solid var(--rpp-green-light);
  font-size: 1.02rem;
}
.asmaia-sim-concl {
  background: var(--rpp-green-light);
  border-radius: 10px;
  padding: .7rem .9rem;
  font-size: .88rem;
  color: #1d4430;
}
.asmaia-sim-concl .bi { color: var(--rpp-green); }

/* ---- Poids des criteres ---- */
.asmaia-poids {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.4rem;
  background: #fff;
  border: 1px solid #e6ece8;
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.2rem;
}
.asmaia-poids .form-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 600;
  font-size: .85rem;
  color: #2a3b31;
  margin-bottom: .2rem;
}
.asmaia-poids-val {
  font-weight: 800;
  color: var(--rpp-green-dark);
  font-variant-numeric: tabular-nums;
}
.asmaia-poids .form-text { font-size: .74rem; }
.asmaia-poids-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #f0f4f1;
  padding-top: .8rem;
}

/* ---- Tableaux du module ---- */
.asmaia-table { font-size: .88rem; }
.asmaia-table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--rpp-green-dark);
  border-bottom: 2px solid var(--rpp-green-light);
  font-weight: 700;
}
.asmaia-table-sub { font-size: .75rem; color: #9aa69e; }
.asmaia-table-action { max-width: 330px; }
.asmaia-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-weight: 800;
  font-size: .95rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.asmaia-score-bon { background: var(--chart-good); }
.asmaia-score-moyen { background: var(--chart-warning); color: #3a2d00; }
.asmaia-score-faible { background: var(--chart-critical); }
/* Mini-barre : la note par critere se lit aussi par la longueur, pas
   seulement par le chiffre. */
.asmaia-minibar {
  height: 6px;
  border-radius: 999px;
  background: #eef2ef;
  overflow: hidden;
  margin-bottom: 3px;
}
.asmaia-minibar span { display: block; height: 100%; background: var(--rpp-green); border-radius: 999px; }
.asmaia-signaux { margin: 0; padding-left: 1.1rem; font-size: .82rem; color: #5d6b62; }
.asmaia-signaux li { margin-bottom: .15rem; }
.asmaia-contact { white-space: nowrap; }
.asmaia-contact .btn { margin-right: 4px; margin-bottom: 4px; }

.kpi-value-muet { font-size: 1.05rem; font-weight: 600; color: #9aa69e; }

.asmaia-pied {
  margin-top: 1.6rem;
  font-size: .8rem;
  color: #8c998f;
  line-height: 1.6;
  border-top: 1px solid #e6ece8;
  padding-top: .9rem;
}
.asmaia-pied .bi { color: var(--rpp-green); }
/* La colonne Note doit tenir sur une ligne : "A risque" coupe en deux se lit mal. */
.asmaia-table td:nth-child(3) .asmaia-table-sub { white-space: nowrap; }

/* =====================================================================
   Barre de navigation : actions de droite
   Le nom complet et le libelle de role ont quitte la barre pour le menu
   deroulant (ils occupaient la moitie de la largeur utile). Il ne reste
   que des cibles de taille egale, nettement separees.
   ===================================================================== */
.nav-actions { gap: 10px; }
.nav-icon {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  font-size: 1.1rem;
  padding: 0 !important;
}
.nav-icon .notif-badge {
  top: 3px;
  right: 3px;
  font-size: .58rem;
  min-width: 16px;
  padding: .15em .3em;
  line-height: 1.1;
  box-shadow: 0 0 0 2px #fff;
}
.nav-compte-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px !important;
  border-radius: 999px;
  border: 1px solid var(--platform-line, #e6ece8);
}
.nav-compte-toggle:hover, .nav-compte-toggle.show { background: var(--rpp-green-light); }
.nav-compte-caret { font-size: .7rem; opacity: .6; }

.nav-compte-menu { min-width: 250px; padding-top: 0; }
.nav-compte-entete {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .85rem 1rem .75rem;
  background: var(--rpp-green-light);
  border-radius: var(--bs-dropdown-border-radius, .5rem) var(--bs-dropdown-border-radius, .5rem) 0 0;
}
.nav-compte-ident { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nav-compte-ident strong {
  font-size: .88rem;
  color: #15301f;
  line-height: 1.2;
  word-break: break-word;
}
.nav-compte-ident .role-badge { align-self: flex-start; font-size: .68rem; }
.nav-compte-menu .dropdown-item { display: flex; align-items: center; gap: 9px; }
.nav-compte-menu form { margin: 0; }
.nav-compte-menu form .dropdown-item { width: 100%; text-align: left; border: 0; background: none; }

@media (max-width: 575.98px) {
  .nav-actions { gap: 4px; }
  .nav-icon { width: 36px; height: 36px; font-size: 1rem; }
}

/* Pastille de compteur dans la barre laterale */
.sidebar-pastille {
  display: inline-block;
  min-width: 18px;
  padding: .1em .4em;
  border-radius: 999px;
  background: var(--rpp-red, #c8102e);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
  margin-left: 4px;
}

/* =====================================================================
   Annonces du parti
   ===================================================================== */
.annonce-card {
  background: #fff;
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 16px;
  padding: 1.5rem;
}

/* ---- Choix de la portee (tout le parti / une annexe) ---- */
.annonce-cibles { display: grid; gap: 10px; }
.annonce-cible {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 12px;
  padding: .85rem 1rem;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.annonce-cible:hover { border-color: #cde5d6; background: #f7faf8; }
.annonce-cible.active { border-color: var(--rpp-green); background: var(--rpp-green-light); }
.annonce-cible input { margin-top: .2rem; flex: 0 0 auto; }
.annonce-cible-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff;
  color: var(--rpp-green);
  border: 1px solid var(--platform-line, #e6ece8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.annonce-cible-corps { display: flex; flex-direction: column; min-width: 0; }
.annonce-cible-corps strong { font-size: .9rem; color: #15301f; }
.annonce-cible-corps small { font-size: .76rem; color: #6c7a70; }

.annonce-note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: #f7faf8;
  border: 1px dashed #cde5d6;
  border-radius: 12px;
  padding: .85rem 1rem;
  font-size: .82rem;
  color: #43564b;
  line-height: 1.5;
}
.annonce-note .bi { color: var(--rpp-green); font-size: 1.05rem; flex: 0 0 auto; }

.annonce-image-actuelle {
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 12px;
  padding: .7rem;
  margin-bottom: .8rem;
}
.annonce-image-actuelle img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: .6rem;
}
.annonce-preview img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; }

/* ---- Fil de lecture ---- */
.annonce-fil { display: grid; gap: 1.1rem; }
.annonce-carte {
  display: flex;
  background: #fff;
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}
.annonce-carte:hover { box-shadow: 0 10px 30px rgba(12, 48, 26, .1); transform: translateY(-2px); }
/* Le filet vert signale une annonce non lue ; le mot "Nouveau" le dit aussi,
   la couleur n'est jamais le seul indice. */
.annonce-carte.is-non-lue { border-left: 4px solid var(--rpp-green); }
.annonce-carte-image {
  position: relative;
  flex: 0 0 240px;
  display: block;
  background: #eef2ef;
}
.annonce-carte-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.annonce-epingle {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(21, 48, 31, .85);
  color: #ffd87a;
  border-radius: 999px;
  padding: .2rem .6rem;
  font-size: .7rem;
  font-weight: 600;
}
.annonce-carte-corps { padding: 1.2rem 1.3rem; min-width: 0; flex: 1 1 auto; }
.annonce-carte-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: .55rem;
}
.annonce-carte-date { font-size: .76rem; color: #9aa69e; margin-left: auto; }
.annonce-carte-titre { font-size: 1.1rem; font-weight: 700; margin: 0 0 .4rem; line-height: 1.3; }
.annonce-carte-titre a { color: #15301f; text-decoration: none; }
.annonce-carte-titre a:hover { color: var(--rpp-green); }
.annonce-carte-extrait { font-size: .88rem; color: #5d6b62; margin: 0 0 .9rem; line-height: 1.55; }
.annonce-carte-pied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .8rem;
}
.annonce-carte-auteur { color: #9aa69e; }
.annonce-carte-lire { font-weight: 600; color: var(--rpp-green-dark); text-decoration: none; }
.annonce-carte-lire:hover { text-decoration: underline; }

@media (max-width: 767.98px) {
  .annonce-carte { flex-direction: column; }
  .annonce-carte-image { flex-basis: auto; height: 180px; }
  .annonce-carte-date { margin-left: 0; }
}

/* ---- Etiquettes ---- */
.annonce-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .71rem;
  font-weight: 600;
  border-radius: 999px;
  padding: .2rem .62rem;
  border: 1px solid transparent;
}
.annonce-tag-vert { background: var(--rpp-green-light); color: var(--rpp-green-dark); border-color: #cde5d6; }
.annonce-tag-bleu { background: #eaf2fc; color: #1c54a0; border-color: #cddff5; }
.annonce-tag-or { background: #fdf6e3; color: #7a5c05; border-color: #f0e0b0; }
.annonce-tag-gris { background: #f1f3f2; color: #5d6b62; border-color: #e2e7e4; }
.annonce-tag-neuf { background: var(--rpp-green); color: #fff; }

/* ---- Lecture d'une annonce ---- */
.annonce-lecture-page { max-width: 860px; margin: 0 auto; }
.annonce-retour {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--rpp-green-dark);
  text-decoration: none;
  margin-bottom: 1rem;
}
.annonce-retour:hover { text-decoration: underline; }
.annonce-article {
  background: #fff;
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 18px;
  overflow: hidden;
}
.annonce-article-image { margin: 0; background: #eef2ef; }
.annonce-article-image img { width: 100%; max-height: 420px; object-fit: cover; display: block; }
.annonce-article-corps { padding: 1.8rem; }
.annonce-article-titre { font-size: 1.7rem; font-weight: 800; color: #15301f; margin: .6rem 0 .5rem; line-height: 1.25; }
.annonce-article-signature {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: .82rem;
  color: #9aa69e;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid #f0f4f1;
  margin-bottom: 1.2rem;
}
/* Mesure de ligne limitee : au-dela de 75 caracteres environ, le lecteur
   perd la ligne suivante en revenant a la marge. */
.annonce-article-texte {
  font-size: 1rem;
  line-height: 1.75;
  color: #2a3b31;
  max-width: 68ch;
  word-break: break-word;
}
@media (max-width: 575.98px) {
  .annonce-article-corps { padding: 1.2rem; }
  .annonce-article-titre { font-size: 1.3rem; }
}

.annonce-voisines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 1.2rem;
}
.annonce-voisine {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 12px;
  padding: .85rem 1rem;
  text-decoration: none;
  transition: border-color .15s;
}
.annonce-voisine:hover { border-color: var(--rpp-green); }
.annonce-voisine span { font-size: .74rem; color: #9aa69e; font-weight: 600; }
.annonce-voisine strong { font-size: .86rem; color: #15301f; line-height: 1.35; }
.annonce-voisine-fin { text-align: right; }
@media (max-width: 575.98px) {
  .annonce-voisines { grid-template-columns: 1fr; }
  .annonce-voisine-fin { text-align: left; }
}

.annonce-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 1.4rem;
}

/* ---- Historique cote administration ---- */
.annonce-admin-liste { display: grid; gap: .9rem; }
.annonce-admin {
  display: flex;
  gap: 1rem;
  background: #fff;
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 14px;
  padding: 1rem;
  align-items: flex-start;
}
.annonce-admin.is-brouillon { background: #fcfcfb; border-style: dashed; }
.annonce-admin-vignette {
  flex: 0 0 110px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2ef;
}
.annonce-admin-vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.annonce-admin-vignette-vide {
  display: grid;
  place-items: center;
  color: #b3bdb6;
  font-size: 1.6rem;
  background: var(--rpp-green-light);
}
.annonce-admin-corps { flex: 1 1 auto; min-width: 0; }
.annonce-admin-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: .4rem; }
.annonce-admin-date { font-size: .75rem; color: #9aa69e; }
.annonce-admin-titre { font-size: 1rem; font-weight: 700; margin: 0 0 .25rem; }
.annonce-admin-titre a { color: #15301f; text-decoration: none; }
.annonce-admin-titre a:hover { color: var(--rpp-green); }
.annonce-admin-extrait { font-size: .83rem; color: #6c7a70; margin: 0 0 .6rem; }
.annonce-admin-actions { display: flex; flex-wrap: wrap; gap: 5px; flex: 0 0 auto; }
.annonce-admin-actions form { margin: 0; }
@media (max-width: 767.98px) {
  .annonce-admin { flex-wrap: wrap; }
  .annonce-admin-vignette { flex-basis: 100%; height: 140px; }
  .annonce-admin-actions { width: 100%; }
}

/* Taux de lecture : la barre donne l'ordre de grandeur, le texte le chiffre. */
.annonce-lecture { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.annonce-lecture-barre {
  flex: 1 1 140px;
  max-width: 220px;
  height: 6px;
  border-radius: 999px;
  background: #eef2ef;
  overflow: hidden;
}
.annonce-lecture-barre span { display: block; height: 100%; background: var(--rpp-green); border-radius: 999px; }
.annonce-lecture-txt { font-size: .76rem; color: #6c7a70; }

/* ---- Etat vide ---- */
.annonce-vide {
  text-align: center;
  background: #fff;
  border: 1px dashed var(--platform-line, #e6ece8);
  border-radius: 16px;
  padding: 3rem 1.5rem;
}
.annonce-vide .bi { font-size: 2.6rem; color: #cfd8d2; }
.annonce-vide h2 { font-size: 1.1rem; font-weight: 700; color: #15301f; margin: .8rem 0 .4rem; }
.annonce-vide p { font-size: .88rem; color: #8c998f; max-width: 52ch; margin: 0 auto 1.2rem; }

/* Recherche de l'historique des annonces : champ et bouton sur la meme
   ligne. Sans largeur bornee, le champ prend toute la place et pousse le
   bouton a la ligne suivante. */
.stats-range input[type="text"] { width: auto; min-width: 210px; flex: 0 1 260px; }

/* =====================================================================
   Modale "Mon compte"
   Remplace le menu deroulant de la barre : ancre dans la navbar, il etait
   contraint par elle (debordement, rognage) et s'ouvrait dans un coin
   minuscule sur mobile. Une modale se centre et respire.
   ===================================================================== */
.nav-compte-toggle {
  background: none;
  border: 1px solid var(--platform-line, #e6ece8);
  cursor: pointer;
}

.compte-modal .modal-content {
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(12, 48, 26, .28);
}
.compte-modal-entete {
  position: relative;
  text-align: center;
  padding: 1.8rem 1.5rem 1.4rem;
  background: linear-gradient(135deg, var(--rpp-green-dark) 0%, var(--rpp-green) 70%, #0d8a3e 100%);
  color: #fff;
}
.compte-modal-fermer {
  position: absolute;
  top: 14px;
  right: 14px;
  opacity: .85;
}
.compte-modal-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  border: 2px solid rgba(255, 255, 255, .4);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: .7rem;
}
.compte-modal-nom { font-size: 1.12rem; font-weight: 700; margin: 0 0 .5rem; word-break: break-word; }
.compte-modal-entete .role-badge { font-size: .72rem; }
.compte-modal-email { font-size: .8rem; opacity: .85; margin: .6rem 0 0; word-break: break-all; }

.compte-modal-corps { padding: 1.2rem; }
.compte-modal-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--rpp-green-light);
  border-radius: 11px;
  padding: .65rem .9rem;
  margin-bottom: 1rem;
  font-size: .84rem;
}
.compte-modal-info span { color: #4a5750; }
.compte-modal-info strong { color: var(--rpp-green-dark); font-family: Consolas, ui-monospace, monospace; }

.compte-modal-liens { display: grid; gap: 6px; }
.compte-modal-liens a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: .8rem .9rem;
  border-radius: 12px;
  border: 1px solid var(--platform-line, #e6ece8);
  text-decoration: none;
  color: #15301f;
  transition: border-color .15s, background-color .15s;
}
.compte-modal-liens a:hover { border-color: var(--rpp-green); background: #f7faf8; }
.compte-modal-liens a > .bi:first-child {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--rpp-green-light);
  color: var(--rpp-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.compte-modal-liens a > span { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.compte-modal-liens a strong { font-size: .88rem; font-weight: 600; }
.compte-modal-liens a small { font-size: .74rem; color: #8c998f; }
.compte-modal-chevron { color: #c3ccc6; font-size: .8rem; }
.compte-modal-sortie { margin: 1.1rem 0 0; }


/* Le theme applique une couleur verte a tous les titres (h1..h6) ; sur le
   bandeau vert de la modale, le nom devenait illisible. */
.compte-modal-nom { color: #fff !important; }
.compte-modal .modal-content { border-radius: 20px; }

/* Sur petit ecran, 4 px laissaient les pastilles mordre sur l'icone voisine.
   7 px suffisent : les quatre cibles tiennent encore a 360 px de large. */
@media (max-width: 575.98px) {
  .nav-actions { gap: 7px; }
}

/* =====================================================================
   Asma IA : panneau compact, ancre en bas a droite
   Une conversation d'assistance accompagne la page, elle ne la remplace
   pas : on doit pouvoir lire la reponse et l'ecran derriere en meme
   temps. Le panneau reste donc une vignette posee dans l'angle, sur
   mobile comme sur grand ecran. Le bouton "Agrandir" reste disponible
   pour qui veut ponctuellement plus de place.
   ===================================================================== */
.asmaia-panel {
  width: 340px !important;
  height: 470px !important;
  max-height: calc(100dvh - 130px) !important;
  bottom: 68px;
  right: 0;
  left: auto;
  border-radius: 18px !important;
}

/* Seule la conversation defile : l'en-tete et la zone de saisie restent
   en place, sinon la saisie sort du cadre des que l'echange s'allonge. */
.asmaia-panel .asmaia-header { flex: 0 0 auto; }
.asmaia-panel .asmaia-messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.asmaia-panel .asmaia-form { flex: 0 0 auto; }

/* Densite reduite : a cette taille, les marges du theme mangeaient la
   moitie de la surface utile. */
.asmaia-panel .asmaia-header { padding: 14px 16px; }
.asmaia-panel .asmaia-messages { padding: 14px; gap: 10px; }
.asmaia-panel .asmaia-msg { padding: 10px 12px; line-height: 1.6; }
.asmaia-panel .asmaia-suggestion-btn { padding: 7px 10px; }
.asmaia-panel .asmaia-form { padding: 11px; }
.asmaia-panel .asmaia-form textarea { min-height: 44px; }
.asmaia-panel .asmaia-form > .btn { height: 38px; }
.asmaia-panel .asmaia-avatar { width: 34px; height: 34px; }

@media (max-width: 575.98px) {
  /* Toujours dans l'angle, simplement borne a la largeur disponible.
     Le panneau laisse voir la page derriere : c'est volontaire. */
  .asmaia-panel {
    width: calc(100vw - 24px) !important;
    max-width: 340px !important;
    height: 60dvh !important;
    max-height: calc(100dvh - 110px) !important;
    bottom: 62px;
  }
}

/* Le !important ci-dessus l'emportait aussi sur l'etat "agrandi", qui ne
   faisait donc plus rien. L'etat agrandi doit reprendre la main : meme
   poids, mais selecteur plus specifique. */
.asmaia-panel.asmaia-expanded {
  width: min(780px, calc(100vw - 40px)) !important;
  height: calc(100dvh - 140px) !important;
  max-height: 800px !important;
}
@media (max-width: 575.98px) {
  .asmaia-panel.asmaia-expanded {
    width: calc(100vw - 24px) !important;
    max-width: none !important;
    height: calc(100dvh - 110px) !important;
    max-height: none !important;
  }
}

/* =====================================================================
   Evenements et invitations
   ===================================================================== */

/* ---- Bloc date reutilise dans les listes ---- */
.evenement-date,
.invitation-ligne-date {
  flex: 0 0 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: .55rem .3rem;
  background: var(--rpp-green-light);
  color: var(--rpp-green-dark);
  line-height: 1.1;
}
.evenement-jour { font-size: 1.6rem; font-weight: 800; }
.evenement-mois { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.evenement-annee { font-size: .66rem; opacity: .7; }

/* ---- Ligne d'evenement (administration) ---- */
.evenement-ligne {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 14px;
  padding: 1rem;
}
.evenement-ligne.is-annule { opacity: .72; border-style: dashed; }
.evenement-ligne.is-annule .evenement-date { background: #f1f3f2; color: #8c998f; }
.evenement-chiffres {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: .8rem;
  color: #6c7a70;
}
.evenement-chiffres strong { color: #15301f; }
@media (max-width: 767.98px) {
  .evenement-ligne { flex-wrap: wrap; }
  .evenement-ligne .annonce-admin-actions { width: 100%; }
}

/* ---- Ligne d'invitation (espace membre) ---- */
.invitation-liste { display: grid; gap: .9rem; margin-bottom: 1.5rem; }
.invitation-ligne {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--platform-line, #e6ece8);
  border-left: 4px solid var(--inv-de, var(--rpp-green));
  border-radius: 14px;
  padding: 1rem;
  transition: box-shadow .15s;
}
.invitation-ligne:hover { box-shadow: 0 8px 26px rgba(12, 48, 26, .09); }
.invitation-ligne.is-passee { opacity: .74; }
.invitation-ligne.is-annule { border-left-color: var(--chart-critical); }
.invitation-ligne-corps { flex: 1 1 auto; min-width: 0; }
.invitation-ligne-titre { font-size: 1.02rem; font-weight: 700; margin: .25rem 0; }
.invitation-ligne-titre a { color: #15301f; text-decoration: none; }
.invitation-ligne-titre a:hover { color: var(--rpp-green); }
.invitation-ligne-infos {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: .78rem;
  color: #8c998f;
}
.invitation-ligne-actions { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; }
@media (max-width: 767.98px) {
  .invitation-ligne { flex-wrap: wrap; align-items: flex-start; }
  .invitation-ligne-actions { width: 100%; }
}

/* ---- Page d'un evenement ---- */
.evenement-banniere {
  height: 150px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .55);
  font-size: 3rem;
}
.evenement-reperes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 1.4rem;
}
.evenement-repere {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #f7faf8;
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 12px;
  padding: .75rem .9rem;
}
.evenement-repere > .bi { color: var(--rpp-green); font-size: 1.15rem; }
.evenement-repere span { display: flex; flex-direction: column; min-width: 0; }
.evenement-repere strong { font-size: .9rem; color: #15301f; }
.evenement-repere small { font-size: .72rem; color: #8c998f; }

.evenement-reponse {
  margin-top: 1.6rem;
  padding-top: 1.3rem;
  border-top: 1px solid #f0f4f1;
}
.evenement-reponse-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.evenement-reponse-actions .btn { flex: 1 1 160px; }

.evenement-mail-etat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
}
.evenement-mail-etat > div {
  background: #f7faf8;
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 11px;
  padding: .7rem .4rem;
}
.evenement-mail-etat strong { display: block; font-size: 1.3rem; color: #15301f; }
.evenement-mail-etat span { font-size: .72rem; color: #8c998f; }

/* ---- Choix du theme d'invitation ---- */
.theme-choix { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-option {
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 12px;
  padding: .6rem;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s;
}
.theme-option.active { border-color: var(--rpp-green); background: var(--rpp-green-light); }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-apercu {
  display: block;
  height: 46px;
  border-radius: 8px;
  margin-bottom: .45rem;
  position: relative;
  overflow: hidden;
}
.theme-accent { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; display: block; }
.theme-nom { font-size: .74rem; color: #4a5750; font-weight: 600; }

/* =====================================================================
   La carte d'invitation
   Format fixe : elle est exportee en PNG par html2canvas, donc elle ne
   doit PAS dependre de la largeur de la fenetre, sinon l'image produite
   differe d'un appareil a l'autre.
   ===================================================================== */
.invitation-wrap { display: inline-block; max-width: 100%; }
.invitation {
  width: 420px;
  max-width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 38px rgba(12, 48, 26, .16);
  color: #15301f;
  font-family: var(--inv-police, 'Segoe UI', Roboto, Arial, sans-serif);
}
.invitation-haut {
  background: linear-gradient(135deg, var(--inv-de) 0%, var(--inv-vers) 100%);
  color: #fff;
  padding: 1.3rem 1.4rem 1.5rem;
  position: relative;
  overflow: hidden;
}
/* Pastille decorative : elle donne du relief sans masquer de texte. */
.invitation-haut::after {
  content: "";
  position: absolute;
  right: -55px;
  top: -70px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .09);
}
.invitation-marque { display: flex; align-items: center; gap: 9px; margin-bottom: 1rem; position: relative; z-index: 1; }
.invitation-sigle {
  background: rgba(255, 255, 255, .95);
  color: var(--inv-de);
  font-weight: 800;
  font-size: .74rem;
  letter-spacing: .5px;
  border-radius: 7px;
  padding: 4px 8px;
}
.invitation-parti { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; opacity: .9; }
.invitation-mention {
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--inv-accent);
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.invitation-titre {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
  margin: .3rem 0 0;
  color: #fff;
  position: relative;
  z-index: 1;
}
.invitation-portee { font-size: .72rem; opacity: .85; margin-top: .4rem; position: relative; z-index: 1; }

.invitation-corps { display: flex; gap: 1rem; padding: 1.2rem 1.4rem; align-items: flex-start; }
.invitation-date {
  flex: 0 0 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 12px;
  padding: .6rem .3rem;
  background: var(--inv-de);
  color: #fff;
  line-height: 1.1;
}
.invitation-jour { font-size: 1.7rem; font-weight: 800; }
.invitation-mois { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--inv-accent); }
.invitation-annee { font-size: .66rem; opacity: .8; }

.invitation-infos { flex: 1 1 auto; min-width: 0; }
.invitation-champ {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: .32rem 0;
  border: 0;
  border-bottom: 1px solid #f0f4f1;
  background: none;
  border-radius: 0;
  align-items: baseline;
}
.invitation-champ:last-child { border-bottom: 0; }
.invitation-cle { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: #9aa69e; }
.invitation-val { font-size: .85rem; font-weight: 600; text-align: right; word-break: break-word; }
.invitation-mono { font-family: Consolas, 'SFMono-Regular', ui-monospace, monospace; letter-spacing: .5px; }

.invitation-bas {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem 1.3rem;
  border-top: 1px dashed #d7e0da;
  background: #fbfdfc;
}
.invitation-code { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.invitation-code strong { font-size: .98rem; color: var(--inv-de); word-break: break-all; }
.invitation-note { font-size: .64rem; color: #9aa69e; line-height: 1.4; }
.invitation-qr { flex: 0 0 auto; }
/* Taille fixe en CSS : le canvas est dessine en 260 px pour rester net a
   l'export en 3x, mais affiche plus petit. */
.invitation-qr canvas { width: 96px; height: 96px; display: block; border-radius: 6px; }

.invitation-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem; }

/* ---- Planche d'invitations (page autonome) ---- */
.invitations-planche { background: #f1f5f2; padding: 1.2rem; }
.planche-barre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e6ece8;
  border-radius: 12px;
  padding: .7rem .9rem;
  margin-bottom: 1rem;
}
.planche-titre { font-weight: 700; color: #15301f; }
.planche-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 1rem; }
.planche-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1.4rem;
  justify-items: center;
}
@media (max-width: 500px) {
  .planche-grille { grid-template-columns: 1fr; }
}
@media print {
  .invitations-planche { background: #fff; padding: 0; }
  .no-print { display: none !important; }
  .planche-grille { gap: 1rem; }
  .invitation { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}

/* Etiquette rouge manquante dans la palette d'etiquettes des annonces. */
.annonce-tag-rouge { background: #fdf1ef; color: #a33a2c; border-color: #f3c9c4; }

/* .invitation-wrap etait en inline-block : le lien "Retour" qui la precede
   est lui aussi de niveau ligne, les deux se retrouvaient donc cote a cote,
   le lien colle en bas de la carte. Un bloc centre regle les deux. */
.invitation-wrap { display: block; width: fit-content; max-width: 100%; margin-inline: auto; }
.planche-grille .invitation-wrap { margin-inline: 0; }

/* ---- Personnalisation des couleurs ---- */
.couleur-grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.couleur-champ {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 11px;
  padding: .6rem .4rem;
  cursor: pointer;
}
.couleur-champ:hover { border-color: var(--rpp-green); }
.couleur-champ > span { font-size: .72rem; color: #6c7a70; font-weight: 600; text-align: center; }
.couleur-champ input[type="color"] {
  width: 100%;
  height: 34px;
  border: 1px solid #e2eae5;
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}
.couleur-champ code { font-size: .66rem; color: #9aa69e; }

.theme-option-perso .theme-apercu-perso { position: relative; }
.theme-option-perso .theme-apercu-perso::before {
  content: "\F4D1";            /* icone palette de Bootstrap Icons */
  font-family: 'bootstrap-icons';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .85);
  font-size: 1.1rem;
}

/* ---- Apercu en direct du billet ---- */
.apercu-bloc {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px dashed #d7e0da;
}
.apercu-entete {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: .8rem;
}
.apercu-entete > span {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--rpp-green-dark);
}
.apercu-entete small { font-size: .72rem; color: #9aa69e; }
/* Le billet garde sa largeur de reference (420 px) et se contente de
   retrecir si la colonne est plus etroite : l'apercu montre ainsi la vraie
   mise en page du document final. */
.apercu-bloc .invitation { box-shadow: 0 8px 26px rgba(12, 48, 26, .14); }
.apercu-qr {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 1px dashed #c9d4cd;
  border-radius: 8px;
  color: #c0cac3;
  font-size: 2.2rem;
  background: #fff;
}

/* La carte d'apercu suit le defilement : on remplit le titre et les dates
   dans la colonne de gauche tout en voyant le billet se construire.
   Desactivee sous 992 px : en une seule colonne, un bloc collant mangerait
   la moitie de l'ecran a chaque champ saisi. */
@media (min-width: 992px) {
  .apercu-carte { position: sticky; top: 86px; z-index: 2; }
}
.apercu-carte .apercu-bloc { margin-top: 0; padding-top: 0; border-top: 0; }

/* =====================================================================
   En-tete de section numerotee, pour les formulaires d'administration
   (annonces, evenements).
   Ces formulaires utilisaient les classes .pub-section de public.css, qui
   n'est chargee que sur les pages publiques : le numero restait un simple
   texte en ligne et le titre retombait sur le h2 du theme, soit 32 px dans
   une carte. Ces regles-ci vivent dans style.css, chargee partout.
   ===================================================================== */
.form-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 1.1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid #eef2ef;
}
.form-section-num {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--rpp-green-light);
  color: var(--rpp-green-dark);
  font-weight: 800;
  font-size: .88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.form-section-num .bi { font-size: .85rem; }
.form-section-titre {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #15301f;
  letter-spacing: 0;
}
.form-section-sous { font-size: .78rem; color: #8c998f; margin: 0; }
.form-section > div { min-width: 0; }

/* Utilitaires partages entre pages publiques et pages d'administration.
   Ils vivaient dans public.css, qui n'est chargee que par le site public :
   sur les formulaires d'administration qui les utilisent (annonces,
   evenements), l'asterisque, le bouton d'envoi et la puce de code
   n'avaient donc aucun effet. Les pages publiques chargent style.css en
   plus de public.css, elles les recuperent ici. */
.pub-required { color: var(--rpp-red); }
.pub-submit {
  padding: .75rem 1rem;
  font-weight: 600;
  border-radius: 10px;
  font-size: 1.02rem;
}
.pub-code {
  display: inline-block;
  font-family: Consolas, 'SFMono-Regular', ui-monospace, monospace;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: #15301f;
  color: #fff;
  border-radius: 10px;
  padding: .6rem 1.1rem;
  word-break: break-all;
}
.pub-code-sm {
  font-size: .92rem;
  padding: .25rem .55rem;
  letter-spacing: 1px;
  background: var(--rpp-green-light);
  color: var(--rpp-green-dark);
}

/* La bulle Asma IA est fixee en bas a droite : sans cette reserve, elle
   recouvre le dernier bouton ou la derniere ligne de tableau d'une page. */
.app-content > .container-fluid { padding-bottom: 96px; }

/* ---- Sommaire d'un formulaire long ----
   Sous 992 px les deux colonnes s'empilent et la derniere section se
   retrouve a plus de 2500 px du haut : ces raccourcis evitent de la
   chercher. `scroll-margin-top` compense la barre de navigation collante,
   sinon la section visee se cale sous elle. */
.form-sommaire {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--platform-line, #e6ece8);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 1rem;
}
.form-sommaire a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: .45rem .8rem;
  border-radius: 9px;
  font-size: .84rem;
  font-weight: 600;
  color: #5d6b62;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.form-sommaire a:hover { background: var(--rpp-green-light); color: var(--rpp-green-dark); }
.form-sommaire a span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eef2ef;
  color: #6c7a70;
  font-size: .74rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.form-sommaire a:hover span { background: #fff; color: var(--rpp-green-dark); }
/* L'apparence du billet est la section qu'on vient chercher expressement :
   elle est mise en avant plutot que noyee dans la liste. */
.form-sommaire-accent { color: var(--rpp-green-dark); }
.form-sommaire-accent span { background: var(--rpp-green); color: #fff; }

#sec-evenement, #sec-visuel, #sec-invites, #sec-apparence { scroll-margin-top: 90px; }

@media (max-width: 575.98px) {
  .form-sommaire { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .form-sommaire a { flex: 0 0 auto; }
}

/* ---- Fonction au sein du parti ---- */
/* Ruban sur la fiche membre : le titre doit se voir avant les autres
   mentions, c'est lui qui fait autorite quand on presente sa carte. */
.fonction-ruban {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--rpp-green) 0%, var(--rpp-green-dark) 100%);
  color: #fff;
  border-radius: 999px;
  padding: .25rem .8rem;
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: .5rem;
}
.fonction-ruban .bi { color: var(--rpp-gold); }

/* Sur la carte de membre, la fonction s'intercale sous le nom, en or :
   lisible sans voler la vedette au nom. */
.carte-membre-fonction {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--rpp-gold);
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* Onglets des listes de reference : Bootstrap colore la pastille active en
   bleu, ce qui jure avec le vert de la plateforme. */
.nav-pills .nav-link { color: #5d6b62; border-radius: 9px; font-weight: 600; font-size: .88rem; }
.nav-pills .nav-link:hover { background: var(--rpp-green-light); color: var(--rpp-green-dark); }
.nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--rpp-green) 0%, var(--rpp-green-dark) 100%);
  color: #fff;
}

/* ============================================================
   Parametres de la plateforme (admin/parametres/index.php)
   ============================================================ */
.plat-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;
  background:linear-gradient(135deg,var(--rpp-green,#173f2d),var(--rpp-green-dark,#0f2a1e));
  color:#fff;border-radius:var(--platform-radius,20px);padding:28px 32px;margin-bottom:24px}
.plat-hero h1{font-size:1.75rem;font-weight:700;margin:6px 0 8px}
.plat-hero p{margin:0;max-width:62ch;opacity:.88;font-size:.95rem}
.plat-eyebrow{font-size:.7rem;letter-spacing:.14em;font-weight:600;opacity:.75}
.plat-orb{flex:0 0 auto;width:72px;height:72px;border-radius:50%;display:grid;place-items:center;
  background:rgba(255,255,255,.14);font-size:1.9rem;color:#fff}
@media (max-width:575.98px){.plat-hero{padding:22px;flex-direction:column;align-items:flex-start}
  .plat-orb{width:56px;height:56px;font-size:1.5rem}.plat-hero h1{font-size:1.4rem}}

.plat-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px}
.plat-metrics>div{background:#fff;border:1px solid rgba(23,63,45,.1);border-radius:16px;padding:16px 18px}
.plat-metrics span{display:block;font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;color:#6b7b70;font-weight:600}
.plat-metrics strong{display:block;margin-top:6px;font-size:1.05rem;color:var(--platform-ink,#213a2b);word-break:break-all}

.plat-tabs{gap:8px;flex-wrap:wrap}
.plat-tabs .nav-link{border-radius:999px;padding:8px 16px;font-size:.9rem;font-weight:500;
  color:var(--platform-ink,#213a2b);background:#fff;border:1px solid rgba(23,63,45,.12)}
.plat-tabs .nav-link:hover{background:var(--rpp-green-light,#eaf0e2)}
.plat-tabs .nav-link.active{background:var(--rpp-green,#173f2d);border-color:var(--rpp-green,#173f2d);color:#fff}

.plat-dl{display:grid;grid-template-columns:minmax(120px,38%) 1fr;gap:8px 14px;margin:0;font-size:.9rem}
.plat-dl dt{color:#6b7b70;font-weight:500}
.plat-dl dd{margin:0;font-weight:600;color:var(--platform-ink,#213a2b)}

.plat-suggestions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:14px}

.plat-choix{display:grid;gap:12px}
.plat-radio{display:flex;gap:12px;align-items:flex-start;border:1px solid rgba(23,63,45,.14);
  border-radius:14px;padding:14px 16px;cursor:pointer;transition:border-color .15s,background .15s}
.plat-radio:hover{border-color:var(--rpp-green,#173f2d);background:#fbfdf9}
.plat-radio input{margin-top:3px;flex:0 0 auto}
.plat-radio span{display:block}
.plat-radio strong{display:block;font-size:.95rem}
.plat-radio small{display:block;color:#6b7b70;margin-top:2px}

.plat-danger{border:1px solid rgba(176,42,42,.25)}
.plat-danger .form-section-titre{color:#9d2c2c}

.plat-table th{font-size:.75rem;letter-spacing:.06em;text-transform:uppercase;color:#6b7b70;font-weight:600}
.plat-table td{font-size:.88rem}

.plat-vide{text-align:center;padding:36px 12px;color:#8a9790}
.plat-vide i{font-size:2rem;display:block;margin-bottom:8px;opacity:.6}
.plat-vide p{margin:0;font-size:.9rem}

.plat-liste{list-style:none;margin:0;padding:0;font-size:.9rem}
.plat-liste li{display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:9px 0;border-bottom:1px solid rgba(23,63,45,.08)}
.plat-liste li:last-child{border-bottom:0}

.plat-reglage{display:flex;align-items:center;gap:14px;height:100%;padding:18px;background:#fff;
  border:1px solid rgba(23,63,45,.12);border-radius:16px;text-decoration:none;
  color:var(--platform-ink,#213a2b);transition:transform .15s,box-shadow .15s,border-color .15s}
.plat-reglage:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(23,63,45,.1);
  border-color:var(--rpp-green,#173f2d);color:var(--platform-ink,#213a2b)}
.plat-reglage-icone{flex:0 0 auto;width:44px;height:44px;border-radius:12px;display:grid;place-items:center;
  background:var(--rpp-green-light,#eaf0e2);color:var(--rpp-green,#173f2d);font-size:1.25rem}
.plat-reglage strong{display:block;font-size:.95rem;line-height:1.25}
.plat-reglage small{display:block;color:#6b7b70;margin-top:3px;font-size:.8rem;line-height:1.35}
.plat-reglage-fleche{margin-left:auto;color:#b4c0b8;flex:0 0 auto}
.plat-hero h1, .plat-hero p, .plat-hero .plat-eyebrow { color: #fff; }
.plat-restaurer-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
.plat-table td:first-child { min-width: 200px; }
.app-version { opacity: .6; font-variant-numeric: tabular-nums; margin-left: 4px; }
.plat-version { display: flex; align-items: center; gap: 10px; }
.plat-version-num { font-size: 1.9rem; font-weight: 700; color: var(--rpp-green, #173f2d); line-height: 1; }
.plat-analyse { border: 1px solid rgba(23, 63, 45, .25); }
.plat-analyse-compte { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 14px; }
.plat-analyse-compte > div { background: var(--rpp-green-light, #eaf0e2); border-radius: 12px; padding: 12px 14px; }
.plat-analyse-compte strong { display: block; font-size: 1.3rem; color: var(--rpp-green, #173f2d); }
.plat-analyse-compte span { font-size: .78rem; color: #52645a; }
.plat-table-note td { border-top: 0; padding-top: 0; }

/* ---- AsmaIA : etat du modele local -------------------------------------- */
.asmaia-etat { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
  font-size: .9rem; background: var(--rpp-green-light, #eaf0e2); color: #1d3528; }
.asmaia-etat i { font-size: 1.15rem; flex: 0 0 auto; line-height: 1.3; }
.asmaia-etat-pret { background: #e4f3e8; color: #16552c; }
.asmaia-etat-injoignable, .asmaia-etat-refuse { background: #fbeaea; color: #8d2020; }
.asmaia-etat-modele_absent { background: #fdf3e2; color: #85570d; }
.asmaia-etat-desactive { background: #eef1ee; color: #52645a; }
.asmaia-essai blockquote { margin: 0 0 10px; padding: 12px 14px; border-left: 3px solid var(--rpp-green, #173f2d);
  background: #fbfdf9; border-radius: 0 10px 10px 0; font-size: .92rem; }

/* ---- AsmaIA : recherche transversale ------------------------------------ */
.asmaia-search-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.asmaia-search-form .asmaia-search-main { grid-column: 1 / -1; }
.asmaia-search-form label { display: grid; gap: 4px; font-size: .78rem; font-weight: 600; color: #52645a; }
.asmaia-search-astuce { margin: 14px 0 20px; font-size: .85rem; color: #52645a; }
.asmaia-search-astuce summary { cursor: pointer; font-weight: 600; color: var(--rpp-green, #173f2d); }
.asmaia-search-astuce ul { margin: 10px 0 6px; padding-left: 20px; }
.asmaia-search-astuce li { margin-bottom: 3px; }
.asmaia-search-astuce p { margin: 0; font-style: italic; }
.asmaia-facettes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.asmaia-facette { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: #fff; border: 1px solid rgba(23, 63, 45, .14); font-size: .83rem; text-decoration: none;
  color: var(--platform-ink, #213a2b); }
.asmaia-facette:hover { background: var(--rpp-green-light, #eaf0e2); color: var(--platform-ink, #213a2b); }
.asmaia-facette.is-active { background: var(--rpp-green, #173f2d); border-color: var(--rpp-green, #173f2d); color: #fff; }
.asmaia-facette span { font-weight: 700; font-variant-numeric: tabular-nums; }
.asmaia-facette.is-active span { color: #fff; }
