/* © 2026 Castronovo Florent — Tous droits réservés — 11 novembre 2026 */
/* Aucune couleur en dur hors de ces variables : clair et sombre se règlent ici (leçon de l'ancienne application). */
:root {
  --fond: #f6f7f4; --carte: #ffffff; --texte: #1b2420; --discret: #4a5650; --bord: #cfd6d1;
  --principal: #1f5f4a; --principal-texte: #ffffff; --principal-doux: #e3f0ea;
  --info: #0f4c81; --info-doux: #e4eef8;
  --ok: #17603a; --ok-doux: #e1f3e8;
  --alerte: #8a4b00; --alerte-doux: #fdf0dc;
  --danger: #a3261c; --danger-doux: #fbe7e5;
  --focus: #0b57d0; --ombre: 0 1px 2px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.06);
  --rayon: 12px; --cible: 2.75rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #11171a; --carte: #1a2226; --texte: #e8edea; --discret: #b4c0ba; --bord: #3a474d;
    --principal: #67c9a5; --principal-texte: #0c1a15; --principal-doux: #1d3a30;
    --info: #8ec3f5; --info-doux: #1b2d3f;
    --ok: #7fd9a0; --ok-doux: #1c3527;
    --alerte: #f1be6c; --alerte-doux: #3b2d14;
    --danger: #ff9d94; --danger-doux: #432120;
    --focus: #8ab4ff; --ombre: 0 1px 2px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .4rem; }
p { margin: 0 0 .75rem; }
a { color: var(--info); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1:focus { outline: none; }
.evitement { position: absolute; left: -999px; top: 0; background: var(--principal); color: var(--principal-texte); padding: .75rem 1rem; z-index: 100; }
.evitement:focus { left: 0; }
.cache-visuel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 1rem; background: var(--alerte-doux); color: var(--alerte); }

/* ----- structure : en-tête, navigation, contenu ----- */
.coque { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.entete { display: flex; align-items: center; gap: .75rem; padding: .5rem 1rem; background: var(--carte); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 20; }
.entete .btn { padding: .3rem .8rem; white-space: nowrap; }
.entete .btn-discret { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
.marque { white-space: nowrap; }
.marque { font-weight: 700; color: var(--principal); text-decoration: none; font-size: 1.05rem; }
.espace-nom { color: var(--discret); font-size: .9rem; }
.entete .ecart { flex: 1; }
.corps { display: grid; grid-template-columns: 15rem minmax(0, 1fr); }
.menu { background: var(--carte); border-right: 1px solid var(--bord); padding: 1rem .75rem; }
.menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.menu a { display: flex; align-items: center; gap: .6rem; min-height: var(--cible); padding: .4rem .8rem; border-radius: 10px; color: var(--texte); text-decoration: none; font-weight: 500; }
.menu a:hover { background: var(--principal-doux); }
.menu a[aria-current="page"] { background: var(--principal); color: var(--principal-texte); }
.contenu { padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: 70rem; width: 100%; }
.fil { font-size: .9rem; color: var(--discret); margin-bottom: .75rem; }
.fil ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0; }
.fil li + li::before { content: "›"; margin-right: .35rem; }
.sous-titre { color: var(--discret); margin-bottom: 1.25rem; max-width: 46rem; }
.etape-ou { display: inline-block; font-size: .85rem; font-weight: 600; color: var(--principal); background: var(--principal-doux); padding: .15rem .6rem; border-radius: 999px; margin-bottom: .5rem; }

/* ----- composants ----- */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.1rem 1.25rem; box-shadow: var(--ombre); }
.grille { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.pile { display: grid; gap: 1rem; }
.rangee { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.rangee-ecart { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.action-principale { border-left: 6px solid var(--principal); }
.action-principale h2 { font-size: 1.3rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--cible); padding: .45rem 1.1rem; border-radius: 10px; border: 2px solid var(--principal); background: var(--principal); color: var(--principal-texte); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; filter: none; }
.btn-second { background: transparent; color: var(--principal); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--carte); }
.btn-discret { background: transparent; border-color: transparent; color: var(--info); text-decoration: underline; padding-inline: .5rem; }
.puce { display: inline-block; font-size: .8rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; background: var(--principal-doux); color: var(--principal); white-space: nowrap; }
.puce-ok { background: var(--ok-doux); color: var(--ok); }
.puce-alerte { background: var(--alerte-doux); color: var(--alerte); }
.puce-danger { background: var(--danger-doux); color: var(--danger); }
.puce-info { background: var(--info-doux); color: var(--info); }
.puce-neutre { background: var(--fond); color: var(--discret); border: 1px solid var(--bord); }
progress { width: 100%; height: .7rem; border: 0; border-radius: 999px; overflow: hidden; background: var(--bord); accent-color: var(--principal); }
progress::-webkit-progress-bar { background: var(--bord); }
progress::-webkit-progress-value { background: var(--principal); }
progress::-moz-progress-bar { background: var(--principal); }
.progres-ligne { display: grid; gap: .25rem; }
.progres-ligne small { color: var(--discret); }
.message { padding: .8rem 1rem; border-radius: 10px; border: 1px solid; margin-bottom: 1rem; }
.message-info { background: var(--info-doux); color: var(--info); border-color: var(--info); }
.message-ok { background: var(--ok-doux); color: var(--ok); border-color: var(--ok); }
.message-alerte { background: var(--alerte-doux); color: var(--alerte); border-color: var(--alerte); }
.message-erreur { background: var(--danger-doux); color: var(--danger); border-color: var(--danger); }
.vide { text-align: center; padding: 2.25rem 1rem; }
.vide h2 { margin-bottom: .4rem; }
.vide p { color: var(--discret); max-width: 34rem; margin-inline: auto; }
.chargement { display: grid; gap: .75rem; }
.squelette { height: 5rem; border-radius: var(--rayon); background: linear-gradient(90deg, var(--bord), var(--carte), var(--bord)); background-size: 200% 100%; animation: brille 1.4s infinite linear; }
@keyframes brille { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .squelette { animation: none; } * { scroll-behavior: auto !important; } }
.annonces { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 60; width: min(32rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; padding: .75rem 1rem; border-radius: 10px; border: 1px solid var(--bord); background: var(--carte); box-shadow: var(--ombre); }
.toast-ok { border-color: var(--ok); } .toast-erreur { border-color: var(--danger); }
.aide { font-size: .92rem; color: var(--discret); margin: .5rem 0 1rem; }
.aide summary { cursor: pointer; min-height: 1.75rem; color: var(--info); font-weight: 600; }
.aide div { padding: .4rem 0 0 .2rem; }
.liste-simple { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.element { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: .85rem 1rem; border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); }
.element .texte { flex: 1 1 14rem; min-width: 0; }
.element .texte strong { display: block; }
.element .texte small { color: var(--discret); }
.verrou { opacity: .85; background: var(--fond); }
.stat { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-libelle { color: var(--discret); font-size: .9rem; }

/* ----- formulaires ----- */
.formulaire { max-width: 34rem; display: grid; gap: 1.1rem; }
.champ label, .champ .libelle { display: block; font-weight: 600; margin-bottom: .25rem; }
.champ .aide-champ { color: var(--discret); font-size: .9rem; margin-bottom: .35rem; }
.champ input, .champ select, .champ textarea { width: 100%; min-height: var(--cible); padding: .5rem .75rem; border-radius: 10px; border: 2px solid var(--bord); background: var(--carte); color: var(--texte); font: inherit; }
.champ input:focus, .champ select:focus, .champ textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px var(--info-doux); }
.champ.invalide input, .champ.invalide select, .champ.invalide textarea { border-color: var(--danger); }
.champ .erreur-champ { color: var(--danger); font-size: .92rem; margin-top: .3rem; min-height: 0; }
.champ .avec-bouton { display: flex; gap: .5rem; } .champ .avec-bouton input { flex: 1; }
.exigences { list-style: none; padding: 0; margin: .4rem 0 0; font-size: .92rem; color: var(--discret); }
.exigences li::before { content: "○ "; } .exigences li.ok { color: var(--ok); } .exigences li.ok::before { content: "✓ "; }
fieldset { border: 1px solid var(--bord); border-radius: 10px; padding: .75rem 1rem; margin: 0; }
legend { font-weight: 600; padding: 0 .4rem; }
.choix { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem 1rem; border: 2px solid var(--bord); border-radius: 10px; background: var(--carte); cursor: pointer; min-height: var(--cible); }
.choix:has(input:checked) { border-color: var(--principal); background: var(--principal-doux); }
.choix input { width: 1.3rem; height: 1.3rem; margin-top: .15rem; accent-color: var(--principal); flex: none; }
.mdp-temp { font-family: ui-monospace, Consolas, monospace; font-size: 1.4rem; letter-spacing: .05em; padding: .75rem 1rem; border: 2px dashed var(--principal); border-radius: 10px; background: var(--principal-doux); word-break: break-all; user-select: all; }

/* ----- tableau (grand écran) et cartes (mobile) ----- */
.tableau { width: 100%; border-collapse: collapse; background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; }
.tableau th, .tableau td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.tableau th { font-size: .85rem; color: var(--discret); background: var(--fond); }
.tableau tr:last-child td { border-bottom: 0; }
.outils { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; align-items: end; }
.outils .champ { min-width: 12rem; flex: 1 1 14rem; }
.version-cartes { display: none; }

/* ----- fenêtre de dialogue ----- */
dialog { border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.25rem; max-width: min(34rem, calc(100vw - 2rem)); width: 100%; background: var(--carte); color: var(--texte); box-shadow: var(--ombre); }
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog h2 { margin-top: 0; }
.pied-dialogue { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; margin-top: 1rem; }

/* ----- connexion ----- */
.page-centree { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.page-centree .carte { width: min(30rem, 100%); }
.connexion-titre { text-align: center; margin-bottom: 1rem; }
.etapes { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.etapes li { flex: 1; font-size: .85rem; padding: .35rem .5rem; border-top: 4px solid var(--bord); color: var(--discret); }
.etapes li[aria-current="step"] { border-top-color: var(--principal); color: var(--texte); font-weight: 700; }
.etapes li.fait { border-top-color: var(--ok); }
.question-enonce { font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; }
.rang-ordre { display: flex; gap: .5rem; align-items: center; }
.rang-ordre .num { font-weight: 700; width: 1.6rem; }
.correction { border-left: 5px solid var(--bord); }
.correction.juste { border-left-color: var(--ok); } .correction.faux { border-left-color: var(--danger); }

/* ----- petits écrans : navigation en barre du bas, tableaux en cartes ----- */
@media (max-width: 760px) {
  .corps { grid-template-columns: minmax(0, 1fr); }
  .entete { flex-wrap: wrap; row-gap: .25rem; padding: .4rem .75rem; }
  .entete .btn-discret { max-width: 7rem; }
  .menu { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; border-right: 0; border-top: 1px solid var(--bord); padding: .25rem; }
  .menu ul { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .15rem; }
  .menu a { flex-direction: column; justify-content: center; gap: 0; font-size: .78rem; padding: .25rem; text-align: center; border-radius: 8px; line-height: 1.15; overflow-wrap: anywhere; min-width: 0; }
  .contenu { padding-bottom: 6rem; }
  .espace-nom { display: none; }
  .version-tableau { display: none; }
  .version-cartes { display: grid; gap: .75rem; }
  h1 { font-size: 1.4rem; }
}
@media print { .menu, .entete, .btn { display: none; } }

/* ----- page d'accueil : un onglet de connexion par profil ----- */
.carte-large { max-width: 34rem; width: 100%; }
.onglets { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; margin-bottom: 1rem; border-bottom: 2px solid var(--bord); }
.onglet { min-height: 44px; padding: .4rem .3rem; border: 0; border-bottom: 4px solid transparent; margin-bottom: -2px; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.onglet[aria-selected="true"] { border-bottom-color: currentColor; }
.onglet:hover { background: var(--principal-doux); }

/* Double authentification : clé à recopier */
.cle-2fa { display: inline-block; padding: 0.5rem 0.75rem; background: var(--principal-doux); border: 1px solid var(--bord); border-radius: 6px; font-size: 1.15rem; letter-spacing: 0.08em; word-break: break-all; }
.liste-codes { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.5rem; }
.liste-codes code { display: block; padding: 0.5rem 0.75rem; background: var(--principal-doux); border: 1px solid var(--bord); border-radius: 6px; font-size: 1.1rem; letter-spacing: 0.08em; text-align: center; }

/* Tâches : état lisible sans la couleur seule (texte + puce + liseré) */
.tache { border-left: 6px solid var(--bord); }
.tache-en_cours { border-left-color: var(--info); }
.tache-bloquee { border-left-color: var(--danger); background: var(--danger-doux); }
.tache-faite { border-left-color: var(--ok); }
.motif { margin: 0; padding: .4rem .6rem; border-radius: 6px; background: var(--carte); border: 1px solid var(--danger); color: var(--texte); }
.champ-case { display: flex; align-items: center; gap: .6rem; min-height: var(--cible); }
.champ-case input { width: 1.4rem; height: 1.4rem; }
.pile-serree { display: grid; gap: .25rem; }
.tuile-danger { border-color: var(--danger); background: var(--danger-doux); }
.tuile-alerte { border-color: var(--alerte); background: var(--alerte-doux); }
.barre-empilee { display: flex; gap: 2px; min-height: 1.6rem; border-radius: 6px; overflow: hidden; }
.segment { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; padding: 0 .4rem; }
.segment-ok { background: var(--ok-doux); color: var(--ok); }
.segment-info { background: var(--info-doux); color: var(--info); }
.segment-danger { background: var(--danger-doux); color: var(--danger); }
.segment-neutre { background: var(--fond); color: var(--discret); border: 1px solid var(--bord); }
.kanban { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); align-items: start; }   /* colonnes jamais plus étroites que 18 rem : les boutons restent lisibles */
.colonne { min-width: 0; }
.colonne h2 { font-size: 1.05rem; }
.tuiles { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .75rem; }
.tuile { padding: .75rem 1rem; }
.tache { display: grid; gap: .4rem; }
.tache small { display: block; }
.tache .rangee { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tache .rangee .btn { min-height: var(--cible); padding: .35rem .7rem; width: auto; font-size: .9rem; }
.champ-case label small { display: block; font-weight: 400; }

.btn { max-width: 100%; }
.rangee .btn { white-space: normal; text-align: center; }
.ligne-saisie { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .6rem; align-items: end; }
.ligne-saisie > :first-child { grid-column: 1 / -1; }
.ligne-saisie .btn { justify-self: start; }

.liste-prix{list-style:none;margin:.25rem 0 0;padding:0;font-size:.9rem}
.liste-prix li{margin:.15rem 0}

.menu .icone{flex:none;width:1.35rem;height:1.35rem}
@media (max-width: 760px){.menu .icone{width:1.5rem;height:1.5rem}}

.assistant-pas { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; }
.assistant-pas li { padding: 0.35rem 0.75rem; border: 1px solid var(--bord); border-radius: 999px; font-size: 0.9rem; color: var(--texte-doux, inherit); }
.assistant-pas li.en-cours { background: var(--principal-doux); border-color: var(--principal, currentColor); font-weight: 600; }
.assistant-pas li.fait { opacity: 0.7; }

[hidden] { display: none !important; }
