/* SIMTEC — thème commun. Carbone avec accents néon.
   La couleur du « S » et l'accent viennent de --accent, pour que chaque modèle
   (data-modele sur <html>) puisse changer la couleur et la présentation. */
:root {
  --accent: #2ea8ff;
  --accent-fort: color-mix(in srgb, var(--accent) 62%, #fff);
  --accent-encre: #04121f;
  --accent-doux: color-mix(in srgb, var(--accent) 14%, transparent);
  --lueur: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 25%, transparent);
  --fond: #0b0d10;
  --carbone-a: #121519;
  --carbone-b: #0e1013;
  --panneau: #161a1f;
  --panneau-2: #1c2128;
  --bord: #2a313a;
  --texte: #eef2f6;
  --texte-2: #a9b4c0;
  --ok: #3ddc97;
  --attention: #ffb547;
  --danger: #ff5d6c;
  --rayon: 14px;
  --police: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--police); font-size: 16px; font-weight: 500; line-height: 1.45; color: var(--texte);
  background-color: var(--fond);
  background-image:
    linear-gradient(45deg, var(--carbone-a) 25%, transparent 25%, transparent 75%, var(--carbone-a) 75%),
    linear-gradient(45deg, var(--carbone-a) 25%, var(--carbone-b) 25%, var(--carbone-b) 75%, var(--carbone-a) 75%);
  background-size: 8px 8px; background-position: 0 0, 4px 4px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-fort); }
h1, h2, h3 { margin: 0 0 .5em; font-weight: 750; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Listes déroulantes lisibles partout : sans ça, un <select> hors d'un .champ garde le fond blanc du navigateur avec le texte blanc des modèles foncés. */
:root { color-scheme: dark; }
[data-theme="clair"] { color-scheme: light; }
select { background-color: var(--panneau-2); color: var(--texte); border: 1px solid var(--bord); border-radius: 8px; }
option, optgroup { background-color: var(--panneau); color: var(--texte); }

/* ---------- Logo ---------- */
.logo { display: block; height: 72px; width: auto; max-width: 100%; user-select: none; border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.logo-s { display: none; width: 48px; height: auto; border-radius: 6px; }
.logo-produit { display: block; font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; color: var(--accent-fort); margin-top: 4px; font-weight: 700; }

/* ---------- Charpente ---------- */
.appli { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.cote { background: rgba(10, 12, 15, .92); border-right: 1px solid var(--bord); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.cote .logo-bloc { padding: 4px 10px 18px; }
.nav-lien { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--texte-2); text-decoration: none; font-weight: 600; border: 1px solid transparent; }
.nav-lien svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-lien:hover { color: var(--texte); background: var(--panneau); }
.nav-lien.actif { color: #fff; background: var(--accent-doux); border-color: color-mix(in srgb, var(--accent) 35%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.nav-lien .pastille { margin-left: auto; background: var(--danger); color: #fff; font-size: .72rem; border-radius: 99px; padding: 1px 7px; }
.cote .pied { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--bord); font-size: .85rem; color: var(--texte-2); }
.principal-zone { min-width: 0; display: flex; flex-direction: column; }
.barre { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: rgba(11, 13, 16, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--bord); }
.barre .titre-page { font-weight: 750; font-size: 1.1rem; margin-right: auto; }
.contenu { padding: 24px; max-width: 1280px; width: 100%; }
.bandeau-demo { font-size: .8rem; color: var(--texte-2); padding: 6px 24px; border-bottom: 1px solid var(--bord); background: rgba(255,181,71,.06); }
.nav-bas { display: none; }

/* ---------- Composants ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--bord); background: var(--panneau-2); color: var(--texte); font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.principal { background: linear-gradient(180deg, var(--accent-fort), var(--accent)); color: var(--accent-encre); border-color: transparent; box-shadow: var(--lueur); }
.btn.danger { color: var(--danger); }
.btn.petit { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-icone { background: none; border: 0; color: var(--texte-2); font-size: 1.6rem; cursor: pointer; line-height: 1; padding: 4px 8px; }
.groupe-btn { display: flex; flex-wrap: wrap; gap: 8px; }
.carte { background: linear-gradient(180deg, rgba(28,33,40,.92), rgba(20,24,29,.92)); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px; }
.carte + .carte { margin-top: 16px; }
.grille > .carte + .carte { margin-top: 0; }
td strong, td.nw { white-space: nowrap; }
.grille { display: grid; gap: 16px; }
.grille > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chiffre { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.chiffre-lib { color: var(--texte-2); font-size: .88rem; font-weight: 600; }
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.kpi.attention::after { background: var(--attention); box-shadow: 0 0 12px var(--attention); }
.kpi.danger::after { background: var(--danger); box-shadow: 0 0 12px var(--danger); }
.etiquette { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 700; border: 1px solid var(--bord); color: var(--texte-2); white-space: nowrap; }
.etiquette.bleu { color: var(--accent-fort); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-doux); }
.etiquette.vert { color: var(--ok); border-color: rgba(61,220,151,.4); background: rgba(61,220,151,.08); }
.etiquette.jaune { color: var(--attention); border-color: rgba(255,181,71,.4); background: rgba(255,181,71,.08); }
.etiquette.rouge { color: var(--danger); border-color: rgba(255,93,108,.45); background: rgba(255,93,108,.08); }
.tableau-zone { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th { text-align: left; color: var(--texte-2); font-weight: 650; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding: 10px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid rgba(42,49,58,.6); vertical-align: middle; }
tr.cliquable { cursor: pointer; }
tr.cliquable:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muet { color: var(--texte-2); }
.seul-mobile { display: none; }
.petit-texte { font-size: .85rem; }
.ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.espace { flex: 1; }
.champ { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: .9rem; color: var(--texte-2); font-weight: 600; }
.champ input, .champ select, .champ textarea, .recherche { background: #0f1216; border: 1px solid var(--bord); border-radius: 10px; padding: 10px 12px; color: var(--texte); min-height: 42px; width: 100%; }
.champ input:focus, .champ select:focus, .champ textarea:focus, .recherche:focus { outline: none; border-color: var(--accent); box-shadow: var(--lueur); }
.recherche { max-width: 320px; }
.liste-alertes { list-style: none; margin: 0; padding: 0; }
.liste-alertes li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid rgba(42,49,58,.6); }
.liste-alertes li:last-child { border-bottom: 0; }
.point { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.point.jaune { background: var(--attention); box-shadow: 0 0 8px var(--attention); }
.point.rouge { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bord); margin-bottom: 16px; overflow-x: auto; }
.onglet { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--texte-2); font-weight: 650; cursor: pointer; white-space: nowrap; }
.onglet.actif { color: #fff; border-color: var(--accent); }
.qr-boite { background: #fff; border-radius: 12px; padding: 8px; display: inline-block; line-height: 0; }
.vide { color: var(--texte-2); padding: 18px 0; text-align: center; }
.jauge { height: 8px; background: #0f1216; border-radius: 99px; overflow: hidden; border: 1px solid var(--bord); }
.jauge > span { display: block; height: 100%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.jauge.jaune > span { background: var(--attention); box-shadow: none; }
.jauge.rouge > span { background: var(--danger); box-shadow: none; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--bord); }
.coche { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid rgba(42,49,58,.5); cursor: pointer; }
.coche input { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 2px; flex: none; }
.chrono { font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 800; color: var(--accent-fort); }

/* Planification annuelle */
.plan { border-collapse: separate; border-spacing: 3px; }
.plan th, .plan td { border: 0; padding: 6px; text-align: center; }
.plan td.case { background: #0f1216; border-radius: 6px; min-width: 52px; height: 38px; font-size: .74rem; font-weight: 700; }
.plan td.case.fait { background: rgba(61,220,151,.14); color: var(--ok); }
.plan td.case.prevu { background: var(--accent-doux); color: var(--accent-fort); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.plan td.case.retard { background: rgba(255,93,108,.14); color: var(--danger); }
.plan td.case.ce-mois { outline: 1px dashed var(--accent); }

/* Connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.connexion .carte { width: 100%; max-width: 440px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.5), var(--lueur); }
.connexion .logo { height: 150px; margin: 0 auto; }
.roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.role-choix { overflow-wrap: anywhere; hyphens: auto; }
.role-choix { text-align: left; padding: 12px; border-radius: 10px; border: 1px solid var(--bord); background: #0f1216; cursor: pointer; font-weight: 650; }
.role-choix small { display: block; color: var(--texte-2); font-weight: 500; margin-top: 2px; }
.role-choix.actif { border-color: var(--accent); box-shadow: var(--lueur); }

/* Modale */
.modale-fond { position: fixed; inset: 0; background: rgba(0,0,0,.66); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modale { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--panneau); border: 1px solid var(--bord); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modale-tete { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.modale-tete h2 { margin: 0; }
.modale-corps { padding: 8px 18px; overflow-y: auto; }
.modale-pied { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--bord); }
.scan-cadre { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan-cadre video { width: 100%; height: 100%; object-fit: cover; }
.scan-viseur { position: absolute; inset: 18%; border: 2px solid var(--accent); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.35), 0 0 22px var(--accent); }
.scan-aide { color: var(--texte-2); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0; background: var(--panneau-2); border: 1px solid var(--accent); box-shadow: var(--lueur); padding: 12px 18px; border-radius: 12px; z-index: 60; transition: .25s; font-weight: 650; max-width: calc(100vw - 32px); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.bandeau-avis { border: 1px solid rgba(255,181,71,.45); background: rgba(255,181,71,.08); color: var(--attention); border-radius: 10px; padding: 10px 14px; font-weight: 650; margin-bottom: 16px; }

/* ---------- Téléphone et tablette ---------- */
@media (max-width: 980px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .appli { grid-template-columns: 1fr; }
  .cote { display: none; }
  .barre { padding: 10px 16px; }
  .barre .btn span { display: none; }
  .barre .titre-page { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .contenu { padding: 16px 16px 96px; }
  .bandeau-demo { padding: 6px 16px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .recherche { max-width: none; }
  .nav-bas { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(10,12,15,.96); border-top: 1px solid var(--bord); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .nav-bas a, .nav-bas button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; font-weight: 650; color: var(--texte-2); text-decoration: none; background: none; border: 0; padding: 4px 0; }
  .nav-bas svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .nav-bas .actif { color: var(--accent-fort); }
  .nav-bas .scan-central { color: var(--accent-encre); }
  .nav-bas .scan-central span.rond { width: 52px; height: 52px; margin-top: -24px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, var(--accent-fort), var(--accent)); box-shadow: var(--lueur); }
  .nav-bas .scan-central small { color: var(--texte-2); }
  .cache-mobile { display: none !important; }
  .seul-mobile { display: block; }
}

/* ---------- Impression (étiquettes QR, comptes rendus) ---------- */
@media print {
  body { background: #fff; color: #000; }
  .cote, .barre, .nav-bas, .bandeau-demo, .non-imprime { display: none !important; }
  .appli { display: block; }
  .carte { background: #fff; border: 1px solid #bbb; color: #000; break-inside: avoid; }
  .muet { color: #444; }
  .etiquettes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

/* ---------- Coquille commune ---------- */
.logo-groupe { display: flex; align-items: center; gap: 12px; }
.modeles { display: grid; gap: 8px; }
.modele-choix { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--bord); background: var(--panneau-2); cursor: pointer; font-weight: 650; text-align: left; }
.modele-choix.actif { border-color: var(--accent); box-shadow: var(--lueur); }
.pastille-s { font-weight: 900; font-size: 1.5rem; line-height: 1; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #0f1216; text-shadow: 0 0 8px currentColor; }
.suite-liens { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px; }
.bandeau-avis-haut { background: rgba(255,181,71,.12); color: var(--attention); font-weight: 700; padding: 8px 24px; border-bottom: 1px solid rgba(255,181,71,.4); font-size: .9rem; }

/* ---------- Thème clair (modèles 2 et 4) ---------- */
[data-theme="clair"] {
  --fond: #eef2f7; --carbone-a: #eef2f7; --carbone-b: #e9eef4;
  --panneau: #ffffff; --panneau-2: #f5f8fb; --bord: #d8e0ea;
  --texte: #0f1a26; --texte-2: #586678;
  --accent-fort: color-mix(in srgb, var(--accent) 80%, #000);
  --accent-encre: #ffffff;
  --lueur: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 6px 18px color-mix(in srgb, var(--accent) 22%, transparent);
  --ok: #0f9d66; --attention: #b86e00; --danger: #d42a3c;
}
[data-theme="clair"] body { background: linear-gradient(180deg, #f7f9fc, #e9eff6) fixed; }
[data-theme="clair"] .carte { background: #fff; box-shadow: 0 1px 2px rgba(16,32,56,.05), 0 8px 24px rgba(16,32,56,.06); }
[data-theme="clair"] .cote, [data-theme="clair"] .nav-bas { background: rgba(255,255,255,.96); }
[data-theme="clair"] .barre { background: rgba(255,255,255,.88); }
[data-theme="clair"] .nav-lien.actif { color: var(--accent-fort); }
[data-theme="clair"] .onglet.actif { color: var(--texte); }
[data-theme="clair"] .champ input, [data-theme="clair"] .champ select, [data-theme="clair"] .champ textarea, [data-theme="clair"] .recherche,
[data-theme="clair"] .role-choix, [data-theme="clair"] .jauge, [data-theme="clair"] .plan td.case { background: #f4f7fa; }
[data-theme="clair"] .pastille-s { background: #0f1216; }
[data-theme="clair"] .bandeau-demo { background: #fff7e8; }
[data-theme="clair"] .modale { background: #fff; }
[data-theme="clair"] .toast { background: #fff; }
[data-theme="clair"] .kpi::after { box-shadow: none; }
[data-theme="clair"] .point { box-shadow: none; }

/* ---------- Disposition « haut » (menu en haut, modèles 2 et 5) ---------- */
@media (min-width: 761px) {
  [data-disposition="haut"] .appli { grid-template-columns: 1fr; }
  [data-disposition="haut"] .cote { position: sticky; top: 0; z-index: 6; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 20px; border-right: 0; border-bottom: 1px solid var(--bord); }
  [data-disposition="haut"] .cote .logo-bloc { padding: 0 18px 0 0; flex: none; }
  [data-disposition="haut"] .cote .logo { height: 52px; }
  [data-disposition="haut"] .nav-liste { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
  [data-disposition="haut"] .nav-lien { padding: 9px 11px; white-space: nowrap; font-size: .92rem; }
  [data-disposition="haut"] .nav-lien.actif { box-shadow: inset 0 -3px 0 var(--accent); }
  [data-disposition="haut"] .cote .pied { margin: 0 0 0 auto; border: 0; padding: 0 0 0 12px; display: flex; align-items: center; gap: 10px; white-space: nowrap; flex: none; }
  [data-disposition="haut"] .cote .pied .btn { margin-top: 0 !important; }
  [data-disposition="haut"] .barre { top: 0; position: relative; }
  [data-disposition="haut"] .contenu { margin: 0 auto; }
}
/* ---------- Disposition « rail » (icônes seulement, modèle 3) ---------- */
@media (min-width: 761px) {
  [data-disposition="rail"] .appli { grid-template-columns: 84px 1fr; }
  [data-disposition="rail"] .cote { padding: 16px 10px; align-items: center; }
  [data-disposition="rail"] .cote .logo-bloc { padding: 0 0 14px; }
  [data-disposition="rail"] .logo-produit, [data-disposition="rail"] .cote .logo, [data-disposition="rail"] .nav-lien span:not(.pastille), [data-disposition="rail"] .cote .pied div { display: none; }
  [data-disposition="rail"] .cote .logo-s { display: block; }
  [data-disposition="rail"] .nav-lien { justify-content: center; padding: 12px; position: relative; }
  [data-disposition="rail"] .nav-lien .pastille { position: absolute; top: 2px; right: 2px; }
  [data-disposition="rail"] .nav-lien svg { width: 24px; height: 24px; }
  [data-disposition="rail"] .cote .pied { padding: 10px 0 0; }
  [data-disposition="rail"] .cote .pied .btn { padding: 4px; font-size: .68rem; white-space: normal; width: 64px; line-height: 1.1; }
}
/* Modèle 3 : graphite plus chaud. Modèle 5 : nuit plus profonde. */
[data-modele="3"] { --fond: #121212; --carbone-a: #1a1918; --carbone-b: #141312; --panneau: #1c1b1a; --panneau-2: #24221f; --bord: #35312c; }
[data-modele="5"] { --fond: #07080d; --carbone-a: #0d0f17; --carbone-b: #090a10; --panneau: #11131c; --panneau-2: #171a26; --bord: #262a3a; }

.note-barre { display: inline-block; width: 70px; height: 8px; border-radius: 99px; background: var(--bord); overflow: hidden; vertical-align: middle; }
.note-barre > span { display: block; height: 100%; background: var(--attention); }
.meilleur { color: var(--ok); font-weight: 800; }
.ecart { color: var(--danger); font-weight: 800; }
.etapes { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.etapes .etape { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--bord); font-size: .78rem; font-weight: 700; color: var(--texte-2); }
.etapes .etape.fait { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.etapes .etape.actuelle { color: var(--accent-fort); border-color: var(--accent); box-shadow: var(--lueur); }
.vignette { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; border: 1px solid var(--bord); background: var(--panneau-2); display: grid; place-items: center; color: var(--texte-2); flex: none; }
.vignette svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* ---------- IA SIMTEC ---------- */
.ia-entete { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--panneau)), var(--panneau)); }
.ia-puce { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 18%, transparent); box-shadow: var(--lueur); color: var(--accent-fort); flex: none; }
.ia-puce svg { width: 36px; height: 36px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.ia-anneaux { display: flex; gap: 18px; text-align: center; }
.ia-anneau { --pct: 100; --c: var(--ok); width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 4px;
  background: conic-gradient(var(--c) calc(var(--pct) * 1%), var(--bord) 0); }
.ia-anneau span { width: 70px; height: 70px; border-radius: 50%; background: var(--panneau); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; }
.ia-anneau small { font-size: .7rem; }
.ia-modules { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.ia-module { display: inline-flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--bord); background: var(--panneau-2); font-size: .82rem; font-weight: 650; cursor: pointer; }
.ia-module.actif { border-color: var(--accent); box-shadow: var(--lueur); }
.ia-reponse { white-space: pre-line; margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--accent-doux); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.ia-savoir { border-bottom: 1px solid var(--bord); padding: 10px 0; }
.ia-savoir summary { cursor: pointer; font-weight: 700; }
.ia-savoir p { margin: 8px 0 0; color: var(--texte-2); }

/* ---------- Drapeau du Québec ---------- */
.drapeau-qc { width: 27px; height: 18px; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 2px 6px rgba(0,0,0,.35); vertical-align: middle; }
.fabrique { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .78rem; font-weight: 700; color: var(--texte-2); letter-spacing: .02em; }
.cote .pied .fabrique { margin: 0 0 12px; }
.barre .barre-qc { width: 24px; height: 16px; }
[data-theme="clair"] .drapeau-qc { box-shadow: 0 0 0 1px rgba(16,32,56,.12), 0 1px 3px rgba(16,32,56,.15); }
[data-disposition="rail"] .cote .pied .fabrique span { display: none; }
@media print { .drapeau-qc { box-shadow: none; } }
.connexion .fabrique .drapeau-qc { width: 36px; height: 24px; }
.connexion .fabrique { font-size: .85rem; }
.etiquette.code-panne { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; white-space: nowrap; }
@media (max-width: 760px) {
  .liste-alertes li { flex-wrap: wrap; row-gap: 6px; }
  .liste-alertes li > span[style*="flex:1"] { min-width: 55%; }
}

/* ---------- Répartition ---------- */
.point.vert { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.point.bleu { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.repartition { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(205px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; margin-top: 12px; }
.colonne { background: var(--panneau); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 180px; transition: border-color .15s, box-shadow .15s; }
.colonne-tete { padding: 2px 4px 6px; border-bottom: 1px solid var(--bord); }
.colonne-vide { color: var(--texte-2); text-align: center; padding: 18px 0; font-size: .9rem; }
.colonne.survol { border-color: var(--accent); box-shadow: var(--lueur); }
.colonne.atelier { border-color: rgba(255,93,108,.45); background: color-mix(in srgb, var(--danger) 6%, var(--panneau)); }
.voyage-carte { background: var(--panneau-2); border: 1px solid var(--bord); border-radius: 10px; padding: 10px; cursor: grab; touch-action: manipulation; overflow-wrap: anywhere; }
.voyage-carte:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--bord)); }
.voyage-carte.alerte { border-left: 3px solid var(--attention); }
.voyage-carte.glisse { opacity: .45; }
.voyage-carte svg { width: 14px; height: 14px; vertical-align: -2px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.voyage-alertes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.voyage-alertes .etiquette { white-space: normal; max-width: 100%; }
.carte-geo { height: 460px; border-radius: var(--rayon); border: 1px solid var(--bord); overflow: hidden; margin-bottom: 16px; background: #1a1f26; }
.signature { display: block; width: 100%; height: 160px; background: #fff; border-radius: 10px; border: 1px solid var(--bord); touch-action: none; cursor: crosshair; }
.signature-image { display: block; max-width: 300px; width: 100%; background: #fff; border-radius: 8px; margin-top: 8px; }
.grand-bouton { width: 100%; justify-content: center; padding: 16px; font-size: 1.05rem; margin-top: 12px; }
.ronde-points { display: flex; flex-direction: column; gap: 8px; }
.ronde-point { padding: 10px 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--panneau-2); }
.ronde-point.mineur { border-left: 3px solid var(--attention); }
.ronde-point.majeur { border-left: 3px solid var(--danger); }
.ronde-note { width: 100%; margin-top: 8px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--bord); background: var(--fond); }
.btn.danger-plein { background: var(--danger); color: #fff; border-color: transparent; }
.btn.attention-plein { background: var(--attention); color: #1d1300; border-color: transparent; }
.messagerie { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.canaux { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.canal { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; min-width: 0; }
.canal span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canal:hover { background: var(--panneau-2); }
.canal.actif { background: var(--accent-doux); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.fil { min-width: 0; }
.messagerie > .carte { margin-top: 0; }
.bulles { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.bulle { max-width: 80%; align-self: flex-start; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--panneau-2); border: 1px solid var(--bord); overflow-wrap: anywhere; }
.bulle.moi { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--accent-doux); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.bulle.alerte { border-left: 3px solid var(--danger); max-width: 100%; }
[data-theme="clair"] .carte-geo { background: #e8ecf0; }
[data-theme="clair"] .point.vert { box-shadow: none; }
@media (max-width: 760px) {
  .repartition { grid-auto-flow: row; grid-auto-columns: auto; overflow-x: visible; }
  .colonne { min-height: 0; }
  .voyage-carte { cursor: pointer; }
  .carte-geo { height: 320px; }
  .messagerie { grid-template-columns: minmax(0, 1fr); }
  .canaux { flex-direction: row; overflow-x: auto; }
  .canal { flex: none; max-width: 200px; }
  .bulle { max-width: 92%; }
}

/* ---------- Tableaux sur téléphone : une fiche par ligne ---------- */
@media (max-width: 760px) {
  table.empile, table.empile tbody, table.empile tr, table.empile td { display: block; width: 100%; }
  table.empile thead { display: none; }
  table.empile tr { padding: 10px 0; border-bottom: 1px solid var(--bord); }
  table.empile tr:last-child { border-bottom: 0; }
  table.empile td { padding: 3px 0; border: 0; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  table.empile td::after { content: ""; display: table; clear: both; }
  table.empile td::before { content: attr(data-l); float: left; margin-right: 12px; color: var(--texte-2); font-size: .76rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; line-height: 1.9; text-align: left; }
  table.empile td:first-child { text-align: left; font-size: 1rem; padding-bottom: 4px; }
  table.empile td:first-child::before, table.empile td[data-l=""]::before { display: none; }
  table.empile td strong, table.empile td.nw { white-space: normal; }
  table.empile td.num { text-align: right; }
  table.empile .etiquette { white-space: normal; max-width: 100%; }
  .chiffre { font-size: 1.55rem; overflow-wrap: anywhere; }
}
/* Icône à côté d'un titre de carte */
.ic-titre { display: inline-flex; width: 22px; height: 22px; flex: none; color: var(--accent); }
.ic-titre svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Les 5 formats : chaque modèle a sa propre présentation, pas seulement sa couleur ---------- */
.logo-barre { display: none; height: 44px; width: auto; flex: none; border-radius: 6px; }
.modele-format { display: block; font-size: .76rem; font-weight: 550; color: var(--texte-2); margin-top: 2px; }

/* 3 · Graphite cuivre : atelier industriel, coins carrés, titres en capitales. */
[data-modele="3"] { --rayon: 4px; }
[data-modele="3"] .carte, [data-modele="3"] .btn, [data-modele="3"] .nav-lien, [data-modele="3"] .kpi, [data-modele="3"] .modale, [data-modele="3"] .champ input, [data-modele="3"] .champ select, [data-modele="3"] .champ textarea, [data-modele="3"] .recherche, [data-modele="3"] .etiquette, [data-modele="3"] .onglet { border-radius: 4px; }
[data-modele="3"] .carte h2, [data-modele="3"] th { text-transform: uppercase; letter-spacing: .06em; font-size: .9rem; }
[data-modele="3"] .barre .titre-page { text-transform: uppercase; letter-spacing: .08em; }

/* 4 · Blanc émeraude : panneaux flottants, grands arrondis, beaucoup d'air. */
[data-modele="4"] { --rayon: 22px; }
[data-modele="4"] .carte, [data-modele="4"] .kpi, [data-modele="4"] .modale { border-radius: 22px; }
[data-modele="4"] .btn, [data-modele="4"] .onglet, [data-modele="4"] .recherche { border-radius: 99px; }
[data-modele="4"] .nav-lien { border-radius: 14px; }
[data-modele="4"] .nav-lien.actif { box-shadow: none; }
@media (min-width: 761px) { [data-modele="4"] .contenu { padding: 30px; } }
[data-modele="4"] .carte { box-shadow: 0 10px 30px rgba(15, 40, 30, .08); }
@media (min-width: 761px) {
  [data-disposition="flottant"] .appli { grid-template-columns: 266px 1fr; }
  [data-disposition="flottant"] .cote { margin: 16px 0 16px 16px; height: calc(100vh - 32px); top: 16px; border: 1px solid var(--bord); border-radius: 24px; box-shadow: 0 18px 50px rgba(15, 40, 30, .12); }
  [data-disposition="flottant"] .barre { margin: 16px 16px 0; border: 1px solid var(--bord); border-radius: 18px; top: 16px; }
  [data-disposition="flottant"] .nav-lien { padding: 9px 12px; }
  [data-disposition="flottant"] .bandeau-demo { margin: 10px 16px 0; border: 0; border-radius: 12px; }
}

/* 5 · Nuit rubis : logo dans la barre du haut, menu en dock flottant en bas, écran compact. */
[data-modele="5"] .contenu { padding: 16px 20px; max-width: none; }
[data-modele="5"] .carte { padding: 14px; }
[data-modele="5"] td, [data-modele="5"] th { padding-top: 7px; padding-bottom: 7px; }
[data-modele="5"] .btn { min-height: 36px; border-radius: 8px; }
@media (min-width: 761px) {
  [data-disposition="dock"] .appli { grid-template-columns: 1fr; }
  [data-disposition="dock"] .logo-barre { display: block; }
  [data-disposition="dock"] .barre .titre-page { padding-left: 14px; border-left: 1px solid var(--bord); }
  [data-disposition="dock"] .contenu { padding-bottom: 110px; }
  [data-disposition="dock"] .cote { position: fixed; top: auto; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 20; height: auto; max-width: calc(100vw - 28px); flex-direction: row; align-items: center; padding: 6px 8px; border: 1px solid var(--bord); border-radius: 20px; background: rgba(14, 10, 14, .9); backdrop-filter: blur(14px); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), var(--lueur); overflow-x: auto; overflow-y: hidden; }
  [data-disposition="dock"] .cote .logo-bloc, [data-disposition="dock"] .cote .pied .fabrique, [data-disposition="dock"] .cote .pied div { display: none; }
  [data-disposition="dock"] .nav-liste { display: flex; gap: 2px; }
  [data-disposition="dock"] .nav-lien { flex-direction: column; gap: 3px; padding: 7px 8px; min-width: 66px; font-size: .66rem; text-align: center; line-height: 1.1; position: relative; }
  [data-disposition="dock"] .nav-lien span:not(.pastille) { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  [data-disposition="dock"] .nav-lien.actif { box-shadow: inset 0 -3px 0 var(--accent); }
  [data-disposition="dock"] .nav-lien .pastille { position: absolute; top: 0; right: 4px; margin: 0; }
  [data-disposition="dock"] .cote .pied { margin: 0 0 0 6px; padding: 0 0 0 8px; border-top: 0; border-left: 1px solid var(--bord); }
  [data-disposition="dock"] .cote .pied .btn { margin-top: 0 !important; white-space: nowrap; }
  [data-disposition="dock"] .toast { bottom: 110px; }
}

/* Téléphone : la barre du bas flotte en pilule pour les modèles 4 et 5. */
@media (max-width: 760px) {
  [data-modele="4"] .nav-bas, [data-modele="5"] .nav-bas { left: 10px; right: 10px; bottom: 10px; border: 1px solid var(--bord); border-radius: 22px; padding-bottom: 6px; box-shadow: 0 12px 34px rgba(0, 0, 0, .35); }
  [data-modele="4"] .contenu, [data-modele="5"] .contenu { padding-bottom: 110px; }
  [data-modele="3"] .nav-bas { border-top: 2px solid var(--accent); }
}
[data-theme="clair"][data-disposition="dock"] .cote { background: rgba(255, 255, 255, .92); }

/* ---------- Rendez-vous ---------- */
.courriel-corps { white-space: pre-wrap; font: inherit; font-size: .92rem; background: var(--panneau-2); border: 1px solid var(--bord); border-radius: 10px; padding: 12px; margin: 0; overflow-wrap: anywhere; }
.rv-page { max-width: 760px; margin: 0 auto; padding: 22px 16px 60px; }
.rv-entete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.rv-entete .logo { height: 64px; }
.rv-etapes { display: flex; gap: 6px; margin: 0 0 16px; }
.rv-etapes span { flex: 1; height: 5px; border-radius: 99px; background: var(--bord); }
.rv-etapes span.fait { background: var(--accent); }
.rv-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.rv-choix.petits { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.rv-bouton { text-align: left; padding: 14px; border-radius: var(--rayon); border: 1px solid var(--bord); background: var(--panneau-2); color: var(--texte); cursor: pointer; font-weight: 650; min-height: 52px; }
.rv-bouton:hover, .rv-bouton.actif { border-color: var(--accent); box-shadow: var(--lueur); }
.rv-bouton small { display: block; color: var(--texte-2); font-weight: 550; margin-top: 3px; }
.rv-choix.petits .rv-bouton { text-align: center; padding: 12px 6px; }
.rv-recap { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; }
.rv-recap dt { color: var(--texte-2); } .rv-recap dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.rv-ok { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-doux); color: var(--accent-fort); margin-bottom: 10px; }
.rv-ok svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
