/* ==========================================================================
   fiche-direction.css — TEAM RH v0.71
   Direction visuelle de la fiche : référence « Fiche du travailleur » (Mario Bouchard),
   TEAM_Booking_Fiche_Travailleur_Astra.html, approuvée par Thomas les 24-25 sept. 2026.
   Valeurs reprises de la référence : palette --tm-*, géométrie, typographie
   ( Merriweather régulier pour les noms, texte sans empattement ), espacements.
   Présentation seulement : mêmes identifiants, mêmes onglets, mêmes sections.
   Chargé après team-rh.css.
   ========================================================================== */

:root {
  --tm-ink: #17383f; --tm-teal: #1b3c43; --tm-soft: #edf3f1; --tm-paper: #f4f5f2;
  --tm-line: #e0e6e2; --tm-muted: #5c6c67; --tm-green: #286546; --tm-story: #f8faf6;
  --tm-context: #f4f6f2; --tm-context-line: #e7ebe4; --tm-fact-line: #dce6dd;
}

/* ---- Conteneur : la fiche devient une page large, à côté de la barre latérale ---- */
#fiche.fiche-v2 {
  width: 100vw; max-width: 100vw; padding: 19px 12px 24px;
  background: var(--tm-paper); box-shadow: none; border: 0;
}
@media (min-width: 700px) { #fiche.fiche-v2 { width: min(1120px, 100vw); padding: 25px 26px 24px; box-shadow: -12px 0 40px rgba(16,44,53,.18); } }
@media (min-width: 1100px) {
  #fiche.fiche-v2, #fiche.fiche-v2.tf-workspace-wide { left: 224px; right: 0; width: auto; max-width: none; padding: 28px 32px 28px; box-shadow: none; }
}
#fiche .tf-stage, #fiche.tf-workspace-wide .tf-stage { max-width: 1120px; margin: 0 auto; }
#fiche .tf-window, #fiche.tf-workspace-wide .tf-window { max-width: none; }
#fiche.tf-workspace-wide .tf-header, #fiche.tf-workspace-wide .tf-tabs,
#fiche.tf-workspace-wide .tf-facts, #fiche.tf-workspace-wide .tf-next { max-width: none; margin-left: 0; margin-right: 0; }

/* ---- Titre de page ( au-dessus de la carte ) ---- */
#fiche .tf-page-titre { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 52px 21px 0; }
#fiche .tf-page-eyebrow { font: 600 11px/1.5 Figtree, sans-serif; letter-spacing: 1.4px; text-transform: uppercase; color: var(--tm-muted); margin-bottom: 6px; }
#fiche .tf-page-h1 { font: 400 25px/1.3 Merriweather, Georgia, serif; letter-spacing: -.6px; color: var(--tm-ink); margin: 0; }
#fiche .tf-internal { display: flex; align-items: center; gap: 5px; white-space: nowrap; padding-bottom: 3px; font-size: 12px; color: var(--tm-muted); }
#fiche .tf-internal svg { width: 14px; height: 14px; }
#fiche .tf-close { top: 0; right: 0; width: 44px; height: 44px; border: 1px solid var(--tm-line); background: #fff; border-radius: 8px; color: var(--tm-ink); }
#fiche .tf-close:hover { background: var(--tm-soft); }

/* ---- Carte ---- */
#fiche .tf-window {
  --f2-text: var(--tm-ink); --f2-muted: var(--tm-muted); --f2-line: var(--tm-line); --f2-brand: var(--tm-teal); --f2-inset: var(--tm-context);
  position: relative; background: #fff; border: 1px solid var(--tm-line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 18px rgba(23,56,63,.04); color: var(--tm-ink);
}
#fiche .tf-header { padding: 24px; border-bottom: 1px solid var(--tm-line); }
#fiche .tf-header .tf-eyebrow { display: none; } /* le titre de page porte maintenant ce repère */
#fiche .tf-heading { display: block; }
#fiche .tf-idgroup { display: flex; gap: 19px; align-items: center; }
#fiche .tf-person-info { flex: 1; min-width: 0; }
#fiche .tf-person-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
#fiche .tf-window h2 { font: 400 25px/1.3 Merriweather, Georgia, serif; letter-spacing: -.7px; color: var(--tm-ink); }
#fiche .tf-trade { font-size: 13px; margin: 6px 0 0; color: #394f49; }
#fiche .tf-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--tm-muted); }
#fiche .tf-meta span { display: inline-flex; align-items: center; gap: 5px; }
#fiche .tf-meta svg.tf-i { width: 13px; height: 13px; }
#fiche .tf-appel { margin-top: 14px; gap: 12px; }
#fiche .tf-tel { font-size: 14px; font-weight: 600; }
#fiche .tf-appeler { min-height: 44px; padding: 9px 14px; font-size: 14px; border-color: #cbd7cf; border-radius: 6px; }
#fiche .tf-appeler:hover { background: var(--tm-soft); }

/* pastille d'état ( couleur + libellé + point ) */
#fiche .tf-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; font-weight: 600; line-height: 1.4; padding: 5px 10px; border-radius: 20px; color: #2e4f48; background: #ebf0ed; }
#fiche .tf-status .tf-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; display: inline-block; flex: none; }
#fiche .tf-status.ok { color: #255b41; background: #eaf3ea; }
#fiche .tf-status.ok .tf-dot { background: #4c8a61; opacity: 1; }
#fiche .tf-status.att { color: #7f4a22; background: #fbf0e4; }
#fiche .tf-status.att .tf-dot { background: #bd7a3e; opacity: 1; }
#fiche .tf-status.stop { color: #a3241b; background: #fde8e6; }

/* ---- Portrait ---- */
#fiche .tf-portrait-bloc { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
#fiche .tf-portrait {
  position: relative; width: 112px; height: 128px; flex: none; padding: 0; margin: 0; border: 0; overflow: hidden;
  border-radius: 9px; background: #e4ebe5 center / cover no-repeat; color: var(--tm-teal);
  display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: none;
}
#fiche .tf-portrait:disabled { cursor: default; opacity: 1; }
#fiche .tf-portrait-ini { font: 400 32px/1 Merriweather, Georgia, serif; color: var(--tm-teal); margin-bottom: 14px; }
#fiche .tf-portrait.tf-portrait-chargee .tf-portrait-ini { visibility: hidden; }
#fiche .tf-portrait-legende {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 4px; text-align: center;
  font: 500 12px/1.3 Figtree, sans-serif; color: #fff; background: rgba(23,56,63,.87);
}
#fiche .tf-portrait:disabled .tf-portrait-legende { background: transparent; color: #4f6560; }
#fiche .tf-portrait:not(:disabled):hover .tf-portrait-legende { background: var(--tm-teal); }
#fiche .tf-portrait:focus-visible { outline: 3px solid #D54A2B; outline-offset: 2px; }
#fiche .tf-portrait.photo-survol { outline: 3px dashed var(--tm-teal); outline-offset: 2px; }
#fiche .tf-portrait.photo-occupe .tf-portrait-legende::after { content: attr(data-etat); }
#fiche .tf-portrait.photo-occupe .tf-portrait-legende { font-size: 0; }
#fiche .tf-portrait.photo-occupe .tf-portrait-legende::after { font-size: 12px; }
#fiche .tf-portrait-changer {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 8px; margin: 0;
  border: 0; background: transparent; color: var(--tm-teal); font: 500 12px Figtree, sans-serif;
  text-decoration: underline; text-underline-offset: 4px; cursor: pointer; box-shadow: none;
}
#fiche .tf-portrait-changer .ti { width: 14px; height: 14px; }
#fiche .tf-portrait-changer[hidden] { display: none; }

/* photo agrandie */
#fiche .tf-photo-overlay { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: center; padding: 32px 24px; background: rgba(16,44,53,.67); }
#fiche .tf-photo-carte { width: 380px; max-width: 100%; padding: 17px; background: #fff; border: 1px solid #dce5df; border-radius: 12px; box-shadow: 0 15px 50px rgba(16,44,53,.25); }
#fiche .tf-photo-entete { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
#fiche .tf-photo-entete h3 { font: 600 15px/1.3 Figtree, sans-serif; margin: 0; }
#fiche .tf-photo-entete p { font-size: 12px; color: var(--tm-muted); margin: 2px 0 0; }
#fiche .tf-photo-fermer { min-height: 44px; border: 1px solid #cbd7cf; background: #fff; color: var(--tm-ink); padding: 8px 14px; border-radius: 6px; font: 600 13px Figtree, sans-serif; cursor: pointer; }
#fiche .tf-photo-grande { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 7px; background: #eef2ef; }

/* ---- « Son expérience, en quelques mots » ---- */
#fiche .tf-story { padding: 18px 24px 19px; border-bottom: 1px solid var(--tm-line); background: var(--tm-story); }
#fiche .tf-story-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
#fiche .tf-story-head h3 { font: 600 14px/1.4 Figtree, sans-serif; margin: 0; color: var(--tm-ink); }
#fiche .tf-story-source { font-size: 12px; color: var(--tm-muted); white-space: nowrap; }
#fiche .tf-story-grid { display: grid; grid-template-columns: minmax(0,1fr) 220px; gap: 26px; }
#fiche .tf-story-description { font-size: 14px; line-height: 1.65; color: #34493f; min-width: 0; }
#fiche .tf-story-description p { margin: 0 0 6px; white-space: pre-line; }
#fiche .tf-story-description p:last-child { margin-bottom: 0; }
#fiche .tf-story-description strong { color: var(--tm-ink); font-weight: 600; }
#fiche .tf-story-declare { font-size: 13px; color: #44594f; }
#fiche .tf-story-vide { color: var(--tm-muted); }
#fiche .tf-story-people { padding-left: 18px; border-left: 1px solid #dae3d8; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
#fiche .tf-story-people p { margin: 0; overflow-wrap: anywhere; }
#fiche .tf-story-people strong { display: block; font-size: 12px; font-weight: 500; color: var(--tm-muted); margin-bottom: 2px; }
#fiche .tf-story-detail { border-top: 1px solid #e3e9df; margin-top: 12px; }
#fiche .tf-story-detail > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 40px; padding: 8px 0 0; font-size: 12px; color: var(--tm-muted); cursor: pointer; }
#fiche .tf-story-detail > summary::-webkit-details-marker { display: none; }
#fiche .tf-story-detail > summary .tf-chev { width: 14px; height: 14px; transition: transform .15s; }
#fiche .tf-story-detail[open] > summary .tf-chev { transform: rotate(180deg); }
#fiche .tf-story-origine { padding: 6px 0 0; max-width: 680px; font-size: 12px; color: #4b5f56; }
#fiche .tf-story-origine p { margin: 0 0 4px; }

/* ---- Onglets sobres ---- */
#fiche .tf-tabs { display: flex; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--tm-line); }
#fiche .tf-tab { min-height: 46px; padding: 14px 0 12px; font: 500 13px Figtree, sans-serif; color: var(--tm-muted); border-bottom: 2px solid transparent; }
#fiche .tf-tab[aria-selected="true"] { color: var(--tm-teal); border-bottom-color: var(--tm-teal); font-weight: 700; }
#fiche .tf-tab:hover { color: var(--tm-ink); }

/* ---- Corps : contenu + colonne « Prochaine étape » ---- */
#fiche .tf-body { display: grid; grid-template-columns: minmax(0,1fr) 255px; gap: 30px; padding: 24px; align-items: start; }
#fiche .tf-main { min-width: 0; }
#fiche .tf-panel { padding: 0; }
#fiche .tf-section-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
#fiche .tf-section-top h3 { font: 600 15px/1.4 Figtree, sans-serif; margin: 0; color: var(--tm-ink); }
#fiche .tf-alerts:not(:empty) { margin-bottom: 18px; }

#fiche .tf-facts { grid-template-columns: 1fr 1fr; gap: 21px 20px; margin: 0 0 22px; }
#fiche .tf-facts > div { padding-left: 11px; border-left: 2px solid var(--tm-fact-line); min-width: 0; }
#fiche .tf-facts dt { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--tm-muted); margin: 0 0 4px; line-height: 1.5; }
#fiche .tf-facts dd { font-size: 14px; font-weight: 600; letter-spacing: -.2px; color: var(--tm-ink); }
#fiche .tf-facts dd.tf-fact-sub { font-size: 12px; font-weight: 400; letter-spacing: 0; margin-top: 3px; color: var(--tm-muted); }

/* sections dépliables, comme les « détails » de la référence */
#fiche .tf-extensions { margin-top: 8px; }
#fiche .tf-section { border-top: 1px solid var(--tm-line); margin-top: 0; }
#fiche .tf-section > summary { min-height: 48px; padding: 14px 0; font: 600 14px Figtree, sans-serif; color: var(--tm-ink); }
#fiche .tf-section > summary:hover { color: var(--tm-teal); }
#fiche .tf-section-body { padding: 0 0 18px; }

/* colonne de contexte */
#fiche .tf-context {
  position: sticky; top: 0; background: var(--tm-context); border: 1px solid var(--tm-context-line); border-radius: 9px;
  padding: 18px; min-width: 0;
}
#fiche .tf-context .tf-next-label { font: 600 11px/1.5 Figtree, sans-serif; letter-spacing: 1.2px; text-transform: uppercase; color: var(--tm-muted); margin: 0; }
#fiche .tf-context h3 { font: 400 18px/1.35 Merriweather, Georgia, serif; letter-spacing: -.3px; margin: 9px 0 6px; color: var(--tm-ink); }
#fiche .tf-context p { font-size: 13px; line-height: 1.5; color: #4b5f56; margin: 0; }
#fiche .tf-context .tf-primary {
  margin-top: 17px; min-height: 46px; border-radius: 6px; background: var(--tm-teal); border: 1px solid var(--tm-teal);
  font: 600 14px/1.3 Figtree, sans-serif; box-shadow: none;
}
#fiche .tf-context .tf-primary:hover { background: #24505a; }
#fiche .tf-context-foot { font-size: 12px; color: var(--tm-muted); text-align: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid #dce3d8; }

/* documents et historique dans la même direction */
#fiche .tf-doc { padding: 12px 0; border-bottom-color: #edf0eb; }
#fiche .tf-doc strong { font-size: 13px; }
#fiche .tf-doc-state { font-size: 12px; color: var(--tm-muted); }
#fiche .tf-history { margin-top: 4px; padding-left: 15px; border-left: 1px solid #d5e0d7; }
#fiche .tf-history li { position: relative; padding: 0 0 20px; }
#fiche .tf-history li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 9px; height: 9px; background: #52775c; border: 2px solid #fff; border-radius: 50%; }
#fiche .tf-history time { font-size: 12px; margin-bottom: 3px; }
#fiche .tf-history p { font-size: 13px; font-weight: 600; }

#fiche .tf-footer { padding: 10px 24px; background: #fdfefd; border-top: 1px solid var(--tm-line); font-size: 12px; color: var(--tm-muted); }

/* ---- Largeurs intermédiaires ---- */
@media (max-width: 960px) {
  #fiche .tf-body { grid-template-columns: minmax(0,1fr) 220px; gap: 20px; padding: 20px; }
  #fiche .tf-header { padding: 20px; }
  #fiche .tf-story { padding: 17px 20px; }
  #fiche .tf-story-grid { grid-template-columns: minmax(0,1fr) 180px; gap: 20px; }
}
@media (max-width: 760px) {
  /* la colonne passe AU-DESSUS du contenu : l'action principale reste visible sans défiler ( écart justifié ) */
  #fiche .tf-body { grid-template-columns: 1fr; gap: 20px; }
  #fiche .tf-context { position: static; order: -1; }
  #fiche .tf-story-grid { grid-template-columns: 1fr; gap: 14px; }
  #fiche .tf-story-people { padding-left: 0; padding-top: 12px; border-left: 0; border-top: 1px solid #dae3d8; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  #fiche .tf-tabs { gap: 20px; padding: 0 20px; }
  #fiche .tf-page-titre .tf-internal { display: none; }
}
/* ---- Téléphone ( 390 ) ---- */
@media (max-width: 600px) {
  #fiche.fiche-v2 { padding: 16px 12px 20px; }
  #fiche .tf-page-titre { margin: 0 52px 16px 3px; }
  #fiche .tf-page-h1 { font-size: 23px; }
  #fiche .tf-header { padding: 18px 16px; }
  #fiche .tf-idgroup { gap: 13px; align-items: flex-start; }
  #fiche .tf-portrait { width: 84px; height: 100px; }
  #fiche .tf-portrait-ini { font-size: 26px; }
  #fiche .tf-portrait-legende { font-size: 11px; padding: 5px 2px; }
  #fiche .tf-window h2 { font-size: 21px; }
  #fiche .tf-person-line { gap: 6px; }
  #fiche .tf-trade { font-size: 13px; margin-top: 4px; }
  #fiche .tf-meta { gap: 4px 12px; margin-top: 8px; }
  #fiche .tf-appel { margin-top: 12px; }
  #fiche .tf-appeler { flex: 1 1 auto; justify-content: center; }
  #fiche .tf-story { padding: 17px 16px; }
  #fiche .tf-story-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  #fiche .tf-tabs { padding: 0 16px; gap: 0; justify-content: space-between; }
  #fiche .tf-tab { font-size: 14px; flex: 1; }
  #fiche .tf-body { padding: 18px 16px; gap: 18px; }
  #fiche .tf-facts { gap: 18px 14px; }
  #fiche .tf-context { padding: 17px; }
  #fiche .tf-context .tf-primary { min-height: 48px; }
  #fiche .tf-footer { padding: 11px 16px; }
  #fiche .tf-footer span:last-child { display: none; }
  #fiche .tf-photo-overlay { padding: 20px 12px; }
}
@media (pointer: coarse) {
  #fiche .tf-tab, #fiche .tf-section > summary, #fiche .tf-story-detail > summary, #fiche .tf-portrait-changer { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { #fiche .tf-story-detail > summary .tf-chev { transition: none; } }

/* ---- Repères d'appel ( v0.69 ) dans la même direction : encart clair, choix en contrôle segmenté ---- */
#fiche .reperes-appel { background: #f5f7f3; border: 1px solid var(--tm-context-line); border-radius: 8px; padding: 14px 16px 12px; margin: 0 0 22px; }
#fiche .reperes-titre { font-size: 14px; font-weight: 600; color: var(--tm-ink); margin-bottom: 4px; }
#fiche .repere-ligne { border-top-color: #e3e9df; padding: 10px 0; }
#fiche .repere-lib strong { font-size: 13px; font-weight: 600; }
#fiche .repere-lib small { font-size: 12px; color: var(--tm-muted); line-height: 1.45; }
#fiche .repere-choix-groupe { gap: 0; border: 1px solid #cbd7cf; border-radius: 6px; overflow: hidden; background: #fff; flex-wrap: nowrap; }
#fiche .repere-choix { min-height: 44px; min-width: 52px; border: 0; border-left: 1px solid #dfe6e1; border-radius: 0; background: #fff; font-size: 13px; font-weight: 600; padding: 8px 12px; color: var(--tm-ink); }
#fiche .repere-choix:first-child { border-left: 0; }
#fiche .repere-choix:hover:not(:disabled) { background: var(--tm-soft); }
#fiche .repere-choix.on { background: var(--tm-teal); color: #fff; }
#fiche .repere-choix.on[data-valeur="null"] { background: #e4ece6; color: var(--tm-ink); border: 0; border-left: 1px solid #dfe6e1; box-shadow: inset 0 -2px 0 var(--tm-teal); }
#fiche .repere-choix.on[data-valeur="null"]:first-child { border-left: 0; }
#fiche .repere-masque { font-size: 12px; }
#fiche .repere-choix { white-space: nowrap; }
@media (max-width: 600px) { #fiche .repere-choix-groupe { width: 100%; } #fiche .repere-choix { flex: 1 1 auto; padding: 8px; min-width: 0; } }

/* ==========================================================================
   Harmonisation légère des autres écrans ( jetons seulement ) : mêmes fonds
   verts très clairs, mêmes filets, barre latérale et élément actif de la référence.
   La passe écran par écran suivra l'avis de Thomas sur la fiche.
   ========================================================================== */
:root { --t-ground: #f4f5f2; --t-line: #e0e6e2; --t-column: #edf3f1; --t-surface-2: #f0f5ef; --t-sidebar: #1b3c43; }
@media (min-width: 1100px) {
  .outils .espaces button:hover, .outils .commutateur-vue button:hover { background: #2b4b52; }
  .outils .espaces button.actif, .outils .commutateur-vue button.actif { background: #315158; box-shadow: inset 3px 0 0 #d7e2cf; }
  body.nav-laterale-compacte .outils .espaces button.actif, body.nav-laterale-compacte .outils .commutateur-vue button.actif { background: var(--t-ink); box-shadow: none; }
  .outils { background: #fafbf9; border-bottom: 1px solid var(--t-line); }
}

/* v0.74 — « L'essentiel du dossier » modifiable sur place */
#fiche .tf-section-top #fiche-essentiel-modifier { min-height: 44px; }
#fiche .essentiel-edition { display: grid; grid-template-columns: 1fr; gap: 6px; max-width: 520px; margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--tm-context-line); border-radius: 8px; background: #f5f7f3; }
#fiche .essentiel-edition label { font-size: 12px; font-weight: 600; letter-spacing: .4px; color: var(--tm-muted); margin-top: 6px; }
#fiche .essentiel-edition input, #fiche .essentiel-edition select { min-height: 48px; font-size: 16px; }
#fiche .essentiel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
#fiche .essentiel-actions .mini { min-height: 44px; }
