/* Planning commun : charte Flow Line (vert pétrole, chartreuse, bleu pastel ; Poppins pour les titres, Nunito pour le texte) */
:root {
  --petrole: #013233; --petrole-2: #084F50; --canard: #258486; --chartreuse: #C8E560; --chartreuse-pale: #F5FFD1;
  --pastel: #E7F9FB; --gris-vert: #E7F0EE; --fond: #F6FEFF; --texte: #0E2627; --texte-2: #4B6465; --bord: #D3E3E1;
  --ok: #CFEBB5; --ok-texte: #2F5D12; --orange: #FFD9A0; --orange-texte: #7A4A00; --rouge: #F7B4AE; --rouge-texte: #8A1C12;
  --blanc: #fff; --ombre: 0 6px 24px rgba(1, 50, 51, .14);
  --col-jour: 30px; --col-weekend: 14px; --col-semaine: 52px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 Nunito, system-ui, sans-serif; color: var(--texte); background: var(--fond); }
h1, h2, h3 { font-family: Poppins, Nunito, sans-serif; color: var(--petrole); margin: 0 0 .6em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
a { color: var(--canard); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* barre du haut */
.barre { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 0 18px; height: 54px;
  background: var(--petrole); color: var(--blanc); }
.marque { font-family: Poppins, sans-serif; font-weight: 700; font-size: 18px; text-decoration: none; color: var(--blanc); white-space: nowrap; }
.marque-equipe { color: var(--chartreuse); }
.onglets { display: flex; gap: 2px; overflow-x: auto; }
.onglets a { color: #CFE3E2; text-decoration: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.onglets a:hover { background: rgba(255, 255, 255, .08); color: var(--blanc); }
.onglets a.actif { background: var(--chartreuse); color: var(--petrole); }
.barre-droite { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.unite { display: inline-flex; border: 1px solid rgba(255, 255, 255, .3); border-radius: 8px; overflow: hidden; }
.unite button { background: none; border: 0; color: #CFE3E2; padding: 4px 10px; cursor: pointer; }
.unite button.actif { background: var(--chartreuse); color: var(--petrole); font-weight: 800; }
.btn-claude { color: var(--petrole); background: var(--pastel); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 700; white-space: nowrap; }
.moi { color: var(--blanc); text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }

main { padding: 18px; }
.entete { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.entete h1 { margin: 0 12px 0 0; }
.espace { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--bord); background: var(--blanc); color: var(--petrole);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--canard); }
.btn.principal { background: var(--petrole); color: var(--blanc); border-color: var(--petrole); }
.btn.principal:hover { background: var(--petrole-2); }
.btn.vert { background: var(--chartreuse); border-color: var(--chartreuse); color: var(--petrole); }
.btn.danger { color: var(--rouge-texte); }
.btn.petit { padding: 3px 8px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.lien { background: none; border: 0; padding: 0; color: var(--canard); cursor: pointer; text-decoration: underline; }
select, input[type=text], input[type=date], input[type=number], input[type=email], input:not([type]), textarea {
  border: 1px solid var(--bord); border-radius: 8px; padding: 6px 9px; background: var(--blanc); min-width: 0; }
textarea { width: 100%; min-height: 70px; resize: vertical; }
label.case { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.formulaire label.case { flex-direction: row; align-items: center; font-weight: 600; }
.formulaire label.case input { width: auto; flex: none; }
.groupe-btn { display: inline-flex; border: 1px solid var(--bord); border-radius: 8px; overflow: hidden; background: var(--blanc); }
.groupe-btn button { border: 0; background: none; padding: 5px 10px; cursor: pointer; font-weight: 600; color: var(--texte-2); }
.groupe-btn button.actif { background: var(--petrole); color: var(--blanc); }
.carte { background: var(--blanc); border: 1px solid var(--bord); border-radius: 12px; padding: 16px; }
.discret { color: var(--texte-2); }
.vide { color: var(--texte-2); padding: 30px; text-align: center; }
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.etiquette { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--gris-vert); color: var(--petrole-2); white-space: nowrap; }
.etiquette.doing { background: var(--pastel); color: var(--canard); }
.etiquette.blocked { background: var(--rouge); color: var(--rouge-texte); }
.etiquette.attente { background: var(--orange); color: var(--orange-texte); }
.etiquette.done { background: var(--ok); color: var(--ok-texte); }
.etiquette.retard { background: var(--rouge); color: var(--rouge-texte); }
.etiquette.pilotia { background: var(--chartreuse-pale); color: var(--petrole-2); }

/* Gantt façon Excel */
.cadre-gantt { overflow: auto; max-height: calc(100vh - 150px); background: var(--blanc); border: 1px solid var(--bord); border-radius: 12px; }
table.gantt { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.gantt th, .gantt td { border-bottom: 1px solid var(--gris-vert); padding: 0; height: 26px; }
.gantt thead th { position: sticky; z-index: 3; background: var(--blanc); font-weight: 700; color: var(--texte-2); }
.gantt thead tr:nth-child(1) th { top: 0; height: 24px; }
.gantt thead tr:nth-child(2) th { top: 24px; height: 20px; font-size: 11px; }
.gantt thead tr:nth-child(3) th { top: 44px; height: 22px; }
.gantt .col-titre { position: sticky; left: 0; z-index: 2; background: var(--blanc); min-width: 290px; max-width: 290px; text-align: left; padding: 0 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid var(--bord); }
.gantt .col-qui { position: sticky; left: 290px; z-index: 2; background: var(--blanc); min-width: 86px; max-width: 86px; padding: 0 6px; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid var(--bord); color: var(--texte-2); }
.gantt .col-total { position: sticky; left: 376px; z-index: 2; background: var(--blanc); min-width: 52px; max-width: 52px; text-align: right; padding: 0 6px;
  border-right: 2px solid var(--bord); color: var(--texte-2); font-variant-numeric: tabular-nums; }
.gantt thead .col-titre, .gantt thead .col-qui, .gantt thead .col-total { z-index: 4; }
.gantt .mois { text-align: left; padding-left: 6px; border-left: 1px solid var(--bord); color: var(--petrole); font-family: Poppins, sans-serif; font-size: 12px; }
.gantt .j { min-width: var(--col-jour); max-width: var(--col-jour); width: var(--col-jour); text-align: center; border-left: 1px solid var(--gris-vert);
  font-variant-numeric: tabular-nums; font-size: 12px; }
.gantt .j.we { min-width: var(--col-weekend); max-width: var(--col-weekend); width: var(--col-weekend); background: #F1F5F4; }
.gantt .j.sem { min-width: var(--col-semaine); max-width: var(--col-semaine); width: var(--col-semaine); }
.gantt .j.lundi { border-left: 1px solid var(--bord); }
.gantt thead .j.auj { background: var(--chartreuse); color: var(--petrole); border-radius: 6px 6px 0 0; }
.gantt tbody td.j.auj { box-shadow: inset 1px 0 0 var(--chartreuse), inset -1px 0 0 var(--chartreuse); }
.gantt tbody tr:hover td { background-color: #FAFFF0; }
.gantt tbody tr:hover td.j.plein { filter: brightness(.95); }
.gantt td.j.clic { cursor: pointer; }
.gantt td.j.clic:hover { outline: 2px solid var(--canard); outline-offset: -2px; }
.gantt td.j.plein { font-weight: 800; }
.gantt td.j.reparti { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.35) 0 3px, transparent 3px 6px); }
.gantt tr.tete-projet td { background: var(--pastel); height: 30px; font-weight: 800; color: var(--petrole); border-top: 6px solid var(--fond); }
.gantt tr.tete-projet td.col-titre, .gantt tr.tete-projet td.col-qui, .gantt tr.tete-projet td.col-total { background: var(--pastel); }
.gantt tr.tete-groupe td { background: #FBFDFC; color: var(--petrole-2); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.gantt tr.tete-groupe td.col-titre, .gantt tr.tete-groupe td.col-qui, .gantt tr.tete-groupe td.col-total { background: #FBFDFC; }
.gantt .titre-tache { cursor: pointer; }
.gantt .titre-tache:hover { text-decoration: underline; }
.gantt tr.terminee .titre-tache { color: var(--texte-2); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.gantt tr.jalon td.col-titre { color: var(--petrole-2); font-style: italic; }
.gantt .losange { color: var(--petrole); font-size: 15px; line-height: 1; cursor: pointer; }
.gantt .losange.atteint { color: var(--canard); } .gantt .losange.manque { color: var(--rouge-texte); }
.gantt .bouton-ligne { visibility: hidden; margin-left: 6px; }
.gantt tr:hover .bouton-ligne { visibility: visible; }
.gantt .replier { cursor: pointer; display: inline-block; width: 16px; color: var(--texte-2); }
.gantt tr.ajout td.col-titre { padding: 2px 6px; }
.gantt tr.ajout input { width: 100%; height: 22px; padding: 2px 6px; font-size: 13px; border-style: dashed; }
.c-ok { background: var(--ok) !important; color: var(--ok-texte); }
.c-orange { background: var(--orange) !important; color: var(--orange-texte); }
.c-rouge { background: var(--rouge) !important; color: var(--rouge-texte); }
.c-demi { background: #E9F6DC !important; color: var(--ok-texte); }
.legende { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 10px; color: var(--texte-2); font-size: 13px; }
.legende span.ech { display: inline-block; width: 18px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }

/* tableaux simples */
table.liste { width: 100%; border-collapse: collapse; background: var(--blanc); border: 1px solid var(--bord); border-radius: 12px; overflow: hidden; }
.liste th { text-align: left; font-weight: 800; color: var(--texte-2); background: #FBFDFC; padding: 8px 10px; border-bottom: 1px solid var(--bord); font-size: 13px; }
.liste td { padding: 7px 10px; border-bottom: 1px solid var(--gris-vert); vertical-align: middle; }
.liste tr:last-child td { border-bottom: 0; }
.liste td.nombre, .liste th.nombre { text-align: right; font-variant-numeric: tabular-nums; }
.liste .cliquable { cursor: pointer; font-weight: 700; color: var(--petrole); }
.liste .cliquable:hover { text-decoration: underline; }
.liste select { padding: 3px 6px; }
.filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filtres input[type=text], .filtres input:not([type]) { width: 220px; }

/* journal */
.journal-jour { margin: 16px 0 6px; font-family: Poppins, sans-serif; color: var(--petrole); font-size: 14px; }
.journal-ligne { display: flex; gap: 10px; padding: 7px 12px; background: var(--blanc); border: 1px solid var(--gris-vert); border-radius: 10px; margin-bottom: 4px; align-items: baseline; }
.journal-ligne .heure { color: var(--texte-2); font-variant-numeric: tabular-nums; min-width: 44px; }
.journal-ligne .via { margin-left: auto; }

/* tiroir et fenêtres */
.fond { position: fixed; inset: 0; background: rgba(1, 50, 51, .28); z-index: 40; }
.tiroir { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--blanc); z-index: 41; box-shadow: var(--ombre);
  overflow-y: auto; padding: 18px 20px 30px; }
.tiroir.modale { top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); border-radius: 14px; }
.tiroir .fermer { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--texte-2); }
.formulaire { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.formulaire label { display: flex; flex-direction: column; gap: 3px; font-weight: 700; font-size: 13px; color: var(--texte-2); }
.formulaire label.large { grid-column: 1 / -1; }
.formulaire input, .formulaire select { width: 100%; }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.encadre { background: var(--chartreuse-pale); border: 1px solid #E3F2B4; border-radius: 10px; padding: 9px 12px; margin: 10px 0; font-size: 13px; }
.encadre.bleu { background: var(--pastel); border-color: #CDEEF2; }
.historique { margin-top: 18px; font-size: 13px; }
.historique li { margin-bottom: 4px; }
.code { font-family: Consolas, ui-monospace, monospace; font-size: 12.5px; background: #0E2627; color: #E7F9FB; padding: 10px 12px; border-radius: 8px;
  white-space: pre-wrap; word-break: break-all; }
.copie { display: flex; gap: 8px; align-items: flex-start; }
.copie .code { flex: 1; }

/* bulle de saisie d'une case */
.bulle { position: fixed; z-index: 50; background: var(--blanc); border: 1px solid var(--bord); border-radius: 10px; box-shadow: var(--ombre); padding: 10px; width: 250px; }
.bulle .rapides { display: flex; gap: 4px; margin: 6px 0; }
.bulle .rapides button { flex: 1; border: 1px solid var(--bord); background: var(--fond); border-radius: 6px; padding: 4px 0; cursor: pointer; font-weight: 800; }
.bulle .rapides button:hover { background: var(--chartreuse); }
.bulle .ligne { display: flex; gap: 6px; align-items: center; }
.bulle input { width: 80px; }
.bulle ul { margin: 6px 0 0; padding-left: 16px; max-height: 220px; overflow: auto; }

.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast { background: var(--petrole); color: var(--blanc); padding: 8px 14px; border-radius: 10px; box-shadow: var(--ombre); }
.toast.erreur { background: var(--rouge-texte); }

/* connexion */
.connexion { max-width: 460px; margin: 12vh auto; text-align: center; }
.connexion .logo { font-family: Poppins, sans-serif; font-weight: 700; font-size: 30px; color: var(--petrole); margin-bottom: 6px; }
.connexion .logo span { background: var(--chartreuse); padding: 0 6px; border-radius: 6px; }
.connexion form { display: flex; gap: 8px; margin-top: 16px; }
.connexion input { flex: 1; }

.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.exemples li { margin-bottom: 6px; }

@media (max-width: 760px) {
  .barre { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .barre-droite { margin-left: 0; width: 100%; }
  main { padding: 12px; }
  .gantt .col-titre { min-width: 170px; max-width: 170px; }
  .gantt .col-qui { left: 170px; min-width: 60px; max-width: 60px; }
  .gantt .col-total { left: 230px; }
  .formulaire { grid-template-columns: 1fr; }
}

/* réunions (R-UnIA) */
.tiroir.large { width: min(880px, 100vw); }
.petit-texte { font-size: 12px; }
.entete input[data-texte] { width: 240px; }
.citation { color: var(--texte-2); font-style: italic; font-size: 12.5px; margin-top: 2px; }
.actions-reunion td { vertical-align: top; }
.actions-reunion select, .actions-reunion input { max-width: 150px; }
.actions-reunion tr.ignoree td, .actions-reunion tr.envoyee td { opacity: .6; }
.md h2, .md h3, .md h4 { margin: 14px 0 6px; font-size: 15px; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; }
.md li { margin-bottom: 3px; }
.md p { margin: 4px 0 8px; }
.md table { margin: 8px 0; }
details.transcription { margin-top: 16px; }
details.transcription summary { cursor: pointer; font-weight: 800; color: var(--petrole); }
details.transcription pre { white-space: pre-wrap; max-height: 460px; overflow: auto; font: 12.5px/1.5 Nunito, sans-serif; background: var(--fond);
  border: 1px solid var(--gris-vert); padding: 10px 12px; border-radius: 8px; }
@media (max-width: 760px) { .entete input[data-texte] { width: 100%; } }

/* réunion en direct */
.direct-depart { max-width: 760px; }
.direct-texte { max-height: calc(100vh - 290px); min-height: 200px; overflow-y: auto; }
.direct-texte p { margin: 0 0 8px; }
.pastille.enreg { width: 14px; height: 14px; background: #D9534F; animation: clignote 1.2s infinite; vertical-align: 1px; }
@keyframes clignote { 50% { opacity: .3; } }
.niveau { width: 120px; height: 10px; border-radius: 6px; background: var(--gris-vert); overflow: hidden; }
.niveau div { height: 100%; width: 0; background: var(--canard); transition: width .12s; }

/* enregistrer puis envoyer */
.formulaire fieldset.modes { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.formulaire fieldset.modes label.case { align-items: flex-start; font-weight: 400; color: var(--texte); }
.formulaire fieldset.modes input { margin-top: 3px; }
.attente-envoi { margin: 12px 0; max-width: 900px; }
.ligne-attente { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--gris-vert); }
.ligne-attente:last-of-type { border-bottom: 0; }

/* brancher mon Claude : étapes du connecteur */
ol.etapes { padding-left: 20px; margin: 8px 0; }
ol.etapes li { margin: 8px 0; }
ol.etapes .copie { margin: 6px 0; }
.carte details { margin-top: 10px; }
