/* ============================================================
   planning-envoi.css — fenêtre « Envoyer les plannings » (envoi groupé, 2026-10)
   Même langage visuel que la fiche élève (fiche-eleve.css) : en-tête dégradé teal,
   cartes arrondies, puces segmentées, encres ≥ 4,5:1. Préfixe bp-. Chargé APRÈS styles.css.
   Mode nuit (body.dark-mode) en fin de fichier.
   ============================================================ */

.bp-fond { padding: 16px; }
.bp { width: 100%; max-width: 1120px; height: min(92vh, 880px); display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); color: #0f172a; }

/* --- en-tête --- */
.bp-tete { flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 16px 20px 14px;
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%); border-bottom: 1px solid #e5e7eb; }
.bp-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0;
  background: #0f766e; box-shadow: 0 4px 12px rgba(15, 118, 110, .25); }
.bp-id { flex: 1; min-width: 0; }
.bp-titre { margin: 0; font-size: 20px; font-weight: 800; color: #0f172a; line-height: 1.2; }
.bp-sous { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bp-pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: #334155; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-pill--t { background: #ccfbf1; color: #115e59; }
.bp-fermer { width: 38px; height: 38px; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff; color: #475569; font-size: 16px;
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.bp-fermer:hover { background: #f1f5f9; color: #0f172a; }

/* --- corps : réglages | aperçu --- */
.bp-corps { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); background: #f8fafc; }
.bp-reglages { min-height: 0; overflow-y: auto; padding: 14px 16px 18px; border-right: 1px solid #e5e7eb; display: flex; flex-direction: column; gap: 12px; }
.bp-apercu { min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 16px; overflow-y: auto; }

.bp-etape { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px 14px; }
.bp-etape--familles { display: flex; flex-direction: column; flex: 1 1 0; min-height: 260px; }
.bp-etape-t { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; font-weight: 700; color: #334155;
  text-transform: uppercase; letter-spacing: .04em; }
.bp-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #0f766e; color: #fff; font-size: 12px; letter-spacing: 0; }
.bp-etape-act { margin-left: auto; display: flex; gap: 10px; text-transform: none; letter-spacing: 0; }

/* ① intention */
/* segmenté, comme .fe-seg de la fiche élève */
.bp-intentions { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; border-radius: 12px; background: #e2e8f0; }
.bp-int { font: inherit; font-size: 13.5px; font-weight: 600; color: #475569; background: none; border: 0; border-radius: 9px; padding: 8px 8px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-int:hover { color: #0f172a; }
.bp-int--act, .bp-int--act:hover { background: #fff; color: #0f766e; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.bp-int-aide { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.45; color: #475569; }
.bp-int-aide b { color: #0f172a; }

/* ② période */
.bp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bp-chip { font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid #e2e8f0; background: #f8fafc;
  color: #334155; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.bp-chip:hover { background: #f0fdfa; border-color: #99f6e4; }
.bp-chip--vac { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.bp-chip--act, .bp-chip--act:hover { background: #0f766e; border-color: #0f766e; color: #fff; }
.bp-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.bp-dates label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #475569; }
.bp-dates label .bp-input { flex: 1 1 0; width: auto; }
.bp-input { width: 100%; min-width: 0; font: inherit; font-size: 13.5px; color: #0f172a; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; }
.bp-input:focus { outline: none; border-color: #0d9488; box-shadow: 0 0 0 3px rgba(13, 148, 136, .18); }
.bp-note { font-size: 12.5px; color: #475569; margin-top: 8px; line-height: 1.5; }
.bp-note:empty { display: none; }
.bp-lien { font: inherit; font-size: 12.5px; font-weight: 600; color: #0f766e; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.bp-lien:hover { color: #115e59; }

/* ③ familles */
.bp-outils { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 8px; }
.bp-recherche { flex: 1 1 100%; }
.bp-bascule { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #475569; white-space: nowrap; cursor: pointer; }
.bp-bascule input, .bp-fam-cb, .bp-cc-cb { accent-color: #0f766e; }
.bp-liste { flex: 1 1 0; min-height: 120px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.bp-fam { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 10px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; transition: background .1s, border-color .1s; }
.bp-fam + .bp-fam { margin-top: 2px; }
.bp-fam:hover { background: #f8fafc; }
.bp-fam--coche { background: #f0fdfa; }
.bp-fam--coche:hover { background: #e6fbf6; }
.bp-fam--actif { border-color: #5eead4; box-shadow: inset 3px 0 0 #0d9488; }
.bp-fam--vide { opacity: .72; }
.bp-fam-cb { width: 17px; height: 17px; margin-top: 2px; cursor: pointer; }
.bp-fam-nom { font-size: 14px; font-weight: 600; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-fam-role { font-size: 11px; font-weight: 700; color: #475569; background: #f1f5f9; border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: 1px; }
.bp-fam-sous { font-size: 12.5px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.bp-cc-opt { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12px; color: #475569; cursor: pointer; }
.bp-fam-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bp-badge { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: #f1f5f9; color: #334155; }
.bp-badge--t { background: #ccfbf1; color: #115e59; }
.bp-badge--o { background: #fef3c7; color: #92400e; }
.bp-badge--i { background: #e0e7ff; color: #3730a3; }
.bp-badge--g { background: #f1f5f9; color: #64748b; }
.bp-badge--v { background: #dcfce7; color: #166534; }
.bp-badge--r { background: #fee2e2; color: #991b1b; cursor: help; }
.bp-badge--n { background: #e2e8f0; color: #334155; }
.bp-vide { padding: 22px 10px; text-align: center; font-size: 13px; color: #64748b; }

/* --- aperçu --- */
.bp-ap-tete { display: flex; align-items: center; gap: 10px; }
.bp-ap-qui { flex: 1; min-width: 0; }
.bp-ap-qui small { display: block; font-size: 11.5px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.bp-ap-qui b { display: block; font-size: 15px; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-ap-nav { display: flex; align-items: center; gap: 6px; }
.bp-ap-pos { font-size: 12.5px; color: #475569; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.bp-objet { display: flex; gap: 10px; align-items: baseline; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 9px 12px; }
.bp-objet span { font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.bp-objet b { font-size: 14px; color: #0f172a; overflow-wrap: anywhere; }
.bp-cc { font-size: 12.5px; color: #475569; margin-top: -4px; padding-left: 4px; }
.bp-cc:empty { display: none; }
.bp-mail { flex: 1; min-height: 300px; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; overflow: hidden; }
.bp-mail iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.bp-pj { display: flex; gap: 6px; flex-wrap: wrap; }
.bp-pj-chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px; background: #fff; border: 1px solid #e2e8f0; color: #334155; }
.bp-perso { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 0 12px; }
.bp-perso summary { cursor: pointer; padding: 10px 0; font-size: 13.5px; font-weight: 600; color: #0f766e; list-style: none; }
.bp-perso summary::-webkit-details-marker { display: none; }
.bp-perso[open] { padding-bottom: 12px; }
.bp-lab { display: block; font-size: 12px; font-weight: 700; color: #64748b; margin: 6px 0 4px; }
.bp-textarea { resize: vertical; line-height: 1.5; font-size: 13.5px; }
.bp-vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.bp-var { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 7px; border-radius: 6px; border: 1px solid #e2e8f0; background: #f8fafc; color: #334155; cursor: pointer; }
.bp-var:hover { background: #f0fdfa; border-color: #99f6e4; }
.bp-reinit { margin-left: auto; }

/* --- boutons & pied --- */
.bp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid #e2e8f0;
  background: #fff; color: #334155; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.bp-btn:hover:not(:disabled) { background: #f8fafc; border-color: #cbd5e1; }
.bp-btn:disabled { opacity: .55; cursor: not-allowed; }
.bp-btn--icone { width: 34px; height: 34px; padding: 0; font-size: 18px; }
.bp-btn--primaire { background: #0f766e; border-color: #0f766e; color: #fff; padding: 9px 20px; }
.bp-btn--primaire:hover:not(:disabled) { background: #115e59; border-color: #115e59; }
.bp-pied { flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid #e5e7eb; background: #fff; }
.bp-resume { flex: 1; min-width: 0; font-size: 13.5px; color: #334155; }
.bp-progres { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #334155; }
.bp-progres > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-barre { flex: 0 0 180px; height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.bp-barre i { display: block; height: 100%; width: 0; background: #0d9488; border-radius: 999px; transition: width .25s; }
.bp-pied-act { display: flex; gap: 8px; }
.bp .u-hidden { display: none !important; }
.bp-o { color: #b45309; font-weight: 600; }
.bp-v { color: #15803d; font-weight: 700; }
.bp-r { color: #b91c1c; font-weight: 700; }
.bp--envoi .bp-reglages { pointer-events: none; }
.bp--envoi .bp-liste { pointer-events: auto; }

/* --- responsive --- */
@media (max-width: 900px) {
  .bp-fond { padding: 0; align-items: stretch; }
  .bp { max-width: none; height: 100%; border-radius: 0; }
  .bp-corps { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .bp-reglages, .bp-apercu { overflow: visible; border-right: 0; min-height: 0; }
  .bp-apercu { border-top: 1px solid #e5e7eb; }
  .bp-etape--familles { flex: none; min-height: 0; }
  .bp-liste { max-height: 46vh; }
  .bp-mail { flex: none; height: 460px; }
}
@media (max-width: 560px) {
  .bp-tete { padding: 12px 14px; }
  .bp-ico { display: none; }
  .bp-reglages, .bp-apercu { padding: 12px; }
  .bp-int { font-size: 12.5px; white-space: normal; }
  .bp-dates { grid-template-columns: 1fr; }
  .bp-dates label > span { width: 22px; }
  .bp-pied { flex-wrap: wrap; padding: 10px 12px; }
  .bp-resume, .bp-progres { flex-basis: 100%; }
  .bp-pied-act { width: 100%; }
  .bp-pied-act .bp-btn { flex: 1; }
  .bp-barre { flex-basis: 120px; }
}

/* Règle globale « boutons tactiles 44 px » (styles.css ≤ 768 px) : neutralisée ici, comme
   pour la fiche élève — les puces et la liste restent compactes, les cibles gardent ≥ 34 px. */
@media (max-width: 768px) {
  .bp .bp-chip, .bp .bp-lien, .bp .bp-var, .bp .bp-int, .bp .bp-fermer, .bp .bp-btn--icone { min-height: 0 !important; min-width: 0; font-size: 13.5px !important; }
  .bp .bp-chip { padding: 8px 12px !important; }
  .bp .bp-int { padding: 9px 8px !important; }
  .bp .bp-lien, .bp .bp-var { padding: 4px 6px !important; }
  .bp .bp-fermer, .bp .bp-btn--icone { padding: 0 !important; width: 38px; height: 38px; }
  .bp .bp-btn { font-size: 15px !important; }
  .bp .bp-input { min-height: 40px !important; padding: 8px 10px !important; font-size: 16px !important; }
  .bp .bp-fam-cb, .bp .bp-cc-cb, .bp .bp-bascule input { min-height: 0 !important; }
}

/* --- mode nuit --- */
body.dark-mode .bp { background: #0b1220; color: #e5e7eb; }
body.dark-mode .bp-tete { background: linear-gradient(180deg, #0f2a2a 0%, #111827 100%); border-color: #374151; }
body.dark-mode .bp-titre, body.dark-mode .bp-fam-nom, body.dark-mode .bp-ap-qui b, body.dark-mode .bp-objet b { color: #f3f4f6; }
body.dark-mode .bp-pill { background: #1f2937; color: #e5e7eb; }
body.dark-mode .bp-pill--t { background: #134e4a; color: #99f6e4; }
body.dark-mode .bp-fermer, body.dark-mode .bp-btn { background: #111827; border-color: #374151; color: #e5e7eb; }
body.dark-mode .bp-btn:hover:not(:disabled), body.dark-mode .bp-fermer:hover { background: #1f2937; }
body.dark-mode .bp-btn--primaire { background: #0d9488; border-color: #0d9488; color: #fff; }
body.dark-mode .bp-corps { background: #0b1220; }
body.dark-mode .bp-reglages, body.dark-mode .bp-apercu { border-color: #1f2937; }
body.dark-mode .bp-etape, body.dark-mode .bp-objet, body.dark-mode .bp-perso, body.dark-mode .bp-pj-chip, body.dark-mode .bp-pied { background: #111827; border-color: #374151; }
body.dark-mode .bp-mail { border-color: #374151; }
body.dark-mode .bp-etape-t, body.dark-mode .bp-fam-sous, body.dark-mode .bp-note, body.dark-mode .bp-cc, body.dark-mode .bp-cc-opt,
body.dark-mode .bp-bascule, body.dark-mode .bp-dates label, body.dark-mode .bp-resume, body.dark-mode .bp-progres, body.dark-mode .bp-ap-pos, body.dark-mode .bp-pj-chip { color: #cbd5e1; }
body.dark-mode .bp-ap-qui small, body.dark-mode .bp-objet span, body.dark-mode .bp-lab, body.dark-mode .bp-vide { color: #9ca3af; }
body.dark-mode .bp-intentions { background: #1f2937; }
body.dark-mode .bp-int { color: #cbd5e1; }
body.dark-mode .bp-int--act, body.dark-mode .bp-int--act:hover { background: #111827; color: #5eead4; }
body.dark-mode .bp-int-aide { color: #cbd5e1; }
body.dark-mode .bp-int-aide b { color: #f3f4f6; }
body.dark-mode .bp-chip { background: #1f2937; border-color: #374151; color: #e5e7eb; }
body.dark-mode .bp-chip--vac { background: #422006; border-color: #78350f; color: #fde68a; }
body.dark-mode .bp-chip--act { background: #0d9488; border-color: #0d9488; color: #fff; }
body.dark-mode .bp-input, body.dark-mode .bp-var { background: #0b1220; border-color: #374151; color: #f3f4f6; }
body.dark-mode .bp-lien, body.dark-mode .bp-perso summary { color: #5eead4; }
body.dark-mode .bp-fam:hover { background: #1f2937; }
body.dark-mode .bp-fam--coche { background: #0f2a2a; }
body.dark-mode .bp-fam--actif { border-color: #2dd4bf; }
body.dark-mode .bp-fam-role, body.dark-mode .bp-badge, body.dark-mode .bp-badge--g, body.dark-mode .bp-badge--n { background: #1f2937; color: #e5e7eb; }
body.dark-mode .bp-badge--t { background: #134e4a; color: #99f6e4; }
body.dark-mode .bp-badge--o { background: #78350f; color: #fde68a; }
body.dark-mode .bp-badge--i { background: #312e81; color: #c7d2fe; }
body.dark-mode .bp-badge--v { background: #14532d; color: #bbf7d0; }
body.dark-mode .bp-badge--r { background: #7f1d1d; color: #fecaca; }
body.dark-mode .bp-barre { background: #374151; }
body.dark-mode .bp-o { color: #fbbf24; }
body.dark-mode .bp-v { color: #4ade80; }
body.dark-mode .bp-r { color: #f87171; }
