/* THOR — démonstration web
   Couleurs regroupées ici (mêmes teintes que le tableau de bord du bureau). */
:root {
  --fond: #eef3f9;
  --surface: #ffffff;
  --surface-2: #f6f9fd;
  --carte: #f3f8fe;
  --bord-carte: #c7dbf3;
  --bordure: #dbe3ec;
  --texte: #101828;
  --texte-2: #475467;
  --accent: #1f6fd6;
  --accent-fonce: #1859ad;
  --accent-doux: #e3eefc;
  --sur-accent: #ffffff;
  --vert: #16a34a;
  --orange: #f5a524;
  --rouge: #dc2626;
  --gris: #d0d5dd;
  --inactif-fond: #eef1f5;
  --inactif-texte: #98a2b3;
  --ligne-paire: #f7fafe;
  --ligne-survol: #e8f1fc;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --ombre-haute: 0 10px 28px rgba(16, 24, 40, .14);
  --rayon: 12px;
  --police: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f151c;
    --surface: #171f28;
    --surface-2: #1d2731;
    --carte: #18222d;
    --bord-carte: #2b3b4d;
    --bordure: #2a3642;
    --texte: #e6edf3;
    --texte-2: #9aa8b6;
    --accent: #5aa2ec;
    --accent-fonce: #7db6f0;
    --accent-doux: #1b3248;
    --sur-accent: #0a1622;
    --vert: #3fb96b;
    --orange: #f2b04a;
    --rouge: #f06a6a;
    --gris: #4b5866;
    --inactif-fond: #1c242d;
    --inactif-texte: #5f6d7b;
    --ligne-paire: #1a232c;
    --ligne-survol: #20334a;
    --ombre: 0 1px 2px rgba(0, 0, 0, .45);
    --ombre-haute: 0 10px 28px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 15px/1.5 var(--police); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2 { line-height: 1.25; }

/* ---------- Logo ---------- */
.logo { width: 30px; height: 30px; }
.logo.grand { width: 64px; height: 64px; }
.logo-fond { fill: var(--accent); stroke: none; opacity: .18; }
.logo-anneau { stroke: var(--accent); stroke-width: 2; fill: none; opacity: .7; }
.logo-balai { stroke: var(--accent); stroke-width: 2.5; }
.logo-centre { fill: var(--accent); stroke: none; }

/* ---------- Bandeau, barre du haut ---------- */
.bandeau-demo { background: #3538cd; color: #fff; text-align: center; font-size: 13px;
                font-weight: 600; padding: 5px 12px; letter-spacing: .2px; }
.barre { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px;
         padding: 10px 28px; background: var(--surface); border-bottom: 1px solid var(--bordure); }
.marque { display: flex; align-items: center; gap: 10px; color: var(--texte); font-weight: 800;
          font-size: 19px; letter-spacing: .5px; }
.marque:hover { text-decoration: none; }
.etiquette { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-doux);
             padding: 2px 9px; border-radius: 999px; letter-spacing: 0; }
.fil { display: flex; align-items: center; gap: 8px; color: var(--texte-2); font-size: 14px;
       min-width: 0; overflow: hidden; white-space: nowrap; }
.fil span:last-child { color: var(--texte); font-weight: 600; }
.quitter { margin: 0 0 0 auto; }

/* ---------- Boutons ---------- */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
          border: 1px solid transparent; border-radius: 9px; padding: 9px 18px;
          font: 600 14px var(--police); cursor: pointer; white-space: nowrap; color: var(--texte);
          background: var(--surface); transition: background .15s, border-color .15s, box-shadow .15s; }
.bouton:hover { text-decoration: none; }
.bouton.principal { background: var(--accent); color: var(--sur-accent); }
.bouton.principal:hover { background: var(--accent-fonce); }
.bouton.secondaire { border-color: var(--bordure); }
.bouton.secondaire:hover { border-color: var(--accent); }
.bouton.large { width: 100%; padding: 12px 18px; font-size: 15px; }
.bouton.inactif, .onglet.inactif { background: var(--inactif-fond); color: var(--inactif-texte);
          border-color: transparent; cursor: not-allowed; box-shadow: none; }
.bouton-discret { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0;
                  color: var(--texte-2); font: 600 14px var(--police); cursor: pointer;
                  padding: 6px 10px; border-radius: 8px; }
.bouton-discret:hover { background: var(--surface-2); color: var(--texte); }

/* ---------- Contenu ---------- */
.contenu { max-width: 1440px; margin: 0 auto; padding: 24px 28px 48px; }

/* ---------- Connexion ---------- */
.page-connexion .contenu { min-height: calc(100vh - 32px); display: grid; place-items: center; }
.carte-connexion { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--bordure);
                   border-radius: 16px; box-shadow: var(--ombre-haute); padding: 36px 36px 30px; }
.connexion-marque { text-align: center; margin-bottom: 18px; }
.connexion-marque h1 { margin: 10px 0 2px; font-size: 30px; letter-spacing: 1px; }
.connexion-marque p { margin: 0; color: var(--texte-2); }
.demo-presentation { color: var(--texte-2); margin-bottom: 22px; }
.demo-presentation p { margin: 0 0 10px; }
.liste-points { margin: 0; padding-left: 18px; }
.liste-points li { margin: 4px 0; }
.note-audit { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--texte-2); }
.carte-message { max-width: 560px; margin: 60px auto; background: var(--surface); padding: 28px 32px;
                 border-radius: var(--rayon); border: 1px solid var(--bordure); }

/* ---------- Tableau de bord ---------- */
.entete-page { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 24px;
               justify-content: space-between; margin-bottom: 10px; }
.entete-titre h1 { margin: 0 0 8px; font-size: 24px; }
.entete-titre .plage { color: var(--texte-2); font-weight: 500; font-size: 18px; }
.pastilles { display: flex; flex-wrap: wrap; gap: 8px; }
.pastille { background: var(--p-fond); color: var(--p-texte); border-radius: 999px; padding: 3px 12px;
            font-size: 13px; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .pastille { background: color-mix(in srgb, var(--p-texte) 22%, var(--surface));
              color: color-mix(in srgb, var(--p-fond) 85%, white); }
}
.menu-principal { display: flex; flex-wrap: wrap; gap: 8px; }
.bouton.menu { border-color: var(--bordure); min-width: 120px; }
.bouton.menu.actif { background: var(--accent); color: var(--sur-accent); border-color: var(--accent);
                     box-shadow: 0 0 0 4px var(--accent-doux); }
.bouton.menu.actif:hover { background: var(--accent-fonce); }
.outils { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.bouton.outil { padding: 6px 14px; font-size: 13px; }

.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.carte { background: var(--carte); border: 1px solid var(--bord-carte); border-radius: var(--rayon);
         padding: 18px 22px 16px; display: flex; flex-direction: column; gap: 8px; min-height: 220px; }
.carte.verrouillee { background: var(--surface-2); border-style: dashed; border-color: var(--bordure); }
.carte.verrouillee .carte-titre { color: var(--texte-2); }
.carte-haut { display: flex; align-items: center; justify-content: space-between; }
.carte-etiquette { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
                   color: var(--texte-2); }
.cadenas { width: 18px; height: 18px; color: var(--inactif-texte); }
.carte-titre { margin: 2px 0 0; font-size: 21px; font-weight: 700; }
.carte-titre.alerte { color: var(--rouge); }
.carte-texte { margin: 0; color: var(--texte-2); }
.barre-empilee { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--gris);
                 margin-top: 8px; gap: 2px; }
.barre-empilee span { display: block; height: 100%; }
.legende { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px;
           font-size: 13px; color: var(--texte-2); }
.legende b { color: var(--texte); font-weight: 600; }
.puce { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 6px 0 0; font-size: 13px; }
.details dt { color: var(--texte-2); }
.details dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.carte-lien { margin-top: auto; padding-top: 8px; font-size: 14px; font-weight: 600; }
.appel-audit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
               margin-top: 22px; padding: 20px 24px; border-radius: var(--rayon);
               background: linear-gradient(120deg, var(--accent-doux), var(--surface));
               border: 1px solid var(--bord-carte); }
.appel-audit h2 { margin: 0 0 4px; font-size: 19px; }
.appel-audit p { margin: 0; color: var(--texte-2); max-width: 760px; }
.appel-audit.compact { margin: 0 0 14px; padding: 14px 20px; }
.appel-audit.compact h2 { font-size: 16px; }
.bouton.petit { padding: 6px 12px; font-size: 13px; }
.lien-audit { margin-left: auto; }
.lien-audit + .quitter { margin-left: 0; }
.bandeau-demo a { color: #fff; text-decoration: underline; }

/* ---------- Onglets ---------- */
.onglets { display: flex; gap: 2px; border-bottom: 1px solid var(--bordure); overflow-x: auto;
           scrollbar-width: thin; }
.onglet { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 16px;
          font: 600 14px var(--police); color: var(--texte-2); cursor: pointer; white-space: nowrap; }
.onglet:hover { color: var(--texte); }
.onglet[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.onglet.inactif { background: none; }
.compteur:not(:empty) { margin-left: 6px; background: var(--accent-doux); color: var(--accent);
                        border-radius: 999px; padding: 0 7px; font-size: 12px; }

/* ---------- Menu inventaire ---------- */
.panneau-menu { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon);
                box-shadow: var(--ombre); padding: 6px 22px 22px; max-width: 980px; margin: 0 auto; }
.grille-boutons { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px;
                  padding: 22px 0 6px; }
.bouton.tuile { flex-direction: column; gap: 10px; padding: 22px 14px; border: 1px solid var(--bordure);
                min-height: 108px; white-space: normal; text-align: center; }
.bouton.tuile svg { width: 26px; height: 26px; }
.bouton.tuile.actif { background: var(--accent); color: var(--sur-accent); border-color: var(--accent); }
.bouton.tuile.actif:hover { background: var(--accent-fonce); }
.pied-menu { border-top: 1px solid var(--bordure); margin-top: 16px; padding-top: 16px; }

/* ---------- Analyse réseau ---------- */
.barre-scan { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--surface);
              border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 14px 18px; }
.barre-scan label { font-weight: 600; }
.barre-scan input[type=text] { font: 14px var(--mono); padding: 8px 10px; border-radius: 8px;
             border: 1px solid var(--bordure); background: var(--surface-2); color: var(--texte); width: 200px; }
.barre-scan .case { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }
.barre-scan .case.inactif { color: var(--inactif-texte); cursor: not-allowed; }
.barre-scan .espace { flex: 1; }
.bouton.principal.en-cours, .bouton.principal.en-cours:hover { background: var(--rouge); color: #fff; }
.etat-scan { margin: 12px 2px; }
.etat-scan p { margin: 0; color: var(--texte-2); font-size: 14px; }
.progression { height: 6px; background: var(--accent-doux); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.progression span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }

.zone-tables { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon);
               box-shadow: var(--ombre); overflow: hidden; }
.zone-tables .onglets { padding: 0 10px; flex-wrap: wrap; }
.zone-tables .onglet { padding: 10px 13px; }
.zone-tables .panneau { padding: 12px 14px 14px; }
.outils-table { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.outils-table input[type=search] { font: 14px var(--police); padding: 7px 10px; border-radius: 8px; width: 280px;
             border: 1px solid var(--bordure); background: var(--surface-2); color: var(--texte); }
.outils-table .info { color: var(--texte-2); font-size: 13px; }
.defile { overflow: auto; max-height: calc(100vh - 330px); min-height: 220px; border: 1px solid var(--bordure);
          border-radius: 8px; }
table.donnees { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.donnees th { position: sticky; top: 0; z-index: 1; background: var(--accent-doux); color: var(--texte);
          text-align: left; padding: 7px 10px; font-weight: 600; white-space: nowrap;
          border-bottom: 1px solid var(--bord-carte); cursor: pointer; user-select: none; }
table.donnees th[aria-sort="ascending"]::after { content: " ▲"; font-size: 10px; }
table.donnees th[aria-sort="descending"]::after { content: " ▼"; font-size: 10px; }
table.donnees td { padding: 6px 10px; border-bottom: 1px solid var(--bordure); vertical-align: top;
          max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.donnees td.long { white-space: normal; min-width: 260px; }
table.donnees td.mono { font-family: var(--mono); font-size: 12.5px; }
table.donnees tbody tr:nth-child(even) td { background: var(--ligne-paire); }
table.donnees tbody tr:hover td { background: var(--ligne-survol); }
table.donnees tr.nouvelle td { animation: apparait .6s ease-out; }
@keyframes apparait { from { background: color-mix(in srgb, var(--accent) 25%, transparent); } }
.vide { color: var(--texte-2); padding: 28px; text-align: center; }
.plus { margin-top: 10px; }
.badge { display: inline-block; border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; }
.g-critique { background: #fee4e2; color: #b42318; }
.g-elevee { background: #fef0c7; color: #93370d; }
.g-moyenne { background: #fef7c3; color: #854a0e; }
.g-info { background: #eaecf0; color: #344054; }
@media (prefers-color-scheme: dark) {
  .g-critique { background: #55160c; color: #fda29b; }
  .g-elevee { background: #4e1d09; color: #fec84b; }
  .g-moyenne { background: #4a3a06; color: #fde272; }
  .g-info { background: #2a333d; color: #cfd6de; }
}
@media (prefers-reduced-motion: reduce) {
  table.donnees tr.nouvelle td { animation: none; }
  .progression span { transition: none; }
}

/* ---------- Demande d'audit ---------- */
.audit-grille { display: grid; grid-template-columns: minmax(260px, 5fr) minmax(320px, 7fr); gap: 28px;
                align-items: start; max-width: 1180px; margin: 0 auto; }
.audit-intro h1 { font-size: 28px; margin: 10px 0 12px; }
.audit-intro > p { color: var(--texte-2); }
.audit-intro .marque { margin-bottom: 8px; }
.etapes { margin: 18px 0; padding-left: 20px; display: grid; gap: 10px; }
.etapes li { padding-left: 4px; color: var(--texte-2); }
.etapes b { color: var(--texte); }
.carte-formulaire { background: var(--surface); border: 1px solid var(--bordure); border-radius: 16px;
                    box-shadow: var(--ombre-haute); padding: 26px 28px; }
.formulaire-audit { display: grid; gap: 14px; }
.ligne-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.champ { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.champ label { font-weight: 600; font-size: 14px; }
.obligatoire { color: var(--rouge); }
.champ input, .champ select, .champ textarea {
  font: 15px var(--police); padding: 9px 11px; border-radius: 8px; border: 1px solid var(--bordure);
  background: var(--surface-2); color: var(--texte); width: 100%; }
.champ textarea { resize: vertical; min-height: 96px; }
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-doux); }
.en-erreur input, .en-erreur select, .en-erreur textarea { border-color: var(--rouge); }
.erreur-champ { margin: 0; color: var(--rouge); font-size: 13px; }
.case-champ { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; font-size: 14px; }
.case-champ input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.case-champ .erreur-champ { grid-column: 2; }
.mention { font-size: 12.5px; color: var(--texte-2); margin: 2px 0 4px; }
.pot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.message-erreur { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; background: color-mix(in srgb, var(--rouge) 12%, var(--surface)); color: var(--rouge);
                 border: 1px solid color-mix(in srgb, var(--rouge) 35%, transparent); }
.merci { text-align: center; }
.merci .coche { width: 56px; height: 56px; color: var(--vert); }
.merci h1 { font-size: 24px; }
.merci p { color: var(--texte-2); }
.merci .actions { margin-top: 18px; }

/* ---------- Message « non disponible » ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50;
         background: var(--texte); color: var(--surface); padding: 10px 18px; border-radius: 10px;
         box-shadow: var(--ombre-haute); font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); }

/* ---------- Petits écrans ---------- */
@media (max-width: 720px) {
  .barre { padding: 10px 16px; gap: 10px; }
  .fil, .etiquette, .lien-audit { display: none; }
  .lien-audit + .quitter { margin-left: auto; }
  .contenu { padding: 16px 16px 40px; }
  .carte-connexion { padding: 26px 20px 22px; }
  .bouton.menu { min-width: 0; flex: 1 1 40%; }
  .menu-principal { width: 100%; }
  .outils { justify-content: flex-start; }
  .barre-scan input[type=text] { width: 100%; }
  .barre-scan .espace { display: none; }
  .outils-table input[type=search] { width: 100%; }
  .defile { max-height: 70vh; }
  .audit-grille, .ligne-2 { grid-template-columns: 1fr; }
  .carte-formulaire { padding: 20px 16px; }
  .zone-tables .onglets { flex-wrap: nowrap; }
}
