/* ---- Web fonts ---- */
@font-face {
  font-family: 'ChaumontScript';
  src: url('fonts/ChaumontScript-Regular.woff2') format('woff2'),
       url('fonts/ChaumontScript-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DiamondGrotesk';
  src: url('fonts/DiamondGrotesk-VF.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ApfelGrotezk';
  src: url('fonts/ApfelGrotezk-Regular.woff2') format('woff2'),
       url('fonts/ApfelGrotezk-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ApfelGrotezk';
  src: url('fonts/ApfelGrotezk-Fett.woff2') format('woff2'),
       url('fonts/ApfelGrotezk-Fett.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* =====================================================================
   CALENDRIER MEDIA LAB — Feuille de styles
   ---------------------------------------------------------------------
   Ce fichier contrôle tout l'apparence du calendrier.
   N'hésitez pas à modifier les valeurs ci-dessous pour personnaliser.
   ===================================================================== */


/* =====================================================================
   1. VARIABLES — couleurs, tailles, polices (à modifier pour personnaliser)
   ===================================================================== */
:root {
  /* ---- Couleurs de fond ---- */
  --bg-page: #ffffff;             /* fond général de la page */
  --bg-header: #ffffff;           /* fond de la barre du haut */
  --bg-cell-app: #f0ecc4;         /* fond des groupes APP */
  --bg-cell-sco: #fdf9d4;         /* fond des groupes SCO (jaune) */
  --bg-cell-app-weekend: #f0ecc4; /* fond APP les jours de weekend */
  --bg-row-weekend: #efeff1;      /* fond des lignes samedi/dimanche */
  --bg-th-headers: #ffffff;       /* fond des en-têtes du tableau (matin/après-midi/de/à...) */
  --bg-date-col: #ffffff;         /* fond de la colonne de gauche (date) */
  --bg-week-summary: #fafafa;     /* fond des lignes "Total semaine" */
  --bg-hours-cell: #f0ecc4;       /* fond des cellules 35H (= APP) */
  /* ---- Couleurs des titres de groupes (gros titres au-dessus du tableau) ---- */
  --color-title-A4SCO: #000000;
  --color-title-A4APP: #000000;
  --color-title-A5APP: #000000;
  --color-title-A5SCO: #000000;

  /* ---- Couleurs de statut (pastilles validé) ---- */
  --bg-status-changement: #ffd0d3;

  /* ---- Bordures ---- */
  --border-color: #b9b9bc;        /* couleur des bordures du tableau */
  --border-thin: 1px solid var(--border-color);
  --border-color-week: #6e6e73;   /* bordure plus marquée entre semaines */
  --border-week: 2px solid var(--border-color-week);

  /* ---- Polices ---- */
  --font-base: 'DiamondGrotesk', Ronzino, Arial, sans-serif;
  --font-oswald: 'Oswald', sans-serif;
  --font-size-base: 0.95rem;         /* taille de police par défaut dans le tableau */
  --font-size-title: 5rem;        /* taille des titres de groupes (A4 SCO, etc.) */
  --font-size-headers: 1.25rem;      /* taille des en-têtes de colonnes (de/à/module/...) */
  --font-size-headers-small: 0.9rem;      /* taille des en-têtes de colonnes (de/à/module/...) */
  --font-size-cal: 1rem;         /* taille de police par défaut date et heures colonnes de gauche */
  --font-size-input: 1rem;      /* taille de la police des horaires*/

  /* ---- Largeurs des colonnes (en pixels) ---- */
  --w-date-col: 210px;            /* colonne date fusionnée (ex. "08 septembre — Mer.") */
  --w-time: 2rem;               /* colonne "de" et "à" */
  --w-module: 190px;              /* colonne module */
  --w-teacher: 150px;             /* colonne enseignant */
  --w-status: 3rem;               /* colonne validé */
  --w-hours: 20px;                /* colonne 35H */
  --w-period: 52px;               /* colonne Période (matin/après-midi) */
  --w-violet: 20px;               /* colonne violet */
  --w-group: 620px;               /* largeur d'une colonne groupe (pile de créneaux) */

  /* ---- Hauteur des lignes ---- */
  --row-height: calc(var(--font-size-base) * 2);


  /* ---- Hauteur des lignes du header ---- */
  --thead-row-height: var(--row-height);

  /* ---- Tokens Figma (popin de saisie, vue par cours) ---- */
  --pc-navy: #17242e;
  --pc-red: #ff4d52;
  --pc-purple: #8575f9;
  --pc-gray-dark: #5b5e61;
  --pc-gray-mid: #9f9fa2;
  --pc-ink: #080808;
}

/* =====================================================================
   2. BASE
   ===================================================================== */
* { box-sizing: border-box; }
body {
  font-family: var(--font-base);
  margin: 0;
  padding-left: 24px;
  background: var(--bg-page);
  color: #1d1d1f;
  font-size: var(--font-size-base);
  scrollbar-gutter: stable; /* évite le décalage layout quand la scrollbar apparaît */
}

/* =====================================================================
   3. HEADER (barre du haut avec les boutons)
   ===================================================================== */
header {
  background: #fff;
  border-bottom: none;
  padding: 20px 0 0 24px;
  margin-left: -24px;
  width: calc(100% + 24px);
  box-sizing: border-box;
}

/* ---- Header top row (intro + rabbit) ---- */
.header-top-row {
  display: flex;
  align-items: flex-start;
}
.header-rabbit-area {
  flex: 1;
  position: relative;
  overflow: clip; /* clip sans créer de scroll container — laisse passer le scroll horizontal */
  min-height: 240px;
  align-self: stretch;
}
.header-rabbit {
  position: absolute;
  width: 240px;
  height: 240px;
  cursor: pointer;
  display: block;
}

/* ---- Intro éditoriale ---- */
.site-intro {
  padding: 24px 12px 24px 0px;
  max-width: calc(var(--w-date-col) + 4 * var(--w-time) + 2 * (var(--w-module) + var(--w-teacher)) + var(--w-status));
}
.site-intro-title {
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 3rem;
  font-weight: 400;
  line-height: 1.2;
  color: #000;
  margin: 0 0 1.4rem;
  letter-spacing: -0.015em;
}
.site-intro-main {
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.5;
  color: #000;
  margin: 0 0 8px;
  letter-spacing: -0.015em;
  max-width: 100%;
}
.site-intro-sub {
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.6;
  color: #000;
  margin: 0 0 8px;
  letter-spacing: -0.015em;
}
.violette-month-select {
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: #000;
  background: none;
  border: none;
  border-bottom: 1px solid #000;
  cursor: pointer;
  padding: 0 2px;
}
.btn-inline {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #000;
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 1.5rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  padding: 2px 9px 0 9px;
  border-radius: 40px;
  border: 1px solid #000;
  background: none;
  cursor: pointer;
  vertical-align: baseline;
  transition: background .15s, color .15s;
}
.btn-inline:hover { background: #000; color: #fff; }

/* ---- Chips statut inline dans l'intro ---- */
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  padding: 2px 8px 0 8px;
  border-radius: 40px;
  border: 1px solid;
  vertical-align: baseline;
}
.status-chip-ok {
  color: #232323;
  border-color: #232323;
}

.status-chip-encours {
  color: #a98e21;
  border-color: #a98e21;
}

.status-chip-chg {
  color: #ffd7df;
  border-color: #f31331;
  background: #f31331;
}

/* ---- Barre outils ---- */
.header-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 24px 6px 12px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-actions button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: 1px solid #000;
  color: #000;
  padding: 3px 6px 0 6px;
  font-size: 0.975rem;
  font-weight: 400;
  font-family: 'DiamondGrotesk', sans-serif;
  line-height: 1;
  border-radius: 40px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.header-actions button:hover { background: #000; color: #fff; }

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.save-status { font-size: 10px; color: #34a853; letter-spacing: 0.05em; text-transform: uppercase; }
.save-status.saving { color: #f9ab00; }

/* ---- Statut (sync/sauvegarde) ---- */
.header-status {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  padding: 5px 18px 6px 9px;
}

/* ---- Réglages du calendrier (date de début, nb de jours, total/semaine, groupes) ---- */
.today-settings-group { display: flex; align-items: center; gap: 10px; }
.settings-menu { position: relative; }
.settings-menu > summary { list-style: none; cursor: pointer; }
.settings-menu > summary::-webkit-details-marker { display: none; }
.settings-menu[open] > summary,
.settings-menu > summary:hover { background: #000; color: #fff; }
.settings-menu .menu-pop { left: 0; right: auto; min-width: 220px; }
.menu-pop .header-filters {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  gap: 8px;
}

/* ---- Filtres ---- */
.header-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  padding: 5px 18px 6px 9px;
  flex-wrap: wrap;
}
.header-filters label {
  font-size: 0.73rem;
  font-family: 'DiamondGrotesk', sans-serif;
  font-weight: 400;
  color: #000;
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: none;
  letter-spacing: 0;
}
.header-filters input[type="date"],
.header-filters input[type="number"] {
  padding: 2px 2px;
  border: 1px solid #000;
  border-radius: 40px;
  font-size: 0.73rem;
  font-family: 'DiamondGrotesk', sans-serif;
  background: transparent;
}
.btn-today {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: 1px solid #000;
  color: #000;
  padding: 3px 6px 0 6px;
  font-size: 0.975rem;
  font-family: 'DiamondGrotesk', sans-serif;
  font-weight: 400;
  line-height: 1;
  border-radius: 40px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-today:hover { background: #000; color: #fff; }

/* ---- Boutons globaux (modales, tableau) ---- */
button {
  background: #fff; border: 1px solid #d2d2d7; color: #1d1d1f;
  padding: 5px 10px; border-radius: 5px; cursor: pointer;
  font-size: 12px; font-weight: 500; transition: all .12s ease;
  font-family: inherit;
}
button:hover { background: #f5f5f7; }
button.primary { background: #0071e3; color: #fff; border-color: #0071e3; }
button.primary:hover { background: #005bb5; }
button.danger { color: #d70015; border-color: #ffb3b8; }
button.danger:hover { background: #fff5f5; }
button.icon-only { padding: 4px 7px; }

/* =====================================================================
   4. ZONE PRINCIPALE
   ===================================================================== */
main {
  padding: 0;
  overflow: visible;
}

.table-scroll-wrapper {
  overflow-y: visible;
  width: 100%;
}


/* =====================================================================
   5. GROS TITRES DES GROUPES (1ère ligne du thead)
   ===================================================================== */
th.group-title {
  font-size: var(--font-size-title);
  font-weight: 400;
  letter-spacing: 0px;
  border-bottom: none !important;
  border-right: none;
  text-transform: uppercase;
  background: #ffffff;
  text-align: center;
  vertical-align: bottom;
  padding-bottom: 4px;
}
th.group-title.A4SCO { color: var(--color-title-A4SCO); }
th.group-title.A4APP { color: var(--color-title-A4APP); background: var(--bg-cell-app) !important; }
th.group-title.A5APP { color: var(--color-title-A5APP); background: var(--bg-cell-app) !important; }
th.group-title.A5SCO { color: var(--color-title-A5SCO); }

/* Colonne muette de 40px après A5 INI (dernière classe) : vide, sans trait, couleur de
   fond d'un jour de semaine A5 INI (--bg-cell-sco) sur toute la hauteur du tableau. Le
   ::after !important annule le trait de séparation entre jours (table.cal tbody tr.day-row
   td::after, réactivé le samedi par tr.day-row.weekend.sat td::after) : ce spacer n'est
   jamais un jour, il ne doit jamais en porter le trait. */
.a5sco-spacer,
table.cal thead th.a5sco-spacer,
table.cal tbody td.a5sco-spacer { background: var(--bg-cell-sco); border: none; }
table.cal tbody tr.day-row td.a5sco-spacer::after { display: none !important; }


/* =====================================================================
   6. TABLEAU PRINCIPAL
   ===================================================================== */
table.cal {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: var(--font-size-base);
  background: #ffffff;
  /* Largeur = somme exacte des colonnes (date + 4 groupes + 2 colonnes 35h)
     pour que chaque colonne groupe prenne réellement var(--w-group). */
  width: calc(var(--w-date-col) + 4 * var(--w-group) + 2 * var(--w-hours));
  height: var(--thead-row-height);
}
table.cal th, table.cal td {
  padding: 0;
  vertical-align: middle;
  text-align: left;
  padding: 0px 3px;
}

/* ---- En-têtes du tableau (matin/après-midi puis de/à/module...) ---- */
table.cal thead th {
  background: var(--bg-th-headers);
  height: var(--thead-row-height);
  line-height: normal;
  vertical-align: middle;
  padding-left: 6px;
  text-align: left;
  color: #1d1d1f;
  border-left: none;
  border-right: none;
}

/* -- En-tête 35h -- */
table.cal thead th.period {
    vertical-align: bottom;
    padding-left: 6px;
}


th.col-header.cell-time {
  font-size: var(--font-size-headers-small);
  padding-left: 6px;
  
}

th.col-header.cell-status{
  font-size: var(--font-size-headers-small);
  padding-left: 6px;
}

th.period {
  color: #6e6e73;
  font-size: var(--font-size-headers);
  font-weight: 400;
}

table.cal thead th.period {
  padding-left: 6px;
}

th.col-header {
  color: #6e6e73;
  font-weight: 400;
  font-size: 1rem;
}
/* Cellules d'en-têtes appartenant à un groupe APP : fond jaune */
th.app-bg { background: var(--bg-cell-app) !important; }
th.sco-bg { background: var(--bg-cell-sco) !important; }
th.group-title.A4SCO, th.group-title.A5SCO { background: var(--bg-cell-sco) !important; }


/* ---- Colonnes de gauche : date | jour ---- */
th.date-day-col,
td.date-day-col {
  width: var(--w-date-col);
  text-align: left;
  padding: 3px 4px 3px 6px;
  background: #ffffff;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Sticky horizontal UNIQUEMENT pour le body */
table.cal tbody td.date-day-col {
  position: sticky;
  left: 0;
  z-index: 5;
}


tr.day-row.weekend td.date-day-col { background: var(--bg-row-weekend); }

th.date-day-col {
  background: var(--bg-th-headers);
  font-weight: 400;
}

td.date-day-col {
  padding-right: 0;
}
.date-day-inner {
  display: flex;
  height: var(--row-height);
  align-items: center;
  justify-content: space-between;
  gap: 0;
  padding-right: 7px;
}

.date-wrapper {
  font-family: 'DiamondGrotesk', sans-serif;
  font-weight: 800;
  font-size: var(--font-size-base);
  white-space: nowrap;
  padding-left: 12px;
}


/* ---- Cellules de données ---- */
table.cal tbody td.app-bg { background: var(--bg-cell-app) !important; }
table.cal tbody td.sco-bg { background: var(--bg-cell-sco) !important; }

/* ajuster hauteur de row*/
table.cal tbody td {
  height: var(--row-height);
}

/* Lignes weekend : fond gris clair */
/*table.cal tbody tr.weekend td:not(.day-col):not(.date-col):not(.cell-status):not(.cell-hours) {
  background: var(--bg-row-weekend);
}*/
tr.day-row {
  background: #ffffff;
  border: none;
  border-bottom: none;
}

tr.day-row:hover td {
  background: #9fffe0 !important;
  color: #0d263b !important;
}
tr.day-row:hover .input-time { background: transparent; }
tr.day-row:hover td { color: #0d263b !important; }

/* ---- Hover ligne : force aussi les colonnes APP qui utilisent !important ---- */
tr.day-row:hover td.app-bg,
tr.day-row:hover td.sco-bg,
tr.day-row:hover td.cell-hours,
tr.day-row:hover td.cell-hours-week {
  background: #9fffe0 !important;
  color: #0d263b !important;
}

tr.day-row.weekend {
  background: var(--bg-row-weekend);
}
tr.day-row td {
  background: inherit;
}

table.cal tbody tr.weekend td.app-bg { background: var(--bg-cell-app-weekend) !important; }


/* ---- Largeurs des cellules ---- */
td.cell-time,
th.cell-time {
  width: var(--w-time);
  min-width: var(--w-time);
  max-width: var(--w-time);
}
td.cell-module,
th.cell-module {
  width: var(--w-module);
  max-width: var(--w-module);
  overflow: hidden;
}
td.cell-module-teacher,
th.cell-module-teacher {
  width: calc(var(--w-module) + var(--w-teacher));
  max-width: calc(var(--w-module) + var(--w-teacher));
  overflow: hidden;
  padding: 0;
}
.combined-display {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  width: 100%;
  min-height: var(--row-height);
  padding: 0 4px;
  overflow: hidden;
  cursor: pointer;
}
.combined-display:hover { background: rgba(0,113,227,0.06); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.chip-module,
.chip-teacher {
  cursor: none !important;
  position: relative;
  user-select: none;
  pointer-events: auto !important;
}

#chipCursor {
  position: fixed;
  width: 36px;
  height: 36px;
  pointer-events: none;
  display: none;
  transform: translate(-50%, -50%);
  z-index: 99999;
}
#chipCursor::before,
#chipCursor::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 1px;
  background: #000;
}
#chipCursor::before { transform: translate(-50%, -50%) rotate(45deg); }
#chipCursor::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.chip-module {
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: var(--font-size-base);
  color: #0d263b;
  border: none;
  padding: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}
.chip-occ {
  font-family: 'ApfelGrotezk', sans-serif;
  font-size: 0.7em;
  font-weight: 700;
  color: #9678ff;
  letter-spacing: 0.02em;
  vertical-align: baseline;
}
.chip-teacher {
  color: #6e6e73;
  padding: 0px 10px 2px 10px;
  border-radius: 1rem;
  border: 1px solid currentColor;
  font-size: 0.9rem;
  font-family: 'ApfelGrotezk', sans-serif;
  font-weight: 700;
}
.chip-add-ens {
  font-size: 1rem;
  background: #ffffff;
  color: #6e6e73;
  border: 1px solid currentColor;
  border-radius: 1rem;
  padding: 2px 6px;
  flex: 0 0 auto;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  top: -1px;
}
.chip-remove {
  background: none;
  border: none;
  padding: 0 0 0 2px;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  color: inherit;
  opacity: 0.5;
}
.chip-remove:hover { opacity: 1; }

.input-combined {
  flex: 1 1 80px;
  min-width: 60px;
  height: var(--row-height);
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--font-size-input);
  color: inherit;
  outline: none;
}
td.cell-module .picker-cell {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-text {
  font-family: 'Diamond grotesk', Arial, Helvetica, sans-serif;
  font-size: var(--font-size-base);
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

td.cell-teacher { width: var(--w-teacher); }
td.cell-status {
  width: var(--w-status);
}
td.cell-status .picker-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
  height: var(--row-height);
}
td.cell-status.status-ok .picker-cell,
td.cell-status.status-encours .picker-cell,
td.cell-status.status-changement .picker-cell { justify-content: center; padding-right: 0; }
td.cell-hours, th.cell-hours { width: var(--w-hours); }

td.cell-module,
td.cell-teacher {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td.cell-teacher,
th.cell-teacher {
  width: var(--w-teacher);
  max-width: var(--w-teacher);
  overflow: hidden;
}

.teachers-display {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
  gap: 4px;
}

td.cell-time {
  position: relative;
}


/* ---- Champs de saisie (heures, module, statut) ---- */
td.cell-field { padding: 0; height: var(--row-height); border-left: none; border-right: none; }
.input-module, .input-status {
  width: 100%;
  height: var(--row-height);
  background: transparent;
  padding: 4px 10px 0px 4px;
  font-family: inherit;
  color: inherit;
  border: none;
  line-height: var(--row-height);
  font-size: var(--font-size-input);
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
  cursor: pointer;
}
.input-module:focus, .input-status:focus {
  outline: 2px solid #0071e3;
  outline-offset: -2px;
  background: #ffffff;
}

/* ---- input-time : style Teenage Engineering ---- */
td.cell-field.cell-time { padding-left: 0; }

.input-time {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  width: 100%;
  height: var(--row-height);
  background: transparent;
  color: #111111;
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-align: center;
  text-transform: lowercase;
  border: none;
  border-radius: 2px;
  padding: 0;
  cursor: pointer;
}
.input-time:hover { background: #f0f0f0; }
.input-time:focus {
  outline: 1px solid #aaaaaa;
  outline-offset: -1px;
  background: #f8f8f8;
}
.input-time::-webkit-outer-spin-button,
.input-time::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }


/* ---- Cellule enseignants (clic pour ouvrir le picker) ---- */
.teachers-display {
  width: 100%;
  min-height: var(--row-height);
  cursor: pointer;
  padding: 2px 4px;
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 2px;
  align-items: center;
  justify-content: flex-start;
}
.teachers-display:hover { background: rgba(0,113,227,0.06); }
.teacher-chip {
  background: transparent;
  color: #1e2227;
  padding:2px 6px;
  border:1px solid;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  white-space: nowrap;
  flex: 0 0 auto;  /* 👈 empêche compression + wrap */
}
.teachers-placeholder,
.cell-placeholder { color: #c0bfca; font-size: 10px; }

.picker-cell,
.status-cell { cursor: pointer; }


/* ---- Couleurs des statuts (cellule "validé") ---- */
td.cell-status.status-ok { color: #232323; font-size: 12px; text-transform: lowercase;font-weight: bold; text-align: center;}
td.cell-status.status-encours { color: #a98e21; font-size: 12px; text-transform: lowercase;font-weight: bold;text-align: center;}
td.cell-status.status-changement { background-color:#f31331 !important; color: #ffd7df; font-size: 12px; text-transform: lowercase;font-weight: bold;text-align: center;}


/* ---- Colonnes 35H (jours et totaux) ---- */
td.cell-hours, th.cell-hours {
  background: var(--bg-hours-cell) !important;
  font-weight: 400;
  color: #474337;
  font-size: var(--font-size-cal);
}


/* ---- Séparateurs entre semaines (bordure un peu plus marquée) ---- */
tr.week-start td, tr.week-start th {
  border-top: none;
}  




/* =====================================================================
   7. FENÊTRES MODALES (sélection enseignants, gestion listes)
   ===================================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: 10px;
  width: 90%; max-width: 540px; max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-header {
  padding: 12px 16px;
/*  border-bottom: none;*/
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body { padding: 12px 16px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 10px 16px;
  border-top: none;
  display: flex; justify-content: flex-end; gap: 6px;
}
.search-input {
  width: 100%; padding: 7px 10px;
  border: 1px solid #d2d2d7; border-radius: 6px;
  font-size: 13px; margin-bottom: 8px; font-family: inherit;
}
.picker-list {
  border: 1px solid #e5e5e7; border-radius: 6px;
  max-height: 280px; overflow-y: auto;
}
.picker-item {
  padding: 7px 10px; cursor: pointer;
/*  border-bottom: none;*/
  display: flex; align-items: center; gap: 7px; font-size: 12px;
}
.picker-item:hover { background: #f5f5f7; }
/*.picker-item:last-child { border-bottom: none; }*/
.picker-item.selected { background: #eef4ff; color: #0040a3; }
.picker-item.picker-add-new { color: #0040a3; font-style: italic; margin-top: 4px; }
.selected-teachers {
  margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px;
  min-height: 28px; padding: 5px;
  background: #f9f9fb; border-radius: 6px;
}
.selected-teachers .teacher-chip { cursor: pointer; padding: 2px 7px; font-size: 11px; }
.selected-teachers .teacher-chip:hover { background: #ffd6d8; color: #d70015; }

.list-manage-row {
  display: flex; gap: 5px; padding: 5px 8px;
  /*border-bottom: none;*/
  align-items: center; font-size: 12px;
}
.list-manage-row:hover { background: #f9f9fb; }
.list-manage-row .item-name { flex: 1; }
.list-manage-row button { padding: 2px 6px; font-size: 11px; }

.add-form { display: flex; gap: 5px; margin-bottom: 8px; }
.add-form input { flex: 1; padding: 7px 10px; border: 1px solid #d2d2d7; border-radius: 6px; font-size: 12px; font-family: inherit; }

.empty-state { text-align: center; padding: 30px 16px; color: #6e6e73; }
.file-input-hidden { display: none; }

/* Modal "Gérer les équipes" (Figma popin-gérer-équipes, node 461:354) — rythme vertical
   20px entre les grandes sections (pool / liste des équipes), 40px entre chaque équipe. */
.groupe-modal-title {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 16px; color: var(--pc-gray-dark);
}
#groupeList { display: flex; flex-direction: column; gap: 20px; }
.groupe-pool-section {
  background: var(--pc-yellow); border-radius: 8px; padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.groupe-sub-label {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 0.75rem; color: var(--pc-gray-dark);
}
.groupe-add-label { margin-top: 2px; }
/* Zones de dépôt (drag & drop) volontairement généreuses (padding + min-height) : une zone
   trop fine échoue à recevoir le drop natif HTML5, surtout quand le groupe est encore vide. */
.groupe-pool, .groupe-ens-chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  min-height: 36px; padding: 6px; margin: 2px 0;
  border: 1px dashed var(--pc-gray-mid); border-radius: 8px; transition: background 0.1s, border-color 0.1s;
}
.groupe-etu-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.groupe-pool.drop-hover, .groupe-ens-chips.drop-hover { background: rgba(133, 117, 249, 0.12); border-color: var(--pc-purple); }
.groupe-teacher-chip { cursor: grab; }
.groupe-teacher-chip.dragging { opacity: 0.35; }

.groupe-teams-list { display: flex; flex-direction: column; gap: 40px; }
.groupe-row { display: flex; flex-direction: column; gap: 8px; }
.groupe-row-head { display: flex; align-items: center; gap: 8px; }
.groupe-label-input {
  flex: 1 1 auto; min-width: 0;
  border: 1px solid var(--pc-gray-mid); border-radius: 12px; padding: 5px 10px 4px;
  font-family: 'DiamondGrotesk', sans-serif; font-size: 0.95rem; color: var(--pc-navy); background: #fff;
}
.groupe-label-input:focus { outline: 2px solid var(--pc-purple); outline-offset: -1px; border-color: transparent; }
.groupe-del-btn {
  flex: 0 0 auto; white-space: nowrap;
  border: 1px solid var(--pc-red); background: none; color: var(--pc-red);
  border-radius: 12px; padding: 4px 10px;
  font-family: 'DiamondGrotesk', sans-serif; font-size: 0.72rem; cursor: pointer;
}
.groupe-del-btn:hover { background: var(--pc-red); color: #fff; }
.groupe-add-row { display: flex; flex-wrap: wrap; gap: 20px; }
.groupe-add-col { display: flex; align-items: center; gap: 8px; flex: 1 1 200px; min-width: 0; }
.groupe-add-col input {
  flex: 1 1 auto; min-width: 0;
  border: 1px solid var(--pc-gray-mid); border-radius: 12px; padding: 4px 10px 3px;
  font-family: 'DiamondGrotesk', sans-serif; font-size: 0.85rem; color: var(--pc-navy); background: #fff;
}
.groupe-add-col input:focus { outline: 2px solid var(--pc-purple); outline-offset: -1px; border-color: transparent; }
.groupe-add-btn {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: var(--pc-purple); color: #fff;
  font-size: 0.9rem; line-height: 1; cursor: pointer;
}
.groupe-add-btn:hover { background: var(--pc-purple); opacity: 0.85; }
.groupe-newteam-btn {
  flex: 0 0 auto; white-space: nowrap;
  border: none; background: var(--pc-purple); color: #fff;
  border-radius: 12px; padding: 4px 12px;
  font-family: 'DiamondGrotesk', sans-serif; font-size: 0.72rem; cursor: pointer;
}
.groupe-newteam-btn:hover { background: var(--pc-purple); opacity: 0.85; }

.groupe-modal-footer { padding-top: 8px; justify-content: space-between; }
.groupe-ok-btn {
  border: none; background: var(--pc-red); color: #fff;
  border-radius: 12px; padding: 4px 14px;
  font-family: 'DiamondGrotesk', sans-serif; font-size: 0.85rem; cursor: pointer;
}
.groupe-ok-btn:hover { background: var(--pc-red); opacity: 0.85; }
.groupe-reset-btn {
  border: 1px solid var(--pc-gray-mid); background: none; color: var(--pc-gray-dark);
  border-radius: 12px; padding: 4px 14px;
  font-family: 'DiamondGrotesk', sans-serif; font-size: 0.85rem; cursor: pointer;
}
.groupe-reset-btn:hover { border-color: var(--pc-red); color: var(--pc-red); }


/* ---- Toast (notification temporaire) ---- */
.toast {
  position: fixed; bottom: 16px; right: 16px;
  background: #1d1d1f; color: #fff;
  padding: 9px 14px; border-radius: 7px;
  font-size: 12px; z-index: 2000;
  opacity: 0; transform: translateY(15px);
  transition: all .2s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #d70015; }

hr.divider { border: none; margin: 12px 0; }
.help-text { color: #6e6e73; font-size: 11px; margin-bottom: 6px; }

/* ---- Colonne Période (matin / après-midi) ---- */
th.period-col,
td.period-label {
  width: var(--w-period);
  min-width: var(--w-period);
  max-width: var(--w-period);
  text-align: center;
  font-size: var(--font-size-cal);
  padding: 0 3px;
  white-space: nowrap;
}

td.period-matin,
td.period-aprem {
  font-size: 0.85rem;
  font-weight: 400;
  text-align: left;
  color: #1d1d1f;
}

/* ---- Séparateur entre les deux lignes d'un même jour ---- */
/*
tr.day-row-matin td {
  border-bottom: none !important;
}
*/
/*
tr.day-row-aprem td {
  border-bottom: 1px solid #6e6e73;
}
  */


th.period-label-header {
  font-size: 0.75rem;
  line-height: 115%;
  font-weight: 500;
  color: #6e6e73;
  text-align: center;
}

/* ---- Ligne de total hebdomadaire : pilule posée sur la ligne ---- */
/* (espace réservé) */
tr.week-header td.week-header-cell {
  background: #ffffff;
  padding: 0;
  border-top: none;
  cursor: default;
  height: 1px;
  position: relative;
  overflow: visible;
}
/* Fonds continus : jaune sous les colonnes APP (groupe + 35h) */
tr.week-header td.week-header-cell.app-bg,
tr.week-header td.cell-hours {
  background: var(--bg-cell-app-weekend) !important;
}
/* La pilule « 35h » : blanche, contour fin, déborde sur la ligne de séparation */
.week-total-pill {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  background: var(--bg-cell-app);
  border: none;
  border-radius: 40px;
  padding: 4px 12px 0;     /* texte descendu : plus d'espace en haut dans la pilule */
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.1;
  color: #1d1d1f;
  white-space: nowrap;
}
/* Sur les colonnes APP (fond jaune), la pilule passe en fond blanc pour ressortir */
tr.week-header td.week-header-cell.app-bg .week-total-pill { background: #ffffff; }

.week-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 9px;
  padding: 0 5px 0 0;
  color: #6e6e73;
  font-family: inherit;
  vertical-align: middle;
}

.week-toggle:hover {
  color: #1d1d1f;
}

/* ---- Thead sticky — hauteurs de rangées ---- */
:root {
  --thead-r1-height: calc(var(--font-size-title) + 56px);
  --thead-total-height: calc(var(--thead-r1-height) + var(--thead-row-height));
}

/* Compense la hauteur du header sticky lors d'un scrollIntoView */
tr.day-row {
  scroll-margin-top: var(--thead-total-height);
}

/* Toutes les cellules du thead sont sticky verticalement */
table.cal thead tr.thead-r1 th {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: 40px;
  line-height: normal;
  vertical-align: bottom;
}
table.cal thead tr.thead-r2 th {
  position: sticky;
  top: var(--thead-r1-height);
  z-index: 30;
}
/* (trait sous les en-têtes col-header supprimé) */
/* ligne grises sous les lignes*/
table.cal td,
table.cal th {
  position: relative;
}

/* Séparateur entre jours : dessiné en HAUT de chaque ligne-jour uniquement
   (pas sur les lignes de total → pas de trait au-dessus des totaux) */
table.cal tbody tr.day-row td::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: #424242;
}


/* Cellule mois + violet (coin bas-gauche du thead) */
th.date-month-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 80 !important;
  height: calc(var(--thead-r1-height) + var(--thead-row-height));
  padding: 0 4px 3px 15px !important;
  background: var(--bg-th-headers);
  vertical-align: bottom;
}

.date-month-corner-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}
.date-month-corner-left {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
/* Raccourci « Afficher aujourd'hui » resté accessible pendant le défilement : le bouton
   du header (hors de la zone sticky) disparaît dès qu'on scrolle, celui-ci est à côté du
   nom du mois épinglé en haut de la liste des jours (th.date-month-corner, sticky). */
.today-target-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.today-target-btn:hover { transform: scale(1.15); }
.banner-month-name {
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.banner-violet-icon {
  font-size: 0.55rem;
  line-height: 1;
  flex-shrink: 0;
}

/* Matin / Après-midi */
th.period {
  color: #000;
  font-size: 0.9rem;
  font-weight: 500;
  vertical-align: bottom;
  padding-bottom: 4px;
  padding-left: 6px;
}


.violet-dot-inline {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1px solid #9678ff;
  vertical-align: middle;
  margin: 0 1px;
  pointer-events: none;
}
.violet-dot-inline.active { background: #9678ff; }
.violet-dot-inline.hachure { background: linear-gradient(to top, #9678ff 50%, transparent 50%); }




/* ---- Colonne Violette ---- */
.violet-dot {
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: 1px solid #9678ff;
  cursor: pointer;
}

.violet-dot::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}

.violet-dot.active {
  background: #9678ff;
}

.violet-dot.hachure {
  background: linear-gradient(to top, #9678ff 50%, transparent 50%);
  border-color: #9678ff;
}

td.violet-cell.hachure::before {
  display: none;
}

/* ---- Weekend cells read-only ---- */
tr.day-row.weekend td.cell-field { pointer-events: none; opacity: 0.7; }
tr.day-row.weekend td.date-day-col { pointer-events: auto; opacity: 1; }

/* ---- Périodes entreprise A4 APP : même fond que les lignes week-end (#c4c0a0, cf. règle
   plus bas "Week-end : toute la ligne en #c4c0a0"). Sélecteur préfixé "table.cal tbody"
   pour égaler la spécificité de "table.cal tbody td.app-bg" (ligne 488) — sinon ce fond
   plein écrase le nôtre au repos et seul :hover (plus spécifique) s'affichait. Les deux
   couleurs sont désormais identiques, donc pas de conflit résiduel les jours où une
   période entreprise tombe un week-end. ---- */
table.cal tbody td.app-entreprise {
  background: #c4c0a0 !important;
  pointer-events: none;
}
table.cal tbody td.app-entreprise-hours {
  background: #c4c0a0 !important;
}
table.cal tbody tr.day-row:hover td.app-entreprise,
table.cal tbody tr.day-row:hover td.app-entreprise-hours {
  background: #c4c0a0 !important;
  color: inherit !important;
}
/* Mot décoratif centré, à la hauteur de la case (50px normale / 25px week-end) —
   affiché un jour sur deux seulement (cf. renderGroupCell) pour ne pas surcharger
   visuellement une longue période entreprise. */
.entreprise-label {
  font-family: 'ChaumontScript', cursive;
  font-weight: 400;
  color: #f0ecc4;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 42px;
  line-height: 1;
}
tr.day-row.weekend .entreprise-label { font-size: 21px; }

/* ---- Jours fériés ---- */
tr.ferie-row td {
  background: #0d263b !important;
  color: #ffffff !important;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}
tr.ferie-row:hover td {
  background: #0d263b !important;
  color: #ffffff !important;
}
td.ferie-cell {
  font-family: 'ChaumontScript', cursive;
  font-size: 1.35rem;
  font-weight: 400;
}

/* ---- Total hebdo (colonne 35h du dimanche) ---- */
td.cell-hours-week {
  background: var(--bg-hours-cell) !important;
  font-weight: 700;
  color: #6e4f00;
  font-size: var(--font-size-cal);
}

/* ---- Weekly total label in Sunday date cell ---- */
.week-total-label {
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  color: #6e6e73;
  white-space: nowrap;
}
.week-totals-block {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  align-items: center;
  font-size: 0.7rem;
  color: #6e6e73;
  overflow: hidden;
}

.combined-display:focus {
  outline: 2px solid #9fffe0;
  outline-offset: -2px;
}

/* =====================================================================
   PILE DE CRÉNEAUX (nouveau modèle : 1 colonne par groupe × jour)
   ===================================================================== */
/* Toutes les journées : hauteur fixe 50px (loge les 2 lignes du bloc) */
table.cal tbody tr.day-row td { height: 50px; max-height: 50px; }
/* Week-ends : demi-hauteur */
table.cal tbody tr.day-row.weekend td { height: 25px; max-height: 25px; }
tr.day-row.weekend .date-day-inner { height: 25px; }
/* Week-end : toute la ligne en #c4c0a0 */
tr.day-row.weekend td,
tr.day-row.weekend td.date-day-col,
table.cal tbody tr.weekend td.app-bg,
table.cal tbody tr.weekend td.sco-bg { background: #c4c0a0 !important; }
/* Pas de séparateur entre samedi et dimanche */
table.cal tbody tr.day-row.weekend td::after { display: none; }
/* …mais on garde le trait entre vendredi et samedi (haut de la rangée samedi) */
table.cal tbody tr.day-row.weekend.sat td::after { display: block; }
td.group-cell {
  width: var(--w-group);
  max-width: var(--w-group);
  vertical-align: top;
  padding: 0 6px 0 4px;
  position: relative;     /* ancre le formulaire overlay */
  overflow: visible;
}
/* Les créneaux se positionnent en absolu à l'intérieur, au prorata réel de leur horaire dans la
   journée (cf. hourToPercent / renderGroupCell) : position et largeur reflètent l'heure de début
   et la durée, au lieu d'un empilement séquentiel. */
.slot-stack {
  position: relative;
  height: 50px;
  width: 100%;
  overflow: hidden;
}

/* --- Créneau = bloc 2 lignes, sans fond --- */
.slot { cursor: grab; }
.slot:active { cursor: grabbing; }
.slot.slot-dragging { opacity: 0.35; }
/* Créneaux dont les horaires se chevauchent : répartis sur des bandes horizontales sans conflit
   interne (cf. overlapRows). Chaque bande (.slot-row) occupe toute la largeur de la case et se
   partage la hauteur avec les autres bandes ; les créneaux qu'elle contient gardent leur
   position/largeur au prorata réel de la journée, comme dans une case normale — ils ne peuvent
   pas se chevaucher entre eux par construction. */
.slot-row {
  position: absolute;
  left: 0;
  width: 100%;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.slot-row:first-child { border-top: none; }
.slot.slot-mini {
  justify-content: center; gap: 0;
  padding: 0 8px 0 6px;
}
.slot.slot-mini .slot-body { flex-direction: row; align-items: center; gap: 4px; }
.slot.slot-mini .slot-dot { width: 9px; height: 9px; margin-right: 2px; font-size: 0.5rem; }
.slot-mini-course {
  font-family: 'DiamondGrotesk', sans-serif; font-weight: 400; color: #00033E;
  font-size: 1rem; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: clip; flex: 1 1 auto; min-width: 0;
}
.slot-mini-time {
  font-family: 'DiamondGrotesk', sans-serif; font-size: 1rem; line-height: 1; color: #00033E;
  flex: 0 0 auto; white-space: nowrap;
}
td.group-cell.drop-target { outline: 2px dashed #7c6fff; outline-offset: -2px; background: #7c6fff18; }
.slot.slot-notime {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 25%;
  min-height: 8px;
  max-height: 18px;
  z-index: 2;
  background: none;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  padding: 0;
}
.slot-notime-body {
  flex: 1; min-width: 0; padding: 0; margin: 0;
  display: flex; align-items: center; justify-content: flex-start;
  height: 100%;
}
.slot-notime-label {
  font-size: 0.68rem; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: 'DiamondGrotesk', sans-serif;
  background: #9678ff;
  padding: 2px 6px 1px 6px;
  margin: 0;
  border-radius: 40px;
}
.slot {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  box-sizing: border-box;
  padding: 4px 8px 2px 6px;
  overflow: hidden;
}
/* Pas de retrait à gauche pour les cases des groupes APP (fond jaune) */
td.group-cell.app-bg { padding-left: 0 !important; }
.slot-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
}
/* Ligne 1 : nom du cours */
.slot-l1 {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.slot-dot {
  flex: 0 0 auto;
  align-self: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'ApfelGrotezk', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
}
.slot-dot.is-novalid { background: transparent; border: 2px solid var(--c); color: var(--c); }   /* à valider : contour + ! */
.slot-dot.is-valid   { background: var(--c); border: 2px solid var(--c); color: transparent; }   /* validé : plein */
.slot-course {
  color: #00033E;
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;   /* texte simplement coupé à la largeur (pas d'abréviation) */
  /* Priorité sur la note voisine (.slot-note) : ne cède jamais de place le premier — c'est la
     note qui doit rétrécir/disparaître avant que le nom du cours ne soit lui-même coupé. */
  flex: 1 0 auto;
  min-width: 0;
}
/* Ligne 2 : horaire (gauche) + initiales (droite) */
.slot-l2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.slot-time {
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: normal;
  color: #00033E;            /* surchargé en ligne par la couleur du cours */
  flex: 0 0 auto;
  white-space: nowrap;
}
.slot-l2-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.slot-inits {
  font-family: 'ApfelGrotezk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: normal;
  color: #00033E;
  flex: 0 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.slot-empty-label { color: #00033E; opacity: 0.45; font-style: italic; }
.slot .chip-occ { color: #00033E; }

/* Badge numéroté identifiant le groupe d'un·e enseignant·e (grille + carte de survol) */
/* Fond/couleur du texte fixés en ligne par JS (couleur du cours + contraste, cf. courseColor/textColorFor) */
.grp-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  font-family: 'ChaumontScript', cursive; font-size: 0.8rem; font-weight: 400;
  margin-right: 2px; flex: 0 0 auto;
}
/* Soutenance : bloc coloré en plein (fond + texte contrastés définis en ligne par JS) */
.slot.slot-soutenance .slot-course,
.slot.slot-soutenance .slot-time,
.slot.slot-soutenance .slot-inits,
.slot.slot-soutenance .slot-note,
.slot.slot-soutenance .slot-mini-course,
.slot.slot-soutenance .slot-mini-time { color: inherit; }

/* Pilule de statut (après les initiales) — discrète, en contour */
.slot-status.status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  border-radius: 7px;
  font-family: 'ApfelGrotezk', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border: 1px solid;
  background: transparent;
}
.status-pill.st-none       { color: #c8c8ce; border-color: #dcdce0; }
.status-pill.st-ok         { color: #232323; border-color: #232323; }
.status-pill.st-encours    { color: #a98e21; border-color: #a98e21; }
.status-pill.st-changement { color: #f31331; border-color: #f31331; }

.slot-del {
  position: absolute;
  top: 2px;
  right: 4px;
  z-index: 2;
  color: #00033E;
  opacity: 0;
  font-size: 0.75rem;
  cursor: none;       /* le curseur ✕ custom (#chipCursor) prend le relais */
  transition: opacity .12s;
  background: rgba(255,255,255,0.8);
  padding: 0 2px;
}
.slot:hover .slot-del { opacity: 1; }
/* Bouton "+" toujours accessible en bas à droite de la case, même quand elle est déjà pleine
   de créneaux (donc plus d'espace vide sur lequel cliquer pour en ajouter un). */
.cell-add-btn {
  position: absolute;
  bottom: 2px; right: 2px;
  z-index: 5;
  box-sizing: border-box;
  width: 16px; height: 16px;
  padding: 0; margin: 0;
  border-radius: 50%;
  border: none;
  background: #000;
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s;
}
td.group-cell:hover .cell-add-btn { opacity: 1; }
.cell-add-btn:hover { background: #00033E; }
/* Firefox ajoute un padding/bordure interne (::-moz-focus-inner) indépendant du padding:0
   posé plus haut, ce qui déforme le cercle en ovale — on le neutralise explicitement. */
.cell-add-btn::-moz-focus-inner { border: 0; padding: 0; }

/* (Bouton « + » de grille supprimé — l'ajout se fait via le formulaire) */
.group-cell:empty, .slot-stack:empty { cursor: pointer; }

/* --- Mini-formulaire d'un créneau (overlay : ne change pas la hauteur de ligne) --- */
.slot-form {
  position: absolute;
  top: 1px;
  left: 4px;
  z-index: 60;
  width: max-content;
  min-width: 240px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 12px;
  background: #ffffff;
  border: none;
  border-radius: 10px;
  /* Absent de la spec Figma (frame posé seul sur canvas) : nécessaire ici car ce panneau
     flotte par-dessus la grille du planning, sans quoi il s'y fondrait visuellement. */
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
}
.sf-context {
  font-family: 'ApfelGrotezk', sans-serif; font-weight: 700; font-size: 9px;
  line-height: 1.282; color: var(--pc-purple); text-transform: uppercase; letter-spacing: 0.09em;
  overflow-wrap: anywhere;
}
.sf-section-label {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 16px; line-height: 1.482;
  color: var(--pc-gray-dark);
}
.sf-ens-row { display: flex; align-items: center; gap: 4px; }
.sf-ens-row .sf-ens { flex: 1 1 auto; }
.sf-ens-add {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 1px solid var(--pc-gray-mid);
  background: #fff;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--pc-navy);
}
.sf-ens-add:hover { background: var(--pc-navy); border-color: var(--pc-navy); color: #fff; }
.sf-times { display: flex; align-items: center; gap: 4px; }
.sf-de, .sf-a {
  width: 44px;
  text-align: center;
  border: 1px solid var(--pc-gray-mid);
  border-radius: 12px;
  padding: 4px 10px 2px;
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 16px;
  color: var(--pc-navy);
  background: #fff;
}
.sf-arrow { color: var(--pc-navy); }
.sf-h { color: var(--pc-gray-dark); font-size: 12px; }
.sf-module, .sf-ens, .sf-note {
  width: 100%;
  border: 1px solid var(--pc-gray-mid);
  border-radius: 12px;
  padding: 4px 10px 2px;
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 16px;
  color: var(--pc-navy);
  background: #fff;
  box-sizing: border-box;
}
.sf-de:focus, .sf-a:focus, .sf-module:focus, .sf-ens:focus, .sf-note:focus {
  outline: 2px solid var(--pc-purple);
  outline-offset: -1px;
  border-color: transparent;
}
/* Case carrée partagée (Soutenance + sélection de groupe) */
.sf-check {
  appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px; margin: 0; padding: 0;
  border: 1px solid var(--pc-navy); border-radius: 5px;
  cursor: pointer; position: relative; flex: 0 0 auto;
}
.sf-check:checked { background: var(--pc-navy); }
.sf-check:checked::after {
  content: ''; position: absolute; left: 4px; top: 1px;
  width: 3px; height: 7px; border: solid #fff; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.sf-groupe-block { display: flex; flex-direction: column; gap: 6px; }
.sf-groupe-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: nowrap; }
/* Un encadré par groupe (case du groupe + son roster dessous), empilés verticalement —
   plus de liste à plat où groupe et membres se distinguaient par un simple indentation. */
.sf-groupe-checks { display: flex; flex-direction: column; gap: 5px; flex: 1 1 auto; min-width: 0; }
.sf-groupe-item {
  border: 1px solid #e5e5e7; border-radius: 8px; padding: 5px 8px;
}
.sf-groupe-item.is-override { border-color: var(--pc-red); background: rgba(255, 77, 82, 0.06); }
.sf-groupe-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; color: var(--pc-ink); cursor: pointer; }
.sf-groupe-check .sf-ens-cluster-badge { margin-top: 0; }
.sf-groupe-glabel { color: var(--pc-navy); overflow-wrap: anywhere; }
.sf-groupe-forced {
  color: var(--pc-red); font-weight: 700; font-size: 0.62rem; text-transform: uppercase;
  letter-spacing: 0.03em; background: rgba(255, 77, 82, 0.12); border-radius: 6px; padding: 1px 5px;
}
.sf-groupe-empty { font-size: 0.78rem; color: var(--pc-gray-mid); font-style: italic; }
/* Roster : chips avec case à cocher visible (même style que les pastilles enseignant·es
   plus bas, mais avec la case gardée — pas de masquage), plutôt que case + texte à plat. */
.sf-roster { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 4px 0 0 22px; }
.sf-roster-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--pc-gray-dark); border-radius: 1rem;
  padding: 2px 8px; cursor: pointer;
  font-family: 'ApfelGrotezk', sans-serif; font-weight: 700; font-size: 0.68rem;
  color: var(--pc-gray-dark); text-transform: uppercase; background: #fff;
}
.sf-roster-chip.is-absent { opacity: 0.55; text-decoration: line-through; }
.sf-groupe-manage {
  display: flex; padding: 0 0.625rem; justify-content: flex-end; align-items: center; gap: 0.625rem;
  border-radius: 0.75rem; background: var(--pc-red);
  height: 24px; flex: 0 0 auto;
  border: none; color: #fff;
  font-family: 'DiamondGrotesk', sans-serif; font-size: 10px; line-height: 1.5;
  cursor: pointer; white-space: nowrap;
}
.sf-groupe-manage:hover { background: var(--pc-red); opacity: 0.85; }
.sf-soutenance-check { display: flex; align-items: center; gap: 3px; font-size: 16px; line-height: 1; color: var(--pc-navy); cursor: pointer; }
/* Enseignant·es sans groupe pour ce cours (seul cas restant géré ici — celleux rattaché·es
   à un groupe sont désormais dans la checklist ci-dessus, chips comprises). */
.sf-ens-chips:empty { display: none; }
.sf-ens-cluster { display: flex; align-items: flex-start; gap: 5px; }
.sf-ens-cluster-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; margin-top: 2px;
  font-family: 'ChaumontScript', cursive; font-size: 0.85rem; line-height: 1;
}
/* align-items: flex-start — sans ça les chips s'étirent à la largeur de la colonne de
   grille (~150px) au lieu d'épouser la longueur du nom qu'elles contiennent. */
.sf-ens-cluster-chips { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px; flex: 1 1 auto; min-width: 0; }
.sf-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--pc-gray-dark);
  border-radius: 1rem;
  padding: 2px 4px 2px 8px;
  font-family: 'ApfelGrotezk', sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--pc-gray-dark);
  text-transform: uppercase;
}
.sf-chip-x { border: none; background: none; cursor: pointer; color: inherit; font-size: 0.85rem; line-height: 1; padding: 0 1px; }
.sf-chip-x:hover { color: var(--pc-red); }
/* Pied de formulaire = 2 lignes de 2 boutons (frame Figma "validation" : button row1,
   button row2), plutôt qu'une seule ligne qui se met à la ligne selon la largeur dispo. */
.sf-foot { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; width: 100%; box-sizing: border-box; }
.sf-foot-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.sf-add, .sf-copy {
  border: 1px solid var(--pc-gray-dark);
  background: #fff;
  color: var(--pc-navy);
  border-radius: 12px;
  padding: 2px 10px;
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 10px;
  cursor: pointer;
}
.sf-add:hover, .sf-copy:hover { background: var(--pc-gray-dark); color: #fff; }
.sf-ok {
  border: 1px solid var(--pc-red);
  background: var(--pc-red);
  color: var(--pc-navy);
  border-radius: 12px;
  padding: 2px 10px;
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 12px;
  cursor: pointer;
}
.sf-ok:hover { opacity: 0.8; }
.sf-notify {
  border: 1px solid var(--pc-red);
  background: #fff;
  color: var(--pc-navy);
  border-radius: 12px;
  padding: 2px 10px;
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: 12px;
  cursor: pointer;
}
.sf-notify:hover { opacity: 0.7; }
.sf-notify:disabled { opacity: 0.5; cursor: default; }

/* --- Carte de détail au survol --- */
.slot-hover {
  position: fixed;
  z-index: 1000;
  display: none;
  pointer-events: none;
  width: 244px;
  padding: 10px 12px;
  background: #fff;
  border: none;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  font-family: 'DiamondGrotesk', sans-serif;
  color: #1d1d1f;
}
.hv-head {
  font-family: 'ApfelGrotezk', sans-serif;
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #9678ff;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.hv-title { font-size: 16px; font-weight: 800; line-height: 1.15; color: #0d263b; margin-bottom: 6px; overflow-wrap: anywhere; }
.hv-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.hv-time { font-family: 'Oswald', sans-serif; font-size: 15px; color: #1d1d1f; }
.hv-status { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 1rem; border: 1px solid; }
.hv-ok { color: #232323; border-color: #232323; }
.hv-encours { color: #a98e21; border-color: #a98e21; }
.hv-changement { background: #f31331; color: #ffd7df; border-color: #f31331; }
.hv-none { color: #b8b8c0; border-color: #b8b8c0; }
/* Une ligne par groupe (badge + noms séparés par des virgules) plutôt qu'un flux de
   pastilles où chaque enseignant·e répétait son badge, sans lisibilité de qui va avec qui. */
.hv-teachers { display: flex; flex-direction: column; gap: 4px; }
.hv-group-line {
  display: flex; align-items: baseline; gap: 5px;
  font-family: 'ApfelGrotezk', sans-serif; font-weight: 700; font-size: 11px; color: #1e2227;
  overflow-wrap: anywhere;
}
.hv-group-line .grp-badge { width: 17px; height: 17px; font-size: 0.9rem; flex: 0 0 auto; align-self: center; }
.hv-nogroup { flex-wrap: wrap; }
.hv-chip {
  display: inline-block; max-width: 100%; overflow-wrap: anywhere;
  border: 1px solid #6e6e73; color: #1e2227; border-radius: 1rem;
  padding: 1px 8px; font-family: 'ApfelGrotezk', sans-serif; font-weight: 700; font-size: 11px;
}
.hv-empty { color: #b8b8c0; font-style: italic; font-size: 12px; }

/* La surbrillance verte de ligne doit primer sur le fond des créneaux */
tr.day-row:hover .slot:hover { background: rgba(13,38,59,0.06); }
/* Décompte d'heures (colonne 35h) : petit, pivoté à 90°, centré dans la case */
td.cell-hours, td.cell-hours-week {
  text-align: center;
  vertical-align: middle;
}
td.cell-hours .hcount, td.cell-hours-week .hcount {
  display: inline-block;
  transform: rotate(90deg);
  font-size: 0.75rem;
  white-space: nowrap;
  line-height: 1;
}

/* ---- Modale statistiques ---- */
.stats-tabs { display: flex; gap: 6px; margin: 8px 0; }
.stats-tab {
  border: 1px solid #d2d2d7; background: #fff; border-radius: 40px;
  padding: 4px 12px; font-size: 12px; cursor: pointer;
}
.stats-tab.active { background: #000; color: #fff; border-color: #000; }
#statsList .list-manage-row { justify-content: space-between; }
#statsList .item-name { flex: 1; }

/* ---- Modale périodes entreprise ---- */
.ent-group { margin-bottom: 16px; }
.ent-group-title { font-weight: 700; margin-bottom: 6px; }
.ent-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ent-row input[type="date"] {
  border: 1px solid #d2d2d7; border-radius: 6px; padding: 4px 6px; font-family: inherit; font-size: 12px;
}
.ent-row button.danger { padding: 2px 8px; }

/* Cases à cocher d'affichage des groupes */
.group-toggles { display: inline-flex; flex-wrap: wrap; gap: 8px; font-size: 0.73rem; align-items: center; }
.group-toggles label { display: inline-flex; align-items: center; gap: 3px; }

/* Indicateur de fichier synchronisé */
.sync-status { font-size: 0.7rem; color: #0071e3; letter-spacing: 0.03em; }

/* ---- Menus déroulants du header ---- */
/* ---- Boutons flottants ---- */
.floating-nav {
  position: fixed;
  top: 12px;
  left: 24px;
  right: 264px; /* réserve la place du lapin (240px) à droite */
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
}
/* Historique + Fichier : repoussés à droite de la barre, juste avant le lapin */
#floatingNav .to-right { order: 2; }
#floatingNav .to-right-first { margin-left: auto; }
.float-btn {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #000;
  color: #000;
  padding: 3px 10px 1px;
  font-size: 0.9rem;
  font-family: 'DiamondGrotesk', sans-serif;
  border-radius: 40px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.float-btn:hover { background: #000; color: #fff; }
.float-menu { position: relative; }
.float-menu .menu-pop { left: auto; right: 0; }

/* Sélecteur d'année : même pill .float-btn que les autres boutons flottants */
#anneeSel select {
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
#anneeSel:hover select { color: #fff; }

/* ---- Bouton afficher/masquer sur les titres de groupe ---- */
.group-hide-btn {
  background: none; border: none; cursor: pointer;
  padding: 0 6px 0 0; vertical-align: middle; line-height: 1;
  opacity: 0; transition: opacity .15s;
  position: relative;
}
.group-hide-btn::after {
  content: 'Masquer';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: 0.7rem;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.group-hide-btn:hover::after { opacity: 1; }
th.group-title:hover .group-hide-btn { opacity: 1; }
.group-hide-icon { width: 20px; height: 20px; display: block; }

/* ---- Colonne masquée (bandelette fine) ---- */
:root { --w-col-hidden: 28px; }
th.group-title-collapsed {
  width: var(--w-col-hidden);
  min-width: var(--w-col-hidden);
  max-width: var(--w-col-hidden);
  padding: 0;
  cursor: pointer;
  text-align: center;
  vertical-align: bottom;
  overflow: hidden;
}
th.group-title-collapsed:hover { opacity: 0.7; }
.group-title-collapsed-label {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  padding: 8px 0 6px;
}
th.group-title-collapsed .group-hide-icon {
  width: 16px; height: 16px; margin: 0 auto 4px;
}
td.group-cell-collapsed {
  width: var(--w-col-hidden);
  min-width: var(--w-col-hidden);
  max-width: var(--w-col-hidden);
  padding: 0;
  border-right: 1px solid #e5e5e7;
}

.header-actions .menu { position: relative; }
.header-actions .menu > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center;
  border: 1px solid #000; border-radius: 40px;
  padding: 3px 10px 0; font-size: 0.975rem; font-family: 'DiamondGrotesk', sans-serif;
  background: none; color: #000;
}
.header-actions .menu > summary::-webkit-details-marker { display: none; }
.header-actions .menu[open] > summary,
.header-actions .menu > summary:hover { background: #000; color: #fff; }
.menu-pop {
  position: absolute; top: 100%; right: 0; left: auto; margin-top: 4px; z-index: 200;
  background: #fff; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  padding: 6px; min-width: 200px; display: flex; flex-direction: column; gap: 2px;
}
.menu-pop button { text-align: left; border: none; background: none; padding: 6px 10px; border-radius: 6px; font-size: 0.85rem; cursor: pointer; }
.menu-pop button:hover { background: #f0f0f0; }
.menu-pop hr { border: none; border-top: 1px solid #e5e5e7; margin: 4px 0; }

/* =====================================================================
   VUE PAR COURS
   ===================================================================== */
#courseView { margin: 0 0 80px; }
.cv-body { padding: 24px 28px 32px; }

/* Sélecteur en colonnes (façon Finder), posé sur le bandeau jaune — chaque colonne
   s'adapte à la largeur de son contenu (hug), pas de répartition proportionnelle. */
.cv-selector {
  display: flex;
  align-items: stretch;
}
/* Colonne "Groupes" (équipes projet #1/#2/#3) : n'apparaît que si le cours sélectionné en a. */
#cvGroupes { display: none; }
.cv-selector.has-groupes #cvGroupes { display: block; }
.cv-col {
  flex: 0 0 auto;
  border-left: 1px solid rgba(8, 8, 8, 0.2);
  padding: 0 8px; max-height: 220px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(8, 8, 8, 0.4) transparent;
}
.cv-col:first-child { border-left: none; padding-left: 0; }
/* Ascenseur discret (Chrome/Safari) : fin, noir translucide, pas de piste visible. */
.cv-col::-webkit-scrollbar { width: 4px; }
.cv-col::-webkit-scrollbar-track { background: transparent; }
.cv-col::-webkit-scrollbar-thumb { background: rgba(8, 8, 8, 0.4); border-radius: 2px; }
.cv-col::-webkit-scrollbar-thumb:hover { background: rgba(8, 8, 8, 0.65); }
.cv-col-title {
  font-family: 'DiamondGrotesk', sans-serif; font-weight: 500; font-size: 1.15rem;
  color: var(--pc-ink); padding: 4px 6px 6px; white-space: nowrap;
}
.cv-item {
  display: block; width: 100%; box-sizing: border-box;
  padding: 4px 6px; font-size: 0.92rem; color: var(--pc-ink); cursor: pointer;
  white-space: nowrap;
}
.cv-item:hover { background: rgba(8, 8, 8, 0.08); }
.cv-item.active { background: var(--pc-purple); }
.cv-dot { display: none; }
.cv-empty { padding: 4px 6px; color: rgba(8, 8, 8, 0.4); font-style: italic; }

/* Stats de la sélection */
.cv-stats { margin-bottom: 24px; }
.cv-stat-title { margin-bottom: 14px; }
.cv-stat-name { font-family: 'ApfelGrotezk', sans-serif; font-weight: 700; font-size: 1.9rem; color: var(--pc-navy); line-height: 1.15; }
.cv-stat-sub { font-family: 'DiamondGrotesk', sans-serif; font-size: 1rem; color: var(--pc-gray-dark); margin-top: 2px; }
.cv-stat-cards { display: flex; flex-wrap: wrap; margin-bottom: 14px; }
.cv-card { padding: 14px 20px; min-width: 120px; }
.cv-card-hours { background: var(--pc-red); }
.cv-card:not(.cv-card-hours) { background: var(--pc-gray-light); }
.cv-card-n { font-family: 'ApfelGrotezk', sans-serif; font-weight: 700; font-size: 2rem; color: #000; }
.cv-card-l { font-family: 'DiamondGrotesk', sans-serif; font-size: 0.78rem; color: var(--pc-gray-dark); }
.cv-stat-line { font-family: 'DiamondGrotesk', sans-serif; font-size: 0.9rem; color: var(--pc-navy); margin-bottom: 4px; }

/* Calendrier annuel (mois miniatures) */
.cv-calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.mc-month { }
.mc-title { font-weight: 700; font-size: 0.9rem; text-transform: capitalize; margin-bottom: 6px; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mc-dow { font-size: 0.6rem; color: #6e6e73; text-align: center; }
.mc-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; border-radius: 4px; color: #1d1d1f; background: #f4f4f6;
}
.mc-day.mc-empty { background: transparent; }
.mc-day.mc-on { font-weight: 700; }
/* Vue par cours : jours sans séance / en période entreprise dans les mêmes gris que la
   frise chronologique (scopé à .cv-calendar pour ne pas affecter les autres pages qui
   réutilisent .mc-day/.mc-ent, ex. par-etudiant.html). */
.cv-calendar .mc-day { background: var(--pc-gray-light); }
.cv-calendar .mc-day.mc-empty { background: transparent; }

/* Vue par cours : frise(s) chronologique(s) (affichée au-dessus de la grille calendrier
   quand au moins un cours ou un·e enseignant·e est sélectionné) — une ligne par entité. */
.cv-timeline { margin: 80px 0; }
.cv-tl-rows { display: flex; flex-direction: column; gap: 28px; }
/* Titre + dates empilés au-dessus de la piste (jamais à côté) : la piste occupe alors toute
   la largeur sur chaque ligne, ce qui garantit que 2 pistes affichées l'une sous l'autre
   restent à la même échelle — un libellé à largeur variable posé à côté du bar décalerait
   son point de départ d'une ligne à l'autre. */
.cv-tl-row { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.cv-tl-row-label {
  align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: 'DiamondGrotesk', sans-serif; font-weight: 500; font-size: 0.82rem;
  color: var(--pc-ink); padding: 3px 8px; border-radius: 4px; background: var(--pc-gray-light);
}
.cv-tl-dates {
  display: flex; justify-content: space-between;
  font-family: 'DiamondGrotesk', sans-serif; font-size: 0.78rem; color: var(--pc-gray-dark);
}
.cv-tl-track { position: relative; display: grid; gap: 0; height: 20px; width: 100%; }
.cv-timeline .mc-day {
  aspect-ratio: auto; display: block; background: none; font-size: 0;
  border-radius: 0; height: 100%; padding: 0; position: relative;
}
.cv-timeline .mc-day.red { cursor: help; }
.cv-timeline .mc-day.gray { background: var(--pc-gray-light); }
.cv-timeline .mc-day.ent { background: var(--pc-gray-dark); }
.cv-tl-legend {
  display: flex; gap: 16px; margin-top: 14px;
  font-family: 'DiamondGrotesk', sans-serif; font-size: 0.78rem; color: var(--pc-gray-dark);
}
.cv-tl-leg-item { display: inline-flex; align-items: center; gap: 6px; }
.cv-tl-dot { width: 14px; height: 14px; border-radius: 0; display: inline-block; }
.cv-tl-dot.gray { background: var(--pc-gray-light); }
.cv-tl-dot.ent { background: var(--pc-gray-dark); }

/* Vue par cours : jours entreprise + légende (aplat gris foncé) */
.mc-day.mc-ent {
  background-color: #8a8a8a;
  color: #ffffff;
}
.cv-calendar .mc-day.mc-ent { background-color: var(--pc-gray-dark); color: #fff; }
.cv-legend { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: #6e6e73; margin-bottom: 4px; }
.cv-leg-ent { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid #ececec;
  background-color: #8a8a8a; }

/* Note additionnelle d'un créneau : cède la place en premier face au nom du cours
   (.slot-course) quand l'espace manque — rétrécit, puis se fait couper, avant lui. */
.slot-note {
  font-family: 'ApfelGrotezk', sans-serif; font-size: 0.72rem; color: #6e6e73; margin-left: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: clip;
  flex: 0 1 auto; min-width: 0;
}
.hv-note { font-family: 'ApfelGrotezk', sans-serif; font-size: 0.8rem; font-weight: 400; color: #6e6e73; overflow-wrap: anywhere; }
/* .sf-note : voir la règle groupée avec .sf-module/.sf-ens plus haut (pilule Figma) */

/* "Autonomie" affiché quand aucun enseignant */
.slot-inits.slot-inits-auto { font-style: italic; color: #9aa0a6; font-weight: 400; }

/* Sélecteur de couleur dans la liste des modules */
.mod-color { width: 26px; height: 22px; padding: 0; border: 1px solid #d2d2d7; border-radius: 5px; cursor: pointer; background: none; flex: 0 0 auto; }

/* ===================================================================
   ASSISTANT « Remplir par module » (panneau header)
   =================================================================== */
.wizard { font-family: 'DiamondGrotesk', sans-serif; max-width: none; }
.wiz-cols { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.wiz-col { display: flex; flex-direction: column; gap: 12px; min-width: 220px; }
/* Champs et menus en pilule (rayon = 18px) */
.wiz-field, .wiz-num, .wiz-color, .wiz-row button, .wiz-cal-nav button { border-radius: 18px !important; }
.wiz-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.wiz-head strong { font-size: 1.3rem; }
.wiz-toggle { background: none; border: 1px solid #000; border-radius: 40px; padding: 2px 10px; cursor: pointer; font-family: inherit; font-size: 0.8rem; }
.wiz-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.wiz-field { flex: 1; padding: 6px 8px; border: 1px solid #b9b9bc; border-radius: 6px; font-family: inherit; font-size: 0.9rem; background: #fff; }
.wiz-color { width: 38px; height: 32px; padding: 0; border: 1px solid #b9b9bc; border-radius: 6px; cursor: pointer; background: none; }
.wiz-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.wiz-num { width: 70px; padding: 6px 8px; border: 1px solid #b9b9bc; border-radius: 6px; font-family: inherit; }
.wiz-row button { border: 1px solid #b9b9bc; background: #fff; border-radius: 6px; padding: 6px 10px; cursor: pointer; font-family: inherit; }
/* Étapes en colonne, révélées progressivement */
.wiz-step { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.wiz-step-lbl { font-family: 'ApfelGrotezk', sans-serif; font-weight: 700; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: #6e6e73; }
.wiz-step .wiz-field, .wiz-step .wiz-num { width: 100%; }
.wiz-step .wiz-row { margin-bottom: 0; }
/* Barre d'heures : pleine = couleur du cours, part planifiée en liseré foncé */
.wiz-bar { height: 10px; border-radius: 5px; overflow: hidden; }
.wiz-bar-planned { height: 100%; border-radius: 5px; box-shadow: inset 0 0 0 2px #424242; background: transparent; }
.wiz-bar-info { font-size: 0.78rem; color: #1d1d1f; margin-bottom: 8px; }
.wiz-tchips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.wiz-tchip { display: inline-flex; align-items: center; gap: 3px; border: 1px solid #6e6e73; border-radius: 1rem; padding: 1px 4px 1px 8px; font-family: 'ApfelGrotezk', sans-serif; font-weight: 700; font-size: 0.72rem; color: #6e6e73; }
.wiz-tchip button { border: none; background: none; cursor: pointer; color: inherit; font-size: 0.85rem; }
.wiz-muted { color: #9aa0a6; font-size: 0.75rem; }
.wiz-cal-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.wiz-cal-nav button { border: 1px solid #b9b9bc; background: #fff; border-radius: 6px; padding: 1px 9px; cursor: pointer; }
.wiz-cals { display: flex; gap: 14px; }
.wm-month { font-size: 0.7rem; }
.wm-title { font-weight: 700; text-transform: capitalize; margin-bottom: 3px; font-size: 0.78rem; }
.wm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.wm-dow { text-align: center; color: #9aa0a6; font-size: 0.6rem; }
.wm-day { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 4px; cursor: pointer; box-sizing: border-box; }
.wm-day:not(.wm-we):not(.wm-on):hover { background: #e8f0ff; }
.wm-empty { visibility: hidden; }
.wm-we { color: #c8c8ce; cursor: default; }
.wm-sel { outline: 2px solid #0071e3; }
/* Mini-formulaire de planification d'un jour */
.wiz-dayform { margin-top: 8px; padding: 8px; border: 1px solid #b9b9bc; border-radius: 8px; background: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wiz-dayform input[type="text"] { border: 1px solid #b9b9bc; border-radius: 5px; padding: 3px; text-align: center; font-family: inherit; }
.wf-teachers { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.wf-tk { font-size: 0.8rem; display: inline-flex; align-items: center; gap: 3px; }
.wiz-ok { background: #000 !important; color: #fff; border: 1px solid #000 !important; border-radius: 40px !important; padding: 4px 14px !important; }

/* Panneau latéral « Remplir par module » */
.wiz-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 340px;
  background: #fff; box-shadow: -8px 0 30px rgba(0,0,0,0.18);
  transform: translateX(100%); transition: transform .2s ease;
  z-index: 1500; padding: 16px 18px; overflow-y: auto; box-sizing: border-box;
}
.wiz-drawer.open { transform: translateX(0); }
.wiz-close { border: none; background: none; font-size: 1.1rem; cursor: pointer; line-height: 1; }
.wiz-planhint { background: #f5f5f7; border-radius: 10px; padding: 10px 12px; font-size: 0.85rem; line-height: 1.45; }


/* =====================================================================
   CALENDRIERS ICS — colonnes calendrier juxtaposées (lecture seule)
   ===================================================================== */
:root { --w-cal: 220px; }

/* -- En-tête (1ère ligne) : titre du calendrier, coloré -- */
th.cal-title {
  font-size: var(--font-size-title);
  font-weight: 400;
  border-bottom: none !important;
  border-right: none;
  text-transform: uppercase;
  text-align: left;
  vertical-align: bottom;
  padding: 0 6px 4px;
  color: var(--cal-color, #2563eb);
  background: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-title-dot {
  display: inline-block;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cal-color, #2563eb);
  margin-right: 6px; vertical-align: middle;
}
th.cal-title:hover .group-hide-btn { opacity: 1; }

/* Calendrier masqué : bandelette verticale fine (mêmes dimensions que les groupes masqués) */
th.cal-title-collapsed {
  width: var(--w-col-hidden);
  min-width: var(--w-col-hidden);
  max-width: var(--w-col-hidden);
  padding: 0;
  cursor: pointer;
  text-align: center;
  vertical-align: bottom;
  overflow: hidden;
  color: var(--cal-color, #2563eb);
}
th.cal-title-collapsed:hover { opacity: 0.7; }
th.cal-title-collapsed .group-hide-icon { width: 16px; height: 16px; margin: 0 auto 4px; }

/* -- Sous-en-tête (2ᵉ ligne) -- */
th.col-header.cal-col-header { color: #6e6e73; font-style: italic; }

/* -- Cellules du corps -- */
td.cal-cell {
  width: var(--w-cal);
  vertical-align: top;
  border-left: 1px solid #e5e5e7;
  padding: 3px 4px;
  background: #ffffff;
}
tr.day-row.weekend td.cal-cell,
td.cal-cell.cal-cell-weekend { background: var(--bg-row-weekend); }
tr.week-header td.week-header-cell.cal-cell { border-left: 1px solid #e5e5e7; }

.cal-event-stack { display: flex; flex-direction: column; gap: 3px; }

/* Un événement : pastille colorée à gauche, horaire + titre */
.cal-event {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.8rem;
  line-height: 1.25;
  padding: 2px 6px 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--cal-color, #2563eb) 12%, #fff);
  border-left: 3px solid var(--cal-color, #2563eb);
  overflow: hidden;
}
.cal-event-time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--cal-color, #2563eb);
  font-weight: 600;
  white-space: nowrap;
}
.cal-event-title {
  flex: 1 1 auto;
  color: #1d1d1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chevauchement avec une séance planifiée : bord rouge + icône d'alerte */
.cal-event.cal-event-conflict {
  background: #fdecec;
  border-left-color: #dc2626;
  box-shadow: inset 0 0 0 1px #f3b0b0;
}
.cal-event-warn { color: #dc2626; margin-right: 3px; }

/* Cases à cocher afficher/masquer des calendriers (menu Réglage) */
.cal-toggles { display: inline-flex; flex-wrap: wrap; gap: 8px; font-size: 0.73rem; align-items: center; }
.cal-toggles label { display: inline-flex; align-items: center; gap: 3px; }
.cal-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }

/* -- Modal de gestion des calendriers -- */
.cal-manager-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.cal-manager-row {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid #e5e5e7; border-radius: 10px; padding: 8px 10px;
}
.cal-manager-row .cal-swatch-lg { width: 16px; height: 16px; border-radius: 4px; flex: 0 0 auto; }
.cal-manager-info { flex: 1 1 auto; min-width: 0; }
.cal-manager-name { font-weight: 600; }
.cal-manager-url { font-size: 0.75rem; color: #86868b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-scope-badge {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 20px; flex: 0 0 auto;
}
.cal-scope-badge.shared { background: #e0edff; color: #1d4ed8; }
.cal-scope-badge.private { background: #eee; color: #555; }
.cal-manager-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.cal-manager-actions button { border: none; background: #f0f0f2; border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 0.8rem; }
.cal-manager-actions button:hover { background: #e2e2e6; }
.cal-manager-actions button.danger:hover { background: #f7dada; color: #b91c1c; }

.cal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.cal-form .cal-form-full { grid-column: 1 / -1; }
.cal-form label { display: flex; flex-direction: column; gap: 3px; font-size: 0.85rem; color: #333; }
.cal-form input[type="text"], .cal-form input[type="url"], .cal-form select {
  border: 1px solid #b9b9bc; border-radius: 6px; padding: 6px 8px; font-family: inherit; font-size: 0.9rem;
}
.cal-form input[type="color"] { width: 44px; height: 34px; border: 1px solid #b9b9bc; border-radius: 6px; padding: 2px; cursor: pointer; }
.cal-form-hint { font-size: 0.78rem; color: #86868b; line-height: 1.4; }
