/* Tablo Équipe — feuille de style (aucune dépendance externe) */
@font-face { font-family: "Inter"; src: url("/static/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/Inter-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root, [data-theme="clair"] {
  --fond: #f4f6f8; --surface: #ffffff; --surface-2: #f8fafb; --bord: #e2e8ee; --texte: #18222d; --doux: #5d6b7a;
  --primaire: #0e7490; --primaire-fort: #0b5d74; --primaire-pale: #e0f2f7; --accent: #f59e0b;
  --ok: #15803d; --ok-pale: #dcfce7; --alerte: #b45309; --alerte-pale: #fef3c7; --danger: #b91c1c; --danger-pale: #fee2e2;
  --info: #1d4ed8; --info-pale: #dbeafe; --gris-pale: #eef1f4; --ombre: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --nav: #0f2a36; --nav-texte: #cfe3ea; --nav-actif: #164a5c;
}
[data-theme="sombre"] {
  --fond: #12161b; --surface: #1b2128; --surface-2: #20272f; --bord: #2d3640; --texte: #e6ebf0; --doux: #98a6b4;
  --primaire: #22a5c4; --primaire-fort: #4cc2dd; --primaire-pale: #173a45; --accent: #fbbf24;
  --ok: #4ade80; --ok-pale: #163323; --alerte: #fbbf24; --alerte-pale: #3a2f12; --danger: #f87171; --danger-pale: #3d1c1c;
  --info: #93c5fd; --info-pale: #1c2c47; --gris-pale: #262e37; --ombre: 0 1px 3px rgba(0,0,0,.4);
  --nav: #0d1115; --nav-texte: #b9c6d2; --nav-actif: #1e2a33;
}
[data-theme="bleu_nuit"] {
  --fond: #0b1426; --surface: #111d35; --surface-2: #152342; --bord: #233559; --texte: #e3eaf7; --doux: #9aabc8;
  --primaire: #5aa9ff; --primaire-fort: #8cc4ff; --primaire-pale: #18305a; --accent: #fbbf24;
  --ok: #4ade80; --ok-pale: #133325; --alerte: #fbbf24; --alerte-pale: #3a3015; --danger: #fb7185; --danger-pale: #3e1a26;
  --info: #93c5fd; --info-pale: #1a2d55; --gris-pale: #1a2a4a; --ombre: 0 1px 3px rgba(0,0,0,.45);
  --nav: #070e1c; --nav-texte: #b5c4e0; --nav-actif: #16264a;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fond); color: var(--texte); line-height: 1.45; }
a { color: var(--primaire); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 .2rem; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; font-weight: 600; }
h3 { font-size: .95rem; margin: 0 0 .5rem; font-weight: 600; }
p { margin: .3rem 0 .8rem; }
.doux { color: var(--doux); }
.petit { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ----------------------------------------------------------------- mise en page */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.nav { background: var(--nav); color: var(--nav-texte); padding: 1rem .75rem; display: flex; flex-direction: column; gap: .2rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.nav .marque { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 600; font-size: 1.15rem; padding: .2rem .5rem 1rem; }
.nav .marque img { width: 30px; height: 30px; }
.nav a { color: var(--nav-texte); display: flex; align-items: center; gap: .65rem; padding: .5rem .65rem; border-radius: 8px; font-size: .95rem; }
.nav a:hover { background: var(--nav-actif); text-decoration: none; color: #fff; }
.nav a.actif { background: var(--nav-actif); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav .ico { width: 1.2rem; text-align: center; opacity: .9; }
.nav .sep { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .55; padding: 1rem .65rem .3rem; }
.nav .pied { margin-top: auto; padding-top: 1rem; font-size: .82rem; }
.nav .pied form { margin: .3rem 0 0; }
.nav .pied button { background: none; border: 1px solid rgba(255,255,255,.2); color: var(--nav-texte); border-radius: 6px; padding: .3rem .6rem; cursor: pointer; font: inherit; }
.pastille { background: var(--accent); color: #111; border-radius: 999px; font-size: .72rem; font-weight: 600; padding: 0 .45rem; margin-left: auto; }
main { padding: 1.5rem 2rem 3rem; max-width: 1400px; width: 100%; }
.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.entete .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.menu-mobile { display: none; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: .5rem; }
  .nav .marque { padding: .3rem .5rem; width: 100%; }
  .nav .sep, .nav .pied { display: none; }
  .nav a { padding: .4rem .55rem; font-size: .85rem; }
  main { padding: 1rem; }
}

/* ----------------------------------------------------------------- composants */
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: 1.1rem 1.2rem; box-shadow: var(--ombre); margin-bottom: 1.2rem; min-width: 0; }
.carte > h2:first-child { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.carte h2 .lien { font-size: .82rem; font-weight: 400; }
.grille { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.grille-2 { display: grid; gap: 1.2rem; grid-template-columns: 2fr 1fr; align-items: start; }
@media (max-width: 1100px) { .grille-2 { grid-template-columns: 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.kpi { background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: .8rem 1rem; box-shadow: var(--ombre); }
.kpi .val { font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.kpi .lib { color: var(--doux); font-size: .85rem; }
.kpi.alerte .val { color: var(--danger); }
.kpi.ok .val { color: var(--ok); }

.btn, button.btn { display: inline-flex; align-items: center; gap: .4rem; background: var(--primaire); color: #fff; border: 1px solid var(--primaire); border-radius: 8px; padding: .5rem .9rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--primaire-fort); text-decoration: none; }
.btn.sec { background: var(--surface); color: var(--texte); border-color: var(--bord); }
.btn.sec:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.mini { padding: .25rem .55rem; font-size: .82rem; font-weight: 500; }
.btn.lien { background: none; border: none; color: var(--primaire); padding: 0; font-weight: 500; }
form.inline { display: inline; }

label { display: block; font-size: .85rem; font-weight: 600; margin: .7rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--bord); border-radius: 8px; background: var(--surface); color: var(--texte); font: inherit; }
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primaire); outline-offset: 0; border-color: var(--primaire); }
select[multiple] { min-height: 7rem; }
.champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 1rem; }
.aide { font-size: .8rem; color: var(--doux); margin-top: .2rem; font-weight: 400; }
.case { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.case input { width: auto; }
.form-actions { margin-top: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
fieldset { border: 1px solid var(--bord); border-radius: 10px; padding: .4rem 1rem 1rem; margin: 1rem 0 0; }
legend { font-weight: 600; font-size: .9rem; padding: 0 .4rem; }

.rapide { display: flex; gap: .5rem; flex-wrap: wrap; }
.rapide input[name=titre] { flex: 1 1 260px; }
.rapide input, .rapide select { width: auto; }

.flash { background: var(--info-pale); color: var(--texte); border-left: 4px solid var(--info); padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash.lien code { user-select: all; background: var(--surface); padding: .25rem .4rem; border-radius: 6px; word-break: break-all; display: inline-block; margin-top: .3rem; }
.bandeau { background: var(--alerte-pale); border-left: 4px solid var(--accent); padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); font-weight: 600; padding: .4rem .5rem; border-bottom: 1px solid var(--bord); }
td { padding: .5rem; border-bottom: 1px solid var(--bord); vertical-align: top; }
tr:last-child td { border-bottom: none; }
.table-defile { overflow-x: auto; }

/* badges */
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--gris-pale); color: var(--doux); white-space: nowrap; }
.badge.a_faire { background: var(--gris-pale); color: var(--texte); }
.badge.en_cours { background: var(--info-pale); color: var(--info); }
.badge.en_attente { background: var(--alerte-pale); color: var(--alerte); }
.badge.terminee { background: var(--ok-pale); color: var(--ok); }
.badge.retard { background: var(--danger-pale); color: var(--danger); }
.badge.privee { background: var(--gris-pale); color: var(--doux); }
.badge.equipe, .badge.partage { background: var(--primaire-pale); color: var(--primaire); }
.imp { display: inline-flex; gap: 2px; vertical-align: middle; }
.imp i { width: 6px; height: 12px; border-radius: 2px; background: var(--bord); }
.imp.n2 i:nth-child(-n+2), .imp.n1 i:nth-child(1) { background: var(--doux); }
.imp.n3 i:nth-child(-n+3) { background: var(--accent); }
.imp.n4 i { background: var(--danger); }

/* lignes de tâches */
.taches { list-style: none; margin: 0; padding: 0; }
.tache { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .7rem; align-items: start; padding: .6rem .2rem; border-bottom: 1px solid var(--bord); }
.tache:last-child { border-bottom: none; }
.tache .titre { font-weight: 600; color: var(--texte); }
.tache .meta { grid-column: 2 / 4; font-size: .82rem; color: var(--doux); display: flex; gap: .35rem .8rem; flex-wrap: wrap; align-items: center; }
.tache .droite { display: flex; gap: .4rem; align-items: center; }
.tache.terminee .titre { text-decoration: line-through; color: var(--doux); }
.coche { width: 1.25rem; height: 1.25rem; margin-top: .1rem; border: 2px solid var(--doux); border-radius: 50%; background: none; cursor: pointer; padding: 0; }
.coche:hover { border-color: var(--ok); background: var(--ok-pale); }
.coche.faite { background: var(--ok); border-color: var(--ok); }
.groupe { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); margin: 1rem 0 .2rem; font-weight: 600; }
.groupe.retard { color: var(--danger); }
.vide { color: var(--doux); font-style: italic; padding: .5rem 0; }

.barre { height: 8px; background: var(--gris-pale); border-radius: 999px; overflow: hidden; min-width: 60px; }
.barre > span { display: block; height: 100%; background: var(--primaire); border-radius: 999px; }
.barre.ok > span { background: var(--ok); }
.objectif { padding: .55rem 0; border-bottom: 1px solid var(--bord); }
.objectif:last-child { border-bottom: none; }
.objectif .haut { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; }

.avatar { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--primaire-pale); color: var(--primaire); font-size: .72rem; font-weight: 600; flex: none; }
.personne { display: flex; align-items: center; gap: .55rem; }
.puces { display: flex; gap: .35rem; flex-wrap: wrap; }
.puce { display: inline-flex; align-items: center; gap: .35rem; background: var(--surface-2); border: 1px solid var(--bord); border-radius: 999px; padding: .15rem .3rem .15rem .2rem; font-size: .85rem; }
.puce .avatar { width: 1.4rem; height: 1.4rem; font-size: .62rem; }
.puce form button { background: none; border: none; color: var(--doux); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }

.onglets { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.onglets a { padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--bord); background: var(--surface); color: var(--texte); font-size: .9rem; }
.onglets a.actif { background: var(--primaire); color: #fff; border-color: var(--primaire); }
.onglets a:hover { text-decoration: none; border-color: var(--primaire); }
.filtres { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.filtres > * { width: auto; }
.filtres input[type=search] { min-width: 220px; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: .9rem; overflow-x: auto; }
.colonne { background: var(--surface-2); border: 1px solid var(--bord); border-radius: 12px; padding: .7rem; min-height: 300px; }
.colonne h3 { display: flex; justify-content: space-between; }
.colonne.survol { outline: 2px dashed var(--primaire); }
.vignette { background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; padding: .6rem .7rem; margin-bottom: .55rem; box-shadow: var(--ombre); cursor: grab; }
.vignette.retard { border-left: 4px solid var(--danger); }
.vignette .titre { font-weight: 600; display: block; color: var(--texte); margin-bottom: .3rem; }
.vignette .meta { font-size: .78rem; color: var(--doux); display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.vignette.glisse { opacity: .5; }

/* fil de commentaires */
.fil { display: flex; flex-direction: column; gap: .8rem; }
.message { display: grid; grid-template-columns: auto 1fr; gap: .6rem; }
.message .bulle { background: var(--surface-2); border: 1px solid var(--bord); border-radius: 10px; padding: .55rem .75rem; }
.message .qui { font-size: .82rem; color: var(--doux); margin-bottom: .2rem; display: flex; justify-content: space-between; gap: .5rem; }
.message.moi .bulle { background: var(--primaire-pale); }

.etapes { list-style: none; padding: 0; margin: 0 0 .6rem; }
.etapes li { display: flex; gap: .5rem; align-items: center; padding: .3rem 0; }
.etapes li.faite span { text-decoration: line-through; color: var(--doux); }
.etapes li form.suppr { margin-left: auto; }

.histo { list-style: none; padding: 0; margin: 0; font-size: .85rem; }
.histo li { padding: .3rem 0; border-bottom: 1px dashed var(--bord); color: var(--doux); }

.charge { display: grid; grid-template-columns: 1fr; gap: .3rem; }
.empile { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--gris-pale); }
.empile span { display: block; height: 100%; }
.empile .a_faire { background: var(--doux); }
.empile .en_cours { background: var(--info); }
.empile .en_attente { background: var(--accent); }
.empile .terminee { background: var(--ok); }
.legende { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--doux); }
.legende i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }

/* pages sans menu (connexion, erreurs) */
.page-seule { display: grid; place-items: center; min-height: 100vh; padding: 1rem; background: linear-gradient(160deg, #0f2a36, #0e7490); }
.carte-seule { background: var(--surface); border-radius: 16px; padding: 2rem; width: min(420px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.carte-seule .logo { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.2rem; font-size: 1.3rem; font-weight: 600; }
.carte-seule .logo img { width: 40px; height: 40px; }
.carte-seule .btn { width: 100%; justify-content: center; margin-top: 1.2rem; }
.erreur { background: var(--danger-pale); color: var(--danger); padding: .6rem .8rem; border-radius: 8px; margin: .5rem 0; font-size: .9rem; }

.notif { display: flex; gap: .7rem; padding: .65rem .3rem; border-bottom: 1px solid var(--bord); align-items: flex-start; }
.notif.non-lue { background: var(--primaire-pale); border-radius: 8px; }
.notif .quand { margin-left: auto; white-space: nowrap; font-size: .82rem; color: var(--doux); }

details > summary { cursor: pointer; color: var(--primaire); font-weight: 600; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+ "; }
details[open] > summary::before { content: "− "; }

.energie { display: flex; gap: .4rem; }
.energie label { font-weight: 400; display: flex; gap: .25rem; align-items: center; margin: 0; }
.energie input { width: auto; }

@media print {
  .nav, .entete .actions, .rapide, form, .btn { display: none !important; }
  .layout { display: block; }
  .carte { box-shadow: none; break-inside: avoid; }
}
.choix-multiple { max-height: 13rem; overflow-y: auto; border: 1px solid var(--bord); border-radius: 8px; padding: .3rem .6rem; background: var(--surface); }
.choix-multiple label { font-weight: 400; margin: .25rem 0; display: flex; gap: .45rem; align-items: center; }
.choix-multiple input { width: auto; }
.lecture dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); margin-top: .7rem; }
.lecture dd { margin: .15rem 0 0; }
.pj { display: flex; gap: .7rem; align-items: flex-start; padding: .5rem 0; border-bottom: 1px solid var(--bord); }
.pj:last-of-type { border-bottom: none; }
.pj-ico { font-size: 1.2rem; line-height: 1.3; }
.pj-nom { flex: 1; min-width: 0; word-break: break-word; }
.pj-ajout { margin-top: .8rem; }
.pj-ajout input[type=file] { width: 100%; }

/* ----------------------------------------------------------------- graphiques */
/* Palette validée (daltonisme, contraste) : voir src/charts.rs */
:root, [data-theme="clair"] { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --g-grille: #e6e9ec; --g-base: #c3c9cf; }
[data-theme="sombre"] { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --g-grille: #2a323b; --g-base: #3d4752; }
[data-theme="bleu_nuit"] { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --g-grille: #1f3152; --g-base: #2e4570; }
.s1 { fill: var(--s1); } .s2 { fill: var(--s2); } .s3 { fill: var(--s3); }
.s1-fond { background: var(--s1); } .s2-fond { background: var(--s2); } .s3-fond { background: var(--s3); }
.graphe { width: 100%; height: auto; display: block; margin: .4rem 0; overflow: visible; }
.graphe .g-grille { stroke: var(--g-grille); stroke-width: 1; }
.graphe .g-base { stroke: var(--g-base); stroke-width: 1; }
.graphe .g-axe { fill: var(--doux); font-size: 11px; font-variant-numeric: tabular-nums; }
.graphe .g-lib { fill: var(--texte); font-size: 12px; }
.graphe .g-val { fill: var(--doux); font-size: 11px; font-variant-numeric: tabular-nums; }
.graphe .cible { fill: transparent; }
.graphe .cible:focus { outline: none; }
.graphe .cible:focus-visible { stroke: var(--accent); stroke-width: 2; }
.graphe .marque.actif, .seg.actif { opacity: .78; }
.legende i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.segments { display: flex; gap: 2px; height: 28px; margin: .6rem 0 .5rem; }
.seg { border-radius: 4px; min-width: 6px; display: flex; align-items: center; padding-left: .5rem; color: #fff; font-size: .82rem; font-weight: 600; }
.seg:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.kpis.mini { margin: 1rem 0 0; grid-template-columns: 1fr 1fr; }
.kpis.mini .kpi { box-shadow: none; background: var(--surface-2); }
.donnees summary { color: var(--doux); font-weight: 500; }
.donnees table { margin-top: .5rem; }
.infobulle { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--texte); border: 1px solid var(--bord); border-radius: 8px; padding: .35rem .6rem; box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: .82rem; max-width: 260px; }
.infobulle strong { display: block; font-size: 1rem; }
.infobulle span { color: var(--doux); }
.infobulle[hidden] { display: none; }
@media (forced-colors: active) { .seg, .graphe .marque { forced-color-adjust: none; } }
.empile { gap: 2px; background: none; }
.empile .seg-mince { border-radius: 999px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.seg-mince.actif { opacity: .78; }
