/* SDGCept analyses — « la console de mixage de tes applis »
   Fond ardoise bleu nuit, cadrans ivoire rétroéclairés, vumètres à LED. */

/* Polices hébergées ici (pas de Google Fonts : aucune adresse IP ne part chez Google). Licence OFL. */
@font-face { font-family: 'Chakra Petch'; font-weight: 500; font-style: normal; font-display: swap; src: url('/static/polices/chakra-petch-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-weight: 600; font-style: normal; font-display: swap; src: url('/static/polices/chakra-petch-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-weight: 700; font-style: normal; font-display: swap; src: url('/static/polices/chakra-petch-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 400; font-style: normal; font-display: swap; src: url('/static/polices/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-style: normal; font-display: swap; src: url('/static/polices/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-style: normal; font-display: swap; src: url('/static/polices/barlow-latin-600-normal.woff2') format('woff2'); }

:root {
  --fond: #0b111b;
  --fond2: #0f1724;
  --panneau: #141d2b;
  --panneau-haut: #1a2537;
  --bord: #26344a;
  --bord-clair: #33465f;
  --texte: #e8edf5;
  --texte2: #a9b8cc;
  --muet: #6f8098;
  --ivoire: #f6e8c0;
  --ivoire-ombre: #d9c48c;
  --encre: #2a2116;
  --vert: #35d07f;
  --orange: #ffb020;
  --rouge: #ff4d4d;
  --bleu: #4fc3ff;
  --led-off: #1d2838;
  --rayon: 14px;
  --titre: 'Chakra Petch', 'Barlow', system-ui, sans-serif;
  --corps: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, #16243a 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #1a1f33 0%, transparent 55%),
    var(--fond);
  color: var(--texte);
  font: 15px/1.45 var(--corps);
  -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.visuel-masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; border-radius: 6px; }

.console { max-width: 1440px; margin: 0 auto; padding: 14px 18px 40px; }

/* ---------------- Barre du haut ---------------- */
.barre {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px;
  background: linear-gradient(180deg, #1b2639, #131c2a);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 30px rgba(0,0,0,.35);
}
.marque { display: flex; align-items: center; gap: 10px; font-family: var(--titre); font-size: 18px; letter-spacing: .02em; color: var(--ivoire); margin-right: auto; }
.marque svg { width: 30px; height: 30px; color: var(--ivoire); }
.marque b { color: var(--texte); font-weight: 600; }
.aiguille-logo { transform-origin: 16px 24px; animation: logo 6s ease-in-out infinite; }
@keyframes logo { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }

.canal select {
  appearance: none; -webkit-appearance: none;
  background: #0d1420 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a9b8cc' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center / 11px;
  border: 1px solid var(--bord-clair); border-radius: 10px;
  padding: 8px 34px 8px 12px; font-family: var(--titre); font-weight: 600; letter-spacing: .03em;
  min-height: 40px;
}
.periodes { display: flex; background: #0d1420; border: 1px solid var(--bord-clair); border-radius: 10px; padding: 3px; }
.periodes button {
  border: 0; background: none; padding: 6px 12px; border-radius: 7px; color: var(--texte2);
  font-family: var(--titre); font-size: 13px; letter-spacing: .04em; min-height: 32px;
}
.periodes button[aria-checked="true"] { background: linear-gradient(180deg, #2b3b55, #223049); color: var(--texte); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }

.direct { display: flex; align-items: center; gap: 8px; font-family: var(--titre); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--texte2); }
.direct i { width: 10px; height: 10px; border-radius: 50%; background: var(--muet); }
.direct.on i { background: var(--vert); box-shadow: 0 0 10px var(--vert); animation: pouls 2s ease-in-out infinite; }
.direct.off i { background: var(--rouge); box-shadow: 0 0 10px var(--rouge); }
@keyframes pouls { 50% { opacity: .35; } }

.cloche { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--bord-clair); background: #0d1420; display: grid; place-items: center; }
.cloche svg { width: 20px; height: 20px; fill: none; stroke: var(--texte2); stroke-width: 1.8; stroke-linejoin: round; }
.cloche b { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--rouge); color: #fff; font: 600 12px/20px var(--titre); text-align: center; box-shadow: 0 0 10px rgba(255,77,77,.6); }

/* ---------------- Onglets ---------------- */
.onglets { display: flex; gap: 4px; margin: 16px 0 14px; border-bottom: 1px solid var(--bord); overflow-x: auto; scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglets button {
  border: 0; background: none; padding: 10px 16px 12px; color: var(--muet); white-space: nowrap;
  font-family: var(--titre); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.onglets button[aria-selected="true"] { color: var(--ivoire); border-bottom-color: var(--ivoire); text-shadow: 0 0 12px rgba(246,232,192,.35); }
.onglets button:hover { color: var(--texte); }

/* ---------------- Pages & modules ---------------- */
.page { display: none; }
.page.actif { display: grid; gap: 14px; }
#cockpit {
  grid-template-columns: minmax(250px, 300px) 1fr minmax(260px, 330px);
  grid-template-areas: "master cadrans rack" "chemin chemin chemin" "activite activite activite";
}
#cockpit .master { grid-area: master; }
#cockpit .cadrans { grid-area: cadrans; }
#cockpit .rack { grid-area: rack; }
#cockpit .chemin { grid-area: chemin; }
#cockpit .activite { grid-area: activite; }
#details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.module.large { grid-column: 1 / -1; }

.module {
  position: relative;
  background: linear-gradient(180deg, var(--panneau-haut), var(--panneau) 40%);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 16px 18px 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 30px rgba(0,0,0,.28);
  min-width: 0;
}
/* vis de rack dans les coins */
.module::before, .module::after {
  content: ''; position: absolute; top: 9px; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #50627d, #1c2636 70%);
  box-shadow: inset 0 0 0 1px #0a0f17;
}
.module::before { left: 9px; }
.module::after { right: 9px; }
.module h2 {
  margin: 0 0 14px; padding: 0 10px;
  font: 600 13px/1.2 var(--titre); letter-spacing: .14em; text-transform: uppercase; color: var(--texte2);
}
.module h2 small { font-family: var(--corps); font-size: 12px; letter-spacing: .02em; text-transform: none; color: var(--muet); font-weight: 400; margin-left: 6px; }

/* ---------------- Anneau de santé ---------------- */
.master { display: flex; flex-direction: column; }
.anneau { position: relative; width: 100%; max-width: 230px; margin: 0 auto 6px; aspect-ratio: 1; }
.anneau svg { width: 100%; height: 100%; display: block; }
.anneau .led { fill: var(--led-off); transition: fill .4s, filter .4s; }
.anneau .led.on { filter: drop-shadow(0 0 3px currentColor); }
.anneau .centre { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.anneau .note { font: 700 58px/1 var(--titre); letter-spacing: -.02em; color: var(--texte); }
.anneau .note small { font-size: 18px; color: var(--muet); font-weight: 500; }
.anneau .etat { margin-top: 6px; font: 600 12px/1 var(--titre); letter-spacing: .16em; text-transform: uppercase; }
.raisons { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.raisons li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--texte2); padding: 7px 10px; background: rgba(0,0,0,.18); border-radius: 8px; border: 1px solid rgba(255,255,255,.03); }
.raisons li b { font: 600 13px var(--titre); color: var(--orange); min-width: 34px; }
.raisons li.ok { color: var(--vert); }
.raisons li.ok b { color: var(--vert); }
.raisons li.attente { color: var(--muet); }

/* ---------------- Cadrans à aiguille ---------------- */
.rangee-cadrans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.vu { margin: 0; padding: 10px 10px 12px; background: #0a0f18; border-radius: 12px; border: 1px solid #222e40; box-shadow: inset 0 2px 10px rgba(0,0,0,.6); }
.vu .face { position: relative; border-radius: 8px; overflow: hidden; }
.vu svg { display: block; width: 100%; height: auto; }
.vu .fond-ivoire { fill: url(#ivoire); }
.vu .graduation { stroke: var(--encre); stroke-width: 1.2; }
.vu .graduation.majeure { stroke-width: 2; }
.vu .chiffre { font: 600 9px var(--titre); fill: #5b4a30; text-anchor: middle; }
.vu .unite { font: 600 9px var(--titre); fill: #7a6643; letter-spacing: .12em; text-anchor: middle; }
.vu .aiguille { transform-box: view-box; transition: transform 1.1s cubic-bezier(.3, 1.65, .55, 1); }
.vu .aiguille line { stroke: #d6322b; stroke-width: 2; stroke-linecap: round; filter: drop-shadow(1px 2px 1px rgba(0,0,0,.35)); }
.vu .pivot { fill: #2a2a2a; stroke: #6d6d6d; stroke-width: 1; }
.vu .vitre { fill: url(#vitre); pointer-events: none; }
.vu figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 10px; padding: 0 2px; }
.vu .nom { font: 600 12px/1.2 var(--titre); letter-spacing: .1em; text-transform: uppercase; color: var(--texte2); }
.vu .valeur { font: 700 20px/1 var(--titre); color: var(--texte); white-space: nowrap; }
.vu .verdict { display: block; font-size: 12.5px; color: var(--muet); margin-top: 4px; padding: 0 2px; }
.vu .verdict::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muet); vertical-align: 1px; }
.vu[data-verdict="bon"] .verdict::before { background: var(--vert); box-shadow: 0 0 6px var(--vert); }
.vu[data-verdict="moyen"] .verdict::before { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.vu[data-verdict="mauvais"] .verdict::before { background: var(--rouge); box-shadow: 0 0 6px var(--rouge); }
.vu[data-verdict="aucune"] .face { filter: saturate(.5) brightness(.75); }

/* ---------------- Vumètres à LED ---------------- */
.bargraphes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; height: calc(100% - 30px); min-height: 280px; }
.barre-led { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.barre-led .chiffre { font: 700 22px/1 var(--titre); color: var(--texte); }
.barre-led .colonne {
  flex: 1; width: 100%; max-width: 46px; padding: 6px 7px; border-radius: 8px;
  background: #080c13; border: 1px solid #1f2a3b; box-shadow: inset 0 2px 8px rgba(0,0,0,.7);
  display: flex; flex-direction: column-reverse; gap: 3px;
}
.barre-led .seg { flex: 1; min-height: 5px; border-radius: 2px; background: var(--led-off); transition: background .08s, box-shadow .08s; }
.barre-led .seg.v.on { background: var(--vert); box-shadow: 0 0 6px rgba(53,208,127,.7); }
.barre-led .seg.o.on { background: var(--orange); box-shadow: 0 0 6px rgba(255,176,32,.7); }
.barre-led .seg.r.on { background: var(--rouge); box-shadow: 0 0 8px rgba(255,77,77,.8); }
.barre-led .seg.crete { outline: 1px solid rgba(255,255,255,.6); outline-offset: -1px; }
.barre-led .seg.v.crete { background: var(--vert); }
.barre-led .seg.o.crete { background: var(--orange); }
.barre-led .seg.r.crete { background: var(--rouge); }
.barre-led .etiquette { font: 600 11px/1.2 var(--titre); letter-spacing: .08em; text-transform: uppercase; color: var(--texte2); text-align: center; }
.barre-led .sous { font-size: 11px; color: var(--muet); text-align: center; margin-top: -4px; }

/* ---------------- Parcours = chemin de signal ---------------- */
.signal { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 6px 2px 10px; }
.etape {
  flex: 1 1 0; min-width: 118px; position: relative;
  background: linear-gradient(180deg, #1c2840, #141d2d);
  border: 1px solid var(--bord-clair); border-radius: 10px; padding: 12px 12px 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.etape .rang { font: 600 11px var(--titre); color: var(--muet); letter-spacing: .1em; }
.etape .lib { font-size: 13.5px; line-height: 1.25; color: var(--texte2); min-height: 34px; }
.etape .n { font: 700 26px/1 var(--titre); color: var(--texte); }
.etape .jauge { height: 4px; background: var(--led-off); border-radius: 2px; overflow: hidden; }
.etape .jauge i { display: block; height: 100%; background: var(--bleu); box-shadow: 0 0 8px var(--bleu); border-radius: 2px; transition: width .8s; }
.etape.blocage { border-color: var(--rouge); background: linear-gradient(180deg, #3a1a22, #241319); box-shadow: 0 0 0 1px rgba(255,77,77,.3), 0 0 22px rgba(255,77,77,.25); }
.etape.blocage .jauge i { background: var(--rouge); box-shadow: 0 0 8px var(--rouge); }
.etape .badge { align-self: flex-start; font: 700 10.5px/1 var(--titre); letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--rouge); padding: 4px 6px; border-radius: 4px; animation: pouls 1.6s ease-in-out infinite; }
.cable { flex: 0 0 56px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; position: relative; }
.cable::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%); background: linear-gradient(90deg, #2f6f9a, var(--bleu)); border-radius: 2px; opacity: .7; }
.cable span { position: relative; z-index: 1; font: 600 11.5px/1 var(--titre); background: var(--panneau); padding: 3px 5px; border-radius: 4px; color: var(--muet); border: 1px solid var(--bord); }
.cable.perte span { color: var(--orange); border-color: #5a4415; }
.cable.rouge::before { background: linear-gradient(90deg, var(--bleu), var(--rouge)); }
.cable.rouge span { color: #fff; background: var(--rouge); border-color: var(--rouge); }
.vide { color: var(--muet); font-size: 14px; padding: 10px; }

/* ---------------- Courbe d'activité ---------------- */
.courbe { position: relative; height: 190px; }
.courbe svg { width: 100%; height: 100%; display: block; overflow: visible; }
.courbe .grille { stroke: #223047; stroke-width: 1; }
.courbe .axe { font: 500 11px var(--corps); fill: var(--muet); }
.courbe .aire { fill: url(#degradeActivite); }
.courbe .ligne { fill: none; stroke: var(--bleu); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(79,195,255,.5)); }
.courbe .err { fill: var(--rouge); }
.courbe .repere { stroke: var(--texte2); stroke-width: 1; stroke-dasharray: 3 3; }
.courbe .point { fill: var(--bleu); stroke: var(--panneau); stroke-width: 2; }
.infobulle {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px;
  background: #0a0f18; border: 1px solid var(--bord-clair); border-radius: 8px; padding: 8px 10px;
  font-size: 13px; color: var(--texte2); box-shadow: 0 8px 20px rgba(0,0,0,.5); transform: translate(-50%, calc(-100% - 12px));
}
.infobulle b { color: var(--texte); font-family: var(--titre); }
.infobulle .t { color: var(--muet); font-size: 12px; margin-bottom: 4px; }
.legende-err { display: inline-flex; align-items: center; gap: 6px; }
.legende-err::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--rouge); }
.totaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.totaux div { background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.04); border-radius: 10px; padding: 10px 12px; }
.totaux b { display: block; font: 700 22px/1.1 var(--titre); color: var(--texte); }
.totaux span { font-size: 12.5px; color: var(--muet); }

/* ---------------- Tableaux (Détails) ---------------- */
.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th { text-align: left; font: 600 11px var(--titre); letter-spacing: .1em; text-transform: uppercase; color: var(--muet); padding: 0 8px 8px; border-bottom: 1px solid var(--bord); }
.tableau td { padding: 9px 8px; border-bottom: 1px solid rgba(255,255,255,.04); color: var(--texte2); vertical-align: top; }
.tableau td:first-child { color: var(--texte); word-break: break-word; }
.tableau .num { text-align: right; font-family: var(--titre); white-space: nowrap; }
.tableau td.num.ch.non-nul { color: var(--orange); }
.mini { display: inline-block; height: 6px; border-radius: 3px; background: var(--bleu); vertical-align: middle; margin-left: 6px; opacity: .7; }
.ligne-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.ligne-item:last-child { border-bottom: 0; }
.ligne-item .q { color: var(--texte); word-break: break-word; }
.ligne-item .q small { display: block; color: var(--muet); font-size: 12.5px; margin-top: 2px; }
.ligne-item .r { text-align: right; font-family: var(--titre); white-space: nowrap; color: var(--texte2); }
.pastille { display: inline-flex; align-items: center; gap: 5px; font: 600 11px/1 var(--titre); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 5px; border: 1px solid currentColor; }
.pastille.bon { color: var(--vert); }
.pastille.moyen { color: var(--orange); }
.pastille.mauvais { color: var(--rouge); }
.pastille.ecran { color: var(--bleu); }
.pastille.serveur { color: var(--orange); }

/* ---------------- Rapport ---------------- */
.tete-rapport { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.tete-rapport h2 { margin-bottom: 4px; }
.note { margin: 0; padding: 0 10px; color: var(--muet); font-size: 13.5px; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.case { display: inline-flex; align-items: center; gap: 8px; color: var(--texte2); font-size: 14px; cursor: pointer; }
.case input { width: 18px; height: 18px; accent-color: var(--bleu); }
.bouton {
  border: 1px solid #5d7fa8; border-radius: 10px; padding: 10px 18px; min-height: 42px;
  background: linear-gradient(180deg, #3b6aa0, #2a4f7c); color: #fff;
  font: 600 14px var(--titre); letter-spacing: .06em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 4px 14px rgba(42,79,124,.4);
  transition: transform .08s, filter .15s;
}
.bouton:hover { filter: brightness(1.1); }
.bouton:active { transform: translateY(1px); }
.bouton[disabled] { opacity: .6; cursor: progress; }
.bouton.secondaire { background: linear-gradient(180deg, #26344a, #1b2638); border-color: var(--bord-clair); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.resume { font-size: 16.5px; line-height: 1.55; color: var(--texte); padding: 0 10px; max-width: 900px; }
.axes { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.axes li { display: grid; grid-template-columns: 6px 1fr; gap: 14px; background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.05); border-radius: 12px; padding: 14px 16px 14px 0; overflow: hidden; }
.axes li::before { content: ''; background: var(--c, var(--bleu)); box-shadow: 0 0 10px var(--c, var(--bleu)); border-radius: 0 3px 3px 0; }
.axes li[data-g="critique"] { --c: var(--rouge); }
.axes li[data-g="haute"] { --c: #ff7a45; }
.axes li[data-g="moyenne"] { --c: var(--orange); }
.axes li[data-g="info"] { --c: var(--bleu); }
.axes h3 { margin: 0 0 6px; font: 600 16px/1.3 var(--titre); color: var(--texte); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.axes .gr { font: 700 10.5px/1 var(--titre); letter-spacing: .1em; text-transform: uppercase; color: var(--c); border: 1px solid var(--c); border-radius: 4px; padding: 3px 6px; }
.axes p { margin: 4px 0 0; color: var(--texte2); font-size: 14.5px; }
.axes p.cause { font-style: italic; color: var(--muet); }
.axes p.action { color: #8fe3b5; }
.axes p.action::before { content: '→ '; }
.positif { margin: 16px 10px 0; color: var(--vert); font-size: 15px; }
.positif::before { content: '👍 '; }
.avert { margin: 8px 10px; color: var(--orange); font-size: 13.5px; }

/* ---------------- Journal des alertes ---------------- */
.journal { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.journal li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.05); border-radius: 10px; }
.journal .ic { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: var(--bleu); box-shadow: 0 0 8px var(--bleu); }
.journal li[data-g="critique"] .ic { background: var(--rouge); box-shadow: 0 0 8px var(--rouge); }
.journal li[data-g="haute"] .ic { background: #ff7a45; box-shadow: 0 0 8px #ff7a45; }
.journal li[data-g="moyenne"] .ic { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.journal b { color: var(--texte); display: block; }
.journal p { margin: 3px 0 0; color: var(--texte2); font-size: 14px; word-break: break-word; }
.journal .quand { text-align: right; font: 500 12.5px var(--titre); color: var(--muet); white-space: nowrap; }
.journal .canaux { display: block; margin-top: 4px; font-size: 11.5px; }
.journal .canaux .k { color: var(--vert); }
.journal .canaux .x { color: var(--rouge); }
.journal li.nouveau { animation: arrivee 1.4s ease-out; }
@keyframes arrivee { from { background: rgba(255,77,77,.25); } }

/* ---------------- Toast ---------------- */
.toast {
  visibility: hidden; opacity: 0;
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%); z-index: 50;
  max-width: min(520px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px;
  background: #0a0f18; border: 1px solid var(--bord-clair); color: var(--texte);
  box-shadow: 0 12px 40px rgba(0,0,0,.6); transition: transform .3s cubic-bezier(.3,1.4,.5,1), opacity .3s, visibility .3s; font-size: 14.5px;
}
.toast.visible { transform: translate(-50%, 0); visibility: visible; opacity: 1; }
.toast.alerte { border-color: var(--rouge); box-shadow: 0 0 0 1px rgba(255,77,77,.4), 0 12px 40px rgba(0,0,0,.6); }

/* ---------------- Bandeau hors ligne ---------------- */
.horsligne { display: none; margin: 12px 0 0; padding: 12px 16px; border-radius: 12px; background: linear-gradient(90deg, #4a141c, #2a1117); border: 1px solid var(--rouge); color: #ffd6d6; font-weight: 500; }
.horsligne.visible { display: block; animation: pouls 2.4s ease-in-out infinite; }

/* ---------------- Page de connexion ---------------- */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.carte {
  width: 100%; max-width: 400px; padding: 28px 26px 26px;
  background: linear-gradient(180deg, var(--panneau-haut), var(--panneau));
  border: 1px solid var(--bord); border-radius: 18px; position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 20px 60px rgba(0,0,0,.5);
}
.carte .marque { margin: 0 0 6px; font-size: 22px; }
.carte .marque svg { width: 38px; height: 38px; }
.carte .sous-titre { margin: 0 0 22px; color: var(--muet); font-size: 14px; }
.champ { display: block; margin-bottom: 14px; }
.champ span { display: block; font: 600 11.5px var(--titre); letter-spacing: .12em; text-transform: uppercase; color: var(--texte2); margin-bottom: 6px; }
.champ input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 10px;
  background: #0a0f18; border: 1px solid var(--bord-clair); font-size: 16px;
}
.champ input:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(79,195,255,.18); }
.mdp { position: relative; }
.mdp input { padding-right: 52px; }
.oeil { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; border: 0; background: none; border-radius: 8px; display: grid; place-items: center; color: var(--texte2); }
.oeil:hover { color: var(--texte); background: rgba(255,255,255,.04); }
.oeil svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.oeil .barre-oeil { display: none; }
.oeil[aria-pressed="true"] .barre-oeil { display: inline; }
.carte .bouton { width: 100%; margin-top: 8px; }
.erreur-connexion { min-height: 20px; margin: 10px 0 0; color: #ff8a8a; font-size: 14px; }

/* ---------------- Téléphone & tablette ---------------- */
@media (max-width: 1100px) {
  #cockpit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "master rack" "cadrans cadrans" "chemin chemin" "activite activite"; }
  .rangee-cadrans { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .rangee-cadrans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #details { grid-template-columns: minmax(0, 1fr); }
  .signal { flex-direction: column; overflow: visible; }
  .etape { min-width: 0; flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 12px; }
  .etape .lib { min-height: 0; flex: 1 1 140px; }
  .etape .n { order: 3; }
  .etape .jauge { flex: 1 0 100%; order: 4; }
  .cable { flex: 0 0 38px; flex-direction: row; }
  .cable::before { left: 50%; right: auto; top: 0; bottom: 0; width: 3px; height: auto; transform: translateX(-50%); background: linear-gradient(180deg, #2f6f9a, var(--bleu)); }
  .cable.rouge::before { background: linear-gradient(180deg, var(--bleu), var(--rouge)); }
}
@media (max-width: 640px) {
  .console { padding: 10px 12px 32px; }
  .barre { gap: 10px; padding: 10px; }
  .marque { font-size: 16px; flex: 1 1 100%; margin-right: 0; }
  .marque { order: 0; }
  .barre { position: relative; }
  .direct { position: absolute; right: 108px; top: 22px; }
  .cloche { position: absolute; top: 10px; right: 58px; }
  #deconnexion { right: 10px; }
  .direct span { display: none; }
  .canal { flex: 1 1 auto; }
  .canal select { width: 100%; }
  #cockpit { grid-template-columns: minmax(0, 1fr); grid-template-areas: "master" "cadrans" "rack" "chemin" "activite"; }
  .module { padding: 14px 12px 16px; }
  .bargraphes { min-height: 230px; }
  .anneau { max-width: 200px; }
  .anneau .note { font-size: 50px; }
  .vu .valeur { font-size: 17px; }
  .journal li { grid-template-columns: auto 1fr; }
  .journal .quand { grid-column: 2; text-align: left; }
  .tableau .cache-mobile { display: none; }
  .onglets button { padding: 10px 11px 12px; letter-spacing: .06em; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
