/* ====================================================================== interface (refonte 2026-11)
   Chargée en dernier : jetons de couleur sobres, barre latérale, en-têtes de page, chiffres clés,
   accueil, Mon compte et administration en onglets, tableaux de bord d'analyse. */

:root {
  --fond: #f5f6f8;
  --carte: #ffffff;
  --survol: #f1f3f6;
  --encre: #172033;
  --titre: #0f172a;
  --discret: #5f6b7c;
  --trait: #e3e7ed;
  --trait-fort: #cfd6df;
  --accent: #1d6fd8;
  --accent-fonce: #155bb5;
  --accent-clair: #e9f1fd;
  --valide: #13855a;
  --valide-clair: #e6f5ee;
  --ocre: #a5650b;
  --ocre-clair: #fdf3e2;
  --alerte: #c43a2f;
  --alerte-clair: #fdeeec;
  --rayon: 10px;
  --rayon-carte: 14px;
  --ombre: 0 1px 2px rgb(15 23 42 / 4%), 0 2px 8px rgb(15 23 42 / 4%);
  --ombre-haute: 0 8px 28px rgb(15 23 42 / 10%);
  --largeur-barre: 252px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0d131b;
    --carte: #151d28;
    --survol: #1c2633;
    --encre: #e4e9f0;
    --titre: #f1f5f9;
    --discret: #94a2b5;
    --trait: #243041;
    --trait-fort: #334255;
    --accent: #6aa7f8;
    --accent-fonce: #8dbcfb;
    --accent-clair: #182a42;
    --valide: #4cc38a;
    --valide-clair: #14291f;
    --ocre: #e7b25a;
    --ocre-clair: #2c2414;
    --alerte: #f08a7e;
    --alerte-clair: #33201e;
    --ombre: none;
    --ombre-haute: 0 8px 28px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}

body {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Inter", Roboto, "Noto Sans", sans-serif;
  background: var(--fond);
  color: var(--encre);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--titre); }

.ico { width: 18px; height: 18px; flex: none; }
button:has(> .ico), .bouton:has(> .ico) { display: inline-flex; align-items: center; gap: .45rem; }

/* ------------------------------------------------------------ barre latérale (personne connectée) */

@media (min-width: 961px) {
  body.connecte { padding-left: var(--largeur-barre); }
  body.connecte .entete {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--largeur-barre);
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; padding: 1.15rem .85rem 1rem;
    background: var(--carte); border-right: 1px solid var(--trait); border-bottom: 0; box-shadow: none;
    overflow-y: auto; scrollbar-width: thin;
  }
  body.connecte .marque { padding: .15rem .55rem 1.35rem; font-size: 1.12rem; color: var(--titre); }
  body.connecte .onglets {
    display: flex; flex-direction: column; flex-wrap: nowrap; gap: 2px; width: 100%; margin: 0; padding: 0;
    border: 0; overflow: visible; background: none;
  }
  body.connecte .onglets button {
    display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 0; margin: 0;
    padding: .55rem .7rem; border: 0; border-radius: 9px; background: transparent; box-shadow: none;
    color: var(--discret); font-size: .925rem; font-weight: 500; text-align: left; white-space: nowrap;
  }
  body.connecte .onglets button::after { display: none; }
  body.connecte .onglets button:hover { background: var(--survol); color: var(--encre); }
  body.connecte .onglets button.actif { background: var(--accent-clair); color: var(--accent); font-weight: 600; }
  body.connecte .onglets .separateur {
    display: block; width: auto; height: auto; margin: 1.15rem .7rem .35rem; background: none;
    font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--discret);
  }
  body.connecte .onglets .separateur[hidden] { display: none; }
  body.connecte .entete > .identite {
    display: flex; flex-direction: column; align-items: stretch; gap: .55rem; margin-top: auto; padding-top: 1rem;
    border-top: 1px solid var(--trait); order: 0;
  }
  body.connecte #btn-langue { align-self: flex-start; border: 0; padding: .2rem .7rem; font-size: .82rem; }
  body.connecte #identite { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
  body.connecte #identite[hidden] { display: none; }
  body.connecte .moi-carte { display: flex; align-items: center; gap: .65rem; padding: .35rem .55rem .6rem; min-width: 0; }
  body.connecte .moi-texte { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
  body.connecte .moi-texte b { color: var(--titre); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.connecte .moi-texte #moi-role { font-size: .78rem; display: block; }
  body.connecte .moi-role-sep { display: none; }
  body.connecte .entete .identite button:not(#btn-langue) {
    display: flex; align-items: center; gap: .7rem; width: 100%; padding: .5rem .7rem; border: 0; border-radius: 9px;
    background: transparent; color: var(--discret); font-size: .9rem; font-weight: 500; text-align: left;
  }
  body.connecte .entete .identite button:not(#btn-langue):hover { background: var(--survol); color: var(--encre); }
  body.connecte .entete .identite #btn-compte.actif { background: var(--accent-clair); color: var(--accent); border: 0; }
}

@media (max-width: 960px) {
  body.connecte .entete {
    position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem;
    padding: .55rem .8rem .35rem; background: var(--carte); border-bottom: 1px solid var(--trait); box-shadow: none;
  }
  body.connecte .marque { color: var(--titre); font-size: 1.05rem; }
  body.connecte .entete > .identite { margin-left: auto; display: flex; align-items: center; gap: .35rem; order: 1; }
  body.connecte #identite { display: flex; align-items: center; gap: .3rem; }
  body.connecte #identite[hidden] { display: none; }
  body.connecte .moi-texte { display: none; }
  body.connecte .moi-carte { display: none; }
  body.connecte .entete .identite button { padding: .35rem .5rem; border: 1px solid var(--trait); border-radius: 8px; background: var(--carte); color: var(--discret); }
  body.connecte .entete .identite button span { display: none; }
  body.connecte #btn-langue { border: 0; font-size: .8rem; }
  body.connecte .entete .identite #btn-deconnexion { display: inline-flex; }
  body.connecte .onglets {
    order: 3; width: 100%; display: flex; flex-wrap: nowrap; gap: .2rem; overflow-x: auto; scrollbar-width: none;
    margin: 0; padding: 0; border: 0;
  }
  body.connecte .onglets::-webkit-scrollbar { display: none; }
  body.connecte .onglets button {
    flex: none; display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .7rem; border: 0; border-radius: 8px;
    background: none; color: var(--discret); font-size: .88rem; font-weight: 500; white-space: nowrap; min-height: 0;
  }
  body.connecte .onglets button::after { display: none; }
  body.connecte .onglets button.actif { background: var(--accent-clair); color: var(--accent); font-weight: 600; }
  body.connecte .onglets .separateur { display: none; }
}

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #5b8def); color: #fff;
  font-size: .82rem; font-weight: 700; letter-spacing: .02em;
}
.avatar.grand { width: 68px; height: 68px; font-size: 1.45rem; box-shadow: 0 0 0 4px var(--carte), 0 0 0 5px var(--trait); }

/* ------------------------------------------------------------ pages */

body.connecte main.vue.page { width: min(1280px, 100%); margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 2.5rem) 2.5rem; }
body.connecte .pied-legal { padding-bottom: 1.5rem; }

.page-tete {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem;
  margin: 0 0 1.5rem; padding: 0; background: none; border: 0; box-shadow: none; color: inherit;
}
.page-tete h1 { margin: .15rem 0 .25rem; font-size: clamp(1.55rem, 2.4vw, 1.95rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.page-tete p { margin: 0; }
.page-tete .surtitre { font-size: .76rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.page-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.page-actions button { padding: .55rem .95rem; border-radius: 9px; font-weight: 600; }

.carte { border-radius: var(--rayon-carte); border: 1px solid var(--trait); box-shadow: var(--ombre); background: var(--carte); }
.carte-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.carte-tete h2 { margin: 0; font-size: 1.02rem; font-weight: 650; }
.carte-tete p { margin: .15rem 0 0; }
.carte-tete .lien-bouton { display: inline-flex; align-items: center; gap: .3rem; font-size: .86rem; font-weight: 600; color: var(--accent); border: 0; background: none; padding: .15rem 0; }
.carte-tete .lien-bouton .ico { width: 16px; height: 16px; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600;
  background: var(--survol); color: var(--discret); border: 1px solid var(--trait); }
.badge.ok { background: var(--valide-clair); color: var(--valide); border-color: transparent; }
.badge.attente { background: var(--ocre-clair); color: var(--ocre); border-color: transparent; }
.badge.erreur { background: var(--alerte-clair); color: var(--alerte); border-color: transparent; }

.pastille-statut { flex: none; padding: .16rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--survol); color: var(--discret); white-space: nowrap; }
.pastille-statut.s-a_relire { background: var(--accent-clair); color: var(--accent); }
.pastille-statut.s-termine { background: var(--valide-clair); color: var(--valide); }
.pastille-statut.s-en_cours, .pastille-statut.s-en_attente { background: var(--ocre-clair); color: var(--ocre); }
.pastille-statut.s-erreur { background: var(--alerte-clair); color: var(--alerte); }

/* ------------------------------------------------------------ chiffres clés */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1rem; margin: 0 0 1.25rem; }
.kpi {
  display: flex; flex-direction: column; gap: .4rem; min-width: 0; padding: 1.05rem 1.15rem 1.1rem;
  background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon-carte); box-shadow: var(--ombre);
}
.kpi-tete { display: flex; align-items: center; gap: .6rem; color: var(--discret); font-size: .86rem; font-weight: 500; }
.kpi-icone { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent-clair); color: var(--accent); }
.kpi-icone .ico { width: 17px; height: 17px; }
.kpi-valeur { font-size: 1.75rem; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; color: var(--titre); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-detail { font-size: .82rem; color: var(--discret); }
.kpi-jauge { height: 6px; border-radius: 999px; background: var(--survol); overflow: hidden; }
.kpi-jauge span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.kpi-jauge span.haute { background: var(--ocre); }
.kpi-jauge span.pleine { background: var(--alerte); }
.kpi.alerte .kpi-icone { background: var(--alerte-clair); color: var(--alerte); }

/* ------------------------------------------------------------ accueil */

.acc-alertes { display: flex; flex-direction: column; gap: .5rem; margin: 0 0 1.1rem; }
.acc-alertes:empty { display: none; }
.acc-alerte {
  display: flex; align-items: center; gap: .7rem; width: 100%; padding: .7rem 1rem; text-align: left;
  border-radius: 11px; border: 1px solid transparent; font-size: .92rem; font-weight: 500; cursor: pointer;
  background: var(--accent-clair); color: var(--encre);
}
.acc-alerte > .ico:first-child { color: var(--accent); }
.acc-alerte > .ico:last-child { margin-left: auto; width: 16px; height: 16px; opacity: .6; }
.acc-alerte.attente { background: var(--ocre-clair); }
.acc-alerte.attente > .ico:first-child { color: var(--ocre); }
.acc-alerte.erreur { background: var(--alerte-clair); }
.acc-alerte.erreur > .ico:first-child { color: var(--alerte); }
.acc-alerte:hover { border-color: var(--trait-fort); }

.acc-grille { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
.acc-grille > .carte { margin: 0; padding: 1.2rem 1.3rem; }
.acc-activite { grid-column: span 8; }
.acc-offre { grid-column: span 4; }
.acc-fichiers { grid-column: span 7; }
.acc-projets { grid-column: span 5; }
.acc-grille:has(.acc-activite[hidden]) .acc-offre { grid-column: span 12; }
.acc-grille:has(.acc-fichiers[hidden]) .acc-projets,
.acc-grille:has(.acc-projets[hidden]) .acc-fichiers { grid-column: span 12; }
.acc-graphique { min-height: 230px; }
.acc-vide { color: var(--discret); font-size: .9rem; padding: .6rem 0; list-style: none; }

.acc-offre-bloc { display: flex; flex-direction: column; gap: .6rem; }
.acc-offre-bloc + .acc-offre-bloc { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--trait); }
.acc-grille:has(.acc-activite[hidden]) #acc-offre { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem 2rem; }
.acc-grille:has(.acc-activite[hidden]) .acc-offre-bloc + .acc-offre-bloc { margin: 0; padding: 0; border: 0; }
.acc-offre-ligne { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; font-size: .9rem; }
.acc-offre-ligne span { color: var(--discret); }
.acc-offre-ligne b { font-variant-numeric: tabular-nums; color: var(--titre); }
.acc-offre-bloc button { margin-top: .2rem; justify-content: center; border-radius: 9px; padding: .55rem .9rem; font-weight: 600; }

.acc-liste { list-style: none; margin: 0; padding: 0; }
.acc-liste li + li { border-top: 1px solid var(--trait); }
.acc-ligne {
  display: flex; align-items: center; gap: .8rem; width: 100%; padding: .65rem .35rem; text-align: left;
  border: 0; border-radius: 9px; background: none; color: inherit; cursor: pointer;
}
.acc-ligne:hover { background: var(--survol); }
.acc-ligne-icone { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px;
  border-radius: 10px; background: var(--accent-clair); color: var(--accent); }
.acc-ligne-icone.analyse { background: var(--valide-clair); color: var(--valide); }
.acc-ligne-texte { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.acc-ligne-texte b { font-weight: 600; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--titre); }
.acc-ligne-texte small { color: var(--discret); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) {
  .acc-activite, .acc-offre, .acc-fichiers, .acc-projets { grid-column: span 12; }
}

/* ------------------------------------------------------------ sous-navigation (Mon compte, administration) */

.groupe-cache { display: none !important; }

.mise-sous-nav { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.sous-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 1.5rem; }
.sous-nav button {
  display: flex; align-items: center; gap: .65rem; width: 100%; padding: .55rem .75rem; text-align: left;
  border: 0; border-radius: 9px; background: none; color: var(--discret); font-size: .92rem; font-weight: 500;
}
.sous-nav button:hover { background: var(--carte); color: var(--encre); }
.sous-nav button.actif { background: var(--carte); color: var(--accent); font-weight: 600; box-shadow: var(--ombre); outline: 1px solid var(--trait); }
.sous-nav button[hidden] { display: none; }

.sous-nav.horizontale {
  position: static; flex-direction: row; gap: .25rem; margin: 0 0 1.4rem; padding: 0;
  border-bottom: 1px solid var(--trait); overflow-x: auto; scrollbar-width: none;
}
.sous-nav.horizontale::-webkit-scrollbar { display: none; }
.sous-nav.horizontale button {
  width: auto; flex: none; padding: .65rem .9rem; border-radius: 0; margin-bottom: -1px; white-space: nowrap;
  border-bottom: 2px solid transparent; background: none; box-shadow: none; outline: 0;
}
.sous-nav.horizontale button:hover { background: none; color: var(--encre); }
.sous-nav.horizontale button.actif { background: none; color: var(--accent); border-bottom-color: var(--accent); box-shadow: none; outline: 0; }

@media (max-width: 900px) {
  .mise-sous-nav { grid-template-columns: 1fr; gap: 1rem; }
  .sous-nav:not(.horizontale) { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--trait); gap: .2rem; padding-bottom: .4rem; }
  .sous-nav:not(.horizontale) button { width: auto; flex: none; white-space: nowrap; }
}

/* ------------------------------------------------------------ Mon compte */

.compte-tete { align-items: center; }
.compte-identite { display: flex; align-items: center; gap: 1.2rem; min-width: 0; }
.compte-identite h1 { margin: 0 0 .1rem; }
.badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.badges:empty { display: none; }

#vue-compte .compte-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; align-items: start; margin: 0; max-width: none; }
#vue-compte .compte-grille > .carte { margin: 0; padding: 1.35rem 1.45rem; }
#vue-compte .compte-grille > [data-groupe="offre"],
#vue-compte .compte-grille > [data-groupe="securite"],
#vue-compte .compte-grille > [data-groupe="contrat"],
#vue-compte .compte-grille > .zone-danger { grid-column: 1 / -1; }
#vue-compte .compte-grille > .carte > h2:first-child,
#vue-compte .compte-achat h2 { font-size: 1.05rem; margin: 0 0 1rem; }
@media (max-width: 1100px) { #vue-compte .compte-grille { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ administration */

#vue-admin .admin-grille { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
#vue-admin .admin-grille > * { grid-column: 1 / -1; margin: 0; min-width: 0; }
#vue-admin .admin-grille > .admin-sante-carte { grid-column: span 7; }
#vue-admin .admin-grille > [data-groupe="apercu"].admin-carte:not(.admin-sante-carte):not(.admin-erreurs) { grid-column: span 5; }
#vue-admin .admin-indicateurs.kpis { margin: 0; }
#vue-admin .admin-carte { padding: 1.3rem 1.4rem; }
#vue-admin .admin-titre-section h2 { font-size: 1.05rem; }
#vue-admin .admin-surtitre { color: var(--accent); letter-spacing: .07em; font-size: .7rem; }
@media (max-width: 1100px) { #vue-admin .admin-grille > * { grid-column: 1 / -1 !important; } }

.admin-tendances { display: flex; flex-direction: column; gap: .8rem; }
.tendances-tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.tendances-tete h2 { margin: 0; font-size: 1.05rem; }
.tendances-grille { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; }
.tendances-grille > .tendance { grid-column: span 2; }
.tendances-grille > .tendance.large { grid-column: span 3; }
@media (max-width: 1100px) { .tendances-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tendances-grille > .tendance, .tendances-grille > .tendance.large { grid-column: span 1; } }
@media (max-width: 640px) { .tendances-grille { grid-template-columns: 1fr; } }
#admin-message:empty { display: none; }
.spark { display: block; width: 100%; height: auto; overflow: visible; }
.spark-aire { fill: var(--accent); opacity: .1; }
.spark-ligne { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-barre { fill: var(--accent); opacity: .85; }
.spark-barre.vide { fill: var(--trait); opacity: 1; }
.spark-grille { stroke: var(--trait); stroke-width: 1; stroke-dasharray: 2 3; }
.spark-texte { fill: var(--discret); font-size: 11px; font-variant-numeric: tabular-nums; }
.spark-cible { fill: transparent; }
.spark-cible:hover + .spark-repere, .spark-zone:hover .spark-repere { opacity: 1; }
.spark-repere { stroke: var(--trait-fort); stroke-width: 1; opacity: 0; }
.spark-point { fill: var(--carte); stroke: var(--accent); stroke-width: 2; }
.tendance-variation { font-size: .78rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px; background: var(--survol); color: var(--discret); }
.tendance-variation.hausse { background: var(--valide-clair); color: var(--valide); }
.tendance-variation.baisse { background: var(--alerte-clair); color: var(--alerte); }
.tendance { padding: 1rem 1.1rem .7rem; margin: 0; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.tendance-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; }
.tendance-tete > span:first-child { width: 100%; color: var(--discret); font-size: .85rem; font-weight: 500; }
.tendance-tete strong { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; color: var(--titre); font-variant-numeric: tabular-nums; }
.tendance-trace { min-height: 150px; }
.tendance-trace .g-svg { max-height: 190px; }

.segmente { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--survol); border: 1px solid var(--trait); }
.segmente button { white-space: nowrap; border: 0; background: none; padding: .3rem .7rem; border-radius: 7px; color: var(--discret); font-weight: 600; font-size: .82rem; }
.segmente button.actif { background: var(--carte); color: var(--titre); box-shadow: var(--ombre); }

/* ------------------------------------------------------------ tableaux de bord d'analyse */

.tdb-grille { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; }
.tdb-carte { grid-column: span 2; border-radius: var(--rayon-carte); box-shadow: var(--ombre); padding: 1.05rem 1.15rem 1.15rem; gap: .65rem; }
.tdb-carte.plein { grid-column: 1 / -1; }
.tdb-carte.type-chiffre:not(.plein) { grid-column: span 1; }
.tdb-carte-tete h3 { font-size: .98rem; font-weight: 650; color: var(--titre); }
.tdb-carte-tete .tdb-source { display: inline-block; margin-top: .1rem; font-size: .76rem; }
.tdb-carte:not(.plein) .tdb-carte-tete { flex-direction: row; }
.tdb-carte { position: relative; }
.tdb-carte .tdb-carte-tete > .tdb-actions {
  position: absolute; top: .55rem; right: .55rem; z-index: 3; padding: .25rem; gap: .25rem;
  background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; box-shadow: var(--ombre-haute);
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.tdb-carte .tdb-carte-tete > .tdb-actions .tdb-actions { position: static; display: inline-flex; gap: .25rem; padding: 0; border: 0; box-shadow: none; background: none; }
.tdb-carte:hover .tdb-carte-tete > .tdb-actions, .tdb-carte:focus-within .tdb-carte-tete > .tdb-actions { opacity: 1; pointer-events: auto; }
.tdb-actions button, .tdb-actions select { border-radius: 7px; }
.tdb-carte.type-chiffre .g-chiffre { padding: .1rem 0 0; }
.tdb-carte.type-chiffre .g-chiffre strong { font-size: clamp(1.8rem, 3vw, 2.35rem); }
@media (hover: none) { .tdb-carte .tdb-carte-tete > .tdb-actions { position: static; opacity: 1; pointer-events: auto; box-shadow: none; border: 0; padding: 0; } }
@media (max-width: 1100px) { .tdb-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tdb-carte.type-chiffre:not(.plein) { grid-column: span 1; } }
@media (max-width: 760px) { .tdb-grille { grid-template-columns: 1fr; } .tdb-carte, .tdb-carte.type-chiffre:not(.plein) { grid-column: 1 / -1; } }
@media print { .tdb-grille { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tdb-actions { display: none !important; } }
body.connecte main#vue-compte.vue.page { max-width: 1200px; width: 100%; }
#vue-compte .compte-utilisation li, #vue-compte .chiffres-compte li { min-width: 0; }
.achat-solde { background: var(--accent-clair); border: 0; border-radius: 12px; }
.achat-packs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.achat-pack { padding: 1.05rem 1.1rem; border-radius: 12px; gap: .2rem; transition: border-color .15s, box-shadow .15s; }
.achat-pack:hover { border-color: var(--trait-fort); box-shadow: var(--ombre-haute); }
.achat-pack button { margin-top: auto; border-radius: 9px; font-weight: 600; }
.achat-pack .petit, .achat-pack small { margin-bottom: .6rem; }
@media (max-width: 700px) { .achat-packs { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ analyses : mise en page et barre du tableau de bord */
@media (min-width: 961px) {
  body.connecte #vue-analyses.mise-en-page { grid-template-columns: 290px minmax(0, 1fr); gap: 1.25rem; padding: 1.5rem clamp(1rem, 2vw, 1.75rem) 2rem; max-width: 1500px; margin: 0 auto; }
}
#vue-analyses .colonne > .carte, #vue-analyses .an-principal, #vue-analyses > section.carte { border-radius: var(--rayon-carte); }
.an-tdb-barre {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .6rem; margin: 0 0 1rem; padding: .7rem .8rem;
  background: var(--survol); border: 1px solid var(--trait); border-radius: 12px;
}
.an-tdb-barre label { margin: 0; display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; font-weight: 600; color: var(--discret); }
.an-tdb-barre select { min-width: 13rem; }
.an-tdb-barre button { padding: .42rem .75rem; font-size: .86rem; border-radius: 8px; }
.an-tdb-outils { display: flex; flex-wrap: wrap; gap: .35rem; margin-left: auto; }
.an-tdb-nom { margin: .2rem 0 .1rem; font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }
#vue-analyses [data-panneau="tdb"]:has(#an-tdb-grille > *) .an-tdb-aide > p { display: none; }
#vue-analyses [data-panneau="tdb"]:has(#an-tdb-grille > *) .an-tdb-aide { background: none; padding: 0; margin: .4rem 0 .8rem; }
.tdb-carte.type-chiffre .tdb-source { display: none; }
.an-onglets { border-radius: 11px; }

@media (prefers-color-scheme: dark) {
  button.principal, .bouton.principal, .acc-offre-bloc button.principal { color: #0b1422; }
  .avatar { background: linear-gradient(135deg, #3b82f6, #6aa7f8); color: #fff; }
}
@media (max-width: 640px) {
  body.connecte main.vue.page { padding: 1.1rem .85rem 2rem; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .kpi { padding: .8rem .85rem; }
  .kpi-valeur { font-size: 1.35rem; }
  .kpi-tete { font-size: .78rem; }
  .kpi-icone { width: 26px; height: 26px; }
  .page-actions { width: 100%; }
  .page-actions button { flex: 1; justify-content: center; }
  .compte-identite { gap: .8rem; }
  .avatar.grand { width: 52px; height: 52px; font-size: 1.1rem; }
}
.admin-reglages .admin-sous-titre { margin: 1.4rem 0 .7rem; padding-top: 1.2rem; border-top: 1px solid var(--trait); font-size: .95rem; }
.admin-reglages .admin-titre-section + .admin-sous-titre { margin-top: .4rem; padding-top: 0; border-top: 0; }
.admin-tableau button { white-space: nowrap; }
.heros .pub-services { color: rgb(255 255 255 / 80%); border-left-color: #4cc38a; }

/* ------------------------------------------------------------ page publique (image de marque) */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.pub-nav { display: flex; gap: .3rem 1.4rem; align-items: center; justify-self: center; }
.pub-nav a { color: var(--discret); text-decoration: none; font-size: .92rem; font-weight: 500; }
.pub-nav a:hover { color: var(--accent); }
body.connecte .pub-nav { display: none; }
body:not(.connecte) .entete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem clamp(1rem, 4vw, 2.5rem); border-bottom: 1px solid var(--trait); }
body:not(.connecte) .entete > .identite { margin-left: 0; }
@media (max-width: 760px) { .pub-nav { display: none; } }

.accueil-public .bande { scroll-margin-top: 5rem; }
.pub-surtitre { margin: 0 0 .35rem; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.accueil-public .bande > h2 { margin: 0 0 .5rem; }
.pub-intro { margin: 0 0 1.5rem; max-width: 70ch; color: var(--discret); font-size: 1.02rem; }

.pub-deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.pub-service { position: relative; padding: 1.5rem 1.6rem; border-radius: 16px; border: 1px solid var(--trait); background: var(--fond); overflow: hidden; }
.pub-service h3 { margin: .8rem 0 .3rem; font-size: 1.25rem; }
.pub-service > p { margin: 0 0 1rem; color: var(--discret); }
.pub-service-icone { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-clair); color: var(--accent); }
.pub-service-icone .ico { width: 22px; height: 22px; }
.pub-service.analyse .pub-service-icone { background: var(--valide-clair); color: var(--valide); }
.pub-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.pub-liste li { position: relative; padding-left: 1.6rem; font-size: .94rem; }
.pub-liste li::before { content: ""; position: absolute; left: 0; top: .28em; width: 1rem; height: 1rem; border-radius: 50%;
  background: var(--valide-clair) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 8.2 2.2 2.2 4.8-4.8' fill='none' stroke='%2313855a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.pub-mini-tdb { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1.2rem; padding: .8rem; border-radius: 12px; background: var(--carte); border: 1px solid var(--trait); }
.pub-mini-kpi { padding: .45rem .6rem; border-radius: 8px; background: var(--fond); }
.pub-mini-kpi small { display: block; color: var(--discret); font-size: .72rem; }
.pub-mini-kpi b { font-size: 1.15rem; color: var(--titre); }
.pub-mini-courbe { grid-column: 1 / -1; width: 100%; height: 64px; }
.pub-mini-courbe .aire { fill: var(--accent); opacity: .12; }
.pub-mini-courbe .ligne { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }

.pub-tarifs-grille { display: flex; flex-direction: column; gap: 1.1rem; }
.pub-tarifs-rangee { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.pub-prix { position: relative; display: flex; flex-direction: column; gap: .7rem; padding: 1.3rem 1.3rem 1.2rem; border-radius: 16px; border: 1px solid var(--trait); background: var(--carte); }
.pub-prix.populaire { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-clair), var(--ombre-haute); }
.pub-prix-ruban { position: absolute; top: -.7rem; left: 1.2rem; padding: .15rem .65rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .74rem; font-weight: 700; }
.pub-prix h3 { margin: 0; font-size: .98rem; color: var(--discret); font-weight: 600; }
.pub-prix-montant strong { display: block; font-size: 1.75rem; letter-spacing: -.02em; color: var(--titre); font-variant-numeric: tabular-nums; }
.pub-prix-montant small { color: var(--discret); }
.pub-prix .pub-liste { flex: 1; }
.pub-prix .pub-liste li { font-size: .88rem; }
.pub-prix button { justify-content: center; padding: .6rem; border-radius: 10px; font-weight: 600; }
.pub-tarifs-note { margin-top: 1rem; }

.pub-securite-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.pub-securite-grille > div { padding: 1.2rem; border-radius: 14px; background: var(--fond); border: 1px solid var(--trait); }
.pub-securite-grille .ico { width: 26px; height: 26px; color: var(--accent); }
.pub-securite-grille b { display: block; margin: .6rem 0 .3rem; color: var(--titre); }
.pub-securite-grille p { margin: 0; font-size: .9rem; color: var(--discret); }

.pub-faq-liste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1.2rem; margin-top: 1rem; }
.pub-faq-liste details { border: 1px solid var(--trait); border-radius: 12px; padding: .85rem 1.05rem; background: var(--carte); }
.pub-faq-liste summary { cursor: pointer; font-weight: 600; color: var(--titre); list-style-position: outside; }
.pub-faq-liste details[open] { background: var(--fond); }
.pub-faq-liste details p { margin: .6rem 0 0; color: var(--discret); font-size: .93rem; }

.pub-final { text-align: center; background: linear-gradient(135deg, #123a6b, #1d6fd8) !important; color: #fff; border: 0 !important; }
.pub-final h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.pub-final p { color: rgb(255 255 255 / 85%); margin: 0 auto 1.3rem; max-width: 60ch; }
.pub-final .boutons-heros { justify-content: center; }

@media (max-width: 900px) {
  .pub-deux, .pub-faq-liste { grid-template-columns: 1fr; }
  .pub-securite-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) { .pub-securite-grille { grid-template-columns: 1fr; } }
.pub-final .boutons-heros .principal { background: #fff; color: #123a6b; border-color: #fff; }
.pub-final .boutons-heros button:not(.principal) { background: transparent; color: #fff; border: 1px solid rgb(255 255 255 / 60%); }
.pub-final .boutons-heros button:not(.principal):hover { background: rgb(255 255 255 / 10%); }
.pub-tarifs-titre { margin: .4rem 0 0; font-size: 1rem; color: var(--titre); }
.pub-mini-trans { margin-top: 1.2rem; padding: .8rem .9rem; border-radius: 12px; background: var(--carte); border: 1px solid var(--trait); display: flex; flex-direction: column; gap: .55rem; }
.pub-mini-lecteur { display: flex; align-items: center; gap: .6rem; }
.pub-mini-jouer { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); position: relative; }
.pub-mini-jouer::after { content: ""; position: absolute; left: 10px; top: 8px; border-left: 8px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.pub-mini-lecteur svg { flex: 1; height: 26px; }
.pub-mini-lecteur path { stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; fill: none; vector-effect: non-scaling-stroke; opacity: .8; }
.pub-mini-lecteur small { color: var(--discret); font-variant-numeric: tabular-nums; }
.pub-mini-trans p { margin: 0; font-size: .86rem; line-height: 1.45; padding-left: 3.2rem; position: relative; }
.pub-mini-trans p b { display: block; font-size: .74rem; color: var(--accent); }
.pub-mini-temps { position: absolute; left: 0; top: .1rem; font-size: .72rem; padding: .05rem .35rem; border-radius: 6px; background: var(--valide-clair); color: var(--valide); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ finition : accessibilité, palette, transitions */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }
.lien-evitement { position: absolute; left: .75rem; top: -3rem; z-index: 100; padding: .5rem .9rem; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; transition: top .15s; }
.lien-evitement:focus { top: .75rem; }
body:not(.connecte) .lien-evitement { display: none; }

@keyframes apparition { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
body.connecte .vue:not([hidden]) { animation: apparition .22s ease-out; }
.carte, .kpi, button, .acc-ligne, .sous-nav button { transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s; }

kbd { font: 600 .7rem/1 ui-monospace, "Cascadia Code", Consolas, monospace; padding: .2rem .35rem; border-radius: 5px;
  border: 1px solid var(--trait); border-bottom-width: 2px; background: var(--carte); color: var(--discret); }
.nav-recherche { display: none; }
@media (min-width: 961px) {
  body.connecte .onglets .nav-recherche {
    display: flex; margin: 0 0 .75rem; padding: .5rem .65rem; border: 1px solid var(--trait); border-radius: 10px;
    background: var(--fond); color: var(--discret); font-weight: 400;
  }
  body.connecte .onglets .nav-recherche:hover { border-color: var(--trait-fort); background: var(--fond); }
  body.connecte .onglets .nav-recherche kbd { margin-left: auto; }
}

dialog.palette-commandes { width: min(640px, 94vw); max-width: none; padding: 0; margin: 12vh auto auto; border-radius: 16px; border: 1px solid var(--trait);
  background: var(--carte); box-shadow: var(--ombre-haute), 0 30px 80px rgb(15 23 42 / 25%); overflow: hidden; }
dialog.palette-commandes::backdrop { background: rgb(15 23 42 / 45%); backdrop-filter: blur(3px); }
dialog.palette-commandes[open] { animation: apparition .16s ease-out; }
.palette-champ { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border-bottom: 1px solid var(--trait); color: var(--discret); }
.palette-champ input { flex: 1; border: 0; outline: 0; background: none; font-size: 1.05rem; color: var(--encre); padding: .2rem 0; box-shadow: none; }
.palette-champ input::-webkit-search-cancel-button { display: none; }
.palette-liste { list-style: none; margin: 0; padding: .4rem; max-height: min(420px, 55vh); overflow-y: auto; }
.palette-groupe { padding: .65rem .7rem .3rem; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--discret); }
.palette-liste [role=option] { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 9px; cursor: pointer; }
.palette-liste [role=option].choisi { background: var(--accent-clair); color: var(--accent); }
.palette-icone { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--survol); color: var(--discret); flex: none; }
.palette-liste .choisi .palette-icone { background: var(--carte); color: var(--accent); }
.palette-libelle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.palette-liste small { color: var(--discret); font-size: .78rem; }
.palette-vide { padding: 1.2rem; text-align: center; color: var(--discret); }
.palette-pied { margin: 0; padding: .55rem 1rem; border-top: 1px solid var(--trait); background: var(--fond); }

@keyframes reflet { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sq { display: block; height: .8rem; border-radius: 6px; background: linear-gradient(90deg, var(--survol) 25%, var(--trait) 50%, var(--survol) 75%);
  background-size: 200% 100%; animation: reflet 1.4s ease-in-out infinite; }
.sq-court { width: 45%; } .sq-grand { height: 1.7rem; width: 60%; }
.kpi.squelette { gap: .7rem; min-height: 128px; }
.squelette-ligne { padding: .9rem .35rem; list-style: none; }
dialog.palette-commandes[open] { display: flex; flex-direction: column; }

/* ------------------------------------------------------------ marque DataTrans */
:root { --marque: #1d4e89; --logo-fond: var(--carte); }
@media (prefers-color-scheme: dark) { :root { --marque: #9cc2f5; } }
.marque { display: inline-flex; align-items: center; gap: .6rem; color: var(--marque) !important; text-decoration: none; }
.marque .logo-mark { width: 34px; height: 34px; flex: none; color: var(--marque); }
.marque .logo-mark rect { fill: currentColor; }
.marque-nom { font-family: "Montserrat", "Segoe UI", system-ui, sans-serif; font-size: 1.18rem; font-weight: 400; letter-spacing: .04em; line-height: 1; color: var(--marque); }
.marque-nom b { font-weight: 800; }
body.connecte .marque .logo-mark { width: 32px; height: 32px; }

/* Application mobile : code QR de connexion (Mon compte) */
.mobile-qr-ligne { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.mobile-qr { flex: 0 0 auto; width: 168px; height: 168px; padding: 8px; background: #fff; border-radius: 14px;
  border: 1px solid var(--trait, #e3e8ef); display: grid; place-items: center; }
.mobile-qr svg { width: 100%; height: 100%; }
.mobile-etapes { margin: 0 0 6px; padding-left: 20px; line-height: 1.7; }
.carte-mobile code { font-size: 13px; word-break: break-all; }

/* ---- choix de la langue de l'interface (10 langues) */
#btn-langue.choix-interface {
  width: auto; min-width: 0; max-width: 9.5rem; padding: .25rem 1.6rem .25rem .6rem; font-size: .84rem;
  border: 1px solid var(--trait, #dce2ea); border-radius: 999px; background-color: transparent; color: inherit; cursor: pointer;
}
body.connecte #btn-langue.choix-interface { border: 1px solid var(--trait, #dce2ea); padding: .2rem 1.5rem .2rem .55rem; }

/* ---- écriture de droite à gauche (interface en arabe) */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .entete, [dir="rtl"] .pub-nav, [dir="rtl"] .grille-langues { direction: rtl; }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"], [dir="rtl"] code, [dir="rtl"] pre, [dir="rtl"] .horaire { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] #btn-langue.choix-interface { padding: .25rem .6rem .25rem 1.6rem; }

/* Portion à transcrire et retranscription */
.portion-champs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; }
.portion-champs input { width: 100%; min-width: 0; box-sizing: border-box; }
.choix-mode { border: 0; padding: 0; margin: .4rem 0; display: grid; gap: .3rem; }
.boutons-lecteur { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
/* Bouton qui apparaît sur une sélection de texte pour retranscrire seulement ce passage */
.bouton-passage { position: absolute; z-index: 30; padding: .35rem .7rem; border-radius: 999px; font-size: .85rem;
  background: var(--accent, #1d6fe0); color: #fff; border: 0; box-shadow: 0 4px 14px rgba(0,0,0,.18); cursor: pointer; }
.bouton-passage:hover { filter: brightness(1.08); }
