/* AXION VISION : éléments propres à la vidéosurveillance (même charte que SYNERGY PLAY et WAN PULSE) */

/* Pastilles d'état des clubs */
.pill[class*="vst-"] { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--pilule, 999px); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.pill.vst-ok { background: var(--ok-soft, #dff5ea); color: var(--ok, #138a55); }
.pill.vst-degrade { background: var(--orange-clair, #fff1dc); color: var(--orange, #b8660b); }
.pill.vst-hors_ligne { background: #fde4e4; color: var(--bad, #c62828); }
.pill.vst-attente, .pill.vst-a_configurer, .pill.vst-non_supervise { background: var(--gris-clair, #e8edec); color: var(--texte-2, #5d6563); }

.note-acces a { font-weight: 700; margin-left: 6px; }

/* Cartes des clubs */
.vision-clubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 18px 0; }
.vision-carte { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--carte, #fff); border: 1px solid var(--bord); border-radius: var(--rayon, 14px); box-shadow: var(--ombre); color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.vision-carte:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .08); }
.vc-tete { display: flex; align-items: center; gap: 10px; }
.vc-nom { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.vc-nom b { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-nom small { color: var(--texte-2); font-size: .82rem; }
.vc-etat { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.vc-detail { color: var(--texte-2); font-size: .85rem; }
.vc-chiffres { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--texte-2); border-top: 1px solid var(--bord); padding-top: 10px; }
.vc-chiffres i { font-style: normal; margin-right: 4px; }
.vision-filtre .input { width: 220px; }

/* Deux colonnes : technique / incidents */
.vision-deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-top: 18px; align-items: start; }
.vision-colonne { display: flex; flex-direction: column; gap: 16px; }
.vision-ligne { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--bord); font-size: .9rem; }
.vision-ligne:last-child { border-bottom: 0; }
.vision-ligne > span:last-child { display: flex; flex-direction: column; }
.vision-ligne small { color: var(--texte-2); font-size: .78rem; }
.vision-ligne .state-dot { margin-top: 5px; flex: none; }
.vision-faits { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; margin: 0; }
.vision-faits dt { font-size: .75rem; color: var(--texte-2); text-transform: uppercase; letter-spacing: .04em; }
.vision-faits dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.vision-sous { margin: 18px 0 8px; font-size: 1rem; }
.vision-disque { display: grid; grid-template-columns: 1fr 140px auto; gap: 10px; align-items: center; padding: 6px 0; font-size: .88rem; }
.vision-disque.etat-panne b { color: var(--bad, #c62828); }
.vision-jauge { display: block; height: 8px; border-radius: 999px; background: var(--gris-clair); overflow: hidden; min-width: 80px; }
.vision-jauge i { display: block; height: 100%; background: var(--accent, var(--bleu)); border-radius: inherit; transition: width .4s ease; }
.vision-cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.vision-cam { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; }
.vision-cam > span:last-child { display: flex; flex-direction: column; }
.vision-cam small { color: var(--texte-2); font-size: .76rem; }
.vision-cam.masquee { opacity: .55; }
.toggle-ligne { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--texte-2); }
.vision-config h2 { margin-top: 0; }
.vision-reglage-cams { margin-top: 18px; }
.input-court { width: 70px; text-align: center; }
.danger-zone { margin-top: 18px; }
.nvr-reglage { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.nvr-reglage div { background: var(--surface-2); border: 1px solid var(--bord); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.nvr-reglage span { font-size: .75rem; color: var(--texte-2); text-transform: uppercase; letter-spacing: .04em; }
.liste-inconnus { margin: 0; padding-left: 18px; }
.input-suffixe { display: flex; align-items: center; gap: 8px; }
.input-suffixe .input { width: 110px; }
.input-suffixe span { color: var(--texte-2); font-size: .9rem; }

/* Mosaïque des caméras */
.vision-mosaique { display: grid; grid-template-columns: repeat(var(--colonnes, 3), minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
@media (max-width: 1100px) { .vision-mosaique { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .vision-mosaique { grid-template-columns: 1fr; } }
.vision-tuile { margin: 0; background: var(--carte, #fff); border: 1px solid var(--bord); border-radius: var(--rayon, 14px); overflow: hidden; box-shadow: var(--ombre); }
.vt-ecran { position: relative; aspect-ratio: 16 / 9; background: #0b1110; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.vt-repos { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #c9d4d1; text-align: center; padding: 10px; background: radial-gradient(circle at 50% 40%, rgba(0, 163, 140, .18), transparent 65%); }
.vision-tuile.en-direct .vt-repos { display: none; }
.vt-lancer { width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); background: rgba(0, 163, 140, .85); color: #fff; font-size: 1.4rem; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.vt-lancer:hover { transform: scale(1.08); background: var(--bleu, #00a38c); }
.vision-tuile.en-cours .vt-lancer { animation: vt-pulse 1s ease-in-out infinite; }
@keyframes vt-pulse { 50% { transform: scale(.9); opacity: .6; } }
.vt-message { font-size: .85rem; }
.vision-tuile figcaption { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: .88rem; }
.vision-tuile figcaption b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vision-tuile figcaption small { color: var(--texte-2); font-size: .78rem; white-space: nowrap; }
.vt-actions { margin-left: auto; display: flex; gap: 4px; }
.vt-btn { border: 1px solid var(--bord); background: var(--surface-2); border-radius: 8px; padding: 2px 8px; cursor: pointer; color: inherit; text-decoration: none; font-size: .85rem; line-height: 1.5; }
.vt-btn:hover { background: var(--survol); }
vision-flux { position: absolute; inset: 0; display: block; background: #000; cursor: zoom-in; }
vision-flux video { width: 100%; height: 100%; object-fit: contain; display: block; }
vision-flux video::-webkit-media-controls { display: none !important; }
.vf-etat { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #d5dedc; font-size: .85rem; background: rgba(0, 0, 0, .55); padding: 6px 12px; border-radius: 999px; }
vision-flux.en-lecture::after { content: "● DIRECT"; position: absolute; top: 8px; left: 8px; font-size: .7rem; font-weight: 800; color: #fff; background: rgba(214, 60, 60, .9); padding: 2px 8px; border-radius: 6px; letter-spacing: .05em; }
.vr-ecran vision-flux.en-lecture::after { content: "⏪ RELECTURE"; background: rgba(0, 101, 86, .9); }

/* Plein écran */
.vision-plein { width: min(1280px, 96vw); max-height: 94vh; padding: 0; border: 0; border-radius: 14px; background: #000; color: #fff; overflow: hidden; }
.vision-plein::backdrop { background: rgba(0, 0, 0, .78); }
.vp-tete { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #111; }
.vp-tete b { flex: 1; }
.vp-qualite { font-size: .7rem; font-weight: 800; background: var(--bleu, #00a38c); color: #fff; padding: 2px 7px; border-radius: 6px; }
.vp-ecran { position: relative; aspect-ratio: 16 / 9; max-height: calc(94vh - 52px); }
.vp-ecran vision-flux { cursor: default; }

/* Mur d'images */
.vision-choix-clubs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.vision-puce { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--bord); border-radius: 999px; background: var(--carte, #fff); cursor: pointer; font-size: .88rem; }
.vision-puce:has(input:checked) { border-color: var(--bleu); background: var(--bleu-clair, #dcf6f1); font-weight: 700; }
.vision-puce input { accent-color: var(--bleu); }
.vision-mur-club h2 { font-size: 1.05rem; margin: 18px 0 0; }
.vision-mur-club h2 a { color: inherit; }

/* Relecture */
.vision-relecture { display: flex; flex-direction: column; gap: 14px; }
.vr-choix { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.vr-choix .input { width: auto; }
.vr-heure, .vr-jour { display: inline-flex; gap: 6px; align-items: center; }
.vr-fleche { width: 36px; padding: 0; justify-content: center; font-size: 1.2rem; font-weight: 700; }
.vr-lecteur { max-width: 1100px; width: 100%; margin: 0 auto; background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon, 14px); overflow: hidden; box-shadow: var(--ombre); }
.vr-lecteur:fullscreen { max-width: none; border-radius: 0; display: flex; flex-direction: column; background: #000; }
.vr-lecteur:fullscreen .vr-ecran { flex: 1; aspect-ratio: auto; }
.vr-lecteur:fullscreen .vr-commandes { background: #111; color: #fff; border-top-color: #222; }
.vr-lecteur:fullscreen .vr-instant small { color: #9fb0ac; }
.vr-lecteur:fullscreen .vr-btn:not(.vr-lecture) { background: #1f2a28; border-color: #33423e; color: #e8efed; }
.vr-lecteur:fullscreen .vr-btn:not(.vr-lecture):hover { background: #2a3936; }
.vr-lecteur:fullscreen .segmented { background: #1f2a28; }
.vr-lecteur:fullscreen .segmented button { color: #b9c7c3; }
.vr-lecteur:fullscreen .segmented button.on { background: var(--bleu, #00a38c); color: #fff; }
.vr-commandes { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--bord); }
.vr-instant { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.vr-instant b { font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.vr-instant small { color: var(--texte-2); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vr-transport { display: flex; align-items: center; justify-content: center; gap: 6px; }
.vr-options { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.vr-btn { height: 34px; min-width: 34px; padding: 0 10px; border: 1px solid var(--bord); background: var(--surface-2); color: inherit; border-radius: 9px; font-size: .82rem; font-weight: 650; cursor: pointer; font-variant-numeric: tabular-nums; transition: background .15s, transform .1s; }
.vr-btn:hover { background: var(--survol, #e6efed); }
.vr-btn:active { transform: scale(.96); }
.vr-btn.vr-lecture { width: 46px; height: 46px; border-radius: 50%; font-size: 1.1rem; background: var(--bleu, #00a38c); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(0, 163, 140, .35); }
.vr-btn.vr-lecture:hover { filter: brightness(1.07); background: var(--bleu, #00a38c); }
.vr-qualite button, .vr-vitesse button { font-size: .8rem; padding: 4px 9px; }
.vr-qualite button:disabled { opacity: .45; cursor: not-allowed; }

.vr-frise-zone { max-width: 1100px; width: 100%; margin: 0 auto; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.vr-frise-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.vr-legende { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--texte-2); }
.vr-legende span { display: inline-flex; align-items: center; gap: 6px; }
.vr-legende i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-enr { background: var(--bleu, #00a38c); }
.lg-mvt { background: var(--orange, #e69018); }
.lg-lec { width: 3px !important; height: 14px !important; background: var(--bad, #d63c3c); border-radius: 2px !important; }
.lg-sel { background: rgba(47, 91, 234, .25); border: 1px solid #2f5bea; }
.vr-zoom { display: flex; align-items: center; gap: 8px; }
.vr-zoom .segmented button { font-size: .8rem; padding: 4px 10px; }

.vr-frise { position: relative; height: 78px; border-radius: 12px; overflow: hidden; cursor: pointer; user-select: none; touch-action: none;
    background: repeating-linear-gradient(135deg, var(--gris-clair, #e8edec) 0 6px, #f3f6f5 6px 12px); border: 1px solid var(--bord); }
.vr-frise.glisse { cursor: grabbing; }
.vr-calque { position: absolute; inset: 0; pointer-events: none; }
[data-vr-plages] i { position: absolute; top: 12px; height: 34px; background: linear-gradient(180deg, #1fc4a9, var(--bleu, #00a38c)); border-radius: 5px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08); }
[data-vr-evenements] i { position: absolute; top: 12px; height: 8px; background: var(--orange, #e69018); border-radius: 5px 5px 0 0; opacity: .95; }
.vr-graduations { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; pointer-events: none; }
.vr-graduations span { position: absolute; bottom: 0; transform: translateX(-50%); font-size: .7rem; color: var(--texte-2); padding-bottom: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vr-graduations span::before { content: ""; position: absolute; left: 50%; bottom: 17px; width: 1px; height: 8px; background: rgba(0, 0, 0, .25); }
.vr-graduations span.mineur { font-size: 0; }
.vr-graduations span.mineur::before { height: 4px; bottom: 3px; background: rgba(0, 0, 0, .18); }
.vr-curseur, .vr-survol { position: absolute; top: 0; bottom: 0; width: 2px; transform: translateX(-1px); pointer-events: none; }
.vr-curseur { background: var(--bad, #d63c3c); box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); z-index: 3; }
.vr-curseur::before { content: ""; position: absolute; top: -1px; left: -5px; border: 6px solid transparent; border-top-color: var(--bad, #d63c3c); }
.vr-survol { background: rgba(0, 0, 0, .45); z-index: 2; }
.vr-curseur span, .vr-survol span { position: absolute; top: 4px; left: 6px; font-size: .72rem; font-weight: 750; padding: 2px 7px; border-radius: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vr-curseur span { background: var(--bad, #d63c3c); color: #fff; }
.vr-survol span { background: #1d2624; color: #fff; }
.vr-curseur.a-gauche span, .vr-survol.a-gauche span { left: auto; right: 6px; }
.vr-selection { position: absolute; top: 0; bottom: 0; background: rgba(47, 91, 234, .16); border-left: 2px solid #2f5bea; border-right: 2px solid #2f5bea; pointer-events: none; z-index: 1; }

.vr-apercu { position: relative; height: 14px; border-radius: 7px; background: var(--gris-clair, #e8edec); cursor: pointer; overflow: hidden; }
[data-vr-apercu-plages] i { position: absolute; top: 4px; height: 6px; background: var(--bleu, #00a38c); opacity: .55; border-radius: 3px; }
.vr-fenetre { position: absolute; top: 0; bottom: 0; border: 2px solid var(--bleu, #00a38c); border-radius: 7px; background: rgba(0, 163, 140, .12); pointer-events: none; min-width: 6px; }
.vr-apercu-curseur { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad, #d63c3c); pointer-events: none; }
.vr-frise-pied { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.vr-aide { opacity: .8; }
.vr-export { max-width: 1100px; width: 100%; margin: 0 auto; }
@media (max-width: 1180px) {
    .vr-commandes { grid-template-columns: 1fr auto; }
    .vr-transport { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
    .vr-commandes { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .vr-options { justify-content: center; }
    .vr-transport { flex-wrap: wrap; }
    .vr-aide { display: none; }
}
.vision-filtres { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.vision-filtres .input { width: auto; min-width: 150px; }

/* Téléphone : pas de débordement */
@media (max-width: 760px) {
    .vision-filtre .input { width: 100%; }
    .vision-disque { grid-template-columns: 1fr; gap: 4px; }
    .vision-deux { grid-template-columns: 1fr; }
}

.data .input.input-court { width: 72px; margin: 0 auto; }
.vision-case { width: 20px; height: 20px; accent-color: var(--bleu, #00a38c); cursor: pointer; }
.vr-choix .input { width: auto !important; flex: 0 0 auto; }

/* 🖥️ Mur d'images façon SmartPSS : arborescence + dispositions */
.vm { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.vm-arbre { display: flex; flex-direction: column; background: var(--carte, #fff); border: 1px solid var(--bord); border-radius: var(--rayon, 14px); box-shadow: var(--ombre); overflow: hidden; height: calc(100vh - 190px); min-height: 460px; }
.vm-arbre-tete { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-bottom: 1px solid var(--bord); }
.vm-arbre-tete .input { width: 100%; height: 34px; }
.vm-liste { flex: 1; overflow-y: auto; padding: 6px 0; }
.vm-club > button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 12px; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 700; color: inherit; text-align: left; user-select: none; }
.vm-club > button:hover { background: var(--survol, #eef4f2); }
.vm-club > button .vm-fleche { width: 12px; font-size: .7rem; color: var(--texte-2); transition: transform .15s; }
.vm-club.ouvert > button .vm-fleche { transform: rotate(90deg); }
.vm-club > button small { margin-left: auto; color: var(--texte-2); font-weight: 600; font-size: .75rem; }
.vm-cams { display: none; padding-bottom: 4px; }
.vm-club.ouvert .vm-cams { display: block; }
.vm-cam { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 34px; cursor: grab; font-size: .88rem; user-select: none; }
.vm-cam:hover { background: var(--survol, #eef4f2); }
.vm-cam.affichee b { color: var(--bleu, #00a38c); }
.vm-cam.affichee::after { content: "●"; margin-left: auto; font-size: .6rem; color: var(--bleu, #00a38c); }
.vm-cam b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-astuce { padding: 9px 12px; font-size: .75rem; color: var(--texte-2); border-top: 1px solid var(--bord); text-align: center; }

.vm-principal { display: flex; flex-direction: column; height: calc(100vh - 190px); min-height: 460px; background: #0d1312; border-radius: var(--rayon, 14px); overflow: hidden; box-shadow: var(--ombre); }
.vm-principal:fullscreen { height: 100vh; border-radius: 0; }
.vm-grille { flex: 1; display: grid; gap: 2px; padding: 2px; background: #1b2422; min-height: 0; }
.vm-case { position: relative; background: #050807; overflow: hidden; outline: 2px solid transparent; outline-offset: -2px; cursor: pointer; min-width: 0; min-height: 0; }
.vm-case.choisie { outline-color: var(--bleu, #00a38c); }
.vm-case.survol-depot { outline-color: #f5b83d; outline-style: dashed; }
.vm-case vision-flux { cursor: pointer; }
.vm-case vision-flux.en-lecture::after { font-size: .6rem; top: 6px; left: 6px; padding: 1px 6px; }
.vm-vide { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #50605c; font-size: 1.6rem; pointer-events: none; text-align: center; padding: 8px; }
.vm-vide small { font-size: .72rem; }
.vm-case.occupee .vm-vide { display: none; }
.vm-message { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; color: #d5dedc; font-size: .78rem; text-align: center; max-width: 90%; z-index: 2; }
.vm-message:empty { display: none; }
.vm-message button { border: 1px solid rgba(255, 255, 255, .3); background: rgba(0, 163, 140, .85); color: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: .78rem; }
.vm-etiquette { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 14px 8px 5px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; font-size: .75rem; pointer-events: none; z-index: 2; white-space: nowrap; overflow: hidden; }
.vm-etiquette b { overflow: hidden; text-overflow: ellipsis; }
.vm-etiquette small { opacity: .7; overflow: hidden; text-overflow: ellipsis; }
.vm-case:not(.occupee) .vm-etiquette { display: none; }
.vm-outils { position: absolute; top: 5px; right: 5px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; z-index: 3; }
.vm-case.occupee:hover .vm-outils, .vm-case.occupee.choisie .vm-outils { opacity: 1; }
.vm-outils > * { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 7px; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; font-size: .78rem; text-decoration: none; }
.vm-outils > *:hover { background: var(--bleu, #00a38c); }

.vm-barre { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 8px 12px; background: #141c1a; border-top: 1px solid #222d2a; }
.vm-vues { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vm-vues .input { height: 32px; max-width: 220px; background: #1d2725; border-color: #2c3936; color: #e4ecea; font-size: .82rem; }
.vm-dispositions { display: flex; gap: 4px; justify-content: center; }
.vm-actions { display: flex; gap: 6px; justify-content: flex-end; }
.vm-icone, .vm-dispo { height: 32px; min-width: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #2c3936; background: #1d2725; color: #dfe8e6; border-radius: 8px; cursor: pointer; font-size: .85rem; }
.vm-icone:hover, .vm-dispo:hover { background: #26332f; }
.vm-dispo svg { width: 20px; height: 20px; display: block; }
.vm-dispo svg rect { fill: none; stroke: currentColor; stroke-width: 1.4; }
.vm-dispo.on { background: var(--bleu, #00a38c); border-color: transparent; color: #fff; }
@media (max-width: 900px) {
    .vm { grid-template-columns: 1fr; }
    .vm-arbre { height: auto; min-height: 0; max-height: 260px; }
    .vm-principal { height: 70vh; min-height: 360px; }
    .vm-barre { grid-template-columns: 1fr; justify-items: center; }
    .vm-dispositions { flex-wrap: wrap; }
}
.vm-outils > [hidden], .vm-icone[hidden] { display: none; }

/* 🔔 Événements */
.ev-filtres { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; margin: 14px 0; }
.ev-ligne { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.ev-ligne .input { width: auto; }
.ev-periode { display: inline-flex; gap: 8px; align-items: center; }
.ev-periode label { display: inline-flex; gap: 6px; align-items: center; font-size: .85rem; color: var(--texte-2); }
.ev-types { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ev-n { margin-left: 4px; background: var(--gris-clair, #e8edec); border-radius: 999px; padding: 0 6px; font-size: .72rem; font-weight: 700; }
.ev-boutons { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ev-entete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 2px 10px; }
.ev-direct { color: var(--bad, #d63c3c); font-weight: 700; font-size: .82rem; animation: wp-clignote 2.4s ease-in-out infinite; }
.ev-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ev-jour { grid-column: 1 / -1; font-weight: 750; font-size: .95rem; margin: 8px 2px 0; color: var(--texte-2); text-transform: capitalize; }
.ev-carte { display: flex; flex-direction: column; background: var(--carte, #fff); border: 1px solid var(--bord); border-radius: 12px; overflow: hidden; box-shadow: var(--ombre); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.ev-carte:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .08); }
.ev-carte.nouveau { animation: ev-arrivee 1.2s ease; }
@keyframes ev-arrivee { from { box-shadow: 0 0 0 3px var(--bleu, #00a38c); } }
.ev-image { position: relative; aspect-ratio: 16 / 9; background: #0b1110 center / cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #4f625d; }
.ev-badge { position: absolute; top: 8px; left: 8px; font-size: .72rem; font-weight: 750; padding: 2px 8px; border-radius: 999px; color: #fff; background: rgba(0, 0, 0, .6); }
.ev-badge.orange { background: rgba(230, 144, 24, .95); }
.ev-badge.rouge { background: rgba(214, 60, 60, .95); }
.ev-badge.bleu { background: rgba(0, 120, 200, .9); }
.ev-alerte { position: absolute; top: 8px; right: 8px; font-size: .72rem; font-weight: 750; padding: 2px 8px; border-radius: 999px; background: #fff; color: var(--bad, #d63c3c); }
.ev-corps { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px 10px; }
.ev-corps b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-corps small { color: var(--texte-2); font-size: .78rem; display: flex; justify-content: space-between; gap: 6px; }
.ev-visionneuse { width: min(1000px, 96vw); padding: 0; border: 0; border-radius: 14px; background: #0d1312; color: #fff; overflow: hidden; }
.ev-visionneuse::backdrop { background: rgba(0, 0, 0, .78); }
.ev-v-tete, .ev-v-pied { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: #141c1a; }
.ev-visionneuse img { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #000; }
@media (max-width: 640px) { .ev-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ev-periode { flex-wrap: wrap; justify-content: center; } }
.ex-lien { display: flex; gap: 8px; }
.ex-lien .input { flex: 1; font-size: .78rem; }
.vision-actions-nvr { margin-top: 12px; gap: 8px; flex-wrap: wrap; }

/* 📊 Rapports */
.rp-mois .input { width: auto; }
.rp-dispo { font-weight: 800; }
.rp-dispo.ok, .rp-chiffre b.ok { color: var(--ok, #138a55); }
.rp-dispo.moyen, .rp-chiffre b.moyen { color: var(--orange, #b8660b); }
.rp-dispo.mauvais, .rp-chiffre b.mauvais { color: var(--bad, #c62828); }
.rp-chiffres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.rp-chiffre { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; background: var(--carte, #fff); border: 1px solid var(--bord); border-radius: var(--rayon, 14px); box-shadow: var(--ombre); text-align: center; }
.rp-chiffre b { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.rp-chiffre span { color: var(--texte-2); font-size: .82rem; }
.rp-pied { text-align: center; margin: 14px 0; }
@media (max-width: 760px) { .rp-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print {
    .topbar, .lateral, .no-print, .bulle, #toasts { display: none !important; }
    main.container { margin: 0 !important; padding: 0 !important; max-width: none !important; }
    body { background: #fff !important; }
    .panel, .rp-chiffre { box-shadow: none !important; break-inside: avoid; }
}

/* 🗺️ Plan de la salle */
.plan { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; }
.plan-liste { width: 230px; flex: none; display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--carte, #fff); border: 1px solid var(--bord); border-radius: var(--rayon, 14px); box-shadow: var(--ombre); }
.plan-liste[hidden] { display: none; }
.plan-cam { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--bord); border-radius: 8px; background: var(--surface-2); cursor: grab; font-size: .85rem; user-select: none; }
.plan-cam.posee { opacity: .55; }
.plan-liste-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.plan-liste-actions form .btn { width: 100%; }
.plan-zone { position: relative; flex: 1; min-width: 0; background: var(--carte, #fff); border: 1px solid var(--bord); border-radius: var(--rayon, 14px); box-shadow: var(--ombre); overflow: hidden; }
.plan-zone img { display: block; width: 100%; height: auto; user-select: none; }
.plan-marque { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px; background: rgba(13, 19, 18, .88); color: #fff; font-size: .78rem; font-weight: 650; cursor: pointer; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); border: 2px solid var(--bleu, #00a38c); user-select: none; touch-action: none; }
.plan-marque:hover { background: var(--bleu, #00a38c); }
.plan.edition .plan-marque { cursor: move; border-style: dashed; }
.plan.edition .plan-zone { outline: 3px dashed var(--bleu, #00a38c); outline-offset: -3px; }
@media (max-width: 760px) { .plan { flex-direction: column; } .plan-liste { width: 100%; } }

/* 🔍 Zoom numérique, 🔊 son */
vision-flux { overflow: hidden; }
vision-flux video { transition: transform .05s linear; will-change: transform; }
vision-flux.zoome { cursor: grab; }
vision-flux.zoome:active { cursor: grabbing; }
.vf-zoom, .vf-son { position: absolute; z-index: 4; border: 0; border-radius: 8px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .74rem; font-weight: 700; padding: 3px 8px; cursor: pointer; }
.vf-zoom { bottom: 8px; right: 8px; }
.vf-son { bottom: 8px; left: 8px; font-size: .9rem; padding: 2px 7px; }
.vf-zoom:hover, .vf-son:hover { background: var(--bleu, #00a38c); }
.vm-case .vf-son { bottom: 28px; }
.vm-icone.on, .vm-outils > .on { background: var(--bleu, #00a38c); border-color: transparent; color: #fff; }
.vm-ptz { position: absolute; right: 8px; bottom: 30px; z-index: 5; display: grid; grid-template-columns: repeat(3, 34px); gap: 4px; padding: 8px; background: rgba(0, 0, 0, .55); border-radius: 12px; backdrop-filter: blur(3px); }
.vm-ptz[hidden] { display: none; }
.vm-ptz button { width: 34px; height: 34px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .14); color: #fff; font-size: .9rem; cursor: pointer; touch-action: none; user-select: none; }
.vm-ptz button:active { background: var(--bleu, #00a38c); }
.vm-ptz-zoom { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; color: #cfd9d6; font-size: .72rem; }

/* 🎬 Relecture synchronisée */
.vr-avec { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.vr-avec .input { width: auto; height: 34px; font-size: .85rem; }
.vr-avec-puce button { border: 0; background: none; cursor: pointer; color: var(--texte-2); padding: 0 0 0 4px; }
.vr-ecran.vr-multi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 2px; background: #1b2422; align-items: stretch; justify-items: stretch; }
.vr-ecran.vr-multi[style*="--vr-n: 2"] { grid-template-rows: 1fr; }
.vr-sous { position: relative; background: #050807; min-height: 0; overflow: hidden; }
.vr-ecran:not(.vr-multi) .vr-sous { position: absolute; inset: 0; }
.vr-sous-nom { position: absolute; left: 8px; bottom: 6px; z-index: 3; color: #fff; font-size: .75rem; font-weight: 700; background: rgba(0, 0, 0, .55); padding: 2px 8px; border-radius: 6px; pointer-events: none; }
/* 🫥 Floutage */
.ex-flou { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; padding: 12px; border: 1px dashed var(--bord); border-radius: 12px; }
.ex-flou-tete { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.ex-flou-zone { position: relative; max-width: 640px; margin: 0 auto; width: 100%; cursor: crosshair; user-select: none; touch-action: none; border-radius: 8px; overflow: hidden; background: #0b1110; }
.ex-flou-zone[hidden] { display: none; }
.ex-flou-zone img { display: block; width: 100%; min-height: 120px; }
.flou-rect { position: absolute; background: rgba(47, 91, 234, .25); border: 2px solid #2f5bea; backdrop-filter: blur(6px); }
.flou-rect button { position: absolute; top: -10px; right: -10px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--bad, #d63c3c); color: #fff; font-size: .65rem; cursor: pointer; }
.flou-rect.trace { pointer-events: none; }
.ex-flou-tete .cell-sub { flex: 1 1 260px; }
