/* Styles propres a la console — couleurs/typos dans shared/theme.css */

[hidden] { display: none !important; }

html, body { height: 100%; overflow: hidden; }
.vue { height: 100vh; height: 100dvh; display: flex; }
.vue[hidden] { display: none; }
.vue-centree { align-items: center; justify-content: center; }

.message { min-height: 18px; font-size: 13px; margin: 8px 0 0; }
.message.ok { color: var(--tc-vert); }
.message.ko { color: var(--tc-rouge); }
.large { width: 100%; padding: 14px; font-size: 15px; margin-top: 14px; }
.petit { padding: 7px 12px; font-size: 12px; }
.case { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin: 12px 0 0; }
.case input { accent-color: var(--tc-vert); width: 16px; height: 16px; }
.mono { font-family: var(--tc-font-titre); font-weight: 700; color: var(--tc-vert); letter-spacing: 0.04em; user-select: text; word-break: break-all; }
.espace { flex: 1; }
.tc-label + .tc-champ { margin-bottom: 12px; }

/* Login */
.carte-login { width: 400px; }
.logo-login { height: 44px; display: block; margin-bottom: 18px; }
.details-serveur { margin-top: 4px; }
.details-serveur summary { cursor: pointer; font-size: 12px; color: var(--tc-texte-faible); margin-bottom: 8px; }

/* Accueil */
.barre-laterale {
  width: 240px; flex: none; background: var(--tc-surface); border-right: 1px solid var(--tc-bordure);
  display: flex; flex-direction: column; padding: 22px 16px 16px; gap: 20px;
}
.logo-lateral { height: 34px; align-self: flex-start; margin-left: 6px; }
nav { display: flex; flex-direction: column; gap: 4px; }
.onglet {
  text-align: left; padding: 10px 12px; background: transparent; border: 0; color: var(--tc-gris-moyen);
  font-family: var(--tc-font-titre); font-weight: 500; font-size: 14px; border-radius: var(--tc-radius-sm); cursor: pointer;
  border-left: 3px solid transparent;
}
.onglet:hover { background: var(--tc-graphite); color: var(--tc-blanc); }
.onglet.actif { color: var(--tc-vert); border-left-color: var(--tc-vert); background: var(--tc-vert-voile); }
.pied-lateral { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.technicien { font-size: 13px; }

.contenu { flex: 1; overflow-y: auto; padding: 36px 40px; }
.panneau h1 { margin-top: 4px; }
.entete-panneau { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.carte-connexion { max-width: 480px; margin-top: 20px; }
.champ-code { font-family: var(--tc-font-titre); font-weight: 700; font-size: 28px; letter-spacing: 0.1em; color: var(--tc-vert); text-align: center; }

.tableau { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.tableau th { text-align: left; font-family: var(--tc-font-titre); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tc-texte-faible); padding: 8px 10px; border-bottom: 1px solid var(--tc-bordure); }
.tableau td { padding: 10px; border-bottom: 1px solid var(--tc-bordure); vertical-align: middle; }
.tableau tr:hover td { background: var(--tc-graphite); }
.tableau .code-cell { font-family: var(--tc-font-titre); font-weight: 600; color: var(--tc-vert); letter-spacing: 0.06em; white-space: nowrap; }

.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; margin-top: 16px; }
.grille-2 .tc-btn { margin-top: 6px; }
.resultat-jeton { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--tc-bordure); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* Session */
#vue-session { flex-direction: column; }
.barre-outils {
  height: 48px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: var(--tc-surface); border-bottom: 1px solid var(--tc-bordure); border-top: var(--tc-filet) solid var(--tc-vert);
}
.barre-outils strong { font-family: var(--tc-font-titre); }
.duree { font-family: var(--tc-font-titre); font-weight: 600; color: var(--tc-gris-moyen); font-variant-numeric: tabular-nums; }
.stats { font-family: var(--tc-font-titre); font-size: 11px; font-weight: 500; color: var(--tc-texte-faible); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats b { color: var(--tc-gris-moyen); font-weight: 600; }
.stats .mauvais { color: var(--tc-rouge); }
.select-outil { width: auto; padding: 6px 10px; font-size: 12px; }
#session-raccourcis { width: 118px; flex: none; }
.barre-outils > * { flex-shrink: 0; }
.barre-outils .tc-btn, .barre-outils strong { white-space: nowrap; }
.barre-outils #session-infos { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre-outils .espace { flex: 1 1 0; min-width: 0; }
/* Fenetre etroite : on garde les commandes, on retire l'information secondaire. */
@media (max-width: 1180px) { .barre-outils .stats, .barre-outils #session-infos { display: none; } }
@media (max-width: 1040px) { .barre-outils > .tc-tag, .barre-outils #session-liaison { display: none; } .barre-outils { gap: 9px; } }
.plein-ecran .barre-outils { position: fixed; top: 0; left: 0; right: 0; z-index: 5; opacity: 0; transition: opacity .2s; }
.plein-ecran .barre-outils:hover, .plein-ecran.barre-visible .barre-outils { opacity: 1; }

.zone-video { flex: 1; position: relative; background: #000; overflow: hidden; }
#video { width: 100%; height: 100%; object-fit: contain; display: block; cursor: none; outline: none; transform-origin: 0 0; }
/* Doigts : aucun geste du navigateur (défilement, zoom de page) sur l'image — la console les interprète. */
body.tactile #video { touch-action: none; }
/* Curseur local : il suit la souris du technicien sans attendre l'aller-retour de l'image. */
#video.curseur-local { cursor: crosshair; }
#video.vue-seule { cursor: default; }
.attente { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.75); }
.attente[hidden] { display: none; }
.attente .tc-carte { width: 380px; text-align: center; }
.attente .tc-btn { margin-top: 8px; }
.avertissement {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: var(--tc-graphite); border-left: 3px solid var(--tc-rouge); padding: 10px 16px; border-radius: var(--tc-radius-sm);
  font-size: 13px; max-width: 80%; box-shadow: var(--tc-ombre);
}
.avertissement[hidden] { display: none; }
.avertissement--haut { bottom: auto; top: 16px; border-left-color: var(--tc-vert); }
.avertissement--haut.alerte { border-left-color: var(--tc-rouge); }
.avis-session {
  position: absolute; right: 16px; bottom: 16px; background: var(--tc-graphite); border-left: 3px solid var(--tc-vert);
  padding: 8px 14px; border-radius: var(--tc-radius-sm); font-size: 12px; box-shadow: var(--tc-ombre);
}
.avis-session.ko { border-left-color: var(--tc-rouge); }
.avis-session[hidden] { display: none; }
.interrupteur-outil { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--tc-gris-moyen); white-space: nowrap; cursor: pointer; }
.interrupteur-outil[hidden] { display: none; }
.interrupteur-outil input { accent-color: var(--tc-vert); margin: 0; }

/* Inscription / licence / compte */
.centre { text-align: center; margin-top: 12px; }
.centre a { color: var(--tc-vert); text-decoration: none; }
.bandeau-licence { max-width: 640px; margin-top: 20px; border-left: 3px solid var(--tc-rouge); }
.bandeau-licence p { margin: 6px 0 12px; color: var(--tc-gris-moyen); }
.actions-licence { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions-licence { margin-bottom: 8px; }
.actions-licence .tc-champ { width: 340px; margin: 0; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--tc-texte-faible); }
.kv dd { margin: 0; }
.liste-app { list-style: none; padding: 0; margin: 0; }
.liste-app li { padding: 6px 0; border-bottom: 1px dashed var(--tc-bordure); font-size: 13px; }
.grille-2 .tc-carte h3 { margin-top: 0; }
#btn-dashboard { color: var(--tc-vert); }
.carte-connexion.verrouillee { opacity: .45; pointer-events: none; }

.code-totp { font-family: var(--tc-font-titre); font-weight: 700; font-size: 28px; letter-spacing: .2em; text-align: center; color: var(--tc-vert); }
.qr { background: #fff; padding: 12px; border-radius: 8px; display: inline-block; margin: 10px 0; }
.qr svg { display: block; }
.secret { font-family: var(--tc-font-titre); font-weight: 600; letter-spacing: .1em; color: var(--tc-vert); word-break: break-all; }
.codes-secours { columns: 2; font-family: var(--tc-font-titre); font-weight: 600; letter-spacing: .06em; font-size: 15px; line-height: 1.8; margin: 10px 0; }
.pastille { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; font-family: var(--tc-font-titre); }
.pastille.active { background: var(--tc-vert-voile); color: var(--tc-vert); }
.pastille.revoquee { background: var(--tc-rouge-voile); color: #ff5a5a; }
#compte-2fa .tc-btn { margin-top: 8px; margin-right: 8px; }

/* Menu « Réglages » de la barre de session */
.menu-reglages { position: relative; flex-shrink: 0; }
.menu-reglages > summary { list-style: none; display: inline-flex; align-items: center; white-space: nowrap; }
.menu-reglages > summary::-webkit-details-marker { display: none; }
.menu-reglages > summary::after { content: '▾'; margin-left: 6px; font-size: 10px; }
.panneau-reglages {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 250px;
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px;
  background: var(--tc-graphite); border: 1px solid var(--tc-bordure); border-radius: var(--tc-radius-sm); box-shadow: var(--tc-ombre);
}
#session-ecran { max-width: 190px; }
.barre-outils #session-poste { flex-shrink: 1; min-width: 60px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1040px) { #session-ecran { max-width: 118px; } }
#session-ecran[hidden] { display: none; }

/* ---------- Tablette / téléphone (console web, écran tactile) ---------- */
.barre-tactile { display: none; }
body.tactile .barre-tactile {
  display: flex; flex: none; gap: 6px; align-items: center; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--tc-surface); border-top: 1px solid var(--tc-bordure);
}
.touche-tactile {
  flex: none; min-width: 44px; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--tc-bordure);
  background: var(--tc-graphite); color: var(--tc-blanc); font-family: var(--tc-font-titre); font-size: 14px; font-weight: 500;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.touche-tactile.actif { background: var(--tc-vert); color: var(--tc-noir); border-color: var(--tc-vert); }
.touche-tactile.touche-clavier { border-color: var(--tc-vert); color: var(--tc-vert); }
.touche-tactile[hidden] { display: none; }
/* Champ invisible qui reçoit le clavier du téléphone (16 px : sinon iOS zoome la page). */
.saisie-tactile { position: absolute; left: -2000px; top: 0; width: 2px; height: 2px; opacity: 0; font-size: 16px; resize: none; }

@media (max-width: 760px) {
  .vue-centree { align-items: flex-start; overflow-y: auto; padding: 16px 0; }
  .carte-login { width: auto; max-width: 92vw; margin: 0 auto; }
  /* Accueil : la barre latérale devient un bandeau défilant */
  #vue-accueil { flex-direction: column; }
  .barre-laterale { width: auto; flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--tc-bordure); }
  .logo-lateral { height: 24px; margin-left: 0; }
  .barre-laterale nav { flex-direction: row; gap: 2px; }
  .onglet { white-space: nowrap; padding: 8px 10px; border-left: 0; border-bottom: 3px solid transparent; }
  .onglet.actif { border-bottom-color: var(--tc-vert); }
  .pied-lateral { margin: 0 0 0 auto; flex-direction: row; align-items: center; flex: none; }
  .pied-lateral .technicien { display: none; }
  .contenu { padding: 16px 14px 24px; }
  .grille-2 { grid-template-columns: 1fr; }
  .tableau { display: block; overflow-x: auto; white-space: nowrap; }
  .actions-licence { flex-direction: column; align-items: stretch; }
  /* Session : barre sur deux lignes, seulement l'essentiel */
  .barre-outils { height: auto; flex-wrap: wrap; row-gap: 6px; column-gap: 6px; padding: 6px 8px; }
  .barre-outils .stats, .barre-outils #session-infos, .barre-outils > .tc-tag, .barre-outils #session-liaison, .barre-outils .duree { display: none; }
  .barre-outils .espace { display: none; }
  .barre-outils #session-poste { flex: 1 1 100%; }
  .select-outil { max-width: 31vw; }
  #session-ecran { max-width: 31vw; }
  .panneau-reglages { right: auto; left: 0; min-width: 0; width: min(300px, 92vw); }
  .attente .tc-carte { width: auto; max-width: 92vw; }
  .avertissement { max-width: 94%; font-size: 12px; }
}
/* Plein écran sur tablette : pas de survol possible -> la barre reste affichée. */
body.tactile .plein-ecran .barre-outils { position: static; opacity: 1; }
