/* =====================================================================
   VISION PME — Mes tâches

   Une carte par tâche, empilée. Pas de tableau : un tableau range des
   lignes comparables, or chaque tâche se traite seule et porte un texte
   à lire. Les colonnes forceraient à tronquer précisément ce qu'on est
   venu voir.
   ===================================================================== */

.taches-compte {
  margin: 0 0 var(--s-3);
}

.tache-carte {
  padding: var(--s-4);
  margin-bottom: var(--s-3);
  /* `min-width: 0` : la carte est un enfant de grille, et sans ça un
     courriel long refuse de se replier et pousse toute la page en
     débordement horizontal. Même correctif qu'à `.zone-candidatures`. */
  min-width: 0;
}

.tache-tete {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s-3); flex-wrap: wrap;
}

.tache-qui { font-size: var(--fs-base); }
.tache-qui b { word-break: break-word; }

.tache-quoi {
  display: flex; align-items: center; gap: 6px;
  margin-top: 2px;
  font: 500 var(--fs-sm)/1.4 var(--font-body);
  color: var(--text-muted);
}
.tache-quoi .icon { width: 15px; height: 15px; flex: none; }

/* ---------- Le retard ----------
   Trois tons, et c'est la seule couleur de la carte. Un écran où tout
   crie ne hiérarchise plus rien : ce qui traîne depuis quatre jours doit
   se voir avant ce qui vient de tomber. */
.tache-retard {
  flex: none;
  padding: 4px 10px; border-radius: var(--r-pill);
  font: 600 var(--fs-xs)/1.5 var(--font-body);
  white-space: nowrap;
}
.tache-retard--ok     { background: var(--ok-soft);     color: var(--green-text); }
.tache-retard--warn   { background: var(--warn-soft);   color: var(--warn); }
.tache-retard--danger { background: var(--danger-soft); color: var(--danger); }

.tache-coord {
  display: flex; align-items: center; gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-2);
  font-size: var(--fs-sm);
}
.tache-coord .icon { width: 14px; height: 14px; margin-right: 3px; }

.tache-statut {
  padding: 2px 8px; border-radius: var(--r-pill);
  border: 1px solid var(--border);
  font-size: var(--fs-xs); color: var(--text-muted);
}

/* ---------- L'aperçu ---------- */
.tache-apercu {
  margin-top: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1);
}
.tache-apercu .lbl { display: block; margin: var(--s-2) 0 4px; }
.tache-apercu .lbl:first-child { margin-top: 0; }

.tache-apercu textarea.tache-corps {
  width: 100%;
  /* Le corps est du texte brut avec des sauts de ligne : une police à
     chasse fixe montre exactement ce qui partira, y compris les lignes
     vides entre les paragraphes. */
  font: 400 var(--fs-sm)/1.6 var(--font-mono, ui-monospace, monospace);
  resize: vertical;
}
.tache-apercu input.tache-sujet { width: 100%; }

.tache-apercu--probleme {
  display: flex; gap: var(--s-3); align-items: flex-start;
  border-color: var(--warn); background: var(--warn-soft);
}
.tache-apercu--probleme > .icon {
  width: 20px; height: 20px; flex: none; color: var(--warn); margin-top: 2px;
}
.tache-apercu--probleme > div { flex: 1; min-width: 0; }
.tache-apercu--probleme textarea,
.tache-apercu--probleme input { width: 100%; margin-top: var(--s-2); }
.tache-apercu--probleme .btn { margin-top: var(--s-2); }

.tache-envoi {
  display: flex; align-items: center; gap: var(--s-3);
  flex-wrap: wrap; margin-top: var(--s-3);
}

/* ---------- Les actions ----------
   Envoyer / appeler à gauche, reporter / clore à droite. L'espaceur
   sépare « faire quelque chose » de « décider de ne rien faire » —
   deux familles de gestes qu'on ne veut pas confondre d'un clic. */
.tache-actions {
  display: flex; align-items: center; gap: var(--s-2);
  flex-wrap: wrap;
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}
.tache-espace { flex: 1 1 auto; min-width: var(--s-3); }
.tache-abandon:hover { color: var(--danger); }

@media (max-width: 720px) {
  .tache-espace { display: none; }
  .tache-actions { gap: 6px; }
}

/* =====================================================================
   LE CHOIX DE CANAL (0158)

   Deux boutons plutot qu'une liste deroulante : il n'y a que deux
   canaux, ils tiennent cote a cote, et un choix visible en permanence
   se change sans y penser. `aria-pressed` porte l'etat pour qui
   n'attrape pas la difference de couleur.
   ===================================================================== */
.tache-canaux {
  display: inline-flex;
  margin-bottom: var(--s-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: var(--surface-2);
  gap: 2px;
}

.tache-canal {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border: 0; border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: 600 var(--fs-xs)/1 var(--font-body);
  cursor: pointer;
}
.tache-canal .icon { width: 14px; height: 14px; }
.tache-canal:hover { color: var(--text); }
.tache-canal:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }

.tache-canal.est-actif {
  background: var(--surface-1);
  color: var(--green);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .10);
}
