/* ---- 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);
}

/* =====================================================================
   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: 1.5rem;
  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;
}
.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; }

/* ---- 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); }


/* =====================================================================
   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: var(--font-size-headers);
}
/* 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; }

.groupe-row {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 8px; border-bottom: 1px solid #e5e5e7;
}
.groupe-row:last-child { border-bottom: none; }
.groupe-row-head { display: flex; align-items: center; gap: 6px; }
.groupe-label-input {
  flex: 1; padding: 6px 8px; border: 1px solid #d2d2d7; border-radius: 6px;
  font-size: 13px; font-family: inherit; font-weight: 600;
}
.groupe-sub-label { font-size: 11px; color: #6e6e73; margin-top: 2px; }


/* ---- 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: 30px;
  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%;
}
.banner-month-name {
  font-family: 'DiamondGrotesk', sans-serif;
  font-size: var(--font-size-headers);
  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: 'DiamondGrotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.15em;
}

/* ---- 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;
}
/* Blocs empilés séquentiellement, sans espace (largeur absolue = durée) */
.slot-stack {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  height: 50px;
  width: 100%;
  overflow: hidden;
}

/* --- Créneau = bloc 2 lignes, sans fond --- */
.slot { cursor: grab; }
/* Créneau démarrant à 14h ou après : calé à droite de la cellule (pousse aussi les créneaux suivants) */
.slot.slot-pm { margin-left: auto; }
.slot:active { cursor: grabbing; }
.slot.slot-dragging { opacity: 0.35; }
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: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  box-sizing: border-box;
  height: 50px;
  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) */
  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; }

/* 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 « + » 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: 224px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: #ffffff;
  border: none;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
}
.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 #b9b9bc;
  background: #fff;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: #1d1d1f;
}
.sf-ens-add:hover { background: #0071e3; border-color: #0071e3; color: #fff; }
.sf-times { display: flex; align-items: center; gap: 4px; }
.sf-de, .sf-a {
  width: 34px;
  text-align: center;
  border: 1px solid #b9b9bc;
  border-radius: 5px;
  padding: 3px 2px;
  font-family: inherit;
  font-size: 0.85rem;
  background: #fff;
}
.sf-arrow { color: #6e6e73; }
.sf-h { color: #6e6e73; font-size: 0.8rem; }
.sf-module, .sf-ens {
  width: 100%;
  border: 1px solid #b9b9bc;
  border-radius: 5px;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 0.85rem;
  background: #fff;
  box-sizing: border-box;
}
.sf-de:focus, .sf-a:focus, .sf-module:focus, .sf-ens:focus {
  outline: 2px solid #0071e3;
  outline-offset: -1px;
  border-color: transparent;
}
.sf-groupe-row { display: flex; align-items: center; gap: 4px; }
.sf-groupe {
  flex: 1 1 auto;
  width: 100%;
  border: 1px solid #b9b9bc;
  border-radius: 5px;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 0.85rem;
  background: #fff;
  box-sizing: border-box;
}
.sf-groupe:focus { outline: 2px solid #0071e3; outline-offset: -1px; border-color: transparent; }
.sf-groupe-manage {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 1px solid #b9b9bc;
  background: #fff;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  color: #1d1d1f;
}
.sf-groupe-manage:hover { background: #0071e3; border-color: #0071e3; color: #fff; }
.sf-ens-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.sf-ens-chips:empty { display: none; }
.sf-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #6e6e73;
  border-radius: 1rem;
  padding: 0 4px 0 7px;
  font-family: 'ApfelGrotezk', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  color: #6e6e73;
}
.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: #d70015; }
.sf-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.sf-add {
  border: 1px solid #b9b9bc;
  background: #fff;
  color: #1d1d1f;
  border-radius: 40px;
  padding: 3px 10px;
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}
.sf-add:hover { background: #f0f0f0; border-color: #0071e3; color: #0071e3; }
.sf-copy {
  border: 1px solid #b9b9bc;
  background: #fff;
  color: #1d1d1f;
  border-radius: 40px;
  padding: 3px 10px;
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}
.sf-copy:hover { background: #f0f0f0; border-color: #0071e3; color: #0071e3; }
.sf-foot { flex-wrap: wrap; }
.sf-ok {
  border: 1px solid #000;
  background: #000;
  color: #fff;
  border-radius: 40px;
  padding: 3px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.sf-ok:hover { background: #333; }

/* --- 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; }
.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; }
.hv-teachers { display: flex; flex-wrap: wrap; gap: 4px; }
.hv-chip {
  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;
  right: 16px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 4px;
}
.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; }

/* ---- 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: 1px solid #000; 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 { padding: 16px 24px 80px; max-width: 1100px; }
/* Sélecteur en colonnes (façon Finder) */
.cv-selector {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.2fr;
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  overflow: hidden;
  height: 260px;
  margin-bottom: 20px;
}
.cv-col { border-right: 1px solid #e5e5e7; overflow-y: auto; }
.cv-col:last-child { border-right: none; }
.cv-col-title {
  position: sticky; top: 0;
  background: #fafafa; border-bottom: 1px solid #e5e5e7;
  font-family: 'ApfelGrotezk', sans-serif; font-weight: 700; font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: #6e6e73;
  padding: 6px 10px;
}
.cv-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; font-size: 0.85rem; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cv-item:hover { background: #f0f0f0; }
.cv-item.active { background: #00033E; color: #fff; }
.cv-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.cv-empty { padding: 10px; color: #c0bfca; font-style: italic; }

/* Stats de la sélection */
.cv-stats { margin-bottom: 24px; }
.cv-stat-title { font-size: 1.5rem; font-weight: 800; color: #00033E; margin-bottom: 12px; }
.cv-stat-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cv-card {
  border: 1px solid #e5e5e7; border-radius: 10px; padding: 12px 18px; min-width: 110px;
}
.cv-card-n { font-size: 1.6rem; font-weight: 800; color: #00033E; }
.cv-card-l { font-size: 0.72rem; color: #6e6e73; text-transform: uppercase; letter-spacing: 0.04em; }
.cv-stat-line { font-size: 0.9rem; color: #1d1d1f; 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 entreprise + légende (motif de points, mêmes couleurs qu'avant) */
.mc-day.mc-ent {
  background-color: #ffffff;
  background-image: radial-gradient(#9aa0a6 1px, transparent 1.6px);
  background-size: 6px 6px;
  color: #9aa0a6;
}
.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: #ffffff;
  background-image: radial-gradient(#9aa0a6 1px, transparent 1.6px);
  background-size: 6px 6px; }

/* Note additionnelle d'un créneau */
.slot-note { font-family: 'ApfelGrotezk', sans-serif; font-size: 0.72rem; color: #6e6e73; margin-left: 4px; white-space: nowrap; }
.hv-note { font-family: 'ApfelGrotezk', sans-serif; font-size: 0.8rem; font-weight: 400; color: #6e6e73; }
.sf-note {
  width: 100%; border: 1px solid #b9b9bc; border-radius: 5px; padding: 4px 6px;
  font-family: inherit; font-size: 0.82rem; background: #fff; box-sizing: border-box;
}
.sf-note:focus { outline: 2px solid #0071e3; outline-offset: -1px; border-color: transparent; }

/* "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; }
