:root {
  --fond: #f6f7f9;
  --carte: #ffffff;
  --texte: #1c2430;
  --doux: #5b6676;
  --bord: #dfe3e8;
  --accent: #1f6feb;
  --accent-fonce: #1857b8;
  --vert: #1a7f37;
  --rouge: #c62828;
  --orange: #b35c00;
  --alerte-fond: #fff4e5;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fond); color: var(--texte); font-size: 16px; line-height: 1.45;
}
a { color: var(--accent); }
header.barre {
  display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  background: var(--carte); border-bottom: 1px solid var(--bord);
}
header.barre .nom { font-weight: 700; font-size: 18px; color: var(--texte); text-decoration: none; }
header.barre .espace { flex: 1; }
header.barre form { margin: 0; }
main { max-width: 980px; margin: 24px auto; padding: 0 16px; }
main.large { max-width: none; margin: 0; padding: 0; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
h1 { font-size: 24px; margin: 0 0 12px; }
h2 { font-size: 19px; margin: 0 0 10px; }
.doux { color: var(--doux); }
button, .bouton {
  display: inline-block; border: 0; border-radius: 8px; padding: 10px 16px; font-size: 16px; cursor: pointer;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 600;
}
button:hover, .bouton:hover { background: var(--accent-fonce); }
button.secondaire { background: #e8ecf1; color: var(--texte); }
button.danger { background: var(--rouge); }
button:disabled { opacity: .5; cursor: default; }
label { font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--bord); border-radius: 6px; font-size: 16px; background: #fff;
}
form p { margin: 0 0 14px; }
ul.errorlist { color: var(--rouge); margin: 4px 0; padding-left: 18px; }
.messages { list-style: none; padding: 0; }
.messages li { background: #e6f4ea; border: 1px solid #b7dfc2; padding: 10px 14px; border-radius: 6px; }
.rappel {
  background: var(--alerte-fond); border: 1px solid #f3c98b; color: #6b3b00; padding: 8px 14px;
  font-weight: 600; text-align: center;
}

/* Tableau de bord */
.interrupteur { display: flex; align-items: center; gap: 14px; font-size: 20px; font-weight: 700; }
.interrupteur input { width: 26px; height: 26px; }
.etat-ws { font-size: 14px; }
.demande { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--bord);
  border-radius: 8px; margin-bottom: 10px; background: #fbfcfe; }
.demande .qui { font-weight: 700; font-size: 18px; }
.demande .infos { flex: 1; }
.demande.nouvelle { animation: clignote 1s ease-in-out 3; }
@keyframes clignote { 50% { background: #e3edff; } }
table.simple { border-collapse: collapse; width: 100%; }
table.simple td, table.simple th { padding: 6px 8px; border-bottom: 1px solid var(--bord); text-align: left; }

/* Session */
.session { display: grid; grid-template-columns: 1fr 360px; height: calc(100vh - 95px); }
.ecran { position: relative; background: #111; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ecran video { width: 100%; height: 100%; object-fit: contain; cursor: crosshair; }
.ecran .voile {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  color: #fff; font-size: 22px; background: rgba(0,0,0,.65); padding: 30px;
}
.ecran .voile[hidden] { display: none; }
.cercle-local {
  position: absolute; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  border: 4px solid #ff3b30; pointer-events: none; animation: onde 1.2s ease-out 2;
}
@keyframes onde { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.cote { background: var(--carte); border-left: 1px solid var(--bord); display: flex; flex-direction: column; min-height: 0; }
.commandes { padding: 14px; border-bottom: 1px solid var(--bord); }
.commandes .ligne { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.chrono { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 700; }
.pastille { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: #e8ecf1; }
.pastille.ok { background: #e6f4ea; color: var(--vert); }
.pastille.attention { background: var(--alerte-fond); color: var(--orange); }
.pastille.ko { background: #fdecea; color: var(--rouge); }
.guides { padding: 14px; overflow-y: auto; flex: 1; min-height: 0; }
.guides .resultat { padding: 8px; border: 1px solid var(--bord); border-radius: 6px; margin: 6px 0; cursor: pointer; }
.guides .resultat:hover { background: #f1f5fb; }
.guides ol { padding-left: 20px; }
.guides li { margin-bottom: 10px; }
.guides img { max-width: 100%; border: 1px solid var(--bord); border-radius: 6px; margin-top: 6px; }

/* Fausse personne aidée */
.telephone { position: relative; display: inline-block; max-width: 100%; }
.telephone video { max-width: 100%; max-height: 60vh; border: 1px solid var(--bord); display: block; }
.journal { font-family: monospace; font-size: 13px; background: #111; color: #9fe6a0; padding: 10px; height: 180px; overflow-y: auto; border-radius: 6px; }

@media (max-width: 900px) {
  .session { grid-template-columns: 1fr; height: auto; }
  .ecran { height: 70vh; }
}
