:root {
  --font-titre: "League Spartan", sans-serif;
  --font-texte: "Arimo", sans-serif;
  --background: #f7f8fc;
  --surface: #ffffff;
  --foreground: #1c2340;
  --muted: #6b7280;

  --jaune: #fab428;
  --jaune-soft: #fff2d9;
  --bleu-fonce: #21327b;
  --bleu-fonce-soft: #e7e9f5;
  --bleu-clair: #43b4e9;
  --bleu-clair-soft: #e4f4fc;
  --vert: #1f8a3b;
  --vert-soft: #e8f7ec;
  --rouge: #d64545;
  --rouge-soft: rgba(214, 69, 69, 0.1);
  --violet: #7b61c9;
  --violet-soft: #f0ecfb;
  --radius: 1.1rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-texte);
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .titre { font-family: var(--font-titre); font-weight: 700; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 0.9rem; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bleu-clair); border-radius: 999px; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid rgba(0,0,0,0.06); padding: 1.5rem 1rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.sidebar .brand { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-titre); font-weight: 800; font-size: 1.1rem; color: var(--bleu-fonce); padding: 0 0.5rem 1.2rem; }
.sidebar .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--jaune); }
.nav-link { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.7rem; border-radius: 0.7rem; font-size: 0.9rem; font-weight: 500; color: var(--foreground); }
.nav-link:hover { background: var(--bleu-fonce-soft); }
.nav-link.active { background: var(--bleu-fonce); color: #fff; }
.nav-sep { height: 1px; background: rgba(0,0,0,0.06); margin: 0.9rem 0.5rem; }
.sidebar .footer { margin-top: auto; padding-top: 1rem; }
.sidebar .user { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem; }
.avatar-circle { width: 34px; height: 34px; border-radius: 50%; background: var(--bleu-fonce); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-weight: 600; font-size: 0.85rem; }
.user-role { font-size: 0.72rem; color: var(--muted); }

.main { flex: 1; min-width: 0; padding: 1.75rem 2.25rem; max-width: 1100px; margin: 0 auto; width: 100%; }
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid rgba(0,0,0,0.06); }
  .sidebar .footer { margin-top: 0.5rem; width: 100%; }
  .main { padding: 1.25rem; }
}

.page-header { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.4rem; }
.page-header .icon { width: 42px; height: 42px; border-radius: 1rem; background: var(--jaune-soft); color: var(--bleu-fonce); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.page-header h1 { margin: 0; font-size: 1.4rem; color: var(--bleu-fonce); }
.page-header p { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.88rem; }
.page-header-actions { margin-left: auto; display: flex; gap: 0.5rem; }

.card { background: var(--surface); border-radius: var(--radius); padding: 1.4rem; box-shadow: 0 1px 2px rgba(20,20,50,0.04); }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; border: none; border-radius: 0.75rem; padding: 0.62rem 1.1rem; font-size: 0.88rem; font-weight: 600; transition: filter 0.15s, background 0.15s; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--bleu-fonce); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #182561; }
.btn-soft { background: var(--bleu-fonce-soft); color: var(--bleu-fonce); }
.btn-soft:hover:not(:disabled) { filter: brightness(0.96); }
.btn-danger { background: var(--rouge-soft); color: var(--rouge); }
.btn-danger:hover:not(:disabled) { background: rgba(214,69,69,0.18); }
.btn-danger-solid { background: var(--rouge); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
.btn-icon { padding: 0.5rem; border-radius: 0.6rem; }

.field { margin-bottom: 0.9rem; }
.field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-bottom: 0.3rem; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid rgba(0,0,0,0.12); background: var(--background);
  border-radius: 0.6rem; padding: 0.55rem 0.7rem; font-size: 0.88rem;
}
.field textarea { resize: vertical; min-height: 4.5rem; }

.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge-jaune { background: var(--jaune-soft); color: #8a5a00; }
.badge-bleu { background: var(--bleu-fonce-soft); color: var(--bleu-fonce); }
.badge-vert { background: var(--vert-soft); color: var(--vert); }
.badge-gris { background: #eee; color: var(--muted); }

.alert { border-radius: 0.7rem; padding: 0.65rem 0.9rem; font-size: 0.85rem; margin-bottom: 0.9rem; }
.alert-error { background: var(--rouge-soft); color: var(--rouge); }
.alert-success { background: var(--vert-soft); color: var(--vert); }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }

.list-item { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; border: 1px solid rgba(0,0,0,0.06); border-radius: 0.85rem; padding: 0.7rem 0.9rem; margin-bottom: 0.5rem; }
.list-item .title { font-weight: 600; }
.list-item .meta { font-size: 0.78rem; color: var(--muted); }

.tabs { display: flex; gap: 0.2rem; border-bottom: 1px solid rgba(0,0,0,0.06); margin-bottom: 1.2rem; overflow-x: auto; }
.tab-btn { padding: 0.6rem 1rem; font-size: 0.86rem; font-weight: 500; border-bottom: 2px solid transparent; color: var(--muted); background: none; border-top: none; border-left: none; border-right: none; white-space: nowrap; }
.tab-btn.active { color: var(--bleu-fonce); border-bottom-color: var(--jaune); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(20,20,40,0.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal { background: #fff; border-radius: 1.1rem; padding: 1.5rem; max-width: 480px; width: 100%; max-height: 85vh; overflow-y: auto; }
.modal h2 { margin: 0 0 1rem; font-size: 1.05rem; color: var(--bleu-fonce); }

.toast-stack { position: fixed; bottom: 1.2rem; right: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 200; max-width: 320px; }
.toast { padding: 0.7rem 1rem; border-radius: 0.8rem; font-size: 0.85rem; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,0.15); animation: toast-in 0.2s ease; }
.toast-success { background: var(--bleu-fonce); }
.toast-error { background: var(--rouge); }
.toast-info { background: #374151; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--background); }
.auth-card { width: 100%; max-width: 380px; }

.progress-bar { height: 8px; border-radius: 999px; background: var(--bleu-fonce-soft); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--vert); transition: width 0.2s; }

.link-btn { background: none; border: none; color: var(--bleu-clair); font-size: 0.85rem; cursor: pointer; padding: 0; }

.avatar-lg { width: 60px; height: 60px; border-radius: 50%; background: var(--bleu-fonce); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.3rem; overflow: hidden; }
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.data-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.75rem; padding: 0.5rem 0.6rem; border-bottom: 1px solid rgba(0,0,0,0.08); }
table.data-table td { padding: 0.6rem; border-bottom: 1px solid rgba(0,0,0,0.05); vertical-align: middle; }

.fade-in { animation: fade-in 0.2s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.muted { color: var(--muted); }
.text-sm { font-size: 0.85rem; }
.row { display: flex; align-items: center; gap: 0.6rem; }
.wrap { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.spacer { flex: 1; }

/* --- Identité visuelle : logos ELAN --- */
.sidebar .brand { padding-bottom: 1rem; }
.sidebar .brand .brand-logo { width: 38px; height: 38px; object-fit: contain; }
.sidebar { position: relative; overflow: hidden; }
.sidebar::after {
  content: ""; position: absolute; left: -60px; bottom: -60px; width: 260px; height: 260px;
  background: url("../img/symbole-256.png") no-repeat center / contain; opacity: 0.07; pointer-events: none;
}
.layout > .main { position: relative; z-index: 0; }
.layout::before {
  content: ""; position: fixed; right: -80px; bottom: -80px; width: 420px; height: 420px;
  background: url("../img/symbole-512.png") no-repeat center / contain; opacity: 0.05; pointer-events: none; z-index: 0;
}
.center-screen {
  background: var(--background) url("../img/symbole-512.png") no-repeat right -120px bottom -120px / 520px;
  position: relative;
}
.auth-card { border-top: 4px solid var(--jaune); text-align: left; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 0.4rem; }
.auth-logo img { width: 190px; max-width: 70%; height: auto; }
.auth-title { margin: 0 0 1rem; text-align: center; color: var(--bleu-fonce); font-size: 1.15rem; }
.page-header { border-bottom: 2px solid var(--jaune-soft); padding-bottom: 0.9rem; }
@media (max-width: 800px) { .layout::before { width: 260px; height: 260px; opacity: 0.04; } }

.sondage-box { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.5rem; }
.sondage-qr { width: 72px; height: 72px; background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 0.5rem; padding: 2px; }
.sondage-qr svg { width: 100%; height: 100%; display: block; }
.sondage-link { font-size: 0.82rem; font-weight: 600; color: var(--bleu-fonce); text-decoration: underline; }
.check-row { display: flex; gap: 0.7rem; align-items: flex-start; margin: 0.7rem 0; font-size: 0.9rem; line-height: 1.45; cursor: pointer; }
.check-row input { margin-top: 0.25rem; flex-shrink: 0; }

/* --- Pictogrammes colorés & navigation en cartes --- */
.ico { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; }
.ico-jaune { background: var(--jaune-soft); color: #b97c00; }
.ico-bleu { background: var(--bleu-fonce-soft); color: var(--bleu-fonce); }
.ico-clair { background: var(--bleu-clair-soft); color: #1f86b8; }
.ico-vert { background: var(--vert-soft); color: var(--vert); }
.ico-rouge { background: var(--rouge-soft); color: var(--rouge); }
.sidebar { gap: 0.45rem; }
.nav-card { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.6rem; background: var(--surface); border: 1px solid rgba(33,50,123,0.08); border-radius: 14px; font-size: 0.88rem; font-weight: 600; color: var(--bleu-fonce); box-shadow: 0 1px 2px rgba(33,50,123,0.04); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.nav-card:hover { transform: translateX(2px); box-shadow: 0 4px 12px rgba(33,50,123,0.10); border-color: rgba(33,50,123,0.18); }
.nav-card.active { background: var(--bleu-fonce); color: #fff; border-color: var(--bleu-fonce); box-shadow: 0 6px 16px rgba(33,50,123,0.25); }
.nav-card.active .ico { background: rgba(255,255,255,0.16); color: var(--jaune); }
.nav-link svg { vertical-align: -3px; }
.page-header .icon { background: linear-gradient(135deg, var(--jaune-soft), var(--bleu-clair-soft)); color: var(--bleu-fonce); }

/* --- Pills de sélection (présences, personnes sur une photo) --- */
.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.3rem 0 0.6rem; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-block; padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: #eef0f6; color: #8a90a6; border: 1px solid transparent; text-decoration: line-through; text-decoration-color: rgba(0,0,0,0.25); transition: all .12s ease; }
.pill input:checked + span { background: var(--bleu-fonce); color: #fff; border-color: var(--bleu-fonce); text-decoration: none; }
.pill input:focus-visible + span { outline: 2px solid var(--bleu-clair); outline-offset: 2px; }
.pills.plain .pill span { text-decoration: none; }
.pills.plain .pill input:not(:checked) + span { background: #fff; color: var(--bleu-fonce); border-color: rgba(33,50,123,0.2); }
.tag-pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: var(--bleu-fonce-soft); color: var(--bleu-fonce); margin: 0 0.25rem 0.25rem 0; }

/* --- Couvertures : agenda, bibliothèque, fiche événement --- */
.cover { position: relative; background: linear-gradient(135deg, var(--bleu-fonce), #3a52b8 60%, var(--bleu-clair)); background-size: cover; background-position: center; overflow: hidden; }
.cover::before { content: ""; position: absolute; inset: 0; background: url("../img/symbole-512.png") no-repeat right -30px bottom -40px / 55%; opacity: 0.16; }
.cover.has-image::before { display: none; }
.cover img.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; }
.event-card { display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; overflow: hidden; border: 1px solid rgba(33,50,123,0.08); box-shadow: 0 2px 8px rgba(33,50,123,0.06); transition: transform .15s ease, box-shadow .15s ease; color: inherit; }
.event-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(33,50,123,0.14); }
.event-card .cover { height: 150px; }
.date-badge { position: absolute; left: 12px; top: 12px; z-index: 2; background: #fff; border-radius: 12px; padding: 0.3rem 0.6rem; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.18); line-height: 1.1; }
.date-badge b { display: block; font-family: var(--font-titre); font-size: 1.35rem; color: var(--bleu-fonce); }
.date-badge span { font-size: 0.68rem; text-transform: uppercase; font-weight: 700; color: #b97c00; letter-spacing: .04em; }
.event-card .body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.event-card h3 { margin: 0; font-size: 1rem; color: var(--bleu-fonce); }
.event-card .meta-line { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); }
.event-card .meta-line svg { flex-shrink: 0; }
.event-banner { height: 190px; border-radius: 18px; margin-bottom: 1rem; display: flex; align-items: flex-end; justify-content: flex-end; padding: 0.7rem; gap: 0.5rem; }
.event-banner .btn { position: relative; z-index: 2; }
.programme-img { max-width: 100%; border-radius: 14px; border: 1px solid rgba(0,0,0,0.08); display: block; margin-bottom: 1rem; }
.lib-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.9rem; margin-bottom: 1.4rem; }
.lib-cat { border: 2px solid transparent; border-radius: 18px; overflow: hidden; background: var(--surface); text-align: left; padding: 0; box-shadow: 0 2px 8px rgba(33,50,123,0.08); transition: transform .15s ease; font: inherit; color: inherit; }
.lib-cat:hover { transform: translateY(-2px); }
.lib-cat.active { border-color: var(--jaune); box-shadow: 0 8px 22px rgba(33,50,123,0.18); }
.lib-cat .cover { height: 88px; display: flex; align-items: flex-end; padding: 0.5rem; }
.lib-cat .cat-body { padding: 0.65rem 0.8rem 0.8rem; display: flex; flex-direction: column; gap: 0.15rem; }
.lib-cat .cat-body b { font-family: var(--font-titre); color: var(--bleu-fonce); font-size: 0.92rem; }
.lib-cat .cat-body small { color: var(--muted); }
.lib-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.lib-item { display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; overflow: hidden; border: 1px solid rgba(33,50,123,0.08); box-shadow: 0 2px 8px rgba(33,50,123,0.06); color: inherit; }
.lib-item .cover { height: 110px; }
.lib-item .body { padding: 0.7rem 0.85rem 0.85rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.lib-item .body b { font-size: 0.9rem; color: var(--bleu-fonce); }
.lib-item .body small { color: var(--muted); font-size: 0.76rem; }
.lib-item .actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: auto; padding-top: 0.4rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.9rem; }
.photo-card { background: var(--surface); border-radius: 14px; overflow: hidden; border: 1px solid rgba(0,0,0,0.07); }
.photo-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.photo-card .body { padding: 0.55rem 0.7rem 0.7rem; }
.cr-section { margin-bottom: 1.1rem; }
.cr-section > h3 { font-size: 0.95rem; color: var(--bleu-fonce); margin: 0 0 0.4rem; display: flex; align-items: center; gap: 0.5rem; }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.9rem; margin-bottom: 1.2rem; }
.dash-tile { display: flex; align-items: center; gap: 0.8rem; background: var(--surface); border-radius: 16px; padding: 0.9rem 1rem; border: 1px solid rgba(33,50,123,0.08); box-shadow: 0 2px 8px rgba(33,50,123,0.05); color: inherit; }
.dash-tile .ico { width: 46px; height: 46px; border-radius: 14px; }
.dash-tile b { display: block; font-family: var(--font-titre); font-size: 1.15rem; color: var(--bleu-fonce); }
.dash-tile small { color: var(--muted); font-size: 0.78rem; }

/* --- Menu : cartes carrées, séparation Gestion, dégradés --- */
.sidebar { width: 262px; background: linear-gradient(180deg, #ffffff 0%, #f1f4fc 55%, #fff6e3 100%); }
.nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.nav-card { flex-direction: column; justify-content: center; text-align: center; gap: 0.45rem; aspect-ratio: 1 / 1; padding: 0.5rem 0.3rem; border-radius: 18px; font-size: 0.74rem; line-height: 1.15; }
.nav-card .nav-label { font-weight: 700; letter-spacing: 0.01em; }
.nav-card .ico { width: 54px; height: 54px; border-radius: 17px; }
.nav-card:hover { transform: translateY(-2px); }
.nav-card.active { background: linear-gradient(145deg, var(--bleu-fonce) 0%, #3a52b8 70%, var(--bleu-clair) 140%); }
.nav-card.active .ico { background: rgba(255,255,255,0.18); color: var(--jaune); }
.nav-divider { display: flex; align-items: center; gap: 0.6rem; margin: 1rem 0.2rem 0.8rem; color: var(--muted); font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; }
.nav-divider::before, .nav-divider::after { content: ""; height: 2px; flex: 1; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--jaune), transparent); }
.ico-jaune { background: linear-gradient(145deg, #ffe7b0, #ffd37a); color: #8a5a00; }
.ico-bleu { background: linear-gradient(145deg, #dfe3f7, #c3cbef); color: var(--bleu-fonce); }
.ico-clair { background: linear-gradient(145deg, #d6effc, #a9defa); color: #14709c; }
.ico-vert { background: linear-gradient(145deg, #dcf5e3, #b3e8c2); color: #17692e; }
.ico-rouge { background: linear-gradient(145deg, #fde2e2, #f8bcbc); color: #b32d2d; }
.btn-primary { background: linear-gradient(135deg, var(--bleu-fonce), #3550c2); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.page-header .icon { background: linear-gradient(135deg, #ffe7b0, #c9ecfb); }
.page-header { border-bottom: 3px solid transparent; border-image: linear-gradient(90deg, var(--jaune), var(--bleu-clair), transparent) 1; }
.dash-tile { background: linear-gradient(135deg, #ffffff 0%, #f4f7ff 100%); }
.dash-tile:hover { box-shadow: 0 8px 20px rgba(33,50,123,0.14); transform: translateY(-2px); }
.card { background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%); }
.date-badge { background: linear-gradient(180deg, #fff, #fff6e3); }
.lib-cat .cover { background: linear-gradient(135deg, var(--bleu-fonce), var(--bleu-clair)); }
.lib-cat:nth-child(2) .cover { background: linear-gradient(135deg, #e89c0c, var(--jaune)); }
.lib-cat:nth-child(3) .cover { background: linear-gradient(135deg, #1f86b8, var(--bleu-clair)); }
.lib-cat:nth-child(4) .cover { background: linear-gradient(135deg, #1f8a3b, #6fcf8a); }
.lib-cat:nth-child(5) .cover { background: linear-gradient(135deg, #b32d2d, #f28b82); }
.lib-cat .cover.has-image { background: #000; }
@media (max-width: 860px) {
  .sidebar { width: 100%; }
  .nav-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); width: 100%; }
  .nav-divider { width: 100%; }
}

/* --- Champs de saisie plus soignés (compte-rendu et formulaires) --- */
textarea, .field textarea, .field input, .field select, input[type="text"], input[type="url"], input[type="number"], input[type="date"], input[type="datetime-local"], select {
  font-family: var(--font-texte);
  color: var(--foreground);
  background: #fbfcff;
  border: 1.5px solid rgba(33, 50, 123, 0.16);
  border-radius: 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea, .field textarea { display: block; width: 100%; padding: 0.8rem 1rem; line-height: 1.55; min-height: 5.5rem; resize: vertical; }
.field input, .field select { padding: 0.65rem 0.9rem; }
textarea::placeholder, .field input::placeholder { color: #a3a9bd; }
textarea:hover, .field input:hover, .field select:hover { border-color: rgba(33, 50, 123, 0.32); }
textarea:focus, .field textarea:focus, .field input:focus, .field select:focus {
  outline: none; background: #fff; border-color: var(--bleu-clair);
  box-shadow: 0 0 0 4px rgba(67, 180, 233, 0.18);
}
input[type="file"] { background: transparent; border: 1.5px dashed rgba(33, 50, 123, 0.25); border-radius: 14px; padding: 0.6rem 0.8rem; width: 100%; font-size: 0.82rem; }
input[type="file"]::file-selector-button { border: none; border-radius: 999px; padding: 0.35rem 0.9rem; margin-right: 0.7rem; font-weight: 700; cursor: pointer; background: var(--bleu-fonce-soft); color: var(--bleu-fonce); }

.cr-section { background: linear-gradient(135deg, #ffffff 0%, #f6f8ff 100%); border: 1px solid rgba(33, 50, 123, 0.09); border-left: 5px solid var(--jaune); border-radius: 16px; padding: 1rem 1.1rem 1.1rem; box-shadow: 0 2px 8px rgba(33, 50, 123, 0.05); }
.cr-section:nth-of-type(2n) { border-left-color: var(--bleu-clair); }
.cr-section > h3 { font-family: var(--font-titre); font-size: 1rem; margin-bottom: 0.7rem; }
.cr-section > h3 svg { color: var(--bleu-fonce); }
.cr-section .field { margin-bottom: 0.9rem; }
.cr-section .field label { color: var(--bleu-fonce); font-size: 0.82rem; }
.cr-section .field label .muted { font-weight: 500; }
#cr-form > .cr-section:last-of-type { margin-bottom: 1.2rem; }

/* --- Compte-rendu en lecture : présentation « document de synthèse » --- */
.crdoc { margin: 0 -1.4rem -1.4rem; }
.crdoc-band { height: 6px; margin-bottom: 0.2rem; background: linear-gradient(90deg, var(--bleu-fonce), var(--bleu-clair) 45%, var(--jaune) 75%, var(--violet)); border-radius: 3px; }
.crdoc-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.3rem 0; flex-wrap: wrap; }
.crdoc-eyebrow { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bleu-fonce); }
.crdoc-ref { font-size: 0.72rem; color: var(--muted); font-family: ui-monospace, Menlo, monospace; margin-top: 0.2rem; }
.crdoc-title { padding: 0.5rem 1.3rem 0; font-family: var(--font-titre); font-size: 1.5rem; font-weight: 800; color: var(--bleu-fonce); line-height: 1.15; }
.crdoc-title-bar { margin: 0.6rem 1.3rem 1rem; width: 54px; height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--bleu-fonce), var(--jaune)); }
.crdoc-meta { display: flex; gap: 0.6rem; flex-wrap: wrap; padding: 0 1.3rem; margin-bottom: 1rem; }
.crdoc-meta-pill { display: flex; align-items: center; gap: 0.55rem; padding: 0.4rem 0.9rem 0.4rem 0.4rem; border-radius: 999px; background: #f5f6f9; border: 1px solid #e8eaf0; }
.crdoc-meta-pill .ic { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.crdoc-meta-pill small { display: block; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); line-height: 1.1; }
.crdoc-meta-pill b { font-size: 0.86rem; font-weight: 700; color: var(--foreground); }
.crdoc-card { margin: 0 1.3rem 1.2rem; background: #fff; border: 1px solid #e6e8ee; border-radius: 14px; padding: 1rem 1.1rem; box-shadow: 0 2px 8px rgba(20, 20, 40, 0.04); }
.crdoc-card-h { display: flex; align-items: center; gap: 0.5rem; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.7rem; }
.crdoc-card-h svg { color: var(--bleu-fonce); }
.crdoc-pp { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0.8rem 0.2rem 0.2rem; border-radius: 999px; border: 1px solid #e0e2ea; background: #fff; margin: 0 0.4rem 0.4rem 0; }
.crdoc-pp.off { opacity: 0.55; }
.crdoc-pp .av { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.65rem; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.crdoc-pp span { font-size: 0.84rem; font-weight: 600; }
.crdoc-pp small { font-size: 0.68rem; color: var(--muted); font-style: italic; }
.crdoc-section { margin: 0 1.3rem 1.4rem; }
.crdoc-section-head { position: relative; display: flex; align-items: center; gap: 0.7rem; padding-bottom: 0.65rem; margin-bottom: 0.8rem; }
.crdoc-section-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--section-color, var(--bleu-fonce)), transparent); }
.crdoc-section-ic { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: var(--section-color, var(--bleu-fonce)); }
.crdoc-section-title { font-family: var(--font-titre); font-size: 1.05rem; font-weight: 800; color: var(--foreground); }
.crdoc-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.9rem 1.3rem 1.3rem; margin-top: 0.4rem; border-top: 1px solid #eceef3; color: var(--muted); font-size: 0.74rem; }

/* --- Programme : chronologie graphique --- */
.prog-timeline { position: relative; padding-left: 52px; }
.prog-timeline::before { content: ""; position: absolute; left: 21px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--bleu-fonce-soft), var(--bleu-clair-soft)); }
.prog-item { position: relative; margin-bottom: 1rem; }
.prog-dot { position: absolute; left: -52px; top: 0; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 0 0 4px #fff; background: var(--dot-color, var(--bleu-fonce)); }
.prog-card { background: #fff; border: 1px solid rgba(33, 50, 123, 0.1); border-radius: 14px; padding: 0.9rem 1rem; box-shadow: 0 2px 8px rgba(33, 50, 123, 0.05); }
.prog-card-top { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.prog-type-badge { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--dot-color-soft, var(--bleu-fonce-soft)); color: var(--dot-color, var(--bleu-fonce)); }
.prog-title { font-family: var(--font-titre); font-weight: 700; font-size: 1.02rem; margin: 0 0 0.3rem; color: var(--foreground); }
.prog-who { display: flex; align-items: center; gap: 0.5rem; font-size: 0.84rem; color: var(--muted); }
.prog-who .avatar-circle { width: 24px; height: 24px; font-size: 0.6rem; }

/* --- Case à cocher des checklists --- */
.check-item { gap: 0.8rem; }
.check-box { width: 28px; height: 28px; flex-shrink: 0; border-radius: 9px; border: 2px solid rgba(33,50,123,0.28); background: #fff; color: transparent; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: all .15s ease; }
.check-box:hover { border-color: var(--bleu-clair); box-shadow: 0 0 0 4px rgba(67,180,233,0.16); }
.check-item.is-done .check-box { background: linear-gradient(135deg, #1f8a3b, #4cc27a); border-color: transparent; color: #fff; }
.check-item.is-done .check-label { text-decoration: line-through; color: var(--muted); }
.done-info { color: var(--vert); font-weight: 600; }

/* --- Accueil : événement à la une --- */
.hero { position: relative; display: block; min-height: 300px; border-radius: 24px; overflow: hidden; margin-bottom: 1.3rem; color: #fff; box-shadow: 0 14px 34px rgba(33,50,123,0.28); transition: transform .2s ease, box-shadow .2s ease; }
.hero:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(33,50,123,0.34); }
.hero .cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,28,80,0.05) 0%, rgba(20,28,80,0.35) 45%, rgba(20,28,80,0.88) 100%); }
.hero-date { position: absolute; top: 18px; right: 18px; z-index: 2; background: linear-gradient(180deg, #fff, #fff2d9); color: var(--bleu-fonce); border-radius: 16px; padding: 0.5rem 0.9rem; text-align: center; line-height: 1.05; box-shadow: 0 6px 18px rgba(0,0,0,0.25); }
.hero-date b { display: block; font-family: var(--font-titre); font-size: 2rem; }
.hero-date span { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #b97c00; }
.hero-content { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 1.4rem 1.6rem 1.5rem; display: flex; flex-direction: column; gap: 0.55rem; }
.hero-kicker { align-self: flex-start; background: linear-gradient(135deg, var(--jaune), #ffd36b); color: #4a3200; font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 0.3rem 0.75rem; border-radius: 999px; }
.hero h2 { margin: 0; font-size: clamp(1.5rem, 4.2vw, 2.4rem); line-height: 1.1; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.35); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: 0.92rem; font-weight: 600; }
.hero-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.hero-cta { align-self: flex-start; margin-top: 0.3rem; background: #fff; color: var(--bleu-fonce); font-weight: 800; font-size: 0.86rem; padding: 0.55rem 1.1rem; border-radius: 999px; }

/* --- Bibliothèque : cartes de catégories carrées --- */
.lib-cats { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.lib-cat { position: relative; aspect-ratio: 1 / 1; border-radius: 22px; padding: 0; display: block; width: 100%; overflow: hidden; }
.lib-cat .lib-cat-cover { position: absolute; inset: 0; height: 100%; }
.lib-cat .lib-cat-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,28,80,0) 35%, rgba(20,28,80,0.82) 100%); }
.lib-cat .lib-cat-ico { position: absolute; top: 12px; left: 12px; z-index: 2; }
.lib-cat .cat-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0.8rem 0.9rem; }
.lib-cat .cat-body b { color: #fff; font-size: 0.95rem; line-height: 1.15; text-shadow: 0 1px 8px rgba(0,0,0,0.4); }
.lib-cat .cat-body small { color: rgba(255,255,255,0.85); }
.lib-cat .cover::before { background-size: 70%; }

/* --- Paramètres : couvertures par défaut --- */
.settings-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.1rem; }
.settings-cover { display: flex; flex-direction: column; gap: 0.5rem; }
.settings-cover b { font-size: 0.86rem; color: var(--bleu-fonce); }
.cover.square { aspect-ratio: 1 / 1; border-radius: 18px; width: 100%; }

/* --- Signature --- */
.sig-pad { width: 100%; max-width: 560px; aspect-ratio: 560 / 200; touch-action: none; border: 2px dashed rgba(33,50,123,0.3); border-radius: 16px; background: repeating-linear-gradient(0deg, transparent, transparent 38px, rgba(33,50,123,0.06) 39px); cursor: crosshair; display: block; }
.sig-current { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.7rem; }
.sig-current img { height: 54px; background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 10px; padding: 4px 8px; }

/* --- Lien profil en bas du menu --- */
.user-link { border-radius: 14px; color: inherit; transition: background .15s ease; }
.user-link:hover { background: var(--bleu-fonce-soft); }
.user-edit { color: var(--muted); display: inline-flex; }

/* --- Barre supérieure mobile (masquée sur grand écran) --- */
.topbar { display: none; }

/* --- Responsive --- */
img, svg { max-width: 100%; }
.data-table { min-width: 0; }
@media (max-width: 860px) {
  .topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; padding: 0.6rem 1rem; background: linear-gradient(135deg, var(--bleu-fonce), #3550c2); color: #fff; box-shadow: 0 4px 14px rgba(33,50,123,0.25); }
  .topbar .brand { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-titre); font-weight: 800; color: #fff; }
  .topbar .brand-logo { width: 32px; height: 32px; background: #fff; border-radius: 10px; padding: 3px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 0.4rem; background: rgba(255,255,255,0.16); color: #fff; border: none; border-radius: 999px; padding: 0.45rem 0.9rem; font-weight: 700; }
  .layout { flex-direction: column; }
  .sidebar { display: none; width: 100%; position: static; flex-direction: column; padding: 1rem; border-right: none; border-bottom: 1px solid rgba(0,0,0,0.08); }
  .sidebar.open { display: flex; }
  .sidebar .brand { display: none; }
  .nav-grid { grid-template-columns: repeat(3, 1fr); }
  .nav-card { aspect-ratio: auto; padding: 0.7rem 0.3rem; }
  .sidebar .footer { width: 100%; }
  .main { padding: 1rem; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .page-header { flex-wrap: wrap; }
  .page-header-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .hero { min-height: 340px; border-radius: 20px; }
  .hero-content { padding: 1.1rem 1.1rem 1.2rem; }
  .event-banner { height: 150px; }
  .tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs .tab-btn { flex-shrink: 0; }
  .layout::before { display: none; }
  table.data-table { display: block; overflow-x: auto; }
  .list-item { flex-wrap: wrap; }
  .modal { width: calc(100vw - 2rem); max-width: 100%; max-height: 90vh; overflow-y: auto; }
}
@media (max-width: 520px) {
  .nav-grid { grid-template-columns: repeat(2, 1fr); }
  .event-grid, .lib-items, .photo-grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .lib-cats { grid-template-columns: 1fr 1fr; }
  .dash-tiles { grid-template-columns: 1fr 1fr; }
  .settings-covers { grid-template-columns: 1fr 1fr; }
  .hero-meta { font-size: 0.82rem; }
  .auth-card { max-width: 100%; }
  .event-card .cover { height: 110px; }
}

/* --- Annuaire : cartes carrées avec l'avatar en fond --- */
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.dir-card { position: relative; aspect-ratio: 1 / 1; border-radius: 22px; overflow: hidden; display: block; background: linear-gradient(135deg, var(--bleu-fonce), #3a52b8 60%, var(--bleu-clair)); box-shadow: 0 3px 10px rgba(33,50,123,0.14); transition: transform .15s ease, box-shadow .15s ease; color: #fff; }
.dir-card:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 12px 26px rgba(33,50,123,0.28); }
.dir-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dir-initials { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-titre); font-weight: 800; font-size: 2.6rem; color: rgba(255,255,255,0.92); }
.dir-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,28,80,0) 45%, rgba(20,28,80,0.82) 100%); }
.dir-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.7rem 0.8rem; font-family: var(--font-titre); font-weight: 700; font-size: 1.05rem; text-shadow: 0 1px 8px rgba(0,0,0,0.4); }

/* --- Fiche détaillée --- */
.fiche-top { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: stretch; }
.fiche-photo { aspect-ratio: 1 / 1; border-radius: 24px; overflow: hidden; background: linear-gradient(135deg, var(--bleu-fonce), var(--bleu-clair)); box-shadow: 0 8px 22px rgba(33,50,123,0.22); }
.fiche-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fiche-photo.no-photo { display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-titre); font-weight: 800; font-size: 3.4rem; }
.fiche-line { display: flex; align-items: center; gap: 0.5rem; margin: 0.3rem 0; font-size: 0.9rem; }
.fiche-line a { color: var(--bleu-fonce); font-weight: 600; text-decoration: underline; }
.fiche-h { margin: 0 0 0.8rem; color: var(--bleu-fonce); font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.fiche-item { padding: 0.55rem 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.fiche-item:last-child { border-bottom: none; }
.fiche-company { display: flex; align-items: center; gap: 0.8rem; }
.company-logo { width: 46px; height: 46px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid rgba(0,0,0,0.08); padding: 3px; flex-shrink: 0; }

/* --- Listes modifiables du profil --- */
.form-section { margin: 1.1rem 0; padding: 1rem; border-radius: 16px; background: linear-gradient(135deg, #fbfcff, #f4f7ff); border: 1px solid rgba(33,50,123,0.08); }
.form-section > h3 { margin: 0 0 0.3rem; font-size: 0.95rem; color: var(--bleu-fonce); }
.repeat-block { padding: 0.8rem; margin-bottom: 0.7rem; border-radius: 14px; background: #fff; border: 1px dashed rgba(33,50,123,0.22); }
@media (max-width: 700px) {
  .fiche-top { grid-template-columns: 1fr; }
  .fiche-photo { max-width: 260px; }
  .dir-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.7rem; }
}

/* --- Annuaire : grandes cartes (15 membres maximum) --- */
.dir-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.3rem; }
.dir-card { border-radius: 26px; }
.dir-initials { font-size: 4.2rem; }
.dir-name { padding: 1rem 1.1rem; font-size: 1.45rem; }
@media (max-width: 700px) {
  .dir-grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
  .dir-card { border-radius: 20px; }
  .dir-initials { font-size: 3rem; }
  .dir-name { padding: 0.7rem 0.8rem; font-size: 1.15rem; }
}

/* --- Comptabilité & sauvegardes --- */
.compta-h { font-size: 1.05rem; color: var(--bleu-fonce); margin: 1.4rem 0 0.8rem; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.9rem; }
.account-card { display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem 1.1rem; border-radius: 18px; background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%); border: 1px solid rgba(33,50,123,0.1); box-shadow: 0 2px 10px rgba(33,50,123,0.07); }
.account-top { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--bleu-fonce); }
.account-card b { font-family: var(--font-titre); font-size: 1.7rem; color: var(--bleu-fonce); }
.account-card b.neg { color: var(--rouge); }
.account-card small { color: var(--muted); }
.compta-chart { width: 100%; height: auto; display: block; }
.seg { display: inline-flex; background: #eef0f6; border-radius: 999px; padding: 4px; margin-bottom: 0.9rem; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 0.45rem 1.2rem; border-radius: 999px; font-weight: 700; font-size: 0.86rem; color: var(--muted); }
.seg input:checked + span { background: linear-gradient(135deg, var(--bleu-fonce), #3550c2); color: #fff; box-shadow: 0 3px 10px rgba(33,50,123,0.3); }
.seg input:focus-visible + span { outline: 2px solid var(--bleu-clair); outline-offset: 2px; }

/* --- Carte « Site ELAN » : le logo en image --- */
.nav-card-logo { background: linear-gradient(145deg, #ffffff 0%, #fff6e3 100%); }
.nav-card-logo .nav-logo-img { width: 66%; height: auto; max-height: 62%; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(33,50,123,0.18)); transition: transform .2s ease; }
.nav-card-logo:hover .nav-logo-img { transform: scale(1.06) rotate(-3deg); }

/* --- Administration (justificatifs et contrats) --- */
.fournisseur-group { margin-bottom: 1rem; }
.fournisseur-name { font-family: var(--font-titre); font-weight: 700; color: var(--bleu-fonce); font-size: 0.95rem; padding: 0.3rem 0.7rem; margin-bottom: 0.5rem; border-left: 4px solid var(--jaune); background: linear-gradient(90deg, #fff6e3, transparent); border-radius: 6px; }

[hidden] { display: none !important; }

.lib-cats .nav-divider { grid-column: 1 / -1; margin: 0.4rem 0.2rem; }

/* --- Types d'événements : présentiel / visio / réunion du bureau --- */
.kind-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.22rem 0.65rem; border-radius: 999px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
.kind-badge.kind-presentiel { background: linear-gradient(135deg, #ffe7b0, #ffd37a); color: #7a4d00; }
.kind-badge.kind-visio { background: linear-gradient(135deg, #d6effc, #a9defa); color: #0f6592; }
.kind-badge.kind-bureau { background: linear-gradient(135deg, #21327b, #3a52b8); color: #fff; }
.kind-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.list-item.kind-row { border-left: 6px solid transparent; }
.list-item.kind-row.kind-presentiel { border-left-color: #f0a500; background: linear-gradient(90deg, #fff8e8, #fff 40%); }
.list-item.kind-row.kind-visio { border-left-color: #43b4e9; background: linear-gradient(90deg, #eef8fd, #fff 40%); }
.list-item.kind-row.kind-bureau { border-left-color: #21327b; background: linear-gradient(90deg, #eceffa, #fff 40%); }
.cover.kind-presentiel { background: linear-gradient(135deg, #e89c0c, #fab428 60%, #ffd98a); }
.cover.kind-visio { background: linear-gradient(135deg, #1f86b8, #43b4e9 60%, #a9defa); }
.cover.kind-bureau { background: linear-gradient(135deg, #141c52, #21327b 60%, #3a52b8); }
.cover.has-image.kind-presentiel, .cover.has-image.kind-visio, .cover.has-image.kind-bureau { background: #1c2340; }
.event-card.kind-presentiel { border-top: 5px solid #f0a500; }
.event-card.kind-visio { border-top: 5px solid #43b4e9; }
.event-card.kind-bureau { border-top: 5px solid #21327b; }
.cover-kind { position: absolute; right: 10px; top: 10px; z-index: 3; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25)); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.78rem; color: var(--muted); margin-top: 0.4rem; }
.chart-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 0.3rem; }

/* --- Photo de profil : recadrage et confirmation --- */
.avatar-edit { display: flex; align-items: center; gap: 1rem; }
.avatar-xl { width: 88px; height: 88px; font-size: 1.8rem; flex-shrink: 0; box-shadow: 0 4px 14px rgba(33,50,123,0.2); }
.avatar-status { margin-top: 0.4rem; font-size: 0.85rem; min-height: 1.2rem; color: var(--muted); }
.avatar-status.is-ok { color: var(--vert); font-weight: 700; }
.avatar-status.is-error { color: var(--rouge); font-weight: 700; }
.modal.cropper { max-width: 380px; }
.crop-stage { position: relative; margin: 0 auto; border-radius: 16px; overflow: hidden; background: #1c2340; touch-action: none; }
.crop-stage canvas { display: block; cursor: grab; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at center, transparent 0, transparent 138px, rgba(20,28,80,0.62) 140px); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35); }
.crop-zoom { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.8rem; }
.crop-zoom input { flex: 1; }
.photo-card.is-new { outline: 3px solid var(--vert); box-shadow: 0 0 0 6px rgba(31,138,59,0.15); }
.photo-preview { max-width: 180px; border-radius: 12px; margin-top: 0.5rem; display: block; }

/* Indicateurs de la gestion des membres */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.stat-card { background: var(--surface); border-radius: 14px; padding: 0.8rem 0.95rem; border: 1px solid rgba(33,50,123,0.08); box-shadow: 0 2px 8px rgba(33,50,123,0.05); display: flex; flex-direction: column; gap: 0.1rem; }
.stat-card small { color: var(--muted); font-size: 0.78rem; }
.stat-card > b { font-family: var(--font-titre); font-size: 1.9rem; line-height: 1.1; color: var(--bleu-fonce); }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.1rem; }
@media (max-width: 640px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-box .compta-chart { width: 100%; height: auto; display: block; }
.chart-box { background: var(--surface); border-radius: 14px; padding: 1rem 1.1rem; border: 1px solid rgba(33,50,123,0.08); }
.chart-box h3 { margin: 0 0 0.4rem; font-family: var(--font-titre); font-size: 1rem; color: var(--bleu-fonce); }
.audit-detail { white-space: pre-wrap; word-break: break-word; font-size: 0.74rem; background: var(--bleu-fonce-soft); border-radius: 8px; padding: 0.5rem 0.6rem; margin: 0.3rem 0 0; }
.chart-box .chart-legend { font-size: 0.85rem; margin-top: 0.4rem; } .chart-box .chart-legend i { width: 14px; height: 14px; }

/* --- Sondages : résultats intégrés à l'app (même langage visuel que les CR/programme) --- */
.crdoc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.7rem; margin: 0 1.3rem 1.3rem; }
.crdoc-stat { background: #fff; border: 1px solid #e6e8ee; border-radius: 14px; padding: 0.9rem 1rem; box-shadow: 0 2px 8px rgba(20,20,40,0.04); }
.crdoc-stat b { display: block; font-family: var(--font-titre); font-size: 1.5rem; color: var(--bleu-fonce); line-height: 1.1; }
.crdoc-stat span { display: block; font-size: 0.76rem; color: var(--muted); margin-top: 0.25rem; line-height: 1.3; }
.crdoc-stat.is-accent b { color: var(--dot-color, var(--bleu-fonce)); }

.crdoc-bars .bar-item { margin-bottom: 0.7rem; }
.crdoc-bars .bar-item:last-child { margin-bottom: 0; }
.crdoc-bars .bar-label { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.86rem; margin-bottom: 0.3rem; }
.crdoc-bars .bar-label span { font-weight: 700; color: var(--bleu-fonce); flex-shrink: 0; }
.crdoc-bars .bar-track { height: 10px; border-radius: 999px; background: #eef0f6; overflow: hidden; }
.crdoc-bars .bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--bleu-fonce), var(--bleu-clair)); }

.crdoc-insight { display: flex; gap: 0.6rem; align-items: flex-start; background: var(--jaune-soft); border-left: 4px solid var(--jaune); border-radius: 0 12px 12px 0; padding: 0.7rem 0.9rem; margin-top: 0.8rem; font-size: 0.86rem; color: #6a5208; }
.crdoc-insight .ic { flex-shrink: 0; font-size: 1.1rem; line-height: 1.3; }

.crdoc-donut-wrap { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.crdoc-donut-center { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.crdoc-donut-center svg { display: block; }
.crdoc-donut-center .label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.crdoc-donut-center .label b { font-family: var(--font-titre); font-size: 1.3rem; color: var(--bleu-fonce); line-height: 1; }
.crdoc-donut-center .label small { font-size: 0.68rem; color: var(--muted); }
.crdoc-donut-legend { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 0.5rem; }
.crdoc-donut-legend .row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.86rem; }
.crdoc-donut-legend .dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }

.crdoc-ranking { display: flex; flex-direction: column; gap: 0.6rem; }
.crdoc-rank-item { display: flex; gap: 0.8rem; align-items: flex-start; background: #f8f9fc; border-radius: 12px; padding: 0.6rem 0.85rem; }
.crdoc-rank-item b.n { font-family: var(--font-titre); font-size: 1.1rem; color: var(--bleu-clair); flex-shrink: 0; width: 28px; }
.crdoc-rank-item div b { display: block; font-size: 0.88rem; color: var(--bleu-fonce); }
.crdoc-rank-item div span { font-size: 0.8rem; color: var(--muted); }

.crdoc-distribution .d-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.45rem 0; border-top: 1px solid rgba(33,50,123,0.06); }
.crdoc-distribution .d-item:first-child { border-top: none; }
.crdoc-distribution .d-pct { font-family: var(--font-titre); font-size: 1.1rem; color: var(--bleu-fonce); width: 54px; flex-shrink: 0; }
.crdoc-distribution .d-item div span { display: block; font-size: 0.78rem; color: var(--muted); }

.crdoc-segmented .seg-row { margin-bottom: 0.8rem; }
.crdoc-segmented .seg-row:last-child { margin-bottom: 0; }
.crdoc-segmented .seg-label { font-size: 0.86rem; margin-bottom: 0.35rem; }
.crdoc-segmented .seg-track { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: #eef0f6; }
.crdoc-segmented .seg-track span { height: 100%; }
.crdoc-segmented .seg-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.8rem; font-size: 0.78rem; color: var(--muted); }
.crdoc-segmented .seg-legend .row { display: flex; align-items: center; gap: 0.4rem; }
.crdoc-segmented .seg-legend .dot { width: 10px; height: 10px; border-radius: 3px; }

.crdoc-comments { display: flex; flex-direction: column; gap: 0.6rem; }
.crdoc-comment { background: #f8f9fc; border-left: 3px solid var(--bleu-clair); border-radius: 0 10px 10px 0; padding: 0.6rem 0.9rem; font-size: 0.85rem; font-style: italic; color: var(--foreground); }

.crdoc-synthese { display: flex; flex-direction: column; gap: 0.7rem; }
.crdoc-synth-item { display: flex; gap: 0.7rem; align-items: flex-start; }
.crdoc-synth-item .emoji { font-size: 1.2rem; line-height: 1.4; flex-shrink: 0; }
.crdoc-synth-item p { margin: 0; font-size: 0.86rem; line-height: 1.6; }

.crdoc-note { font-size: 0.78rem; color: var(--muted); font-style: italic; margin-top: 0.4rem; }

.sondage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.sondage-card { display: block; background: var(--surface); border-radius: var(--radius); padding: 1.1rem; box-shadow: 0 1px 2px rgba(20,20,50,0.04); border-top: 4px solid var(--bleu-fonce); }
.sondage-card:nth-child(4n+2) { border-top-color: var(--bleu-clair); }
.sondage-card:nth-child(4n+3) { border-top-color: var(--jaune); }
.sondage-card:nth-child(4n+4) { border-top-color: var(--violet); }
.sondage-card .badge { margin-bottom: 0.6rem; }
.sondage-card h3 { margin: 0 0 0.4rem; font-family: var(--font-titre); font-size: 1.05rem; color: var(--bleu-fonce); }
.sondage-card p { margin: 0; font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

/* --- Sondages : menu de bascule entre résultats --- */
.sondage-switch { display: flex; gap: 0.6rem; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.2rem; }
.sondage-switch-item { flex-shrink: 0; display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.9rem 0.5rem 0.5rem; border-radius: 999px; border: 2px solid transparent; background: var(--bleu-fonce-soft); color: var(--bleu-fonce); text-decoration: none; transition: border-color .15s ease; }
.sondage-switch-item:hover { border-color: var(--bleu-clair); }
.sondage-switch-item.active { background: var(--bleu-fonce); color: #fff; }
.sondage-switch-item .ic { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,0.25); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sondage-switch-item:not(.active) .ic { background: #fff; color: var(--bleu-fonce); }
.sondage-switch-item b { font-size: 0.84rem; font-weight: 700; line-height: 1.15; display: block; }
.sondage-switch-item small { font-size: 0.7rem; opacity: 0.85; display: block; }

/* Notice d'information RGPD */
.notice-page { min-height: 100vh; background: var(--background); padding: 1.2rem 0.8rem 2rem; }
.notice-card { max-width: 860px; margin: 0 auto; background: var(--surface); border-radius: 18px; box-shadow: 0 4px 18px rgba(33,50,123,0.10); overflow: hidden; padding-bottom: 1.2rem; }
.notice-hd { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.2rem 1.6rem 0.6rem; }
.notice-logo { height: 64px; width: auto; }
.notice-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.notice-title { font-family: var(--font-titre); font-size: 1.7rem; line-height: 1.2; color: var(--bleu-fonce); margin: 0.3rem 1.6rem 0; }
.notice-sub { color: var(--muted); font-size: 0.85rem; margin: 0.4rem 1.6rem 0.8rem; }
.notice-body { padding: 0 1.6rem; }
.notice-sec h2 { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-titre); font-size: 1.1rem; color: var(--bleu-fonce); margin: 1.4rem 0 0.5rem; }
.notice-sec h2 span { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--jaune); color: var(--bleu-fonce); font-size: 0.85rem; }
.notice-sec p, .notice-sec li { font-size: 0.92rem; line-height: 1.6; }
.notice-sec ul { padding-left: 1.2rem; margin: 0.3rem 0; }
.notice-sec a { color: var(--bleu-clair); }
@media print {
  .notice-actions { display: none; }
  .notice-page { background: #fff; padding: 0; }
  .notice-card { box-shadow: none; border-radius: 0; }
  .notice-sec { break-inside: avoid; }
}

/* Agenda : prochains rendez-vous mis en avant, liste groupée par mois, passés séparés */
.ag-heroes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.ag-hero { display: block; background: var(--surface); border-radius: 18px; overflow: hidden; border: 1px solid rgba(33,50,123,0.10); box-shadow: 0 4px 16px rgba(33,50,123,0.08); color: inherit; text-decoration: none; position: relative; transition: transform .15s, box-shadow .15s; }
a.ag-hero:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(33,50,123,0.14); }
.ag-hero .cover { height: 130px; position: relative; }
.ag-hero-label { position: absolute; left: 0.8rem; bottom: 0.8rem; z-index: 2; background: var(--jaune); color: var(--bleu-fonce); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.3rem 0.7rem; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.ag-hero-label--flat { position: static; display: inline-block; box-shadow: none; }
.ag-hero.kind-visio .ag-hero-label { background: var(--bleu-clair); color: #fff; }
.ag-hero.kind-bureau .ag-hero-label { background: var(--bleu-fonce); color: #fff; }
.ag-hero .body { padding: 0.9rem 1.1rem 1.1rem; }
.ag-hero .body h3 { margin: 0.2rem 0 0.4rem; font-family: var(--font-titre); font-size: 1.2rem; line-height: 1.2; color: var(--bleu-fonce); }
.ag-when { display: inline-block; font-size: 0.78rem; font-weight: 800; color: var(--vert); background: var(--vert-soft); padding: 0.15rem 0.6rem; border-radius: 999px; }
.ag-hero-empty { border-style: dashed; box-shadow: none; background: transparent; }
.ag-hero-empty .body { padding: 1.1rem; }
.ag-section { margin-bottom: 1.6rem; }
.ag-section-hd { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.ag-section-hd h2, .ag-past summary { font-family: var(--font-titre); font-size: 1.1rem; color: var(--bleu-fonce); margin: 0; }
.ag-count { display: inline-block; margin-left: 0.4rem; font-size: 0.78rem; font-weight: 700; background: var(--bleu-fonce-soft); color: var(--bleu-fonce); padding: 0.05rem 0.55rem; border-radius: 999px; }
.ag-filter { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.ag-chip { display: inline-flex; align-items: center; gap: 0.3rem; border: 1px solid rgba(33,50,123,0.15); background: var(--surface); color: var(--bleu-fonce); padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.ag-chip.active { background: var(--bleu-fonce); color: #fff; border-color: var(--bleu-fonce); }
.ag-month { font-family: var(--font-titre); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 1.1rem 0 0.4rem; padding-bottom: 0.25rem; border-bottom: 2px solid var(--jaune); display: inline-block; }
.ag-list { display: flex; flex-direction: column; gap: 0.45rem; }
.ag-row { display: flex; align-items: center; gap: 0.9rem; background: var(--surface); border: 1px solid rgba(33,50,123,0.08); border-left: 4px solid var(--jaune); border-radius: 12px; padding: 0.55rem 0.9rem; color: inherit; text-decoration: none; }
.ag-row:hover { background: var(--bleu-clair-soft); }
.ag-row[hidden], .ag-month[hidden] { display: none; }
.ag-row.kind-visio { border-left-color: var(--bleu-clair); }
.ag-row.kind-bureau { border-left-color: var(--bleu-fonce); }
.ag-date { display: flex; flex-direction: column; align-items: center; min-width: 2.8rem; line-height: 1.05; }
.ag-date b { font-family: var(--font-titre); font-size: 1.3rem; color: var(--bleu-fonce); }
.ag-date small { font-size: 0.7rem; text-transform: uppercase; color: var(--muted); }
.ag-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ag-main .title { font-weight: 700; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; }
.ag-main .meta { font-size: 0.8rem; color: var(--muted); }
.ag-past { background: #eef0f6; border-radius: 16px; padding: 0.8rem 1rem; border: 1px dashed rgba(33,50,123,0.2); }
.ag-past summary { cursor: pointer; display: flex; align-items: center; list-style: none; color: var(--muted); }
.ag-past summary::before { content: "▸"; margin-right: 0.5rem; transition: transform .15s; }
.ag-past details[open] summary::before { transform: rotate(90deg); }
.ag-past .ag-row { opacity: 0.85; background: rgba(255,255,255,0.7); }
@media (max-width: 520px) { .ag-row .kind-badge { display: none; } }

/* Menu de gauche fixe : reste en place quel que soit la hauteur de la page (défile en interne s'il est plus haut que l'écran) */
@media (min-width: 861px) {
  .sidebar { position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; }
  .sidebar .footer { padding-bottom: 0.5rem; }
}

/* Déclaration d'absence */
.absence-pill { cursor: pointer; border: 2px solid var(--rouge); background: #fff; color: var(--rouge); font-weight: 800; font-size: 0.82rem; padding: 0.3rem 0.95rem; border-radius: 999px; transition: background .15s, color .15s; }
.absence-pill:hover { background: var(--rouge-soft); }
.absence-pill.is-on { background: var(--rouge); color: #fff; }
.pill--absent span { background: var(--rouge-soft); color: var(--rouge); border-color: rgba(214,69,69,0.45); text-decoration: none; }
.pill--absent input:checked + span { background: var(--rouge); color: #fff; border-color: var(--rouge); }

.dir-pending { position: absolute; right: 8px; top: 8px; z-index: 3; background: var(--jaune); color: var(--bleu-fonce); font-size: 0.65rem; font-weight: 800; padding: 0.15rem 0.55rem; border-radius: 999px; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
