/* =========================================================
 * Espace pro Vivreco — charte commune
 * Chargée par includes/navbar_pro.php
 * ========================================================= */

:root {
    --ep-rouge: #CE323F;
    --ep-fond: #F7F8FA;
    --ep-texte: #252A30;
    --ep-attenue: #6D7379;
    --ep-filet: #E6E8EB;
    --ep-survol: #F8EEF0;

    --ep-nc-texte: #AD2733;  --ep-nc-fond: #FFF5F6;
    --ep-ss-texte: #7A5A12;  --ep-ss-fond: #FDF8EC;
    --ep-sv-texte: #1D4FA1;  --ep-sv-fond: #F0F6FE;
    --ep-ok-texte: #22543D;  --ep-ok-fond: #F1F8F4;
}

/* ---------- Bandeau commun ---------- */
.ep-bandeau.navbar {
    background-color: var(--ep-rouge);
    min-height: 52px;
    padding-top: 0;
    padding-bottom: 0;
    box-shadow: none;
    font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}
.ep-bandeau .container { max-width: 1120px; padding-left: 16px; padding-right: 16px; }
.ep-bandeau .navbar-brand { padding: 0; }
.ep-bandeau .nav-link,
.ep-bandeau .nav-link:focus { color: #fff !important; font-weight: 500; }
.ep-bandeau .nav-link:hover,
.ep-bandeau .nav-link.is-actif { color: #fff !important; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Page ---------- */
body.ep-page {
    background-color: var(--ep-fond);
    color: var(--ep-texte);
    font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}
.ep-page [hidden] { display: none !important; }

.ep-main {
    flex: 1;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px 32px;
    box-sizing: border-box;
}

.ep-entete {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 12px;
}
.ep-titre { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; color: var(--ep-texte); }
.ep-attenue { color: var(--ep-attenue); margin: 0; }

.ep-vue { display: flex; align-items: center; gap: 8px; }
.ep-vue label { color: var(--ep-attenue); font-size: .875rem; }
.ep-vue select {
    height: 36px;
    border: 1px solid var(--ep-filet);
    border-radius: 8px;
    background: #fff;
    color: var(--ep-texte);
    padding: 0 10px;
    font: inherit;
}

/* ---------- Rangées de cartes ---------- */
.ep-rangee { margin-bottom: 24px; }
.ep-rangee-titre {
    font-size: .8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ep-attenue);
    margin: 0 0 8px;
}
.ep-rangee-titre a { color: inherit; text-decoration: none; }
.ep-rangee-titre a:hover { color: var(--ep-texte); text-decoration: underline; }

.ep-grille {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 900px) { .ep-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479.98px) { .ep-grille { grid-template-columns: 1fr; } }

.ep-carte {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 96px;
    box-sizing: border-box;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--ep-filet);
    border-radius: 8px;
    box-shadow: none;
    color: var(--ep-texte);
    text-align: left;
    text-decoration: none;
    font: inherit;
}
.ep-chiffre { font-size: 28px; line-height: 1.15; font-weight: 700; color: var(--ep-texte); }
.ep-libelle { font-size: .9375rem; color: var(--ep-attenue); font-weight: 500; }
.ep-note { font-size: .8125rem; color: var(--ep-attenue); }

a.ep-carte--lien { color: var(--ep-texte); }
a.ep-carte--lien:hover .ep-libelle { color: var(--ep-texte); text-decoration: underline; }
a.ep-carte--lien:focus-visible { outline: 2px solid var(--ep-rouge); outline-offset: 2px; }

/* Cartes d'alerte = filtres */
.ep-alerte { cursor: pointer; border-left-width: 4px; }
.ep-alerte:hover { background: var(--ep-survol); }
.ep-alerte:focus-visible { outline: 2px solid var(--ep-rouge); outline-offset: 2px; }
.ep-alerte--non_connectee { border-left-color: var(--ep-nc-texte); }
.ep-alerte--sous_seuil,
.ep-alerte--entretien     { border-left-color: var(--ep-ss-texte); }
.ep-alerte--surveiller    { border-left-color: var(--ep-sv-texte); }

.ep-alerte--non_connectee.is-active { background: var(--ep-nc-fond); }
.ep-alerte--non_connectee.is-active .ep-libelle { color: var(--ep-nc-texte); }
.ep-alerte--sous_seuil.is-active,
.ep-alerte--entretien.is-active     { background: var(--ep-ss-fond); }
.ep-alerte--sous_seuil.is-active .ep-libelle,
.ep-alerte--entretien.is-active .ep-libelle { color: var(--ep-ss-texte); }
.ep-alerte--surveiller.is-active    { background: var(--ep-sv-fond); }
.ep-alerte--surveiller.is-active .ep-libelle { color: var(--ep-sv-texte); }
.ep-alerte--ok { border-left-color: var(--ep-ok-texte); }
.ep-alerte--ok.is-active { background: var(--ep-ok-fond); }
.ep-alerte--ok.is-active .ep-libelle { color: var(--ep-ok-texte); }
.ep-alerte.is-active .ep-libelle { font-weight: 700; }

/* ---------- Blocs d'information (graphiques, répartition, récents) ---------- */
.ep-rangee--apres { margin-top: 24px; }

.ep-duo {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.ep-bloc--large { grid-column: span 2; }
@media (max-width: 900px) {
    .ep-duo { grid-template-columns: 1fr; }
    .ep-bloc--large { grid-column: auto; }
}

.ep-bloc {
    background: #fff;
    border: 1px solid var(--ep-filet);
    border-radius: 8px;
    box-shadow: none;
    padding: 16px;
    min-width: 0;
}
.ep-bloc-titre { font-size: 1rem; font-weight: 700; margin: 0; color: var(--ep-texte); }
.ep-bloc-sous { font-size: .8125rem; color: var(--ep-attenue); margin: 2px 0 12px; }
.ep-bloc-vide { color: var(--ep-attenue); margin: 24px 0; text-align: center; }

/* Données des graphiques pour lecteurs d'écran */
.ep-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Graphiques SVG */
.ep-graph { position: relative; width: 100%; min-height: 200px; }
.ep-graph svg { display: block; overflow: visible; }
.ep-g-grille  { stroke: var(--ep-filet); stroke-width: 1; }
.ep-g-repere  { stroke: #C9CDD2; stroke-width: 1; stroke-dasharray: 4 4; }
.ep-g-axe     { fill: var(--ep-attenue); font-size: 11px; font-family: inherit; }
.ep-g-valeur  { fill: var(--ep-texte); font-size: 12px; font-weight: 700; font-family: inherit; }
.ep-g-ligne   { fill: none; stroke: var(--ep-rouge); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ep-g-aire    { fill: var(--ep-rouge); opacity: .08; }
.ep-g-point   { fill: var(--ep-rouge); stroke: #fff; stroke-width: 2; }
.ep-g-reticule { stroke: var(--ep-attenue); stroke-width: 1; }
.ep-g-barre   { fill: var(--ep-rouge); }

.ep-bulle {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    background: var(--ep-texte);
    color: #fff;
    font-size: .8125rem;
    line-height: 1.35;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
}
.ep-bulle span { color: #C9CDD2; }

/* Barre empilée de répartition : un segment par statut, 2 px d'air entre segments */
.ep-pile {
    display: flex;
    gap: 2px;
    height: 16px;
    margin-bottom: 14px;
}
.ep-pile-seg { flex-basis: 0; min-width: 4px; }
.ep-pile-seg:first-child { border-radius: 4px 0 0 4px; }
.ep-pile-seg:last-child  { border-radius: 0 4px 4px 0; }
.ep-pile-seg:only-child  { border-radius: 4px; }

.ep-seg--ok            { background: #2E9E6A; }
.ep-seg--surveiller    { background: #3B7DD8; }
.ep-seg--sous_seuil    { background: #D9A21B; }
.ep-seg--non_connectee { background: #CE323F; }
.ep-seg--rodage        { background: #A9AFB6; }

.ep-legende { list-style: none; margin: 0; padding: 0; }
.ep-legende li {
    display: grid;
    grid-template-columns: 10px 1fr auto 44px;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-top: 1px solid var(--ep-filet);
    font-size: .875rem;
}
.ep-legende li:first-child { border-top: 0; }
.ep-pastille-couleur { width: 10px; height: 10px; border-radius: 2px; }
.ep-legende-libelle { color: var(--ep-texte); }
.ep-legende-n { font-weight: 700; color: var(--ep-texte); text-align: right; }
.ep-legende-pct { color: var(--ep-attenue); text-align: right; }

/* Dernières mises en service */
.ep-recents { list-style: none; margin: 0; padding: 0; }
.ep-recents li { border-top: 1px solid var(--ep-filet); }
.ep-recents li:first-child { border-top: 0; }
.ep-recents a {
    display: block;
    padding: 9px 8px;
    margin: 0 -8px;
    border-radius: 6px;
    color: var(--ep-texte);
    text-decoration: none;
}
.ep-recents a:hover { background: var(--ep-survol); }
.ep-recents-haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ep-recents-bas { display: block; font-size: .8125rem; color: var(--ep-attenue); margin-top: 2px; }

/* ---------- Panneau + tableau ---------- */
.ep-panneau {
    background: #fff;
    border: 1px solid var(--ep-filet);
    border-radius: 8px;
    box-shadow: none;
    overflow: hidden;
}
.ep-panneau-titre {
    font-size: 1.0625rem;
    font-weight: 700;
    margin: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ep-filet);
    color: var(--ep-texte);
}

.ep-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.ep-table tr[hidden] { display: none !important; }
.ep-table th {
    text-align: left;
    font-weight: 500;
    font-size: .8125rem;
    color: var(--ep-attenue);
    padding: 10px 16px;
    border-bottom: 1px solid var(--ep-filet);
    white-space: nowrap;
}
.ep-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ep-filet);
    vertical-align: middle;
}
.ep-table tbody tr:last-child td { border-bottom: 0; }
.ep-table tbody tr { cursor: pointer; }
.ep-table tbody tr:hover { background: var(--ep-survol); }
.ep-table a { color: var(--ep-texte); font-weight: 700; text-decoration: none; }
.ep-table a:hover { text-decoration: underline; }

.ep-vide { margin: 0; padding: 24px 16px; color: var(--ep-attenue); text-align: center; }
.ep-table td[data-col="Taux"] { white-space: nowrap; }

.ep-plus {
    display: block;
    width: 100%;
    height: 44px;
    border: 0;
    border-top: 1px solid var(--ep-filet);
    background: #fff;
    color: var(--ep-rouge);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}
.ep-plus:hover { background: var(--ep-survol); }
.ep-plus:focus-visible { outline: 2px solid var(--ep-rouge); outline-offset: -2px; }

/* ---------- Statuts (le mot est toujours affiché) ---------- */
.ep-statut {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
}
.ep-statut--non_connectee { color: var(--ep-nc-texte); background: var(--ep-nc-fond); }
.ep-statut--sous_seuil,
.ep-statut--entretien     { color: var(--ep-ss-texte); background: var(--ep-ss-fond); }
.ep-statut--surveiller    { color: var(--ep-sv-texte); background: var(--ep-sv-fond); }
.ep-statut--ok            { color: var(--ep-ok-texte); background: var(--ep-ok-fond); }
.ep-statut--rodage,
.ep-statut--stock,
.ep-statut--fabrication   { color: var(--ep-attenue); background: var(--ep-fond); }

/* ---------- Nom personnalisé des PAC ---------- */
.ep-pac { display: inline-flex; flex-direction: column; line-height: 1.25; text-decoration: none; }
.ep-pac-nom { font-weight: 500; }
.ep-table td[data-col="PAC"] { min-width: 150px; }
.ep-pac:hover .ep-pac-nom { text-decoration: underline; }
.ep-pac-num { font-size: .75rem; color: var(--ep-attenue); font-weight: 400; }
.ep-recents-haut .ep-pac-num { margin-right: auto; }
.ep-nouveau {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border: 1px solid var(--ep-filet);
    border-radius: 4px;
    font-size: .6875rem;
    font-weight: 500;
    line-height: 18px;
    color: var(--ep-texte);
    vertical-align: middle;
}

/* ---------- Taux + mini-courbe 30 j ---------- */
.ep-taux { display: inline-flex; align-items: center; gap: 8px; }
.ep-mini { display: inline-block; width: 64px; height: 20px; flex-shrink: 0; }
.ep-mini svg { display: block; overflow: visible; }
.ep-mini-ligne { fill: none; stroke: var(--ep-attenue); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.ep-mini-point { fill: var(--ep-texte); }
.ep-mini-seuil { stroke: #C9CDD2; stroke-width: 1; stroke-dasharray: 2 2; }

/* ---------- Infobulle d'explication du taux ---------- */
.ep-aide { cursor: help; white-space: nowrap; border-radius: 4px; }
.ep-aide .bi { font-size: .8125rem; color: var(--ep-attenue); margin-left: 2px; }
.ep-taux { cursor: help; border-radius: 4px; }
.ep-aide:focus-visible, .ep-taux:focus-visible { outline: 2px solid var(--ep-sv-texte); outline-offset: 2px; }
.ep-infobulle {
    position: fixed;
    z-index: 1080;
    max-width: 300px;
    padding: 10px 12px;
    background: #fff;
    color: var(--ep-texte);
    border: 1px solid var(--ep-filet);
    border-radius: 8px;
    box-shadow: none;
    font-size: .8125rem;
    line-height: 1.4;
    text-align: left;
    pointer-events: none;
}
.ep-infobulle strong { display: block; font-size: .875rem; margin-bottom: 2px; }
.ep-infobulle-jour { display: block; margin-top: 6px; font-weight: 500; }
.ep-infobulle-note { display: block; margin-top: 6px; color: var(--ep-attenue); }
.ep-infobulle-seuils { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--ep-filet); color: var(--ep-attenue); }
.ep-infobulle-seuils b { color: var(--ep-texte); font-weight: 500; }

/* ---------- Moyenne 30 j et réseau ---------- */
.ep-moyenne { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 8px 0 0; }
.ep-moyenne-v { font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: var(--ep-texte); }
.ep-moyenne-l { font-size: .875rem; color: var(--ep-attenue); }
.ep-moyenne-reseau { font-size: .875rem; color: var(--ep-texte); }
.ep-g-reseau { fill: none; stroke: #A9AFB6; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ep-legende-lignes { display: flex; gap: 16px; list-style: none; margin: -4px 0 8px; padding: 0; font-size: .8125rem; color: var(--ep-attenue); }
.ep-trait { display: inline-block; width: 16px; height: 2px; border-radius: 1px; vertical-align: middle; margin-right: 4px; }
.ep-trait--parc { background: var(--ep-rouge); }
.ep-trait--reseau { background: #A9AFB6; }

/* ---------- Dossiers ---------- */
.ep-paire { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .ep-paire { grid-template-columns: 1fr; } }
.ep-lignes { list-style: none; margin: 8px 0 0; padding: 0; }
.ep-lignes li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0 8px 10px;
    border-top: 1px solid var(--ep-filet);
    border-left: 3px solid transparent;
}
.ep-lignes li:first-child { border-top: 0; }
.ep-lignes-l small { display: block; font-size: .75rem; color: var(--ep-attenue); }
.ep-lignes-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.ep-ligne--action { border-left-color: var(--ep-ss-texte) !important; background: var(--ep-ss-fond); }
.ep-ligne--action .ep-lignes-n { color: var(--ep-ss-texte); }
.ep-recents--serre { margin-top: 12px; border-top: 1px solid var(--ep-filet); }
.ep-bloc-lien { margin: 12px 0 0; font-size: .875rem; }

/* ---------- Choix en pastilles et champs (formulaires de l'espace pro) ---------- */
.ep-choix { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.ep-choix legend { float: none; width: auto; font-size: .875rem; font-weight: 500; margin: 0 0 6px; color: var(--ep-texte); }
.ep-choix-liste { display: flex; flex-wrap: wrap; gap: 8px; }
.ep-choix-item { position: relative; margin: 0; cursor: pointer; }
.ep-choix-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ep-choix-item span {
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid var(--ep-filet);
    border-radius: 999px;
    background: #fff;
    font-size: .875rem;
    color: var(--ep-texte);
}
.ep-choix-item:hover span { background: var(--ep-survol); }
.ep-choix-item input:checked + span { border-color: var(--ep-rouge); background: var(--ep-survol); color: #8E1F2A; font-weight: 500; }
.ep-choix-item input:focus-visible + span { outline: 2px solid var(--ep-sv-texte); outline-offset: 2px; }
.ep-champ { margin: 0 0 16px; }
.ep-champ label { display: block; font-size: .875rem; font-weight: 500; margin: 0 0 6px; }
.ep-champ select,
.ep-champ input {
    width: 100%;
    max-width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #C9CDD2;
    border-radius: 8px;
    background: #fff;
    color: var(--ep-texte);
    font: inherit;
    font-size: .9375rem;
}
.ep-champ input[type="number"] { max-width: 120px; }
.ep-champ select:focus,
.ep-champ input:focus { outline: 2px solid var(--ep-sv-texte); outline-offset: 1px; border-color: transparent; }

/* ---------- Calcul de garantie ---------- */
.ep-gar-tarif { align-self: flex-start; padding: 4px 10px; border: 1px solid var(--ep-filet); border-radius: 999px; background: #fff; font-size: .8125rem; color: var(--ep-attenue); }
.ep-gar { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .ep-gar { grid-template-columns: 1fr; } }
.ep-gar-config { padding: 20px; }
.ep-gar-etape { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; margin: 0 0 14px; }
.ep-gar-etape + * { margin-top: 0; }
.ep-gar-etape span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--ep-texte); color: #fff; font-size: .75rem;
}
.ep-gar-config .ep-gar-etape:not(:first-child) { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--ep-filet); }
.ep-gar-indice { color: var(--ep-attenue); font-size: .875rem; margin: 0; }
.ep-gar-resultat { position: sticky; top: 68px; padding: 20px; }
@media (max-width: 900px) { .ep-gar-resultat { position: static; } }
.ep-gar-vide { color: var(--ep-attenue); margin: 20px 0; }
.ep-gar-erreur { color: var(--ep-nc-texte); background: var(--ep-nc-fond); border-radius: 8px; padding: 10px 12px; margin: 12px 0; font-size: .875rem; }
.ep-gar-offre { padding: 14px 0; border-top: 1px solid var(--ep-filet); }
.ep-gar-offre:first-child { margin-top: 10px; }
.ep-gar-offre-titre { font-size: .875rem; font-weight: 500; color: var(--ep-attenue); }
.ep-gar-offre-prix { margin: 2px 0 4px; }
.ep-gar-montant { font-size: 1.75rem; font-weight: 700; line-height: 1.15; color: var(--ep-texte); font-variant-numeric: tabular-nums; }
.ep-gar-unite { font-size: .875rem; color: var(--ep-attenue); }
.ep-gar-offre-detail { font-size: .8125rem; color: var(--ep-texte); }
.ep-gar-offre-limite { font-size: .8125rem; color: var(--ep-attenue); }
.ep-gar-offre.is-indisponible .ep-gar-montant { font-size: 1.125rem; color: var(--ep-attenue); }
/* Couleur de chaque garantie, reprise de l'ancienne version : 10 ans en bleu, 15 ans en rouge */
.ep-gar-offre[data-duree] .ep-gar-offre-titre { display: inline-block; padding: 2px 10px; border-radius: 4px; color: #fff; }
.ep-gar-offre[data-duree="10"] .ep-gar-offre-titre { background: #2196F3; }
.ep-gar-offre[data-duree="15"] .ep-gar-offre-titre { background: #D32F2F; }
.ep-gar-offre[data-duree="10"] .ep-gar-montant { color: #1976D2; }
.ep-gar-offre[data-duree="15"] .ep-gar-montant { color: #D32F2F; }
.ep-gar-offre.is-indisponible .ep-gar-offre-titre { background: #CFD8DC; color: var(--ep-texte); }
.ep-gar-base { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--ep-filet); font-size: .8125rem; color: var(--ep-attenue); }
.ep-gar-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--ep-fond); font-size: .8125rem; color: var(--ep-attenue); line-height: 1.45; }
.ep-gar-conditions { padding: 4px 20px; }
.ep-gar-conditions details { border-top: 1px solid var(--ep-filet); }
.ep-gar-conditions details:first-child { border-top: 0; }
.ep-gar-conditions summary { padding: 14px 0; font-weight: 500; cursor: pointer; }
.ep-gar-conditions details > :not(summary) { font-size: .9375rem; line-height: 1.55; }
.ep-gar-conditions ul { padding-left: 20px; }
.ep-gar-conditions details[open] { padding-bottom: 8px; }

/* ---------- Fenêtres (Bootstrap) à la charte ---------- */
.ep-modal .modal-content { border: 1px solid var(--ep-filet); border-radius: 8px; box-shadow: none; font-family: 'Roboto', system-ui, sans-serif; color: var(--ep-texte); }
.ep-modal .modal-header, .ep-modal .modal-footer { border-color: var(--ep-filet); padding: 14px 20px; }
.ep-modal .modal-body { padding: 18px 20px; }
.ep-modal .modal-title { font-size: 1.0625rem; font-weight: 700; margin: 0; }
.ep-modal .modal-footer { gap: 8px; }
.ep-modal .modal-footer > * { margin: 0; }

/* ---------- Annonce (toast) ---------- */
.ep-toast {
    position: fixed; z-index: 1090; left: 50%; bottom: 24px; transform: translateX(-50%);
    max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 8px;
    background: var(--ep-texte); color: #fff; font-size: .875rem; box-shadow: none;
}
.ep-toast.is-erreur { background: var(--ep-nc-texte); }

/* ---------- Comptes ---------- */
.ep-gc-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 12px; }
.ep-gc-resume { margin: 0; color: var(--ep-attenue); font-size: .875rem; }
.ep-gc-resume strong { color: var(--ep-texte); }
.ep-gc-alerte { color: var(--ep-nc-texte); font-weight: 500; }
.ep-gc-recherche { margin: 0; flex: 0 1 320px; }
.ep-gc-personne { display: flex; flex-direction: column; line-height: 1.3; }
.ep-gc-nom { font-weight: 500; }
.ep-gc-email { font-size: .8125rem; color: var(--ep-attenue); overflow-wrap: anywhere; }
.ep-gc-table td[data-col="Personne"] { min-width: 230px; }
.ep-gc-vous { display: inline-block; margin-left: 4px; padding: 0 6px; border: 1px solid var(--ep-filet); border-radius: 999px; font-size: .6875rem; font-weight: 500; line-height: 18px; color: var(--ep-attenue); vertical-align: middle; }
.ep-gc-etat { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .8125rem; font-weight: 500; white-space: nowrap; margin-right: 6px; }
.ep-gc-etat--actif  { color: var(--ep-ok-texte); background: var(--ep-ok-fond); }
.ep-gc-etat--bloque { color: var(--ep-nc-texte); background: var(--ep-nc-fond); }
.ep-gc-etat--invite { color: var(--ep-sv-texte); background: var(--ep-sv-fond); }
.ep-gc-etat--echecs { color: var(--ep-ss-texte); background: var(--ep-ss-fond); }
.ep-gc-actions { text-align: right; white-space: nowrap; }
.ep-gc-actions .ep-bouton { height: 32px; padding: 0 10px; font-size: .8125rem; margin: 2px 0 2px 4px; white-space: nowrap; }
.ep-gc-table tbody tr { cursor: default; }
.ep-gc-legende { margin: 12px 0 0; font-size: .8125rem; color: var(--ep-attenue); }
.ep-gc-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 479.98px) { .ep-gc-deux { grid-template-columns: 1fr; } }
.ep-gc-droits { display: flex; flex-direction: column; }
.ep-gc-droit { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--ep-filet); cursor: pointer; font-size: .9375rem; }
.ep-gc-droit:first-child { border-top: 0; }
.ep-gc-droit input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ep-rouge); flex-shrink: 0; }
.ep-gc-sep { margin-top: 20px !important; padding-top: 16px; border-top: 1px solid var(--ep-filet); }
.ep-gc-droits-lecture { margin: 8px 0 0; padding-left: 18px; font-size: .9375rem; }
.ep-gc-fiche { margin: 12px 0; }
.ep-gc-fiche div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--ep-filet); }
.ep-gc-fiche div:first-child { border-top: 0; }
.ep-gc-fiche dt { font-weight: 400; color: var(--ep-attenue); }
.ep-gc-fiche dd { margin: 0; text-align: right; word-break: break-word; }

/* ---------- Connexion et mot de passe (login.php, reset_pass.php) ---------- */
.ep-acces { display: flex; flex-direction: column; min-height: 100vh; margin: 0; }
.ep-acces *, .ep-acces *::before, .ep-acces *::after { box-sizing: border-box; } /* pas de Bootstrap sur ces pages */
.ep-acces-bandeau { height: 52px; background: var(--ep-rouge); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ep-acces-bandeau img { height: 28px; width: auto; display: block; }
.ep-acces-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px 48px; }
.ep-acces-carte { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--ep-filet); border-radius: 8px; padding: 28px 24px; }
.ep-acces-titre { font-size: 1.375rem; font-weight: 700; margin: 0 0 6px; color: var(--ep-texte); }
.ep-acces-sous { margin: 0 0 20px; color: var(--ep-attenue); font-size: .9375rem; line-height: 1.45; overflow-wrap: anywhere; }
.ep-acces-sous strong { color: var(--ep-texte); font-weight: 500; }
.ep-acces-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ep-acces-ligne label { margin-bottom: 6px; }
.ep-acces-lien { color: var(--ep-rouge); font-size: .875rem; font-weight: 500; text-decoration: none; }
.ep-acces-lien:hover { text-decoration: underline; }
.ep-acces-bouton { height: 44px; font-size: .9375rem; margin-top: 4px; }
.ep-acces-bas { margin: 16px 0 0; text-align: center; }
.ep-acces-aide { max-width: 400px; margin: 16px 0 0; text-align: center; font-size: .8125rem; color: var(--ep-attenue); }
.ep-acces-regle { margin: 6px 0 0; font-size: .8125rem; color: var(--ep-attenue); }
.ep-acces-message { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; font-size: .875rem; line-height: 1.45; }
.ep-acces-message--erreur { color: var(--ep-nc-texte); background: var(--ep-nc-fond); }
.ep-acces-message--ok { color: var(--ep-ok-texte); background: var(--ep-ok-fond); }
.ep-acces .ep-champ input { height: 44px; font-size: 1rem; } /* 16 px : pas de zoom automatique sur iPhone */
.ep-mdp { position: relative; }
.ep-mdp input { padding-right: 84px !important; }
.ep-mdp-voir {
    position: absolute; top: 4px; right: 4px; bottom: 4px;
    padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
    color: var(--ep-attenue); font: inherit; font-size: .8125rem; font-weight: 500; cursor: pointer;
}
.ep-mdp-voir:hover { background: var(--ep-fond); color: var(--ep-texte); }
.ep-mdp-voir:focus-visible { outline: 2px solid var(--ep-sv-texte); outline-offset: 0; }
@media (max-width: 479.98px) { .ep-acces-carte { padding: 24px 18px; } .ep-acces-main { justify-content: flex-start; padding-top: 24px; } }

/* ---------- Fiche client ---------- */
.ep-fc-retour { margin: 0 0 8px; font-size: .875rem; }
.ep-fc-retour a { color: var(--ep-attenue); text-decoration: none; }
.ep-fc-retour a:hover { color: var(--ep-texte); text-decoration: underline; }
.ep-fc-manque { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--ep-nc-texte); border-radius: 8px; background: var(--ep-nc-fond); color: var(--ep-nc-texte); font-size: .875rem; }
.ep-fc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .ep-fc { grid-template-columns: 1fr; } }
.ep-fc-form, .ep-fc-pacs { padding: 20px; }
.ep-fc-form .ep-bloc-titre { margin-bottom: 14px; }
.ep-fc-grille { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 12px; }
.ep-fc-grille > .ep-champ { grid-column: span 2; margin-bottom: 14px; }
.ep-fc-grille > .ep-fc-demi { grid-column: span 3; }
.ep-fc-grille > .ep-fc-plein { grid-column: span 6; }
@media (max-width: 479.98px) {
    .ep-fc-grille > .ep-champ, .ep-fc-grille > .ep-fc-demi { grid-column: span 6; }
    .ep-fc-grille > .ep-fc-civ { grid-column: span 3; }
}
.ep-champ.is-manquant input { border-color: var(--ep-nc-texte); border-left-width: 3px; background: var(--ep-nc-fond); }
.ep-fc-legende { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: .8125rem; color: var(--ep-attenue); }
.ep-fc-marque { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--ep-nc-texte); border-left-width: 3px; border-radius: 3px; background: var(--ep-nc-fond); }
.ep-fc-actions { display: flex; justify-content: flex-end; }
.ep-fc-pacs-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ep-fc-liste { list-style: none; margin: 0; padding: 0; }
.ep-fc-liste li { position: relative; border-top: 1px solid var(--ep-filet); }
.ep-fc-liste li:first-child { border-top: 0; }
.ep-fc-pac { display: block; padding: 12px 8px 30px; margin: 0 -8px; border-radius: 6px; color: var(--ep-texte); text-decoration: none; }
.ep-fc-pac:hover { background: var(--ep-survol); }
.ep-fc-pac-haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ep-fc-pac-bas { display: block; margin-top: 4px; font-size: .8125rem; color: var(--ep-attenue); }
.ep-fc-retirer { position: absolute; right: 0; bottom: 10px; font-size: .8125rem; color: var(--ep-attenue); font-weight: 400; }
.ep-fc-retirer:hover { color: var(--ep-nc-texte); }

/* ---------- Ajouter un client ---------- */
.ep-ac .ep-fc-form { max-width: 760px; }
.ep-ac-sep { margin-top: 8px !important; padding-top: 16px; border-top: 1px solid var(--ep-filet); }
.ep-facultatif { font-weight: 400; color: var(--ep-attenue); font-size: .8125rem; }
.ep-champ-aide { display: block; margin-top: 4px; font-size: .8125rem; color: var(--ep-attenue); }
.ep-champ-erreur { display: block; margin-top: 4px; font-size: .8125rem; color: var(--ep-nc-texte); }
.ep-champ.is-erreur input { border-color: var(--ep-nc-texte); border-left-width: 3px; background: var(--ep-nc-fond); }
.ep-champ input[readonly] { background: var(--ep-fond); color: var(--ep-attenue); }
.ep-ac-gps { margin: 0 0 14px; border-top: 1px solid var(--ep-filet); }
.ep-ac-gps summary { padding: 14px 0; cursor: pointer; font-weight: 500; }
.ep-fc-actions { gap: 8px; flex-wrap: wrap; }

/* ---------- Visionneuse de documents (pac/documents.php, dans la fenêtre « Document ») ---------- */
body.ep-dv { margin: 0; height: 100vh; display: flex; flex-direction: column; background: var(--ep-fond); }
.ep-dv *, .ep-dv *::before, .ep-dv *::after { box-sizing: border-box; }
.ep-dv-barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--ep-filet); font-size: .875rem; }
.ep-dv-nom { font-weight: 500; color: var(--ep-texte); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 200px; }
.ep-dv-actions { display: flex; gap: 16px; }
.ep-dv-lien { color: var(--ep-rouge); font-weight: 500; text-decoration: none; white-space: nowrap; }
.ep-dv-lien:hover { text-decoration: underline; }
.ep-dv-image { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px; }
.ep-dv-image img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.ep-dv--etat { background: var(--ep-fond); align-items: center; justify-content: center; padding: 16px; }
.ep-dv-etat { max-width: 420px; text-align: center; color: var(--ep-texte); }
.ep-dv-etat h1 { font-size: 1.125rem; font-weight: 700; margin: 0 0 8px; overflow-wrap: anywhere; }
.ep-dv-etat p { margin: 0 0 16px; color: var(--ep-attenue); line-height: 1.5; }

/* ---------- Mobile : chaque ligne devient un bloc ---------- */
@media (max-width: 719.98px) {
    .ep-table thead { display: none; }
    .ep-table, .ep-table tbody, .ep-table tr, .ep-table td { display: block; width: 100%; box-sizing: border-box; }
    .ep-table tr { padding: 12px 16px; border-bottom: 1px solid var(--ep-filet); }
    .ep-table tbody tr:last-child { border-bottom: 0; }
    .ep-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 4px 0;
        border-bottom: 0;
        text-align: right;
    }
    .ep-table td::before {
        content: attr(data-label);
        color: var(--ep-attenue);
        font-size: .8125rem;
        text-align: left;
        flex-shrink: 0;
    }
    .ep-statut { white-space: normal; }
    .ep-table td[data-col="PAC"] { align-items: center; }
    .ep-pac { align-items: flex-end; text-align: right; }
    .ep-table td[data-col="PAC"] .ep-pac { margin-left: auto; }
    .ep-gc-actions { white-space: normal; }
    .ep-gc-actions::before { display: none; }
    .ep-gc-actions .ep-bouton { margin: 4px 4px 0 0; }
    .ep-table td.ep-gc-actions { justify-content: flex-start; flex-wrap: wrap; }
    .ep-gc-personne { align-items: flex-end; text-align: right; }
}

/* =========================================================
 * Fiche PAC (pac/suivi.php)
 * ========================================================= */
.ep-fil { margin: 0 0 8px; font-size: .875rem; }
.ep-fil a { color: var(--ep-attenue); text-decoration: none; }
.ep-fil a:hover { color: var(--ep-texte); text-decoration: underline; }

.ep-fiche-entete {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px 16px;
    margin-bottom: 16px;
}
.ep-fiche-nom { min-width: 0; }
.ep-fiche-nom .ep-titre { overflow-wrap: anywhere; }
.ep-fiche-note { margin: 0; font-size: .8125rem; color: var(--ep-attenue); }

.ep-fiche-renommer { margin-bottom: 16px; }
.ep-fiche-renommer label { font-weight: 700; display: block; }
.ep-fiche-message:empty { display: none; }
.ep-fiche-message { margin-top: 8px; font-size: .875rem; }

.ep-fiche-grille {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.ep-fiche-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 900px) {
    .ep-fiche-grille { grid-template-columns: 1fr; }
    /* Sur mobile, le suivi (taux, entretien) passe avant le formulaire */
    .ep-fiche-grille > aside { order: -1; }
}

.ep-fiche-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ep-fiche-ligne .form-control { flex: 1 1 220px; max-width: 360px; }
.ep-fiche-ligne--garantie { margin-top: 8px; }
.ep-fiche-ligne--garantie .form-select { width: auto; max-width: 100%; }

/* Liste d'informations : libellé à gauche, valeur à droite */
.ep-infos {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    margin: 12px 0 0;
}
.ep-infos dt, .ep-infos dd {
    margin: 0;
    padding: 10px 0;
    border-top: 1px solid var(--ep-filet);
}
.ep-infos dt:first-of-type, .ep-infos dt:first-of-type + dd { border-top: 0; }
.ep-infos dt { font-weight: 400; color: var(--ep-attenue); font-size: .875rem; }
.ep-infos dd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ep-infos dd > .ep-fiche-ligne, .ep-infos-aide { flex-basis: 100%; }
.ep-infos-aide { font-size: .8125rem; }
.ep-infos--serre { grid-template-columns: 90px minmax(0, 1fr); }
.ep-infos a { color: var(--ep-texte); font-weight: 500; }
@media (max-width: 479.98px) {
    .ep-infos { grid-template-columns: 1fr; }
    .ep-infos dt { padding-bottom: 0; }
    .ep-infos dd { border-top: 0; padding-top: 2px; }
}

.ep-fiche-chiffre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.75rem; font-weight: 700; line-height: 1.1; }

/* Boutons de la charte */
.ep-bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--ep-filet);
    border-radius: 8px;
    background: #fff;
    color: var(--ep-texte);
    font: inherit;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
.ep-bouton:hover { background: var(--ep-survol); }
.ep-bouton:focus-visible, .ep-lien:focus-visible, .ep-statut--bouton:focus-visible { outline: 2px solid var(--ep-rouge); outline-offset: 2px; }
.ep-bouton--principal { background: var(--ep-rouge); border-color: var(--ep-rouge); color: #fff; }
.ep-bouton--principal:hover { background: #B52A36; }
.ep-bouton--principal:disabled { opacity: .6; cursor: default; }
.ep-bouton--plein { width: 100%; }
.ep-lien { border: 0; background: none; padding: 0; color: var(--ep-rouge); font: inherit; font-weight: 500; cursor: pointer; }
.ep-lien:hover { text-decoration: underline; }
.ep-statut--bouton { border: 0; cursor: pointer; font-family: inherit; }
.ep-statut--bouton:hover { text-decoration: underline; }

/* Étapes de production */
.ep-etapes { list-style: none; margin: 0; padding: 0; }
.ep-etapes li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--ep-filet); }
.ep-etapes li:first-child { border-top: 0; }
.ep-etape-point { width: 10px; height: 10px; border-radius: 2px; margin-top: 6px; flex-shrink: 0; }
.ep-etape-l { font-weight: 500; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ep-etape-d { font-size: .8125rem; }
.ep-etape-blocage { font-size: .8125rem; color: var(--ep-nc-texte); }

/* Formulaires et listes Bootstrap remis à la charte, dans la fiche seulement */
.ep-fiche .form-label { font-size: .875rem; color: var(--ep-attenue); margin-bottom: 4px; }
.ep-fiche .form-control, .ep-fiche .form-select {
    border-color: var(--ep-filet);
    border-radius: 8px;
    color: var(--ep-texte);
    font-size: .9375rem;
}
.ep-fiche .form-control:focus, .ep-fiche .form-select:focus { border-color: var(--ep-attenue); box-shadow: none; }
.ep-fiche .btn { border-radius: 8px; font-weight: 500; box-shadow: none; }
.ep-fiche .btn-primary { background: var(--ep-rouge); border-color: var(--ep-rouge); }
.ep-fiche .btn-primary:hover, .ep-fiche .btn-primary:focus { background: #B52A36; border-color: #B52A36; }
.ep-fiche .btn-outline-primary { color: var(--ep-texte); border-color: var(--ep-filet); background: #fff; }
.ep-fiche .btn-outline-primary:hover { background: var(--ep-survol); color: var(--ep-texte); border-color: var(--ep-filet); }
.ep-fiche .alert { border-radius: 8px; }
.ep-fiche .list-group { border-radius: 0; }
.ep-fiche .list-group-item { border-left: 0; border-right: 0; border-color: var(--ep-filet); padding: 12px 0; background: transparent; }
.ep-fiche .list-group-item:first-child { border-top: 0; }
.ep-fiche .list-group-item:last-child { border-bottom: 0; }
.ep-fiche .muted-small { color: var(--ep-attenue); font-size: .8125rem; }
.ep-fiche .open-doc { color: var(--ep-rouge); font-size: .875rem; }
.ep-fiche .pagination .page-link { color: var(--ep-texte); border-color: var(--ep-filet); }
.ep-fiche .pagination .active .page-link { background: var(--ep-rouge); border-color: var(--ep-rouge); color: #fff; }
.ep-fiche .ep-bloc-titre { margin-bottom: 12px; }
.ep-fiche .ep-bloc-titre + .ep-bloc-sous { margin-top: -10px; }

/* Bouton « Retour » flottant (footer_pro) */
.ep-page #btn-retour {
    background: #fff;
    color: var(--ep-texte);
    border: 1px solid var(--ep-filet);
    border-radius: 8px;
    box-shadow: none !important;
    font-weight: 500;
}
.ep-page #btn-retour:hover { background: var(--ep-survol); }

/* Défilement vers un bloc : ne pas passer sous le bandeau collant */
.ep-fiche .ep-bloc { scroll-margin-top: 68px; }

/* =========================================================
 * Liste des PAC (pac/liste.php)
 * ========================================================= */
.ep-filtres {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid var(--ep-filet);
    border-radius: 8px;
}
.ep-filtre { display: flex; flex-direction: column; gap: 4px; flex: 1 1 180px; min-width: 0; }
.ep-filtre label { font-size: .8125rem; color: var(--ep-attenue); }
.ep-filtres .form-control { height: 36px; border-color: var(--ep-filet); border-radius: 8px; font-size: .9375rem; color: var(--ep-texte); }
.ep-filtres .form-control:focus { border-color: var(--ep-attenue); box-shadow: none; }
.ep-filtre--case { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px; height: 36px; }
.ep-filtre--case label { font-size: .9375rem; color: var(--ep-texte); cursor: pointer; }
.ep-filtre--case .form-check-input { margin: 0; cursor: pointer; }
.ep-filtre--case .form-check-input:checked { background-color: var(--ep-rouge); border-color: var(--ep-rouge); }
.ep-filtre--case .form-check-input:focus { box-shadow: none; border-color: var(--ep-attenue); }
.ep-filtre--actions { flex: 0 0 auto; flex-direction: row; gap: 8px; }
@media (max-width: 719.98px) {
    .ep-filtre, .ep-filtre--actions { flex-basis: 100%; }
    .ep-filtre--actions .ep-bouton { flex: 1; }
}

/* En-têtes triables */
.ep-table th[aria-sort] { padding: 0; }
.ep-tri {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    color: var(--ep-attenue) !important;
    font-weight: 500 !important;
    text-decoration: none;
}
.ep-tri .bi { font-size: .75rem; opacity: .5; }
.ep-tri:hover, .ep-tri.is-actif { color: var(--ep-texte) !important; }
.ep-tri.is-actif .bi { opacity: 1; }
.ep-tri:focus-visible { outline: 2px solid var(--ep-rouge); outline-offset: -2px; }

.ep-client { display: inline-flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.ep-client-nom { font-weight: 500; }
.ep-client-contact { font-size: .8125rem; color: var(--ep-attenue); overflow-wrap: anywhere; }
.ep-table a.ep-action { color: var(--ep-ss-texte); font-weight: 500; font-size: .875rem; white-space: nowrap; }
.ep-taux-cellule { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ep-taux-v:empty { display: none; }

/* Pagination */
.ep-pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; margin-top: 16px; }
.ep-page-lien {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--ep-filet);
    border-radius: 8px;
    background: #fff;
    color: var(--ep-texte);
    font-size: .875rem;
    text-decoration: none;
}
a.ep-page-lien:hover { background: var(--ep-survol); color: var(--ep-texte); }
.ep-page-lien.is-actif { background: var(--ep-rouge); border-color: var(--ep-rouge); color: #fff; font-weight: 500; }
.ep-page-trou { color: var(--ep-attenue); padding: 0 4px; }

@media (max-width: 719.98px) {
    .ep-liste .ep-table thead { display: none; }
    .ep-client { align-items: flex-end; text-align: right; }
    .ep-table td[data-col="PAC"] { min-width: 0; }
    .ep-table td[data-col="Taux"],
    .ep-table a.ep-action,
    .ep-taux-cellule { white-space: normal; }
}

/* Liste des clients */
.ep-table a.ep-client-nom { font-weight: 500; }
.ep-client-contact-l { overflow-wrap: anywhere; }
.ep-client .ep-action { margin-top: 2px; }

/* Espace factures */
.ep-factures .ep-panneau { overflow-x: auto; }
.ep-grille--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .ep-grille--3 { grid-template-columns: 1fr; } }
.ep-table th.ep-montant,
.ep-table td.ep-montant { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ep-table th.ep-montant .ep-tri { width: 100%; justify-content: flex-end; box-sizing: border-box; }
.ep-fact-lib { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-table a.ep-fact-num { font-weight: 500; }
@media (max-width: 719.98px) {
    .ep-fact-lib { max-width: none; white-space: normal; text-align: right; }
}

/* ---------- Wiki ---------- */
/* Le lecteur a sa propre navigation : pas de bouton « Retour » flottant par-dessus */
.ep-page--wiki #btn-retour { display: none !important; }
.ep-main.ep-wiki { max-width: none; padding-bottom: 16px; }
.ep-wiki-message { padding: 16px; }
.ep-wiki-message p { margin: 0 0 12px; }
.ep-wiki-message .ep-bouton { margin-top: 4px; }
.ep-wiki-corps {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.ep-wiki-sommaire {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding: 12px 8px 16px;
}
.ep-wiki-recherche { padding: 0 4px 10px; }
.ep-wiki-recherche input {
    width: 100%;
    height: 36px;
    box-sizing: border-box;
    border: 1px solid var(--ep-filet);
    border-radius: 8px;
    padding: 0 10px;
    font: inherit;
    font-size: .875rem;
    color: var(--ep-texte);
    background: #fff;
}
.ep-wiki-recherche input:focus { outline: 2px solid var(--ep-sv-texte); outline-offset: 1px; border-color: transparent; }
.ep-wiki-liste { list-style: none; margin: 0; padding: 0; }
.ep-wiki-liste .ep-wiki-liste { padding-left: 12px; margin-left: 9px; border-left: 1px solid var(--ep-filet); }
.ep-wiki-liste li { margin: 0; }
.ep-wiki-liste summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--ep-texte);
    cursor: pointer;
    list-style: none;
}
.ep-wiki-liste summary::-webkit-details-marker { display: none; }
.ep-wiki-liste summary::before {
    content: '';
    flex: none;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid var(--ep-attenue);
    border-bottom: 1.5px solid var(--ep-attenue);
    transform: rotate(-45deg);
    margin: 0 3px 0 1px;
    transition: transform .15s;
}
.ep-wiki-liste details[open] > summary::before { transform: rotate(45deg); margin-top: -3px; }
.ep-wiki-liste summary:hover { background: var(--ep-survol); }
.ep-wiki-liste summary:focus-visible,
a.ep-wiki-doc:focus-visible { outline: 2px solid var(--ep-rouge); outline-offset: -2px; }
a.ep-wiki-doc {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: .875rem;
    color: var(--ep-texte);
    text-decoration: none;
}
a.ep-wiki-doc:hover { background: var(--ep-survol); color: var(--ep-texte); }
a.ep-wiki-doc.is-actif { background: var(--ep-survol); color: var(--ep-nc-texte); font-weight: 500; }
.ep-wiki-doc-titre { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ep-wiki-chapitres { margin-top: 2px; }
a.ep-wiki-chap {
    display: block;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: .8125rem;
    color: var(--ep-texte);
    text-decoration: none;
    overflow-wrap: anywhere;
}
.ep-wiki-liste summary a.ep-wiki-chap { padding: 0; flex: 1; min-width: 0; font-weight: 500; }
a.ep-wiki-chap:hover { color: var(--ep-nc-texte); }
.ep-wiki-liste li > a.ep-wiki-chap:hover { background: var(--ep-survol); }
a.ep-wiki-chap.is-actif { color: var(--ep-nc-texte); font-weight: 500; background: var(--ep-survol); }
a.ep-wiki-chap:focus-visible { outline: 2px solid var(--ep-rouge); outline-offset: -2px; }
.ep-wiki-type { flex: none; font-size: .75rem; color: var(--ep-attenue); font-weight: 400; }
.ep-wiki-vide { margin: 4px 8px; font-size: .8125rem; color: var(--ep-attenue); }
.ep-wiki-lecteur { padding: 0; overflow: hidden; }
.ep-wiki-lecteur .ep-wiki-message { margin: 0; }
.ep-wiki-barre {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--ep-filet);
}
.ep-wiki-barre-titre { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-wiki-actions { display: flex; align-items: center; gap: 16px; flex: none; }
.ep-wiki-pdf {
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--ep-filet);
    border-radius: 4px;
    background: #fff;
    color: var(--ep-texte);
    font: inherit;
    font-size: .8125rem;
    font-weight: 500;
    cursor: pointer;
}
.ep-wiki-pdf:hover { background: var(--ep-survol); }
.ep-wiki-pdf:disabled { opacity: .6; cursor: progress; }
.ep-wiki-pdf:focus-visible { outline: 2px solid var(--ep-rouge); outline-offset: 1px; }
.ep-wiki-onglet { flex: none; font-size: .8125rem; color: var(--ep-attenue); }
.ep-wiki-onglet:hover { color: var(--ep-texte); }
.ep-wiki-cadre {
    display: block;
    width: 100%;
    height: calc(100vh - 190px);
    min-height: 480px;
    border: 0;
    background: #fff;
    color-scheme: light;   /* documents toujours en clair, même si l'appareil est en mode sombre */
}
/* Téléphone / petite tablette : pas de lecteur, chaque document s'ouvre dans un nouvel onglet */
@media (max-width: 899.98px) {
    .ep-wiki-corps { grid-template-columns: 1fr; }
    .ep-wiki-sommaire { position: static; max-height: none; }
    .ep-wiki-lecteur { display: none; }
}


/* =========================================================
 * News : icônes du bandeau (journal + paramètres), panneau latéral,
 * page de gestion (news/gestion.php)
 * ========================================================= */
.ep-outils { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.ep-outils .dropdown { position: relative; }
@media (min-width: 1200px) { .ep-outils { margin-left: 8px; } }
/* Liens du bandeau toujours sur une ligne (sinon « Liste / PAC » sur deux lignes) */
.ep-bandeau .nav-link { white-space: nowrap; }
@media (max-width: 1199.98px) {
    .ep-outils { margin-right: 6px; }
    .ep-bandeau .navbar-brand { margin-right: 6px; }
    .ep-bandeau .navbar-toggler { padding: 4px 8px; }
}
/* Petit écran : logo un peu plus petit pour garder journal, paramètres et menu sur une ligne */
@media (max-width: 419.98px) { .ep-bandeau .navbar-brand img { height: 24px !important; } }
@media (max-width: 389.98px) { .ep-bandeau .navbar-brand img { height: 20px !important; } }
.ep-outil {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0;
    border: 0; border-radius: 8px; background: transparent;
    color: #fff; font-size: 1.125rem; line-height: 1; cursor: pointer;
}
.ep-outil:hover, .ep-outil.is-actif, .ep-outil[aria-expanded="true"] { background: rgba(255, 255, 255, .16); }
.ep-outil:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* Point rouge sur le journal : une news non lue */
.ep-news-point {
    position: absolute; top: 6px; right: 5px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #FF2D3D; border: 2px solid #fff;
    animation: ep-news-clignote 1.2s ease-in-out infinite;
}
@keyframes ep-news-clignote { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .ep-news-point { animation: none; } }

.ep-outil-menu { border: 1px solid var(--ep-filet); border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, .08); font-family: 'Roboto', system-ui, sans-serif; font-size: .9375rem; padding: 6px 0; min-width: 220px; }
.ep-outil-menu .dropdown-header { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ep-attenue); }
.ep-outil-menu .dropdown-item { display: flex; align-items: center; gap: 8px; color: var(--ep-texte); padding: 8px 16px; }
.ep-outil-menu .dropdown-item:hover, .ep-outil-menu .dropdown-item:focus { background: var(--ep-survol); color: var(--ep-texte); }

/* Panneau latéral */
.ep-news.offcanvas { z-index: 1060; width: 420px; max-width: 100%; font-family: 'Roboto', system-ui, sans-serif; color: var(--ep-texte); border-left: 1px solid var(--ep-filet); }
.ep-news .offcanvas-header { align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--ep-filet); }
.ep-news-titre { font-size: 1.25rem; font-weight: 700; margin: 0 0 2px; }
.ep-news .ep-attenue { font-size: .875rem; }
.ep-news-liste { padding: 0 20px; }
.ep-news-vide { color: var(--ep-attenue); margin: 24px 0; text-align: center; }
.ep-news-pied { padding: 12px 20px; border-top: 1px solid var(--ep-filet); font-size: .875rem; }
.ep-news-pied a { color: var(--ep-rouge); font-weight: 500; text-decoration: none; }
.ep-news-pied a:hover { text-decoration: underline; }

.ep-news-item { padding: 16px 0; border-top: 1px solid var(--ep-filet); }
.ep-news-item:first-child { border-top: 0; }
.ep-news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .8125rem; color: var(--ep-attenue); margin: 0 0 4px; }
.ep-news-type { font-weight: 500; color: var(--ep-texte); }
.ep-news--important .ep-news-type { color: var(--ep-nc-texte); }
.ep-news--annonce .ep-news-type { color: var(--ep-sv-texte); }
.ep-news-nouveau { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-weight: 500; color: var(--ep-rouge); }
.ep-news-nouveau::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ep-rouge); }
.ep-news-item-titre { font-size: 1rem; font-weight: 700; margin: 0 0 6px; }
.ep-news-texte { font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.ep-news-texte p, .ep-news-texte ul { margin: 0 0 8px; }
.ep-news-texte ul { padding-left: 20px; }
.ep-news-texte h4 { font-size: .9375rem; font-weight: 700; margin: 10px 0 4px; }
.ep-news-texte a { color: var(--ep-rouge); }
.ep-news-texte > :last-child { margin-bottom: 0; }

/* Page de gestion */
.ep-ng { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 24px; }
@media (max-width: 900px) { .ep-ng { grid-template-columns: 1fr; } }
.ep-ng .ep-champ textarea {
    width: 100%; min-height: 200px; padding: 10px 12px;
    border: 1px solid #C9CDD2; border-radius: 8px; background: #fff;
    color: var(--ep-texte); font: inherit; font-size: .9375rem; line-height: 1.5; resize: vertical;
}
.ep-ng .ep-champ textarea:focus { outline: 2px solid var(--ep-sv-texte); outline-offset: 1px; border-color: transparent; }
.ep-ng-ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ep-ng-aide { font-size: .8125rem; color: var(--ep-attenue); margin: 6px 0 0; }
.ep-ng-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ep-ng-message { font-size: .875rem; margin: 0; }
.ep-ng-message.is-erreur { color: var(--ep-nc-texte); }
.ep-ng-apercu .ep-news-item { padding-top: 0; }
.ep-ng-table td.ep-ng-boutons { white-space: nowrap; text-align: right; }
.ep-ng-table .ep-bouton { height: 30px; padding: 0 10px; font-size: .8125rem; margin-left: 4px; }
.ep-ng-table tbody tr { cursor: default; }
.ep-ng-table tbody tr:hover { background: transparent; }
.ep-ng-titre-cel { font-weight: 500; }
@media (max-width: 719.98px) { .ep-ng-table td.ep-ng-boutons { justify-content: flex-end; flex-wrap: wrap; } }

/* ---------- Wiki : choix de la langue par drapeaux (FR / EN / IT / DE) ---------- */
.ep-drapeaux { display: flex; gap: 6px; }
.ep-drapeau-lien {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 10px;
    border: 1px solid var(--ep-filet); border-radius: 4px; background: #fff;
    color: var(--ep-attenue); font-size: .8125rem; font-weight: 500; text-decoration: none;
}
.ep-drapeau-lien:hover { background: var(--ep-fond); color: var(--ep-texte); }
.ep-drapeau-lien.is-actif { background: #f8eef0; border-color: #e8c5ca; color: var(--ep-nc-texte); }
.ep-drapeau-lien:focus-visible { outline: 2px solid var(--ep-rouge); outline-offset: 1px; }
.ep-drapeau { display: block; width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); flex: none; }
.ep-wiki-repli { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--ep-ss-fond); color: var(--ep-ss-texte); font-size: .875rem; }
@media (max-width: 479.98px) { .ep-drapeau-lien { padding: 0 8px; } }

/* =========================================================
   Choix de la langue (bandeau) : drapeau en cours en grand,
   les autres en fines bandes, tous ouverts au survol
   ========================================================= */
.ep-langues {
    display: inline-flex; align-items: center; gap: 3px;
    height: 28px; padding: 0 5px; margin-right: 6px;
    border: 1px solid rgba(255, 255, 255, .4); border-radius: 4px;
}
.ep-langue {
    display: block; flex: 0 0 auto;
    width: 6px; height: 16px; overflow: hidden;
    border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
    opacity: .85;
    transition: width .15s ease, opacity .15s ease;
}
.ep-langue svg { display: block; width: 24px; height: 16px; }
.ep-langue.is-actif { width: 24px; opacity: 1; }
.ep-langues:hover .ep-langue,
.ep-langues:focus-within .ep-langue,
.ep-langues.is-ouvert .ep-langue { width: 24px; }
.ep-langue:hover, .ep-langue:focus-visible { opacity: 1; }
.ep-langue:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .ep-langue { transition: none; } }
/* Petit écran : drapeaux plus petits pour garder logo, drapeaux, icônes et menu sur une ligne */
@media (max-width: 419.98px) {
    .ep-langues { gap: 2px; height: 24px; padding: 0 3px; margin-right: 0; }
    .ep-langue { width: 4px; height: 13px; }
    .ep-langue svg { width: 20px; height: 13px; }
    .ep-langue.is-actif,
    .ep-langues.is-ouvert .ep-langue { width: 20px; }
    .ep-bandeau .ep-outil { width: 32px; }
}
/* Pages de connexion : drapeaux à droite du bandeau, logo toujours centré */
.ep-acces-bandeau { position: relative; }
.ep-acces-bandeau .ep-langues { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); margin-right: 0; }

/* Renommer une PAC depuis la liste : crayon à côté du nom, champ sur place */
.ep-pac-cellule { display: flex; align-items: center; gap: 6px; }
.ep-pac-renommer {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 28px; height: 28px; padding: 0;
    border: 0; border-radius: 4px; background: transparent;
    color: var(--ep-attenue); font-size: .875rem; cursor: pointer;
}
.ep-pac-renommer:hover, .ep-pac-renommer:focus-visible { background: var(--ep-fond); color: var(--ep-texte); }
.ep-pac-renommer:focus-visible { outline: 2px solid var(--ep-rouge); outline-offset: 1px; }
.ep-pac-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.ep-pac-champ {
    width: 200px; max-width: 100%; height: 32px; padding: 4px 8px;
    border: 1px solid var(--ep-filet); border-radius: 4px; font: inherit; color: var(--ep-texte);
}
.ep-pac-champ:focus { outline: none; border-color: var(--ep-rouge); box-shadow: 0 0 0 2px var(--ep-survol); }
.ep-pac-form-boutons { display: flex; gap: 6px; }
.ep-pac-form .ep-bouton { padding: 4px 10px; min-height: 32px; font-size: .875rem; }
.ep-pac-aide { flex-basis: 100%; margin: 0; font-size: .75rem; color: var(--ep-attenue); }
.ep-pac-aide.is-erreur { color: var(--ep-nc-texte); }
@media (max-width: 767.98px) {
    .ep-pac-cellule { justify-content: flex-end; }
    .ep-pac-form { justify-content: flex-end; }
    .ep-pac-aide { text-align: right; }
}
