/* Mission : outil de pilotage. Synthèse d'abord, l'état se lit à la couleur de bord et aux pastilles. */
:root {
  --fond: #f2f5f7; --surface: #ffffff; --texte: #16232e; --discret: #5a6977; --filet: #d6dee5;
  --accent: #0b5c7a; --accent-texte: #ffffff; --accent-doux: #e2eff4;
  --ok: #1d6f42; --ok-fond: #e1f2e8; --cours: #8a5a00; --cours-fond: #fbeecf;
  --attente: #6a3fa0; --attente-fond: #efe6fa; --retard: #a4302a; --retard-fond: #fae3e1;
  --afaire: #46525e; --afaire-fond: #e7ebef;
  --titre: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --corps: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --fond: #10171d; --surface: #18222b; --texte: #e7edf2; --discret: #a1afbb; --filet: #2c3a45;
    --accent: #6cc0dd; --accent-texte: #0c1a22; --accent-doux: #1b3340;
    --ok: #82d8a6; --ok-fond: #17352a; --cours: #efc76c; --cours-fond: #3a2e12;
    --attente: #c9a8f2; --attente-fond: #2f2440; --retard: #f3a29c; --retard-fond: #40201e;
    --afaire: #bcc7d0; --afaire-fond: #29353f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 400 16px/1.45 var(--corps); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--titre); font-weight: 600; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; font-family: var(--corps); }
p { margin: 0; }

.haut { display: flex; align-items: center; gap: 18px; padding: calc(10px + env(safe-area-inset-top)) 20px 10px; background: var(--surface); border-bottom: 1px solid var(--filet); position: sticky; top: 0; z-index: 4; }
.marque { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--texte); font-weight: 700; }
.nav-large { display: flex; gap: 4px; flex: 1; }
.nav-large a { text-decoration: none; color: var(--discret); padding: 6px 10px; border-radius: 6px; font-weight: 600; font-size: 15px; }
.nav-large a[aria-current="page"] { color: var(--accent); background: var(--accent-doux); }
.deco { margin-left: auto; }
.lien { background: none; border: 0; color: var(--discret); cursor: pointer; padding: 6px; text-decoration: underline; }
.contenu { max-width: 1100px; margin: 0 auto; padding: 20px 20px 40px; display: grid; gap: 18px; }
.nav-bas { display: none; }

@media (max-width: 760px) {
  .nav-large, .deco { display: none; }
  .haut { padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  .contenu { padding: 14px 16px calc(84px + env(safe-area-inset-bottom)); gap: 14px; }
  h1 { font-size: 22px; }
  .nav-bas { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--filet); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
  .nav-bas a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 9px; color: var(--discret); text-decoration: none; font-size: 12px; font-weight: 600; }
  .nav-bas svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .nav-bas a[aria-current="page"] { color: var(--accent); }
}

.entete { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; justify-content: space-between; }
.sous { color: var(--discret); font-size: 14.5px; }
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.bloc { background: var(--surface); border: 1px solid var(--filet); border-radius: 10px; padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.chiffre { background: var(--surface); border: 1px solid var(--filet); border-radius: 10px; padding: 10px 14px; text-decoration: none; color: var(--texte); font-variant-numeric: tabular-nums; }
.chiffre b { display: block; font-size: 26px; line-height: 1.1; }
.chiffre span { font-size: 13.5px; color: var(--discret); }
.chiffre.alerte b { color: var(--retard); }

.liste { display: grid; gap: 8px; }
.carte { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--filet); border-left: 4px solid var(--filet); border-radius: 8px; padding: 10px 12px; text-decoration: none; color: var(--texte); }
.carte:hover { border-color: var(--accent); }
.carte.afaire { border-left-color: var(--afaire); } .carte.encours { border-left-color: var(--cours); }
.carte.attente { border-left-color: var(--attente); } .carte.fait { border-left-color: var(--ok); opacity: .75; }
.carte .t { font-weight: 600; }
.carte .p { color: var(--discret); font-size: 14px; }
.ligne { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.afaire { color: var(--afaire); background: var(--afaire-fond); } .chip.encours { color: var(--cours); background: var(--cours-fond); }
.chip.attente { color: var(--attente); background: var(--attente-fond); } .chip.fait { color: var(--ok); background: var(--ok-fond); }
.chip.retard { color: var(--retard); background: var(--retard-fond); } .chip.neutre { color: var(--discret); background: var(--fond); }
.pastille-couleur { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.colonnes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; align-items: start; }
.colonne { background: var(--accent-doux); border-radius: 10px; padding: 10px; display: grid; gap: 8px; min-height: 120px; }
.colonne h2 { font-size: 15px; font-family: var(--corps); display: flex; justify-content: space-between; }
.colonne.survol { outline: 2px dashed var(--accent); }
.carte[draggable="true"] { cursor: grab; }
@media (max-width: 760px) { .colonnes { display: none; } }
@media (min-width: 761px) { .seulement-mobile { display: none; } }

.barre { height: 8px; background: var(--fond); border-radius: 4px; overflow: hidden; }
.barre i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.avancement { display: grid; gap: 4px; text-decoration: none; color: var(--texte); }
.avancement .ligne { justify-content: space-between; font-size: 14.5px; }

form.formulaire { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; color: var(--discret); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; border: 1px solid var(--filet); border-radius: 8px; padding: 9px 10px; background: var(--surface); }
textarea { min-height: 90px; resize: vertical; }
.deux { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ajout { display: grid; gap: 8px; grid-template-columns: 1fr auto; }
.ajout .options { grid-column: 1 / -1; display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.btn { border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 700; background: var(--accent); color: var(--accent-texte); cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
.btn.second { background: var(--surface); color: var(--texte); border: 1px solid var(--filet); }
.btn.danger { background: var(--surface); color: var(--retard); border: 1px solid var(--retard); }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.filtres { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filtre { flex: none; border: 1px solid var(--filet); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 14px; text-decoration: none; color: var(--texte); }
.filtre[aria-current="true"] { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); font-weight: 600; }
.vide { color: var(--discret); text-align: center; padding: 20px 12px; border: 1px dashed var(--filet); border-radius: 10px; }
.erreur { color: var(--retard); background: var(--retard-fond); padding: 8px 10px; border-radius: 8px; font-size: 14.5px; }
.fil { display: grid; gap: 0; }
.fil .e { display: grid; grid-template-columns: minmax(56px, max-content) 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--filet); }
.fil .e:last-child { border-bottom: 0; }
.fil .h { color: var(--discret); font-size: 13px; font-variant-numeric: tabular-nums; }
.fil .note { font-weight: 600; }
.fil p { white-space: pre-line; }
.jour-titre { font-size: 14px; color: var(--discret); text-transform: capitalize; margin-top: 8px; }
.texte { white-space: pre-line; }
.menu-plus { display: grid; gap: 8px; }
.menu-plus a, .menu-plus button { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--filet); border-radius: 10px; padding: 14px 16px; font-weight: 600; text-decoration: none; color: var(--texte); cursor: pointer; }

/* connexion */
.page-connexion { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.page-connexion .contenu { width: 100%; max-width: 400px; padding: 0; }
.boite { background: var(--surface); border: 1px solid var(--filet); border-radius: 14px; padding: 24px 22px; display: grid; gap: 16px; }
.boite .logo { display: flex; align-items: center; gap: 10px; }
.qr { display: grid; place-items: center; background: #fff; border-radius: 10px; padding: 8px; }
.qr img { width: 220px; height: 220px; image-rendering: pixelated; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 14px; word-break: break-all; background: var(--fond); padding: 8px; border-radius: 6px; user-select: all; }
.code-saisie { font-size: 26px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
