body {
  margin: 0;
  /* Pour enlever les marges par défaut du body */
  padding: 0;
  /* Pour enlever les marges internes par défaut du body */
  min-height: 100vh;
  /* 100% de la hauteur de la vue */
  background: linear-gradient(to bottom, #ff8400, #f64200);
  font-family: "Helvetica";
}

.logo {
  max-width: 8rem;
  margin-bottom: 1rem;
}

.contact-wrap {
  -webkit-box-shadow: 0 0px 20px 0 rgba(0, 0, 0, 0.2);
  box-shadow: 0 0px 20px 0 rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.93);
  border-radius: 7px;
}

/* Sur mobile, les form bodies (.contact-wrap.p-5) passent de 3rem à 2rem
   pour gagner de la largeur utile. Bootstrap met `padding:3rem !important`
   sur .p-5, donc on a besoin de !important + d'une spécificité >10 (le
   sélecteur .contact-wrap.p-5 = 20). En desktop la media query ne s'active
   pas et .p-5 reste à 3rem.
   Les headers (.contact-wrap.p-4) ne sont pas matchés et restent à 1.5rem. */
@media (max-width: 767.98px) {
  .contact-wrap.p-5 {
    padding: 2rem !important;
  }
}

.addButton {
  width: 11rem;
  font-size: 0.9rem;
  padding: 5px 10px;
  border: 2px solid #48C6B6;
  background: #48C6B6 !important;
  border-color: #48C6B6 !important;
}

.radio-toolbar input[type="radio"] {
  opacity: 0;
  position: fixed;
  width: 0;
}

.radio-toolbar label {
  font-size: 0.9rem;
  display: inline-block;
  color: black;
  min-width: 11rem;
  text-align: center;
  padding: 5px 10px;
  border: 2px solid #283167;
  border-radius: 26px;
  margin-bottom: 5px;
}

.radio-toolbar input[type="radio"]:checked+label {
  background-color: #283167;
  color: white;
  border-color: #283167;
}

.radio-toolbar input[type="radio"]:focus+label {
  border: 2px solid #283167;
}

.radio-toolbar label:hover {
  background-color: white;
}

.civilite {
  min-width: 4.2rem !important;
}

.form-control {
  border: 1px solid rgba(0, 0, 0, 0.26);
  background: none;
}

.form-control:active,
.form-control:focus {
  outline: none;
  -webkit-box-shadow: none;
  box-shadow: none;
  border-color: #000;
}

.col-form-label {
  color: #444444;
  font-size: 13px;
}

.select2 {
  width: 100% !important;
}

.select2-container--default .select2-selection--multiple {
  background-color: transparent !important;
}

.select2-container--default .select2-search--inline .select2-search__field {
  min-height: 1.6rem !important;
}

.select2-container .select2-search--inline .select2-search__field {
  font-size: 96% !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  width: 98% !important;
  background-color: #48C6B6 !important;
  color: white !important;
  border: 1px solid #283167 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: #283167 !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: #283167 !important;
}

.select2-container--default .select2-results__option--selected {
  color: white !important;
  background-color: #48C6B6 !important;
}

.select2-container--default .select2-selection--single {
  background-color: transparent !important;
  min-height: 2.4rem !important;
  padding: 4px !important;
  font-size: 96% !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  margin-top: 2px !important;
}

.validate {
  margin-top: 1rem;
  letter-spacing: .3rem;
  text-transform: uppercase;
  background-color: #ff8400 !important;
  border-color: #ff9900 !important;
}

.validate:hover {
  background-color: #ff9900 !important;
  border-color: #ff8400 !important;
}

.esh-color {
  color: white !important;
  background-color: #ff8400 !important;
  border-color: #ff9900 !important;
}

.esh-color:hover {
  background-color: #ff9900 !important;
  border-color: #ff8400 !important;
}

/* =================================================================
   Back Office Design System — Phase 4
   -----------------------------------------------------------------
   Classes `.bo-*` superposées à Bootstrap 5. Utilisées par les pages
   modernes (crm/index.php, polls.php, poll.php) sans casser celles qui
   utilisent encore .contact-wrap / .validate / .esh-color (qui restent
   en place pour la rétrocompatibilité).
   ================================================================= */

:root {
  --bo-orange:        #ff8400;
  --bo-orange-light:  #ffa033;
  --bo-orange-soft:   rgba(255, 132, 0, 0.10);
  --bo-text:          #1a1a1a;
  --bo-text-muted:    #6c757d;
  --bo-card-bg:       #ffffff;
  --bo-card-shadow:   0 4px 16px rgba(0, 0, 0, 0.08);
  --bo-card-shadow-h: 0 8px 24px rgba(0, 0, 0, 0.14);
  --bo-radius:        12px;
}

/* --- Carte blanche réutilisable (équivalent moderne de .contact-wrap) --- */
.bo-card {
  background: var(--bo-card-bg);
  border-radius: var(--bo-radius);
  box-shadow: var(--bo-card-shadow);
  padding: 1.5rem;
}

.bo-card-tight { padding: 1rem; }

/* Panneau d'export Excel — <details> natif, fermé par défaut. */
.bo-export > .bo-export-summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1.1rem;
  border: 1px solid #198754;
  color: #198754;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  font-weight: 500;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.bo-export > .bo-export-summary::-webkit-details-marker { display: none; }
.bo-export > .bo-export-summary:hover { background: #198754; color: #fff; }
.bo-export[open] > .bo-export-summary { background: #198754; color: #fff; }

/* Titre de section sur fond orange (texte blanc) */
.bo-section-title {
  color: white;
  margin: 1.75rem 0 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.bo-section-title .badge {
  font-size: 0.72rem;
}

/* --- Grille de tuiles pour le hub CRM ---
   1 col mobile / 2 col tablette / 3 col desktop. */
.bo-tile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 576px) {
  .bo-tile-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

@media (min-width: 992px) {
  .bo-tile-grid { grid-template-columns: repeat(3, 1fr); }
}

.bo-tile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: var(--bo-card-bg);
  border-radius: var(--bo-radius);
  box-shadow: var(--bo-card-shadow);
  text-decoration: none;
  color: var(--bo-text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  min-height: 84px;
}

.bo-tile:hover,
.bo-tile:focus {
  transform: translateY(-2px);
  box-shadow: var(--bo-card-shadow-h);
  color: var(--bo-text);
  text-decoration: none;
}

.bo-tile-icon {
  font-size: 1.6rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bo-orange-soft);
  border-radius: 50%;
  flex-shrink: 0;
}

.bo-tile-text   { flex: 1; min-width: 0; }
.bo-tile-title  { font-weight: 600; font-size: 1rem; line-height: 1.2; }
.bo-tile-desc   { font-size: 0.78rem; color: var(--bo-text-muted); line-height: 1.3; margin-top: 0.15rem; }

.bo-tile-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  background: var(--bo-orange);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}

/* Tuile "urgente" (pleine couleur, pour le bouton Voter actif) */
.bo-tile-urgent {
  background: linear-gradient(135deg, var(--bo-orange), #ff6a00);
  color: white;
}

.bo-tile-urgent:hover,
.bo-tile-urgent:focus {
  color: white;
  background: linear-gradient(135deg, var(--bo-orange-light), var(--bo-orange));
}

.bo-tile-urgent .bo-tile-icon { background: rgba(255, 255, 255, 0.22); }
.bo-tile-urgent .bo-tile-desc { color: rgba(255, 255, 255, 0.92); }
.bo-tile-urgent .bo-tile-badge { background: white; color: var(--bo-orange); }

/* --- Toolbar du header (Mon profil / logout) --- */
.bo-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* --- Pile horizontale d'actions sous une carte --- */
.bo-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* --- <details><summary> stylisé en toggle (cardable) --- */
.bo-collapsible > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}
.bo-collapsible > summary::-webkit-details-marker { display: none; }
.bo-collapsible[open] > summary > .bo-collapse-chevron::before     { content: "▴"; }
.bo-collapsible:not([open]) > summary > .bo-collapse-chevron::before { content: "▾"; }

/* --- Barres de résultats (polls, futures stats) --- */
.bo-bar-row + .bo-bar-row { margin-top: 1rem; }
.bo-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
  gap: 0.5rem;
}
.bo-bar-label-name { font-weight: 500; }
.bo-bar-label-meta { font-size: 0.82rem; color: var(--bo-text-muted); white-space: nowrap; }
.bo-bar-track {
  height: 10px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.bo-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bo-orange), var(--bo-orange-light));
  border-radius: 999px;
  transition: width 0.4s ease;
  min-width: 2px;
}

/* --- Carte d'item pour les listes (sondages, événements à venir, etc.) --- */
.bo-item-card {
  background: var(--bo-card-bg);
  border-radius: var(--bo-radius);
  box-shadow: var(--bo-card-shadow);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.bo-item-card:hover {
  box-shadow: var(--bo-card-shadow-h);
}
.bo-item-card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.bo-item-card-info     { flex: 1 1 250px; min-width: 0; }
.bo-item-card-title    { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.25rem; }
.bo-item-card-meta     { font-size: 0.82rem; color: var(--bo-text-muted); }
.bo-item-card-actions  { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* --- Toggle switch (style iOS) --- utilisé par crm/kippour.php colonne "Placé" */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.25s;
  border-radius: 24px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
  background-color: var(--bo-orange);
}
.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 1px var(--bo-orange);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}
.toggle-switch input:disabled + .toggle-slider {
  cursor: not-allowed;
  opacity: 0.55;
}

/* --- Bouton "Retour" (.accueil) standardisé --- */
.accueil {
  background: rgba(255, 255, 255, 0.95);
  color: var(--bo-orange);
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.accueil:hover {
  background: white;
  color: var(--bo-orange-light);
  text-decoration: none;
}

/* --- Tables modernes (.bo-table) ---
   Toutes les listes du CRM (haverim, inscriptions, etc.) utilisent ce
   pattern. Le wrapper .bo-table-wrap fournit le card + le scroll horizontal
   sur petit écran. Le JS bo-sortable.js (chargé sur la page) ajoute le tri
   au clic sur tout <th class="sortable">. */

.bo-table-wrap {
  background: var(--bo-card-bg);
  border-radius: var(--bo-radius);
  box-shadow: var(--bo-card-shadow);
  overflow-x: auto;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.bo-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  font-size: 0.9rem;
  color: var(--bo-text);
}

.bo-table thead tr {
  background: linear-gradient(135deg, #283167, #1c2347);
  color: white;
}

.bo-table thead th {
  padding: 0.8rem 1rem;
  font-weight: 600;
  text-align: left;
  border: none;
  white-space: nowrap;
  user-select: none;
  vertical-align: middle;
}

.bo-table thead th.sortable {
  cursor: pointer;
  padding-right: 1.7rem;
  position: relative;
  transition: background 0.15s ease;
}

.bo-table thead th.sortable:hover {
  background: rgba(255, 255, 255, 0.08);
}

.bo-table thead th.sortable::after {
  content: "↕";
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  font-size: 0.85em;
}

.bo-table thead th.sortable.sort-asc::after  { content: "↑"; opacity: 1; }
.bo-table thead th.sortable.sort-desc::after { content: "↓"; opacity: 1; }

.bo-table tbody td {
  padding: 0.7rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  vertical-align: middle;
}

.bo-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

.bo-table tbody tr:hover {
  background: rgba(255, 132, 0, 0.06);
}

.bo-table tbody tr.bo-row-inactive {
  opacity: 0.55;
  font-style: italic;
}

.bo-table .badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  letter-spacing: 0.01em;
}

/* Ligne totale en pied de tableau (totaux NIS/places) */
.bo-table tbody tr.bo-row-total td,
.bo-table tfoot tr td {
  font-weight: 700;
  background: rgba(255, 132, 0, 0.08);
  border-top: 2px solid var(--bo-orange);
  white-space: nowrap;
}

/* Pile d'action buttons dans une cellule */
.bo-table-actions {
  display: inline-flex;
  gap: 0.3rem;
  flex-wrap: nowrap;
  align-items: center;
}

.bo-table-actions .btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}

/* État "vide" (placeholder quand 0 ligne) */
.bo-table-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--bo-text-muted);
  font-style: italic;
}

/* Compact mobile : padding réduit pour gagner de la largeur utile */
@media (max-width: 575.98px) {
  .bo-table { font-size: 0.82rem; }
  .bo-table thead th,
  .bo-table tbody td { padding: 0.5rem 0.6rem; }
  .bo-table-actions .btn {
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
  }
}

/* --- Alerts homogènes (fond léger sur card blanc, pas la version Bootstrap orange) --- */
.bo-alert {
  border-radius: var(--bo-radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--bo-card-shadow);
  border: 1px solid transparent;
}
.bo-alert-success { background: #e6f7ec; color: #1a6c39; border-color: #c3eed2; }
.bo-alert-danger  { background: #fde8e8; color: #921818; border-color: #f6c6c6; }
.bo-alert-warning { background: #fff4d6; color: #6c4d00; border-color: #ffe3a0; }
.bo-alert-info    { background: #e1f3fa; color: #0c4a6e; border-color: #b9e3f3; }

/* --- Stats summary chip (pour les "X actifs · Y inactifs" en haut de pinkas) --- */
.bo-stat-chips {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.bo-stat-chip {
  background: rgba(255, 132, 0, 0.10);
  color: var(--bo-text);
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-weight: 500;
}
.bo-stat-chip strong { color: var(--bo-orange); }

/* --- Form fields homogènes dans un .bo-card --- */
.bo-card .form-control,
.bo-card .form-select {
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: white;
  padding: 0.55rem 0.85rem;
}
.bo-card .form-control:focus,
.bo-card .form-select:focus {
  border-color: var(--bo-orange);
  box-shadow: 0 0 0 0.2rem rgba(255, 132, 0, 0.15);
}
.bo-card .form-label {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--bo-text);
  margin-bottom: 0.4rem;
}
