/* TPI Task — charte Groupe TPI : Scooter #2d819c, Storm Dust #61615f, Maverick #bfbdbe */
:root {
  --scooter: #2d819c; --scooter-fonce: #1d5466; --scooter-clair: #d6eaf1;
  --storm: #61615f; --maverick: #bfbdbe; --ligne: #e4e3e3; --fond: #fafafa;
  --vert: #3b8a5a; --vert-clair: #dcefe2; --orange-fonce: #8a4b06; --orange-clair: #fdebd3;
  --titre: 'League Spartan', Quicksand, Helvetica, Arial, sans-serif;
  --texte: Quicksand, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--texte); color: var(--storm); background: var(--fond); font-size: 15px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--scooter-fonce); }
a:hover { color: var(--scooter); }
:focus-visible { outline: 3px solid var(--scooter); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--titre); color: var(--storm); line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
small { font-size: 12px; }

.progression { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: var(--scooter-clair); overflow: hidden; z-index: 100; }
.progression span { position: absolute; top: 0; bottom: 0; width: 35%; background: var(--scooter); animation: glisse 1.1s ease-in-out infinite; }
@keyframes glisse { from { left: -35%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .progression span { animation: none; width: 100%; left: 0; opacity: .6; } }

.haut { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--ligne); }
.marque { font-family: var(--titre); font-weight: 700; font-size: 22px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--storm); }
.haut-nav { display: flex; gap: 4px; }
.haut-nav a { text-decoration: none; font-weight: 700; color: var(--storm); padding: 8px 12px; border-radius: 8px; }
.haut-nav a:hover { background: #f1f1f0; color: var(--storm); }
.haut-droite { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.moi { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--scooter-clair); color: var(--scooter-fonce); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
@media (max-width: 640px) { .moi-nom { display: none; } .haut { padding: 10px 14px; } }

.page { flex: 1 0 auto; width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 24px 40px; }
.pied { text-align: center; font-size: 13px; padding: 16px; border-top: 1px solid var(--ligne); background: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--storm); background: var(--storm); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: #4f4f4d; color: #fff; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-large { min-height: 50px; font-size: 16px; padding: 0 22px; }
.btn.discret { background: #fff; color: var(--storm); border-color: #d6d5d5; min-height: 36px; }
.btn.discret:hover { background: #f4f4f3; }
.lien { border: 0; background: none; padding: 4px 0; font: inherit; font-weight: 700; color: var(--scooter-fonce); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.en-ligne { display: inline; }

.message { padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; font-weight: 600; }
.message-ok { background: var(--vert-clair); color: #22593a; }
.message-erreur { background: var(--orange-clair); color: var(--orange-fonce); }

.bloc { background: #fff; border: 1px solid var(--ligne); border-radius: 12px; padding: 20px 22px; margin-bottom: 20px; min-width: 0; }
.etroit { max-width: 640px; margin-left: auto; margin-right: auto; }
.vide { text-align: left; }
.note { font-size: 13px; }
.entete { margin-bottom: 18px; }
.sous { margin: 0; font-size: 16px; }

/* Connexion */
.connexion { max-width: 440px; margin: 6vh auto 0; background: #fff; border: 1px solid var(--ligne); border-radius: 14px; padding: 32px 30px; }
.connexion h1 { font-size: 28px; }
.intro { margin: 0 0 22px; }
.externe { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--ligne); font-size: 14px; }
.connexion .btn-large { width: 100%; }
.pile { display: flex; flex-direction: column; gap: 8px; }
.pile .btn { margin-top: 10px; }
label { font-weight: 700; font-size: 14px; }
input, select, textarea { font: inherit; color: var(--storm); min-height: 42px; padding: 8px 12px; border: 1px solid #c9c8c8; border-radius: 8px; background: #fff; width: 100%; }
textarea { min-height: 90px; }
input[type="color"] { padding: 4px; width: 64px; }
.code { font-size: 26px; letter-spacing: .35em; text-align: center; font-weight: 700; }

/* Accueil */
.arbre { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.espace { background: #fff; border: 1px solid var(--ligne); border-radius: 12px; padding: 18px 20px; border-top: 5px solid var(--teinte, var(--scooter)); }
.dossier { margin: 14px 0 6px; }
.dossier h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.projets { list-style: none; margin: 0; padding: 0; }
.projets li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-top: 1px solid #f0efef; }
.p-nom { font-weight: 700; }
.p-meta { grid-column: 1; font-size: 13px; }
.projets .role { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.role { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 12px; background: var(--scooter-clair); color: var(--scooter-fonce); font-family: var(--texte); font-size: 12px; font-weight: 700; }
.aucun { font-size: 13px; }

/* Administration */
.onglets { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--ligne); margin-bottom: 20px; }
.onglets a { padding: 10px 14px; text-decoration: none; font-weight: 600; color: var(--storm); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.onglets a.actif { border-bottom-color: var(--scooter); font-weight: 700; }
.deux-colonnes { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.deux-colonnes > * { flex: 1 1 380px; }
.deux-colonnes > .bloc:first-child { flex-grow: 2; }
.pile-blocs { display: flex; flex-direction: column; }
.formulaire { display: flex; flex-direction: column; gap: 6px; }
.formulaire label { margin-top: 8px; }
.formulaire .btn { margin-top: 14px; align-self: flex-start; }
.defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--ligne); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #f0efef; vertical-align: top; }
tr.inactif td { opacity: .6; }
.a-espace { padding: 10px 0; border-top: 1px solid #f0efef; }
.a-espace:first-of-type { border-top: 0; }
.a-ligne { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 34px; }
.a-n2 { padding-left: 22px; }
.a-n3 { padding-left: 44px; }
.pastille { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }

/* Installation */
.verifs { list-style: none; padding: 0; margin: 0 0 20px; }
.verifs li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid #f0efef; }
.v-etat { flex: 0 0 90px; font-weight: 700; }
.v-ok .v-etat { color: #22593a; }
.v-ko .v-etat { color: var(--orange-fonce); }
.a-dossier { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.espace > .projets { margin-bottom: 4px; }

/* ---------- Lot 1 ---------- */
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fil { margin: 0 0 6px; font-size: 14px; }
.entete-ligne { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.statut { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px 0 8px; border-radius: 12px; font-size: 12px; font-weight: 700; white-space: nowrap; background: color-mix(in srgb, var(--c) 18%, #fff); color: color-mix(in srgb, var(--c) 55%, #000); }
.statut::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--c); color: color-mix(in srgb, var(--c) 25%, #000); }
.prio { font-size: 12px; font-weight: 700; }
.prio-haute { color: var(--orange-fonce); }
.prio-urgente { color: #fff; background: #b4410f; padding: 2px 8px; border-radius: 10px; }
.prio-basse { color: #8a8a88; }
.jauge { display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: #ececeb; overflow: hidden; vertical-align: middle; }
.jauge span { display: block; height: 100%; background: var(--scooter); }
.avatar.petit { width: 26px; height: 26px; font-size: 10px; margin-right: 2px; }
.compte { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 11px; background: #ececeb; font-family: var(--texte); font-size: 12px; font-weight: 700; vertical-align: 3px; }
.ajout-rapide { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 22px; }
.ajout-rapide input { flex: 1 1 320px; min-height: 48px; font-size: 16px; }
.barre-liste { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sans-marge { padding: 0; }
table.taches td { vertical-align: middle; }
table.taches tr.finie .t-titre { color: #8a8a88; text-decoration: line-through; }
.t-titre { font-weight: 700; color: var(--storm); text-decoration: none; }
.t-titre:hover { color: var(--scooter-fonce); text-decoration: underline; }
.t-sous { display: block; }
.retard { color: var(--orange-fonce); font-weight: 700; }
.liste-simple { list-style: none; padding: 0; margin: 0 0 12px; }
.liste-simple li { padding: 8px 0; border-top: 1px solid #f0efef; }
.fiche { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.fiche-principale { flex: 999 1 520px; min-width: 0; }
.fiche-cote { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.fiche-cote .bloc label { display: block; margin: 10px 0 6px; }
.fiche-cote .bloc label:first-child { margin-top: 0; }
.titre-champ { font-family: var(--titre); font-size: 26px; font-weight: 700; border-color: transparent; padding-left: 4px; }
.titre-champ:hover, .titre-champ:focus { border-color: #c9c8c8; }
.petit-titre { font-size: 15px; margin: 18px 0 8px; }
.barre-edition { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.barre-edition button { min-height: 34px; min-width: 38px; padding: 0 10px; border: 1px solid #d6d5d5; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; color: var(--storm); cursor: pointer; }
.barre-edition button:hover { background: #f4f4f3; }
.editeur { min-height: 140px; padding: 12px 14px; border: 1px solid #c9c8c8; border-radius: 8px; background: #fff; line-height: 1.6; }
.editeur:not([contenteditable]) { border-color: transparent; padding-left: 4px; }
.editeur:empty::before { content: 'Aucune description.'; color: #8a8a88; }
.editeur[contenteditable]:empty::before { content: 'Ajoutez une description, des liens vers des documents…'; }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.champ label { display: block; margin-bottom: 6px; }
.case { display: flex; align-items: center; gap: 8px; min-height: 36px; font-weight: 600; cursor: pointer; }
.case input { width: 18px; height: 18px; min-height: 0; accent-color: var(--scooter); flex: none; }
.cases { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plein { width: 100%; margin-bottom: 12px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-propose { min-height: 30px; padding: 0 10px; border: 1px dashed #bfbdbe; border-radius: 15px; background: #fff; font: inherit; font-size: 12px; font-weight: 700; color: var(--storm); cursor: pointer; }
.tag-propose:hover { border-style: solid; border-color: var(--scooter); }
.petit-lien { font-size: 13px; display: inline-block; margin-top: 4px; }
.fiche-bas { margin-top: 0; }
.checklist { list-style: none; margin: 0 0 12px; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #f0efef; }
.coche { width: 28px; height: 28px; border: 2px solid #9e9c9d; border-radius: 6px; background: #fff; color: #fff; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.coche.cochee { background: var(--vert); border-color: var(--vert); }
.barre { text-decoration: line-through; color: #8a8a88; }
.droite { margin-left: auto; }
.lien.discret { color: #8a8a88; font-weight: 600; }
.ajout-ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.ajout-ligne input { flex: 1 1 220px; }
.historique { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.historique li { padding: 8px 0; border-top: 1px solid #f0efef; }
.ligne-champs { display: flex; gap: 8px; align-items: center; }
.ligne-champs input[type="color"] { flex: none; }
.case-ordre { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ordre { width: 70px; min-height: 34px; padding: 4px 8px; }
.label-like { font-weight: 700; font-size: 14px; margin-top: 8px; }
.en-rangee { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ligne); }
.deux > div { min-width: 0; }
.deux input { min-width: 0; padding-left: 8px; padding-right: 4px; }
.fiche-cote .bloc label.case { margin: 0; display: flex; }
input[type="range"] { accent-color: var(--scooter); padding: 0; min-height: 32px; border: 0; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--scooter); }
input[type="color"] { min-height: 40px; }
.a-ligne { flex-wrap: wrap; }
.a-actions { display: inline-flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
details.modif > summary { cursor: pointer; font-weight: 700; color: var(--scooter-fonce); text-decoration: underline; text-underline-offset: 3px; list-style: none; padding: 4px 0; }
details.modif > summary::-webkit-details-marker { display: none; }
details.modif[open] { flex-basis: 100%; order: 2; }
details.modif[open] > summary { margin-bottom: 6px; }
details.modif[open] .formulaire { background: var(--fond); border: 1px solid var(--ligne); border-radius: 10px; padding: 12px 14px; min-width: min(360px, 100%); }
.a-ligne:has(details[open]) > .a-actions { flex-basis: 100%; justify-content: flex-start; }
.a-ligne:has(details[open]) > .a-actions > form.en-ligne { display: none; }
details.modif[open] { order: 0; }

/* ---------- Lot 2 : vues ---------- */
.lien-titre { color: inherit; text-decoration: none; }
.lien-titre:hover { color: var(--scooter-fonce); text-decoration: underline; }
.vue-barre { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }
.onglets-vue { display: inline-flex; border: 1px solid #d6d5d5; border-radius: 8px; overflow: hidden; }
.onglets-vue a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; font-weight: 700; text-decoration: none; color: var(--storm); background: #fff; }
.onglets-vue a.actif { background: var(--storm); color: #fff; }
.recherche { flex: 1 1 260px; display: flex; }
.recherche input { min-height: 40px; }
.vues-enreg { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vues-enreg select { width: auto; min-height: 40px; font-weight: 600; }
.vue-filtres { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.v-groupe { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; margin-right: 6px; }
.v-groupe select { width: auto; min-height: 36px; padding: 4px 8px; font-weight: 700; font-size: 13px; }
.v-filtre { position: relative; }
.v-droite { margin-left: auto; }
.fbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid #d6d5d5; font: inherit; font-size: 13px; font-weight: 700; background: #fff; color: var(--storm); cursor: pointer; white-space: nowrap; }
.fbtn.fon { background: var(--scooter-clair); border-color: var(--scooter); color: var(--scooter-fonce); }
.fbtn.pointille { border-style: dashed; }
.pop { position: absolute; top: 42px; left: 0; z-index: 30; min-width: 240px; max-height: 340px; overflow-y: auto; background: #fff; border: 1px solid #d6d5d5; border-radius: 10px; padding: 8px; }
.pop-droite { left: auto; right: 0; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 8px; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.opt:hover { background: #f4f4f3; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.vue-compte { font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.tri { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; font-size: 13px; color: var(--storm); cursor: pointer; white-space: nowrap; }
.tri:hover { color: var(--scooter-fonce); }
tr.grp td { background: #eaf4f7; padding: 6px 10px; border-bottom: 1px solid var(--scooter-clair); }
.gbtn { border: 0; background: none; font: inherit; font-weight: 700; color: var(--scooter-fonce); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.colonne { background: #f1f1f0; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; min-height: 360px; scroll-snap-align: start; }
.col-tete { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.col-fin { margin-left: auto; font-weight: 700; }
.col-cartes { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 80px; border-radius: 8px; }
.col-cartes.refus { outline: 2px dashed var(--orange-fonce); outline-offset: 2px; }
.carte { background: #fff; border: 1px solid var(--ligne); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.carte.modifiable { cursor: grab; }
.carte:hover { border-color: var(--scooter); }
.carte-titre { font-weight: 700; color: var(--storm); text-decoration: none; line-height: 1.35; }
.carte-titre:hover { text-decoration: underline; }
.carte-projet { font-size: 12px; font-weight: 600; }
.carte-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.carte-pied { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.carte-prio { align-self: flex-start; }
.carte-jauge { width: 100%; height: 5px; }
.carte-fantome { opacity: .35; }
.carte-choisie { box-shadow: 0 0 0 2px var(--scooter); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--storm); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 200; max-width: 90vw; }
@media (max-width: 640px) { .kanban { grid-auto-columns: 85%; } .v-droite { margin-left: 0; } }

/* Pièces jointes */
.pieces-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pieces-tete h2 { margin: 0; }
.pieces-boutons { display: flex; gap: 8px; flex-wrap: wrap; }
.pieces-boutons label.btn { margin: 0; cursor: pointer; }
.pieces { list-style: none; margin: 0; padding: 0; }
.pieces li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid #f0efef; }
.pj-vignette { flex: none; width: 56px; height: 56px; border-radius: 8px; background: #ececeb; display: flex; align-items: center; justify-content: center; overflow: hidden; text-decoration: none; color: var(--storm); font-size: 11px; font-weight: 700; }
.pj-vignette img { width: 100%; height: 100%; object-fit: cover; }
.pj-infos { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pj-infos a { color: var(--storm); text-decoration: none; overflow-wrap: anywhere; }
.pj-infos a:hover { text-decoration: underline; }
.envoi { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; font-size: 13px; font-weight: 600; }
.jauge.large { width: 100%; height: 10px; }
#pieces.depot { outline: 3px dashed var(--scooter); outline-offset: -6px; }
.carte-pied > span:last-child { display: flex; flex: none; }
[hidden] { display: none !important; }
