/* Accueil (jalon J3, lot L3, maquettes 01 à 03, D68) : grille, orbite, fond en ondes concentriques.
   Ondes : bleu très pâle, sur l'accueil seulement, derrière les panneaux (opaques : aucun texte ne perd de contraste),
   fixes ; déclinées pour le thème sombre (jeton --onde). */

.accueil { min-height: 100%; background-color: var(--bg);
  background-image: repeating-radial-gradient(circle at 50% 42%, transparent 0 46px, var(--onde) 46px 47.5px);
  background-attachment: local; }
.accueil .head { background: transparent; border-bottom: 0; }

/* Grille */
.accueil-haut { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 22px; align-items: start; }
/* Remplissage automatique : un bloc seul prend toute la largeur, deux se partagent la ligne dès qu'ils tiennent */
.accueil-bas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 22px; align-items: start; }
.titre-section { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
/* auto-fit : les familles présentes se partagent toute la largeur (auto-fill laisserait des colonnes vides) */
.grille-familles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.famille-carte { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 14px 10px; min-width: 0; }
.famille-carte h3 { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px 6px; }
.famille-carte ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.famille-carte a { display: flex; gap: 10px; align-items: flex-start; padding: 7px 6px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.famille-carte a .icone { color: var(--navy-2); margin-top: 2px; flex: 0 0 auto; }
.famille-carte a:hover { background: var(--line-2); }
.famille-carte a:hover .module-titre { color: var(--navy-2); }
.module-titre { display: block; font-weight: 500; }
.famille-carte .muted { display: block; }

.liste-reprise, .liste-a-traiter, .liste-simple { list-style: none; margin: 0; padding: 0; }
/* Reprendre et À traiter : hauteur réservée dès le premier affichage (six lignes), défilement au-delà ; rien ne bouge
   à l'arrivée des données (règle de stabilité, docs/j3-conception.md) */
.corps-reserve { height: 20rem; overflow-y: auto; }
.reprise { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, max-content); gap: 6px 14px; align-items: center;
  padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.reprise:last-child { border-bottom: 0; }
.reprise.compact { grid-template-columns: minmax(0, 1fr); padding: 8px 16px; }
.code-genre { font: 500 11px/1 var(--mono); width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: 6px; color: var(--muted); background: var(--bg); }
.reprise-texte { display: flex; flex-direction: column; min-width: 0; }
.reprise-texte a { color: var(--ink); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.reprise-texte a:hover { text-decoration: underline; color: var(--navy-2); }
/* Une seule ligne de détail par objet (D97) : moment et état l'un sous l'autre, à droite, pour laisser la largeur au
   nom et au détail */
.reprise:not(.compact) { grid-template-columns: auto minmax(0, 1fr) max-content; }
.reprise:not(.compact) .reprise-quand { grid-column: 3; grid-row: 1; justify-self: end; }
.reprise:not(.compact) .st { grid-column: 3; grid-row: 2; justify-self: end; }
.reprise:not(.compact) .code-genre, .reprise:not(.compact) .reprise-texte { grid-row: 1 / span 2; }
.reprise-quand { white-space: nowrap; }
.pied-panel { padding: 10px 18px; border-top: 1px solid var(--line-2); font-size: 13.5px; }

.a-traiter { display: flex; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.a-traiter:last-child { border-bottom: 0; }
.flottant .a-traiter { padding: 8px 16px; }
.pastille-gravite { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--navy-3); }
.a-traiter.erreur .pastille-gravite { background: var(--red); }
.a-traiter.attention .pastille-gravite { background: var(--orange); }
.a-traiter-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* Lien et téléchargement d'un élément (document _schema à déposer, J2b L2) : cibles espacées (24 px au moins) */
.a-traiter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.a-traiter-titre { font-weight: 500; }
/* Gravité en toutes lettres (J4 bis, L5) : la pastille seule ne distingue « Urgent » d'« À regarder » que par la couleur */
.gravite-texte { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.a-traiter.erreur .gravite-texte { color: var(--red); }
.a-traiter.attention .gravite-texte { color: var(--orange-2); }      /* contraste suffisant en petit texte */

.liste-simple li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 18px; border-bottom: 1px solid var(--line-2); }
.liste-simple li:last-child { border-bottom: 0; }
.liste-simple li.empty { display: block; }
.etat-ligne { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; margin: 0; }
.point { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: 0 0 auto; }
.point.ok { background: var(--green); }
.point.err { background: var(--red); }

/* Vue en orbite : « Reprendre » et « À traiter » à côté de l'orbite sur très grand écran, dessous ailleurs (D71) */
.accueil-orbite { display: flex; flex-direction: column; gap: 22px; }
.accueil-cote { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 22px; align-items: start; }
@media (min-width: 1600px) {
  .accueil-orbite { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); align-items: start; }
  .accueil-cote { grid-template-columns: minmax(0, 1fr); }
}

/* Vue d'ensemble (maquette 10, D90, D91 ; repère du dessin : 1080 x 660) */
.orbite-plan { position: relative; width: 100%; max-width: 1180px; margin: 0 auto; aspect-ratio: 1080 / 660; }
.orbite-plan svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.anneau { fill: none; stroke: var(--navy-4); stroke-dasharray: 3 7; }
.orbite-plan .lien { fill: none; stroke: var(--navy-2); stroke-width: 1.8; stroke-dasharray: 8 9; opacity: .6; animation: flux 1.4s linear infinite; }
.orbite-plan .lien.vers-centre { stroke-width: 2.4; opacity: .8; }
.orbite-plan .lien.tension { stroke: var(--orange); opacity: .9; }
.chevron path { fill: none; stroke: var(--navy-2); stroke-width: 1.8; }
.chevron.tension path { stroke: var(--orange); }
@keyframes flux { to { stroke-dashoffset: -34; } }
/* (traits du schéma limités à .orbite-plan : la classe « lien » sert aussi aux boutons en forme de lien, J6, L6) */

.coeur { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--ink); text-decoration: none; }
.coeur.au-centre { position: absolute; left: 50%; top: 50%; width: 19.5%; transform: translate(-50%, -50%); }
.cerveau { position: relative; width: 108px; height: 108px; display: grid; place-items: center; }
.image-cerveau { width: 108px; height: 108px; object-fit: contain; animation: respire var(--rythme, 2s) ease-in-out infinite; }
.cerveau::before, .cerveau::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2px solid var(--navy-2);
  opacity: 0; animation: pulsation var(--rythme, 2s) ease-out infinite; pointer-events: none; }
.cerveau::after { animation-delay: calc(var(--rythme, 2s) / 2); }
.coeur.rythme-lent { --rythme: 3.2s; }
.coeur.rythme-moyen { --rythme: 2s; }
.coeur.rythme-rapide { --rythme: 1.1s; }
@keyframes pulsation { 0% { transform: scale(.85); opacity: .55; } 80%, 100% { transform: scale(1.45); opacity: 0; } }
@keyframes respire { 0%, 100% { transform: scale(.97); } 50% { transform: scale(1.03); } }
.coeur.indisponible .image-cerveau, .coeur.indisponible .cerveau::before, .coeur.indisponible .cerveau::after { animation: none; }
.coeur.indisponible .cerveau::before, .coeur.indisponible .cerveau::after { display: none; }
.coeur.indisponible .image-cerveau { filter: grayscale(1); opacity: .6; }
/* Libellé et charge sur le fond de la page : un flux qui passe derrière ne les traverse pas */
.coeur-titre { display: block; font-size: 15px; font-weight: 600; margin-top: 6px; background: var(--bg); border-radius: 4px; padding: 0 4px; }
.coeur .charge { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 2px;
  background: var(--bg); border-radius: 4px; padding: 0 4px; }
a.coeur:hover .coeur-titre, a.coeur:focus-visible .coeur-titre { color: var(--navy-2); text-decoration: underline; }

.noeud { position: absolute; transform: translate(-50%, -50%); display: flex; gap: 10px; align-items: flex-start; width: 16.3%;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--navy-4); border-radius: 6px; color: var(--ink);
  text-decoration: none; box-shadow: 0 1px 2px rgba(10, 20, 36, .06); }
.noeud .icone { color: var(--navy-2); flex: 0 0 auto; margin-top: 2px; }
.noeud-texte strong { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.noeud-texte small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; margin-top: 2px; }
.noeud:hover, .noeud:focus-visible { border-color: var(--navy-2); }
.noeud.tension { border-color: var(--orange); }
.etiquette-tension { position: absolute; top: -9px; right: 8px; font-size: 11px; padding: 0 6px; border-radius: 4px;
  background: var(--surface); color: var(--orange-2); border: 1px solid var(--orange); }
.orbite-liste { display: none; }

.legende { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin: 10px auto 0; padding: 0; max-width: 1180px; color: var(--muted); }
.legende li { display: inline-flex; align-items: center; gap: 8px; }
.trait { display: inline-block; width: 28px; height: 0; border-top: 2px dashed var(--navy-2); }
.trait.tension { border-top-color: var(--orange); }

@media (max-width: 1279px) {
  .accueil-haut, .accueil-cote { grid-template-columns: minmax(0, 1fr); }
  .noeud { padding: 8px 9px; gap: 7px; }
  .noeud-texte small { font-size: 11.5px; }
}
@media (max-width: 1023px) {
  .orbite-plan { display: none; }
  .orbite-liste { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
  .orbite-liste .coeur-liste { grid-column: 1 / -1; }
  .orbite-liste .noeud { position: relative; transform: none; width: 100%; height: 100%; }
}
@media (max-width: 599px) {
  .reprise { grid-template-columns: auto minmax(0, 1fr); }
  .reprise .reprise-quand, .reprise .st { grid-column: 2; }
}
/* Mouvements réduits : ni défilement des flux ni pulsation (la règle générale de base.css ne vise pas les
   pseudo-éléments) ; le pourcentage de charge reste affiché */
@media (prefers-reduced-motion: reduce) {
  .lien, .image-cerveau, .cerveau::before, .cerveau::after { animation: none !important; }
  .cerveau::before, .cerveau::after { display: none; }
  .legende-pulsation { display: none !important; }
}
.sous-titre-famille { margin: -4px 0 8px; }

/* Accueil (organisation de la maquette de référence du 18/10/2026, libellés et couleurs inchangés) : cartes de famille
   avec en-tête (icône, titre, description courte), lignes cliquables (icône, libellé, description, chevron) ; rangée 2 :
   Administration et Favoris ; à droite « Reprendre » puis « À traiter » à la hauteur de son contenu ; état en pied. */
.grille-familles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.famille-carte { padding: 0; display: flex; flex-direction: column; }
.famille-tete { display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 12px; border-bottom: 1px solid var(--line-2); }
.famille-tete > .icone { color: var(--navy-2); flex: none; margin-top: 2px; }
.famille-tete h3 { font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--ink); margin: 0; font-weight: 600; }
.famille-tete h3 a { display: inline; padding: 0; color: inherit; text-decoration: none; }
.famille-tete h3 a:hover { text-decoration: underline; }
.famille-tete p { margin: 2px 0 0; }
.famille-tete a.tout { display: inline; margin-left: auto; padding: 0; white-space: nowrap; color: var(--navy-2); text-decoration: underline; }
.famille-carte ul { padding: 6px; gap: 0; }
.famille-carte a.ligne-module { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 6px; }
.ligne-module .ligne-texte { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ligne-module > .icone:last-child { color: var(--muted); flex: none; margin-top: 0; }
.rangee-deux { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.etat-vide { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 16px; color: var(--muted); }
.etat-vide > .icone { color: var(--navy-3); }
.etat-vide-titre { color: var(--ink); font-weight: 600; margin: 4px 0 0; }
.etat-vide p { margin: 0; }
.bloc-a-traiter .corps-contenu { min-height: 7.5rem; max-height: 14rem; overflow-y: auto; }
.pied-accueil { padding-top: 10px; }
.pied-accueil .etat-ligne { margin: 0; }
/* Famille seule (profil de consultation) : ses entrées en colonnes sur la largeur de la carte (D97) */
.grille-familles:has(> :nth-child(1):last-child) .famille-carte ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
@media (min-width: 1024px) {
  .rangee-deux.avec-admin { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .rangee-deux.avec-admin:has(> :nth-child(3)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  .rangee-deux:not(.avec-admin):has(> :nth-child(2)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Accueil en vue unique (demande de Kio du 18/10/2026) : sur ordinateur, tout tient dans la hauteur visible, sans
   défilement de page ; à gauche les modules (toujours visibles), à droite « Reprendre » (ou « Mes tableaux de bord »
   pour les profils de consultation) et « À traiter », l'un sous l'autre, seuls à défiler. Tablette et téléphone :
   blocs empilés, défilement vertical. */
.accueil-vue { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.accueil-gauche, .accueil-droite { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ligne-compacte { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.ligne-compacte h2 { font-size: 13px; margin: 0; }
.ligne-compacte ul { display: contents; list-style: none; }
.ligne-compacte li { display: inline; }
.ligne-compacte .tout { margin-left: auto; }
/* Vue unique là où tout tient (1440 x 900 et plus, hauteur rapportée à l'échelle des grands écrans, D97) ; en dessous,
   la page défile verticalement, rien n'est coupé */
@media (min-width: 1440px) and (max-width: 1919px) and (min-height: 900px),
       (min-width: 1920px) and (max-width: 2559px) and (min-height: 1029px),
       (min-width: 2560px) and (min-height: 1093px) {
  .accueil.vue-unique { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .accueil.vue-unique > .content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-bottom: 16px; }
  .vue-unique .accueil-vue { flex: 1 1 auto; min-height: 0; align-items: stretch; }
  .vue-unique .grille-familles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* Moins de quatre familles (profils de consultation) : les cartes se partagent la largeur, sans colonnes vides */
  .vue-unique .grille-familles:has(> :nth-child(1):last-child) { grid-template-columns: minmax(0, 1fr); }
  .vue-unique .grille-familles:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vue-unique .grille-familles:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Rangée 2 (D97) : Administration plus large, ses entrées sur deux colonnes, pour que tout tienne en 1440 x 900 */
  .vue-unique .rangee-deux.avec-admin { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .vue-unique .rangee-deux.avec-admin:has(> :nth-child(3)) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(0, 2fr); }
  .vue-unique .rangee-deux.avec-admin > .famille-carte:first-child ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vue-unique .accueil-gauche { min-height: 0; }
  .vue-unique .accueil-droite { min-height: 0; }
  .vue-unique .accueil-droite > .panel { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; margin: 0; }
  .vue-unique .accueil-droite > .bloc-a-traiter { flex: 0 0 auto; }
  .vue-unique .accueil-droite > .panel > .corps-reserve { height: auto; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .vue-unique .accueil-gauche .etat-ligne { margin: 0; }
}


/* Deux colonnes dès 1024 px (modules à gauche, Reprendre et À traiter à droite), avec défilement de page sous 1440 x 900 */
@media (min-width: 1024px) {
  .accueil-vue { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); align-items: start; }
}
@media (min-width: 1440px) {
  .accueil-vue { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); }
}
/* Profils de consultation (K2) : sur tablette et téléphone, leurs tableaux de bord et « À traiter » d'abord */
@media (max-width: 1023px) {
  .accueil-vue.consultation .accueil-droite { order: -1; }
}
