/* Ajouts du prototype ERP (direction « Tour de contrôle », décision du 24/11/2026) */
.lgrp { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 14px 0 6px; }
.lgrp:first-child { margin-top: 4px; }
.profiles { margin: 0; }
.prof .av { width: 34px; height: 34px; font-size: 12px; }

.chipb.net { gap: 8px; }
.chipb.net i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); display: inline-block; }
.chipb.net.off { background: var(--err-bg); color: var(--err); border-color: #E9B4AE; }
.chipb.net.off i { background: var(--err); }
.chipb.sup { background: var(--acc); border-color: var(--acc-2); color: var(--acc-ink); font-weight: 700; }
@media (max-width: 900px) { .chipb.sup span, .chipb.net span { display: none; } }

/* Frise et compte à rebours */
.cd { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; font-weight: 700; font-size: 13px; background: var(--blue-soft); color: var(--night); }
.cd.late { background: var(--err-bg); color: var(--err); }
.tl li .who2 { font-size: 12.5px; color: var(--ink-3); }
@keyframes pulseIn { from { opacity: .3; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* Colonnes par étape */
.kb { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.kb .colk { background: var(--bg-2); border-radius: 10px; padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 120px; }
.kb .colk h4 { margin: 0; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); display: flex; justify-content: space-between; gap: 6px; }
.kc { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; text-align: left; display: grid; gap: 4px; font-size: 13.5px; }
.kc:hover { border-color: var(--night-3); }
.kc b { font-weight: 700; }
.kc small { color: var(--ink-3); font-size: 12.5px; }
.kc.stop { border-color: #E9B4AE; background: #FFF8F7; }
.kc.wait { border-color: #E6C77A; background: #FFFBF0; }

/* Petite carte par lieu */
.places { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; position: relative; }
.places > div { background: var(--bg); border-radius: 10px; padding: 12px; text-align: center; position: relative; }
.places > div:not(:last-child)::after { content: "→"; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 700; }
.places b { display: block; font: 600 34px/1 var(--cond); color: var(--night); }
.places small { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
@media (max-width: 520px) { .places { grid-template-columns: 1fr 1fr; } .places > div::after { display: none; } }

/* Messagerie */
.chat { display: grid; grid-template-columns: 230px 1fr; gap: 14px; min-height: 420px; }
.chat .chans { display: grid; gap: 4px; align-content: start; }
.chat .chans button { text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.chat .chans button[aria-current] { background: var(--blue-soft); color: var(--night); }
.bub { max-width: 78%; background: var(--bg); border-radius: 12px 12px 12px 4px; padding: 8px 12px; }
.bub.me { margin-left: auto; background: var(--blue-soft); border-radius: 12px 12px 4px 12px; }
.bub small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.thread { display: grid; gap: 8px; align-content: start; max-height: 52vh; overflow: auto; padding: 4px; }
.compose { display: flex; gap: 8px; margin-top: 10px; }
.compose input { flex: 1; min-height: 44px; border: 1.5px solid var(--line); border-radius: 8px; padding: 0 12px; }
@media (max-width: 760px) { .chat { grid-template-columns: 1fr; } .chat .chans { grid-auto-flow: column; overflow-x: auto; } }

/* Matrice des droits */
.mxr { overflow-x: auto; }
.mxr table { min-width: 760px; }
.mxr td.c, .mxr th.c { text-align: center; }
.tg { width: 34px; height: 22px; border-radius: 11px; border: 0; background: var(--line); position: relative; }
.tg::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.tg[aria-pressed="true"] { background: var(--ok); }
.tg[aria-pressed="true"]::after { left: 15px; }
.tg.base { background: var(--night-3); opacity: .55; cursor: default; }
.tg.base::after { left: 15px; }

/* Module prévu (option) */
.opt-mod { border: 2px dashed var(--line); background: repeating-linear-gradient(45deg, #fff, #fff 12px, var(--bg) 12px, var(--bg) 24px); }
.opt-mod ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-3); }

/* Passeur : cartes mobiles */
.mis { display: grid; gap: 12px; }
.mis .card { display: grid; gap: 10px; }
.mis .card.done { opacity: .6; }
.mis h3 { margin: 0; font: 600 22px/1.15 var(--cond); text-transform: uppercase; }
.mis .btn { min-height: 52px; font-size: 16px; }

/* Tour de contrôle (mural) */
#wall { position: fixed; inset: 0; z-index: 120; background: #060B45; color: #fff; padding: 28px 34px; display: grid; grid-template-rows: auto auto 1fr; gap: 22px; overflow: auto; }
#wall h1 { font: 600 40px/1 var(--cond); text-transform: uppercase; margin: 0; letter-spacing: .02em; }
#wall .wtop { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
#wall .wk { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
#wall .wk div { background: rgba(255, 255, 255, .07); border-radius: 14px; padding: 18px 20px; }
#wall .wk div.red b { color: #FF9D94; }
#wall .wk b { display: block; font: 600 76px/1 var(--cond); }
#wall .wk small { color: #C3C9EE; font-size: 16px; font-weight: 600; }
#wall .wb { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
#wall .wcard { background: rgba(255, 255, 255, .06); border-radius: 14px; padding: 16px 18px; }
#wall .wcard h2 { margin: 0 0 10px; font: 600 22px var(--cond); text-transform: uppercase; color: #F6C04D; }
#wall .wrow { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 17px; }
#wall .places > div { background: rgba(255, 255, 255, .08); }
#wall .places b { color: #fff; font-size: 52px; }
#wall .places small { color: #C3C9EE; font-size: 15px; }
@media (max-width: 900px) { #wall .wk, #wall .wb { grid-template-columns: 1fr 1fr; } #wall .wb { grid-template-columns: 1fr; } }

.badge2 { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 5px; font-size: 12px; font-weight: 700; background: var(--acc-soft); color: var(--acc-ink); }
.rowb { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.why { font-size: 13px; color: var(--ink-3); }
#wall > *, #wall .wb > * { min-width: 0; }
@media (max-width: 700px) { #wall { padding: 18px 16px; } #wall h1 { font-size: 28px; } #wall .wk b { font-size: 54px; } #wall .wrow { grid-template-columns: 1fr auto; } #wall .wrow span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-size: 15px; color: #C3C9EE; } }

/* Document à imprimer ou à enregistrer en PDF (documents pré-remplis, rapport d'activité) */
#printDoc { background: #fff; color: #111; padding: 14mm 16mm; font: 400 11pt/1.5 var(--sans); max-width: 210mm; margin: 0 auto; }
#printDoc header { display: flex; justify-content: space-between; gap: 12mm; padding-bottom: 5mm; margin-bottom: 7mm; border-bottom: .5mm solid var(--night); }
#printDoc header b { display: block; font: 600 16pt/1.1 var(--cond); text-transform: uppercase; color: var(--night); }
#printDoc header span { font-size: 9pt; color: #444; }
#printDoc header .pr { text-align: right; }
#printDoc table { width: 100%; border-collapse: collapse; margin: 3mm 0 6mm; }
#printDoc th, #printDoc td { border: .2mm solid #BBB; padding: 2mm 3mm; text-align: left; vertical-align: top; font-size: 10pt; text-transform: none; letter-spacing: 0; color: #111; }
#printDoc th { background: #F2F4F8; font-weight: 600; }
#printDoc .kvp th { width: 32%; }
#printDoc h3 { font: 600 12pt var(--cond); text-transform: uppercase; margin: 5mm 0 0; }
#printDoc .sign { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8mm; margin-top: 14mm; font-size: 10pt; }
#printDoc .sign div { border-top: .2mm solid #888; padding-top: 2mm; min-height: 22mm; }
#printDoc footer { margin-top: 10mm; font-size: 8pt; color: #666; }
@media print {
  @page { size: A4; margin: 0; }
  body.printing > *:not(#printDoc) { display: none !important; }
  body.printing #printDoc { display: block !important; }
  body.printing { background: #fff; }
}

/* ---------- Fluidité (chantier 34, 24/11/2026) ---------- */
:root { --ease: cubic-bezier(.2, .7, .2, 1); --lift: 0 1px 2px rgba(26, 43, 60, .05), 0 10px 26px -18px rgba(26, 43, 60, .28); }
html { scroll-behavior: smooth; }

/* Surfaces plus souples : ombre légère, angles plus doux */
.card, .kpi { border-radius: 14px; border-color: var(--line-2); box-shadow: var(--lift); }
.kpi.hl { box-shadow: var(--lift); }

/* Entrée en cascade, seulement quand on change d'écran */
@keyframes enterUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#view.enter .hello, #view.enter .kpi, #view.enter .card, #view.enter .tabs, #view.enter .filters, #view.enter .mis > * { animation: enterUp .42s var(--ease) both; }
#view.enter .kpi:nth-child(2) { animation-delay: .04s; } #view.enter .kpi:nth-child(3) { animation-delay: .08s; } #view.enter .kpi:nth-child(4) { animation-delay: .12s; }
#view.enter .grid .col:nth-child(1) .card:nth-child(1) { animation-delay: .1s; } #view.enter .grid .col:nth-child(1) .card:nth-child(2) { animation-delay: .16s; }
#view.enter .grid .col:nth-child(2) .card:nth-child(1) { animation-delay: .14s; } #view.enter .grid .col:nth-child(2) .card:nth-child(2) { animation-delay: .2s; } #view.enter .grid .col:nth-child(2) .card:nth-child(3) { animation-delay: .26s; }
#view.enter .mis > *:nth-child(2) { animation-delay: .06s; } #view.enter .mis > *:nth-child(3) { animation-delay: .12s; }

/* Retours au survol et au clic */
.btn, .kc, .li, .prof, #nav button, .tabs button, .chipb, .iconb, .tg, .chat .chans button { transition: transform .16s var(--ease), background-color .16s ease, border-color .16s ease, box-shadow .2s ease, color .16s ease; }
.btn:active, .chipb:active, .iconb:active, .prof:active { transform: scale(.97); }
button.kpi { transition: transform .2s var(--ease), box-shadow .2s ease; }
button.kpi:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(26, 43, 60, .06), 0 18px 34px -20px rgba(26, 43, 60, .4); }
button.kpi:active { transform: translateY(0) scale(.99); }
.kc:hover { transform: translateY(-1px); box-shadow: var(--lift); }
button.li { border-radius: 8px; padding-left: 6px; padding-right: 6px; margin: 0 -6px; width: calc(100% + 12px); }
button.li:hover { background: var(--bg); }
tr.click td { transition: background-color .14s ease; }

/* Fiche dossier : ouverture, changement d'onglet, étape validée */
#drawer { transition: transform .34s var(--ease), visibility .34s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#dScrim:not(.hide), #scrim:not(.hide) { animation: fadeIn .22s ease both; }
#drawer.swap .sec:nth-child(3) > :last-child { animation: enterUp .28s var(--ease) both; }
@keyframes stepIn { 0% { transform: scale(.5); opacity: .2; } 60% { transform: scale(1.25); } 100% { transform: scale(1); opacity: 1; } }
#drawer.adv .tl li.now i, #drawer.adv .tl li.stop i { animation: stepIn .5s var(--ease) both; }
#drawer.adv .tl li.now span, #drawer.adv .dh .rowb { animation: enterUp .4s var(--ease) both; }
.tl li::before { transition: background-color .3s ease; }

/* Modale, notifications, messages */
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
dialog.modal[open] { animation: pop .22s var(--ease) both; }
dialog.modal::backdrop { animation: fadeIn .2s ease both; }
.notif:not(.hide), .gres:not(.hide) { animation: pop .16s var(--ease) both; }
.thread .bub:last-child { animation: enterUp .25s var(--ease) both; }
.toast { transition: transform .38s var(--ease), visibility .38s; }
.bar i { transition: width .5s var(--ease); }
.chipb.net i { transition: background-color .3s ease; }
.chipb.net:not(.off) i { box-shadow: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Saisie par étape (lot 7) */
.fsteps { display: grid; gap: 12px; }
.fstep { padding: 14px 16px; box-shadow: none; }
.fstep .ch { margin-bottom: 8px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.fgrid .field b { font-weight: 600; min-height: 22px; }
.fgrid .field b.muted { color: var(--ink-3); font-weight: 500; }
.field .req { font-size: 11.5px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
@media (max-width: 560px) { .fgrid { grid-template-columns: 1fr; } }

/* Bandeau « Prototype » retiré à la demande d'Habib (24/11) : plus de décalage en haut de page */
:root { --rib: 0px; }

/* ---------- Page de connexion épurée (24/11, validée par Habib) : identifiants, version, support ---------- */
#login { display: block; background: var(--bg); min-height: 100dvh; }
.lg2 { min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 32px 16px 18px; }
.lg2-card { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--lift); padding: 32px 30px 26px; display: grid; gap: 14px; }
.lg2-logo { width: 210px; height: auto; margin: 0 auto 6px; display: block; }
.lg2-card h1 { font: 600 22px/1.1 var(--cond); text-transform: uppercase; letter-spacing: .04em; margin: 0; text-align: center; color: var(--ink-2); }
.lg2-card .field { margin: 0; }
.lg2-card .btn[type=submit] { width: 100%; min-height: 50px; font-size: 16px; }
.lg2-card .serr { margin: -4px 0; min-height: 0; }
.lg2-card .serr:empty { display: none; }
.lg2-help { margin: 0; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.pw { position: relative; }
.pw input { width: 100%; padding-right: 48px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: var(--ink-3); display: grid; place-items: center; }
.pw-eye[aria-pressed="true"] { color: var(--night); background: var(--blue-soft); }
.lnk2 { border: 0; background: none; padding: 4px 0; color: var(--night-3); font-weight: 600; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; width: 100%; }
#lgProfiles { margin-top: 8px; max-height: 46vh; overflow: auto; }
.lg2-foot { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; padding-top: 18px; }
/* Vrai logo d'EPS (elsapremium.com, accord d'Habib du 24/11) : emblème dans le menu */
.logo { background: #fff url(assets/embleme.png) center / 78% no-repeat; border-color: rgba(255, 255, 255, .6); }
.logo::before { content: none; }

/* Accès web (audit p. 24) et version, en bas du menu */
.webl { display: grid; gap: 2px; margin-bottom: 8px; }
.webl a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #D5D9F4; text-decoration: none; font-size: 14px; font-weight: 500; }
.webl a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side .ver { color: #8F97D6; font-size: 11.5px; padding: 10px 10px 0; }

/* Page de connexion : le bouton Support garde son texte sur petit écran */
.lg2-foot .chipb.sup span { display: inline; }

/* ---------- Page de connexion immersive (24/11, V.1.2) ---------- */
.lg3 { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(380px, .88fr); }
.lg3-art { position: relative; overflow: hidden; color: #fff; padding: 36px 44px 30px; display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 18px;
  background: radial-gradient(120% 90% at 20% 110%, #1B2AA8 0%, rgba(27, 42, 168, 0) 55%), linear-gradient(160deg, #0C177B 0%, #060B45 70%); }
.lg3-brand { display: flex; align-items: center; gap: 12px; }
.lg3-brand img { width: 44px; height: 44px; }
.lg3-brand b { display: block; font: 600 20px/1.05 var(--cond); text-transform: uppercase; letter-spacing: .05em; }
.lg3-brand small { color: #AEB5E8; font-size: 12.5px; }
.lg3-kicker { margin: 0 0 10px; color: #F6C04D; font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.lg3-hero h2 { margin: 0; font: 600 clamp(40px, 4.6vw, 68px)/.98 var(--cond); text-transform: uppercase; letter-spacing: .005em; }
.lg3-sub { margin: 14px 0 0; max-width: 470px; color: #D5D9F4; font-size: 16.5px; line-height: 1.5; }
.lg3-map { width: 100%; max-height: 44vh; align-self: center; overflow: visible; }
.lg3-map .grid line { stroke: rgba(255, 255, 255, .05); stroke-width: 1; }
.lg3-map .ocean { fill: rgba(174, 181, 232, .45); font: 600 11px var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.lg3-map .rt { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 1.6; }
.lg3-map .rt.sea { stroke-dasharray: 2 6; }
.lg3-map .flow { fill: none; stroke: #F0A91B; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 26 400; animation: flow var(--t) linear infinite; opacity: .9; }
@keyframes flow { from { stroke-dashoffset: 426; } to { stroke-dashoffset: 0; } }
.lg3-map .box rect { fill: #F6C04D; stroke: #060B45; stroke-width: 1; }
.lg3-map .nd .dot { fill: #fff; }
.lg3-map .nd.hub .dot { fill: #F6C04D; }
.lg3-map .nd .ring { fill: none; stroke: #F6C04D; stroke-width: 1.5; transform-origin: 0 0; animation: ring 2.8s ease-out infinite; }
@keyframes ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
.lg3-map text { fill: #fff; font: 600 13px var(--sans); }
.lg3-map text .s { fill: #AEB5E8; font-size: 11px; font-weight: 500; }
.lg3-map .nd.hub text .n { font-size: 15px; font-weight: 700; }
.lg3-facts { list-style: none; margin: 0; padding: 18px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; border-top: 1px solid rgba(255, 255, 255, .14); }
.lg3-facts b { display: block; font: 600 34px/1 var(--cond); color: #fff; }
.lg3-facts span { color: #AEB5E8; font-size: 13px; }
.lg3-sign { display: inline-flex; align-items: center; gap: 10px; color: #8F97D6; font-size: 12px; text-decoration: none; justify-self: start; opacity: .85; transition: opacity .2s ease; }
.lg3-sign:hover { opacity: 1; }
.lg3-sign img { width: 112px; height: auto; }
.lg3-main { display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 32px 20px 18px; background: var(--bg); }
.lg3-main .lg2-card { width: min(410px, 100%); padding: 34px 32px 28px; gap: 16px; }
.lg3-main .lg2-logo { width: 190px; margin-bottom: 2px; }
.lg3-hello h1 { margin: 0; font: 600 30px/1.05 var(--cond); text-transform: uppercase; letter-spacing: .02em; color: var(--ink); text-align: left; }
.lg3-hello p { margin: 4px 0 0; color: var(--ink-3); font-size: 14.5px; }
.lg3-main .btn[type=submit] { gap: 10px; }
.lg3-main .btn[type=submit] svg { transition: transform .2s var(--ease); }
.lg3-main .btn[type=submit]:hover svg { transform: translate(2px, -2px); }
.lg3-main .field input:focus { box-shadow: 0 0 0 3px var(--blue-soft); }
.lg3-main .lg2-foot { padding-top: 14px; }
@keyframes lgIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.lg3-main .lg2-card { animation: lgIn .55s var(--ease) both; }
.lg3-hero, .lg3-map, .lg3-facts { animation: lgIn .7s var(--ease) both; }
.lg3-map { animation-delay: .12s; } .lg3-facts { animation-delay: .22s; }
@media (max-width: 980px) {
  .lg3 { grid-template-columns: 1fr; }
  .lg3-art { padding: 22px 20px 20px; grid-template-rows: auto auto auto; gap: 14px; }
  .lg3-hero h2 { font-size: 34px; }
  .lg3-sub, .lg3-map, .lg3-facts { display: none; }
  .lg3-sign { order: 9; }
  .lg3-main { padding: 22px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) { .lg3-map .flow, .lg3-map .ring, .lg3-map .box { display: none; } }
/* le panneau tient dans la hauteur de l'écran : la carte prend la place qui reste */
@media (min-width: 981px) {
  .lg3 { height: 100dvh; min-height: 640px; }
  .lg3-art { height: 100%; grid-template-rows: auto auto minmax(0, 1fr) auto auto; padding: 30px 44px 24px; gap: 16px; }
  .lg3-hero h2 { font-size: clamp(36px, min(4.2vw, 6.4vh), 64px); }
  .lg3-map { height: 100%; max-height: none; min-height: 0; }
  .lg3-main { overflow: auto; }
}

/* Repères chiffrés retirés (Habib, 25/11) : la carte reprend la place */
@media (min-width: 981px) { .lg3-art { grid-template-rows: auto auto minmax(0, 1fr) auto; } }
