:root {
  /* Identité Nexus — vert lime sur noir. */
  --fond: #000000;
  --fond-2: #0d0d0d;
  --fond-3: #1a1a1a;
  --bord: #2a2a2a;
  --texte: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #a3e635;        /* vert lime */
  --accent-fonce: #84cc16;  /* lime plus profond (survol, boutons) */
  --danger: #f87171;
  --ok: #a3e635;            /* « en ligne » en lime, cohérent avec l'accent */
  --attention: #fbbf24;
  --rayon: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fond);
  color: var(--texte);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.erreur { color: var(--danger); margin: .5rem 0; }
.ok { color: var(--ok); margin: .5rem 0; }
[hidden] { display: none !important; }

header#entete {
  display: flex; align-items: center; gap: 1.5rem;
  padding: .6rem 1.25rem; background: var(--fond-2); border-bottom: 1px solid var(--bord);
}
.marque { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.15rem; color: var(--texte); }
header nav { display: flex; gap: 1rem; }
header nav a { color: var(--muted); padding: .25rem .5rem; border-radius: 6px; }
header nav a.actif, header nav a:hover { color: var(--texte); background: var(--fond-3); }
.qui { margin-left: auto; display: flex; gap: .75rem; align-items: center; color: var(--muted); }
button.lien { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

main#contenu { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.vue { padding: 1.5rem; max-width: 1100px; width: 100%; margin: 0 auto; }
.vue.centre { display: flex; align-items: center; justify-content: center; flex: 1; }
.carte { background: var(--fond-2); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.25rem; margin-bottom: 1rem; }
.carte.petit { max-width: 380px; text-align: center; }
.formulaire { width: 100%; max-width: 400px; text-align: center; }
.formulaire .logo { margin-bottom: .5rem; }
label { display: block; text-align: left; margin: .75rem 0 .25rem; color: var(--muted); font-size: .9rem; }
input, select {
  width: 100%; margin-top: .25rem; padding: .55rem .7rem; border-radius: 6px; border: 1px solid var(--bord);
  background: var(--fond); color: var(--texte); font: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
label.inline select { width: auto; margin: 0; padding: .3rem .5rem; }
button, .bouton {
  display: inline-block; padding: .5rem .9rem; border-radius: 6px; border: 1px solid var(--bord); background: var(--fond-3);
  color: var(--texte); font: inherit; cursor: pointer; text-decoration: none; line-height: 1.2;
}
button:hover, .bouton:hover { border-color: var(--muted); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.principal { background: var(--accent-fonce); border-color: var(--accent-fonce); color: #0a0a0a; font-weight: 600; margin-top: 1rem; width: 100%; }
button.principal:hover { background: var(--accent); }
.ligne button.principal { width: auto; margin-top: .25rem; }
button.danger, .bouton.danger { background: #3b1d1d; border-color: #5a2a2a; color: #fca5a5; }
button.petit { padding: .25rem .55rem; font-size: .85rem; }
.ligne { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; }
.ligne input, .ligne select { width: auto; flex: 1 1 160px; margin: 0; }

.titre-ligne { display: flex; align-items: center; gap: 1rem; }
.pastille { font-size: .8rem; color: var(--muted); }
.pastille::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: .4rem; }
.pastille.ok::before { background: var(--ok); }
.pastille.attention::before { background: var(--attention); }

.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.poste {
  background: var(--fond-2); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1rem;
  display: flex; gap: .9rem; align-items: center; cursor: pointer; transition: border-color .15s, transform .15s;
}
.poste:hover { border-color: var(--accent); transform: translateY(-1px); }
.poste.hors-ligne { opacity: .55; cursor: default; }
.poste.hors-ligne:hover { border-color: var(--bord); transform: none; }
.poste .icone { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--fond-3); font-size: 1.4rem; flex: none; }
.poste.en-ligne .icone { background: #1a2e05; }
.poste .nom { font-weight: 600; font-size: 1.05rem; }
.poste .etat { font-size: .85rem; color: var(--muted); }
.poste.en-ligne .etat { color: var(--ok); }
.poste.verrouille .etat { color: var(--attention); }
.poste.occupe .etat { color: var(--attention); }

/* Visionneuse */
.vue.visionneuse { max-width: none; padding: 0; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.barre { display: flex; align-items: center; gap: .6rem; padding: .4rem .75rem; background: var(--fond-2); border-bottom: 1px solid var(--bord); flex-wrap: wrap; font-size: .9rem; }
.barre .espace { flex: 1; }
.barre .bouton, .barre button { padding: .3rem .6rem; font-size: .85rem; }
.stats { font-variant-numeric: tabular-nums; font-size: .8rem; white-space: nowrap; }
.scene { position: relative; flex: 1; background: #000; min-height: 0; outline: none; overflow: hidden; }
.scene video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.scene.controle video { cursor: none; }
.voile { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .92); }
.voile form label { text-align: center; }
.case-memo { display: flex; align-items: center; justify-content: center; gap: .45rem; margin: .6rem 0 0; color: var(--muted); font-size: .9rem; cursor: pointer; }
.case-memo input { width: auto; margin: 0; }
.scene:fullscreen .barre { display: none; }
/* Contrôle tactile : le bouton Clavier n'apparaît que sur écran tactile ; le champ de saisie caché
   sert seulement à ouvrir le clavier du téléphone. touch-action:none = on gère nous-mêmes les gestes. */
.tactile-seul { display: none; }
body.tactile .tactile-seul { display: inline-flex; align-items: center; }
body.tactile .scene { touch-action: none; }
#saisie-tactile { position: fixed; bottom: 0; left: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; margin: 0; background: transparent; color: transparent; caret-color: transparent; }

/* Administration */
.onglets { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--bord); }
.onglets button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: .5rem .9rem; }
.onglets button.actif { color: var(--texte); border-bottom-color: var(--accent); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--bord); vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.table td.actions { white-space: nowrap; text-align: right; }
.table td .etat-ok { color: var(--ok); }
.table td .etat-non { color: var(--muted); }
.table td .etat-att { color: var(--attention); }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { font-size: .8rem; padding: .15rem .5rem; border-radius: 999px; border: 1px solid var(--bord); background: var(--fond); cursor: pointer; color: var(--muted); }
.chip.on { background: #1a2e05; border-color: var(--accent-fonce); color: var(--texte); }
.code { margin-top: 1rem; padding: 1rem; border-radius: var(--rayon); background: var(--fond); border: 1px dashed var(--accent-fonce); }
.code strong { font-size: 1.8rem; letter-spacing: .15em; font-family: ui-monospace, Consolas, monospace; display: block; margin: .25rem 0; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: .85em; }

#toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 50; }
.toast { background: var(--fond-3); border: 1px solid var(--bord); border-left: 4px solid var(--accent); padding: .6rem .9rem; border-radius: 6px; max-width: 360px; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.toast.erreur { border-left-color: var(--danger); }

@media (max-width: 640px) {
  header#entete { flex-wrap: wrap; gap: .5rem; }
  .vue { padding: 1rem; }
  .barre { gap: .4rem; }
}
