/* =====================================================================
   eConsignation — GU Super-Bissorte (25/11/2026)
   Bleu nuit EDF + orange Toolbox ; rouge « cadenas » = ce qui est consigné sur les installations.
   Peu de texte : des pastilles, des anneaux, une action principale par écran.
   Mode terrain : fond noir, très gros caractères, zones tactiles larges (gants), action maintenue.
   ===================================================================== */
:root {
  color-scheme: light;
  --navy: #001a70; --navy-2: #0a2a8a; --navy-3: #13308f; --navy-txt: #b8c3ea;
  --orange: #ff861d; --orange-2: #fe5815; --orange-soft: #fff3e8; --orange-fg: #b44a06;
  --rouge: #d62d20; --rouge-soft: #fdecea; --rouge-fg: #a3190f;
  --vert: #14854f; --vert-soft: #e3f5eb; --vert-fg: #0d6139;
  --ambre: #e8a200; --ambre-soft: #fff6dc; --ambre-fg: #7a5300;
  --bleu: #2563eb; --bleu-soft: #e7efff; --violet: #6b4fbb; --violet-soft: #efeafb;
  --fond: #f3f5f9; --surface: #fff; --ligne: #e2e6ee; --ligne-2: #cfd6e3; --txt: #0e1525; --muted: #5d6779; --muted-2: #8a93a5;
  --r1: 10px; --r2: 14px; --r3: 20px;
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --ombre: 0 1px 2px rgba(14,21,37,.05), 0 6px 18px rgba(14,21,37,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fond); color: var(--txt); font-family: var(--font); font-size: 16px; line-height: 1.4;
       -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--bleu); }
.mono { font-family: var(--mono); letter-spacing: -.01em; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible
  { outline: 3px solid var(--orange); outline-offset: 2px; }
svg.i { width: 20px; height: 20px; flex: none; }

/* ---------------------------------------------------------------- En-tête */
.hd { background: var(--navy); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 18px 18px;
      border-radius: 0 0 26px 26px; position: relative; overflow: hidden; }
.hd::after { content: ""; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%;
             background: radial-gradient(circle, rgba(255,134,29,.22), transparent 70%); pointer-events: none; }
.hd-in { max-width: 760px; margin: 0 auto; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; }
.hd-l { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kicker { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: #ffb672; font-weight: 600; }
.hd h1 { margin: 0; font-size: 27px; line-height: 1.1; letter-spacing: -.01em; }
.hd-sub { color: var(--navy-txt); font-size: 14px; }
.hd-retour { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; color: var(--navy-txt); text-decoration: none;
             font-size: 15px; background: none; border: 0; padding: 0; cursor: pointer; }
.hd-retour:hover { color: #fff; }
.hd-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1);
          border: 1px solid rgba(255,255,255,.2); color: #fff; cursor: pointer; text-decoration: none; }
.hd-btn:hover { background: rgba(255,255,255,.18); }

/* Chiffres clés de l'accueil */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 10px 12px;
       display: flex; flex-direction: column; gap: 2px; text-align: left; color: #fff; cursor: pointer; }
.kpi b { font-size: 26px; line-height: 1; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.kpi span { font-size: 12.5px; color: var(--navy-txt); }
.kpi.rouge b { color: #ff8a80; } .kpi.ambre b { color: #ffd166; } .kpi.bleu b { color: #9cc0ff; }
.kpi.on { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); }

/* ---------------------------------------------------------------- Mise en page */
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(150px + env(safe-area-inset-bottom)); }
.sec { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
       margin: 22px 4px 10px; display: flex; align-items: center; gap: 8px; }
.sec:first-child { margin-top: 4px; }
.sec .n { background: var(--ligne); color: var(--txt); border-radius: 99px; padding: 1px 8px; font-size: 12px; letter-spacing: 0; }
.sec .plus { margin-left: auto; }
.card { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r3); padding: 16px; box-shadow: var(--ombre); }
.card + .card { margin-top: 10px; }
.card h2 { margin: 0 0 4px; font-size: 18px; }
.card h3 { margin: 0; font-size: 15.5px; }
.vide { text-align: center; color: var(--muted); padding: 26px 12px; font-size: 15px; }
.vide svg { width: 42px; height: 42px; color: var(--ligne-2); display: block; margin: 0 auto 8px; }
.muted { color: var(--muted); }
.petit { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.wrap-txt { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Boutons, pastilles */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 18px;
       border: 0; border-radius: var(--r2); font-size: 16px; font-weight: 600; color: #fff; background: var(--navy);
       cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn.orange { background: var(--orange); color: var(--navy); }
.btn.rouge { background: var(--rouge); }
.btn.vert { background: var(--vert); }
.btn.ghost { background: var(--surface); color: var(--txt); border: 1.5px solid var(--ligne-2); }
.btn.lien { background: none; color: var(--bleu); padding: 0 6px; min-height: 40px; }
.btn.petit { min-height: 40px; font-size: 14.5px; padding: 0 13px; border-radius: 12px; }
.btn.bloc { display: flex; width: 100%; }
.btn:disabled { background: var(--ligne-2); color: var(--muted); cursor: default; filter: none; }
.btn-ico { width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--ligne); background: var(--surface);
           display: grid; place-items: center; cursor: pointer; color: var(--muted); flex: none; padding: 0; }
.btn-ico:hover { color: var(--txt); border-color: var(--ligne-2); }
.btn-ico.on { background: var(--ambre-soft); border-color: var(--ambre); color: var(--ambre-fg); }
.btn-ico:disabled { opacity: .4; cursor: default; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px;
        font-weight: 600; white-space: nowrap; background: var(--ligne); color: var(--txt); }
.pill.preparation { background: var(--bleu-soft); color: #1d4ed8; }
.pill.a_verifier, .pill.a_approuver { background: var(--ambre-soft); color: var(--ambre-fg); }
.pill.approuve { background: var(--violet-soft); color: var(--violet); }
.pill.en_consignation, .pill.consigne, .pill.en_deconsignation { background: var(--rouge-soft); color: var(--rouge-fg); }
.pill.deconsigne, .pill.clos { background: var(--vert-soft); color: var(--vert-fg); }
.pill.arrete { background: var(--rouge); color: #fff; animation: pulse 1.6s ease-in-out infinite; }
.pill.annule { background: #eceef2; color: var(--muted-2); text-decoration: line-through; }
@keyframes pulse { 50% { opacity: .65; } }
.tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.cons .row { flex-wrap: wrap; gap: 4px 8px; }
.tag i { width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--muted)); display: inline-block; }
.ind { font-family: var(--mono); font-size: 11.5px; font-weight: 600; background: var(--navy); color: #fff; border-radius: 6px; padding: 1px 6px; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chips.defile { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chips.defile::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 99px;
        border: 1.5px solid var(--ligne-2); background: var(--surface); font-size: 14.5px; font-weight: 500; cursor: pointer;
        white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.chip:disabled { opacity: .5; cursor: default; }

/* ---------------------------------------------------------------- Liste des dossiers */
.recherche { position: relative; margin-bottom: 10px; }
.recherche svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.recherche input { width: 100%; min-height: 50px; border: 1.5px solid var(--ligne); border-radius: 16px; padding: 0 14px 0 44px;
                   background: var(--surface); font-size: 16px; }
.recherche input:focus { outline: none; border-color: var(--navy); }
.dos { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--ligne);
       border-radius: 18px; padding: 13px 14px; text-decoration: none; color: inherit; box-shadow: var(--ombre);
       border-left: 5px solid var(--c, var(--ligne-2)); -webkit-tap-highlight-color: transparent; }
.dos + .dos { margin-top: 8px; }
.dos:hover { border-color: var(--ligne-2); }
.dos .t { font-weight: 600; font-size: 15.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dos .s { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dos .haut { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.dos .droite { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.phases-mini { display: flex; gap: 3px; }
.phases-mini b { width: 14px; height: 5px; border-radius: 3px; background: var(--ligne); }
.phases-mini b.f { background: var(--vert); } .phases-mini b.c { background: var(--orange); }

/* Sur les installations : ce qui est consigné, en grand */
.terrain-l { display: grid; gap: 10px; }
.cons { background: var(--surface); border-radius: 20px; padding: 14px; border: 1.5px solid #f3c4bf; box-shadow: var(--ombre);
        text-decoration: none; color: inherit; display: flex; gap: 13px; align-items: center; position: relative; overflow: hidden; }
.cons::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--rouge); }
.cons.arrete { border-color: var(--rouge); background: var(--rouge-soft); }
.cons .cad { width: 50px; height: 50px; border-radius: 15px; background: var(--rouge-soft); color: var(--rouge); display: grid;
             place-items: center; flex: none; }
.cons.arrete .cad { background: var(--rouge); color: #fff; }
.cons .cad svg { width: 28px; height: 28px; }
.cons .t { font-weight: 700; font-size: 16px; }
.cons .s { color: var(--muted); font-size: 13px; }
.compte { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.compte span { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; background: var(--fond);
               padding: 3px 8px; border-radius: 8px; }
.compte svg { width: 14px; height: 14px; }

/* À moi */
.amoi { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--ambre-soft);
        border: 1px solid #f2dc9b; text-decoration: none; color: inherit; }
.amoi + .amoi { margin-top: 8px; }
.amoi .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--ambre); color: #fff; display: grid; place-items: center; flex: none; }
.amoi b { display: block; font-size: 15px; }
.amoi small { color: var(--ambre-fg); font-size: 13px; }

/* FAB + barre d'onglets */
.fab { position: fixed; right: max(16px, calc(50vw - 364px)); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30;
       height: 60px; padding: 0 22px 0 18px; border-radius: 30px; background: var(--orange); color: var(--navy); border: 0;
       font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; cursor: pointer;
       box-shadow: 0 10px 28px rgba(254,88,21,.35); }
.fab svg { width: 24px; height: 24px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
       border-top: 1px solid var(--ligne); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.nav-in { max-width: 760px; margin: 0 auto; display: flex; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; text-decoration: none;
         color: var(--muted-2); font-size: 12px; font-weight: 600; border-radius: 12px; }
.nav a svg { width: 23px; height: 23px; }
.nav a.on { color: var(--navy); }
.nav a.on svg { color: var(--orange-2); }

/* ---------------------------------------------------------------- Dossier : parcours en 5 phases */
.ident { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ident .tag { color: #fff; font-size: 15px; }
.ident .ind { background: var(--orange); color: var(--navy); }
.parcours { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 4px; position: relative; }
.parcours::before { content: ""; position: absolute; left: 10%; right: 10%; top: 21px; height: 3px; background: rgba(255,255,255,.15); border-radius: 2px; }
.ph { display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; border: 0; padding: 0; color: var(--navy-txt);
      cursor: pointer; position: relative; font-size: 11.5px; font-weight: 600; -webkit-tap-highlight-color: transparent; }
.ph .o { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-3);
         border: 2px solid rgba(255,255,255,.18); color: #c9d2f2; transition: transform .15s; }
.ph .o svg { width: 21px; height: 21px; }
.ph.fait .o { background: var(--vert); border-color: var(--vert); color: #fff; }
.ph.encours .o { background: var(--orange); border-color: #ffc896; color: var(--navy); box-shadow: 0 0 0 5px rgba(255,134,29,.25); }
.ph.ici { color: #fff; }
.ph.ici .o { transform: scale(1.1); outline: 2px solid #fff; outline-offset: 3px; }
.ph.rouge .o { background: var(--rouge); border-color: #ff9d94; color: #fff; }

.alerte { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 14.5px; margin-bottom: 10px; }
.alerte svg { margin-top: 1px; }
.alerte.ambre { background: var(--ambre-soft); color: var(--ambre-fg); border: 1px solid #f2dc9b; }
.alerte.rouge { background: var(--rouge-soft); color: var(--rouge-fg); border: 1px solid #f3c4bf; }
.alerte.bleu { background: var(--bleu-soft); color: #1d4ed8; border: 1px solid #c8d8ff; }
.alerte.vert { background: var(--vert-soft); color: var(--vert-fg); border: 1px solid #bfe6cf; }
.alerte b { display: block; }

/* Formulaires */
.champ { display: block; margin-top: 14px; }
.champ:first-child { margin-top: 0; }
.champ > span { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.champ > span em { font-style: normal; color: var(--orange-2); font-size: 12px; }
.in { width: 100%; min-height: 50px; border: 1.5px solid var(--ligne-2); border-radius: 13px; padding: 11px 13px; font-size: 16px;
      background: var(--surface); }
textarea.in { min-height: 82px; resize: vertical; line-height: 1.4; }
.in:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(0,26,112,.08); }
.in:disabled { background: var(--fond); color: var(--txt); border-style: dashed; }
.in.ko { border-color: #ffb880; background: var(--orange-soft); }
select.in { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6779' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
            background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 38px; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deux .champ { margin-top: 14px; }
.seg { display: inline-flex; background: var(--fond); border: 1.5px solid var(--ligne); border-radius: 14px; padding: 3px; gap: 3px; }
.seg button { min-height: 42px; padding: 0 14px; border: 0; border-radius: 11px; background: none; font-weight: 600; font-size: 14.5px;
              cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.seg button:disabled { cursor: default; }
.bascule { display: flex; align-items: center; gap: 12px; min-height: 50px; cursor: pointer; }
.bascule input { appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--ligne-2); position: relative;
                 cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.bascule input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
                        box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.bascule input:checked { background: var(--vert); }
.bascule input:checked::after { transform: translateX(20px); }
.bascule input:disabled { opacity: .5; }
.etat-enreg { font-size: 12.5px; color: var(--muted-2); text-align: right; min-height: 18px; margin: 6px 4px 0; }

/* Équipe : 4 rôles */
.equipe { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.role { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; border: 1.5px dashed var(--ligne-2);
        background: var(--surface); cursor: pointer; text-align: left; min-height: 64px; }
.role.plein { border-style: solid; border-color: var(--ligne); }
.role.ko { border-color: #ffb880; background: var(--orange-soft); }
.role:disabled { cursor: default; }
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff;
      font-weight: 700; font-size: 14px; flex: none; }
.av.libre { background: var(--fond); color: var(--muted-2); border: 1.5px dashed var(--ligne-2); }
.role small { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.role b { display: block; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Six pièces : anneaux */
.pieces { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.piece { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 6px 12px; border-radius: 18px; background: var(--surface);
         border: 1.5px solid var(--ligne); cursor: pointer; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.2;
         -webkit-tap-highlight-color: transparent; }
.piece:hover { border-color: var(--ligne-2); }
.piece.ici { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0,26,112,.08); }
.piece .rond { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange-2); }
.piece .rond svg { width: 23px; height: 23px; }
.piece.ok .rond { background: var(--vert-soft); color: var(--vert); }
.piece.non_requis .rond { background: var(--fond); color: var(--muted-2); }
.piece small { color: var(--muted-2); font-weight: 500; font-size: 11.5px; font-family: var(--mono); }
.piece .nb { color: var(--orange-fg); font-size: 11.5px; font-weight: 700; }

/* Manques */
.manques { list-style: none; margin: 8px 0 0; padding: 0; }
.manques li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; padding: 6px 0; border-top: 1px solid var(--ligne); }
.manques li:first-child { border-top: 0; }
.manques li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-top: 6px; flex: none; }

/* FdM */
.compteurs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.cpt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--vert-soft); color: var(--vert-fg); }
.cpt.ko { background: var(--orange-soft); color: var(--orange-fg); }
.cpt svg { width: 24px; height: 24px; }
.cpt b { font-size: 18px; font-family: var(--mono); }
.cpt small { display: block; font-size: 12px; opacity: .85; }
.ligne { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: start; padding: 10px 0; border-top: 1px solid var(--ligne); }
.ligne:first-of-type { border-top: 0; }
.ligne .num { width: 32px; height: 32px; border-radius: 10px; background: var(--fond); display: grid; place-items: center;
              font-family: var(--mono); font-weight: 600; font-size: 14px; margin-top: 8px; }
.ligne .num.cle { background: var(--ambre); color: #fff; }
.ligne .champs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ligne .champs .in { min-height: 44px; padding: 8px 11px; font-size: 15px; }
.ligne .champs .large { grid-column: 1 / -1; }
.ligne .outils { display: flex; flex-direction: column; gap: 4px; }
.legende { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13.5px; margin-top: 8px; }
.legende b { font-family: var(--mono); }
details.plier summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; padding: 6px 0; list-style: none; }
details.plier summary::-webkit-details-marker { display: none; }
details.plier summary::before { content: "▸ "; }
details.plier[open] summary::before { content: "▾ "; }

/* Blocs répétés (périmètres R1, phases R2, schémas) */
.bloc { border: 1.5px solid var(--ligne); border-radius: 16px; padding: 12px; margin-top: 10px; background: #fbfcfe; }
.bloc-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.ajout { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; margin-top: 10px;
         border: 1.5px dashed var(--ligne-2); border-radius: 14px; background: none; color: var(--navy); font-weight: 600; cursor: pointer; }
.ajout:hover { background: var(--surface); border-color: var(--navy); }

/* Validation : signatures */
.sigs { display: grid; gap: 0; }
.sig { display: grid; grid-template-columns: 44px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.sig:last-child { padding-bottom: 0; }
.sig::before { content: ""; position: absolute; left: 21px; top: 46px; bottom: 2px; width: 2px; background: var(--ligne); }
.sig:last-child::before { display: none; }
.sig .o { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--fond);
          color: var(--muted-2); border: 2px solid var(--ligne); }
.sig.fait .o { background: var(--vert); color: #fff; border-color: var(--vert); }
.sig.ici .o { background: var(--orange); color: var(--navy); border-color: var(--orange); }
.sig.fait::before { background: var(--vert); }
.sig small { color: var(--muted); font-size: 12.5px; display: block; }
.sig b { font-size: 15.5px; }
.empreinte { font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--fond); border-radius: 6px; padding: 1px 6px; }
.remarque { padding: 10px 12px; border-radius: 14px; background: var(--fond); margin-top: 8px; font-size: 14.5px; }
.remarque.ouverte { background: var(--orange-soft); border: 1px solid #ffd2ad; }
.remarque small { color: var(--muted); font-size: 12px; display: block; margin-bottom: 2px; }
.remarque .rep { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--ligne-2); color: var(--vert-fg); }
.grille { list-style: none; padding: 0; margin: 0; }
.grille li { border-top: 1px solid var(--ligne); }
.grille li:first-child { border-top: 0; }
.grille label { display: flex; gap: 12px; align-items: center; padding: 10px 2px; cursor: pointer; font-size: 14.5px; }
.grille input { appearance: none; width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--ligne-2); flex: none; margin: 0;
                cursor: pointer; display: grid; place-items: center; }
.grille input:checked { background: var(--vert); border-color: var(--vert); }
.grille input:checked::after { content: ""; width: 12px; height: 7px; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.grille .n { font-family: var(--mono); color: var(--muted-2); font-size: 13px; width: 20px; flex: none; }
.jauge { height: 8px; border-radius: 99px; background: var(--ligne); overflow: hidden; }
.jauge i { display: block; height: 100%; background: var(--vert); border-radius: 99px; transition: width .3s; }

/* Terrain : carte d'état */
.etat-cons { border-radius: 22px; padding: 18px; color: #fff; background: linear-gradient(135deg, #b4190f, var(--rouge)); position: relative; overflow: hidden; }
.etat-cons.vert { background: linear-gradient(135deg, #0d6139, var(--vert)); }
.etat-cons.violet { background: linear-gradient(135deg, #3c2a85, var(--violet)); }
.etat-cons .gros { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.etat-cons .gros svg { width: 30px; height: 30px; }
.etat-cons p { margin: 6px 0 0; opacity: .9; font-size: 14.5px; }
.etat-cons .compte span { background: rgba(255,255,255,.18); color: #fff; }
.prog { height: 10px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; margin-top: 12px; }
.prog i { display: block; height: 100%; background: #fff; border-radius: 99px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--ligne); }
.doc:first-child { border-top: 0; }
.doc .code { font-family: var(--mono); font-weight: 600; background: var(--navy); color: #fff; border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.doc.rendu .code { background: var(--vert); }
.coche-l { display: flex; flex-direction: column; gap: 6px; }
.verif { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 8px 0; }
.verif .o { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--orange-soft); color: var(--orange-2); }
.verif.ok .o { background: var(--vert-soft); color: var(--vert); }
.verif .o svg { width: 16px; height: 16px; }
.pjb-q { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; margin-top: 12px; }
.pjb-q .n { width: 34px; height: 34px; border-radius: 11px; background: var(--navy); color: #fff; display: grid; place-items: center;
            font-weight: 700; font-family: var(--mono); margin-top: 22px; }

/* Barre d'action (prochaine étape) */
.action { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
          background: linear-gradient(to top, var(--fond) 70%, rgba(243,245,249,0)); }
.action-in { max-width: 760px; margin: 0 auto; display: flex; gap: 8px; }
.action .btn { min-height: 58px; font-size: 17px; border-radius: 18px; box-shadow: 0 8px 22px rgba(0,26,112,.22); }
.action .btn.grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.action .btn.ghost { box-shadow: none; }

/* ---------------------------------------------------------------- Fenêtres */
dialog { border: 0; border-radius: 24px; padding: 0; width: min(94vw, 520px); max-height: 88vh; box-shadow: 0 30px 80px rgba(0,0,0,.35); color: var(--txt); }
dialog::backdrop { background: rgba(0,10,40,.55); }
.dlg-in { padding: 20px; display: flex; flex-direction: column; gap: 12px; max-height: 88vh; }
.dlg-in h2 { margin: 0; font-size: 20px; }
.dlg-corps { overflow-y: auto; margin: 0 -20px; padding: 0 20px; }
.dlg-pied { display: flex; gap: 8px; }
.dlg-pied .btn { flex: 1; }
.pers { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 6px; border: 0; border-top: 1px solid var(--ligne);
        background: none; cursor: pointer; text-align: left; }
.pers:hover { background: var(--fond); }
.pers b { display: block; font-size: 15px; }
.pers small { font-size: 12.5px; color: var(--muted); }
.hab { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.hab.ok { background: var(--vert-soft); color: var(--vert-fg); }
.hab.ko { background: var(--orange-soft); color: var(--orange-fg); }
.hab.att { background: var(--ambre-soft); color: var(--ambre-fg); }
.amgt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.amgt button { min-height: 92px; border-radius: 18px; border: 0; color: #fff; background: var(--c); cursor: pointer; text-align: left;
               padding: 14px; display: flex; flex-direction: column; justify-content: space-between; font-weight: 700; font-size: 16px; }
.amgt button span { font-family: var(--mono); font-size: 13px; opacity: .85; }
.type-l { display: flex; flex-direction: column; gap: 8px; }
.type-b { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1.5px solid var(--ligne);
          background: var(--surface); cursor: pointer; text-align: left; }
.type-b:hover { border-color: var(--navy); }
.type-b .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; flex: none; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
         pointer-events: none; background: #0e1525; color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14.5px; z-index: 80;
         max-width: min(92vw, 460px); text-align: center; transition: opacity .2s, transform .2s; box-shadow: 0 12px 30px rgba(0,0,0,.3); }
#toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast.err { background: var(--rouge); }
#toast button { background: none; border: 0; color: #ffb672; font-weight: 700; margin-left: 10px; cursor: pointer; }

/* Pilotage */
.kgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kcard { background: var(--surface); border: 1px solid var(--ligne); border-radius: 18px; padding: 14px; box-shadow: var(--ombre); }
.kcard b { font-size: 30px; line-height: 1.05; display: block; font-weight: 700; letter-spacing: -.02em; }
.kcard span { color: var(--muted); font-size: 13.5px; }
.kcard.vert b { color: var(--vert); } .kcard.rouge b { color: var(--rouge); } .kcard.ambre b { color: var(--ambre-fg); }
.barres { display: grid; gap: 7px; }
.barre { display: grid; grid-template-columns: 150px 1fr 34px; gap: 10px; align-items: center; font-size: 13.5px; }
.barre .j { height: 12px; border-radius: 6px; background: var(--fond); overflow: hidden; }
.barre .j i { display: block; height: 100%; border-radius: 6px; background: var(--navy-2); }
.barre b { text-align: right; font-family: var(--mono); }
.nota { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* =====================================================================
   MODE TERRAIN — plein écran, noir, très lisible, rien d'autre à l'écran
   ===================================================================== */
#terrain { position: fixed; inset: 0; z-index: 60; background: #05070d; color: #fff; display: flex; flex-direction: column;
           padding: calc(10px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom)); overflow-y: auto; }
.tr-h { display: flex; align-items: center; gap: 10px; max-width: 680px; width: 100%; margin: 0 auto; }
.tr-h .quitter { min-height: 48px; padding: 0 14px; border-radius: 14px; background: #161b28; border: 1px solid #2a3142; color: #c8cfdf;
                 font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tr-h .titre { flex: 1; min-width: 0; }
.tr-h .titre b { display: block; font-size: 13px; letter-spacing: .14em; color: #ff9d94; }
.tr-h .titre b.d { color: #7ee2a8; }
.tr-h .titre span { font-family: var(--mono); font-size: 14px; color: #aab3c7; }
.tr-ver { font-family: var(--mono); font-size: 12px; padding: 5px 9px; border-radius: 10px; background: #0f2a1c; color: #7ee2a8; white-space: nowrap; }
.tr-ver.ko { background: #3a0f0b; color: #ff9d94; }
.tr-prog { max-width: 680px; width: 100%; margin: 12px auto 0; display: flex; gap: 3px; }
.tr-prog b { flex: 1; height: 8px; border-radius: 4px; background: #222838; }
.tr-prog b.f { background: #2fbf71; } .tr-prog b.c { background: var(--orange); }
.tr-corps { flex: 1; max-width: 680px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 18px 0; }
.tr-prec { font-size: 15px; color: #8a93a5; display: flex; align-items: center; gap: 8px; }
.tr-prec svg { color: #2fbf71; }
.tr-prec button { margin-left: auto; background: none; border: 1px solid #2a3142; color: #c8cfdf; border-radius: 10px; min-height: 40px; padding: 0 12px; cursor: pointer; }
.tr-carte { background: #10141f; border: 2px solid #262d3f; border-radius: 26px; padding: 22px 20px; }
.tr-carte.cle { border-color: var(--ambre); box-shadow: 0 0 0 4px rgba(232,162,0,.18); }
.tr-n { font-family: var(--mono); font-size: 16px; color: #8a93a5; display: flex; align-items: center; gap: 10px; }
.tr-cle { background: var(--ambre); color: #1a1200; font-family: var(--font); font-weight: 700; font-size: 13px; letter-spacing: .08em; padding: 4px 10px; border-radius: 8px; }
.tr-organe { font-size: clamp(34px, 9vw, 54px); font-weight: 700; line-height: 1.05; margin: 10px 0 14px; overflow-wrap: anywhere; letter-spacing: -.01em; }
.tr-op { display: flex; align-items: center; gap: 12px; font-size: clamp(22px, 5.5vw, 30px); font-weight: 600; }
.tr-op .code { font-family: var(--mono); background: #fff; color: #05070d; border-radius: 12px; padding: 4px 12px; font-size: .85em; }
.tr-etat { margin-top: 10px; font-size: 19px; color: #c8cfdf; }
.tr-suiv { font-size: 15px; color: #6b7487; }
.tr-pied { max-width: 680px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.tenir { position: relative; overflow: hidden; width: 100%; min-height: 92px; border-radius: 24px; border: 0; background: #2fbf71; color: #04210f;
         font-size: 24px; font-weight: 700; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; -webkit-touch-callout: none; }
.tenir > span { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 12px; }
.tenir > span svg { width: 30px; height: 30px; }
.tenir .tx { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.tenir small { display: block; font-size: 14px; font-weight: 600; opacity: .75; }
.tenir::before { content: ""; position: absolute; inset: 0; background: #7ff0ae; transform: scaleX(var(--p, 0)); transform-origin: left; }
.tenir.d { background: #3b82f6; color: #fff; } .tenir.d::before { background: #93c5fd; }
.tr-b2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tr-b2 button { min-height: 64px; border-radius: 18px; font-size: 18px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tr-pause { background: #2a2210; border: 2px solid var(--ambre); color: #ffd166; }
.tr-arret { background: #3a0f0b; border: 2px solid var(--rouge); color: #ff9d94; }
.tr-reseau { text-align: center; font-size: 13.5px; color: #ffd166; }
.tr-fin { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tr-fin .rond { width: 110px; height: 110px; border-radius: 50%; background: #2fbf71; color: #04210f; display: grid; place-items: center; }
.tr-fin .rond svg { width: 60px; height: 60px; }
.tr-fin h2 { font-size: 30px; margin: 0; }
.minute { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.minute svg { width: 200px; height: 200px; }
.minute .s { font-size: 54px; font-weight: 700; font-family: var(--mono); }
.minute p { margin: 0; font-size: 19px; color: #c8cfdf; max-width: 420px; }
.minute .der { background: #10141f; border: 2px solid #262d3f; border-radius: 20px; padding: 16px 18px; width: 100%; text-align: left; }
.minute .der small { color: #8a93a5; font-size: 14px; }
.minute .der b { display: block; font-size: 24px; margin-top: 4px; }
.tr-sans { font-size: 20px; color: #c8cfdf; text-align: center; line-height: 1.5; }

/* ---------------------------------------------------------------- Impression : le dossier papier (mode dégradé) */
#print { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; color: #000; font-size: 10.5pt; font-family: var(--font); }
  #print h1 { font-size: 17pt; margin: 0 0 2mm; color: #001a70; }
  #print h2 { font-size: 12.5pt; margin: 6mm 0 2mm; color: #001a70; border-bottom: 1.5pt solid #ff861d; padding-bottom: 1mm; }
  #print table { width: 100%; border-collapse: collapse; margin-top: 2mm; page-break-inside: auto; }
  #print th, #print td { border: .6pt solid #777; padding: 1.6mm 2mm; text-align: left; vertical-align: top; }
  #print th { background: #e9edf6; font-size: 9.5pt; }
  #print tr { page-break-inside: avoid; }
  #print .case { width: 12mm; }
  #print .entete { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2pt solid #001a70; padding-bottom: 3mm; }
  #print .pg { page-break-before: always; }
  #print .sign { height: 14mm; }
  #print .pied { margin-top: 5mm; font-size: 8.5pt; color: #555; }
}

@media (min-width: 720px) {
  .wrap { padding-top: 22px; }
  .kgrid { grid-template-columns: repeat(4, 1fr); }
  .equipe { grid-template-columns: repeat(4, 1fr); }
  .pieces { grid-template-columns: repeat(6, 1fr); }
  .ph { font-size: 13px; }
}
@media (max-width: 380px) {
  .deux { grid-template-columns: 1fr; }
  .ligne .champs { grid-template-columns: 1fr; }
  .barre { grid-template-columns: 110px 1fr 30px; }
}
@media (prefers-reduced-motion: reduce) { .pill.arrete { animation: none; } }

/* Déconsignation en miroir : lignes générées, non saisies */
.ligne.miroir .mir { padding: 9px 2px; font-size: 14.5px; }
.ligne.miroir .mir b { font-family: ui-monospace, monospace; margin-right: 4px; }
