/* Tâches, Kanban et Gantt (lot P2-6). Jetons de la charte Horalio (docs/DESIGN-SYSTEM.md). Le Kanban
   reprend les classes du pipeline des prospects (.kanban, .colonne-pipeline, .carte-prospect) : ici,
   seulement ce qui est propre aux tâches. */

/* ---------- Kanban ---------- */
.taches-kanban .colonne-tache { border-top: 3px solid var(--neutre); }
.taches-kanban .colonne-tache--info { border-top-color: var(--primaire); }
.taches-kanban .colonne-tache--attention { border-top-color: var(--attention); }
.taches-kanban .colonne-tache--erreur { border-top-color: var(--danger); }
.taches-kanban .colonne-tache--succes { border-top-color: var(--succes); }
.carte-tache__parent, .carte-tache__dossier { margin: 2px 0 0; font-size: var(--t-meta); color: var(--encre-douce); overflow-wrap: anywhere; }
.carte-tache__dossier a, .carte-tache__parent a { color: inherit; }
.carte-tache__interne { font-style: italic; }
.carte-tache__pied { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-1) var(--e-2); }
.carte-tache__compte { font-size: var(--t-meta); color: var(--encre-douce); font-variant-numeric: tabular-nums; }
.carte-tache__personne { margin-left: auto; font-size: var(--t-micro); color: var(--encre-douce); }
.carte-tache__pied .carte-prospect__cdm { margin-left: auto; }
.taches-vide .vide a { font-weight: 500; }

/* ---------- Fiche ---------- */
.tache-statut { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--e-2); margin-top: var(--e-3); }
.tache-statut .champ { margin: 0; }
.tache-controle__jauge { display: block; width: 100%; height: 6px; margin: 0 0 var(--e-2); accent-color: var(--succes); }
.tache-controle { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--e-1); }
.tache-controle__point { display: flex; align-items: center; gap: var(--e-2); min-height: 32px; }
.tache-controle__point form { margin: 0; display: contents; }
.tache-controle__case {
    flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0;
    border: 1.5px solid var(--trait-fort); border-radius: var(--rayon-xs); background: var(--surface);
    color: var(--surface); font-size: 14px; line-height: 1; cursor: pointer;
}
button.tache-controle__case:focus-visible { box-shadow: var(--anneau); outline: none; }
.tache-controle__point--fait .tache-controle__case { background: var(--succes); border-color: var(--succes); }
.tache-controle__point--fait .tache-controle__libelle { color: var(--encre-douce); text-decoration: line-through; }
.tache-controle__libelle { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.tache-controle__meta { font-size: var(--t-micro); color: var(--encre-douce); white-space: nowrap; }
.tache-controle__retirer { font-size: var(--t-meta); }
.tache-controle__ajout { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--e-2); margin-top: var(--e-3); }
.tache-controle__ajout .champ { flex: 1 1 200px; margin: 0; }
.tache-sous-taches { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--e-2); }
.tache-sous-taches li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-1) var(--e-2); }
.tache-sous-taches li > a { font-weight: 500; overflow-wrap: anywhere; }
.tache-sous-taches__meta { font-size: var(--t-meta); color: var(--encre-douce); }
.tache-sous-taches__meta--retard { color: var(--danger-texte); font-weight: 500; }

/* ---------- Gantt ---------- */
.gantt__societe { font-weight: 400; color: var(--encre-douce); }
.gantt-legende { display: flex; flex-wrap: wrap; gap: var(--e-1) var(--e-4); margin: 0 0 var(--e-2); padding: 0; list-style: none; font-size: var(--t-meta); color: var(--encre-douce); }
.gantt-legende li { display: inline-flex; align-items: center; gap: var(--e-1); }
.gantt-legende__barre { display: inline-block; width: 22px; height: 10px; border-radius: var(--rayon-xs); background: var(--primaire-pale); border-left: 3px solid var(--primaire); }
.gantt-legende__barre--exercice { background: var(--surface-4); border-left-color: var(--encre-douce); }
.gantt-legende__barre--tache { background: var(--neutre-fond); border-left-color: var(--marque); }
.gantt-legende__repere, .gantt-legende__retard { display: inline-block; width: 10px; height: 10px; transform: rotate(45deg); background: var(--attention); }
.gantt-legende__retard { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-fond); }

.gantt { padding: 0; overflow: hidden; }
/* Seule la frise défile : la page garde sa largeur, l'intitulé reste collé à gauche. */
.gantt__defilement { overflow-x: auto; overscroll-behavior-x: contain; }
.gantt__defilement:focus-visible { outline: none; box-shadow: var(--anneau); }
.gantt__grille { --gantt-libelle: 220px; min-width: calc(var(--gantt-libelle) + var(--gantt-mois, 6) * 96px); }
.gantt__lignes { margin: 0; padding: 0; list-style: none; }
.gantt__ligne { display: grid; grid-template-columns: var(--gantt-libelle) 1fr; border-bottom: 1px solid var(--trait-2); }
.gantt__ligne:last-child { border-bottom: 0; }
.gantt__libelle {
    position: sticky; left: 0; z-index: 2; display: grid; align-content: center; gap: 1px; min-width: 0;
    padding: var(--e-2) var(--e-3); background: var(--surface); border-right: 1px solid var(--trait-2);
}
.gantt__titre { font-weight: 600; color: var(--encre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.gantt__titre { color: var(--primaire); }
.gantt__detail { font-size: var(--t-micro); color: var(--encre-douce); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt__frise { position: relative; min-height: 44px; }
.gantt__ligne--tete { position: sticky; top: 0; z-index: 3; background: var(--surface-2); }
.gantt__ligne--tete .gantt__libelle { background: var(--surface-2); color: var(--encre-douce); font-size: var(--t-meta); font-weight: 600; }
.gantt__ligne--tete .gantt__frise { min-height: 32px; }
.gantt__mois { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 var(--e-1); border-left: 1px solid var(--trait-3); font-size: var(--t-meta); font-weight: 600; color: var(--encre-douce); white-space: nowrap; overflow: hidden; }
.gantt__trait { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--trait-3); }
.gantt__aujourdhui { position: absolute; top: 0; bottom: 0; z-index: 1; width: 0; border-left: 2px solid var(--primaire); }
.gantt__aujourdhui--tete::after { content: ''; position: absolute; top: 0; left: -5px; border: 4px solid transparent; border-top-color: var(--primaire); }

.gantt__barre {
    position: absolute; top: 50%; z-index: 1; display: flex; align-items: center; height: 22px; min-width: 6px;
    transform: translateY(-50%); padding: 0 var(--e-1); border-radius: var(--rayon-xs); overflow: hidden;
    background: var(--neutre-fond); border-left: 3px solid var(--neutre); color: var(--encre); text-decoration: none;
    font-size: var(--t-micro); font-weight: 500;
}
a.gantt__barre:hover, a.gantt__barre:focus-visible { z-index: 2; box-shadow: var(--anneau); outline: none; }
.gantt__texte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt__barre--coupe-avant { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dashed; }
.gantt__barre--coupe-apres { border-top-right-radius: 0; border-bottom-right-radius: 0; mask-image: linear-gradient(to right, #000 calc(100% - 12px), transparent); }
.gantt__barre.gantt--mission { background: var(--primaire-pale); border-left-color: var(--primaire); }
.gantt__barre.gantt--exercice { background: var(--surface-4); border-left-color: var(--encre-douce); color: var(--encre-douce); }
.gantt__barre.gantt--tache.gantt--ton-info { background: var(--primaire-pale); border-left-color: var(--marque); }
.gantt__barre.gantt--tache.gantt--ton-attention { background: var(--attention-fond); border-left-color: var(--attention); }
.gantt__barre.gantt--tache.gantt--ton-erreur { background: var(--danger-fond); border-left-color: var(--danger); }
.gantt__barre.gantt--tache.gantt--ton-succes { background: var(--succes-fond); border-left-color: var(--succes); }
.gantt__barre.gantt--retard { box-shadow: inset 0 -2px 0 var(--danger); }

.gantt__repere {
    position: absolute; top: 50%; z-index: 1; width: 12px; height: 12px; margin-left: -6px;
    transform: translateY(-50%) rotate(45deg); border-radius: 2px; background: var(--neutre); border: 2px solid var(--surface);
}
a.gantt__repere:hover, a.gantt__repere:focus-visible { z-index: 2; box-shadow: var(--anneau); outline: none; }
.gantt__repere.gantt--ton-info { background: var(--primaire); }
.gantt__repere.gantt--ton-attention { background: var(--attention); }
.gantt__repere.gantt--ton-erreur { background: var(--danger); }
.gantt__repere.gantt--ton-succes { background: var(--succes); }
.gantt__repere.gantt--retard { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-fond); }
.gantt__repere.gantt--echeance { border-radius: 50%; transform: translateY(-50%); }

@media (max-width: 720px) {
    .gantt__grille { --gantt-libelle: 128px; min-width: calc(var(--gantt-libelle) + var(--gantt-mois, 6) * 64px); }
    .gantt__libelle { padding: var(--e-1) var(--e-2); }
    .gantt__titre { font-size: var(--t-meta); }
}
