/* ============================================================
   veille.css — Le panneau « Veille » de l'app Caméras.
   Une dalle de verre SOMBRE posée sur le canevas clair du HUB :
   même matière que les tuiles caméra, donc ça ne fait pas rapporté.
   C'est le contraste qui fait exister le panneau, pas un cadre.
   ⚠️ Chargé APRÈS cameras.css — il réutilise ses variables (--cam-vif…).
   ============================================================ */

.vl {
  position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 26px;
  /* deux halos : rouge à gauche (l'urgence), violet à droite (l'app) */
  background:
    radial-gradient(90% 130% at 8% -20%, rgba(240, 80, 110, .20), transparent 55%),
    radial-gradient(70% 120% at 92% -10%, rgba(108, 92, 231, .18), transparent 58%),
    linear-gradient(168deg, #16202c 0%, #0a0f16 100%);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .09) inset, 0 22px 48px -26px rgba(4, 10, 20, .95);
}
/* le reflet oblique : c'est lui qui donne la matière « verre » */
.vl::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(152deg, rgba(255, 255, 255, .10) 0%, transparent 30%);
}
.vl__in { position: relative; padding: 20px 22px 22px; }

/* ---------- en-tête ---------- */
.vl__tete { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.vl__pt {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--danger); box-shadow: 0 0 0 4px rgba(240, 80, 110, .18);
  animation: vl-puls 1.7s ease-in-out infinite;
}
/* pile vide : le point passe au vert et cesse de battre */
.vl--calme .vl__pt { background: var(--cam-vif, #35e0a1); box-shadow: 0 0 0 4px rgba(53, 224, 161, .16); animation: none; }
@keyframes vl-puls { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }

.vl__t { font-size: 15.5px; font-weight: 750; color: #eef4fa; letter-spacing: -.01em; }
.vl__n {
  font-size: 12.5px; font-weight: 800; color: #0a0f16; background: var(--cam-vif, #35e0a1);
  border-radius: 999px; padding: 2px 10px; font-variant-numeric: tabular-nums;
}
.vl--calme .vl__n { background: rgba(255, 255, 255, .14); color: #7f93a8; }
.vl__s { font-size: 12.5px; color: #7f93a8; }

/* Le comptage d'entrées/sorties : un état, pas une alerte — donc discret,
   dans l'en-tête, et jamais affiché tant que l'analyseur n'a rien envoyé. */
.vl__c {
  font-size: 12.5px; color: #93a9bf;
  background: rgba(53, 224, 161, .10); border: 1px solid rgba(53, 224, 161, .22);
  border-radius: 999px; padding: 4px 12px; font-variant-numeric: tabular-nums;
}
.vl__cN { color: var(--cam-vif, #35e0a1); font-weight: 800; font-size: 13.5px; }
/* le même bandeau, en ATTENTE : gris, sans le liseré vert — on voit que la
   fonction existe et ce qui manque pour qu'elle s'allume. */
.vl__c--off { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .10); color: #7f93a8; }

.vl__f { margin-left: auto; display: inline-flex; gap: 5px; }
.vl__fb {
  font-size: 12px; font-weight: 650; color: #93a9bf;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 999px; padding: 5px 12px; transition: color .15s, border-color .15s, background .15s;
}
.vl__fb:hover { color: #dfe8f2; border-color: rgba(255, 255, 255, .2); }
.vl__fb--on { background: rgba(255, 255, 255, .92); color: #0f151d; border-color: transparent; }

/* ---------- la grille de cartes ---------- */
.vl__grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(292px, 1fr)); gap: 14px; }
.vl__grille > * { min-width: 0; }

/* ---------- une carte : dalle de verre TEINTÉE par son type ----------
   La teinte (--tn) irrigue le halo, le voile sur l'image, la bordure,
   la pastille et le bouton principal : la couleur arrive avant le texte. */
.k {
  position: relative; border-radius: 15px; overflow: hidden; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 80% at 50% -14%, color-mix(in srgb, var(--tn) 32%, transparent), transparent 62%),
    linear-gradient(170deg, #18222e 0%, #0d131b 100%);
  border: 1px solid color-mix(in srgb, var(--tn) 26%, rgba(255, 255, 255, .07));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 10px 26px -16px rgba(2, 6, 12, .95);
  transition: transform .24s cubic-bezier(.2, .9, .3, 1), box-shadow .24s, border-color .24s, opacity .3s;
}
.k:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--tn) 52%, transparent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset,
    0 20px 40px -20px color-mix(in srgb, var(--tn) 55%, transparent),
    0 14px 34px -18px rgba(2, 6, 12, .9);
}
/* une alerte salarié n'est pas « une carte de plus » : elle a son propre anneau */
.k--urg {
  border-color: color-mix(in srgb, var(--tn) 62%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tn) 45%, transparent),
    0 1px 0 rgba(255, 255, 255, .09) inset,
    0 16px 34px -18px color-mix(in srgb, var(--tn) 50%, transparent);
}
/* la carte qu'on vient de classer s'en va : elle ne reste pas cochée */
.k--part { transform: translateY(-10px) scale(.97); opacity: 0; }

/* ---------- la vue caméra ---------- */
.k__vue { position: relative; aspect-ratio: 16 / 9; background: var(--cam-noir, #080b10); overflow: hidden; cursor: zoom-in; }
.k__vue img, .k__vue svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.k__voile {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(6, 10, 16, .9) 0%, transparent 46%),
    radial-gradient(80% 60% at 50% 108%, color-mix(in srgb, var(--tn) 34%, transparent), transparent 70%);
}
.k__horo {
  position: absolute; right: 8px; top: 7px; font: 10.5px/1 ui-monospace, Consolas, monospace;
  color: #c6d8e8; background: rgba(4, 8, 13, .62); border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 5px; padding: 3px 7px; letter-spacing: .02em;
}
.k__cam {
  position: absolute; left: 10px; bottom: 9px; font-size: 11px; font-weight: 700;
  color: #e8f1f8; letter-spacing: .02em; text-shadow: 0 1px 5px rgba(0, 0, 0, .8);
}
.k__live {
  position: absolute; left: 10px; top: 8px; display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: #0a0f16; background: var(--tn); border-radius: 999px; padding: 3px 8px;
}
.k__loupe {
  position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s;
  background: rgba(5, 9, 15, .42); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .03em;
}
.k__vue:hover .k__loupe { opacity: 1; }

/* ---------- le corps ---------- */
.k__c { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.k__type {
  align-self: flex-start; font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase;
  color: color-mix(in srgb, var(--tn) 72%, #ffffff);
  background: color-mix(in srgb, var(--tn) 17%, rgba(255, 255, 255, .04));
  border: 1px solid color-mix(in srgb, var(--tn) 30%, transparent);
  border-radius: 999px; padding: 3px 9px;
}
.k__ti { font-size: 15.5px; font-weight: 700; color: #f1f6fb; letter-spacing: -.012em; margin-top: 9px; line-height: 1.3; }

/* LE CHIFFRE : on lit l'écart avant de lire la phrase. */
.k__stat { display: flex; align-items: baseline; gap: 8px; margin-top: 9px; }
.k__gros {
  font-size: 27px; font-weight: 800; letter-spacing: -.03em; line-height: 1;
  color: color-mix(in srgb, var(--tn) 60%, #ffffff); font-variant-numeric: tabular-nums;
}
.k__u { font-size: 12px; color: #8fa5ba; font-weight: 600; }
.k__u b { color: color-mix(in srgb, var(--tn) 55%, #ffffff); font-weight: 700; }

.k__d { font-size: 12.5px; color: #93a9bf; margin-top: 8px; line-height: 1.5; }
.k__r {
  font-size: 12px; color: #7f93a8; margin-top: 9px; padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, .07); line-height: 1.5;
}
.k__r b { color: color-mix(in srgb, var(--tn) 66%, #ffffff); font-weight: 700; }

.k__a { margin-top: 13px; display: flex; gap: 7px; flex-wrap: wrap; }
.k__b {
  font-size: 12.5px; font-weight: 650; border-radius: 9px; padding: 8px 14px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .11);
  color: #c9dae9; transition: background .15s, color .15s;
}
.k__b:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.k__b--p { background: var(--tn); border-color: transparent; color: #0a0f16; font-weight: 750; }
.k__b--p:hover { background: color-mix(in srgb, var(--tn) 84%, #ffffff); color: #0a0f16; }

/* le mot que la pile renvoie quand on classe : c'est ce qui rend
   l'auto-réglage visible au lieu de le laisser invisible. */
.k__ap { margin-top: 10px; font-size: 12px; color: var(--cam-vif, #35e0a1); font-weight: 650; display: none; }
.k__ap.on { display: block; animation: vl-fade .3s; }
@keyframes vl-fade { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* ---------- pile vide : le panneau se réduit à un ruban ---------- */
.vl__vide { display: none; align-items: center; gap: 13px; }
.vl--calme .vl__vide { display: flex; }
.vl--calme .vl__grille { display: none; }
.vl__vide .r {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: rgba(53, 224, 161, .14); color: var(--cam-vif, #35e0a1);
  border: 1px solid rgba(53, 224, 161, .24);
}
.vl__vide .r svg { width: 20px; height: 20px; }
.vl__vide h3 { font-size: 15px; color: #eef4fa; font-weight: 700; }
.vl__vide p { font-size: 12.5px; color: #7f93a8; margin-top: 1px; }

/* ---------- le journal du jour ---------- */
.vl__j { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.vl__jt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #6f8399; font-weight: 800; margin-bottom: 6px; }
.vl__l { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: #93a9bf; padding: 7px 0; }
.vl__l + .vl__l { border-top: 1px solid rgba(255, 255, 255, .05); }
.vl__l .h { color: #61748a; width: 42px; flex: none; font-variant-numeric: tabular-nums; }
.vl__l .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl__l .v { margin-left: auto; flex: none; font-size: 11px; font-weight: 750; border-radius: 999px; padding: 2px 9px; }
.vl__v--r { background: rgba(255, 255, 255, .07); color: #7f93a8; }
.vl__v--a { background: rgba(53, 224, 161, .15); color: var(--cam-vif, #35e0a1); }

/* Le plein écran de la Veille réutilise le cadre de cameras.css, mais avec
   une IMAGE fixe (l'instant du déclenchement) et non un flux vidéo. */
.vl__zoom img {
  flex: 1; min-height: 0; width: 100%; object-fit: contain;
  background: #000; border-radius: var(--radius);
}

/* Le titre de la section « Les murs », sous le panneau de veille. */
.mt { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.mt h2 { font-size: 15.5px; font-weight: 750; letter-spacing: -.01em; color: var(--text); }
.mt span { font-size: 12.5px; color: var(--text-3); }

/* ---------- la pastille d'alerte sur une tuile de mur ---------- */
.cam__murAl {
  position: absolute; right: 9px; top: 9px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 850; letter-spacing: .05em; color: #0a0f16;
  background: var(--danger); border-radius: 999px; padding: 3px 8px;
  box-shadow: 0 4px 12px -4px rgba(240, 80, 110, .8);
}

@media (max-width: 640px) {
  .vl__in { padding: 16px 14px 18px; }
  .vl__grille { grid-template-columns: 1fr; }
  .vl__f { margin-left: 0; width: 100%; }
}

/* ============================================================
   Le BOUTON D'ALERTE, côté salarié (« Ma fiche », alerte.js).
   Placé tout en haut de la fiche : en urgence on ne fait pas défiler.
   ============================================================ */
.al { max-width: 760px; margin: 0 0 16px; }
.al__poste {
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 13px 15px; margin-bottom: 14px;
}
.al__l { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 750; }
.al__v { font-size: 15px; font-weight: 700; margin-top: 3px; }
.al__h { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

.al__sos {
  display: block; width: 100%; border: 0; border-radius: 17px; padding: 21px 16px;
  color: #fff; text-align: center; position: relative; overflow: hidden; cursor: pointer;
  background: linear-gradient(160deg, #ff6b86, #e0344f);
  box-shadow: 0 10px 26px -12px rgba(240, 80, 110, .95), 0 1px 0 rgba(255, 255, 255, .25) inset;
  transition: transform .1s, background .3s;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.al__sos::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, .22), transparent 42%);
}
.al__sos:active { transform: scale(.975); }
.al__t { font-size: 17px; font-weight: 800; position: relative; }
.al__s { font-size: 12.5px; opacity: .92; margin-top: 3px; position: relative; }
/* la jauge d'appui : le seul retour visuel pendant les 1,5 s */
.al__j { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: rgba(255, 255, 255, .9); }
.al__sos--go {
  background: linear-gradient(160deg, #43dd94, #12a862);
  box-shadow: 0 10px 26px -12px rgba(32, 191, 115, .95), 0 1px 0 rgba(255, 255, 255, .25) inset;
}
.al__hint { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 12px; line-height: 1.55; }
