/* Kontroll — charte YEZH : marine #3D4967, orange #CA6132, texte #2B3346, gris #7A8499, filets #E7EBF1 */
@font-face { font-family: "Quantico"; src: url("polices/quantico-regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Quantico"; src: url("polices/quantico-bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --marine: #3D4967; --marine-fonce: #2B3346; --orange: #CA6132; --orange-fonce: #B0532A;
  --texte: #2B3346; --gris: #5F6A80; --filet: #E7EBF1; --fond: #F3F5F9; --carte: #FFFFFF;
  --vert: #1E7A43; --rouge: #B3261E; --ambre: #D4880F;
  --rayon: 12px; --ombre: 0 1px 2px rgba(43, 51, 70, .06), 0 8px 24px rgba(43, 51, 70, .07);
  --titre: "Quantico", "Segoe UI", sans-serif;
  --corps: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--fond); color: var(--texte); font: 15px/1.45 var(--corps); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2 { font-family: var(--titre); font-weight: 700; margin: 0 0 4px; letter-spacing: .01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; }
a { color: var(--orange-fonce); }
.vue { min-height: 100%; display: flex; flex-direction: column; }

/* ── Bandeau marine + filet orange (comme le portail YEZH) ── */
.bandeau { background: var(--marine); color: #fff; height: 64px; padding: 0 max(20px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; border-bottom: 4px solid var(--orange); flex: none; }
.marque { display: flex; align-items: center; gap: 10px; }
.marque img { width: 34px; height: 34px; border-radius: 8px; }
.marque span { font: 700 22px var(--titre); letter-spacing: .02em; }
.marque small { font: 400 12px var(--titre); color: #C4CCDB; margin-top: 6px; }
.bandeau-droite { display: flex; align-items: center; gap: 12px; }
.moi { font-weight: 600; font-size: 14px; }
.pastille { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pastille-ok { background: #3FBF74; box-shadow: 0 0 0 3px rgba(63, 191, 116, .25); }
.pastille-attente { background: var(--ambre); }
.pastille-ko { background: #E5534B; }

/* ── Cartes, champs, boutons ── */
.centre { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.carte { background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 24px; min-width: 0; }
.carte-etroite { width: 100%; max-width: 380px; }
.carte-large { grid-column: 1 / -1; }
.carte-titre { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sous { color: var(--gris); margin: 0 0 18px; font-size: 14px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--marine); margin-bottom: 14px; }
input, select { font: inherit; color: var(--texte); }
label input { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid #C4CCDB; border-radius: 8px; background: #FBFCFE; outline: none; transition: border-color .15s, box-shadow .15s; }
label input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(202, 97, 50, .15); background: #fff; }
.champ-id { font: 700 22px var(--titre) !important; letter-spacing: .08em; }
.btn { font: 600 14px var(--corps); border-radius: 8px; border: 1px solid transparent; padding: 11px 18px; cursor: pointer; transition: background .15s, border-color .15s, opacity .15s; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-principal { background: var(--orange-fonce); color: #fff; width: 100%; }
.btn-principal:hover:not(:disabled) { background: #9A4823; }
.btn-fantome { background: transparent; color: inherit; border-color: currentColor; opacity: .85; }
.btn-fantome:hover { opacity: 1; }
.btn-petit { padding: 5px 10px; font-size: 12.5px; width: auto; }
.carte .btn-fantome { color: var(--marine); border-color: #C4CCDB; }
.erreur { color: var(--rouge); background: #FBEAE9; border-radius: 8px; padding: 8px 12px; font-size: 13.5px; margin: 0 0 14px; }
.lien-client { color: var(--gris); font-size: 14px; margin-top: 18px; }

/* ── Accueil ── */
.grille-accueil { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 20px; align-content: start; }
.attente { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--marine); font-size: 14px; }
.attente .btn { margin-left: auto; }
.rond { width: 16px; height: 16px; border: 2px solid var(--filet); border-top-color: var(--orange); border-radius: 50%; animation: tourne .8s linear infinite; flex: none; }
@keyframes tourne { to { transform: rotate(360deg); } }
.liste { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.liste li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--filet); font-size: 14px; }
.liste li:last-child { border-bottom: 0; }
.liste .id { font: 700 15px var(--titre); color: var(--marine); letter-spacing: .05em; min-width: 104px; }
.liste .meta { color: var(--gris); font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etiquette { font-size: 11.5px; font-weight: 600; border-radius: 99px; padding: 2px 9px; background: var(--filet); color: var(--marine); white-space: nowrap; }
.etiquette-orange { background: #F8E6DC; color: var(--orange-fonce); }
.etiquette-vert { background: #DFF1E6; color: var(--vert); }
.etiquette-rouge { background: #FBEAE9; color: var(--rouge); }
.vide { color: var(--gris); font-size: 14px; padding: 8px 4px; }
.tableau-defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--gris); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px; border-bottom: 2px solid var(--filet); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--filet); white-space: nowrap; }
td.id { font-family: var(--titre); font-weight: 700; color: var(--marine); cursor: pointer; }
td.id:hover { color: var(--orange-fonce); }

/* ── Session ── */
.vue-session { height: 100%; background: #1B2130; color: #E7EBF1; overflow: hidden; }
.barre { flex: none; display: flex; align-items: center; gap: 12px; padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); background: var(--marine); border-bottom: 3px solid var(--orange); z-index: 5; }
.barre-poste { display: flex; align-items: center; gap: 8px; min-width: 0; }
.barre-poste img { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.barre-poste div { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.barre-poste b { font: 700 14px var(--titre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-poste small { color: #C4CCDB; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-outils { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.barre-outils::-webkit-scrollbar { display: none; }
.barre select { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .18); border-radius: 7px; padding: 6px 8px; font-size: 13px; max-width: 170px; }
.barre select option { color: var(--texte); }
.outil { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; background: transparent; border: 0; color: #fff; padding: 4px 8px; border-radius: 7px; cursor: pointer; font: inherit; flex: none; }
.outil span { font-size: 17px; line-height: 1.1; }
.outil em { font-style: normal; font-size: 11px; color: #C4CCDB; }
.outil:hover, .outil.actif { background: rgba(255, 255, 255, .1); }
.outil.actif em { color: #fff; }
.outil-fin { background: var(--orange-fonce); margin-left: 6px; }
.outil-fin em { color: #fff; }
.outil-fin:hover { background: #9A4823; }
.outil i { position: absolute; top: 3px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 2px var(--marine); }
.stats { font: 11px var(--titre); color: #C4CCDB; text-align: right; min-width: 82px; white-space: nowrap; }
.menu-conteneur { position: relative; }
.menu { position: fixed; z-index: 20; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); padding: 6px; display: flex; flex-direction: column; min-width: 220px; }
.menu button { text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 6px; font: 14px var(--corps); color: var(--texte); cursor: pointer; }
.menu button:hover { background: var(--fond); color: var(--orange-fonce); }
.zone { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.zone.reel { overflow: auto; display: block; }
#ecran { display: block; background: #000; outline: none; touch-action: none; cursor: default; image-rendering: auto; }
.zone.reel #ecran { margin: 0; }
.zone-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 16px var(--titre); color: #C4CCDB; pointer-events: none; text-align: center; padding: 20px; }
.saisie-mobile { position: fixed; left: -1000px; bottom: 0; width: 10px; height: 10px; opacity: 0; }
.chat { position: fixed; right: 12px; bottom: 12px; width: min(360px, calc(100vw - 24px)); height: min(460px, calc(100vh - 100px)); background: #fff; color: var(--texte); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .4); display: flex; flex-direction: column; z-index: 10; overflow: hidden; }
.chat-tete { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--marine); color: #fff; border-bottom: 3px solid var(--orange); font-family: var(--titre); }
.chat-fil { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--fond); }
.bulle { max-width: 82%; padding: 8px 12px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.bulle small { display: block; font-size: 11px; opacity: .7; margin-bottom: 2px; }
.bulle-moi { align-self: flex-end; background: var(--orange-fonce); color: #fff; border-bottom-right-radius: 4px; }
.bulle-eux { align-self: flex-start; background: #fff; border: 1px solid var(--filet); border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--filet); }
.chat-form input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #C4CCDB; border-radius: 8px; outline: none; }
.chat-form input:focus { border-color: var(--orange); }
.transferts { position: fixed; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 9; width: min(320px, calc(100vw - 24px)); }
.transfert { background: #fff; color: var(--texte); border-radius: 10px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); font-size: 13px; }
.transfert b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jauge { height: 5px; background: var(--filet); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.jauge div { height: 100%; background: var(--orange); width: 0; transition: width .2s; }

/* ── Page de téléchargement du QS ── */
.carte-qs { max-width: 440px; text-align: center; padding: 32px 28px; }
.qs-logo { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 14px; }
.btn-telecharger { display: block; text-decoration: none; font-size: 16px; padding: 14px; margin: 6px 0 22px; }
.etapes { text-align: left; margin: 0 0 18px; padding-left: 22px; display: grid; gap: 8px; font-size: 14.5px; }
.etapes b { color: var(--marine); }
.mention { color: var(--gris); font-size: 13px; margin: 0; }
.autre-appareil { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--filet); }

/* ── Mode application (fenêtre sans cadre : le bandeau marine sert de barre de titre) ── */
.seulement-appli { display: none; }
.appli .seulement-appli { display: block; }
.appli-bureau .bandeau, .appli-bureau .barre { -webkit-app-region: drag; user-select: none; }
.appli-bureau .bandeau button, .appli-bureau .bandeau a, .appli-bureau .barre button, .appli-bureau .barre select, .appli-bureau .barre-outils, .appli-bureau .bandeau .pastille { -webkit-app-region: no-drag; }
.appli-bureau .bandeau { padding-right: calc(100vw - env(titlebar-area-width, 100vw) + 16px); }
.appli-bureau .barre { height: 58px; padding-right: calc(100vw - env(titlebar-area-width, 100vw) + 10px); }
.appli-bureau .vue-session:fullscreen .barre { padding-right: 10px; }

/* ── Notifications ── */
.toasts { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 30; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--marine-fonce); color: #fff; border-radius: 8px; padding: 10px 14px; font-size: 14px; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); display: flex; align-items: center; gap: 10px; animation: entree .2s ease-out; }
.toast .btn { margin-left: auto; color: #fff; }
@keyframes entree { from { opacity: 0; transform: translateY(-6px); } }

@media (max-width: 820px) {
  .grille-accueil { grid-template-columns: 1fr; }
  .moi { display: none; }
  .stats, .barre-poste div { display: none; }
  .outil em { display: none; }
  .outil { padding: 6px 7px; }
  .barre select { max-width: 110px; }
}
