/* LI_MENTOR_LAYOUT_WIDTH_V637_R1
 * Mentor uniquement. Largeurs fluides sans toucher aux donnees ou aux vues Client.
 * Pas de couleur imposee au bouton #calendarModelPicker (il reste noir comme R4).
 */
/* Boite de rendu fluide : ne pas toucher aux autres pages Mentor. */
body[data-admin-session="1"][data-ui-mode="coach"]:not(.mentor-full-preview) #app .program-model-page,
body[data-admin-session="1"][data-ui-mode="coach"]:not(.mentor-full-preview) #app .program-model-board-shell,
body[data-admin-session="1"][data-ui-mode="coach"]:not(.mentor-full-preview) #app .mentor-calendar-top,
body[data-admin-session="1"][data-ui-mode="coach"]:not(.mentor-full-preview) #modal .modal-card:has(.model-picker-modal){
  box-sizing:border-box;
}

/* Largeur de la zone calendrier Mentor et de la barre d'actions. */
body[data-admin-session="1"][data-ui-mode="coach"][data-ui-page="schedule"]:not(.mentor-full-preview) #app .mentor-schedule-main,
body[data-admin-session="1"][data-ui-mode="coach"][data-ui-page="schedule"]:not(.mentor-full-preview) #app .mentor-calendar-top,
body[data-admin-session="1"][data-ui-mode="coach"][data-ui-page="schedule"]:not(.mentor-full-preview) #app .mentor-three-months {
  width:100%; max-width:100%; min-width:0;
}
body[data-admin-session="1"][data-ui-mode="coach"][data-ui-page="schedule"]:not(.mentor-full-preview) #app .mentor-calendar-actions {
  min-width:0; max-width:100%; flex-wrap:wrap; justify-content:flex-end;
}

/* Largeur du modèle calendrier (éditeur Mentor > Modèles).
   Conserver l'implantation sidebar existante mais interdire la troncature du plateau. */
body[data-admin-session="1"][data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-page {
  min-width:0; max-width:100%; width:100%;
}
body[data-admin-session="1"][data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-board-shell,
body[data-admin-session="1"][data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-board-toolbar {
  width:100%; max-width:100%; min-width:0;
}
body[data-admin-session="1"][data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-title-fields {
  min-width:0; max-width:100%; flex:1 1 360px;
}
body[data-admin-session="1"][data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-title-fields :is(input,textarea,select) {
  width:100%; min-width:0; max-width:100%;
}
body[data-admin-session="1"][data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app #programModelInlineCalendar {
  width:100%; max-width:100%; min-width:0; overflow-x:auto; overscroll-behavior-x:contain;
}

/* Fenêtre « Modèle calendrier » / attribution d'un contenu : adaptation PC/mobile. */
body[data-admin-session="1"][data-ui-mode="coach"]:not(.mentor-full-preview) #modal .modal-card:has(.model-picker-modal) {
  width:min(1040px,calc(100vw - 32px)) !important;
  max-width:calc(100vw - 32px) !important;
  min-width:0 !important;
}
body[data-admin-session="1"][data-ui-mode="coach"]:not(.mentor-full-preview) #modal #modalBody .model-picker-modal {
  width:100%; max-width:100%; min-width:0;
}
body[data-admin-session="1"][data-ui-mode="coach"]:not(.mentor-full-preview) #modal #modalBody .model-picker-modal .grid {
  min-width:0; max-width:100%;
}
body[data-admin-session="1"][data-ui-mode="coach"]:not(.mentor-full-preview) #modal #modalBody .model-picker-modal :is(input,select,textarea) {
  width:100%; max-width:100%; min-width:0;
}

@media(max-width:760px){
  body[data-admin-session="1"][data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-page {
    grid-template-columns:minmax(0,1fr) !important;
  }
  body[data-admin-session="1"][data-ui-mode="coach"]:not(.mentor-full-preview) #modal .modal-card:has(.model-picker-modal) {
    width:calc(100vw - 20px) !important;max-width:calc(100vw - 20px) !important;
  }
  body[data-admin-session="1"][data-ui-mode="coach"]:not(.mentor-full-preview) #modal #modalBody .model-picker-modal .grid.grid-2 {
    grid-template-columns:minmax(0,1fr) !important;
  }
}

/* LI_MENTOR_MODELES_FIX_V637_R2
   Correction des elements REELS du menu Parcours (classes renderues par app.js),
   et des deux colonnes de l'editeur. Mentor uniquement, aucune ecriture de donnees.
   Le calendrier conserve son defilement horizontal INTERNE pour ses 7 jours.
*/
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-page {
  display:grid !important;
  grid-template-columns: minmax(290px, 320px) minmax(0, 1fr) !important;
  column-gap:clamp(14px,1.5vw,24px) !important;
  align-items:start !important;
  box-sizing:border-box !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
}
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-list-panel,
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-board-shell,
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-list,
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-board-toolbar {
  box-sizing:border-box !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
}
/* Corrige les noms noirs (Leader Impactant, SPORT PRO...) dans les cartes sombres. */
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-list-panel .program-model-list-item,
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-list-panel .program-model-list-item > span,
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-list-panel .program-model-list-item > b,
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-list-panel .program-model-list-item > strong {
  color:#f8f9fc !important;
  -webkit-text-fill-color:#f8f9fc !important;
}
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-list-panel .program-model-list-item > small {
  color:#cdd3dc !important;
  -webkit-text-fill-color:#cdd3dc !important;
}
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-list-panel .program-model-list-item {
  box-sizing:border-box !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  text-align:left;
}
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-list-panel .program-model-list-item > :is(span,small) {
  max-width:100% !important;
  min-width:0 !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  text-overflow:clip !important;
}
/* Le contenu de chaque semaine peut deborder uniquement dans son plateau defilant,
   pas dans la page ou dans le panneau voisin. */
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app #programModelInlineCalendar {
  box-sizing:border-box !important;
  display:block;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow-x:auto !important;
  overscroll-behavior-x:contain;
}
body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-title-fields {
  min-width:0 !important;
  max-width:100% !important;
}
@media (max-width:970px) {
  body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-page {
    grid-template-columns:minmax(0,1fr) !important;
    row-gap:16px !important;
  }
  body[data-ui-mode="coach"][data-ui-page="models"]:not(.mentor-full-preview) #app .program-model-list-panel {
    width:100% !important;
    max-width:100% !important;
  }
}
