/* =====================================================================
   Skynium HUBJ Teams - Feuille de style
   Version : 2.1.0

   Autonome : rien n'est importe de skynium.fr sauf les icones et le
   logo. L'ancienne application chargeait /ressources/style.css, dont
   les regles de <header> et de <nav> entraient en conflit avec les
   siennes ; on ne savait plus quelle declaration gagnait.

   Choix d'ensemble : texte a 16 px, cibles cliquables d'au moins
   44 px, contrastes eleves. Ce site s'utilise aussi bien sur un
   telephone dans un couloir que sur un ecran de bureau.
   ===================================================================== */

:root {
  /* Palette HUBJ. --profond porte les fonds sombres et le texte,
     --primaire les titres et les liens, --secondaire les accents sur
     fond sombre, --tertiaire l'action principale.

     Les accents clairs (--secondaire, --tertiaire) ne servent jamais a
     ecrire sur du blanc : #22BCEA sur blanc donne un contraste de
     2,4 pour 1, illisible des que le texte descend sous 18 px. */
  --primaire:   #0171BA;
  --secondaire: #22BCEA;
  --tertiaire:  #FBBA03;
  --profond:    #073245;
  --fond:       #F4F8FB;
  --carte:      #FFFFFF;
  --texte:      #0F2733;
  --gris:       #5A7280;
  --gris-clair: #8FA6B2;
  --bord:       rgba(7, 50, 69, 0.12);
  --rouge:      #C81E1E;
  --vert:       #15803D;
  --ambre:      #B45309;
  --rayon:      12px;
  --ombre:      0 1px 2px rgba(7,50,69,.06), 0 4px 16px rgba(7,50,69,.05);
  --teinte:     var(--primaire);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.fige { overflow: hidden; }

h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--primaire); }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p  { margin: 0; }
a  { color: var(--primaire); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 3px solid var(--primaire); outline-offset: 2px; border-radius: 4px; }

/* --- Entete ---------------------------------------------------------- */

#entete {
  position: sticky; top: 0; z-index: 40;
  background: var(--profond);
  color: #fff;
  box-shadow: 0 2px 14px rgba(7,50,69,.30);
}

.entete-haut {
  display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, 3vw);
}

.marque { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; letter-spacing: .04em; font-size: .92rem; }
.marque:hover { text-decoration: none; opacity: .9; }
.marque b { color: var(--secondaire); }
.marque img { border-radius: 6px; background: #fff; padding: 2px; }

.entete-outils { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.recherche { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); border-radius: 999px; padding: 0 14px; height: 42px; }
.recherche i { color: rgba(255,255,255,.7); }
.recherche input { background: none; border: 0; outline: none; color: #fff; font: inherit; width: 15rem; max-width: 32vw; }
.recherche input::placeholder { color: rgba(255,255,255,.65); }

.icone {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #fff; border: 0; cursor: pointer; font-size: 1rem;
}
.icone:hover { background: rgba(255,255,255,.26); }
.icone.petit { min-width: 30px; height: 30px; background: transparent; color: var(--gris-clair); font-size: .95rem; }
.icone.petit:hover { background: rgba(7,50,69,.07); color: var(--rouge); }
.icone.petit.actif { color: var(--primaire); }

.puce {
  position: absolute; top: -3px; right: -3px;
  background: var(--tertiaire); color: var(--profond);
  border-radius: 999px; padding: 1px 6px; font-size: .68rem; font-weight: 800;
}

.compte { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); border: 0; color: #fff; font: inherit; font-weight: 600; border-radius: 999px; padding: 5px 14px 5px 5px; height: 42px; cursor: pointer; }
.compte:hover { background: rgba(255,255,255,.26); }

/* --- Onglets --------------------------------------------------------- */

.onglets { display: flex; align-items: center; gap: 4px; padding: 0 max(16px, 3vw); overflow-x: auto; }
.onglets a {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; color: rgba(255,255,255,.78); font-weight: 600; font-size: .94rem;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.onglets a:hover { color: #fff; text-decoration: none; }
.onglets a[aria-current="page"] { color: #fff; border-bottom-color: var(--secondaire); }
.onglets .puce { position: static; }
.onglets .creer { margin-left: auto; }

/* --- Boutons --------------------------------------------------------- */

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid transparent; background: var(--carte); color: var(--primaire);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.bouton:hover { transform: translateY(-1px); }
.bouton:disabled { opacity: .6; cursor: progress; transform: none; }
.bouton.principal { background: var(--tertiaire); color: var(--profond); }
.bouton.fantome   { background: transparent; border-color: var(--bord); color: var(--primaire); }
.bouton.fantome:hover { background: rgba(1,113,186,.06); }
.bouton.vert      { background: var(--vert); color: #fff; }
.bouton.danger    { color: var(--rouge); border-color: rgba(200,30,30,.3); }
.bouton.danger:hover { background: rgba(200,30,30,.07); }
.bouton.petit     { min-height: 34px; padding: 0 12px; font-size: .84rem; }

.lien { background: none; border: 0; color: var(--primaire); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 4px; text-decoration: underline; }

.segments { display: inline-flex; background: rgba(7,50,69,.06); border-radius: 999px; padding: 3px; }
.segments button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--gris); padding: 8px 15px; border-radius: 999px; cursor: pointer; }
.segments button.actif { background: var(--carte); color: var(--primaire); box-shadow: var(--ombre); }

/* --- Structure ------------------------------------------------------- */

#principal { max-width: 1180px; margin: 0 auto; padding: 22px max(16px, 3vw) 90px; }

#chargement { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--secondaire); z-index: 60; animation: glisse 1.1s linear infinite; }
@keyframes glisse { 0% { opacity: .35 } 50% { opacity: 1 } 100% { opacity: .35 } }

.bonjour { margin-bottom: 20px; }
.bonjour h1 { font-size: 1.85rem; }
.bonjour p { color: var(--gris); margin-top: 4px; }

.page-tete { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.page-tete h1 { display: flex; align-items: center; gap: 10px; }
.page-tete p { color: var(--gris); margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.fil { margin-bottom: 12px; color: var(--gris); font-size: .9rem; }
.fil a { font-weight: 600; }

.sous-titre { margin: 16px 0 6px; color: var(--gris); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }

.deux-colonnes { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }

/* --- Chiffres -------------------------------------------------------- */

.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.carreau {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 16px 18px; box-shadow: var(--ombre); color: var(--texte);
}
a.carreau:hover { text-decoration: none; border-color: var(--primaire); }
.carreau i { color: var(--primaire); font-size: 1.05rem; margin-bottom: 6px; }
.carreau strong { font-size: 1.9rem; font-weight: 800; color: var(--primaire); line-height: 1; }
.carreau span { color: var(--gris); font-size: .88rem; }
.carreau.alerte { border-color: rgba(200,30,30,.35); background: #FEF3F2; }
.carreau.alerte i, .carreau.alerte strong { color: var(--rouge); }

/* --- Blocs ----------------------------------------------------------- */

.bloc { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--ombre); }
.bloc-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.bloc-tete h2 { display: flex; align-items: center; gap: 9px; }
.bloc-tete h2 i { color: var(--primaire); }
.bloc.invitations { border-color: var(--secondaire); background: #EFFAFE; }

.explication { color: var(--gris); font-size: .92rem; }
.texte-libre { white-space: pre-wrap; color: #3B3B57; }

.avertissement { display: flex; align-items: center; gap: 10px; background: #FFFBEB; border: 1px solid #FDE68A; color: var(--ambre); border-radius: var(--rayon); padding: 12px 16px; margin-bottom: 16px; font-weight: 600; }

/* --- Lignes ---------------------------------------------------------- */

.liste { display: flex; flex-direction: column; gap: 8px; }

.ligne {
  display: flex; align-items: center; gap: 14px;
  background: var(--carte); border: 1px solid var(--bord); border-left: 4px solid var(--teinte);
  border-radius: 10px; padding: 12px 14px;
}
.ligne.cliquable { cursor: pointer; }
.ligne.cliquable:hover { border-color: var(--primaire); border-left-color: var(--teinte); }
.ligne.retard { border-left-color: var(--rouge); background: #FEF6F5; }
.ligne.neuve { background: #EFFAFE; }
.ligne-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ligne-corps strong { font-weight: 650; }
.ligne-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--gris); font-size: .84rem; }
.ligne-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.ligne-heure { flex-shrink: 0; font-weight: 700; color: var(--primaire); min-width: 76px; }
.ligne-date { color: var(--gris-clair); font-size: .82rem; flex-shrink: 0; }

.etiquette { display: inline-flex; align-items: center; gap: 5px; background: rgba(1,113,186,.09); color: var(--primaire); border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; }
.rouge { color: var(--rouge); font-weight: 600; }
.fait { color: var(--vert); font-weight: 600; font-size: .86rem; }

/* --- Pastilles ------------------------------------------------------- */

.pastille { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px; font-size: .78rem; font-weight: 700; background: rgba(7,50,69,.07); color: var(--gris); }
.pastille .point { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-afaire   { background: #EEF2FF; color: #3730A3; }
.st-encours  { background: #ECFEFF; color: #155E75; }
.st-revision { background: #FEF3C7; color: #92400E; }
.st-terminee { background: #DCFCE7; color: #166534; }
.st-archivee { background: #F1F1F4; color: #52525B; }
.pr-critique { background: #FEE2E2; color: #991B1B; }
.pr-haute    { background: #FFEDD5; color: #9A3412; }
.pastille.role { background: color-mix(in srgb, var(--role) 15%, white); color: color-mix(in srgb, var(--role) 70%, var(--profond)); }

.barre { display: inline-block; width: 100%; height: 8px; background: rgba(7,50,69,.10); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.barre > span { display: block; height: 100%; border-radius: 999px; transition: width .3s; }

.avancement-large { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.avancement-large strong { font-size: 1.3rem; color: var(--primaire); }

/* La couleur du role vient de la base (hub_roles.couleur) : elle peut
   changer sans que cette feuille le sache. Le fond est donc eclairci et
   le texte assombri par calcul, pour qu'un role jaune reste lisible. */

/* --- Avatars --------------------------------------------------------- */

.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0; border: 2px solid var(--carte); }
.avatar-reste { background: rgba(1,113,186,.14); color: var(--primaire); font-size: .7rem; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -8px; }
.qui { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; margin-right: 12px; }
.qui em { color: var(--gris); font-style: normal; font-size: .8rem; }

/* --- Cartes projet --------------------------------------------------- */

.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-top: 4px solid var(--teinte); border-radius: var(--rayon); padding: 16px 18px; cursor: pointer; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 11px; }
.carte:hover { border-color: var(--primaire); border-top-color: var(--teinte); }
.carte-tete { display: flex; align-items: flex-start; gap: 8px 11px; flex-wrap: wrap; }
.carte-icone { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--teinte) 13%, white); color: var(--teinte); flex-shrink: 0; }
.carte-tete > div { flex: 1 1 160px; min-width: 0; }
/* La pastille de role descend d'elle-meme sous le titre quand la carte
   est etroite : sinon « Refonte du site vitrine » se coupait en trois. */
.carte-tete .pastille { margin-left: auto; }
.carte-sous { color: var(--gris); font-size: .82rem; }
.carte-texte { color: var(--gris); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.carte-avancement { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .82rem; color: var(--gris); }
.carte-avancement .barre { flex: 1 1 100%; }
.carte-equipe { display: flex; flex-wrap: wrap; gap: 4px 0; padding-top: 10px; border-top: 1px solid var(--bord); }
.carte-vide { color: var(--gris-clair); font-size: .84rem; }

/* --- Equipe ---------------------------------------------------------- */

.equipe { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.membre { display: flex; align-items: center; gap: 12px; border: 1px solid var(--bord); border-radius: 10px; padding: 11px 13px; }
.membre > div:first-of-type { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

/* --- Tableau (kanban) ------------------------------------------------ */

.colonnes { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; }
.colonne { background: rgba(7,50,69,.04); border-radius: var(--rayon); padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.colonne-tete { display: flex; justify-content: space-between; font-weight: 700; color: var(--primaire); font-size: .9rem; }
.colonne-tete span { background: var(--carte); border-radius: 999px; padding: 0 9px; color: var(--gris); }
.colonne-vide { color: var(--gris-clair); font-size: .84rem; text-align: center; padding: 12px 0; }
.fiche { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.fiche:hover { border-color: var(--primaire); }
.fiche-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* --- Detail tache ---------------------------------------------------- */

.details { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.details dt { color: var(--gris); font-size: .84rem; }
.details dd { margin: 0; font-weight: 600; }
.details.aide { grid-template-columns: 1fr; gap: 2px; }
.details.aide dt { color: var(--primaire); font-weight: 700; font-size: .96rem; margin-top: 12px; }
.details.aide dd { font-weight: 400; color: var(--gris); }

.gros-chiffre { font-size: 1.8rem; font-weight: 800; color: var(--primaire); }
.mini-liste { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; color: var(--gris); font-size: .88rem; }
.mini-liste li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.etapes { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.etape { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.etape:hover { background: rgba(7,50,69,.05); }
.etape input { width: 20px; height: 20px; accent-color: var(--vert); cursor: pointer; }
.etape span { flex: 1; }
.barre-texte { text-decoration: line-through; color: var(--gris-clair); }

.ajout { display: flex; gap: 8px; margin-top: 10px; }
.ajout input { flex: 1; min-height: 42px; padding: 0 14px; border: 1px solid var(--bord); border-radius: 10px; font: inherit; }
.ajout input:focus { outline: none; border-color: var(--primaire); }

.echanges { display: flex; flex-direction: column; gap: 14px; }
.echange { display: flex; gap: 11px; }
.echange > div { flex: 1; }
.echange-tete { color: var(--gris); font-size: .82rem; }
.echange p { margin-top: 3px; white-space: pre-wrap; }

.histoire { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.histoire li { display: flex; gap: 14px; font-size: .89rem; }
.histoire-date { color: var(--gris-clair); flex-shrink: 0; min-width: 120px; }
.histoire em { color: var(--gris); font-style: normal; }

/* --- Agenda ---------------------------------------------------------- */

.mois { margin: 6px 0 12px; text-transform: capitalize; }
.calendrier { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 22px; }
.calendrier-tete { text-align: center; font-weight: 700; color: var(--gris); font-size: .82rem; padding-bottom: 4px; }
.calendrier-case { background: var(--carte); border: 1px solid var(--bord); border-radius: 9px; min-height: 96px; padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.calendrier-case:hover { border-color: var(--primaire); }
.calendrier-case.vide-case { background: transparent; border-color: transparent; cursor: default; }
.calendrier-case.aujourdhui { border-color: var(--primaire); box-shadow: inset 0 0 0 1px var(--primaire); }
.calendrier-num { font-weight: 700; color: var(--gris); font-size: .82rem; }
.calendrier-case.aujourdhui .calendrier-num { color: var(--primaire); }
.calendrier-evenement { color: #fff; border-radius: 5px; padding: 2px 6px; font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendrier-plus { color: var(--gris); font-size: .72rem; }

/* --- Notes ----------------------------------------------------------- */

.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.note { border: 1px solid var(--bord); border-radius: var(--rayon); padding: 15px 17px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 9px; }
.note-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.note p { white-space: pre-wrap; font-size: .92rem; color: #3B3B57; }
.note footer { color: var(--gris); font-size: .78rem; margin-top: auto; }

/* --- Etat vide ------------------------------------------------------- */

.vide { text-align: center; padding: 34px 20px; color: var(--gris); }
.vide i { font-size: 2rem; color: var(--gris-clair); margin-bottom: 12px; }
.vide-titre { font-weight: 700; color: var(--primaire); font-size: 1.02rem; }
.vide-texte { margin: 6px auto 14px; max-width: 44ch; }

.ecran-erreur { text-align: center; padding: 60px 20px; }
.ecran-erreur i { font-size: 2.6rem; color: var(--rouge); margin-bottom: 16px; }
.ecran-erreur p { color: var(--gris); margin: 12px auto 20px; max-width: 60ch; word-break: break-word; }

/* --- Message flottant ------------------------------------------------ */

.message {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 10px;
  background: var(--profond); color: #fff; border-radius: 999px;
  padding: 13px 24px; box-shadow: 0 8px 30px rgba(7,50,69,.32); font-weight: 600;
  max-width: 90vw;
}
.message.erreur { background: var(--rouge); }

/* --- Fenetres -------------------------------------------------------- */

.fond { position: fixed; inset: 0; background: rgba(7,50,69,.58); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.fenetre { background: var(--carte); border-radius: 16px; width: 100%; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(7,50,69,.38); }
.fenetre.large { max-width: 760px; }
.fenetre-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--bord); }
.fenetre-tete h2 { display: flex; align-items: center; gap: 10px; }
.fenetre-tete .icone { background: rgba(7,50,69,.07); color: var(--gris); font-size: 1.5rem; }
.fenetre-corps { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.fenetre-pied { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--bord); }
.fenetre-choix { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.choix { display: grid; gap: 10px; }
.choix button { display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; gap: 2px 14px; text-align: left; background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; cursor: pointer; font: inherit; }
.choix button:hover { border-color: var(--primaire); background: #F2FAFE; }
.choix i { grid-row: 1 / 3; align-self: center; justify-self: center; font-size: 1.4rem; color: var(--primaire); }
.choix strong { color: var(--primaire); font-size: 1.02rem; }
.choix span { color: var(--gris); font-size: .88rem; }

/* --- Champs ---------------------------------------------------------- */

.champ { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; margin: 0; min-width: 0; }
.champ-titre { font-weight: 650; color: var(--primaire); font-size: .94rem; padding: 0; }
.champ-titre em { font-style: normal; color: var(--primaire); font-size: .78rem; font-weight: 700; }
.champ-aide { color: var(--gris); font-size: .82rem; }
.champ input, .champ select, .champ textarea, .ajout input {
  font: inherit; color: var(--texte); background: var(--carte);
  border: 1px solid var(--bord); border-radius: 10px; padding: 11px 13px; min-height: 44px; width: 100%;
}
.champ textarea { resize: vertical; min-height: 84px; }
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-color: var(--primaire); box-shadow: 0 0 0 3px rgba(1,113,186,.18); }

.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px; max-height: 240px; overflow-y: auto; padding: 4px; border: 1px solid var(--bord); border-radius: 10px; }
.case { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .92rem; }
.case:hover { background: rgba(7,50,69,.05); }
.case input { width: 20px; height: 20px; accent-color: var(--primaire); cursor: pointer; }
.case.seule { border: 1px solid var(--bord); border-radius: 10px; min-height: 44px; }

/* --- Ecrans etroits -------------------------------------------------- */

@media (max-width: 900px) {
  .deux-colonnes { grid-template-columns: 1fr; }
  .colonnes { grid-template-columns: repeat(4, 78vw); }
  .recherche input { width: 8rem; }
}

@media (max-width: 680px) {
  h1 { font-size: 1.35rem; }
  .bonjour h1 { font-size: 1.5rem; }
  .entete-haut { flex-wrap: wrap; }
  .marque span { display: none; }
  .recherche { flex: 1; }
  .recherche input { width: 100%; max-width: none; }
  .compte span { display: none; }

  /* La navigation passe en bas : le pouce y arrive sans deplacer la main. */
  .onglets {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    background: var(--profond); padding: 0;
    box-shadow: 0 -2px 14px rgba(7,50,69,.32);
    justify-content: space-around;
  }
  .onglets a { flex-direction: column; gap: 3px; font-size: .68rem; padding: 8px 4px 6px; flex: 1; text-align: center; border-bottom: 0; border-top: 3px solid transparent; }
  .onglets a i { font-size: 1.15rem; }
  .onglets a[aria-current="page"] { border-bottom-color: transparent; border-top-color: var(--secondaire); }
  .onglets .creer { position: fixed; right: 16px; bottom: 74px; width: 56px; height: 56px; padding: 0; border-radius: 50%; box-shadow: 0 6px 20px rgba(251,186,3,.55); }
  .onglets .creer span { display: none; }
  .onglets .puce { position: absolute; top: 2px; right: 22%; }

  #principal { padding-bottom: 96px; }
  .message { bottom: 84px; }
  .calendrier-case { min-height: 62px; }
  .calendrier-evenement { font-size: 0; padding: 3px; }
  .ligne { flex-wrap: wrap; }
  .ligne-actions { width: 100%; justify-content: space-between; }
  .deux { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
  .segments { width: 100%; overflow-x: auto; }
}

/* --- Impression : la fiche projet sert de compte rendu papier -------- */

@media print {
  #entete, .page-actions, .fil, .bouton, .icone, .lien, #chargement, .message, .fond { display: none !important; }
  body { background: #fff; }
  #principal { max-width: none; padding: 0; }
  .bloc, .carte, .ligne { break-inside: avoid; box-shadow: none; border-color: #ccc; }
  a { color: inherit; text-decoration: none; }
}

/* =====================================================================
   Vague 1 — Pilotage, insights, santé, Gantt, graphiques (v2.2.0)
   ===================================================================== */

/* --- Ma prochaine meilleure action (accueil) ------------------------ */
.action-phare { display: flex; align-items: center; gap: 16px; background: linear-gradient(120deg, var(--profond), #0b4a63); color: #fff; border: 0; }
.action-phare:hover { transform: translateY(-1px); }
.action-icone { font-size: 2rem; flex-shrink: 0; }
.action-titre { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--secondaire); font-weight: 700; }
.action-tache { font-size: 1.15rem; font-weight: 800; margin: 2px 0; }
.action-pourquoi { font-size: .84rem; color: rgba(255,255,255,.82); }
.action-fleche { margin-left: auto; color: var(--secondaire); font-size: 1.1rem; }

/* --- HUBJ Insights -------------------------------------------------- */
.insight { display: flex; align-items: flex-start; gap: 11px; padding: 11px 14px; border-radius: 10px; border-left: 4px solid var(--gris-clair); background: var(--carte); font-size: .9rem; }
.insight-icone { flex-shrink: 0; }
.insight.cliquable { cursor: pointer; }
.insight.cliquable:hover { background: #F2FAFE; }
.insight-risque   { border-left-color: #C81E1E; background: #FEF3F2; }
.insight-alerte   { border-left-color: #B45309; background: #FFFBEB; }
.insight-suggestion { border-left-color: #0171BA; }
.insight-prevision  { border-left-color: #0E7490; }
.insight-nettoyage  { border-left-color: #8FA6B2; }
.insight-succes     { border-left-color: #15803D; background: #F0FDF4; }

/* --- État de chaque projet (feu tricolore) -------------------------- */
.etat-projets { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.etat-projet { border: 1px solid var(--bord); border-top: 3px solid var(--teinte); border-radius: var(--rayon); padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; }
.etat-projet:hover { border-color: var(--primaire); border-top-color: var(--teinte); }
.etat-tete { display: flex; align-items: center; gap: 10px; }
.etat-barre { display: flex; align-items: center; gap: 8px; }
.etat-barre span { font-size: .78rem; font-weight: 700; color: var(--primaire); }
.etat-pieds { display: flex; flex-wrap: wrap; gap: 8px; font-size: .78rem; color: var(--gris); }
.etat-raison { flex-basis: 100%; color: var(--gris); }
.feu { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: .8rem; }
.feu-vert { color: var(--vert); } .feu-orange { color: var(--ambre); } .feu-rouge { color: var(--rouge); }

/* --- Santé du projet ------------------------------------------------ */
.sante { border-left: 5px solid var(--gris-clair); }
.sante-vert   { border-left-color: var(--vert); }
.sante-orange { border-left-color: var(--ambre); }
.sante-rouge  { border-left-color: var(--rouge); }
.sante-haut { display: flex; gap: 18px; align-items: center; }
.jauge { flex-shrink: 0; }
.sante-corps { flex: 1; min-width: 0; }
.sante-resume { font-size: .96rem; color: var(--texte); margin: 6px 0; }
.sante-chiffres { display: flex; flex-wrap: wrap; gap: 14px; font-size: .84rem; color: var(--gris); }
.sante-action { margin-top: 10px; background: rgba(1,113,186,.08); border-radius: 8px; padding: 8px 12px; font-size: .88rem; font-weight: 600; color: var(--primaire); cursor: pointer; }
.sante-action:hover { background: rgba(1,113,186,.14); }
.sante-raisons { margin-top: 14px; border-top: 1px solid var(--bord); padding-top: 12px; }
.sante-raisons-titre { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); font-weight: 700; }
.sante-raisons ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sante-raisons li { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.sante-raisons .grav-haut { color: var(--rouge); }
.sante-raisons .grav-moyen { color: var(--ambre); }

/* --- Charge de l'équipe --------------------------------------------- */
.charge-liste { display: flex; flex-direction: column; gap: 12px; }
.charge-ligne { display: flex; align-items: center; gap: 11px; }
.charge-corps { flex: 1; min-width: 0; }
.charge-tete { display: flex; justify-content: space-between; gap: 8px; font-size: .84rem; margin-bottom: 4px; }
.charge-tete span { color: var(--gris); }
.jauge-charge { display: block; width: 100%; height: 8px; background: rgba(7,50,69,.09); border-radius: 999px; overflow: hidden; }
.jauge-charge > span { display: block; height: 100%; border-radius: 999px; transition: width .3s; }

/* --- Vélocité / graphiques ------------------------------------------ */
.tendance { font-size: .8rem; font-weight: 700; }
.tendance-hausse { color: var(--vert); } .tendance-baisse { color: var(--rouge); } .tendance-stable { color: var(--gris); }
.graph-barres, .graph-courbe { display: block; }

/* --- Gantt ---------------------------------------------------------- */
.gantt-cadre { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--bord); border-radius: 10px; padding: 4px; }
.gantt { min-width: 640px; }

@media (max-width: 680px) {
  .sante-haut { flex-direction: column; align-items: flex-start; gap: 10px; }
  .action-tache { font-size: 1.05rem; }
  .etat-projets { grid-template-columns: 1fr; }
}

/* =====================================================================
   Vague 1 (suite) — kanban glisser-déposer, simulateur (v2.2.0)
   ===================================================================== */

/* --- Kanban glisser-déposer ----------------------------------------- */
.colonne-corps { display: flex; flex-direction: column; gap: 9px; min-height: 40px; flex: 1; border-radius: 8px; transition: background .15s; }
.fiche[draggable="true"] { cursor: grab; }
.fiche.glisse { opacity: .4; }
.colonne.survol { outline: 2px dashed var(--primaire); outline-offset: 2px; }
.colonne.survol .colonne-corps { background: rgba(1,113,186,.06); }
.colonne-vide { color: var(--gris-clair); font-size: .82rem; text-align: center; padding: 18px 6px; border: 1px dashed var(--bord); border-radius: 8px; }

/* --- Simulateur « et si ? » ----------------------------------------- */
.simu-choix { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.simu-choix .bouton { justify-content: flex-start; text-align: left; }
.simu-res { background: var(--fond); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.simu-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .92rem; }
.simu-ligne span { color: var(--gris); }
.simu-egal { color: var(--gris-clair); }
.simu-alertes { border-top: 1px solid var(--bord); padding-top: 10px; }
.simu-alertes ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.simu-alertes li { display: flex; align-items: center; gap: 8px; font-size: .86rem; }

/* --- Insight : texte cliquable séparé du bouton masquer -------------- */
.insight-texte { flex: 1; }
.insight-texte.cliquable { cursor: pointer; }
.insight-texte.cliquable:hover { text-decoration: underline; }
.insight > .icone.petit { flex-shrink: 0; margin: -4px -4px -4px 0; }

/* --- Budget de temps (fiche projet) --------------------------------- */
.budget { margin-top: 14px; border-top: 1px solid var(--bord); padding-top: 12px; }
.budget-tete { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: .84rem; }
.budget-tete span:last-child { color: var(--gris); }
.budget-alerte .budget-tete span:last-child { color: var(--rouge); font-weight: 600; }

/* --- Évolution / machine à remonter le temps ------------------------ */
.evo-reperes { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.evo-repere { background: var(--fond); border: 1px solid var(--bord); border-radius: 8px; padding: 6px 11px; font-size: .8rem; display: flex; flex-direction: column; gap: 1px; }
.evo-date { color: var(--gris); }
.evo-val { font-weight: 700; color: var(--primaire); }

/* --- Header dynamique : barre d'actions rapides ---------------------- */
.quick-actions { display: flex; gap: 8px; padding: 8px max(16px, 3vw); overflow-x: auto; background: rgba(1,113,186,.06); -webkit-overflow-scrolling: touch; }
.qa { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 999px; padding: 6px 13px;
  font: inherit; font-size: .82rem; font-weight: 600; color: var(--primaire); cursor: pointer; min-height: 36px; }
.qa:hover { border-color: var(--primaire); background: #F2FAFE; }
.qa span { font-size: .95rem; }
@media (max-width: 680px) { .quick-actions { padding: 7px 12px; } .qa { font-size: .8rem; } }
