/* ============================================================
   workflow.css · styles du moteur de suivi configurable (workflow-engine.js)
   ============================================================
   Le moteur (assets/workflow-engine.js) est monte a la fois sur la fiche
   (projets/fiche.html, qui a deja ces styles dans fiche.css) ET sur le
   formulaire de creation (projets/nouvelle-demande.html, qui n'a pas fiche.css).
   Ce fichier fournit UNIQUEMENT les classes emises par le moteur, pour que le
   suivi s'affiche correctement partout.

   NOTE · ces regles reprennent a l'identique le sous-ensemble .wf-* / pickers /
   .ident-label / .fiche-inp de fiche.css. Si tu changes le look du suivi,
   change les deux (ou, un jour, extraire fiche.css vers ce fichier partage).
   Tous les tokens (var(--...)) viennent de assets/styles.css, dispo partout.
   ============================================================ */

/* ---- Boite d'etape ---- */
.wf-step {
  display: flex; flex-direction: column;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  background: var(--canvas);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}
.wf-step-done   { opacity: 0.7; }
.wf-step-closed { opacity: 0.7; }
.wf-step-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline-soft);
}
.wf-step-done .wf-step-header { border-bottom-color: transparent; }

.wf-badge {
  width: 22px; height: 22px; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.wf-badge-done    { background: var(--semantic-up);   color: #fff; }
.wf-badge-current { background: var(--ink);            color: var(--canvas); }
.wf-badge-closed  { background: var(--semantic-down);  color: #fff; }
.wf-badge-future  { background: transparent; color: var(--muted); border: 1px solid var(--hairline); }

.wf-step-meta { flex: 1; min-width: 0; }
.wf-step-num  {
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 1px;
}
.wf-step-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.wf-step-right {
  flex-shrink: 0; font-size: 11px; color: var(--muted); font-family: var(--font-mono);
}
.wf-step-body { padding: 16px 18px 18px 52px; }

.wf-check-line { font-size: 12px; color: var(--body); line-height: 1.5; }
.wf-result-pill {
  display: inline-block;
  font-size: 11px; font-weight: 500;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: rgba(207, 32, 47, 0.10);
  color: var(--semantic-down);
  line-height: 1.5; vertical-align: baseline;
}
.wf-result-pill.ok { background: rgba(5, 177, 105, 0.10); color: var(--semantic-up); }

/* ---- Boutons de reponse ---- */
.wf-btn-group { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.wf-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.wf-btn:hover { background: var(--surface-soft); border-color: var(--ink); }
.wf-btn-primary {
  background: var(--primary); color: var(--on-primary);
  border-color: transparent; font-weight: 600;
}
.wf-btn-primary:hover { background: var(--primary-active); border-color: transparent; }
.wf-btn-danger {
  background: var(--canvas); color: var(--semantic-down);
  border-color: var(--hairline); font-weight: 500;
}
.wf-btn-danger:hover { background: var(--canvas); border-color: var(--semantic-down); color: var(--semantic-down); }

/* ---- Picker de jours ---- */
.day-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 4px; margin-bottom: 4px;
}
.day-cell {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 4px;
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--canvas);
  cursor: pointer; font-family: var(--font-body);
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  min-width: 0;
}
.day-cell:hover { border-color: var(--ink); }
.day-cell.selected { border-color: var(--primary); background: var(--primary); }
.day-cell .dow { font-size: 10px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.04em; }
.day-cell .dnum {
  font-size: 15px; font-weight: 500; color: var(--ink);
  font-family: var(--font-mono); line-height: 1.1; font-variant-numeric: tabular-nums;
}
.day-cell .dmon { font-size: 10px; color: var(--muted); }
.day-cell.selected .dow,
.day-cell.selected .dmon { color: rgba(255,255,255,0.75); }
.day-cell.selected .dnum { color: #fff; }

/* ---- Picker de presets ---- */
.preset-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.preset-cell {
  padding: 7px 14px;
  border: 1px solid var(--hairline); border-radius: var(--r-pill);
  background: var(--canvas);
  cursor: pointer; font-family: var(--font-body); font-size: 12px; font-weight: 500;
  color: var(--ink);
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.preset-cell:hover { border-color: var(--ink); }
.preset-cell.selected { border-color: var(--primary); background: var(--primary); color: #fff; }

/* ---- Champs de formulaire d'une reponse ---- */
.wf-form-row { margin-bottom: 20px; }
.wf-form-row .ident-label {
  display: block;
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 6px;
}
.ident-label {
  font-size: 10px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 2px;
}
.fiche-inp, .fiche-sel, .fiche-ta {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
  background: var(--canvas); color: var(--ink);
  font-family: inherit; font-size: 13px;
  padding: 6px 10px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fiche-inp:focus, .fiche-sel:focus, .fiche-ta:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.fiche-ta { resize: none; min-height: 80px; padding: 10px 12px; line-height: 1.55; overflow: hidden; }

/* ---- Banniere d'etat ferme ---- */
.wf-closed-banner {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: var(--space-lg);
  text-align: center;
  font-size: 13px; color: var(--muted);
  line-height: 1.6;
  margin-bottom: var(--space-base);
}
