/* GMAO CMCP — Planification plus simple sur téléphone (v1.0)
 * - Fenêtre Planifier : choix en un geste (date, heure, durée d'arrêt, même équipe)
 * - Liste « À planifier » en plein écran sur téléphone, bouton libellé
 * - Bouton « Copier / envoyer le plan » visible dans le Suivi sur téléphone
 */

/* ---------- Pastilles de choix rapide (tous écrans) ---------- */
.gm-qk { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gm-qk-b {
  appearance: none; border: 1px solid #d4d4d8; background: #fff; color: #18181b;
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  padding: 8px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.gm-qk-b:focus-visible { outline: 2px solid #ff6a13; outline-offset: 2px; }
.gm-qk-b.is-on { background: #0a0a0b; border-color: #0a0a0b; color: #fff; }
.gm-qk-b.is-stop { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.gm-qk-b.is-stop.is-on { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.gm-qk-team { margin: 0 0 8px; }
.gm-qk-team .gm-qk-b { white-space: normal; text-align: left; line-height: 1.25; border-style: dashed; }
.gm-qk-team .gm-qk-b.is-on { border-style: solid; }
@media (hover: hover) { .gm-qk-b:hover:not(.is-on) { border-color: #0a0a0b; } }

/* Bouton WhatsApp dans la fenêtre « Plan d'action — message Outlook » */
.gm-xpm-wa { white-space: nowrap; }

/* ---------- Téléphone ---------- */
@media (max-width: 639px) {
  /* Fenêtre Planifier : une colonne, boutons plus grands, équipe sans 2e barre de défilement */
  .gm-pm-when { grid-template-columns: 1fr !important; }
  .gm-qk { gap: 8px; }
  .gm-qk-b { font-size: 14px; padding: 11px 14px; min-height: 44px; }
  html body .gm-team-l { max-height: none !important; overflow: visible !important; }

  /* Liste « À planifier » en plein écran */
  html body .gmao-planning-sidebar { width: 100vw !important; max-width: 100vw !important; }
  /* La liste reste ouverte derrière les fenêtres Planifier / Réalisé (elle passe dessous) */
  html body .gm-pm-ov { z-index: 70 !important; }
  html body .gmao-planning-shell:has(.gm-pm-ov, .fixed.inset-0.z-50) .gmao-planning-sidebar { z-index: 40 !important; }

  /* Bouton libellé « 61 à planifier » */
  html body .gm-m-todo {
    flex: 1 1 100%; justify-content: center; gap: 8px;
    min-height: 46px; padding: 10px 14px; font-size: 15px; border-radius: 10px;
    background: #ff6a13 !important; color: #fff !important;
  }
  html body .gm-m-todo svg { width: 18px; height: 18px; }
  html body .gm-m-todo b { font-size: 17px; font-weight: 900; }

  /* Bouton « Copier / envoyer le plan » dans le Suivi */
  .gm-m-copy {
    flex: 1 1 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 10px 14px; border: 0; border-radius: 10px;
    background: #25d366; color: #fff; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
  }
  .gm-m-copy:active { filter: brightness(.95); }

  /* Vue Jour : une carte par machine, à la hauteur de son contenu (plus de grand vide) */
  html body .gmao-dgrid .gmao-dm { height: auto !important; max-height: none !important; }

  /* Fenêtre de copie : boutons du pied lisibles et à portée du pouce */
  html body .gmao-xpm-f { flex-wrap: wrap; gap: 8px; }
  html body .gmao-xpm-f .gm-xpm-wa { order: -1; flex: 1 1 100%; min-height: 46px; background: #25d366; border-color: #25d366; color: #fff; font-weight: 800; }
}
