/* eLIOT : l'apparence de la version navigateur (Windows), calquée sur la version Mac. */
:root {
  --fond: #ffffff; --fond-barre: #f3f3f5; --texte: #1d1d1f; --texte2: #6e6e73; --texte3: #a1a1a6;
  --carte: rgba(0,0,0,.045); --filet: rgba(0,0,0,.08); --bord: rgba(0,0,0,.07); --survol: rgba(0,0,0,.05);
  --accent: #3a76d8; --echelle: 1; --espace: 1;
  --bleu: #4f7fe0; --orange: #e8823a; --aqua: #2fb88a; --jaune: #e9b949; --rose: #e8789f; --vert: #4cc46a;
  --violet: #8c7cf0; --rouge: #e5534b; --saumon: #ee9584; --neutre: #8a8a8e; --or: #d9a520;
  --s0: #dfe9fb; --s1: #b0cbf3; --s2: #77a3ea; --s3: #4677d8; --s4: #284fa6;
  color-scheme: light;
}
:root[data-theme="sombre"] {
  --fond: #1e1e1f; --fond-barre: #2a2a2c; --texte: #f2f2f4; --texte2: #a1a1a6; --texte3: #6e6e73;
  --carte: rgba(255,255,255,.055); --filet: rgba(255,255,255,.1); --bord: rgba(255,255,255,.08); --survol: rgba(255,255,255,.06);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fond); color: var(--texte);
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, system-ui, sans-serif; font-size: calc(13.5px * var(--echelle)); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
#app { display: flex; height: 100vh; }

/* barre latérale */
#barre { width: 290px; flex: none; background: var(--fond-barre); display: flex; flex-direction: column; border-right: 1px solid var(--filet); }
#barre .tete { padding: 16px 16px 10px; }
#barre .logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
#barre .logo img { width: 34px; height: 34px; }
#barre .etat { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0; font-size: 12.5px; }
#barre .etat b { display: block; }
#barre .recherche { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--survol); border: 1px solid var(--bord); }
#barre .recherche input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; width: 100%; }
#barre .recherche .petit { white-space: nowrap; }
#barre nav { flex: 1; overflow-y: auto; padding: 0 10px 10px; }
#barre .section { font-size: 12px; color: var(--texte2); font-weight: 600; margin: 16px 8px 4px; display: flex; justify-content: space-between; cursor: default; }
#barre .lien { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#barre .lien.sous { padding-left: 34px; font-size: 13.5px; }
#barre .lien:hover { background: var(--survol); }
#barre .lien.actif { background: var(--accent); color: white; }
#barre .lien .ic { width: 18px; text-align: center; opacity: .85; }
#barre .pied { border-top: 1px solid var(--filet); padding: 8px 10px; }
.point { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.barrette { width: 4px; height: 15px; border-radius: 2px; display: inline-block; flex: none; }

/* contenu */
#contenu { flex: 1; overflow-y: auto; position: relative; }
.page { padding: calc(34px * var(--espace)) 40px 60px; }
:root[data-largeur="centree"] .page { max-width: 1280px; margin: 0 auto; }
.entete-page { display: flex; gap: 16px; align-items: flex-start; margin-bottom: calc(22px * var(--espace)); }
.entete-page .titres { flex: 1; }
h1 { font-size: calc(30px * var(--echelle)); font-weight: 700; margin: 0; }
.sous-titre { font-size: calc(16px * var(--echelle)); color: var(--texte2); margin-top: 6px; }
.explication { font-size: calc(13px * var(--echelle)); color: var(--texte2); margin-top: 10px; }
:root[data-explications="0"] .explication { display: none; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; padding-top: 6px; }
.pile { display: flex; flex-direction: column; gap: calc(22px * var(--espace)); }
.rangee { display: flex; gap: 22px; align-items: flex-start; }
.rangee > * { flex: 1; min-width: 0; }
.rangee.egale { align-items: stretch; }
.fixe { flex: none !important; }
.grille { display: grid; gap: 16px; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 22px; padding: calc(22px * var(--espace)) 26px; min-width: 0; }
.carte > .tete { display: flex; align-items: center; gap: 12px; margin-bottom: calc(16px * var(--espace)); }
.carte.repliee > .tete { margin-bottom: 0; }
.carte > .tete .titres { flex: 1; min-width: 0; }
.carte .titre-carte { font-size: calc(16.5px * var(--echelle)); font-weight: 600; }
.carte .sous-carte { font-size: calc(13.5px * var(--echelle)); color: var(--texte2); margin-top: 3px; }
.carte .bande { width: 4px; border-radius: 2px; align-self: stretch; min-height: 24px; }
:root[data-couleurs="0"] .carte .bande { background: var(--texte3) !important; }
.replier { border: 0; background: transparent; cursor: pointer; color: var(--texte2); font-size: 14px; width: 28px; height: 28px; }
.fond-carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 22px; padding: calc(22px * var(--espace)) 26px; }

/* petits composants */
.pilule { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--bord); background: var(--survol); border-radius: 999px; padding: 7px 16px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.pilule:hover { filter: brightness(.96); }
.pilule.principal { background: var(--texte); color: var(--fond); border-color: transparent; }
.pilule[disabled] { opacity: .45; cursor: default; }
.lien-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 12px; }
.segments { align-self: flex-start; width: fit-content; display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--survol); }
.segments button { border: 0; background: transparent; padding: 6px 15px; border-radius: 999px; font-weight: 600; color: var(--texte2); cursor: pointer; white-space: nowrap; }
.segments button.oui { background: var(--filet); color: var(--texte); }
.pastilles { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 10px; }
.pastilles button { border: 0; background: var(--survol); padding: 7px 14px; border-radius: 999px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.pastilles button.oui { background: var(--texte); color: var(--fond); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.statut { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.statut i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.sigle { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sigle i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.photo { border-radius: 50%; object-fit: cover; background: var(--survol); flex: none; }
.secondaire { color: var(--texte2); }
.tertiaire { color: var(--texte3); }
.petit { font-size: calc(12px * var(--echelle)); }
.gras { font-weight: 600; }
.chiffre { font-size: calc(30px * var(--echelle)); font-weight: 600; font-variant-numeric: tabular-nums; }
.chiffre-moyen { font-size: calc(21px * var(--echelle)); font-weight: 600; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.vide { text-align: center; color: var(--texte2); padding: 20px 0; }
.vide .detail { color: var(--texte3); font-size: 12px; margin-top: 6px; white-space: pre-line; }
.chargement { display: flex; justify-content: center; padding: 50px; }
.chargement::after { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--filet); border-top-color: var(--accent); animation: tourne 0.8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.filets > * + * { border-top: 1px solid var(--filet); }
.cliquable { cursor: pointer; }
.cliquable:hover { background: var(--survol); border-radius: 8px; }
.ligne { display: flex; gap: 14px; align-items: flex-start; padding: 10px 4px; }
.ligne .grand { flex: 1; min-width: 0; }
.coupe { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chiffres { display: flex; }
.chiffres > div { flex: 1; padding-right: 8px; }
.chiffres > div + div { border-left: 1px solid var(--filet); padding-left: 26px; }
.chiffres .leg { margin-top: 4px; }
.chiffres .sous { color: var(--texte2); font-size: 13.5px; margin-top: 2px; }
.tuile { display: flex; gap: 12px; padding: 18px; min-height: 120px; border-radius: 18px; background: var(--carte); border: 1px solid var(--bord); }
.tuile .ic { width: 34px; height: 34px; border-radius: 50%; background: var(--filet); display: flex; align-items: center; justify-content: center; flex: none; }
.barre-h { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.barre-h .lib { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.barre-h .piste { flex: 1; height: 8px; border-radius: 4px; background: var(--survol); position: relative; }
.barre-h .plein { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.barre-h .repere { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--texte2); }
.barre-h .val { width: 76px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.progression { height: 6px; border-radius: 3px; background: var(--survol); overflow: hidden; flex: 1; }
.progression > div { height: 100%; background: var(--accent); }
.composition { display: flex; gap: 2px; height: 7px; }
.composition > div { border-radius: 4px; }
input.champ, select.champ, textarea.champ { border: 1px solid var(--bord); background: var(--fond); border-radius: 8px; padding: 6px 10px; }
.cherche { display: inline-flex; align-items: center; gap: 6px; background: var(--survol); border-radius: 999px; padding: 7px 12px; }
.cherche input { border: 0; outline: 0; background: transparent; width: 100%; }
textarea.zone { width: 100%; border: 0; border-radius: 10px; background: var(--survol); padding: 10px; resize: vertical; min-height: 120px; }
.retour { display: inline-flex; gap: 6px; align-items: center; border: 0; background: var(--survol); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--filet); flex-wrap: wrap; }
.onglets button { border: 0; background: none; padding: 8px 10px; cursor: pointer; color: var(--texte2); border-bottom: 2px solid transparent; }
.onglets button.oui { color: var(--texte); font-weight: 600; border-bottom-color: var(--texte); }

/* tableaux */
table.tab { width: 100%; border-collapse: collapse; }
table.tab th { font-size: 12px; font-weight: 600; color: var(--texte2); text-align: left; padding: 6px 6px; cursor: pointer; white-space: nowrap; border-bottom: 1px solid var(--filet); }
table.tab td { padding: 6px 6px; border-bottom: 1px solid var(--filet); vertical-align: middle; }
table.tab td.n, table.tab th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.tab tr.sur td { background: color-mix(in srgb, var(--or) 14%, transparent); }
table.tab tr.cliquable:hover td { background: var(--survol); }

/* fenêtre (feuillet) */
#voile { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: none; align-items: center; justify-content: center; z-index: 50; }
#voile.ouvert { display: flex; }
#feuillet { background: var(--fond); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); max-width: 94vw; max-height: 90vh; overflow: auto; padding: 24px; position: relative; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--fond-barre); border: 1px solid var(--bord); border-radius: 999px; padding: 10px 18px; box-shadow: 0 6px 24px rgba(0,0,0,.2); display: none; z-index: 60; }
.menu { position: relative; display: inline-block; }
.menu > .liste { display: none; position: absolute; z-index: 30; top: 100%; left: 0; min-width: 180px; max-height: 360px; overflow: auto; background: var(--fond); border: 1px solid var(--bord); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.18); padding: 4px; }
.menu.ouvert > .liste { display: block; }
.menu > .liste button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.menu > .liste button:hover { background: var(--survol); }
.graphe { position: relative; }
.flash { animation: flash 2.2s ease; }
@keyframes flash { 0%, 60% { background: color-mix(in srgb, var(--or) 30%, transparent); } 100% { background: transparent; } }
.planning { display: flex; gap: 14px; align-items: flex-start; }
.planning .jour { flex: 1; min-width: 0; background: var(--carte); border-radius: 20px; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.planning .reu { background: var(--fond); border: 1px solid var(--filet); border-radius: 14px; padding: 14px; cursor: pointer; }
.cases { display: grid; gap: 8px; overflow-x: auto; }
.cases textarea { width: 230px; border: 0; border-radius: 8px; background: var(--survol); padding: 6px; font-size: 12px; resize: vertical; }
.hemi { width: 100%; height: 270px; }
.flux { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.frise { position: relative; height: 16px; }
.frise > div { position: absolute; }
.chaleur { display: grid; gap: 3px; }
.chaleur div { height: 18px; border-radius: 3px; }
.deroule { max-height: 640px; overflow-y: auto; }
.matrice { display: grid; gap: 3px; }
.matrice div { height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
/* notes de groupe : un bureau de dossiers */
.grille-dossiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tuile-dossier { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px 14px; border-radius: 18px; background: var(--carte); border: 1px solid var(--bord); cursor: pointer; text-align: center; min-width: 0; user-select: none; }
.tuile-dossier:hover { background: var(--survol); }
.tuile-dossier .plus-dossier { position: absolute; top: 6px; right: 10px; color: var(--texte3); font-size: 14px; opacity: 0; }
.tuile-dossier:hover .plus-dossier { opacity: 1; }
.survol-depot { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--survol) !important; }
.ligne-fichier[draggable="true"] { cursor: grab; }
.bureau { min-height: 160px; border-radius: 18px; }
