/* ========================================================================= charte graphique Edgard AI
   Polices Inter et Inter Display embarquées (static/polices, licence SIL OFL 1.1) : l'application reste lisible sans Internet. */
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("polices/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: italic; font-display: swap; src: url("polices/inter-400-italique.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("polices/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("polices/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700 900; font-style: normal; font-display: swap; src: url("polices/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Inter Display"; font-weight: 600 700; font-style: normal; font-display: swap; src: url("polices/inter-display-700.woff2") format("woff2"); }
@font-face { font-family: "Inter Display"; font-weight: 800 900; font-style: normal; font-display: swap; src: url("polices/inter-display-800.woff2") format("woff2"); }

/* Charte par défaut : Edgard AI (bleu nuit, safran). Chaque utilisateur peut choisir un autre thème dans Mon compte ›
   Apparence (attribut data-theme de la page, ou couleurs personnalisées). */
:root {
  --navy: #12264A; --navy-2: #2B4C7E; --clair: #E3EAF4; --fond: #F3F6FA; --carte: #fff;
  --accent: #F2A516; --sur-accent: #12264A;
  --texte: #1B2433; --doux: #5A6B85; --bord: #DDE6F3; --vert: #15803d; --rouge: #b91c1c; --ambre: #b45309;
  --rayon: 10px;
  --police: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --police-titres: "Inter Display", "Inter", "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="pilot360"] { --navy: #1f3a5f; --navy-2: #2c5282; --clair: #dce6f1; --fond: #f4f6f9; --accent: #4a90d9; --sur-accent: #fff; --bord: #e2e8f0; --doux: #64748b; }
:root[data-theme="emeraude"] { --navy: #0F3D3E; --navy-2: #1E6B5C; --clair: #DDEFEA; --fond: #F2F7F5; --accent: #E0B23A; --sur-accent: #0F3D3E; --bord: #D6E6E0; }
:root[data-theme="bordeaux"] { --navy: #4A1426; --navy-2: #7A2B44; --clair: #F2E3E8; --fond: #FAF5F6; --accent: #D4A017; --sur-accent: #4A1426; --bord: #EBDCE1; }
:root[data-theme="ardoise"] { --navy: #1E293B; --navy-2: #334E68; --clair: #E2E8F0; --fond: #F5F7FA; --accent: #38BDF8; --sur-accent: #0B1A2E; --bord: #E2E8F0; }
:root[data-theme="terre"] { --navy: #3B2A1A; --navy-2: #6B4A2B; --clair: #F1E7DC; --fond: #FAF6F1; --accent: #E07A2F; --sur-accent: #fff; --bord: #EADFD3; }
:root[data-theme="contraste"] { --navy: #000; --navy-2: #1d1d1d; --clair: #E6E6E6; --fond: #fff; --accent: #FFD400; --sur-accent: #000; --texte: #000; --doux: #333; --bord: #999; }
:root[data-taille="grand"] body { font-size: 15.5px; }
:root[data-taille="petit"] body { font-size: 13px; }
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--police);
  background: var(--fond); color: var(--texte); font-size: 14px; }
a { color: var(--navy-2); }

/* barre du haut */
.barre { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 18px;
  padding: 0 24px; height: 58px; position: sticky; top: 0; z-index: 5; }
.logo { font-weight: 700; font-size: 18px; letter-spacing: .1px; display: flex; align-items: center; gap: 10px; }
.logo .pastille { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--sur-accent);
  display: grid; place-items: center; font: 800 18px var(--police-titres); flex-shrink: 0; }
.logo .marque-p { display: flex; flex-direction: column; line-height: 1.05; }
.logo .marque-p b { font: 800 18px var(--police-titres); letter-spacing: -.2px; }
.logo .marque-p i { font-style: normal; font-weight: 500; font-size: 11px; opacity: .75; letter-spacing: .2px; }
.logo small { font-weight: 400; opacity: .7; font-size: 12px; }
h1, h2, h3, .entete-apercu h3 { font-family: var(--police-titres); }
.carte h2 { font-family: var(--police); }
.barre .espace { flex: 1; }
.statut { font-size: 12.5px; display: flex; align-items: center; gap: 7px; opacity: .95; }
.point { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.point.ok { background: #4ade80; } .point.ko { background: #f87171; } .point.demo { background: #fbbf24; }
.barre a.bouton-lien { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.35);
  padding: 7px 14px; border-radius: 7px; font-size: 13px; }
.barre a.bouton-lien:hover { background: rgba(255,255,255,.12); }

.page { display: grid; grid-template-columns: 300px 1fr; gap: 20px; padding: 20px 24px; max-width: 1600px; margin: 0 auto; }
@media (max-width: 900px) { .page { grid-template-columns: 1fr; padding: 14px; } }

.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px; }
.carte h2 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--doux); }

/* liste des états */
.etats { display: flex; flex-direction: column; gap: 8px; }
.etat { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--bord);
  border-radius: 9px; cursor: pointer; transition: .12s; }
.etat:hover { border-color: var(--navy-2); }
.etat input { display: none; }
.etat .ico { width: 34px; height: 34px; border-radius: 8px; background: var(--fond); color: var(--navy);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.etat b { display: block; font-size: 14px; }
.etat span { font-size: 12px; color: var(--doux); }
.etat.actif { border-color: var(--navy); background: #f0f5fb; box-shadow: inset 3px 0 0 var(--navy); }
.etat.actif .ico { background: var(--navy); color: #fff; }

/* formulaire */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
label.champ { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--doux); font-weight: 600; }
input[type=text], input[type=date], input[type=number], input[type=password], select {
  font: inherit; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: var(--texte); }
input:focus, select:focus { outline: 2px solid #93c5fd; border-color: var(--navy-2); }
.raccourcis { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 2px; }
.puce { border: 1px solid var(--bord); background: var(--fond); border-radius: 20px; padding: 4px 11px;
  font-size: 12px; cursor: pointer; color: var(--texte); }
.puce:hover { border-color: var(--navy-2); color: var(--navy-2); }
.options { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; }
.options label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.cache { display: none !important; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bord); }
button { font: inherit; cursor: pointer; border-radius: 8px; padding: 9px 16px; border: 1px solid transparent; font-weight: 600; }
button:disabled { opacity: .55; cursor: wait; }
.b-prim { background: var(--navy); color: #fff; }
.b-prim:hover { background: var(--navy-2); }
.b-sec { background: #fff; border-color: #cbd5e1; color: var(--texte); display: inline-flex; gap: 8px; align-items: center; }
.b-sec:hover { border-color: var(--navy-2); }
.tag { font-size: 10.5px; font-weight: 800; padding: 2px 6px; border-radius: 4px; color: #fff; }
.tag.xlsx { background: #15803d; } .tag.csv { background: #475569; } .tag.pdf { background: #b91c1c; } .tag.docx { background: #1d4ed8; }

.message { margin-top: 14px; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.message.err { background: #fef2f2; color: var(--rouge); border: 1px solid #fecaca; }
.message.ok { background: #f0fdf4; color: var(--vert); border: 1px solid #bbf7d0; }
.message.info { background: #fffbeb; color: var(--ambre); border: 1px solid #fde68a; }

/* aperçu */
.entete-apercu { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.entete-apercu h3 { margin: 0; font-size: 18px; color: var(--navy); }
.entete-apercu p { margin: 3px 0 0; color: var(--doux); font-size: 12.5px; }
.chiffres { display: flex; gap: 8px; flex-wrap: wrap; }
.chiffre { background: var(--fond); border-radius: 7px; padding: 6px 10px; font-size: 12px; color: var(--doux); }
.chiffre b { color: var(--texte); }
.zone-table { overflow: auto; max-height: calc(100vh - 330px); min-height: 200px; border: 1px solid var(--bord); border-radius: 8px; }
table.rapport { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
table.rapport th { position: sticky; top: 0; background: var(--navy); color: #fff; font-weight: 600; padding: 8px 10px;
  text-align: center; white-space: pre-line; font-size: 12px; }
table.rapport td { padding: 5px 10px; border-bottom: 1px solid #eef2f6; white-space: nowrap; }
table.rapport td.n { text-align: right; }
table.rapport td.lib { white-space: normal; min-width: 180px; }
tr.groupe td, tr.groupe_principal td { font-weight: 700; color: var(--navy); padding-top: 10px; }
tr.groupe_principal td { background: var(--clair); }
tr.report td { font-style: italic; background: #f8fafc; }
tr.sous_total td { font-weight: 700; background: var(--clair); border-top: 1px solid var(--navy); }
tr.total td { font-weight: 700; background: var(--navy); color: #fff; }
tr.pourcentage td { font-style: italic; background: #f1f5f9; }
.vide { padding: 60px 20px; text-align: center; color: var(--doux); }
.vide b { display: block; font-size: 15px; color: var(--texte); margin-bottom: 6px; }
.controle { margin-top: 10px; font-size: 12px; color: var(--doux); font-style: italic; }

.pied { text-align: center; font-size: 11.5px; color: var(--doux); padding: 10px 24px 24px; line-height: 1.6; }

/* paramètres */
.param { max-width: 1100px; margin: 0 auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.param .grille { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.mapping { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
@media (max-width: 700px) { .mapping { grid-template-columns: 1fr; } }
.mapping label { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 10px; font-size: 13px; }
.mapping label em { color: var(--rouge); font-style: normal; }
.aide { font-size: 12.5px; color: var(--doux); margin: -4px 0 12px; line-height: 1.5; }
.rangee { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.rangee .champ { flex: 1; min-width: 220px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: t .7s linear infinite; vertical-align: -2px; }
.b-sec .spin { border-color: #cbd5e1; border-top-color: var(--navy); }
@keyframes t { to { transform: rotate(360deg); } }

/* logo client */
.logo-client { background: #fff; border-radius: 8px; height: 42px; padding: 4px 10px; display: flex; align-items: center;
  margin-right: 4px; }
.logo-client img { max-height: 34px; max-width: 170px; object-fit: contain; display: block; }
.bloc-logo { display: flex; gap: 18px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bord); flex-wrap: wrap; }
.apercu-logo { width: 180px; height: 80px; border: 1px dashed #cbd5e1; border-radius: 8px; display: grid; place-items: center;
  background: #fff; padding: 8px; }
.apercu-logo img { max-width: 100%; max-height: 64px; object-fit: contain; }
.apercu-logo span { font-size: 12px; color: var(--doux); }
.pied b { color: var(--texte); }

/* menu utilisateur */
.menu { display: flex; align-items: center; gap: 10px; }
.compte { position: relative; }
.compte summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px;
  border-radius: 22px; }
.compte summary::-webkit-details-marker { display: none; }
.compte summary:hover { background: rgba(255,255,255,.12); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--navy); display: grid; place-items: center; font-weight: 800; }
.qui { display: flex; flex-direction: column; font-size: 13px; line-height: 1.2; }
.qui small { opacity: .7; font-size: 11px; }
.deroulant { position: absolute; right: 0; top: 46px; background: #fff; border: 1px solid var(--bord); border-radius: 9px;
  box-shadow: 0 10px 30px rgba(15,23,42,.15); min-width: 220px; padding: 6px; z-index: 20; }
.deroulant a { display: block; padding: 9px 12px; color: var(--texte); text-decoration: none; border-radius: 6px; font-size: 13px; }
.deroulant a:hover { background: var(--fond); }
@media (max-width: 760px) { .qui, .statut { display: none; } }

/* connexion */
.page-login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, var(--fond) 55.1%); padding: 16px; }
.boite-login { background: #fff; border-radius: 14px; padding: 32px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 50px rgba(15,23,42,.25); display: flex; flex-direction: column; gap: 22px; }
.boite-login form { display: flex; flex-direction: column; gap: 14px; }
.boite-login .message { margin: 0; }
.boite-login button { padding: 11px; margin-top: 4px; }
.logo-login { display: flex; justify-content: center; }
.logo-login img { max-height: 70px; max-width: 240px; object-fit: contain; }
.titre-login { display: flex; gap: 12px; align-items: center; }
.titre-login .pastille { width: 46px; height: 46px; flex-shrink: 0; border-radius: 10px; background: var(--accent); color: var(--sur-accent); display: grid; place-items: center; font: 800 25px var(--police-titres); }
.titre-login b { display: block; font: 800 21px var(--police-titres); color: var(--navy); }
.titre-login span { font-size: 12.5px; color: var(--doux); }
.page-login .pied { padding-top: 18px; }

/* comptes */
.badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 10px; background: #e2e8f0; color: #334155; font-weight: 600; }
.badge.ok { background: #dcfce7; color: var(--vert); } .badge.ko { background: #fee2e2; color: var(--rouge); }
table.comptes td { padding: 8px 10px; vertical-align: middle; }
table.comptes select { padding: 5px 8px; font-size: 12.5px; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.b-mini { font-size: 12px; padding: 5px 10px; border-radius: 6px; background: #fff; border: 1px solid #cbd5e1; font-weight: 600; }
.b-mini:hover { border-color: var(--navy-2); }
.b-mini.danger { color: var(--rouge); border-color: #fecaca; }

/* droits, onglets, pagination, modale */
.droits { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.groupe-droits b { font-size: 12.5px; color: var(--doux); display: block; margin-bottom: 6px; }
.cases { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.cases label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
tr.ligne-droits td { background: #f8fafc; padding: 14px 16px; white-space: normal; }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bord); margin: -4px 0 16px; flex-wrap: wrap; }
.onglet { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 9px 14px;
  color: var(--doux); font-weight: 600; }
.onglet:hover { color: var(--navy-2); }
.onglet.actif { color: var(--navy); border-bottom-color: var(--navy); }
.pager { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; font-size: 13px; }
.pager .espace { flex: 1; }
.pager select { padding: 4px 6px; margin-left: 6px; }
.b-mini:disabled { opacity: .4; cursor: default; }
table.rapport a { color: var(--navy-2); text-decoration: none; font-weight: 600; }
table.rapport a:hover { text-decoration: underline; }
a.etat.lien { text-decoration: none; color: inherit; }
.voile { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modale { background: #fff; border-radius: 12px; padding: 20px; width: min(1100px, 100%); max-height: 90vh; overflow: auto;
  box-shadow: 0 25px 60px rgba(15,23,42,.35); }

/* type de tiers */
.type-tiers { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.lib-type { font-size: 12.5px; color: var(--doux); font-weight: 600; }
.segments { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.segments label { cursor: pointer; }
.segments input { display: none; }
.segments span { display: block; padding: 7px 16px; font-size: 13px; font-weight: 600; color: var(--texte); border-right: 1px solid #e2e8f0; }
.segments label:last-child span { border-right: 0; }
.segments input:checked + span { background: var(--navy); color: #fff; }
.opt-agee select { padding: 4px 6px; font-size: 12.5px; }

/* critère obligatoire manquant */
input.manquant, select.manquant { border-color: var(--rouge) !important; background: #fff5f5; outline: 2px solid #fecaca; }

mark { background: #fde68a; color: inherit; padding: 0 1px; border-radius: 2px; }

/* Pilot360 v2 : personnalisations */
.nb-alerte { background: #f59e0b; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; font-weight: 700; margin-left: 4px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--bord); background: var(--fond); color: var(--doux); white-space: nowrap; }
.badge.valide { background: #ecfdf3; color: #166534; border-color: #bbf7d0; }
.badge.recette { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.badge.brouillon { background: #fff7e6; color: #92400e; border-color: #f5c46b; }
.badge.ko { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.choix-dossier { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 7px; padding: 6px 10px; font-weight: 600; max-width: 260px; }
.choix-dossier option { color: var(--texte); }
.nom-dossier { font-size: 13px; opacity: .85; font-weight: 600; padding: 0 6px; }
/* accès mobile */
.mobile-etat { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--bord); border-radius: 9px; background: var(--fond); margin-bottom: 14px; font-size: 13px; }
.mobile-etat small { flex-basis: 100%; color: var(--doux); }
.mobile-etat .point { background: #94a3b8; } .mobile-etat .point.ok { background: #16a34a; } .mobile-etat .point.ko { background: #dc2626; } .mobile-etat .point.demo { background: #f59e0b; }
.m-activation { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; }
@media (max-width: 900px) { .m-activation { grid-template-columns: 1fr; } }
.m-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border: 1px solid var(--bord); border-radius: 10px; width: 220px; text-align: center; }
.m-qr img { width: 180px; height: 180px; } .m-qr a { font-size: 12px; word-break: break-all; } .m-qr small { color: var(--doux); font-size: 11.5px; }
ul.diag { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13px; border: 1px solid var(--bord); border-radius: 9px; overflow: hidden; }
ul.diag li { display: flex; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--bord); } ul.diag li:last-child { border-bottom: 0; }
ul.diag li b { min-width: 280px; } ul.diag li.ok b { color: var(--vert); } ul.diag li.ko b { color: var(--rouge); } ul.diag li span { color: var(--doux); }
.b-mini.danger { color: var(--rouge); }

/* Paramètres : onglets généraux / par gamme Sage */
.onglets-param { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.onglets-param a { display: block; padding: 10px 14px; border: 1px solid var(--bord); border-radius: 10px; background: #fff;
  color: var(--texte, #1e293b); text-decoration: none; min-width: 0; }
.onglets-param a b { display: block; font-size: 14px; color: var(--navy); }
.onglets-param a small { display: block; font-size: 11.5px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onglets-param a:hover { border-color: var(--navy); }
.onglets-param a.actif { background: var(--navy); border-color: var(--navy); }
.onglets-param a.actif b, .onglets-param a.actif small { color: #fff; }
.onglets-param .pastille-g { color: #16a34a; font-size: 11px; vertical-align: middle; }
.onglets-param a.actif .pastille-g { color: #86efac; }
.bandeau-gamme { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.bandeau-gamme .sigle { width: 46px; height: 46px; border-radius: 10px; background: var(--navy); color: #fff; display: grid;
  place-items: center; font-weight: 700; font-size: 13px; flex: none; }
table.modules-g td { vertical-align: top; white-space: normal; }
table.modules-g td small { display: block; color: var(--doux); font-size: 11.5px; margin-top: 2px; }
table.modules-g .etat-vue { font-size: 12px; display: block; }
table.modules-g .etat-vue.ok { color: var(--vert); }
table.modules-g .etat-vue.ko { color: var(--rouge); }
.cx-module { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.cx-module input, .cx-module select { width: 100%; }
table.modules-g { table-layout: fixed; width: 100%; }
table.modules-g .vues-m .etat-vue { overflow-wrap: anywhere; }
table.modules-g .scripts-m { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
table.modules-g .scripts-m a { font-size: 12px; overflow-wrap: anywhere; }

/* Navigation latérale compacte : recherche, favoris, groupes repliables, défilement propre */
.page > aside.carte { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto;
  padding: 14px 12px; scrollbar-width: thin; }
.nav-p360 { display: flex; flex-direction: column; gap: 6px; }
.nav-recherche input { width: 100%; padding: 8px 10px; border: 1px solid var(--bord); border-radius: 8px; font: inherit; font-size: 13px; background: var(--fond); }
.nav-recherche input:focus { outline: none; border-color: var(--navy-2); background: #fff; }
.nav-recherche { position: sticky; top: -14px; background: var(--carte); padding: 0 0 6px; z-index: 2; }
.nav-titre { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 4px 6px; border: 0; background: none;
  cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
.nav-titre span::before { content: '▾'; display: inline-block; width: 14px; transition: transform .15s; }
.nav-groupe.replie:not(.force-ouvert) .nav-titre span::before { transform: rotate(-90deg); }
.nav-groupe.replie:not(.force-ouvert) .nav-liste { display: none; }
.nav-groupe.filtre-vide { display: none; }
.nav-titre .nb { background: var(--fond); color: var(--navy); border-radius: 10px; padding: 1px 7px; font-size: 11px; letter-spacing: 0; }
.nav-titre:hover { color: var(--navy); }
.nav-liste { gap: 3px; }
.nav-sous { font-size: 11px; font-weight: 600; color: var(--doux); margin: 6px 0 0 6px; }
.nav-p360 .etat { position: relative; gap: 9px; align-items: center; padding: 6px 30px 6px 8px; border-radius: 8px; border-color: transparent; }
.nav-p360 .etat:hover { border-color: var(--bord); background: var(--fond); }
.nav-p360 .etat .ico { width: 28px; height: 28px; font-size: 10.5px; border-radius: 7px; flex: none; }
.nav-p360 .etat .txt { min-width: 0; }
.nav-p360 .etat b { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.nav-p360 .etat span { display: block; font-size: 11.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-p360 .etat.actif { border-color: var(--navy); }
.nav-etoile { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer;
  font-size: 15px; color: #cbd5e1; opacity: 0; padding: 2px 4px; }
.nav-p360 .etat:hover .nav-etoile, .nav-etoile.on, .nav-etoile:focus { opacity: 1; }
.nav-etoile.on { color: #f59e0b; }
.nav-vide { font-size: 12.5px; color: var(--doux); padding: 8px 4px; }
@media (max-width: 900px) { .page > aside.carte { position: static; max-height: none; } .nav-etoile { opacity: 1; } }

/* états analytiques détaillés : lignes de ventilation et alertes */
tr.ventilation td { font-style: italic; color: var(--navy-2); font-size: 12.5px; }
tr.ventilation td:nth-child(4), tr.ventilation td:first-child { padding-left: 22px; }
tr.alerte td { color: var(--rouge); font-weight: 600; background: #fef2f2; }
.barre a.bouton-lien.actif { background: #fff; color: var(--navy); border-color: #fff; font-weight: 700; }

/* modules métier (recouvrement, rapprochement) : onglets internes et tuiles */
.onglets-mod { display: flex; gap: 4px; border-bottom: 2px solid var(--bord); margin-bottom: 4px; flex-wrap: wrap; }
.onglets-mod a { padding: 9px 16px; text-decoration: none; color: var(--doux); font-weight: 600; font-size: 14px;
  border-bottom: 3px solid transparent; margin-bottom: -2px; }
.onglets-mod a.actif { color: var(--navy); border-bottom-color: var(--navy); }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tuiles div { border: 1px solid var(--bord); border-radius: 10px; padding: 12px 14px; background: #fff; }
.tuiles b { display: block; font-size: 21px; color: var(--navy); }
.tuiles span { font-size: 12px; color: var(--doux); }
.tuiles .rouge b { color: var(--rouge); }
.barre-tranches { display: flex; height: 26px; border-radius: 6px; overflow: hidden; margin: 8px 0 4px; }
.barre-tranches div { display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.legende-tranches { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--doux); }
.legende-tranches i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.pastille-statut { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: var(--fond); color: var(--doux); }
.pastille-statut.surveille { background: #fffbeb; color: var(--ambre); }
.pastille-statut.litige, .pastille-statut.contentieux { background: #fef2f2; color: var(--rouge); }
.pastille-statut.bloque { background: #f1f5f9; color: #475569; }
.panneau { position: fixed; top: 0; right: 0; bottom: 0; width: min(980px, 100%); background: var(--fond); box-shadow: -8px 0 30px rgba(15,23,42,.25);
  z-index: 50; overflow-y: auto; padding: 18px 22px; }
.panneau .fermer { position: sticky; top: 0; float: right; }
.voile-panneau { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 49; }
#msg:empty { display: none; }
/* barre du haut : rien ne passe à la ligne, le superflu s'efface sur les écrans étroits */
.barre a.bouton-lien, .barre .menu, .barre .nom-dossier { white-space: nowrap; }
.barre .logo { white-space: nowrap; flex-shrink: 0; }
.barre .statut { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
@media (max-width: 1600px) { .barre .plus-large { display: none; } .barre .logo small { display: none; } }
@media (max-width: 1400px) { .barre .statut span:not(.point) { display: none; } }
@media (max-width: 1500px) { .barre .compte .qui { display: none; } .barre .choix-dossier { max-width: 210px; } .barre { gap: 12px; } }
@media (max-width: 1280px) { .barre .choix-dossier { max-width: 150px; } .barre .bouton-lien { padding-left: 10px; padding-right: 10px; } }

/* ===================================================================== navigation v2.6 : menus déroulants par métier */
.barre { flex-wrap: wrap; height: auto; min-height: 58px; row-gap: 0; }
.barre > .logo, .barre > .logo-client, .barre > .espace, .barre > .statut { min-height: 58px; }
.barre .menu { display: contents; }
.barre .choix-dossier, .barre .nom-dossier, .barre .compte, .barre .m-tiroir { align-self: center; }
.m-barre { order: 99; flex-basis: calc(100% + 48px); margin: 0 -24px; padding: 0 18px; display: flex; gap: 2px; align-items: stretch;
  background: var(--navy-2); min-height: 42px; position: relative; }
.m-item { position: relative; display: flex; }
.m-titre { background: none; border: 0; color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; padding: 0 14px; cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap; opacity: .92; }
.m-titre::after { content: "▾"; font-size: 10px; margin-left: 6px; opacity: .7; }
.m-aide .m-titre::after { content: ""; margin: 0; }
.m-aide { margin-left: auto; }
.m-aide .m-titre { font-size: 15px; font-weight: 800; padding: 0 16px; }
.m-item:hover .m-titre, .m-item.ouvert .m-titre { background: rgba(255,255,255,.12); opacity: 1; }
.m-item.actif .m-titre { border-bottom-color: var(--accent); opacity: 1; }
.m-panneau { display: none; position: absolute; top: 100%; left: 0; background: #fff; color: var(--texte); border: 1px solid var(--bord);
  border-radius: 0 0 12px 12px; box-shadow: 0 18px 40px rgba(15,23,42,.22); padding: 12px 14px 14px; z-index: 40; min-width: 330px;
  max-height: calc(100vh - 120px); overflow-y: auto; }
.m-panneau.m-droite { left: auto; right: 0; }
.m-item.ouvert .m-panneau { display: block; }
/* le panneau d'un menu ne s'affiche qu'ouvert, quelles que soient les classes de mise en page des écrans */
.m-item:not(.ouvert) > .m-panneau { display: none !important; }
.m-panneau.m-large { width: min(1080px, calc(100vw - 40px)); }
.m-panneau .m-desc { margin: 0 0 10px; padding: 0 4px 9px; border-bottom: 1px solid var(--bord); font-style: italic; color: var(--doux); font-size: 12.5px; }
/* groupes répartis en colonnes équilibrées (côté serveur) : chaque groupe se place juste sous le précédent, sans trou */
.m-groupes { display: grid; grid-template-columns: repeat(var(--m-cols, 1), minmax(0, 1fr)); gap: 0 18px; align-items: start; }
.m-colonne { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.m-panneau.m-c3 { width: min(840px, calc(100vw - 40px)); }
.m-gtitre { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--navy-2); font-weight: 700; padding: 4px 8px 4px; }
.m-lien { display: block; padding: 7px 8px; border-radius: 7px; text-decoration: none; color: var(--texte); }
.m-lien b { display: block; font-size: 13px; font-weight: 600; }
.m-lien i { display: block; font-size: 11.8px; color: var(--doux); margin-top: 1px; line-height: 1.35; }
.m-lien:hover, .m-lien:focus { background: var(--fond); outline: none; }
.m-lien:hover b { color: var(--navy-2); }
.m-tiroir { display: none; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 7px;
  padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
@media (max-width: 1100px) {
  .m-tiroir { display: inline-block; }
  .m-barre { display: none; }
  nav.tiroir-ouvert .m-barre { display: block; position: absolute; left: 0; right: 0; top: 100%; margin: 0; padding: 6px 10px 12px;
    max-height: calc(100vh - 58px); overflow-y: auto; box-shadow: 0 18px 40px rgba(15,23,42,.3); z-index: 45; }
  nav.tiroir-ouvert .m-item { display: block; border-bottom: 1px solid rgba(255,255,255,.15); }
  nav.tiroir-ouvert .m-titre { width: 100%; text-align: left; padding: 12px 8px; font-size: 14.5px; border-bottom: 0; }
  nav.tiroir-ouvert .m-aide { margin-left: 0; }
  nav.tiroir-ouvert .m-groupes { display: flex; flex-direction: column; gap: 10px; }
  nav.tiroir-ouvert .m-colonne { display: contents; }   /* téléphone : groupes dans l'ordre d'origine */
  nav.tiroir-ouvert .m-panneau { position: static; width: auto; min-width: 0; box-shadow: none; border-radius: 9px; margin-bottom: 8px; max-height: none; }
  .barre { position: relative; }
}
.barre { position: sticky; }

/* ===================================================================== aides en italique */
.aide { font-style: italic; }
.aide-bandeau { display: flex; align-items: flex-start; gap: 14px; background: #eef4fb; border-bottom: 1px solid #d5e2f2; padding: 9px 24px;
  color: #34506f; font-size: 13px; line-height: 1.45; }
.aide-bandeau .ab-txt { flex: 1; max-width: 1500px; }
.aide-bandeau b { font-style: normal; color: var(--navy); margin-right: 8px; }
.aide-bandeau i { font-style: italic; }
.aide-bandeau .ab-onglet:not(:empty) { display: block; margin-top: 2px; color: var(--navy-2); }
.aide-bandeau .ab-onglet:not(:empty)::before { content: "› "; font-style: normal; }
.ab-fermer { background: none; border: 0; color: var(--doux); cursor: pointer; font: inherit; font-size: 12px; white-space: nowrap; padding: 2px 4px; }
.ab-fermer:hover { color: var(--navy); text-decoration: underline; }
i.aide-champ { display: block; font-style: italic; font-weight: 400; font-size: 11.8px; color: var(--doux); margin-top: 3px; line-height: 1.35;
  text-transform: none; letter-spacing: 0; }
body.sans-aides .aide-bandeau, body.sans-aides i.aide-champ, body.sans-aides .aide-onglet { display: none !important; }
@media print { .aide-bandeau, i.aide-champ, .m-barre, .m-tiroir { display: none !important; } }
.m-panneau.m-deux { width: min(600px, calc(100vw - 40px)); }
.nav-liste .txt span { font-style: italic; }
.m-panneau, .m-panneau * { white-space: normal; }
.m-lien { overflow-wrap: anywhere; }
html { scroll-padding-top: 150px; }
a.b-prim, a.b-sec, label.b-sec, label.b-prim { display: inline-flex; align-items: center; gap: 8px; border-radius: 8px; padding: 9px 16px;
  border: 1px solid transparent; font-weight: 600; text-decoration: none; font-size: 14px; }
a.b-sec, label.b-sec { border-color: #cbd5e1; }
a.b-prim { color: #fff; }
a.b-mini { display: inline-block; text-decoration: none; color: var(--texte); }

/* ---------------------------------------------------------------- v2.9 : fluidité */
#p360-progression { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 9999; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, #1d6fd8, #22a06b); transition: width .25s ease, opacity .2s ease; }
#p360-progression.actif { opacity: 1; width: 82%; transition: width 6s cubic-bezier(.1, .7, .2, 1), opacity .1s; }
#p360-progression.actif.page { width: 92%; transition: width 2s cubic-bezier(.1, .7, .2, 1); }
.m-actualiser { background: transparent; border: 1px solid rgba(255,255,255,.35); color: inherit; border-radius: 6px; width: 32px; height: 30px;
  font-size: 17px; line-height: 1; cursor: pointer; margin-left: 6px; flex: none; }
.m-actualiser:hover { background: rgba(255,255,255,.12); }
.m-actualiser.tourne { animation: p360-tourne .8s linear infinite; }
@keyframes p360-tourne { to { transform: rotate(360deg); } }
.barre .m-actualiser { align-self: center; }

/* ---------------------------------------------------------------- v2.9 : signature de la solution */
.devise { font-style: italic; font-weight: 700; color: var(--navy); font-size: 15px; margin: 0; }
.copilote { font-size: 12.5px; color: var(--texte); margin: 4px 0 0; }
.domaines { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 0; }
.domaines span { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #eef3fb; color: var(--navy); border: 1px solid #d9e3f3; white-space: nowrap; }
.devise-login { border-top: 1px solid var(--bord); border-bottom: 1px solid var(--bord); padding: 12px 0; margin: 4px 0 2px; text-align: center; }
.devise-login .domaines { justify-content: center; }
.devise-login .devise { font-size: 14.5px; }
.pied-devise { display: block; font-style: italic; font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.bandeau-marque { background: linear-gradient(120deg, #fff 55%, #eef3fb); }
.bandeau-marque .bm-titre { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.bandeau-marque .bm-titre .pastille { width: 42px; height: 42px; border-radius: 10px; background: var(--accent); color: var(--sur-accent); display: grid; place-items: center; font: 800 23px var(--police-titres); }
.bandeau-marque .bm-titre b { display: block; font-size: 18px; color: var(--navy); }
.bandeau-marque .bm-titre span { font-size: 12px; color: var(--doux); }
.bandeau-marque .devise { font-size: 17px; }
.m-devise { font-weight: 600; }
.page-login .boite-login { max-width: 470px; }
.page-login .pied-devise { display: none; }

/* page d'accueil (connexion) : présentation d'Edgard AI */
.accueil-login { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 470px); gap: 28px; width: 100%; max-width: 1080px; align-items: center; }
.edgard-login { background: linear-gradient(155deg, var(--navy) 0%, var(--navy) 60%, var(--navy-2) 100%); color: #fff; border-radius: 16px;
  padding: 30px 32px; box-shadow: 0 20px 50px rgba(15,23,42,.25); display: flex; flex-direction: column; gap: 14px; }
.ea-tete { display: flex; align-items: center; gap: 14px; }
.ea-avatar { width: 64px; height: 64px; flex: none; }
.ea-nom { font-weight: 800; font-size: 18px; letter-spacing: .2px; }
.ea-nom span { font-weight: 600; color: #b9cbe0; font-size: 14px; }
.ea-statut { font-size: 12.5px; font-weight: 700; color: #7fe0ae; margin-top: 2px; }
.edgard-login h1 { font-size: 25px; line-height: 1.25; margin: 4px 0 0; color: #fff; }
.edgard-login h1 sup { font-size: .6em; }
.ea-intro { margin: 0; color: #DCE4F0; font-size: 14.5px; line-height: 1.5; }
.ea-points { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ea-points li { position: relative; padding-left: 24px; font-size: 14px; line-height: 1.4; color: #eef3fb; }
.ea-points li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(242,165,22,.25); }
.ea-donnees { display: flex; gap: 12px; align-items: flex-start; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.45; color: #eef3fb; }
.ea-donnees svg { width: 26px; height: 26px; flex: none; color: var(--accent); margin-top: 1px; }
.ea-donnees b { color: #fff; }
.ea-slogan { margin: 2px 0 0; font-style: italic; font-weight: 700; color: #f2b33d; font-size: 15px; }
@media (max-width: 900px) {
  .accueil-login { grid-template-columns: minmax(0, 1fr); max-width: 520px; gap: 18px; }
  .accueil-login .boite-login { order: -1; }
  .edgard-login { padding: 22px 20px; }
  .edgard-login h1 { font-size: 21px; }
}



/* ========================================================================= Mon compte › Apparence */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme-c { border: 2px solid var(--bord); border-radius: 12px; padding: 10px; cursor: pointer; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.theme-c input { display: none; }
.theme-c.actif { border-color: var(--navy); box-shadow: 0 0 0 3px var(--clair); }
.theme-c .ap { height: 46px; border-radius: 8px; display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.theme-c .ap i { width: 20px; height: 20px; border-radius: 6px; display: block; }
.theme-c .ap span { height: 6px; flex: 1; border-radius: 3px; background: rgba(255,255,255,.45); }
.theme-c b { font-size: 13px; } .theme-c small { font-size: 11.5px; color: var(--doux); }
.couleurs-perso { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.couleurs-perso input[type=color] { width: 46px; height: 32px; border: 1px solid var(--bord); border-radius: 6px; padding: 2px; background: #fff; }

/* extrait d'un texte officiel cité par Edgard */
.ass-officiel { margin: 6px 0 10px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--fond);
  border-radius: 6px; font-size: .93em; line-height: 1.45; white-space: normal; }

.ass-avis { display: flex; gap: 6px; margin: 4px 0 8px; }
.ass-avis input { flex: 1; padding: 5px 8px; border: 1px solid var(--clair, #ccd); border-radius: 6px; font: inherit; font-size: .9em; }
