/* Planning interactif : équipe en pastilles, cartes avec état du jour, jauge des places et avatars.
   Tout est limité au planning (#planning-view). */

/* L'équipe en pastilles : remplace la liste déroulante, qui reste pour les lecteurs d'écran. */
#workspace #planning-view .filters select#coach-filter { display: none; }
#workspace #planning-view .pi-puces { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
#workspace #planning-view .pi-puce { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px 4px 6px; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: 13px; font-weight: 600; color: var(--ink); transition: border-color .15s, background .15s; }
#workspace #planning-view .pi-puce:first-child { padding-left: 14px; }
#workspace #planning-view .pi-puce:hover { border-color: var(--plum); background: #fdfaff; }
#workspace #planning-view .pi-puce[aria-pressed="true"] { border-color: var(--plum); background: var(--lilac); color: #4a1459; box-shadow: 0 0 0 3px #7b2d8e1a; }
#workspace #planning-view .pi-puce b { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #f2edf7; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
#workspace #planning-view .pi-puce-alerte { border-color: #e6c48a; }
#workspace #planning-view .pi-puce-alerte b { background: #fff1d6; color: #80500b; }
#workspace #planning-view .pi-puce:not(:first-child):not(:nth-child(2)) { padding-left: 4px; }

/* Avatars : initiales sur une couleur propre à chaque personne. */
#workspace #planning-view .pi-av { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 50%; color: white; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
#workspace #planning-view .pi-plus { background: #8a7f95; }

/* Légende sous le calendrier, aux couleurs des cartes. */
#workspace #planning-view .legend.formation { background: #7b2d8e; }
#workspace #planning-view .legend.meeting { background: #2f8f7a; }
#workspace #planning-view .legend.pi-legende-coaching { background: #5b6fb8; }
#workspace #planning-view .legend.pi-legende-affecter { background: #d08a1e; }

/* En-tête des jours */
#workspace #planning-view .day-heading .pi-compte { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
#workspace #planning-view .day.today .day-heading .pi-compte { color: inherit; opacity: .85; }
#workspace #planning-view .day.pi-jour-passe .day-heading { opacity: .7; }

/* Les cartes */
#workspace #calendar .pi-carte { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 10px; border: 1px solid #e6dceb; border-left: 4px solid #7b2d8e; border-radius: 10px; background: white; text-align: left; transition: border-color .15s, box-shadow .15s, transform .15s, opacity .15s; }
#workspace #calendar .pi-carte:hover, #workspace #calendar .pi-carte:focus-visible { border-color: #7b2d8e; box-shadow: 0 6px 18px #3b0f4a1f; transform: translateY(-1px); }
#workspace #calendar .pi-carte.pi-lie { border-color: #7b2d8e; background: #faf4fc; box-shadow: 0 0 0 3px #7b2d8e1f; }
#workspace #calendar .pi-carte.meeting { border-left-color: #2f8f7a; background: #f3faf8; }
#workspace #calendar .pi-carte.cap, #workspace #calendar .pi-carte.pro { border-left-color: #5b6fb8; background: #f6f7fd; }
#workspace #calendar .pi-carte.pi-a-affecter { border-left-color: #d08a1e; background: #fffaf2; }
#workspace #calendar .pi-carte.pi-passee { opacity: .62; }
#workspace #calendar .pi-carte.pi-passee:hover { opacity: 1; }
#workspace #calendar .pi-carte.pi-encours { border-color: #7b2d8e; box-shadow: 0 0 0 3px #7b2d8e24; }
#workspace #calendar .pi-haut { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 6px; }
#workspace #calendar .pi-carte time { color: #6a5a75; font-size: 12px; font-weight: 600; }
#workspace #calendar .pi-carte strong { font: 700 13px/1.3 var(--font-heading, DM, sans-serif); color: #1f1a2b; letter-spacing: -.01em; }
#workspace #calendar .pi-etat { padding: 1px 7px; border-radius: 999px; background: #f2edf7; color: #5b3a6b; font-size: 11px; font-weight: 600; white-space: nowrap; }
#workspace #calendar .pi-live { display: inline-flex; align-items: center; gap: 5px; background: #7b2d8e; color: white; }
#workspace #calendar .pi-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #7ef0b0; animation: pi-pouls 1.6s infinite; }
@keyframes pi-pouls { 50% { opacity: .35; } }
#workspace #calendar .pi-jauge { display: flex; gap: 3px; height: 7px; }
#workspace #calendar .pi-jauge i { flex: 1; border-radius: 3px; background: #ece4f1; }
#workspace #calendar .pi-jauge i.pi-pris { background: #7b2d8e; }
#workspace #calendar .pi-carte .participants { color: #6a5a75; font-size: 12px; }
#workspace #calendar .pi-equipe { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin-top: auto; padding-top: 4px; }
#workspace #calendar .pi-equipe .pi-av { width: 24px; height: 24px; font-size: 10px; border: 2px solid white; margin-left: -6px; }
#workspace #calendar .pi-equipe .pi-av:first-child { margin-left: 0; }
#workspace #calendar .pi-noms { margin-left: 6px; color: #6a5a75; font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
#workspace #calendar .pi-affecter { align-self: flex-start; margin-top: auto; padding: 3px 8px; border-radius: 6px; background: #fff1d6; color: #80500b; font-size: 12px; font-weight: 700; }

@media (max-width: 1100px) { #workspace #calendar .pi-noms { display: none; } }
@media (max-width: 760px) {
  #workspace #planning-view .pi-puces { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  #workspace #planning-view .pi-puce { flex: none; }
  #workspace #calendar .pi-noms { display: inline; }
  #workspace #calendar .pi-carte { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #workspace #calendar .pi-live::before { animation: none; }
  #workspace #calendar .pi-carte { transition: none; }
  #workspace #calendar .pi-carte:hover { transform: none; }
}

/* Jours off : sous l'en-tête du jour, avatars grisés et prénoms. Absence signalée en pointillés orangés. */
#workspace #planning-view .pi-off { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px 8px; border-bottom: 1px dashed #d9cfe0; background: repeating-linear-gradient(135deg, #faf7fb 0 6px, #f3eef6 6px 12px); font-size: 11px; color: #6a5a75; }
#workspace #planning-view .agenda-group .pi-off { margin: 0 0 8px; border: 1px dashed #d9cfe0; border-radius: 8px; }
#workspace #planning-view .pi-off-titre { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 10px; color: #8a7f95; }
#workspace #planning-view .pi-off-qui { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px 1px 1px; border-radius: 999px; background: white; border: 1px solid #e6dceb; font-weight: 600; }
#workspace #planning-view .pi-off-qui .pi-av { width: 18px; height: 18px; font-size: 9px; filter: grayscale(1); opacity: .7; }
#workspace #planning-view .pi-off-absence { border-style: dashed; border-color: #e6c48a; background: #fffaf2; color: #80500b; }
/* Avec des jours off, les trois étages de chaque jour (en-tête, off, cartes) s'alignent d'une colonne à l'autre. */
@media (min-width: 761px) {
  #workspace #calendar.pi-avec-off { grid-template-rows: auto auto 1fr; }
  #workspace #calendar.pi-avec-off .day { display: grid; grid-row: span 3; grid-template-rows: subgrid; }
}
#workspace #calendar .pi-carte.pi-conflit { border-left-color: #b3261e; }
#workspace #calendar .pi-alerte-off { align-self: flex-start; padding: 2px 7px; border-radius: 6px; background: #fbe9e7; color: #8a1f17; font-size: 11px; font-weight: 700; }
#workspace #calendar .pi-equipe .pi-av-off { box-shadow: 0 0 0 2px #b3261e; opacity: .75; }
