/* ============================================================
   CRM En Avant Guingamp — Feuille de style principale
   ============================================================ */

/* ---- Variables ---- */
:root {
  /* Couleurs EAG exactes (d'après logo officiel) */
  --primary:       #C31017;
  --primary-h:     #a20d13;
  --primary-light: rgba(195,16,23,.07);
  --accent:        var(--primary);   /* alias marque (chat, accents) — suit le thème */
  --eag-dark:      #171817;   /* noir EAG */
  --eag-dark-l:    #222222;   /* noir EAG hover */

  --sidebar-w:     252px;
  --topbar-h:      60px;
  --font:          'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --radius:        10px;
  --radius-sm:     6px;
  --radius-lg:     14px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow:        0 4px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md:     0 8px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  --border:        #e5e7eb;
  --bg:            #f2f2f0;   /* très légèrement chaud, sans bleu */
  --bg-2:          #e8e7e3;   /* gris neutre : fonds de survol, pistes de jauges */
  --card:          #ffffff;
  --text:          #111111;
  --text-2:        #3a3a3a;
  --muted:         #6b7280;
  --muted-l:       #9ca3af;
  --success:       #16a34a;
  --success-bg:    #dcfce7;
  --warning:       #d97706;
  --warning-bg:    #fef3c7;
  --danger:        #dc2626;
  --danger-bg:     #fee2e2;
  --info:          #2563eb;
  --info-bg:       #dbeafe;
  --navy:          #0d1b3e;   /* utilisé par .stat-icon.navy */

  /* Sidebar — dégradé de deux rouges sombres, proches du noir (profond → presque noir).
     Les thèmes de démo surchargent ces deux variables pour garder leur couleur. */
  --sidebar-1:     #7E0A10;
  --sidebar-2:     #350507;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* L'attribut hidden ne pèse rien face à une classe : .btn ou .ml-fond, qui posent
   un display, le désactivent sans le vouloir. On lui rend la priorité une fois
   pour toutes, plutôt que de doubler chaque classe d'une règle [hidden]. */
[hidden] { display: none !important; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; min-height: 100dvh; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* Taille par défaut des icônes SVG — les règles contextuelles ci-dessous surchargent si besoin */
.icon { width: 16px; height: 16px; flex-shrink: 0; vertical-align: middle; }

/* ---- Layout ---- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar-1);   /* repli si le dégradé n'est pas supporté */
  background: linear-gradient(168deg, var(--sidebar-1) 0%, var(--sidebar-2) 100%);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
  /* Liseré clair en haut + ombre portée à droite pour détacher du contenu */
  border-top: 3px solid rgba(255,255,255,.22);
  box-shadow: 1px 0 0 rgba(0,0,0,.10), 4px 0 18px rgba(0,0,0,.08);
}

.page-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  /* Filet rouge en bas de la topbar — rappel discret du club */
  box-shadow: 0 2px 0 0 var(--primary), var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.content {
  flex: 1;
  padding: 28px;
}

/* ---- Sidebar Brand ---- */
.sidebar-brand {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-bottom: 1px solid rgba(255,255,255,.16);
  flex-shrink: 0;
}

/* Plus de plaque blanche : l'emblème se pose directement sur le rouge */
.brand-logo-wrap {
  background: transparent;
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-shadow: none;
}
/* Emblème rond EAG dans la sidebar */
.brand-emblem {
  height: 46px;
  width: auto;
  flex-shrink: 0;
  border-radius: 4px;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.28));
}
.brand-logo-img {
  height: 26px;
  width: auto;
  display: block;
  flex: 1;
  min-width: 0;
}
.brand-sub {
  color: rgba(255,255,255,.62);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  text-align: center;
  margin-top: 8px;
  font-weight: 700;
}

/* Emblème rond dans la topbar */
.topbar-emblem {
  height: 32px;
  width: auto;
  border-radius: 6px;
  opacity: .5;
  margin-left: 10px;
  transition: opacity .2s;
}
.topbar-emblem:hover { opacity: .8; }

/* ---- Sidebar Nav ---- */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  padding: 16px 20px 6px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: rgba(255,255,255,.5);
  font-weight: 700;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 20px;
  color: rgba(255,255,255,.78);
  font-size: 13.5px;
  font-weight: 500;
  transition: all .18s ease;
  position: relative;
  cursor: pointer;
}

.sidebar-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.10);
}

.sidebar-nav a.active {
  color: #fff;
  font-weight: 600;
  background: rgba(255,255,255,.16);
}
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 3px;
  background: #fff;
  border-radius: 0 3px 3px 0;
}

.sidebar-nav a.coming-soon {
  opacity: .45;
  cursor: default;
  pointer-events: none;
}
.sidebar-nav a.coming-soon::after {
  content: 'bientôt';
  margin-left: auto;
  font-size: 9.5px;
  padding: 2px 6px;
  background: rgba(255,255,255,.1);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sidebar-nav .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.16);
  margin: 8px 16px;
}

/* ---- Sidebar User ---- */
.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.16);
  flex-shrink: 0;
}
.sidebar-user-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background .18s;
}
.sidebar-user-inner:hover { background: rgba(255,255,255,.10); }
.sidebar-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}
.sidebar-user-profile:hover .user-avatar { opacity: .85; }
.sidebar-user-profile:hover .user-info strong { color: rgba(255,255,255,.85); }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info strong {
  display: block;
  color: #fff;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-info small {
  color: rgba(255,255,255,.62);
  font-size: 10.5px;
  text-transform: capitalize;
}

.logout-btn {
  color: rgba(255,255,255,.62);
  transition: color .18s;
  display: flex;
  align-items: center;
}
.logout-btn:hover { color: #fff; }
.logout-btn .icon { width: 16px; height: 16px; }

/* ---- Topbar ---- */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.breadcrumb a { transition: color .15s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .icon { width: 14px; height: 14px; color: var(--muted-l); }
.breadcrumb .current { color: var(--text-2); font-weight: 500; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 2px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn .icon { width: 16px; height: 16px; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-h); border-color: var(--primary-h); box-shadow: 0 4px 12px rgba(196,30,58,.3); }

.btn-secondary { background: var(--card); color: var(--text-2); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: #d1d5db; }

.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #fca5a5; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-sm .icon { width: 14px; height: 14px; }

.btn-icon { padding: 7px; border-radius: 2px; }
.btn-icon .icon { width: 15px; height: 15px; }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.04);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h2, .card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.card-body { padding: 24px; }

/* Programme d'un événement : heure de début, heure de fin, intitulé, sur une ligne. */
.prog-l { display: grid; grid-template-columns: 130px 130px 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.prog-ls .prog-l { grid-template-columns: 18px 130px 130px 1fr auto; }
.prog-h { cursor: grab; color: var(--muted, #9ca3af); font-size: 15px; letter-spacing: -3px; user-select: none; text-align: center; }
.prog-h:active { cursor: grabbing; }
.prog-b { display: flex; gap: 2px; }
.prog-drag { opacity: .4; }
@media (max-width: 700px) { .prog-l { grid-template-columns: 1fr 1fr; } .prog-ls .prog-l { grid-template-columns: 18px 1fr 1fr auto; } .prog-l input[type=text] { grid-column: 1 / -1; } }
/* Sous-programmes : un bloc par programme, son nom en tête, ses lignes dessous. */
.prog-multi .prog-s { border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 12px 12px 4px; margin-bottom: 12px; }
.prog-l[hidden] { display: none; }
.prog-t { grid-template-columns: 1fr 110px auto; margin-bottom: 12px; }
.prog-t input[type=text] { font-weight: 700; text-transform: uppercase; color: #E30613; }

/* Carte dont le contenu est posé directement dedans, sans .card-header ni .card-body.
   Trois blocs de la fiche événement faisaient ça sans marge : le texte touchait le bord
   et le champ du lien débordait de la carte. La marge et l'en-tête sont ici, une fois. */
.card-simple { padding: 16px 18px; }
.card-simple-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.card-simple-head h2 {
  font-size: 13px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .4px; margin: 0;
}
.card-simple-head > span { font-size: 12.5px; color: var(--text-2); }
/* Un élément de formulaire en flex déborde par défaut (min-width auto) : sans ça,
   une URL longue pousse le bouton « Copier » hors de la carte. */
.card-simple .form-control { min-width: 0; }
.card-body-sm { padding: 16px 20px; }
.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: #fafafa;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---- Stat Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon .icon { width: 22px; height: 22px; }
.stat-icon.red    { background: rgba(196,30,58,.1); color: var(--primary); }
.stat-icon.blue   { background: rgba(37,99,235,.1); color: var(--info); }
.stat-icon.green  { background: rgba(22,163,74,.1);  color: var(--success); }
.stat-icon.orange { background: rgba(217,119,6,.1);  color: var(--warning); }
.stat-icon.navy   { background: rgba(13,27,62,.1);   color: var(--navy); }

.stat-info { flex: 1; min-width: 0; }
.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 3px;
}
.stat-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

/* ---- Dashboard big cards ---- */
.dashboard-big-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,.05);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.dashboard-big-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 5px; height: 100%;
  background: var(--card-color, #C41E3A);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.dashboard-big-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dashboard-big-card__icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--card-color, #C41E3A) 12%, transparent);
  color: var(--card-color, #C41E3A);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dashboard-big-card__icon .icon { width: 28px; height: 28px; }
.dashboard-big-card__body { flex: 1; min-width: 0; }
.dashboard-big-card__num {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
  letter-spacing: -1px;
}
.dashboard-big-card__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}
.dashboard-big-card__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.dashboard-big-card__arrow {
  color: var(--muted-l);
}
.dashboard-big-card__arrow .icon { width: 20px; height: 20px; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: background .12s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f9fafb; }
tbody td { padding: 12px 16px; vertical-align: middle; }

.td-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

/* ---- Forms ---- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid .full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-group label .req { color: var(--primary); }

.form-control {
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  transition: border-color .18s, box-shadow .18s;
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196,30,58,.1);
}
.form-control::placeholder { color: var(--muted-l); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---- Checkbox grid (statuts, rôles) ---- */
.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  font-size: 13px;
}
.checkbox-item:hover { border-color: var(--primary); background: var(--primary-light); }
.checkbox-item input[type=checkbox] { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.checkbox-item.checked { border-color: var(--primary); background: var(--primary-light); }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-gray   { background: #f3f4f6; color: var(--muted); border-color: var(--border); }
.badge-red    { background: rgba(196,30,58,.1); color: var(--primary); border-color: rgba(196,30,58,.2); }
.badge-blue   { background: var(--info-bg); color: var(--info); border-color: #bfdbfe; }
.badge-green  { background: var(--success-bg); color: var(--success); border-color: #bbf7d0; }
.badge-orange { background: var(--warning-bg); color: var(--warning); border-color: #fde68a; }

.dot-active   { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.dot-inactive { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted-l); }

/* ---- Search / Filter bar ---- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}
.search-wrap .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.search-wrap input {
  padding: 9px 13px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  width: 100%;
  background: var(--card);
  transition: border-color .18s, box-shadow .18s;
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196,30,58,.1);
}

/* ---- Alerts / Flash ---- */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.alert svg { flex-shrink: 0; }
.alert-success { background: var(--success-bg); color: #15803d; border-color: #bbf7d0; }
.alert-error   { background: var(--danger-bg);  color: #b91c1c; border-color: #fca5a5; }
.alert-warning { background: var(--warning-bg); color: #92400e; border-color: #fde68a; }
.alert-info    { background: var(--info-bg);    color: #1d4ed8; border-color: #bfdbfe; }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tab-btn .icon { width: 15px; height: 15px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Activity Timeline ---- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
  align-items: flex-start;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.timeline-dot .icon { width: 14px; height: 14px; color: var(--muted); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-text { font-size: 13.5px; color: var(--text-2); }
.timeline-text strong { color: var(--text); }
.timeline-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---- Detail page ---- */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.detail-header-left h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.detail-header-left .detail-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.detail-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}
.info-item {}
.info-item dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 4px;
}
.info-item dd {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.info-item dd a:hover { color: var(--primary); text-decoration: underline; }

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.page-btn {
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border: 1.5px solid var(--border);
  transition: all .15s;
  background: var(--card);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state .icon { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--muted-l); }
.empty-state h3 { font-size: 16px; color: var(--text-2); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; margin-bottom: 20px; }

/* ---- Count badge (table) ---- */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 20px;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

/* ---- Section title ---- */
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ---- Coming soon page ---- */
.coming-soon-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  color: var(--muted);
}
.coming-soon-page .icon { width: 56px; height: 56px; color: var(--muted-l); margin-bottom: 20px; }
.coming-soon-page h2 { font-size: 20px; color: var(--text-2); margin-bottom: 8px; }
.coming-soon-page p { font-size: 14px; max-width: 360px; }

/* ---- Login page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fond noir EAG avec très légère texture */
  background: var(--eag-dark);
  padding: 20px;
}
.login-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  /* Filet rouge en haut de la card de connexion */
  border-top: 4px solid var(--primary);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
/* Emblème rond — vedette de la page de connexion */
.login-emblem {
  height: 72px;
  width: auto;
  margin: 0 auto 14px;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,.12);
}
.login-logo-img {
  height: 36px;
  width: auto;
  margin: 0 auto 10px;
  display: block;
  opacity: .85;
}
.login-logo p {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

/* ---- Utility classes ---- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 12.5px; }

/* ================================================================
   PRODUITS — Fiche entreprise (onglet Produits)
   ================================================================ */

/* Header de groupe saison */
.produit-saison-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.produit-saison-icon { width: 15px; height: 15px; color: var(--primary); flex-shrink: 0; }
.produit-saison-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

/* Ligne produit */
.produit-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid #f3f4f6;
  min-height: 52px;
}
.produit-row:last-child { border-bottom: none; }

/* Barre de couleur catégorie */
.produit-row-color {
  width: 4px;
  align-self: stretch;
  flex-shrink: 0;
}

/* Info produit */
.produit-row-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  min-width: 0;
}
.produit-row-nom {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.produit-row-cat {
  font-size: 11.5px;
  color: var(--muted);
}

/* Quantité */
.produit-row-qte {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  flex-shrink: 0;
}
.produit-qte-num {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.produit-qte-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* Bouton retirer */
.produit-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: 10px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-l);
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
  font-family: inherit;
}
.produit-remove-btn:hover { color: var(--danger); background: var(--danger-bg); }
.produit-remove-btn .icon { width: 14px; height: 14px; }

/* ================================================================
   PRODUIT VIEW — Section entreprises associées
   ================================================================ */

.prod-ent-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Onglets saison */
.prod-saison-tabs {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: var(--radius);
}
.prod-saison-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.prod-saison-tab:hover { color: var(--text); background: rgba(255,255,255,.7); }
.prod-saison-tab--active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.prod-saison-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}
.prod-saison-tab:not(.prod-saison-tab--active) .prod-saison-count {
  background: var(--muted-l);
}

/* Barre de stat */
.prod-ent-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.prod-ent-stat-sep { color: var(--border); }

/* Ligne cliquable */
.produit-row--clickable {
  cursor: pointer;
  transition: background .12s;
}
.produit-row--clickable:hover { background: #f5f5f5; }
.produit-row-edit-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  margin-right: 10px;
  color: var(--muted-l);
  flex-shrink: 0;
  transition: color .15s;
}
.produit-row-edit-hint .icon { width: 14px; height: 14px; }
.produit-row--clickable:hover .produit-row-edit-hint { color: var(--primary); }

/* Bannière produit général (permanente, non-dismissable) */
.produit-general-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  font-size: 13.5px;
  color: #92400e;
  line-height: 1.5;
}
.produit-general-banner svg { margin-top: 2px; color: #d97706; flex-shrink: 0; }

/* ================================================================
   MODALS
   ================================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
/* La confirmation globale passe devant tout, y compris la fenêtre Médiathèque
   (z-index 1200) : une question posée derrière un voile ne se répond pas. */
#confirmModal { z-index: 1300; }

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn .18s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.modal-title .icon { width: 16px; height: 16px; color: var(--primary); }
.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  font-family: inherit;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-close .icon { width: 16px; height: 16px; }

/* La <form> est un enfant direct de .modal — elle doit participer au flex */
.modal > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
/* Un contenu trop haut doit faire DÉFILER le corps de la modale, pas se faire
   écraser : sans ça les blocs se compriment (et .form-section, en overflow:hidden,
   rogne ses champs sans qu'aucune barre de défilement n'apparaisse). */
.modal-body > * { flex-shrink: 0; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: #fafafa;
}
.modal-footer--spread { justify-content: space-between; }

/* Bouton cadenas */
.modal-lock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fafafa;
  cursor: pointer;
  color: var(--muted);
  transition: all .18s;
  flex-shrink: 0;
  font-family: inherit;
}
.modal-lock-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.modal-lock-btn--unlocked {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-bg);
}

/* Bandeau lecture seule */
.modal-locked-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  font-size: 12.5px;
  color: #92400e;
  font-weight: 500;
}
.modal-locked-banner .icon { width: 14px; height: 14px; flex-shrink: 0; }

/* Champs désactivés dans le modal */
.modal-body select:disabled,
.modal-body input:disabled {
  background: #f5f5f5;
  color: var(--muted);
  cursor: not-allowed;
  border-color: var(--border);
  opacity: 1;
}

/* Nom du produit en lecture seule dans le modal édition */
.modal-produit-name {
  padding: 9px 13px;
  background: #f5f5f5;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.produit-loge-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(195,16,23,.09);
  color: var(--primary);
  border: 1px solid rgba(195,16,23,.2);
  margin-left: 5px;
}
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.fw-700 { font-weight: 700; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* ================================================================
   ÉVÉNEMENTS — Nav interne + Dashboard
   ================================================================ */

/* Grille 2 boutons nav */
.ev-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

/* Card nav générique */
.ev-nav-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.ev-nav-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Klub K — fond blanc */
.ev-nav-card--klubk {
  background: #fff;
  border-top: 4px solid var(--primary);
}

/* Petit déj — fond sombre */
.ev-nav-card--petitdej {
  background: var(--eag-dark);
  border-top: 4px solid var(--primary);
}

/* Cartes claires (Autre événement, Salon de l'habitat) — texte foncé sur fond blanc */
.ev-nav-card--light { background: #fff; }
.ev-nav-card--light .ev-nav-title { color: var(--eag-dark, #1b1b22); }
.ev-nav-card--light .ev-nav-sub   { color: var(--muted, #6b7280); }

/* Intérieur de la card */
.ev-nav-card-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px 20px;
  flex: 1;
}

/* Logo Klub K */
.ev-nav-logo {
  height: 72px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.08));
}

/* Icône Petit déj */
.ev-nav-icon-wrap {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

/* Infos à droite de l'icône/logo */
.ev-nav-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ev-nav-title {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  letter-spacing: -.3px;
}
.ev-nav-sub {
  font-size: 13px;
  color: rgba(255,255,255,.55);
  font-weight: 500;
}

/* Badge "X à venir" */
.ev-nav-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(195,16,23,.09);
  color: var(--primary);
  border: 1px solid rgba(195,16,23,.18);
  margin-top: 6px;
  width: fit-content;
}
.ev-nav-badge--dark {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.15);
}

/* Boutons d'action en bas de la card */
.ev-nav-actions {
  display: flex;
  gap: 1px;
  border-top: 1px solid rgba(0,0,0,.08);
}
.ev-nav-card--petitdej .ev-nav-actions { border-top-color: rgba(255,255,255,.08); }

.ev-nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.ev-nav-btn .icon { width: 15px; height: 15px; flex-shrink: 0; }

/* Klub K buttons (fond blanc) */
.ev-nav-btn--list {
  background: #fafafa;
  color: var(--text-2);
  border-right: 1px solid var(--border);
}
.ev-nav-btn--list:hover { background: #f3f4f6; }
.ev-nav-btn--add {
  background: var(--primary);
  color: #fff;
}
.ev-nav-btn--add:hover { background: var(--primary-h); }

/* Petit déj buttons (fond sombre) */
.ev-nav-btn--dark-list {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.75);
  border-right: 1px solid rgba(255,255,255,.08);
}
.ev-nav-btn--dark-list:hover { background: rgba(255,255,255,.1); color: #fff; }
.ev-nav-btn--dark-add {
  background: var(--primary);
  color: #fff;
}
.ev-nav-btn--dark-add:hover { background: var(--primary-h); }

/* ---- Dashboard 2 colonnes ---- */
.ev-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Header de section */
.ev-dash-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ev-dash-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ev-dash-dot--red  { background: var(--primary); }
.ev-dash-dot--dark { background: var(--eag-dark); }
.ev-dash-label {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ev-dash-link {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.ev-dash-link:hover { text-decoration: underline; }
.ev-dash-link .icon { width: 13px; height: 13px; }

/* Lignes d'événements */
.ev-list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
  transition: background .12s;
}
.ev-list-row:last-child { border-bottom: none; }
.ev-list-row:hover { background: #f9fafb; }

/* Bloc date */
.ev-list-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
  flex-shrink: 0;
}
.ev-list-day {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}
.ev-list-month {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: .5px;
}

/* Info centre */
.ev-list-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ev-list-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-list-lieu {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.ev-list-lieu .icon { width: 12px; height: 12px; }

/* Droite */
.ev-list-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.ev-list-heure {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

/* État vide */
.ev-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 20px;
  color: var(--muted-l);
  font-size: 13px;
  text-align: center;
}
.ev-empty .icon { width: 28px; height: 28px; }

/* Responsive */
@media (max-width: 780px) {
  .ev-nav-grid      { grid-template-columns: 1fr; }
  .ev-dashboard-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   MODULE ÉVÉNEMENTS — Formulaire création / édition
   ================================================================ */

/* Layout 2 colonnes : principale + latérale */
.event-form-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
.event-form-main { display: flex; flex-direction: column; gap: 16px; }
.event-form-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--topbar-h) + 16px); }

/* Section card */
.form-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.form-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.form-section-icon { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.form-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.form-section-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: #f0f0ef;
  padding: 2px 8px;
  border-radius: 20px;
}
.form-section-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Boutons de formulaire */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 0 8px;
}

/* ---- Toggle switch ---- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #f9fafb;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
}
.toggle-row-info { display: flex; flex-direction: column; gap: 2px; }
.toggle-label { font-size: 14px; font-weight: 600; color: var(--text); }
.toggle-hint  { font-size: 12px; color: var(--muted); }

.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 24px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ---- Zone upload image ---- */
.upload-zone {
  width: 100%;
  aspect-ratio: 16/9;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s, background .18s;
  background: #f9fafb;
  position: relative;
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone.drag-over { border-color: var(--primary); background: var(--primary-light); border-style: solid; }
.upload-zone--has-img { border-style: solid; border-color: var(--border); }

.upload-zone-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 20px;
  pointer-events: none;
}
.upload-zone-placeholder svg { color: var(--muted-l); }
.upload-zone-hint {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted-l);
  line-height: 1.5;
  margin-top: 2px;
}

/* Aperçu identique au hero : fond flouté + image entière + bandeau titre */
.upload-preview-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(28px) brightness(.55);
  transform: scale(1.15);
}
.upload-preview {
  position: absolute; inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.upload-hero-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 18px 20px;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.05) 55%);
  pointer-events: none;
}
.upload-hero-title {
  color: #fff; font-weight: 900; font-size: 20px;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
  line-height: 1.15;
}

.remove-img-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--danger);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
}
.remove-img-btn:hover { text-decoration: underline; }
.remove-img-btn .icon { width: 14px; height: 14px; }

/* ---- Champs builder ---- */
.champs-builder {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.champ-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s;
}
.champ-row:hover { border-color: #d1d5db; }

.champ-row-grip {
  color: var(--muted-l);
  font-size: 16px;
  cursor: grab;
  padding-top: 8px;
  flex-shrink: 0;
  user-select: none;
}
.champ-row-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.champ-row-fields .champ-options { min-height: 60px; font-size: 13px; }

/* Intitulé · type · aide, sur une ligne qui repasse en colonne sur mobile */
.champ-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.champ-grid .champ-label { flex: 2 1 220px; font-weight: 600; }
.champ-grid .champ-type  { flex: 1 1 150px; }
.champ-grid .form-control:not(.champ-label) { font-size: 12.5px; padding: 7px 9px; }
.champ-grid input[name="champ_aide[]"] { flex: 2 1 220px; color: var(--text-2); }

/* Champ standard : présent sur tous les formulaires, non supprimable */
.champ-row--sys { background: #fff; border-style: dashed; }
.champ-fixe {
  display: inline-flex;
  align-items: center;
  flex: 1 1 150px;
  padding: 7px 9px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--bg-2, #f3f4f6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.champ-badge-sys {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  background: var(--bg-2, #f3f4f6);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}
.champ-requis-label input:disabled + span { color: var(--muted-l); cursor: not-allowed; }

/* Regroupement par portée : entreprise / participant */
.champ-groupe { margin-bottom: 22px; }
.champ-groupe-head { margin-bottom: 10px; }
.champ-groupe-head h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text);
  margin: 0 0 3px;
}
.champ-groupe-head p { font-size: 12.5px; color: var(--muted); margin: 0; }

.champ-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.champ-requis-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  margin-top: 8px;
}
.champ-requis-label input { accent-color: var(--primary); }

.cle-note {
  border-left: 3px solid var(--primary);
  background: var(--bg-2, #f7f8fa);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
}
.cle-note strong { display: block; color: var(--text); margin-bottom: 2px; }
.cle-note--vide { border-left-color: var(--danger, #d33); }
.cle-note--vide strong { color: var(--danger, #d33); }

/* Le réglage lui-même : une liste, donc son état se lit sans rien décoder. */
.cle-label { display: block; margin: 12px 0 4px; font-weight: 700; color: var(--text); font-size: 12.5px; }
.cle-select { max-width: 420px; }
.cle-note--vide .cle-select { border-color: var(--danger, #d33); }
.cle-aide { margin: 8px 0 0; font-size: 12px; line-height: 1.5; }
.cle-aide b { color: var(--text); }

.champ-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
  font-family: inherit;
}
.champ-remove-btn:hover { color: var(--danger); background: var(--danger-bg); }
.champ-remove-btn .icon { width: 14px; height: 14px; }

.add-champ-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  margin-top: 4px;
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: all .15s;
  font-family: inherit;
}
.add-champ-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.add-champ-btn .icon { width: 16px; height: 16px; }

/* Type recap sidebar */
/* ================================================================
   MODULE ÉVÉNEMENTS — Page détail (view)
   ================================================================ */

/* Héro avec couverture */
.event-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 340px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
/* Fond flouté qui remplit le cadre 16:9 (couleurs de l'affiche, sans bandes vides) */
.event-hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(28px) brightness(.55);
  transform: scale(1.15);
}
/* L'affiche affichée EN ENTIER par-dessus, jamais recadrée */
.event-hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.event-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.05) 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 28px;
  color: #fff;
}
/* Logo de l'événement (ou du partenaire qui reçoit) posé en haut du bandeau :
   margin-bottom auto le décolle du bloc titre, aligné en bas par le flex parent. */
.event-hero-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 5px;
  align-self: flex-start;
  margin-bottom: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.event-hero-title {
  font-size: 26px;
  font-weight: 900;
  margin: 8px 0 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.event-hero-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  opacity: .9;
}
.event-hero-meta .icon { width: 14px; height: 14px; }

/* Layout view */
.event-view-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
.event-view-main { display: flex; flex-direction: column; }
.event-view-side  { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--topbar-h) + 16px); }

/* Meta items dans la sidebar */
.event-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.event-meta-item:last-child { border-bottom: none; }
.event-meta-icon {
  width: 32px; height: 32px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}
.event-meta-icon .icon { width: 16px; height: 16px; }
.event-meta-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.event-meta-value { font-size: 13.5px; font-weight: 600; color: var(--text); margin-top: 2px; }
.event-meta-value small { font-size: 11.5px; font-weight: 400; color: var(--muted); }

/* Champs list dans view */
.champ-preview-row {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f9fafb;
  margin-bottom: 6px;
}
.champ-preview-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.champ-preview-label .req { color: var(--primary); }
.champ-preview-type { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.champ-preview-options { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-style: italic; }

/* ================================================================
   Utilitaires supplémentaires
   ================================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.empty-state .icon { width: 36px; height: 36px; color: var(--muted-l); }

.text-muted { color: var(--muted); }
.text-sm    { font-size: 13px; }

/* Responsive form événement */
@media (max-width: 900px) {
  .event-form-layout { grid-template-columns: 1fr; }
  .event-form-side { position: static; }
  .event-view-layout { grid-template-columns: 1fr; }
  .event-view-side  { position: static; }
}

/* ---- Responsive ---- */
/* Burger et voile : n'existent visuellement que sous 900px, où la barre latérale devient un tiroir. */
.topbar-menu-btn { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-252px); transition: transform .25s; width: 252px; }
  .sidebar.open { transform: translateX(0); --sidebar-w: 252px; }
  .page-wrapper { margin-left: 0; }
  .topbar-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-left: -10px; border: 0; border-radius: 8px;
    background: transparent; color: var(--text); cursor: pointer;
  }
  .topbar-menu-btn .icon { width: 24px; height: 24px; }
  .topbar-menu-btn:active { background: var(--bg-2, #f3f4f6); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 190; background: rgba(17,24,39,.45); }
  .sidebar-backdrop[hidden] { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; }
}

/* ================================================================
   DOCUMENTS — Onglet documents entreprise
   ================================================================ */
.doc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s;
}
.doc-card:hover { box-shadow: var(--shadow-sm); }
.doc-card--open { border-color: var(--primary); }

.doc-card-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
}
.doc-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.doc-card-icon .icon { width: 20px; height: 20px; }
.doc-card-info { flex: 1; min-width: 0; }
.doc-card-nom {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.doc-card-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}
.doc-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.doc-badge--type-contrat    { background: #fee2e2; color: #C41E3A; }
.doc-badge--type-avenant    { background: #ffedd5; color: #c2410c; }
.doc-badge--type-bon_commande { background: #dbeafe; color: #1d4ed8; }
.doc-badge--type-rib        { background: #cffafe; color: #0e7490; }
.doc-badge--type-echeancier { background: #ede9fe; color: #6d28d9; }
.doc-badge--type-autre      { background: #f3f4f6; color: #4b5563; }
.doc-badge--duree  { background: #e0e7ff; color: #3730a3; font-weight: 700; }
.doc-badge--saison { background: #f1f5f9; color: #475569; }
.doc-badge--produit { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.doc-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.doc-card-sep { color: var(--border); }
.doc-card-notes {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  font-style: italic;
}
.doc-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 2px;
}
.doc-archive-btn { color: var(--muted); }
.doc-archive-btn:hover { color: var(--danger); background: var(--danger-bg); }

.doc-edit-form {
  padding: 18px 20px;
  background: #f8fafc;
  border-top: 2px solid var(--primary);
}
.doc-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

/* Chips saisons dans le formulaire doc */
.doc-saison-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.doc-saison-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border: 2px solid var(--border);
  border-radius: 30px;
  cursor: pointer;
  transition: all .15s;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: #fff;
  user-select: none;
}
.doc-saison-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.doc-saison-chip.checked { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.doc-saison-chip input[type=checkbox] { display: none; }
.doc-duree-hint {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #3730a3;
  background: #e0e7ff;
  border-radius: 20px;
  padding: 4px 12px;
  display: inline-block;
}

/* Chips produits dans le formulaire doc */
.doc-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.doc-produit-chip {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  overflow: hidden;
  background: #fff;
  user-select: none;
}
.doc-produit-chip:hover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.doc-produit-chip.checked { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 2px var(--primary-light); }
.doc-produit-chip input[type=checkbox] { display: none; }
.doc-produit-chip-color {
  width: 5px;
  align-self: stretch;
  flex-shrink: 0;
}
.doc-produit-chip-body {
  padding: 6px 11px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.doc-produit-chip-nom {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.doc-produit-chip-cat {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
}
.doc-produit-chip.checked .doc-produit-chip-nom { color: var(--primary); }
.doc-produit-chip-check {
  margin-left: auto;
  padding-right: 8px;
  color: var(--primary);
  display: none;
}
.doc-produit-chip.checked .doc-produit-chip-check { display: flex; align-items: center; }

/* ================================================================
   LISTES — Hub & pages de liste
   ================================================================ */

/* Hub : grille de 3 cartes */
.listes-hub-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.listes-hub-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s, border-color .15s, transform .1s;
}
.listes-hub-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.listes-hub-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.listes-hub-card-icon .icon { width: 22px; height: 22px; }

.listes-hub-card--klubk .listes-hub-card-icon   { background: #f3f4f6; }
.listes-hub-card--partenaires .listes-hub-card-icon { background: #fee2e2; color: #C41E3A; }
.listes-hub-card--horaires .listes-hub-card-icon { background: #dbeafe; color: #2563eb; }

.listes-hub-card-body { flex: 1; min-width: 0; }
.listes-hub-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
}
.listes-hub-card-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.listes-hub-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.listes-hub-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: #f3f4f6;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.listes-hub-saison {
  font-size: 12px;
  color: var(--muted);
}
.listes-hub-card-arrow {
  color: var(--muted-l);
  flex-shrink: 0;
}
.listes-hub-card-arrow .icon { width: 18px; height: 18px; }

/* Nav interne (subnav) présente sur chaque page liste */
.listes-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.listes-subnav-back {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.listes-subnav-back:hover { color: var(--text); }
.listes-subnav-back .icon { width: 14px; height: 14px; transform: rotate(180deg); }

/* Lignes entreprise + sous-lignes contacts */
.liste-ent-row td { border-bottom: none; padding-bottom: 6px; }
.liste-contact-row { background: transparent; }
.liste-contact-row:last-child td,
.liste-contact-row + .liste-ent-row td { border-top: 1px solid var(--border); }
.liste-contact-cell {
  padding: 2px 18px 3px 18px !important;
  border-bottom: none;
}
.liste-contact-bullet {
  color: var(--muted-l);
  font-size: 12px;
  margin-right: 6px;
}
.liste-contact-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-right: 10px;
}
.liste-contact-email {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}
.liste-contact-email:hover { color: var(--primary); text-decoration: underline; }

/* En-tête de page liste avec sélecteur saison */
.listes-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ======================================================
   COMMERCIAUX — PASTILLE ET AVATAR
   ====================================================== */
.commercial-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  border: 2px solid rgba(0,0,0,.08);
  transition: background .2s;
}
.commercial-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 5px;
}

/* ======================================================
   CHANGEMENT DE MOT DE PASSE
   ====================================================== */
.pwd-strength-track {
  height: 5px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 4px;
}
.pwd-strength-fill {
  height: 100%;
  border-radius: 10px;
  width: 0;
  transition: width .3s, background .3s;
}
.pwd-strength-label {
  font-size: 11.5px;
  font-weight: 600;
}

/* ======================================================
   ADMINISTRATION — GESTION UTILISATEURS
   ====================================================== */

/* Légende des rôles */
.admin-role-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.admin-role-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.admin-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.admin-role-sections {
  color: var(--muted);
  white-space: nowrap;
}

/* Avatar utilisateur */
.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.admin-self-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  background: #e0e7ff;
  color: #3730a3;
  padding: 1px 7px;
  border-radius: 20px;
  margin-left: 5px;
  vertical-align: middle;
}

/* Ligne inactif */
.admin-user-inactive td { opacity: .5; }

/* Toggle actif/inactif */
.admin-toggle-btn {
  display: inline-flex;
  align-items: center;
  width: 36px;
  height: 20px;
  border-radius: 20px;
  background: #d1d5db;
  padding: 2px;
  cursor: pointer;
  border: none;
  transition: background .2s;
  position: relative;
}
.admin-toggle-btn.active { background: #16a34a; }
.admin-toggle-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.admin-toggle-btn.active .admin-toggle-dot { transform: translateX(16px); }

/* ======================================================
   LOGOS ENTREPRISES / PARTENAIRES
   ====================================================== */

/* Logo affiché en lecture (liste, fiche) */
.ent-logo {
  display: block;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  flex-shrink: 0;
}
.ent-logo-xs  { width: 36px;  height: 36px; }
.ent-logo-sm  { width: 48px;  height: 48px; }
.ent-logo-md  { width: 64px;  height: 64px; }
.ent-logo-lg  { width: 88px;  height: 88px; padding: 6px; }

/* Placeholder initiales quand pas de logo */
.ent-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
  letter-spacing: .5px;
}
.ent-logo-placeholder.ent-logo-xs  { width: 36px;  height: 36px; font-size: 12px; }
.ent-logo-placeholder.ent-logo-sm  { width: 48px;  height: 48px; font-size: 14px; }
.ent-logo-placeholder.ent-logo-md  { width: 64px;  height: 64px; font-size: 18px; }
.ent-logo-placeholder.ent-logo-lg  { width: 88px;  height: 88px; font-size: 24px; }

/* Zone d'upload logo dans le formulaire */
.logo-upload-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.logo-current-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.logo-current-label {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}
.logo-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: center;
  background: #fff;
}
.logo-upload-zone:hover,
.logo-upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.logo-upload-zone input[type=file] { display: none; }
.logo-upload-icon { color: var(--muted); }
.logo-upload-label { font-size: 13px; font-weight: 600; color: var(--text); }
.logo-upload-hint  { font-size: 11.5px; color: var(--muted); }
.logo-preview-wrap {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.logo-preview-wrap.visible { display: flex; }
.logo-preview-img {
  max-height: 80px;
  max-width: 200px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  background: #fff;
}
.logo-preview-name { font-size: 11.5px; color: var(--muted); }

/* Ligne partenaire avec logo dans la liste */
.partenaire-logo-cell {
  width: 52px;
  padding-right: 0;
}
.partenaire-row-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Ligne de tableau cliquable */
tr.tr-clickable { cursor: pointer; }
tr.tr-clickable:hover td { background: var(--primary-light); }

/* ============================================================
   KAP LA VIE — Section mécénat
   ============================================================ */

/* Stat cards dans l'en-tête */
.klv-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  min-width: 100px;
  box-shadow: var(--shadow-sm);
}
.klv-stat-card--accent {
  background: linear-gradient(135deg, #7c3aed11, #7c3aed08);
  border-color: #7c3aed33;
}
.klv-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.klv-stat-card--accent .klv-stat-num { color: #7c3aed; }
.klv-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 3px;
}

/* Badge année (ex : 2025-2026) */
.klv-annee-badge {
  display: inline-block;
  background: #7c3aed18;
  color: #7c3aed;
  border: 1px solid #7c3aed30;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* ===== Mode Maintenance ===== */
.maintenance-overlay {
  position: fixed;
  inset: 0 0 0 var(--sidebar-w, 252px);
  z-index: 150;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}
.maintenance-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px 48px;
  max-width: 400px;
  width: calc(100% - 48px);
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
}
.maintenance-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #fef2f2;
  color: var(--primary, #C41E3A);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.maintenance-box h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--text);
}
.maintenance-box p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0 0 20px;
}
.maintenance-chip {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
}

/* ===== Settings Toggle Switch ===== */
.settings-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.settings-toggle input { opacity: 0; width: 0; height: 0; }
.settings-toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 26px;
  transition: background .2s;
}
.settings-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.settings-toggle input:checked + .settings-toggle-slider { background: var(--primary, #C41E3A); }
.settings-toggle input:checked + .settings-toggle-slider::before { transform: translateX(22px); }

/* ===== Add Product Modal — Category Cards ===== */
.add-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}
.add-cat-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: border-color .15s, background .15s;
  text-align: left;
  width: 100%;
}
.add-cat-card:hover {
  border-color: var(--cat-color, var(--primary));
  background: var(--bg-2);
}
.add-cat-card.selected {
  border-color: var(--cat-color, var(--primary));
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--cat-color, var(--primary));
}
.add-cat-card__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.add-cat-divider {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 6px 0 2px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ===== Add Product Modal — Product List ===== */
.add-prod-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 200px;
  overflow-y: auto;
}
.add-prod-item {
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid var(--border);
}
.add-prod-item:last-child { border-bottom: none; }
.add-prod-item:hover { background: var(--bg-2); }
.add-prod-item.selected {
  background: #fef2f2;
  color: var(--primary, #C41E3A);
  font-weight: 600;
}

/* ===== Naming badge on product row ===== */
.produit-naming-badge {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  font-size: 10.5px;
  padding: 1px 6px;
  margin-left: 2px;
}
.produit-naming-badge--hosp {
  background: #fdf4ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}
.add-prod-item--taken {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.add-prod-taken-badge {
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 1px 6px;
  flex-shrink: 0;
}

/* ============================================================
   PACK FINITIONS — ajouts globaux (accessibilité + polish).
   Additif : ne modifie aucune règle existante.
   ============================================================ */

/* Anneau de focus clavier propre (n'apparaît qu'au clavier, pas à la souris) */
:root { --ring: rgba(195,16,23,.45); }
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.tab-btn:focus-visible,
.sidebar-nav a:focus-visible,
.sidebar-chat-btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Boutons désactivés — état unifié */
.btn:disabled,
.btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none !important;
  pointer-events: none;
}

/* Retour tactile au clic */
.btn:not(:disabled):active { transform: translateY(1px); }

/* Ombre du bouton primaire alignée sur la couleur de marque réelle */
.btn-primary:hover { box-shadow: 0 4px 12px var(--ring); }

/* Sélection de texte aux couleurs du thème */
::selection { background: var(--primary); color: #fff; }

/* Scrollbar fine et discrète (cohérente sur tout le CRM) */
* { scrollbar-width: thin; scrollbar-color: #c7c7cc transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c7c7cc; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a8a8af; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Respect de la préférence « mouvement réduit » */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Badges statut de licence (module bénévoles) ---- */
.licence-badge{display:inline-block;padding:3px 11px;border-radius:99px;font-size:12px;font-weight:700;line-height:1.4}
.licence-valide{background:#dcfce7;color:#15803d}
.licence-encours{background:#fef3c7;color:#92400e}
.licence-renouveler{background:#ffedd5;color:#9a3412}
.licence-expiree{background:#fee2e2;color:#b91c1c}
.licence-refusee{background:#fee2e2;color:#b91c1c}
.licence-none{background:#f3f4f6;color:#6b7280}

/* ---- Éditeur habillage (aperçu / code) — paramétrage des événements ---- */
.tpl-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px;flex-wrap:wrap}
.tpl-actions{display:flex;align-items:center;gap:8px}
/* Verrou du gabarit : coché, le code s'édite. Décoché, il se lit. */
/* Verrou commun au HTML et au CSS : un seul geste ouvre les deux volets à l'écriture.
   Interrupteur plutôt que case à cocher, on lit son état sans le chercher. */
.tpl-edit{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;font-weight:600;
          color:var(--text-muted);cursor:pointer;user-select:none;margin-right:2px}
.tpl-edit input{position:absolute;opacity:0;width:0;height:0}
.tpl-piste{width:38px;height:22px;border-radius:11px;background:#d1d5db;position:relative;
           flex:0 0 auto;transition:background .18s ease}
.tpl-piste::after{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;
                  background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.28);transition:transform .18s ease}
.tpl-edit input:checked + .tpl-piste{background:var(--red)}
.tpl-edit input:checked + .tpl-piste::after{transform:translateX(16px)}
.tpl-edit input:focus-visible + .tpl-piste{outline:2px solid var(--red);outline-offset:2px}
.tpl-edit input:checked ~ .tpl-mot{color:var(--red);font-weight:700}
.tpl-edit--bloc{display:block;margin-top:10px;font-weight:500;color:var(--text-muted)}
.tpl-edit--bloc input{position:static;opacity:1;width:15px;height:15px;
                      accent-color:var(--red);vertical-align:-2px;margin-right:5px}
.seg{display:inline-flex;border:1px solid var(--border,#e5e7eb);border-radius:8px;overflow:hidden;background:#fff}
/* Largeur libre : les libellés « Aperçu / HTML / CSS » sont plus clairs que des
   pictogrammes seuls, personne ne devine ce que montre un </> . */
.seg-btn{display:flex;align-items:center;justify-content:center;gap:5px;min-width:36px;height:32px;
         padding:0 11px;border:0;background:#fff;color:#6b7280;cursor:pointer;font-size:12.5px;font-weight:600}
.seg-btn + .seg-btn{border-left:1px solid var(--border,#e5e7eb)}
.seg-btn svg{width:17px;height:17px}
.seg-btn:hover{background:#f3f4f6;color:#111}
.seg-btn.is-on{background:#111827;color:#fff}
/* Aperçu et volets de code à la même hauteur : basculer de l'un à l'autre ne doit pas
   faire sauter la page. On prend la hauteur de l'écran, pas 640 px fixes : lire du HTML
   dans une fenêtre plus courte que l'écran, c'est passer son temps à faire défiler. */
.tpl-frame,.tpl-code{height:min(80vh,1100px)}
.tpl-frame{display:block;width:100%;border:1px solid var(--border,#e5e7eb);border-radius:8px;background:#fff}
.tpl-frame--vide{display:flex;align-items:center;justify-content:center;text-align:center;padding:24px;color:#6b7280;font-size:13px;background:#f9fafb}
/* Lignes repliées dans les deux états : une balise longue ne doit pas imposer un
   défilement horizontal, et basculer le verrou ne doit pas remettre en page le code. */
.tpl-code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;
          line-height:1.55;white-space:pre-wrap;word-break:break-word;overflow:auto;resize:vertical}
/* Verrouillé : lisible, mais on voit qu'on n'y touche pas. */
.tpl-code[readonly]{background:#f9fafb;color:#374151;cursor:default}
.form-hint .icon,.form-hint svg{width:14px;height:14px;vertical-align:-2px}

/* ---- Médiathèque (page + modale de sélection) ---- */
.ml-page{margin-top:4px}
.ml{display:grid;grid-template-columns:210px minmax(0,1fr);gap:18px;position:relative;
    background:var(--card,#fff);border:1px solid var(--border,#e5e7eb);border-radius:12px;padding:16px}
.ml:has(#mlDetail:not([hidden])){grid-template-columns:210px minmax(0,1fr) 300px}
.ml-side{display:flex;flex-direction:column;gap:4px;min-width:0}
.ml-dos{display:flex;align-items:center;gap:6px;width:100%;text-align:left;border:0;background:transparent;
        padding:8px 10px;border-radius:8px;font-size:13px;color:#374151;cursor:pointer}
.ml-dos:hover{background:#f3f4f6}
.ml-dos.is-on{background:#111827;color:#fff}
.ml-n{margin-left:auto;font-size:11px;opacity:.6}
.ml-dos-x{opacity:0;padding:0 2px;font-size:15px;line-height:1}
@media (hover:none){.ml-dos-x{opacity:.5}}
.ml-dos:hover .ml-dos-x{opacity:.5}
.ml-dos-x:hover{opacity:1;color:#b91c1c}
.ml-add{border:1px dashed var(--border,#e5e7eb);background:transparent;border-radius:8px;padding:8px;
        font-size:12.5px;color:#6b7280;cursor:pointer;margin-top:6px}
.ml-add:hover{border-color:#9ca3af;color:#111}
.ml-note{font-size:11.5px;color:#6b7280;line-height:1.5;margin:10px 0 0}
.ml-main{min-width:0}
.ml-bar{display:flex;gap:10px;align-items:center;margin-bottom:12px}
.ml-bar .form-control{max-width:320px}
.ml-import{cursor:pointer;margin:0}
.ml-grille{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:10px;
           max-height:60vh;overflow:auto;padding:2px}
.ml-grille.is-busy{opacity:.5;pointer-events:none}
.ml-item{border:1px solid var(--border,#e5e7eb);background:#fff;border-radius:10px;padding:0;overflow:hidden;
         cursor:pointer;display:flex;flex-direction:column;text-align:left}
.ml-item img{width:100%;aspect-ratio:1/1;object-fit:cover;display:block;background:#f9fafb}
.ml-item.is-on{outline:2px solid #111827;outline-offset:1px}
.ml-nom{font-size:11.5px;padding:6px 8px;color:#374151;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ml-pdf{display:flex;align-items:center;justify-content:center;aspect-ratio:1/1;background:#fef2f2;
        color:#b91c1c;font-weight:800;font-size:13px;letter-spacing:.06em}
.ml-vide{grid-column:1/-1;color:#6b7280;font-size:13px;padding:26px;text-align:center}
.ml-drop{position:absolute;inset:0;display:none;align-items:center;justify-content:center;
         background:rgba(255,255,255,.92);border:2px dashed #9ca3af;border-radius:12px;
         font-weight:700;color:#374151;pointer-events:none;z-index:3}
.ml-drop.is-on{display:flex}
.ml-detail{min-width:0;border-left:1px solid var(--border,#e5e7eb);padding-left:16px}
.ml-detail label{display:block;font-size:11.5px;font-weight:700;color:#6b7280;margin:12px 0 4px}
.ml-apercu img{width:100%;max-height:190px;object-fit:contain;background:#f9fafb;border-radius:8px}
.ml-meta{font-size:11.5px;color:#6b7280;margin:8px 0 0}
.ml-url{font-size:11.5px;font-family:ui-monospace,Menlo,Consolas,monospace}
.ml-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px}
.ml-suppr{color:#b91c1c}
.ml-choisir{width:100%;margin-top:12px}

/* Modale */
.ml-fond{position:fixed;inset:0;background:rgba(17,24,39,.55);z-index:1200;display:flex;
         align-items:center;justify-content:center;padding:24px}
.ml-fenetre{background:#fff;border-radius:14px;width:min(1180px,100%);max-height:92vh;overflow:auto;
            box-shadow:0 24px 60px rgba(0,0,0,.28)}
.ml-tete{display:flex;align-items:center;gap:10px;padding:14px 18px;border-bottom:1px solid var(--border,#e5e7eb)}
.ml-tete-sub{font-size:12px;color:#6b7280}
.ml-x{margin-left:auto;border:0;background:transparent;font-size:24px;line-height:1;color:#6b7280;cursor:pointer}
.ml--modale{border:0;border-radius:0}

.event-type-recap { overflow: hidden; }
.event-type-recap-header {
  padding: 12px 16px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

/* Champ visuel d'un formulaire */
.mf{margin-bottom:18px}
/* Le duo aperçu + boutons passe à la ligne quand la colonne est étroite : figé côte à
   côte, il débordait de la carte latérale et le bouton se retrouvait coupé au bord. */
.mf-box{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-start}
.mf-vue{flex:0 1 190px;max-width:100%;max-height:180px;border:1px solid var(--border,#e5e7eb);
        border-radius:10px;overflow:hidden;background:#f9fafb;display:flex;align-items:center;
        justify-content:center;color:#9ca3af;font-size:12px}
.mf-vue img{width:100%;height:100%;object-fit:contain}
.mf-act{display:flex;flex-direction:column;gap:6px;flex:1 1 130px}
.mf-act .btn{white-space:nowrap}
@media (max-width:900px){
  .ml,.ml:has(#mlDetail:not([hidden])){grid-template-columns:1fr}
  .ml-detail{border-left:0;padding-left:0;border-top:1px solid var(--border,#e5e7eb);padding-top:14px}
}

/* Aide aux variables d'un email paramétrable : cliquer une puce copie le repère. */
/* Texte riche des emails : barre d'outils, zone éditable, variables cliquables. */
.tr-bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:6px}
.tr-bar button{background:var(--bg-2,#f3f4f6);border:1px solid var(--border,#e5e7eb);border-radius:5px;
  padding:3px 9px;font-size:13px;line-height:1.5;color:var(--text,#111);cursor:pointer}
.tr-bar button:hover{border-color:var(--primary,#e30613)}
.tr-bar .tr-teinte{width:20px;height:20px;padding:0;border-radius:50%;border:1px solid rgba(0,0,0,.25)}
.tr-vars{display:flex;flex-wrap:wrap;gap:4px;margin-left:auto}
.tr-vars code{background:var(--bg-2,#f3f4f6);border:1px solid var(--border,#e5e7eb);border-radius:5px;
  padding:2px 6px;font-size:11px;cursor:pointer}
.tr-vars code:hover{border-color:var(--primary,#e30613)}
.tr-zone{min-height:64px;height:auto;line-height:1.6}
.tr-zone:empty:before{content:attr(data-ph);color:var(--muted,#6b7280)}

.pf-vars{display:flex;flex-wrap:wrap;gap:6px}
.pf-vars code{background:var(--bg-2,#f3f4f6);border:1px solid var(--border,#e5e7eb);border-radius:5px;
              padding:3px 7px;font-size:11.5px;cursor:pointer}
.pf-vars code:hover{border-color:var(--primary,#e30613)}
.pf-vars code.is-copie{background:var(--primary,#e30613);border-color:var(--primary,#e30613);color:#fff}

/* ── Paramétrage des événements : page à rail latéral ──────────────────────
   Une seule section visible à la fois. Les autres restent dans le DOM, donc
   dans le formulaire : masquer n'est pas désactiver, tout part à l'envoi. */
.pfx{display:grid;grid-template-columns:248px minmax(0,1fr);gap:22px;align-items:start}
.pfx-rail{position:sticky;top:78px;background:var(--card,#fff);border:1px solid var(--border,#e5e7eb);
          border-radius:12px;padding:8px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.pfx-grp{font-size:10.5px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;
         color:var(--text-2,#6b7280);padding:12px 12px 6px}
.pfx-rail .pfx-grp:first-child{padding-top:6px}
.pfx-lien{display:flex;align-items:center;gap:9px;width:100%;padding:9px 11px;border:0;border-radius:8px;
          background:none;font:inherit;font-size:13px;font-weight:600;color:var(--text,#111);
          text-align:left;cursor:pointer;line-height:1.3}
.pfx-lien svg{width:17px;height:17px;flex-shrink:0;color:var(--text-2,#6b7280)}
.pfx-lien:hover{background:var(--bg-2,#f3f4f6)}
.pfx-lien.is-on{background:var(--eag-dark,#1b1b22);color:#fff}
.pfx-lien.is-on svg{color:#fff}
.pfx-panes > .form-section{display:none}
.pfx-panes > .form-section.is-on{display:block;animation:pfx-fondu .18s ease-out}
@keyframes pfx-fondu{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

/* Barre d'enregistrement : toujours atteignable, quelle que soit la longueur de la section. */
.pfx-barre{position:sticky;bottom:0;z-index:20;display:flex;align-items:center;gap:12px;flex-wrap:wrap;
           margin-top:20px;padding:12px 16px;background:var(--card,#fff);
           border:1px solid var(--border,#e5e7eb);border-radius:12px;
           box-shadow:0 -4px 18px rgba(15,23,42,.07)}
.pfx-etat{font-size:12.5px;color:var(--text-2,#6b7280);margin-left:auto}
.pfx-etat.is-modif{color:var(--primary,#e30613);font-weight:700}

@media (max-width:980px){
  .pfx{grid-template-columns:1fr}
  .pfx-rail{position:static;display:flex;flex-wrap:wrap;gap:4px}
  .pfx-grp{width:100%;padding:8px 6px 2px}
  .pfx-lien{width:auto}
}

/* Couleurs de maillot du challenge : la pastille bicolore et ses deux sélecteurs. */
.chc{display:flex;align-items:center;gap:10px}
.chc input[type=color]{width:44px;height:32px;padding:2px;border:1px solid var(--border,#e5e7eb);
  border-radius:8px;background:#fff;cursor:pointer}
.chc-vue{display:inline-block;border-radius:99px;border:1px solid rgba(0,0,0,.18);flex-shrink:0}

/* Médiathèque : un document ou une archive (ni image ni PDF) porte un badge sobre. */
.ml-pdf.ml-doc{background:#f3f4f6;color:#4b5563;font-size:12px}


/* ================================================================
   MOBILE — règles communes (téléphone ≤ 560px, tiroir ≤ 900px, tactile)
   Rien n'est masqué : tout ce qui existe sur grand écran reste accessible.
   ================================================================ */
/* Topbar : un fil d'Ariane long se coupe par une ellipse au lieu de pousser la date et l'emblème. */
.topbar-left { min-width: 0; flex: 1; }
.breadcrumb { overflow: hidden; white-space: nowrap; min-width: 0; }
.breadcrumb .current, .topbar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { flex-shrink: 0; }
/* Rangées de boutons : passer à la ligne plutôt que sortir de la carte. */
.card-header, .modal-footer, .form-actions, .ml-bar, .pagination { flex-wrap: wrap; }
.page-gap { padding: 0 4px; color: var(--muted-l); }
/* Onglets : défilement horizontal quand ils ne tiennent pas. */
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn { flex-shrink: 0; white-space: nowrap; }
/* Modales : le fond ne défile pas derrière. */
.modal-overlay, .modal-body { overscroll-behavior: contain; }
.table-wrap { -webkit-overflow-scrolling: touch; }

@media (max-width: 900px) {
  .sidebar { padding-bottom: env(safe-area-inset-bottom); }
  .page-wrapper { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .dash-2col { grid-template-columns: 1fr !important; }
}
@media (max-width: 560px) {
  .topbar-right .text-sm { display: none; } /* la date du jour, redondante avec l'horloge du téléphone */
  .card-body, .card-header, .card-footer, .stat-card { padding: 14px 16px; }
  .pagination { padding: 12px 16px; }
  /* Modales en feuille bas d'écran, pleine largeur. */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: none; border-radius: 14px 14px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  .pfx-barre { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
/* Tactile : cibles ≥ 40px, pas de zoom iOS au focus (police < 16px), pas d'état survol collé. */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]),
  select, textarea, [contenteditable="true"] { font-size: 16px !important; }
  .btn-icon, .modal-close, .page-btn, .logout-btn, .chat-panel-header button, .chat-conv-header button,
  .btn-sm, .tr-bar button { min-width: 40px; min-height: 40px; }
  .nav-group-hd { padding: 12px 14px; }
  .sidebar-nav a, .sidebar-chat-btn { padding-top: 11px; padding-bottom: 11px; }
  .btn { min-height: 40px; }
}
@media (hover: none) {
  .stat-card:hover, .dashboard-big-card:hover, .ev-nav-card:hover { transform: none; }
}

/* ---- Règles transverses pour les pages : grilles et rangées posées en style inline ---- */
/* ≈40 pages posent leurs colonnes en style="grid-template-columns:1fr 340px" : une seule règle
   les empile sur téléphone et les met à deux colonnes égales sur tablette, sans toucher au PHP.
   Les grilles déjà fluides (auto-fit / auto-fill) sont laissées telles quelles. */
@media (max-width: 780px) {
  .content [style*="grid-template-columns"]:not([style*="auto-fi"]) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 560px) {
  .content [style*="grid-template-columns"]:not([style*="auto-fi"]) { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 900px) {
  /* Rangées de boutons/filtres en display:flex inline : à la ligne plutôt que hors écran. */
  .content [style*="display:flex"]:not([style*="flex-direction:column"]):not([style*="flex-direction: column"]),
  .content [style*="display: flex"]:not([style*="flex-direction:column"]):not([style*="flex-direction: column"]) { flex-wrap: wrap; }
  /* Tableaux : la colonne d'actions reste visible pendant le défilement horizontal. */
  .table-wrap td:last-child:has(.btn, .btn-icon, .td-actions) { position: sticky; right: 0; background: var(--card); box-shadow: -6px 0 8px -6px rgba(0,0,0,.15); }
  .table-wrap:has(td:last-child .btn, td:last-child .btn-icon, td:last-child .td-actions) th:last-child { position: sticky; right: 0; background: #fafafa; }
  .doc-edit-grid { grid-template-columns: 1fr; }
  .doc-card { flex-wrap: wrap; }
  .produit-row-nom { white-space: normal; }
  .toolbar select, .toolbar input[type=text], .toolbar input[type=search] { flex: 1 1 140px; min-width: 0 !important; width: auto !important; }
}
/* Modales maison des pages (création événement, match, défi) : hauteur bornée et défilement interne. */
.ev-create-box, .sn-modal-box, .ch-box, .cg-modal-box, .psm, [id$="-modal"] > div { max-height: calc(100dvh - 40px); overflow-y: auto; }
/* Sensations natives : pas de flash gris au tap ni de feuille d'aperçu Safari à l'appui long sur les boutons. */
html { -webkit-text-size-adjust: 100%; }
a, button, .btn, .btn-icon, .sidebar-nav a { -webkit-tap-highlight-color: transparent; }
.btn, .btn-icon, .sidebar-nav a, .tab-btn { -webkit-touch-callout: none; }
body:has(.modal-overlay.active, .modal-overlay[style*="flex"], [id$="-modal"][style*="flex"], .cg-modal.open, .psm-overlay[style*="flex"]) { overflow: hidden; }
/* Listes de suggestions (doublons, liaison contact) : ne pas passer sous le clavier virtuel. */
#dup-dropdown, #cAddResults, #lnkResults, .suggest-box { max-height: 40dvh; overflow: auto; }
/* Barres fixes en bas d'écran : au-dessus de la barre iPhone. */
#point-bar, #crm-imp-bar { padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important; }
@media (max-width: 560px) { .inv-card-team { max-width: none !important; } }
