/* ============================================================
   SUPPORT IMAGES PRO : feuille de style unique
   Palette provisoire, entièrement réglée par les variables ci-dessous.
   Polices système (aucun appel externe : rien à autoriser côté DSI).
   ============================================================ */
:root {
  --fond: #f4f5f7;
  --carte: #ffffff;
  --texte: #1b1f24;
  --texte-2: #5b6472;
  --filet: #e3e6eb;
  --accent: #0f766e;
  --accent-fonce: #0b5d57;
  --accent-pale: #e6f3f1;
  --ok: #1f8a4c;
  --attention: #b7791f;
  --echec: #c0392b;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --police: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--fond); color: var(--texte); font: 16px/1.55 var(--police); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
a:hover { color: var(--accent-fonce); }
button, input, textarea, select { font: inherit; color: inherit; }
.petit { font-size: .875rem; color: var(--texte-2); }
[hidden] { display: none !important; }

/* ---------- bandeau de démonstration ---------- */
.bandeau-demo { background: #fff7e6; border-bottom: 1px solid #f3dfb2; color: #7a5410; font-size: .85rem; text-align: center; padding: 7px 16px; }

/* ---------- en-tête ---------- */
.entete { background: var(--carte); border-bottom: 1px solid var(--filet); }
.entete-int { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.marque { white-space: nowrap; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--texte); }
.marque img { height: 64px; width: auto; display: block; }
.marque span { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.nav { display: flex; gap: 6px; }
.nav .court { display: none; }
.nav a { white-space: nowrap; text-decoration: none; color: var(--texte-2); font-size: .95rem; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { background: var(--fond); color: var(--texte); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-pale); font-weight: 600; }

/* ---------- page ---------- */
main { flex: 1; width: 100%; }
.conteneur { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.tete-page { padding: 40px 0 24px; max-width: 760px; margin: 0 auto; }
.tete-page h1 { font-size: clamp(1.5rem, 3.2vw, 2rem); line-height: 1.2; letter-spacing: -.015em; margin-bottom: 10px; }
.tete-page p { color: var(--texte-2); max-width: 62ch; }

/* ---------- carte de l'assistant ---------- */
.assistant { max-width: 760px; margin: 0 auto 32px; background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); box-shadow: var(--ombre); display: flex; flex-direction: column; }
.assistant-tete { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--filet); }
.assistant-tete p { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.assistant-tete p::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.lien-bouton { background: none; border: none; color: var(--accent); cursor: pointer; font-size: .9rem; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.lien-bouton:hover { color: var(--accent-fonce); }
.fil { padding: 20px; display: flex; flex-direction: column; gap: 12px; min-height: 420px; }

.bulle { max-width: 86%; padding: 12px 16px; border-radius: 14px; line-height: 1.5; animation: apparait .2s ease-out; }
@keyframes apparait { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bulle p + p, .bulle p + ol, .bulle ol + p { margin-top: 8px; }
.bulle ol { padding-left: 1.3em; }
.bulle ol li { margin: 4px 0; }
.bulle.bot { align-self: flex-start; background: var(--fond); border-top-left-radius: 4px; }
.bulle.bot.large { max-width: 100%; width: 100%; background: var(--carte); border: 1px solid var(--filet); }
.bulle.moi { align-self: flex-end; background: var(--accent); color: #fff; border-top-right-radius: 4px; }
.bulle.frappe { padding: 14px 16px; }
.points { display: inline-flex; gap: 4px; }
.points i { width: 6px; height: 6px; border-radius: 50%; background: var(--texte-2); opacity: .35; animation: point 1s infinite; }
.points i:nth-child(2) { animation-delay: .15s; }
.points i:nth-child(3) { animation-delay: .3s; }
@keyframes point { 50% { opacity: 1; } }

.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.choix button { background: var(--carte); border: 1.5px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 8px 15px; font-size: .95rem; cursor: pointer; text-align: left; line-height: 1.3; }
.choix button:hover:not(:disabled) { background: var(--accent-pale); }
.choix button.secondaire { border-color: var(--filet); color: var(--texte-2); }
.choix button:disabled { cursor: default; opacity: .4; }
.choix button.choisi { display: none; }
.choix:has(button:disabled) { display: none; }

/* résultats de test */
.titre-test { font-weight: 600; margin-bottom: 8px; }
.resultats { list-style: none; }
.resultats li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--filet); align-items: flex-start; }
.resultats li:first-child { border-top: none; }
.resultats .detail { color: var(--texte-2); font-size: .92rem; }
.pastille { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; background: var(--filet); }
.encours .pastille { background: none; border: 2px solid var(--accent); border-top-color: transparent; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.ok .pastille { background: var(--ok); }
.attention .pastille { background: var(--attention); }
.echec .pastille { background: var(--echec); }
.apercu-cam { margin-top: 12px; }
.apercu-cam video { width: 100%; max-width: 320px; aspect-ratio: 16 / 9; object-fit: cover; background: #000; border-radius: 8px; display: block; transform: scaleX(-1); }
.vumetre { width: 100%; max-width: 320px; height: 8px; background: var(--filet); border-radius: 4px; margin: 8px 0 4px; overflow: hidden; }
.vumetre span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.rapport { width: 100%; margin-top: 8px; font: .8rem/1.45 ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--filet); border-radius: 8px; padding: 10px; background: var(--fond); resize: vertical; }

/* saisie libre */
.saisie { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--filet); }
.saisie input { flex: 1; min-width: 0; border: 1px solid var(--filet); border-radius: 10px; padding: 10px 14px; background: var(--carte); }
.saisie input:focus, .champ:focus, form input:focus, form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* ---------- formulaires ---------- */
.bouton { display: inline-block; background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 11px 20px; font-weight: 600; cursor: pointer; text-decoration: none; }
.bouton:hover { background: var(--accent-fonce); color: #fff; }
.bouton:disabled { opacity: .55; cursor: default; }
.bouton.second { background: var(--carte); color: var(--texte); border: 1px solid var(--filet); }
.bouton.second:hover { background: var(--fond); }
.bouton.danger { background: var(--carte); color: var(--echec); border: 1px solid #efc6c1; }
form label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 12px; }
form input:not([type=checkbox]):not([type=radio]):not([type=file]), form textarea, form select, .champ {
  display: block; width: 100%; margin-top: 5px; border: 1px solid #d3d8df; border-radius: 9px; padding: 9px 12px; background: var(--carte); font-weight: 400; }
form textarea { resize: vertical; }
.facultatif { font-weight: 400; color: var(--texte-2); font-size: .82rem; }
fieldset { border: none; margin-bottom: 12px; }
legend { font-size: .9rem; font-weight: 600; margin-bottom: 6px; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
label.radio { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; border: 1px solid #d3d8df; border-radius: 999px; padding: 6px 13px; cursor: pointer; }
label.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-pale); }
label.case { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .87rem; color: var(--texte-2); }
label.case input { margin-top: 4px; flex: none; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-tete { margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.etiquette { display: inline-block; font-size: .78rem; font-weight: 600; background: var(--accent-pale); color: var(--accent-fonce); border-radius: 999px; padding: 3px 10px; }
.sujet { font-weight: 600; }
.alerte-jour { background: #fff4e5; border-radius: 9px; padding: 10px 14px; font-size: .92rem; margin-bottom: 12px; }
.pieces { margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pieces .ajout-capture { display: inline; margin: 0; font-weight: 400; }
.captures { display: contents; }
.vignette { position: relative; display: inline-block; }
.vignette img { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--filet); display: block; }
.vignette button { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: none; background: var(--texte); color: #fff; font-size: .8rem; line-height: 1; cursor: pointer; }
.piege { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.erreur { color: var(--echec); font-size: .9rem; margin: 4px 0 12px; }
.envoye form { opacity: .6; }

/* ---------- cartes génériques ---------- */
.carte { background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 24px; }
.etroite { max-width: 760px; margin: 0 auto 32px; }
.sous-lien { max-width: 760px; margin: -12px auto 40px; text-align: center; font-size: .92rem; color: var(--texte-2); }

/* ---------- suivi ---------- */
.statut { display: inline-block; font-size: .8rem; font-weight: 600; border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.statut.nouveau { background: #e8f0fe; color: #1d4ed8; }
.statut.en_cours { background: var(--accent-pale); color: var(--accent-fonce); }
.statut.attente { background: #fff4e5; color: #8a5a10; }
.statut.resolu { background: #eaf6ee; color: var(--ok); }
.ticket-tete { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.ticket-tete h2 { font-size: 1.2rem; line-height: 1.3; }
.messages { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 20px; }
.message { border: 1px solid var(--filet); border-radius: 10px; padding: 12px 16px; }
.message.support { background: var(--accent-pale); border-color: #cfe7e3; }
.message .qui { font-size: .82rem; color: var(--texte-2); margin-bottom: 4px; }
.message .qui strong { color: var(--texte); }

/* ---------- administration ---------- */
.admin main { display: flex; flex-direction: column; }
.admin-grille { flex: 1; display: grid; grid-template-columns: 380px 1fr; min-height: 0; border-top: 1px solid var(--filet); }
.admin-liste { border-right: 1px solid var(--filet); background: var(--carte); display: flex; flex-direction: column; min-height: calc(100vh - 64px - 49px); }
.admin-outils { padding: 14px; border-bottom: 1px solid var(--filet); display: flex; flex-direction: column; gap: 10px; }
.filtres { display: flex; flex-wrap: wrap; gap: 6px; }
.filtres button { border: 1px solid var(--filet); background: var(--carte); border-radius: 999px; padding: 4px 11px; font-size: .84rem; cursor: pointer; color: var(--texte-2); }
.filtres button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-pale); color: var(--accent-fonce); font-weight: 600; }
.filtres b { font-weight: 600; margin-left: 3px; }
.admin-outils .rangee { display: flex; gap: 8px; }
.admin-outils .champ { margin: 0; padding: 7px 10px; font-size: .9rem; }
.tickets { list-style: none; overflow-y: auto; flex: 1; }
.tickets li { padding: 13px 16px; border-bottom: 1px solid var(--filet); cursor: pointer; position: relative; }
.tickets li:hover { background: var(--fond); }
.tickets li[aria-selected="true"] { background: var(--accent-pale); box-shadow: inset 3px 0 0 var(--accent); }
.tickets .l1 { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--texte-2); }
.tickets .l2 { font-weight: 600; margin: 3px 0 2px; line-height: 1.3; }
.tickets .l3 { font-size: .85rem; color: var(--texte-2); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tickets .nonlu .l2::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 2px; }
.prio-jour { color: var(--echec); font-weight: 700; }
.prio-semaine { color: var(--attention); font-weight: 600; }
.vide { padding: 32px 20px; text-align: center; color: var(--texte-2); }
.admin-detail { padding: 24px 28px 40px; overflow-y: auto; }
.detail-vide { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--texte-2); }
.detail-tete { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 18px; }
.detail-tete h2 { font-size: 1.3rem; line-height: 1.25; }
.detail-tete .num { font-size: .85rem; color: var(--texte-2); margin-bottom: 4px; }
.commandes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.commandes select { margin: 0; width: auto; padding: 7px 10px; font-size: .9rem; }
.bloc { background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 16px 20px; margin-bottom: 16px; }
.bloc h3 { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); margin-bottom: 10px; }
.infos { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: .93rem; }
.infos dt { color: var(--texte-2); }
.chemin { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font-size: .88rem; }
.chemin li { background: var(--fond); border-radius: 6px; padding: 3px 9px; }
.chemin li + li::before { content: "› "; color: var(--texte-2); }
table.diag { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.diag td { padding: 6px 0; border-top: 1px solid var(--filet); vertical-align: top; }
table.diag td:first-child { width: 170px; color: var(--texte-2); padding-right: 12px; }
table.diag .pastille { display: inline-block; margin: 0 6px 0 0; vertical-align: 0; width: 9px; height: 9px; }
.vignettes { display: flex; gap: 10px; flex-wrap: wrap; }
.vignettes button { border: 1px solid var(--filet); background: var(--fond); border-radius: 8px; padding: 0; width: 140px; height: 92px; cursor: pointer; overflow: hidden; font-size: .8rem; color: var(--texte-2); }
.vignettes img { width: 100%; height: 100%; object-fit: cover; display: block; }
.note { background: #fffbea; border: 1px solid #f1e3a6; border-radius: 8px; padding: 9px 12px; font-size: .9rem; margin-bottom: 8px; }
.note .qui { font-size: .78rem; color: var(--texte-2); }
.reponse-outils { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.reponse-outils label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
.reponse-outils select { margin: 0; width: auto; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--texte); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: .92rem; z-index: 20; box-shadow: var(--ombre); }
.connexion { max-width: 380px; margin: 80px auto; }
.connexion h1 { font-size: 1.3rem; margin-bottom: 6px; }
.visionneuse { position: fixed; inset: 0; background: rgba(15, 18, 22, .85); display: flex; align-items: center; justify-content: center; z-index: 30; padding: 24px; cursor: zoom-out; }
.visionneuse img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.retour-liste { display: none; }

/* ---------- pages de texte ---------- */
.texte h2 { font-size: 1.1rem; margin: 24px 0 8px; }
.texte p, .texte li { color: #2c323a; margin-bottom: 8px; }
.texte ul { padding-left: 1.2em; }

/* ---------- pied de page ---------- */
.pied { border-top: 1px solid var(--filet); background: var(--carte); }
.pied-int { max-width: 1120px; margin: 0 auto; padding: 16px 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .82rem; color: var(--texte-2); }
.pied a { color: var(--texte-2); }
.version { opacity: .45; margin-left: 8px; }

.admin .entete-int { max-width: none; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .admin-grille { grid-template-columns: 1fr; }
  .admin-liste { min-height: 0; border-right: none; }
  .admin-grille.detail-ouvert .admin-liste { display: none; }
  .admin-grille:not(.detail-ouvert) .admin-detail { display: none; }
  .retour-liste { display: inline-block; margin-bottom: 12px; }
  .admin-detail { padding: 16px; }
}
@media (max-width: 640px) {
  .entete-int, .conteneur, .pied-int { padding-left: 16px; padding-right: 16px; }
  .entete-int { height: 56px; }
  .marque img { height: 50px; }
  .marque span { font-size: .72rem; }
  .nav .long { display: none; }
  .nav .court { display: inline; }
  .nav a { padding: 6px 8px; font-size: .88rem; }
  .tete-page { padding: 24px 0 16px; }
  .assistant { border-radius: 0; border-left: none; border-right: none; margin-left: -16px; margin-right: -16px; }
  .fil { padding: 16px; min-height: 360px; }
  .saisie { padding: 12px 16px; }
  .bulle { max-width: 92%; }
  .grille-2 { grid-template-columns: 1fr; }
  .carte { padding: 18px; }
  .infos { grid-template-columns: 1fr; }
  .infos dd { margin-bottom: 6px; }
  table.diag td:first-child { width: 110px; }
}

/* ---------- demandes reçues par email ---------- */
.origine-email { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--accent); background: var(--accent-pale); padding: 1px 7px; border-radius: 999px; vertical-align: 1px; }

/* dernier message d'un ticket : mis en avant, cible du défilement à l'ouverture */
.message.dernier { box-shadow: 0 0 0 2px var(--accent-pale), 0 0 0 3px #cfe7e3; }
.etiquette-nouveau { display: inline-block; margin-left: 6px; font-size: .7rem; font-weight: 700; color: #fff; background: var(--accent); padding: 1px 7px; border-radius: 999px; vertical-align: 1px; }
