/* tasks-projects : styles propres à ce module (chargé après style.css) */

/* ---------- Statut « Incapacité d'exécution » : libellé long, il passe à la ligne dans les boutons d'avancement ---------- */
.seg.seg-4 .segbtn { white-space: normal; line-height: 1.2; overflow-wrap: anywhere; }

/* ---------- Filtre de période « Du … au … » (liste des tâches, direction et salarié) ---------- */
.period-field { flex: 1 1 340px; min-width: 260px; }
.period-inputs { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.period-part { display: flex; align-items: center; gap: 8px; flex: 1 1 150px; min-width: 0; }
.period-part label { font-weight: 600; color: var(--muted); flex: none; }
.period-part input[type="date"] { flex: 1 1 auto; min-width: 0; }
.period-field .neg { display: block; margin-top: 4px; }
.filters-inline { margin: 0 0 4px; }

/* ---------- Fiche projet : étapes ---------- */
.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.step-item { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.step-item:first-child { padding-top: 0; border-top: 0; }
.step-open { min-height: 0; padding: 0; text-align: left; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.step-open:hover { text-decoration: underline; }
.pstep-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.pstep-progress .pbar { height: 10px; }
.pstep { border-left: 5px solid var(--pc); }
.pstep.st-done { border-left-color: var(--ok); }
.pstep.st-late { border-left-color: var(--bad); }
@media (max-width: 560px) { .pstep-progress { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Rétroplanning : frise horizontale, une barre par étape ---------- */
.rt-wrap { display: grid; gap: 10px; min-width: 0; }
.rt-legend { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; font-size: .85rem; color: var(--muted); }
.rt-legend > span { display: inline-flex; gap: 6px; align-items: center; }
.lg-flag { color: var(--brand); font-weight: 800; }

/* Seul ce bloc défile horizontalement (la page, elle, ne défile jamais de côté). */
.rt-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overscroll-behavior-x: contain; }
.rt-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.rt { --rt-label: 210px; position: relative; width: calc(var(--rt-label) + var(--rt-w)); min-width: 100%; }
.rt-row { display: flex; border-top: 1px solid var(--line); min-height: 62px; }
.rt-head { border-top: 0; min-height: 0; background: var(--surface-2); position: relative; }
.rt-label { flex: none; width: var(--rt-label); position: sticky; left: 0; z-index: 4; background: var(--surface); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; justify-content: center; border-right: 1px solid var(--line); min-width: 0; }
.rt-head .rt-label { background: var(--surface-2); justify-content: flex-start; }
.rt-cap { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.rt-track { flex: none; position: relative; width: var(--rt-w); z-index: 2; }
.rt-head .rt-track { height: 74px; }
.rt-name { font-weight: 700; overflow-wrap: break-word; text-align: left; }
.rt-link { background: none; border: 0; padding: 0; min-height: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; }
.rt-link:hover { text-decoration: underline; }
.rt-sub { font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; line-height: 1.3; }
.rt-step { background: color-mix(in srgb, var(--pc) 4%, var(--surface)); }
.rt-step .rt-label { background: color-mix(in srgb, var(--pc) 6%, var(--surface)); }

/* échelle : mois, puis semaines (numéro du lundi), puis pastilles « Aujourd'hui » et « Date cible » */
.rt-month { position: absolute; top: 0; height: 24px; padding: 4px 6px; font-size: .78rem; font-weight: 700; border-left: 1px solid var(--line-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-week { position: absolute; top: 24px; height: 22px; padding: 3px 4px; font-size: .7rem; color: var(--muted); border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.rt-pill { position: absolute; top: 48px; transform: translateX(-50%); font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; line-height: 1.3; }
.rt-pill.before { transform: translateX(-100%); margin-left: 1px; }
.rt-pill.after { transform: none; }
.rt-pill-today { background: var(--honey); color: var(--on-honey); }
.rt-pill-target { background: var(--brand); color: var(--on-brand); }

/* traits verticaux : semaines, mois, aujourd'hui (miel), date cible (drapeau) */
.rt-body { position: relative; }
.rt-overlay { position: absolute; top: 0; bottom: 0; left: var(--rt-label); width: var(--rt-w); pointer-events: none; z-index: 1; }
.rt-wline, .rt-mline, .rt-today, .rt-target { position: absolute; top: 0; bottom: 0; }
.rt-wline { border-left: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.rt-mline { border-left: 1px solid var(--line-strong); }
.rt-today { width: 2px; margin-left: -1px; background: var(--honey-strong); opacity: .9; z-index: 2; }
.rt-target { width: 0; border-left: 2px dashed var(--brand); margin-left: -1px; z-index: 2; }

/* barres d'étape : remplies selon la progression */
.rt-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 26px; min-width: 10px; padding: 0; border: 1.5px solid var(--pc); border-radius: 8px; background: color-mix(in srgb, var(--pc) 14%, var(--surface)); overflow: hidden; display: block; }
button.rt-bar { cursor: pointer; }
button.rt-bar:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.rt-fill { position: absolute; inset: 0 auto 0 0; background: var(--pc); opacity: .9; }
.rt-bar.st-done { border-color: var(--ok); }
.rt-bar.st-done .rt-fill { background: var(--ok); }
.rt-bar.st-late { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 30%, transparent); }
.rt-bar.st-upcoming, .rt-bar.st-todo { border-style: dashed; }
.rt-bar.loose { border-style: dotted; }
.rt-note { position: absolute; top: 50%; transform: translateY(-50%); font-size: .75rem; font-weight: 700; color: var(--muted); white-space: nowrap; pointer-events: none; }
.rt-nodate { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); font-size: .78rem; color: var(--muted); font-style: italic; }

@media (max-width: 560px) {
  .rt { --rt-label: 132px; }
  .rt-label { padding: 6px 8px; }
  .rt-name { font-size: .82rem; }
  .rt-sub { font-size: .72rem; }
  .rt-row { min-height: 70px; }
}
