/* Kiné · back-office « poste de commandement » : sombre, net, lisible. États toujours accompagnés d'un libellé. */
@font-face { font-family: 'Space Grotesk'; src: url('/static/fonts/space-grotesk.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/static/fonts/manrope.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
:root {
  color-scheme: dark;
  --bg: #050912; --panel: #0b1322; --panel2: #101a2e; --ligne: #1a2740; --ligne2: #26375a; --txt: #e8eef8; --txt2: #b2bfd4; --muted: #7a879e;
  --menthe: #5ce1c6; --bleu: #4c8dff; --ok: #2fc48a; --warn: #f0b03a; --crit: #ff6b6b; --info: #6aa8ff;
  --fort: #fff; --carte1: rgba(16, 26, 46, .9); --carte2: rgba(11, 19, 34, .9); --side1: rgba(11, 19, 34, .96); --side2: rgba(5, 9, 18, .98);
  --tiroir: rgba(11, 19, 34, .7); --creux: rgba(5, 9, 18, .6); --champ: #070d19; --sur-acc: #04140f; --halo1: rgba(76, 141, 255, .16); --halo2: rgba(92, 225, 198, .1);
  --f-t: 'Space Grotesk', 'Manrope', system-ui, sans-serif; --f: 'Manrope', system-ui, sans-serif; --r: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: radial-gradient(1100px 600px at 80% -10%, rgba(76, 141, 255, .16), transparent 60%), radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--menthe) 10%, transparent), transparent 60%), var(--bg); background-attachment: fixed; color: var(--txt); font: 400 14px/1.55 var(--f); }
a { color: var(--menthe); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-t); letter-spacing: -.015em; margin: 0; color: var(--fort); }
:focus-visible { outline: 2px solid var(--menthe); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-focus:focus { position: fixed !important; z-index: 99; top: 8px; left: 8px; width: auto; height: auto; clip: auto; background: var(--menthe); color: var(--sur-acc); padding: 8px 12px; border-radius: 8px; }
.mono { font-family: var(--f-t); font-variant-numeric: tabular-nums; }
.petit { font-size: 12.5px; color: var(--muted); margin: 4px 0; }
.app { display: grid; grid-template-columns: 254px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: linear-gradient(180deg, var(--side1), var(--side2)); border-right: 1px solid var(--ligne); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 8px 14px; }
.marque img { width: 34px; height: 34px; border-radius: 10px; }
.marque b { display: block; font: 700 18px var(--f-t); color: var(--fort); }
.marque b i { font-style: normal; color: var(--menthe); }
.marque small { display: block; font: 500 10px var(--f-t); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.grp { margin: 14px 10px 4px; font: 600 10px var(--f-t); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.it { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--txt2); text-decoration: none; font-size: 13.5px; position: relative; }
.it svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.it:hover { background: var(--panel2); color: var(--fort); }
.it[aria-current] { background: linear-gradient(90deg, color-mix(in srgb, var(--menthe) 16%, transparent), color-mix(in srgb, var(--menthe) 2%, transparent)); color: var(--fort); }
.it[aria-current]::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--menthe); }
.bulle { margin-left: auto; background: var(--menthe); color: var(--sur-acc); font: 700 11px var(--f-t); padding: 1px 7px; border-radius: 20px; }
.side .bas { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--ligne); display: grid; gap: 4px; font-size: 12.5px; color: var(--txt2); }
.side .bas form button { background: none; border: 0; color: var(--menthe); padding: 0; font: inherit; cursor: pointer; text-align: left; }
.menu-mob { display: none; }
.main { padding: 14px clamp(14px, 2.4vw, 36px) 60px; min-width: 0; }
.barre-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 0 14px; border-bottom: 1px solid var(--ligne); margin-bottom: 18px; }
.perimetre { display: flex; gap: 4px; flex-wrap: wrap; background: var(--panel); padding: 4px; border-radius: 12px; border: 1px solid var(--ligne); }
.seg { appearance: none; border: 0; background: transparent; color: var(--txt2); font: 500 12.5px var(--f); padding: 6px 10px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg:hover { color: var(--fort); background: var(--panel2); }
.seg.on { background: var(--fort); color: var(--bg); font-weight: 700; }
.seg i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); display: inline-block; }
.horloge { margin: 0; font-size: 12px; color: var(--txt2); display: flex; align-items: center; gap: 8px; }
.vivant { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(47, 196, 138, .6); animation: pouls 2.4s infinite; }
@keyframes pouls { 70% { box-shadow: 0 0 0 8px rgba(47, 196, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 196, 138, 0); } }
.bandeau { margin: 0 0 14px; padding: 9px 14px; border-radius: 12px; border: 1px dashed var(--ligne2); color: var(--txt2); font-size: 12.5px; background: rgba(76, 141, 255, .06); }
.bandeau.alerte { border-color: rgba(240, 176, 58, .5); background: rgba(240, 176, 58, .07); }
.flash { padding: 10px 14px; border-radius: 12px; margin: 0 0 14px; font-size: 13.5px; }
.flash.ok { background: rgba(47, 196, 138, .12); color: #b9f2d9; border: 1px solid rgba(47, 196, 138, .35); }
.flash.erreur { background: rgba(255, 107, 107, .1); color: #ffd0d0; border: 1px solid rgba(255, 107, 107, .35); }
.titre-page { display: flex; justify-content: space-between; align-items: end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.titre-page h1 { font-size: clamp(22px, 2.4vw, 30px); }
.titre-page .sous { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 11px; border: 1px solid var(--ligne2); background: var(--panel2); color: var(--txt); font: 600 13px var(--f); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--menthe); }
.btn svg { width: 16px; height: 16px; }
.btn-p { background: linear-gradient(120deg, var(--menthe), color-mix(in srgb, var(--menthe) 55%, #7fd3ff)); color: var(--sur-acc); border-color: transparent; }
.btn-d { color: #ffc9c9; border-color: rgba(255, 107, 107, .4); }
.btn-d:hover { background: rgba(255, 107, 107, .12); border-color: var(--crit); }
.btn-s { padding: 5px 10px; font-size: 12px; border-radius: 9px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; margin-bottom: 18px; }
.tuile { position: relative; padding: 14px 16px; border-radius: var(--r); background: linear-gradient(160deg, var(--panel2), var(--panel)); border: 1px solid var(--ligne); text-decoration: none; color: var(--txt); overflow: hidden; }
.tuile::after { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, var(--c, color-mix(in srgb, var(--menthe) 25%, transparent)), transparent 70%); opacity: .6; }
.tuile .l { font: 600 10.5px var(--f-t); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tuile .v { display: block; font: 600 28px/1.15 var(--f-t); color: var(--fort); margin-top: 6px; font-variant-numeric: tabular-nums; }
.tuile .d { font-size: 12px; color: var(--txt2); }
.tuile .d.up { color: var(--ok); } .tuile .d.down { color: var(--crit); }
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grille-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grille-2-1 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1200px) { .grille-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) { .grille-2, .grille-3, .grille-2-1 { grid-template-columns: 1fr; } }
.carte { background: linear-gradient(160deg, var(--carte1), var(--carte2)); border: 1px solid var(--ligne); border-radius: var(--r); padding: 16px 18px; min-width: 0; }
.carte + .carte { margin-top: 16px; }
.grille-2 > .carte + .carte, .grille-3 > .carte + .carte, .grille-2-1 > .carte + .carte { margin-top: 0; }
.carte h2 { font-size: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.carte h2 small { font: 500 12px var(--f); color: var(--muted); }
.t-d { overflow-x: auto; }
.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th, .t td { padding: 8px 10px; border-bottom: 1px solid var(--ligne); text-align: left; vertical-align: top; }
.t th { font: 600 10.5px var(--f-t); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.t td.n, .t th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tr:hover td { background: color-mix(in srgb, var(--fort) 2%, transparent); }
.t a { color: var(--fort); text-decoration: none; } .t a:hover { color: var(--menthe); }
.pt { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--menthe)); margin-right: 6px; }
.etat { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font: 700 11px var(--f); background: color-mix(in srgb, var(--fort) 6%, transparent); color: var(--txt2); white-space: nowrap; }
.etat::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.etat.confirme { color: var(--info); background: rgba(106, 168, 255, .1); } .etat.arrive { color: var(--warn); background: rgba(240, 176, 58, .12); } .etat.en_cours { color: var(--menthe); background: color-mix(in srgb, var(--menthe) 12%, transparent); } .etat.termine { color: var(--ok); background: rgba(47, 196, 138, .1); } .etat.absent { color: var(--crit); background: rgba(255, 107, 107, .12); } .etat.annule { color: var(--muted); } .etat.propose { color: #c9a8ff; background: rgba(180, 140, 255, .12); }
.niv { display: inline-block; padding: 2px 8px; border-radius: 6px; font: 700 10.5px var(--f-t); letter-spacing: .08em; text-transform: uppercase; }
.niv.critique { background: rgba(255, 107, 107, .15); color: #ffb3b3; } .niv.serieux { background: rgba(255, 140, 80, .15); color: #ffc49e; } .niv.attention { background: rgba(240, 176, 58, .15); color: #ffd98e; } .niv.info { background: rgba(106, 168, 255, .14); color: #bcd6ff; }
.filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.filtres label { display: grid; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.f input, .f select, .f textarea, .filtres input, .filtres select { background: var(--champ); color: var(--txt); border: 1px solid var(--ligne2); border-radius: 10px; padding: 8px 10px; font: 500 13.5px var(--f); min-height: 38px; }
.f textarea { min-height: 110px; width: 100%; }
.f { display: grid; gap: 12px; }
.f label { display: grid; gap: 5px; font-size: 12.5px; color: var(--txt2); font-weight: 600; }
.f label small { font-weight: 400; color: var(--muted); }
.f-l { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.case { display: flex !important; gap: 10px; align-items: center; font-weight: 500 !important; }
.case input { min-height: 0; width: 16px; height: 16px; }
.vide { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--ligne2); border-radius: var(--r); }
/* tiroirs */
.tiroir { border: 1px solid var(--ligne); border-radius: var(--r); background: var(--tiroir); margin-bottom: 10px; }
.tiroir > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 13px 16px; font-weight: 700; }
.tiroir > summary::-webkit-details-marker { display: none; }
.tiroir > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .2s; flex: none; }
.tiroir[open] > summary::before { transform: rotate(45deg); }
.tiroir > summary .cpt { margin-left: auto; font: 600 11.5px var(--f-t); color: var(--muted); }
.tiroir > summary .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--menthe)) 18%, transparent); color: var(--c, var(--menthe)); flex: none; }
.tiroir > summary .ic svg { width: 17px; height: 17px; }
.tiroir > .in { padding: 4px 16px 16px; }
.tiroir .tiroir { background: var(--creux); }
/* tour de contrôle */
.tour-l { display: grid; gap: 8px; }
.ligne-p { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; align-items: center; }
.ligne-p .qui { display: flex; gap: 10px; align-items: center; min-width: 0; }
.ligne-p .qui img { width: 34px; height: 34px; flex: none; }
.ligne-p .qui b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-p .qui small { color: var(--muted); font-size: 11.5px; }
.piste { position: relative; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--fort) 2.5%, transparent); border: 1px solid var(--ligne); overflow: hidden; }
.piste .ouv { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--menthe) 5%, transparent); border-left: 1px solid color-mix(in srgb, var(--menthe) 15%, transparent); border-right: 1px solid color-mix(in srgb, var(--menthe) 15%, transparent); }
.piste .b { position: absolute; top: 5px; bottom: 5px; border-radius: 7px; background: rgba(106, 168, 255, .3); border: 1px solid rgba(106, 168, 255, .6); color: var(--fort); font-size: 10.5px; padding: 2px 5px; overflow: hidden; white-space: nowrap; text-decoration: none; }
.piste .b.termine { background: rgba(47, 196, 138, .18); border-color: rgba(47, 196, 138, .45); color: #bdf0da; }
.piste .b.en_cours { background: color-mix(in srgb, var(--menthe) 45%, transparent); border-color: var(--menthe); box-shadow: 0 0 14px color-mix(in srgb, var(--menthe) 50%, transparent); }
.piste .b.arrive { background: rgba(240, 176, 58, .35); border-color: var(--warn); }
.piste .b.absent { background: rgba(255, 107, 107, .2); border-color: rgba(255, 107, 107, .6); text-decoration: line-through; }
.piste .maint { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--crit); box-shadow: 0 0 10px var(--crit); z-index: 2; }
.axe { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; font: 600 10.5px var(--f-t); color: var(--muted); }
.axe .h { position: relative; height: 16px; }
.axe .h span { position: absolute; transform: translateX(-50%); }
@media (max-width: 760px) { .ligne-p, .axe { grid-template-columns: 1fr; } .axe > :first-child { display: none; } }
.salle { display: grid; gap: 8px; }
.salle-i { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 12px; background: color-mix(in srgb, var(--fort) 3%, transparent); border: 1px solid var(--ligne); }
.salle-i .min { font: 700 15px var(--f-t); }
.salle-i .min.long { color: var(--warn); }
.alerte-i { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.alerte-i:last-child { border: 0; }
.alerte-i p { margin: 2px 0 0; color: var(--txt2); font-size: 12.5px; }
.reco-i { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--ligne); background: color-mix(in srgb, var(--fort) 2%, transparent); margin-bottom: 8px; }
.reco-i b { display: block; margin: 4px 0; }
.reco-i p { margin: 0 0 8px; color: var(--txt2); font-size: 12.5px; }
/* graphiques */
.barres { display: flex; align-items: end; gap: 3px; height: 140px; padding-top: 6px; }
.barres span { flex: 1; min-width: 3px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--menthe), color-mix(in srgb, var(--menthe) 25%, transparent)); position: relative; }
.barres span.we { background: linear-gradient(180deg, rgba(106, 168, 255, .7), rgba(106, 168, 255, .15)); }
.barres-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.jauge { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--fort) 6%, transparent); overflow: hidden; }
.jauge i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c, var(--menthe)), color-mix(in srgb, var(--c, var(--menthe)) 55%, #7fd3ff)); }
.futur { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; }
.futur div { text-align: center; font-size: 10.5px; color: var(--muted); }
.futur b { display: block; height: 70px; border-radius: 8px; background: color-mix(in srgb, var(--fort) 4%, transparent); position: relative; overflow: hidden; margin-bottom: 4px; }
.futur b i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, var(--c, var(--menthe)), color-mix(in srgb, var(--menthe) 20%, transparent)); }
/* agenda */
.ag { display: grid; gap: 0; overflow-x: auto; border: 1px solid var(--ligne); border-radius: var(--r); }
.ag-t { display: grid; min-width: 720px; }
.ag-col { position: relative; border-left: 1px solid var(--ligne); }
.ag-h { position: sticky; top: 0; z-index: 3; padding: 8px; background: var(--panel); border-bottom: 1px solid var(--ligne); font-size: 12px; font-weight: 700; display: flex; gap: 8px; align-items: center; min-height: 48px; }
.ag-h img { width: 28px; height: 28px; }
.ag-c { position: relative; }
.ag-ligne { position: absolute; left: 0; right: 0; border-top: 1px solid color-mix(in srgb, var(--fort) 4%, transparent); }
.ag-ouv { position: absolute; left: 0; right: 0; background: color-mix(in srgb, var(--menthe) 4%, transparent); }
.ag-abs { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(255, 107, 107, .08) 0 6px, transparent 6px 12px); }
.ag-r { position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 3px 6px; font-size: 11px; line-height: 1.25; overflow: hidden; text-decoration: none; color: var(--fort); background: rgba(106, 168, 255, .25); border-left: 3px solid var(--c, var(--info)); }
.ag-r.termine { background: rgba(47, 196, 138, .15); } .ag-r.absent { background: rgba(255, 107, 107, .15); text-decoration: line-through; } .ag-r.en_cours { background: color-mix(in srgb, var(--menthe) 35%, transparent); } .ag-r.arrive { background: rgba(240, 176, 58, .28); } .ag-r.propose { background: rgba(180, 140, 255, .2); border-style: dashed; }
.ag-libre { position: absolute; left: 4px; right: 4px; border-radius: 6px; border: 1px dashed color-mix(in srgb, var(--menthe) 25%, transparent); color: var(--menthe); font-size: 10px; text-decoration: none; padding: 1px 5px; opacity: .55; }
.ag-libre:hover { opacity: 1; background: color-mix(in srgb, var(--menthe) 10%, transparent); }
.ag-heures { position: relative; }
.ag-heures span { position: absolute; right: 6px; font-size: 10.5px; color: var(--muted); transform: translateY(-50%); }
.ag-maint { position: absolute; left: 0; right: 0; height: 2px; background: var(--crit); z-index: 2; }
/* fil de passages */
.fil { list-style: none; margin: 0; padding: 0; }
.fil li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--ligne); font-size: 13px; }
.fil li small { color: var(--muted); }
.chat { display: grid; gap: 8px; max-height: 58vh; overflow-y: auto; padding: 14px; border-radius: var(--r); background: var(--creux); border: 1px solid var(--ligne); }
.bul { max-width: min(78%, 620px); padding: 10px 12px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--ligne2); white-space: pre-wrap; }
.bul.moi { justify-self: end; background: color-mix(in srgb, var(--menthe) 14%, transparent); border-color: color-mix(in srgb, var(--menthe) 35%, transparent); }
.bul small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.cx { width: min(420px, 100%); background: linear-gradient(160deg, var(--carte1), var(--carte2)); border: 1px solid var(--ligne2); border-radius: 22px; padding: 28px; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9); }
.cx .f input { width: 100%; }
.recos-a { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 8px; margin: 10px 0; }
.recos-a button { text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--ligne2); background: var(--panel2); color: var(--txt); cursor: pointer; font: inherit; }
.recos-a button.on, .recos-a button:hover { border-color: var(--menthe); }
.recos-a b { display: block; font: 700 18px var(--f-t); }
.recos-a small { color: var(--muted); }
.nav-barre { position: fixed; left: 0; top: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--menthe), var(--bleu)); z-index: 100; transition: width .4s; }
.nav-barre.on { width: 70%; } .nav-barre.fin { width: 100%; opacity: 0; transition: width .2s, opacity .4s .2s; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 60; transform: translateX(-102%); transition: transform .3s; }
  .side.ouvert { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); }
  .menu-mob { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--ligne); position: sticky; top: 0; z-index: 40; background: var(--bg); }
  .menu-mob button { background: var(--panel2); border: 1px solid var(--ligne2); color: var(--fort); border-radius: 10px; padding: 8px 12px; font: 600 13px var(--f); }
}
@media (prefers-reduced-motion: reduce) { .vivant { animation: none; } * { scroll-behavior: auto !important; } }
/* ── 0.2.0 · couleur d'accent (retenue dans ce navigateur, valeur par défaut dans Réglages) ── */
html[data-accent="bleu"] { --menthe: #6aa8ff; } html[data-accent="corail"] { --menthe: #ff8a6b; } html[data-accent="violet"] { --menthe: #b18cff; } html[data-accent="ambre"] { --menthe: #f5b942; }
/* ── 0.2.0 · thème clair : mêmes repères, encre sombre sur papier bleuté ; états toujours libellés ── */
html[data-theme="clair"] {
  color-scheme: light;
  --bg: #eef3f8; --panel: #ffffff; --panel2: #f3f7fb; --ligne: #d8e1ec; --ligne2: #c3cfdd; --txt: #121a2b; --txt2: #3a475c; --muted: #5d6a80;
  --menthe: #0b8670; --bleu: #2563c9; --ok: #12805a; --warn: #9a6300; --crit: #c23b3b; --info: #2563c9;
  --fort: #0b1220; --carte1: #ffffff; --carte2: #f8fbfd; --side1: #ffffff; --side2: #f4f8fb; --tiroir: #ffffff; --creux: #f3f7fb; --champ: #ffffff; --sur-acc: #ffffff;
  --halo1: rgba(37, 99, 201, .08); --halo2: rgba(11, 134, 112, .07);
}
html[data-theme="clair"][data-accent="bleu"] { --menthe: #2563c9; } html[data-theme="clair"][data-accent="corail"] { --menthe: #c2482b; } html[data-theme="clair"][data-accent="violet"] { --menthe: #6d43c9; } html[data-theme="clair"][data-accent="ambre"] { --menthe: #8f5a00; }
html[data-theme="clair"] .carte, html[data-theme="clair"] .tuile, html[data-theme="clair"] .tiroir { box-shadow: 0 1px 2px rgba(18, 26, 43, .05), 0 10px 24px -18px rgba(18, 26, 43, .25); }
html[data-theme="clair"] .flash.ok { color: #0d5c40; } html[data-theme="clair"] .flash.erreur { color: #8f2424; } html[data-theme="clair"] .btn-d { color: #a82e2e; }
html[data-theme="clair"] .niv.critique { color: #9b1c1c; } html[data-theme="clair"] .niv.serieux { color: #9a3d0c; } html[data-theme="clair"] .niv.attention { color: #7a4d00; } html[data-theme="clair"] .niv.info { color: #1d4fa3; }
html[data-theme="clair"] .piste .b, html[data-theme="clair"] .ag-r { color: #0b1220; } html[data-theme="clair"] .piste .b.termine { color: #0d5c40; }
html[data-theme="clair"] .side.ouvert { box-shadow: 0 0 0 100vmax rgba(18, 26, 43, .35); }
html[data-theme="clair"] .bandeau.alerte { background: #fff6e3; }
html[data-theme="clair"] .bul.moi { background: color-mix(in srgb, var(--menthe) 10%, #fff); }
html[data-theme="clair"] .ndv-sig .ndv-credit__sig { filter: brightness(.62) saturate(1.4); }
html[data-theme="clair"] .ndv-sig { --ndv-or: #9a7326; --ndv-or-l: #b8913f; }
/* ── 0.2.0 · menu latéral compact : groupes repliables, mode réduit (icônes), outils ── */
@media (min-width: 901px) { .app { grid-template-columns: 232px minmax(0, 1fr); } }
.side { padding: 12px 10px; }
.marque { padding: 2px 6px 10px; }
.side-outils { display: flex; gap: 4px; margin: 0 2px 4px; }
.rail-b { flex: 1; display: flex; align-items: center; gap: 7px; padding: 5px 8px; background: none; border: 1px solid var(--ligne); color: var(--muted); border-radius: 8px; font: 500 11.5px var(--f); cursor: pointer; min-width: 0; white-space: nowrap; }
.rail-b svg { width: 15px; height: 15px; flex: none; }
.rail-b .lib { overflow: hidden; text-overflow: ellipsis; }
.rail-b:hover { color: var(--txt); border-color: var(--ligne2); }
.grp-d { margin: 0; }
.grp-d > summary.grp { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; margin: 8px 2px 2px; padding: 4px 8px; border-radius: 7px; user-select: none; }
.grp-d > summary.grp::-webkit-details-marker { display: none; }
.grp-d > summary.grp::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-left: auto; flex: none; }
.grp-d[open] > summary.grp::after { transform: rotate(45deg); }
.grp-d > summary.grp:hover { color: var(--txt2); background: var(--panel2); }
.grp-d > summary .bulle { margin-left: auto; font-size: 10px; padding: 0 6px; }
.grp-d > summary .bulle + * { margin-left: 0; }
.grp-d[open] > summary .bulle { display: none; }
.it { padding: 6px 9px; font-size: 13px; gap: 9px; border-radius: 8px; }
.it .lib { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it[aria-current]::before { left: -10px; top: 6px; bottom: 6px; }
.side .bas { gap: 3px; font-size: 12px; padding-top: 10px; }
.side .bas .deco { background: none; border: 0; color: var(--menthe); padding: 0; font: inherit; cursor: pointer; text-align: left; }
.accents { display: flex; gap: 6px; margin-bottom: 6px; }
.acc { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--ligne2); cursor: pointer; padding: 0; }
.acc[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--fort); }
.acc-menthe { background: #2fbfa5; } .acc-bleu { background: #4c8dff; } .acc-corail { background: #ff7a57; } .acc-violet { background: #9d73ff; } .acc-ambre { background: #e5a72e; }
.ndv-l { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--ligne); min-width: 0; overflow: hidden; }
.ndv-sig { font-size: 11px; color: var(--muted); text-decoration: none; line-height: 1.35; }
.ndv-sig:hover { color: var(--txt2); } .ndv-sig b { font-weight: 600; color: var(--menthe); }
@media (min-width: 901px) {
  .rail .app { grid-template-columns: 66px minmax(0, 1fr); }
  .rail .side { padding: 10px 8px; align-items: center; }
  .rail .side .lib, .rail .marque-t, .rail .grp-d > summary.grp, .rail .side .bas .qui, .rail .side .bas .role, .rail .side .bas .lien-portail, .rail .accents, .rail .ndv-sig { display: none; }
  .rail .side-outils { flex-direction: column; margin: 0 0 6px; }
  .rail .grp-d { display: contents; }
  .rail .it { justify-content: center; padding: 9px; width: 46px; }
  .rail .it .bulle { position: absolute; top: 1px; right: -2px; font-size: 9px; padding: 0 4px; }
  .rail .rail-b { justify-content: center; width: 46px; flex: none; }
  .rail .side .bas { align-items: center; justify-items: center; width: 100%; }
  .rail .side .bas .deco::before { content: '⏻'; font-size: 15px; }
  .rail .marque { padding: 2px 0 10px; }
  .rail .it[aria-current]::before { left: -8px; }
}
@media (max-width: 900px) { .rail-b[data-rail] { display: none; } }
/* ── 0.2.0 · visionneuse : sombre dans les deux thèmes ── */
.vz-ici { height: min(78vh, 900px); margin-top: 10px; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .8); animation: vz-ici .28s ease-out; }
.vz-ici > div { height: 100%; } @keyframes vz-ici { from { opacity: 0; transform: translateY(-6px); } }
.cl .ic { font: 700 8.5px var(--f-t); }
html[data-theme="clair"] .cl-arbre summary:hover { background: color-mix(in srgb, var(--menthe) 7%, transparent); }
/* pièces liées (rendez-vous, patient, formation) */
.pieces { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.piece { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--ligne); background: var(--creux); }
.piece.lit { border-color: color-mix(in srgb, var(--menthe) 55%, transparent); }
.piece .vgn { width: 48px; height: 64px; border-radius: 5px; background: #fff; border: 1px solid var(--ligne2); overflow: hidden; display: grid; place-items: center; font: 700 9px var(--f-t); color: #0f7f6c; cursor: pointer; padding: 0; }
.piece .vgn canvas, .piece .vgn img { width: 100%; height: auto; display: block; }
.piece .vgn.ok { font-size: 0; }
.piece b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece small { color: var(--muted); font-size: 11.5px; }
.piece .num { font: 600 11px var(--f-t); color: var(--menthe); letter-spacing: .02em; }
.piece .act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.piece > .vz-ici { grid-column: 1 / -1; }
@media (max-width: 640px) { .piece { grid-template-columns: 40px minmax(0, 1fr); } .piece .vgn { width: 40px; height: 54px; } .piece .act { grid-column: 1 / -1; justify-content: flex-start; } }
.produire { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.produire input, .produire select { background: var(--champ); color: var(--txt); border: 1px solid var(--ligne2); border-radius: 10px; padding: 6px 10px; font: 500 13px var(--f); min-height: 36px; }
/* synchronisation : chaînes entre modules */
.chaines { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; margin-bottom: 18px; }
.chaine { position: relative; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--ligne); background: linear-gradient(160deg, var(--carte1), var(--carte2)); display: grid; gap: 8px; }
.chaine.off { opacity: .62; }
.chaine .trajet { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 600 12px var(--f-t); }
.chaine .trajet span { padding: 3px 9px; border-radius: 99px; border: 1px solid var(--ligne2); background: var(--panel2); }
.chaine .trajet i { width: 26px; height: 2px; background: linear-gradient(90deg, var(--menthe), transparent); position: relative; overflow: hidden; border-radius: 2px; }
.chaine .trajet i::after { content: ''; position: absolute; inset: 0; width: 10px; background: var(--menthe); border-radius: 2px; animation: impulsion 1.8s linear infinite; }
.chaine.off .trajet i::after { animation: none; opacity: 0; }
@keyframes impulsion { from { transform: translateX(-10px); } to { transform: translateX(28px); } }
.chaine p { margin: 0; color: var(--txt2); font-size: 12.5px; }
.chaine .chiffres { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; align-items: center; }
.chaine .chiffres b { font: 700 18px var(--f-t); color: var(--fort); }
.flux-l { list-style: none; margin: 0; padding: 0; }
.flux-l li { display: grid; grid-template-columns: 112px 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ligne); font-size: 13px; }
.flux-l li:last-child { border: 0; }
.flux-l .pt-f { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.flux-l .pt-f.erreur { background: var(--crit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--crit) 20%, transparent); } .flux-l .pt-f.ignore { background: var(--muted); box-shadow: none; }
@media (max-width: 700px) { .flux-l li { grid-template-columns: 18px minmax(0, 1fr); } .flux-l li > small:first-child { grid-column: 1 / -1; } .flux-l li > :last-child { grid-column: 2; } }
@media (prefers-reduced-motion: reduce) { .chaine .trajet i::after, .vz-ici { animation: none; } }
/* sous-tiroirs : retrait et filet pour lire la hiérarchie */
.tiroir .tiroir { margin-left: 4px; border-style: dashed; }
.tiroir .tiroir > summary { padding: 10px 14px; font-weight: 600; font-size: 13.5px; }
.vz-pg span { white-space: nowrap; }
/* ── Kiné 0.1.0 · pavé de signature, séries, signatures ── */
.pad { --encre: #13306b; display: grid; gap: 8px; max-width: 560px; }
.pad-cadre { position: relative; aspect-ratio: 3 / 1; border-radius: 14px; background: #fbfcfe; border: 1px dashed #9fb0c8; overflow: hidden; touch-action: none; }
.pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.pad-ligne { position: absolute; left: 6%; right: 6%; bottom: 22%; border-bottom: 1px solid #c9d4e3; pointer-events: none; }
.pad-aide { position: absolute; left: 7%; bottom: 8%; font: 600 11px var(--f-t); letter-spacing: .14em; text-transform: uppercase; color: #9fb0c8; pointer-events: none; }
.pad.plein .pad-aide { display: none; }
.pad-bas { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pad-msg { margin: 0; color: var(--crit); font-size: 13px; }
.sig-apercu { background: #fbfcfe; border-radius: 12px; border: 1px solid var(--ligne); padding: 6px; display: inline-block; max-width: 100%; }
.sig-apercu svg { display: block; max-width: 100%; height: auto; }
.serie { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--ligne); background: var(--creux); margin-bottom: 10px; }
.serie-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.serie-h b { font-size: 14px; }
.serie .jauge { height: 10px; }
.serie .jauge i.prevu { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--menthe) 45%, transparent) 0 6px, transparent 6px 9px); }
.jauge-d { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--fort) 6%, transparent); }
.jauge-d i { display: block; height: 100%; }
.jauge-d .fait { background: var(--menthe); } .jauge-d .prevu { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--menthe) 50%, transparent) 0 6px, transparent 6px 9px); }
.etat.a_renouveler, .etat.signe, .etat.lu { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.etat.active, .etat.envoye { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); }
.etat.terminee, .etat.contresigne, .etat.close { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.etat.refuse { color: var(--crit); background: color-mix(in srgb, var(--crit) 12%, transparent); }
.frise { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--ligne); display: grid; gap: 12px; }
.frise li { position: relative; font-size: 13px; }
.frise li::before { content: ''; position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ligne2); }
.frise li.ok::before { background: var(--menthe); box-shadow: 0 0 0 3px color-mix(in srgb, var(--menthe) 22%, transparent); }
.frise small { display: block; color: var(--muted); }
.empreinte { font: 500 11px ui-monospace, monospace; word-break: break-all; color: var(--txt2); }
