
/* CSS Standard pour toutes pages */
/*--------------------------------*/
/* Reset général */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}


/* Appliquer Poppins à tout le site */
body {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
}

/* Pour alléger les titres */
h1, h2, h3 {
    font-weight: 600;
}

/* Pour les textes plus fins */
p, a, span {
    font-weight: 300;
}

/* Barre de titre */
.navbar {
    height: 50px;
    width: 100%;
    background: #2F855A; /* Vert Kyberis */
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 18px;
    font-weight: bold;	 
	    overflow: hidden;
    z-index: 10000; /* Toujours au-dessus des autres éléments */
}
/* Conteneur principal */
.wrapper {
    display: flex;
    height: 100vh;
    background: #f5f5f5;
}

/* MENU LATÉRAL */
.sidebar {
    width: 250px;
    /* Très léger dégradé pour rompre la planéité du blanc pur */
    background: linear-gradient(180deg, #ffffff 0%, #fafbfa 100%);
    color: #333;
    position: fixed;
    left: 0;
    top: 40px;
    bottom: 0;
    transition: width 0.5s ease-in-out;
    box-shadow: 2px 0 8px rgba(15, 23, 42, 0.06);
    border-right: 1px solid #eef0ee;
    padding-top: 5px;
    overflow: hidden;
    overflow-y: auto;  /* Active le scroll automatique */
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar a {
    display: flex;
    align-items: center;
    padding: 11px 18px;
    text-decoration: none;
    color: #374151;
    font-size: 15px;
    transition: background 0.15s, color 0.15s, padding-left 0.15s;
    font-family: 'Poppins', sans-serif;
    border-left: 3px solid transparent;
    border-radius: 0 8px 8px 0;
    margin-right: 8px;
}

/* En mode replié : on cache les labels (span) mais on garde les icônes */
.sidebar.collapsed a span {
    display: none;
}

.sidebar a i {
    margin-right: 12px;
    font-size: 15px;
    color: #2F855A;            /* icônes en vert Kyberis pour un peu de vie */
    min-width: 20px;
    text-align: center;
    transition: transform 0.15s;
}

.sidebar.collapsed a {
    justify-content: center;
    margin-right: 0;
    border-radius: 0;
}

.sidebar.collapsed a i {
    margin-right: 0;
}

.sidebar a:hover {
    background: #f0fdf4;       /* fond vert très pâle */
    color: #1f2937;
    border-left-color: #2F855A;
    padding-left: 21px;
}
.sidebar a:hover i {
    transform: scale(1.1);
}
.sidebar a.active {
    background: linear-gradient(90deg, #d1fae5 0%, #f0fdf4 100%);
    color: #065f46;
    border-left-color: #2F855A;
    font-weight: 500;
}

/* Backdrop affiché derrière le menu mobile lorsqu'il est ouvert */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
}
.sidebar-backdrop.visible {
    display: block;
}

/* Menu off-canvas sur mobile (< 768px) :
   le sidebar n'occupe plus l'espace de la page et glisse depuis la gauche */
@media (max-width: 767px) {
    .sidebar {
        width: 280px;
        max-width: 85vw;
        transform: translateX(-100%);
        transition: transform 0.25s ease-in-out;
        z-index: 9999;
        top: 50px;
        padding-top: 10px;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.2);
    }
    /* En mobile on ignore l'état "collapsed" (hérité du desktop) */
    .sidebar.collapsed {
        width: 280px;
    }
    .sidebar.collapsed a span {
        display: inline;
    }
    /* Le contenu prend toute la largeur, plus de marge gauche */
    .content,
    .sidebar.collapsed ~ .content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }
    .container {
        margin-left: 0;
        width: 100%;
    }
    /* Liens du menu plus généreux au toucher */
    .sidebar a {
        padding: 16px 20px;
        font-size: 17px;
    }
}

/* Modules dynamiques */
.dynamic-modules {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dynamic-modules > li {
    padding: 2px 0;
    border-bottom: 0px solid #e8e8e8;
}

.dynamic-modules li a {
    text-decoration: none;
    color: #333;
}

.dynamic-modules li a:hover {
    color: #c33d2e;
}

.menu-empty {
    display: block;
    padding: 15px 20px;
    color: #9ca3af;
    font-style: italic;
    font-size: 0.85rem;
}

/* Sections accordéon dans le menu hamburger */
.menu-section {
    padding: 0 !important;
    margin-top: 8px;
}
.menu-section-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    padding: 14px 20px 6px;
    margin-top: 4px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #2F855A;            /* labels de section en vert pour la hiérarchie */
    cursor: pointer;
    transition: color 0.15s;
}
.menu-section-header:hover {
    color: #065f46;
}
.menu-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s;
}
.menu-section.collapsed-section .menu-chevron {
    transform: rotate(-90deg);
}
.menu-section-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.25s ease-in-out;
}
.menu-section.collapsed-section .menu-section-list {
    max-height: 0;
}
/* En mode sidebar repliée (desktop), les en-têtes de section sont cachés */
.sidebar.collapsed .menu-section-header {
    display: none;
}


.sidebar.collapsed ~ .content {
    margin-left: 70px;
    width: calc(100% - 70px);
}


.content {
	 font-family: 'Poppins', sans-serif;
    margin-left: 250px;
    padding: 20px;
    width: calc(100% - 250px);
    margin-top: 70px; /* Laisse de la place pour la navbar */
    height: calc(100vh - 70px);
    overflow-y: auto;
    transition: margin-left 0.3s ease-in-out;
}
		
/* Standard Page container */
.container {
    font-family: 'Poppins', sans-serif;
    margin-left: 250px;
    padding: 20px;
    width: calc(100% - 250px);
    margin-top: 70px; /* Laisse de la place pour la navbar */
    height: calc(100vh - 70px);
    overflow-y: auto;
    transition: margin-left 0.3s ease-in-out;
}

/* Pour les écrans plus larges (PC ou tablettes en paysage) */
@media (min-width: 768px) {
.container {
    max-width: calc(100% - 40px); /* La largeur maximale prend en compte 20px de marge à gauche et à droite */
    margin: 20px auto;            /* 20px de marge en haut et en bas, et auto pour centrer horizontalement */
}
}

/* Override mobile : doit venir APRÈS .content/.container desktop pour
   gagner la cascade (même spécificité, le dernier déclaré l'emporte).
   Sinon le margin-left: 250px desktop reste appliqué sur mobile et le
   contenu est squeezé sur la droite avec 250px d'espace vide à gauche. */
@media (max-width: 767px) {
    .content,
    .container,
    .sidebar.collapsed ~ .content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px !important;
    }
}

/* UserInfoBox right top */
#userInfoBox {
    /* Le userInfoBox est maintenant un enfant flex de .navbar-right-group
       (et non plus position:fixed). Ça évite qu'il se superpose aux boutons
       Recherche / Notifications. Le displayProfile() JS le passe en
       display:flex quand les données sont chargées. */
    padding: 4px 8px;
    color: white;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    max-width: 220px;
    display: none;   /* Caché par défaut ; displayProfile() le passe en flex */
    align-items: center;
    gap: 6px;
}

/* Footer Copyright info */
#footerInfoBar {
    position: fixed;
    bottom: 20px; /* Distance depuis le bas */
    right: 20px; /* Distance depuis la droite */
    padding: 5px 10px; /* Réduction des marges pour un look discret */
    background-color: rgba(255, 255, 255, 0.7); /* Fond semi-transparent */
    color: #333; /* Texte gris foncé */
    border-radius: 5px; /* Coins légèrement arrondis */
    font-family: Arial, sans-serif;
    font-size: 12px; /* Police plus petite */
    text-align: right; /* Alignement du texte à droite */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Ombre légère */
    z-index: 1000;
    max-width: 300px; /* Limite la largeur pour éviter de déborder */
    display: none; /* Masqué par défaut */
}

/* icon sound */
.audio-icon {
    font-size: 18px;
    cursor: pointer;
    color: #4CAF50;
    transition: transform 0.3s;
	opacity: 0.3;
}

.audio-icon:hover {
    transform: scale(1.1);
}

/* Performance Lantency Indicator */
#performanceBarContainer {
    width: 100%;
    height: 5px;
    background: #ddd;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

#performanceBar {
    height: 100%;
    width: 100%; /* Par défaut */
    background: green;
    transition: width 0.5s ease-in-out, background 0.5s ease-in-out;
}

#latencyText {
    font-size: 12px;
    text-align: center;
    color: #555;
    margin-top: 5px;
}

/* Text color definition, rules etc.. */
/*------------------------------------*/
a {
    text-decoration: none; /* Supprime le soulignement */
    color: inherit; /* Utilise la couleur du texte environnant */
}

/* Optionnel : changer la couleur au survol */
a:hover {
    color: inherit; /* Pas de changement de couleur au survol */
	font-weight: bold;
}

h2 {
    color: #5a5a5a;
}
input[type="email"] {
    width: 90%;
    padding: 12px;
    margin: 10px 0;
    font-size: 1rem;
    border-radius: 5px;
    border: 1px solid #d1d5db;
    background-color: #f2f7fb;
}

input[type="text"] {
    width: 90%;
    padding: 12px;
    margin: 10px 0;
    font-size: 1rem;
    border-radius: 5px;
    border: 1px solid #d1d5db;
    background-color: #f2f7fb;
}


/* Boutons standard */
.btn {
   background-color: #007bff;
   color: white;
   border-radius: 10px;
   box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
   cursor: pointer;
   justify-content: space-between;
   width: 30%;
   display: center;
   opacity: 0.7;
 }
 
 .btn-danger {
   color: white;
   border-radius: 10px;
   box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
   cursor: pointer;
   justify-content: space-between;
   width: 30%;
   display: center;
   opacity: 0.7;
   background-color: #dc3545;
}
 
.btn-orange {
   color: white;
   border-radius: 10px;
   box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
   cursor: pointer;
   justify-content: space-between;
   width: 30%;
   display: center;
   opacity: 0.7;
   background-color: #FF7F50 ;
}

.btn-save {
   color: white;
   border-radius: 10px;
   box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
   cursor: pointer;
   justify-content: space-between;
   width: 30%;
   display: center;
   opacity: 0.7;	
   background-color: #007bff;    
}

.btn-close {
   color: white;
   border-radius: 10px;
   box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
   cursor: pointer;
   justify-content: space-between;
   width: 30%;
   display: center;
   opacity: 0.7;
   background-color: #dc3545;    
}

 
.btn:hover {
      opacity: 1;
 }
 
.btn-danger:hover {
      opacity: 1;
 }
 
 .btn-orange:hover {
      opacity: 1;
 }
 
 .btn-close:hover {
      opacity: 1;
 }
 
 .btn-save:hover {
      opacity: 1;
 }
 
 /* Media queries pour les écrans de moins de 768px */
@media (max-width: 768px) {
    .btn,
    .btn-danger,
	.btn-close,
	.btn-save,
    .btn-orange {
        width: 90%; /* Les boutons occupent toute la largeur */
        padding: 15px; /* Plus d'espace pour les smartphones */
        font-size: 16px; /* Agrandir la police pour plus de lisibilité */
        border-radius: 5px; /* Ajustement des bords pour un rendu plus net */
    }
}
 
 /* Please wait loading screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s, opacity 0.3s ease-in-out;
}

.loading-screen.visible {
  visibility: visible;
  opacity: 1;
}

.loading-content {
  text-align: center;
  color: white;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 6px solid #ccc;
  border-top: 6px solid #007BFF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Menu "hamburger" */	
/* Positionne le bouton hamburger en haut à gauche */
 #hamburgerButton {
   position: fixed;
   top: 30px;
   left: 20px;
   z-index: 1000; /* S'assurer qu'il soit au-dessus de l'offcanvas */
   background: transparent;
   border: none;
   padding: 0.5rem;
  color:#333;
 }
 /* Optionnel : retirer le contour lors du focus */
 #hamburgerButton:focus {
   outline: none;
   box-shadow: none;
 }
 #hamburgerTitle {
   position: fixed;
   top: 30px;
   left: 50px;
   z-index: 1000; /* S'assurer qu'il soit au-dessus de l'offcanvas */
   background: transparent;
   border: none;
   padding: 0.5rem;
  color:#333;
 }
 


/* définition standard */
.hidden {
    display: none;
}    


.visible {
    display: block;
}

/* Jquery filter definition */
		/* Style pour les cellules cliquables (facultatif) */
		.clickable {
			cursor: pointer;
			text-decoration: none; /* Supprime le soulignement */
			color: inherit; /* Utilise la couleur de texte par défaut (héritée) */
		}
		
		.clickable:hover {
			color: inherit; /* Garde la couleur inchangée au survol */
		}
		
		 @media (max-width: 768px) {
            .hide-on-mobile {
                display: none;
            }
        }
		 .sortable {
            cursor: pointer;
            text-decoration: none;
            color: inherit;
            display: inline-flex;
            align-items: center;
        }
        .sortable .sort-icon {
            margin-left: 5px;
            font-size: 0.9em;
            display: none;
        }
        .sortable.sorted-asc .sort-icon.asc,
        .sortable.sorted-desc .sort-icon.desc {
            display: inline;
        }

/* Conteneur de formulaire */
        .form-group {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
        }

        /* Style des labels */
        .form-group label {
            flex: 0 0 100px; /* Largeur fixe pour les labels */
            font-weight: bold;
            color: #333;
            text-align: right; /* Alignement des labels à droite */
            margin-right: 10px;
        }

        /* Style des champs d'entrée */
        .form-group input {
            flex: 1; /* S'étend pour prendre tout l'espace restant */
            padding: 8px;
            font-size: 14px;
            border: 1px solid #ccc;
            border-radius: 5px;
            background-color: #f9f9f9;
            outline: none;
            transition: border-color 0.3s ease;
        }

        /* Effet de focus */
        .form-group input:focus {
            border-color: #007BFF;
            background-color: #fff;
        }

        /* Conteneur général */
        .form-container {
            max-width: 600px;
            margin: 20px auto;
            background: #ffffff;
            padding: 20px;
            border: 1px solid #ddd;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
		







/* Login Page Specific Layout */
/*----------------------------*/
.containerlogin {
    max-width: 380px;
    width: 100%;
    text-align: center;
    padding: 20px;
	top: 5px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin: 0 auto; /* Centre le conteneur horizontalement */
}

/* Ligne email + icône "j'ai oublié" — l'icône n'apparait que
   quand un email plausible est saisi (déclenché par JS). */
.email-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.email-row input[type="email"] {
    flex: 1;
    padding-right: 44px;  /* place pour l'icône */
}
.forgot-pin-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    cursor: pointer;
    transition: all .15s;
    padding: 0;
}
.forgot-pin-btn:hover {
    background: #2F855A;
    border-color: #2F855A;
    color: white;
    transform: translateY(-50%) scale(1.05);
}
.forgot-pin-btn[hidden] { display: none; }
.forgot-pin-btn.is-sending {
    pointer-events: none;
    opacity: 0.6;
}

.pin-display {
	display: center;
	width: 50%;
    font-size: 2rem;
    letter-spacing: 0.5rem;
    margin: 15px 0;
    color: #333;
	border-radius: 5px;
    border: 1px solid #d1d5db;
    background-color: #f2f7fb;
}
.pin-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.pin-buttons button {
    font-size: 1.5rem;
    padding: 15px;
    border-radius: 5px;
    background-color: #b3d1ff;
    color: #3a3a3a;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pin-buttons button:hover {
    background-color: #92b4f3;
}		


.pin-buttons button:active {
    background-color: #3e8e41; /* Encore un peu plus foncé */
}

/* Pulse visuel quand une touche du clavier physique est utilisée :
   le bouton "brille" brièvement mais l'utilisateur garde la main
   sur les touches — pas besoin de déplacer la souris sur l'écran. */
.pin-buttons button.is-flashing {
    background-color: #2F855A;
    color: white;
    transform: scale(0.96);
    transition: background-color 0.08s, transform 0.08s;
}

/* Indice discret sous le clavier — apparaît seulement sur écrans
   ayant un clavier physique (hover sur fine-pointer). */
.pin-kbd-hint {
    display: none;
    text-align: center;
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 12px;
    opacity: 0.7;
}
.pin-kbd-hint kbd {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: ui-monospace, "SF Mono", monospace;
    font-size: 0.75rem;
    color: #374151;
}
@media (hover: hover) and (pointer: fine) {
    .pin-kbd-hint { display: block; }
}



/* Page des modules */
/*------------------*/
.modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}


		
.module {
    background: #f8f9fa; /* Fond clair pour les modules */
    border: 1px solid #e0e0e0; /* Bordure subtile */
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
}

.module:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Ombre douce au survol */
    transform: scale(1.05);
}

.module a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

.module a:hover {
    color: #4facfe; /* Couleur d'accentuation au survol */
}

.admin-full {
    border-left: 5px solid #dc3545;
}

.admin-limited {
    border-left: 5px solid #ffc107;
}

.admin-view-only {
    border-left: 5px solid #28a745;
}


/* ============================================================ */
/*                       D A S H B O A R D                       */
/*           Page d'accueil portail post-login                   */
/* ============================================================ */
.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 5px 40px;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    background: linear-gradient(135deg, #2F855A 0%, #38A169 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(47, 133, 90, 0.2);
}
.dashboard-hero-text h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    color: white;
}
.dashboard-subtitle {
    margin: 4px 0 0;
    opacity: 0.9;
    font-weight: 300;
    font-size: 0.95rem;
    color: white;
}
.dashboard-logo {
    height: 50px;
    width: auto;
    opacity: 0.95;
}

/* Stats rapides */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #2F855A;
    border-radius: 10px;
    padding: 15px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.stat-card.stat-warn { border-left-color: #f59e0b; }
.stat-card.stat-next { border-left-color: #3b82f6; }
.stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    font-weight: 600;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 4px;
}
.stat-detail {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 2px;
}

/* Grille des cartes */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
@media (max-width: 767px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-hero { flex-direction: column; text-align: center; gap: 12px; }
    .dashboard-logo { height: 40px; }
}

.dashboard-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.dashboard-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.dashboard-card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}
.dashboard-card-header i {
    color: #2F855A;
}
.dashboard-card-body {
    padding: 5px 0;
}
.dashboard-card-footer {
    display: block;
    padding: 12px 18px;
    border-top: 1px solid #e5e7eb;
    color: #2F855A;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
    transition: background 0.15s;
}
.dashboard-card-footer:hover {
    background: #f0fdf4;
    color: #2F855A;
    font-weight: 500;
}

.dashboard-loading,
.dashboard-empty {
    padding: 20px;
    color: #9ca3af;
    text-align: center;
    font-style: italic;
}

/* Liste d'événements */
.event-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
    transition: background 0.15s;
}
.event-row:last-child { border-bottom: none; }
.event-row:hover {
    background: #f9fafb;
    color: #1f2937;
}
.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    background: #f0fdf4;
    border-radius: 8px;
    border: 1px solid #d1fae5;
}
.event-when {
    font-size: 0.78rem;
    font-weight: 600;
    color: #2F855A;
    text-transform: uppercase;
}
.event-time {
    font-size: 0.9rem;
    color: #1f2937;
    font-weight: 500;
}
.event-title {
    font-weight: 500;
    font-size: 0.95rem;
    color: #1f2937;
}
.event-meta {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 2px;
}
.event-rsvp {
    text-align: right;
    position: relative;
}
.rsvp-control { display: inline-block; position: relative; }
.rsvp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
    font-family: 'Poppins', sans-serif;
}
.rsvp-badge:hover:not([disabled])  { filter: brightness(0.96); }
.rsvp-badge:active:not([disabled]) { transform: translateY(1px); }
.rsvp-badge[disabled] { cursor: default; opacity: 0.7; }

.rsvp-pending { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.rsvp-yes     { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.rsvp-no      { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.rsvp-maybe   { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }

/* Popover de choix Oui / Peut-être / Non */
.rsvp-popover {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    display: flex;
    flex-direction: column;
    min-width: 150px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    padding: 4px;
    z-index: 50;
}
.rsvp-popover[hidden] { display: none; }
.rsvp-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #1f2937;
    text-align: left;
    font-family: 'Poppins', sans-serif;
}
.rsvp-option:hover {
    background: #f3f4f6;
}
.rsvp-option i { width: 16px; color: #6b7280; }
.rsvp-option[data-value="yes"]   i { color: #059669; }
.rsvp-option[data-value="no"]    i { color: #dc2626; }
.rsvp-option[data-value="maybe"] i { color: #4f46e5; }

/* event-row n'est plus un <a> direct — le clic vers le détail se fait
   via l'enfant .event-clickable, ce qui laisse le badge RSVP autonome */
.event-clickable {
    display: grid;
    grid-template-columns: 80px 1fr;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex: 1;
}
.event-clickable:hover {
    color: inherit;
    font-weight: inherit;
}

@media (max-width: 767px) {
    .event-row {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px;
    }
    .event-clickable {
        grid-template-columns: 60px 1fr;
        width: 100%;
    }
    .event-rsvp {
        margin-left: 70px;
        text-align: left;
    }
    .rsvp-popover { right: auto; left: 0; }
}

/* Raccourcis */
.dashboard-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    padding: 15px 18px;
}
.shortcut-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #1f2937;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s;
    min-height: 80px;
}
.shortcut-tile i {
    font-size: 1.5rem;
    color: #2F855A;
}
.shortcut-tile span {
    font-size: 0.8rem;
    font-weight: 500;
}
.shortcut-tile:hover {
    background: #f0fdf4;
    border-color: #2F855A;
    color: #1f2937;
    transform: translateY(-2px);
    font-weight: 500;
}

.dashboard-version {
    text-align: center;
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 25px;
}

/* ---------- Carte "Mes tâches" du dashboard ---------- */
.dashboard-card-count {
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 400;
    margin-left: 4px;
}
.dash-task-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: #1f2937;
    transition: background 0.15s;
}
.dash-task-row:last-of-type { border-bottom: none; }
.dash-task-row:hover { background: #f9fafb; color: #1f2937; font-weight: inherit; }
.dash-task-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
    background: #d1d5db;
}
.dash-task-status.status-0 { background: #9ca3af; }
.dash-task-status.status-1 { background: #4f46e5; }
.dash-task-status.status-3 { background: #dc2626; }
.dash-task-body { flex: 1; min-width: 0; }
.dash-task-title {
    font-weight: 500;
    color: #1f2937;
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-task-meta {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 2px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.dash-task-prio {
    background: #fee2e2;
    color: #991b1b;
    padding: 0 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-left: 6px;
}
.dash-task-deadline {
    color: #6b7280;
}
.dash-task-deadline.is-overdue {
    color: #dc2626;
    font-weight: 600;
}
.dash-task-deadline.is-today {
    color: #b45309;
    font-weight: 600;
}
.dash-task-deadline.is-soon {
    color: #b45309;
}

/* Z-index : les modales Bootstrap (par défaut 1055) doivent passer
   par-dessus la navbar qui est à 10000. Sinon le header vert recouvre
   le haut des modales et la croix de fermeture disparaît. */
.modal { z-index: 10050; }
.modal-backdrop { z-index: 10040; }

/* SweetAlert encore au-dessus des modales Bootstrap, sinon la
   confirmation de suppression apparaît derrière la modale qui est
   encore ouverte. */
.swal2-container { z-index: 10070 !important; }

/* ============================================================ */
/*       M O D E   I N V I T É   ( M A G I C   L I N K )         */
/* Sur les pages accédées via un magic link (?magic=1), on hide  */
/* tous les éléments de navigation pour empêcher l'accès aux     */
/* autres modules en cas de forward du mail.                     */
/* ============================================================ */

/* Bandeau d'avertissement au-dessus de la navbar */
.magic-banner {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 8px 16px;
    text-align: center;
    font-size: 0.85rem;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10001;
}
body.is-magic-mode .navbar {
    top: 36px;   /* décale la navbar sous le bandeau */
}
body.is-magic-mode .content,
body.is-magic-mode .container {
    margin-top: 110px;   /* navbar 50 + bandeau 36 + marge 24 */
}

/* Mode invité : on cache les éléments de navigation */
body.is-magic-mode #toggleSidebar i.fa-bars,
body.is-magic-mode #searchToggle,
body.is-magic-mode #notifToggle,
body.is-magic-mode #notifDropdown,
body.is-magic-mode .sidebar,
body.is-magic-mode .sidebar-backdrop,
body.is-magic-mode .navbar-notif-dropdown {
    display: none !important;
}
/* Mode invité : on retire le lien vers profile.php (sinon l'invité
   peut sortir du sandbox magic en cliquant sur son nom). Seule
   l'icône logout reste cliquable. */
body.is-magic-mode #userInfoBox .username,
body.is-magic-mode #userInfoBox .fa-user-circle {
    display: none !important;
}
/* La sidebar étant cachée, le contenu doit prendre toute la largeur */
body.is-magic-mode .content,
body.is-magic-mode .container {
    margin-left: 0 !important;
    width: 100% !important;
}
/* L'org-switcher est visible mais le dropdown de swap est désactivé */
body.is-magic-mode #orgSwitcher {
    cursor: default;
    pointer-events: none;
}
body.is-magic-mode #toggleSidebar {
    cursor: default;
}

@media (max-width: 767px) {
    .magic-banner { font-size: 0.75rem; padding: 6px 10px; }
    body.is-magic-mode .navbar { top: 30px; }
    body.is-magic-mode .content,
    body.is-magic-mode .container { margin-top: 90px; }
}


/* ============================================================ */
/*                  O D J   T O O L B A R                        */
/* Barres d'action compactes pour l'ODJ (status 0/1/2/3).        */
/* Les .btn standards sont width:30% — trop gros quand on a 5+   */
/* boutons. Ici on les groupe en flex compact + icônes.          */
/* ============================================================ */

.odj-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 14px 0;
}
.odj-toolbar .btn,
.odj-toolbar .btn-danger,
.odj-toolbar .btn-orange,
.odj-toolbar .btn-save,
.odj-toolbar .btn-close {
    width: auto;
    padding: 7px 14px;
    font-size: 0.875rem;
    border-radius: 8px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.92;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.odj-toolbar .btn:hover,
.odj-toolbar .btn-danger:hover,
.odj-toolbar .btn-orange:hover {
    opacity: 1;
}
/* Bouton "icône seule" : carré compact pour actions secondaires */
.odj-toolbar .btn-icon {
    padding: 7px 10px;
    min-width: 36px;
    justify-content: center;
}
.odj-toolbar-sep {
    width: 1px;
    height: 24px;
    background: #e5e7eb;
    margin: 0 4px;
}

@media (max-width: 768px) {
    .odj-toolbar { gap: 6px; }
    .odj-toolbar .btn,
    .odj-toolbar .btn-danger,
    .odj-toolbar .btn-orange,
    .odj-toolbar .btn-save,
    .odj-toolbar .btn-close {
        width: auto;
        padding: 8px 12px;
        font-size: 0.875rem;
    }
}

/* Bouton × pour supprimer un point en status 0 (au lieu d'une
   grosse barre rouge sous chaque point) */
#pointsContainer .point { position: relative; }
.odj-point-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #dc3545;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.55;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, background 0.15s;
    padding: 0;
}
.odj-point-remove:hover {
    opacity: 1;
    background: rgba(220, 53, 69, 0.12);
}

/* Bloc d'envoi par email (status 1 admin) : retire la largeur 30% */
.odj-email-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.odj-email-actions .btn {
    width: auto;
    padding: 8px 14px;
    font-size: 0.875rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


/* ============================================================ */
/*                  B R E A D C R U M B                          */
/*    Fil d'ariane placé en tête du .content de chaque module    */
/* ============================================================ */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -20px -20px 18px;  /* compense le padding de .content */
    padding: 10px 25px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.88rem;
    color: #6b7280;
}
.breadcrumb-home {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #2F855A;
    text-decoration: none;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}
.breadcrumb-home:hover {
    background: #f0fdf4;
    color: #2F855A;
    font-weight: 500;
}
.breadcrumb-sep {
    color: #d1d5db;
    font-size: 1rem;
}
.breadcrumb-current {
    color: #1f2937;
    font-weight: 500;
}
@media (max-width: 767px) {
    .breadcrumb-bar {
        margin: -15px -15px 15px;
        padding: 8px 15px;
        font-size: 0.82rem;
    }
}


/* ============================================================ */
/*           O R G   S W I T C H E R   ( navbar)                 */
/*  Dropdown sur le nom de l'organisation pour switcher d'ASBL   */
/* ============================================================ */
.org-switcher {
    display: inline-block;
}
.org-switcher.has-dropdown {
    position: relative;
    cursor: pointer;
}
.org-switcher-current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.org-switcher.has-dropdown:hover .org-switcher-current {
    background: rgba(255, 255, 255, 0.15);
}
.org-switcher-current i {
    font-size: 0.75rem;
    opacity: 0.85;
}
.org-switcher-menu {
    display: none;
    /* position: fixed pour s'échapper du .navbar qui a overflow: hidden ;
       JS calcule top/left dynamiquement au moment de l'ouverture en
       fonction de la position du .org-switcher-current */
    position: fixed;
    top: 50px;
    left: 0;
    min-width: 220px;
    background: white;
    color: #1f2937;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 6px 0;
    z-index: 10001;
    overflow: hidden;
}
.org-switcher-menu.open { display: block; }
.org-switcher-header {
    padding: 8px 14px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    font-weight: 600;
    border-bottom: 1px solid #f3f4f6;
}
.org-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #1f2937;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.12s;
}
.org-switcher-item:hover {
    background: #f0fdf4;
    color: #1f2937;
    font-weight: 500;
}
.org-switcher-item i {
    color: #2F855A;
    width: 16px;
    text-align: center;
}


/* ============================================================ */
/*                E V E N T   M O D A L                          */
/*  Détails lecture-seule d'un événement (clic depuis dashboard) */
/* ============================================================ */
body.no-scroll { overflow: hidden; }

.event-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.event-modal[hidden] { display: none; }

.event-modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.event-modal-content {
    position: relative;
    background: white;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.2s ease-out;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.event-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.15s;
}
.event-modal-close:hover { background: rgba(255, 255, 255, 0.2); }

.event-modal-header {
    background: linear-gradient(135deg, #2F855A 0%, #38A169 100%);
    color: white;
    padding: 24px 28px 22px;
}
.event-modal-badge {
    display: inline-flex;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 10px;
}
.event-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.3;
}
.event-modal-meta {
    margin-top: 10px;
    font-size: 0.88rem;
    opacity: 0.95;
    font-weight: 300;
}
.event-modal-meta i { margin-right: 5px; }

.event-modal-body {
    padding: 18px 28px;
    overflow-y: auto;
    flex: 1;
}
.event-modal-section { margin-bottom: 22px; }
.event-modal-section:last-child { margin-bottom: 0; }
.event-modal-section h4 {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 10px;
}
.event-modal-count {
    margin-left: 4px;
    color: #9ca3af;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}
.event-modal-myresponse .rsvp-badge {
    padding: 6px 14px;
    font-size: 0.85rem;
}
#eventModalDescription {
    color: #1f2937;
    font-size: 0.92rem;
    line-height: 1.5;
}
#eventModalDescription p:last-child { margin-bottom: 0; }

.event-modal-attendees {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.attendee-group {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.attendee-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
}
.attendee-group-header.rsvp-yes   { background: #d1fae5; color: #065f46; }
.attendee-group-header.rsvp-maybe { background: #e0e7ff; color: #3730a3; }
.attendee-group-header.rsvp-no    { background: #fee2e2; color: #991b1b; }
.attendee-group-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 1px 8px;
    font-size: 0.78rem;
}
.attendee-list {
    list-style: none;
    margin: 0;
    padding: 8px 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 4px 12px;
    font-size: 0.88rem;
    color: #1f2937;
}

.event-modal-footer {
    padding: 14px 28px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f9fafb;
}
.btn-modal-primary,
.btn-modal-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    font-family: 'Poppins', sans-serif;
}
.btn-modal-primary {
    background: #2F855A;
    color: white;
}
.btn-modal-primary:hover {
    background: #276749;
    color: white;
    font-weight: 500;
}
.btn-modal-secondary {
    background: white;
    color: #4b5563;
    border-color: #e5e7eb;
}
.btn-modal-secondary:hover { background: #f3f4f6; }

@media (max-width: 767px) {
    .event-modal { padding: 0; }
    .event-modal-content {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    .event-modal-header { padding: 20px 20px 18px; }
    .event-modal-body { padding: 16px 20px; }
    .event-modal-footer { padding: 12px 20px; }
}


/* ============================================================ */
/*       A G E N D A   —   T O O L B A R   &   V U E S          */
/* ============================================================ */
.agenda-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0 18px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 18px;
}
.agenda-view-toggle {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 3px;
}
.agenda-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #4b5563;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: background 0.12s, color 0.12s;
}
.agenda-view-btn:hover { color: #1f2937; }
.agenda-view-btn.is-active {
    background: white;
    color: #2F855A;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.agenda-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.agenda-nav-btn {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 10px;
    color: #4b5563;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'Poppins', sans-serif;
    transition: background 0.12s;
}
.agenda-nav-btn:hover { background: #f9fafb; }

/* Bouton Abonnement calendrier — plus visible que les autres nav-btn */
.agenda-sub-btn {
    background: #f0fdf4;
    border-color: #2F855A;
    color: #2F855A;
    font-weight: 500;
    margin-right: 8px;
}
.agenda-sub-btn:hover {
    background: #2F855A;
    color: white;
}
.agenda-nav-label {
    font-weight: 600;
    color: #1f2937;
    min-width: 130px;
    text-align: center;
    font-size: 0.95rem;
}

.agenda-view-content {
    margin-top: 5px;
}
.agenda-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}
.agenda-empty i {
    font-size: 2.5rem;
    color: #d1d5db;
    margin-bottom: 10px;
}
.agenda-empty p { margin: 0; }


/* ---------- V U E   L I S T E ---------- */
.agenda-list-section { margin-bottom: 26px; }
.agenda-list-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}
.agenda-day-block {
    display: flex;
    gap: 18px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}
.agenda-day-block:last-child { border-bottom: none; }
.agenda-day-date {
    flex: 0 0 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
    padding: 5px 0;
    border-radius: 8px;
    transition: background 0.12s;
}
.agenda-day-date:hover { background: #f0fdf4; }
.agenda-day-weekday {
    font-size: 0.72rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.agenda-day-num {
    font-size: 1.6rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.1;
}
.agenda-day-num.is-today {
    background: #2F855A;
    color: white;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.agenda-day-month {
    font-size: 0.72rem;
    color: #9ca3af;
    text-transform: lowercase;
}
.agenda-day-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.agenda-day-events .event-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}
.agenda-event-meta {
    font-size: 0.8rem;
    color: #6b7280;
}
.agenda-event-meta i { color: #9ca3af; margin-right: 3px; }


/* ---------- V U E   M O I S ---------- */
.agenda-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    background: #e5e7eb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.agenda-month-dow {
    background: #f9fafb;
    padding: 8px 4px;
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
}
.agenda-month-cell {
    background: white;
    min-height: 100px;
    padding: 6px 6px 8px;
    position: relative;
    cursor: pointer;
    transition: background 0.12s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.agenda-month-cell:hover { background: #f9fafb; }
.agenda-month-cell.is-out { background: #fafafa; color: #c4c4c4; }
.agenda-month-cell.is-weekend { background: #fdfdfb; }
.agenda-month-cell.is-out.is-weekend { background: #f8f8f6; }
.agenda-month-cell-num {
    font-size: 0.85rem;
    font-weight: 500;
    color: #4b5563;
}
.agenda-month-cell.is-out .agenda-month-cell-num { color: #c4c4c4; }
.agenda-month-cell.is-today .agenda-month-cell-num {
    background: #2F855A;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
}
.agenda-month-cell-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}
.agenda-month-chip {
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    background: #e0e7ff;
    color: #3730a3;
    border-left: 3px solid #6366f1;
}
.agenda-month-chip:hover { filter: brightness(0.95); }
.agenda-month-chip.is-yes     { background: #d1fae5; color: #065f46; border-left-color: #059669; }
.agenda-month-chip.is-no      { background: #fee2e2; color: #991b1b; border-left-color: #dc2626; }
.agenda-month-chip.is-maybe   { background: #e0e7ff; color: #3730a3; border-left-color: #6366f1; }
.agenda-month-chip.is-pending { background: #fef3c7; color: #92400e; border-left-color: #f59e0b; }
.agenda-month-chip.is-perso   { background: #f3e8ff; color: #6b21a8; border-left-color: #a855f7; }
.agenda-month-more {
    font-size: 0.7rem;
    color: #6b7280;
    padding: 1px 6px;
}


/* ---------- V U E   A N N É E ---------- */
.agenda-year-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.agenda-year-mini {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
}
.agenda-year-mini-head {
    text-align: center;
    font-weight: 600;
    color: #1f2937;
    font-size: 0.85rem;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: color 0.12s;
}
.agenda-year-mini-head:hover { color: #2F855A; }
.agenda-year-mini-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    font-size: 0.7rem;
}
.agenda-year-dow {
    color: #9ca3af;
    text-align: center;
    font-weight: 600;
    padding: 2px 0;
}
.agenda-year-day {
    text-align: center;
    padding: 3px 0;
    border-radius: 4px;
    color: #4b5563;
    cursor: pointer;
    position: relative;
}
.agenda-year-day:hover { background: #f0fdf4; color: #2F855A; }
.agenda-year-day.is-blank { cursor: default; }
.agenda-year-day.is-blank:hover { background: transparent; }
.agenda-year-day.has-events {
    font-weight: 600;
    color: #2F855A;
}
.agenda-year-day.has-events::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #2F855A;
}
.agenda-year-day.is-today {
    background: #2F855A;
    color: white;
}
.agenda-year-day.is-today.has-events::after { background: white; }

@media (max-width: 1024px) {
    .agenda-year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* ============================================================ */
/*           S I G N A L E M E N T   —   F O R M U L A I R E    */
/* ============================================================ */
.signalement-intro {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #1f2937;
    margin: 10px 0;
}
.signalement-intro i { padding-top: 2px; }

.location-status {
    font-size: 0.85rem;
    color: #4b5563;
    padding: 6px 0;
}


/* ============================================================ */
/*        O N B O A R D I N G   ( T O U R   D E   B I E N V .)  */
/* ============================================================ */
.kyb-onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    z-index: 10020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s;
}
.kyb-onboarding-overlay.kyb-onboarding-active { opacity: 1; }
.kyb-onboarding-overlay.kyb-onboarding-leaving { opacity: 0; }

.kyb-onboarding-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 480px;
    padding: 32px 28px 22px;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.25s ease-out;
}
.kyb-onboarding-active .kyb-onboarding-card { transform: translateY(0); }

.kyb-onboarding-skip {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.kyb-onboarding-skip:hover { background: #f3f4f6; color: #1f2937; }

.kyb-onboarding-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2F855A 0%, #38A169 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 14px;
    box-shadow: 0 6px 16px rgba(47, 133, 90, 0.3);
}

.kyb-onboarding-card h3 {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 600;
    color: #1f2937;
}
.kyb-onboarding-card p {
    margin: 0 0 18px;
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.5;
}
.kyb-onboarding-card p strong { color: #1f2937; }
.kyb-onboarding-card p i { color: #2F855A; }

.kyb-onboarding-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}
.kyb-onb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: background 0.2s, transform 0.2s;
}
.kyb-onb-dot.is-active {
    background: #2F855A;
    transform: scale(1.4);
}

.kyb-onboarding-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}
.kyb-onboarding-btn-primary,
.kyb-onboarding-btn-secondary {
    flex: 1;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: filter 0.15s, transform 0.1s;
}
.kyb-onboarding-btn-primary {
    background: #2F855A;
    color: white;
}
.kyb-onboarding-btn-primary:hover { filter: brightness(1.05); }
.kyb-onboarding-btn-primary:active { transform: translateY(1px); }
.kyb-onboarding-btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}
.kyb-onboarding-btn-secondary:hover { background: #e5e7eb; }

@media (max-width: 480px) {
    .kyb-onboarding-card { padding: 26px 22px 18px; }
    .kyb-onboarding-icon { width: 60px; height: 60px; font-size: 1.6rem; }
    .kyb-onboarding-card h3 { font-size: 1.2rem; }
}


/* ============================================================ */
/*       N O T I F I C A T I O N S   ( N A V B A R )            */
/* ============================================================ */
.navbar-right-group {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    position: relative;
    flex-shrink: 0;     /* empêche d'être écrasé par un org name long */
}

/* Sur mobile : navbar plus compacte, org name tronqué pour faire de
   la place aux boutons search/notif et au userInfoBox. */
@media (max-width: 767px) {
    .navbar { padding: 0 10px !important; }
    .navbar-right-group { gap: 4px; }
    .navbar-notif-btn { padding: 6px 8px; font-size: 0.95rem; }
    #userInfoBox { padding: 2px 4px; font-size: 12px; gap: 4px !important; max-width: 110px; }
    #userInfoBox .username { max-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* Org name tronqué : laisse de la place aux icônes à droite */
    #orgSwitcher {
        display: inline-block;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
    }
}
.navbar-notif-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.05rem;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
}
.navbar-notif-btn:hover { background: rgba(255, 255, 255, 0.15); }
.navbar-notif-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: #dc2626;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    min-width: 16px;
    text-align: center;
    line-height: 1.3;
    box-shadow: 0 0 0 2px #2F855A;  /* halo à la couleur de la navbar */
}
.navbar-notif-dropdown {
    position: fixed;
    top: 55px;
    right: 12px;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    z-index: 10002;
    overflow: hidden;
    animation: notifDropdownIn 0.15s ease-out;
}
@keyframes notifDropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.navbar-notif-header {
    padding: 12px 16px;
    font-weight: 600;
    color: #1f2937;
    font-size: 0.92rem;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
}
.navbar-notif-body {
    max-height: 60vh;
    overflow-y: auto;
}
.navbar-notif-empty {
    padding: 20px 16px;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}
.navbar-notif-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.12s;
}
.navbar-notif-item:last-child { border-bottom: none; }
.navbar-notif-item:hover { background: #f9fafb; color: #1f2937; font-weight: 500; }
.navbar-notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.navbar-notif-label {
    flex: 1;
    font-size: 0.88rem;
}
.navbar-notif-chevron {
    color: #9ca3af;
    font-size: 0.75rem;
}


/* ============================================================ */
/*       R E C H E R C H E   G L O B A L E   ( Cmd+K )          */
/* ============================================================ */
#kyb-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 10030;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 70px 20px 20px;
    animation: kybSearchFadeIn 0.15s ease-out;
}
#kyb-search-overlay.kyb-search-leaving { opacity: 0; transition: opacity 0.15s; }
@keyframes kybSearchFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.kyb-search-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 620px;
    overflow: hidden;
    animation: kybSearchSlideIn 0.18s ease-out;
}
@keyframes kybSearchSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.kyb-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #f3f4f6;
}
.kyb-search-icon { color: #9ca3af; font-size: 1.05rem; }
.kyb-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    color: #1f2937;
    font-family: 'Poppins', sans-serif;
    background: transparent;
}
.kyb-search-input::placeholder { color: #9ca3af; }
.kyb-search-kbd {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    color: #6b7280;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.kyb-search-results {
    max-height: 60vh;
    overflow-y: auto;
}
.kyb-search-hint {
    padding: 28px 18px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}
.kyb-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}
.kyb-search-result:last-child { border-bottom: none; }
.kyb-search-result.is-selected { background: #f0fdf4; }
.kyb-search-result-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.kyb-search-result-text { flex: 1; min-width: 0; }
.kyb-search-result-title {
    font-weight: 500;
    color: #1f2937;
    font-size: 0.94rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kyb-search-result-subtitle {
    font-size: 0.78rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}
.kyb-search-result-type {
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

@media (max-width: 480px) {
    #kyb-search-overlay { padding: 12px; }
    .kyb-search-result { padding: 12px 14px; }
    .kyb-search-result-type { display: none; }
}
@media (max-width: 767px) {
    .agenda-toolbar { padding: 6px 0 12px; }
    .agenda-view-btn span { display: none; }   /* icônes seules sur mobile */
    .agenda-view-btn { padding: 7px 11px; }
    .agenda-nav-label { min-width: 90px; font-size: 0.85rem; }
    .agenda-nav-btn { padding: 5px 8px; font-size: 0.8rem; }

    .agenda-month-cell { min-height: 60px; padding: 3px; }
    .agenda-month-chip { font-size: 0.65rem; padding: 1px 4px; }

    .agenda-year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .agenda-year-day { padding: 2px 0; }

    .agenda-day-block { flex-direction: row; gap: 10px; }
    .agenda-day-date { flex-basis: 55px; }
    .agenda-day-num { font-size: 1.3rem; }
    .agenda-day-num.is-today { width: 30px; height: 30px; font-size: 0.95rem; }
}