/* ================================================================= */
/* CALENDRIER COMMERCIAL INTERACTIF - v4.0 Refonte "Pill Filters"    */
/* ================================================================= */
/* 1. CONFIGURATION GLOBALE */
:root {
    --color-primary: #3b82f6;
    --color-primary-light: #eff6ff;
    --color-text-dark: #111827;
    --color-text-default: #374151;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-bg-light: #f9fafb;
    --color-bg-white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

    /* Couleurs des statuts pour les badges */
    --status-realise: #10b981;
    --status-a-venir: #3b82f6;
    --status-en-retard: #ef4444;
}

/* 2. STYLES DE BASE */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-text-default);
    background-color: var(--color-bg-light);
    margin: 0;
}

/* 3. STRUCTURE PRINCIPALE */
#calendar-wrapper { display: flex; height: 100vh; }
#filters-sidebar {
    width: 300px;
    background-color: var(--color-bg-white);
    border-right: 1px solid var(--color-border);
    padding: 1.5rem;
    flex-shrink: 0;
    overflow-y: auto;
}
#calendar-main { flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; }

/* 4. EN-TÊTE DU CALENDRIER */
#calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background-color: var(--color-bg-white);
    border-bottom: 1px solid var(--color-border);
}
#current-period-display { font-size: 1.25rem; font-weight: 600; color: var(--color-text-dark); }
.header-nav button, .view-btn {
    background-color: transparent;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.header-nav button:hover, .view-btn:hover { background-color: var(--color-bg-light); }
.view-btn.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* 5. BARRE LATÉRALE DE FILTRES MODERNISÉE */
.sidebar-title { font-size: 1.5rem; font-weight: bold; margin: 0 0 2rem 0; color: var(--color-text-dark); }
.filter-group { margin-bottom: 2rem; }
.filter-group-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 0.75rem;
    display: block;
}

/* CONTENEUR DES PILULES */
.filter-pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* STYLE DE BASE DES PILULES */
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 15px; /* Pour un effet "pilule" arrondi */
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-light);
    color: var(--color-text-default);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none; /* Empêche la sélection du texte au clic */
}
.filter-pill:hover {
    border-color: #d1d5db;
    background-color: #f3f4f6;
}

/* STYLE DES PILULES ACTIVES */
.filter-pill.active {
    background-color: var(--color-primary);
    color: var(--color-bg-white);
    border-color: var(--color-primary);
}

/* Spécificités pour les pilules de commerciaux */
.filter-pill .user-color-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    /* La couleur est définie en JS */
}
.filter-pill.active .user-color-swatch {
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Spécificités pour les pilules de type d'événement */
.filter-pill .icon { font-size: 1rem; }

/* Section des commerciaux avec scroll */
.filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 250px;
    overflow-y: auto;
}
.filter-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: none;
    background-color: transparent;
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.filter-list-item:hover { background-color: var(--color-bg-light); }
.filter-list-item.active {
    background-color: var(--color-primary);
    color: white;
    font-weight: 500;
}
.filter-list-item .user-color-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}


/* 6. VUE MOIS (AVEC COULEUR PAR COMMERCIAL) */
#calendar-container { flex-grow: 1; overflow-y: auto; background-color: var(--color-bg-white); }
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(120px, auto);
    border-left: 1px solid var(--color-border);
}
.day-header { font-weight: 500; text-align: center; padding: 0.75rem; border-bottom: 1px solid var(--color-border); border-right: 1px solid var(--color-border); color: var(--color-text-muted); }
.day-cell { padding: 0.25rem; border-bottom: 1px solid var(--color-border); border-right: 1px solid var(--color-border); }
.day-number { text-align: right; font-size: 0.8rem; padding: 0.25rem; color: var(--color-text-muted); }
.day-cell.today .day-number {
    background-color: var(--color-primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    float: right;
}

/* ** LE STYLE IMPORTANT : TUILE D'ÉVÉNEMENT COLORÉE ** */
.event-item {
    padding: 0.2rem 0.6rem;
    margin: 2px 4px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-dark); /* Texte toujours lisible */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    /* ** LA COULEUR DE FOND EST DÉFINIE PAR LA VARIABLE --user-color ** */
    background-color: var(--user-color, var(--color-text-muted));
    border: 1px solid color-mix(in srgb, var(--user-color, #e5e7eb) 80%, black);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.event-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

/* ** STYLE RÉINTÉGRÉ POUR LES BADGES DE STATUT ** */
.event-status-badge {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
    margin-left: 8px;
}
.event-status-badge[data-status="realise"] { background-color: var(--status-realise); }
.event-status-badge[data-status="a-venir"] { background-color: var(--status-a-venir); }
.event-status-badge[data-status="en-retard"] { background-color: var(--status-en-retard); }

/* ================================================================= */
/* 7. STYLE ENRICHI DES TUILES D'ÉVÉNEMENTS                          */
/* ================================================================= */

/* Conteneur principal de la tuile */
.event-item {
    display: flex; /* Permet d'aligner le contenu et le bouton */
    align-items: stretch; /* Fait en sorte que le bouton prenne toute la hauteur */
    padding: 0; /* Le padding sera géré par les éléments internes */
    /* Le reste des styles (bordure, couleur, etc.) est déjà bon */
}

/* Contenu principal cliquable (gauche) */
.event-main-content {
    flex-grow: 1;
    padding: 4px 8px;
    overflow: hidden;
}

/* En-tête de l'événement (titre + badge) */
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.event-title {
    font-weight: 500;
}

/* Corps de l'événement (nom entité + badge contexte) */
.event-body {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.event-entity-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge "client" / "prospect" */
.event-context-badge {
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    flex-shrink: 0;
}
.context-client {
    background-color: #dbeafe; /* Bleu clair */
    color: #1e40af; /* Bleu foncé */
}
.context-prospect {
    background-color: #f3e8ff; /* Violet clair */
    color: #6b21a8; /* Violet foncé */
}

/* Bouton "Fiche" (droite) */
.event-fiche-btn {
    flex-shrink: 0;
    width: 30px;
    border: none;
    background-color: rgba(0, 0, 0, 0.05);
    border-left: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 1.2rem;
    color: var(--color-text-muted);
}
.event-fiche-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--color-text-dark);
}

/* ================================================================= */
/* 10. STYLES POUR LA COMPATIBILITÉ AVEC L'OVERLAY-PLUGIN            */
/* ================================================================= */

/* Classe pour cacher/montrer l'overlay (utilisée par le JS) */
.overlay-hidden {
    visibility: hidden !important;
    opacity: 0;
    pointer-events: none;
}

/* Style du conteneur principal de l'overlay (le fond semi-transparent) */
/* Cible les deux overlays grâce à la classe commune */
.overlay-container {
    position: fixed;
    inset: 0; /* Équivalent à top: 0; right: 0; bottom: 0; left: 0; */
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    
    /* Pour centrer la fenêtre de contenu */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Pour l'animation d'apparition */
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}
/* Donne une vraie hauteur à la fenêtre et permet aux enfants de scroller en interne */
.overlay-content-wrapper {
  height: 90vh;                /* au lieu de seulement max-height */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Zone centrale à 2 colonnes qui peut rétrécir */
.overlay-two-col {
  display: flex;
  gap: 1rem;
  flex: 1 1 auto;
  min-height: 0;               /* clé pour autoriser le scroll enfant */
}

/* Colonnes */
.overlay-left,
.overlay-right {
  flex: 1 1 0;
  min-width: 0;                /* évite le débordement horizontal en flex */
}

/* Scroll UNIQUEMENT à droite */
.overlay-right {
  overflow-y: auto;            /* c’est ici que le scroll doit vivre */
}

/* Optionnel : on évite que la gauche scrolle */
.overlay-left {
  overflow: hidden;
}

/* === SECTIONS COLLAPSIBLES === */
.filter-group {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 0.3rem 0;
}

.filter-header:hover .filter-group-title {
  color: var(--color-primary);
}

.toggle-icon {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  transition: transform 0.25s ease;
}

.filter-body {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.25s ease;
  opacity: 1;
}

.filter-group.collapsed .filter-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.filter-group.collapsed .toggle-icon {
  transform: rotate(-90deg);
}
/* ===========================================================
   VUE SEMAINE / JOUR
   =========================================================== */
.time-grid-view {
  background: white;
  height: 100%;
  overflow: auto;
  font-family: system-ui, sans-serif;
}

.time-grid-container {
  display: flex;
  flex-direction: column;
}

.time-grid-header {
  display: grid;
  grid-template-columns: 80px repeat(auto-fit, minmax(120px, 1fr));
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}

.day-column-header {
  text-align: center;
  padding: 0.5rem;
  font-weight: 600;
  color: #1f2937;
  border-left: 1px solid #e5e7eb;
}

.time-grid-body {
  display: grid;
  grid-template-columns: 80px repeat(auto-fit, minmax(120px, 1fr));
  position: relative;
  height: calc(12 * 60px); /* 12h d'affichage */
}

.hour-column {
  border-right: 1px solid #e5e7eb;
}

.hour-cell {
  height: 60px;
  font-size: 0.75rem;
  color: #6b7280;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: 8px;
}

.day-column {
  position: relative;
  border-left: 1px solid #e5e7eb;
}

.time-event {
  position: absolute;
  left: 5px;
  right: 5px;
  border-radius: 6px;
  color: white;
  font-size: 0.75rem;
  padding: 4px 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.time-event:hover {
  transform: scale(1.03);
}

.time-event-title {
  font-weight: 600;
}

.time-event-meta {
  font-size: 0.7rem;
  opacity: 0.85;
}
#event-overlay {
  position: fixed;            /* super important */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* fond assombri */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;              /* par-dessus tout */
  visibility: visible;
  opacity: 1;
  transition: opacity 0.2s ease-in-out;
}

#event-overlay.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

#event-overlay-content {
  background: white;
  border-radius: 10px;
  width: 80%;
  max-width: 900px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 5px 20px rgba(0,0,0,0.25);
  animation: fadeIn 0.25s ease;
  padding: 2rem;
}

/* animation légère */
@keyframes fadeIn {
  from { transform: scale(0.98); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.gallery-group {
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f9fafb;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.gallery-group h4 {
  font-weight: 600;
  font-size: 0.95rem;
  color: #374151;
  margin-bottom: 0.5rem;
}

.gallery-pair {
  display: flex;
  gap: 1rem;
}

.gallery-photo {
  flex: 1;
  text-align: center;
}

.gallery-photo p {
  font-size: 0.7rem;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 0.3rem;
}

.gallery-photo img {
  width: 100%;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-photo img:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.photo-missing {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e5e7eb;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* ============================
   STRUCTURE GLOBALE
============================ */
.time-grid-container {
  font-family: "Inter", "Segoe UI", sans-serif;
  color: #1f2937;
}

.time-grid-header {
  display: flex;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  text-align: center;
  height: 45px;
}

.day-column-header {
  flex: 1;
  padding: 10px 4px;
  border-right: 1px solid #e5e7eb;
  color: #374151;
  font-size: 0.9rem;
}

.hour-column {
  width: 70px;
  text-align: right;
  font-size: 0.75rem;
  color: #9ca3af;
  border-right: 1px solid #e5e7eb;
  padding-right: 8px;
}

/* ============================
   ALIGNEMENT DES COLONNES
============================ */
.days-wrapper {
  display: flex;
  flex: 1;
}

.day-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  border-right: 1px solid #f3f4f6;
}

/* ============================
   SECTION JOURNÉE ENTIÈRE
============================ */
.all-day-section {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  min-height: 65px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.all-day-event {
  background: #fdfdfd;
  border-left: 4px solid var(--event-color, #3b82f6);
  border-radius: 6px;
  padding: 6px 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  transition: all 0.15s ease;
  cursor: pointer;
}

.all-day-event:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

.all-day-event .event-title {
  font-weight: 600;
  font-size: 0.8rem;
  color: #111827;
}

.all-day-event .event-meta {
  font-size: 0.72rem;
  color: #4b5563;
  line-height: 1.2;
}

/* ============================
   GRILLE HORAIRE
============================ */
.day-grid {
  position: relative;
  flex: 1;
  min-height: 1200px;
  background: repeating-linear-gradient(
    to bottom,
    #fff 0,
    #fff 59px,
    #f9fafb 60px
  );
}

/* ============================
   ÉVÉNEMENTS HORAIRES
============================ */
.time-event {
  position: absolute;
  left: 8px;
  right: 8px;
  background: #fff;
  border-left: 4px solid var(--event-color, #3b82f6);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  padding: 5px 7px;
  font-size: 0.75rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.time-event:hover {
  transform: scale(1.02);
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.time-event-title {
  font-weight: 600;
  font-size: 0.8rem;
  color: #111827;
  margin-bottom: 2px;
}

.time-event-meta {
  font-size: 0.72rem;
  color: #4b5563;
  line-height: 1.3;
}

/* ============================
   BADGES DE CONTEXTE
============================ */
.ctx-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
}
.ctx-badge.client {
  background: linear-gradient(90deg, #10b981, #059669);
}
.ctx-badge.prospect {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* ============================
   TEXTE & INFOS
============================ */
.event-entity {
  font-weight: 500;
  color: #111827;
}

.event-user {
  color: #6b7280;
  font-style: italic;
}

/* === ÉVÉNEMENTS SANS HORAIRE === */
.untimed-section {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 50px;
}

.untimed-event {
  background: #ffffff;
  border-left: 4px solid var(--event-color, #3b82f6);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  padding: 6px 8px;
  transition: all 0.15s ease;
}

.untimed-event:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

.untimed-empty {
  text-align: center;
  font-size: 0.7rem;
  color: #9ca3af;
  font-style: italic;
}

.untimed-event .event-title {
  font-weight: 600;
  font-size: 0.8rem;
  color: #111827;
}

.untimed-event .event-meta {
  font-size: 0.72rem;
  color: #4b5563;
  line-height: 1.2;
}

/* === Suggestions pour l’autocomplétion === */
#taches-suggestions {
  border-top: 1px solid #ccc;
  z-index: 9999;
  position: absolute;
  width: 100%;
}

#taches-suggestions li {
  transition: background-color 0.2s ease-in-out;
}

/* === Overlay responsive === */
@media (max-width: 640px) {
  #taches-overlay .max-w-2xl {
    max-width: 95%;
    margin: 0 auto;
  }

  #taches-overlay .p-6 {
    padding: 1.5rem 1rem;
  }
}


/* ================================================================= */
/* AJOUTS POUR L'EN-TÊTE DU CALENDRIER (À METTRE DANS VOTRE CSS)     */
/* ================================================================= */

/* On s'assure que le conteneur de gauche et celui de droite sont bien alignés */
#calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem; /* Ajoute un peu d'espace si l'écran est petit */
}

/* Le conteneur de gauche qui contient la navigation et le titre */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Le nouveau conteneur pour les actions de droite */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem; /* Espace entre le bouton "Nouvelle tâche" et les vues */
}

/* Le conteneur des boutons de vue (juste pour être propre) */
.view-controls {
    display: flex;
    align-items: center;
}


/* === STYLE SPÉCIFIQUE POUR LE NOUVEAU BOUTON D'ACTION === */
#new-task-btn {
    /* On utilise les variables que vous avez déjà définies ! */
    background-color: var(--color-primary);
    color: var(--color-bg-white);
    
    /* Harmonisation avec les autres boutons de l'en-tête */
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    
    /* On s'assure qu'il n'y a pas de style résiduel de son ancienne position */
    position: static; 
    margin: 0;
}

/* Effet de survol cohérent */
#new-task-btn:hover {
    /* On assombrit légèrement la couleur primaire au survol */
    background-color: #2563eb; 
    border-color: #2563eb;
}
/* ================================================================= */
/* 8. VUE PLANNING MODERNISÉE                                      */
/* ================================================================= */

/* Conteneur principal de la vue planning */
.planning-modern {
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* En-tête de la page (ex: "Planning des Actions à Venir") */
.planning-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-dark);
    text-align: center;
    margin-bottom: 2rem;
}

/* Conteneur pour une journée spécifique */
.planning-day {
    margin-bottom: 2.5rem;
}

/* Titre de la journée (ex: "mercredi 29 octobre") */
.planning-day-title {
    font-size: 1.125rem; /* 18px */
    font-weight: 600;
    color: var(--color-text-dark);
    text-transform: capitalize;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-border);
}

/* La carte pour un événement individuel */
.planning-card {
    background-color: var(--color-bg-white);
    border-radius: 8px;
    padding: 0.75rem 1.25rem; /* 12px 20px */
    margin-top: 1rem;
    box-shadow: var(--shadow-sm);
    /* La couleur de la bordure est gérée en JS via "border-left" */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.planning-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* En-tête de la carte (heure, statut, commercial) */
.planning-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.planning-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Espace entre l'heure et le badge de statut */
}

.planning-time {
    font-weight: 600;
    font-size: 0.875rem; /* 14px */
    color: var(--color-text-dark);
}

/* Badge de statut rond (✓, 🕒, !) */
.planning-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}
/* On utilise les variables globales que vous avez déjà pour les couleurs */
.planning-status-badge[data-status*="realise" i],
.planning-status-badge[data-status*="réalisé" i] { background-color: var(--status-realise); }

.planning-status-badge[data-status*="venir" i] { background-color: var(--status-a-venir); }

.planning-status-badge[data-status*="retard" i] { background-color: var(--status-en-retard); }


.planning-user {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Corps de la carte (titre et entité) */
.planning-card-body {
    padding-left: 5px;
}

.planning-title {
    font-size: 1rem; /* 16px */
    font-weight: 500;
    color: var(--color-text-dark);
    margin: 0 0 0.25rem 0;
}

.planning-entity {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0;
}

.planning-entity strong {
    color: var(--color-text-default);
}

/* Badges "Client" / "Prospect" */
.badge-client, .badge-prospect {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
    vertical-align: middle;
}
.badge-client {
    background: #dbeafe;
    color: #1e40af;
}
.badge-prospect {
    background: #f3e8ff;
    color: #6b21a8;
}

/* Style pour le message "Aucun événement" */
.planning-empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 4rem;
    font-size: 1.1rem;
}

.task-proposal {
    background-color: #fffbeb; /* Jaune très clair */
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.task-proposal.validated {
    background-color: #f0fdf4; /* Vert très clair */
    border-color: #bbf7d0;
}
.validated-chip {
    display: inline-block;
    background-color: #22c55e;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 10px;
}

/* ================================================================= */
/* STYLE POUR LES TÂCHES EN RETARD DANS LE PLANNING                  */
/* ================================================================= */

.planning-card.status-en-retard {
    /* Fond rouge clair et bordure rouge foncée pour alerter */
    background-color: #fff1f1; /* Un rouge très pâle et doux */
    border-left-color: var(--status-en-retard) !important; /* Force la bordure à être rouge */
}

/* On ajuste les couleurs du texte pour qu'elles restent lisibles et cohérentes */
.planning-card.status-en-retard .planning-title,
.planning-card.status-en-retard .planning-entity strong {
    color: #991b1b; /* Un rouge foncé pour le texte important */
}

.planning-card.status-en-retard .planning-entity {
    color: #b91c1c; /* Un rouge un peu moins foncé pour les détails */
}

/* Le nom du commercial peut aussi prendre une teinte rouge */
.planning-card.status-en-retard .planning-user {
    color: #c53030 !important;
    font-weight: 700;
}

/* Style générique pour tous les événements en retard */
.event-item.status-en-retard,
.time-event.status-en-retard,
.untimed-event.status-en-retard {
    background-color: #fff1f1 !important; /* On force le fond rouge clair */
    border-color: var(--status-en-retard) !important;
}

/* On ajuste les couleurs de texte pour une meilleure lisibilité */
.status-en-retard .event-title,
.status-en-retard .event-entity-name,
.status-en-retard .time-event-title,
.status-en-retard .event-entity {
    color: #991b1b !important;
}

.status-en-retard .event-user {
    color: #b91c1c !important;
}

/* ================================================================= */
/* AJOUT DU MENU LATÉRAL "PSYKOTOOLS"                                */
/* ================================================================= */
#main-menu {
  width: 220px;
  background-color: #1e40af; /* Bleu foncé */
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}

.menu-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}

.menu-links {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0.4rem;
}

.menu-links a {
  display: block;
  text-align: center;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.menu-links a:hover {
  background-color: #2563eb; /* bleu plus clair */
}

.menu-links a.active {
  background-color: #172554; /* bleu encore plus foncé */
  font-weight: 600;
}