/* Facturation — interface.
   Aucun style en ligne (CSP stricte) : les couleurs d'entité sont posées par app.js (variables --accent / --c). */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --accent: #2563eb;
    --encre: #0f172a;
    --texte: #1e293b;
    --discret: #64748b;
    --pale: #94a3b8;
    --ligne: #e2e8f0;
    --ligne-forte: #cbd5e1;
    --fond: #f6f7f9;
    --carte: #ffffff;
    --survol: #f8fafc;
    --succes: #15803d;
    --succes-fond: #f0fdf4;
    --danger: #dc2626;
    --danger-fond: #fef2f2;
    --alerte: #b45309;
    --alerte-fond: #fffbeb;
    --info: #1d4ed8;
    --info-fond: #eff6ff;
    --rayon: 12px;
    --rayon-petit: 8px;
    --ombre: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
    --ombre-forte: 0 10px 30px rgba(15, 23, 42, .12);
    --barre: 252px;
}

html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--fond);
    color: var(--texte);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; color: var(--encre); line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 15.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
code, .mono { font-family: "Cascadia Mono", Consolas, Menlo, monospace; font-size: .9em; }
.ico { width: 1em; height: 1em; vertical-align: -0.125em; flex-shrink: 0; }
.discret { color: var(--discret); }
.nowrap { white-space: nowrap; }
.vide { color: var(--discret); text-align: center; padding: 40px 16px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Structure : barre latérale + contenu ─────────────────────────────── */

.barre {
    position: fixed; inset: 0 auto 0 0; width: var(--barre); z-index: 20;
    background: #0f172a; color: #cbd5e1;
    display: flex; flex-direction: column; padding: 18px 14px;
}
.marque { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; padding: 4px 10px 18px; }
.marque-logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; }
.nav-titre { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 14px 10px 6px; font-weight: 600; }
.nav a, .nav button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 10px; border-radius: 8px; border: 0; background: none;
    color: #cbd5e1; text-decoration: none; font: inherit; font-weight: 500; cursor: pointer; text-align: left;
}
.nav a:hover, .nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.actif { background: rgba(255, 255, 255, .1); color: #fff; }
.nav .ico { width: 16px; height: 16px; opacity: .85; }
.pastille { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #64748b); flex-shrink: 0; box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
.barre-bas { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; }
.compte { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: #fff; text-decoration: none; border-radius: 8px; }
.compte:hover { background: rgba(255, 255, 255, .06); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #334155; display: grid; place-items: center; font-weight: 700; font-size: 13px; text-transform: uppercase; }
.compte small { display: block; color: #94a3b8; font-size: 12px; }
.version { color: #475569; font-size: 11px; padding: 8px 10px 0; }

.principal { margin-left: var(--barre); min-height: 100vh; }
.contenu { padding: 28px 32px 48px; max-width: 1640px; }
.entete-page { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.entete-page .titres { flex: 1; min-width: 240px; }
.entete-page p { margin: 4px 0 0; color: var(--discret); }
.actions-page { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Composants ─────────────────────────────────────────────────────────── */

.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 22px; margin-bottom: 18px; }
.carte-titre { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.carte-titre p { margin: 2px 0 0; color: var(--discret); font-size: 13px; }
.carte-etroite { max-width: 560px; }
.pile { display: flex; flex-direction: column; gap: 14px; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grille-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.large { grid-column: 1 / -1; }
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; margin-bottom: 18px; }
.grille-cartes .carte { margin-bottom: 0; }

.champ { display: flex; flex-direction: column; gap: 6px; }
.champ label, .libelle { font-weight: 600; font-size: 13px; color: #334155; }
.champ .requis { color: var(--danger); }
.aide { font-size: 12.5px; color: var(--discret); }

input[type="text"], input[type="password"], input[type="date"], input[type="search"], input[type="email"], textarea, select {
    width: 100%; min-height: 40px; padding: 9px 12px;
    border: 1px solid var(--ligne-forte); border-radius: var(--rayon-petit);
    font: inherit; color: var(--texte); background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.45; }
select { padding-right: 32px; }
input::placeholder, textarea::placeholder { color: var(--pale); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type="color"] { width: 48px; height: 40px; padding: 3px; border: 1px solid var(--ligne-forte); border-radius: var(--rayon-petit); background: #fff; cursor: pointer; }
.code-otp { font-size: 24px; letter-spacing: 8px; text-align: center; font-family: "Cascadia Mono", Consolas, monospace; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 38px; padding: 8px 15px; border-radius: var(--rayon-petit);
    border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    background: var(--encre); color: #fff; transition: background .15s, border-color .15s, box-shadow .15s, filter .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-accent { background: var(--accent); }
.btn-secondaire { background: #fff; color: var(--texte); border-color: var(--ligne-forte); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.btn-secondaire:hover { background: var(--survol); filter: none; }
.btn-fantome { background: transparent; color: var(--discret); }
.btn-fantome:hover { background: #f1f5f9; color: var(--texte); filter: none; }
.btn-danger { background: var(--danger); }
.btn-danger-doux { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger-doux:hover { background: var(--danger-fond); filter: none; }
.btn-petit { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.btn-icone { min-height: 32px; width: 32px; padding: 0; }
.btn-large { width: 100%; min-height: 46px; font-size: 15px; }
.btn-lien { background: none; border: 0; color: var(--discret); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.lien-form { text-align: center; margin-top: 16px; }
.barre-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; align-items: center; }

.message { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; display: flex; gap: 12px; align-items: flex-start; border: 1px solid; font-size: 14px; }
.message .ico { font-size: 18px; margin-top: 1px; }
.message ul { margin: 4px 0 0; padding-left: 18px; }
.message .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.message-erreur { background: var(--danger-fond); color: #991b1b; border-color: #fecaca; }
.message-succes { background: var(--succes-fond); color: #166534; border-color: #bbf7d0; }
.message-info { background: var(--info-fond); color: #1e40af; border-color: #bfdbfe; }
.message-alerte { background: var(--alerte-fond); color: #92400e; border-color: #fde68a; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--succes-fond); color: var(--succes); }
.badge-alerte { background: var(--danger-fond); color: var(--danger); }
.badge-info { background: #f1f5f9; color: #475569; }
.badge-entite { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; }
.badge-entite::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #64748b); }

/* ── Authentification ───────────────────────────────────────────────────── */

.page-auth { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, #1e3a8a 0%, transparent 60%), #0f172a; display: grid; place-items: center; padding: 24px; }
.auth { width: 100%; max-width: 440px; }
.auth .marque { justify-content: center; font-size: 20px; padding-bottom: 22px; }
.auth .carte { padding: 30px; border: 0; box-shadow: var(--ombre-forte); }
.auth h1 { font-size: 20px; margin-bottom: 6px; }
.auth .sous-titre { color: var(--discret); margin: 0 0 20px; }
.auth-pied { color: #64748b; text-align: center; font-size: 12px; margin-top: 18px; }
.etapes { padding-left: 20px; margin: 0 0 18px; }
.etapes li { margin-bottom: 10px; }
.qr { display: block; margin: 12px auto; width: 200px; height: 200px; border-radius: 8px; border: 1px solid var(--ligne); }
.secret { background: #f1f5f9; padding: 3px 8px; border-radius: 6px; user-select: all; word-break: break-all; }
.codes { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.codes code { display: block; background: #f8fafc; border: 1px solid var(--ligne); padding: 8px; border-radius: 8px; text-align: center; font-size: 15px; }

/* ── Nouvelle facture ───────────────────────────────────────────────────── */

.page-facture { display: grid; grid-template-columns: minmax(460px, 600px) minmax(0, 1fr); gap: 24px; align-items: start; }
.entite-titre { display: flex; align-items: center; gap: 12px; }
.entite-titre .pastille-grande { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.section-titre { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--discret); margin: 0 0 14px; }
.section-titre::after { content: ""; flex: 1; height: 1px; background: var(--ligne); }
.lignes { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.lignes th { text-align: left; font-size: 12px; color: var(--discret); font-weight: 600; padding: 0 4px; }
.lignes td { padding: 0 4px; vertical-align: top; }
.lignes .col-pu { width: 118px; }
.lignes .col-qte { width: 76px; }
.lignes .col-sup { width: 36px; }
.lignes textarea { min-height: 40px; overflow: hidden; resize: none; }
.num { text-align: right; }
.recap-form { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 10px; background: var(--survol); border: 1px solid var(--ligne); border-radius: var(--rayon-petit); }
.recap-form strong { font-size: 16px; color: var(--encre); }
.pied-form { position: sticky; bottom: 16px; z-index: 6; display: flex; align-items: center; gap: 16px; margin-top: 4px;
    padding: 12px 12px 12px 18px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--ligne); border-radius: var(--rayon); box-shadow: 0 8px 24px rgba(15, 23, 42, .10); }
.pied-form .pied-total { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.pied-form .pied-total span { font-size: 12px; color: var(--discret); }
.pied-form .pied-total strong { font-size: 18px; color: var(--encre); font-variant-numeric: tabular-nums; }
.pied-form .btn-large { width: auto; padding: 0 22px; }

.panneau-apercu { position: sticky; top: 20px; }
.apercu-barre { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.apercu-barre h2 { flex: 1; }
.etat-apercu { font-size: 12.5px; color: var(--discret); display: inline-flex; align-items: center; gap: 6px; }
.etat-apercu::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.etat-apercu.en-cours::before { background: #f59e0b; }
.etat-apercu.erreur::before { background: var(--danger); }
.apercu-cadre { background: #e8ebef; border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden; }
.apercu-cadre iframe { display: block; width: 100%; height: calc(100vh - 92px); min-height: 560px; border: 0; }

.modale { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .6); display: grid; place-items: center; padding: 24px; }
.modale-boite { background: #fff; border-radius: var(--rayon); box-shadow: var(--ombre-forte); width: min(1000px, 100%); height: min(92vh, 1300px); display: flex; flex-direction: column; overflow: hidden; }
.modale-entete { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--ligne); }
.modale-entete h2 { flex: 1; }
.modale iframe { flex: 1; width: 100%; border: 0; background: #525659; }

/* ── Listes et tableaux ─────────────────────────────────────────────────── */

.resumes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.resume { display: block; text-decoration: none; margin: 0; padding: 16px 18px; position: relative; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.resume::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c, #64748b); }
.resume:hover { border-color: var(--ligne-forte); box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }
.resume-nom { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--discret); font-size: 13px; }
.resume-montant { display: block; font-size: 22px; font-weight: 700; color: var(--encre); margin: 6px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.resume-meta { color: var(--discret); font-size: 12.5px; }
.filtres { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px; }
.filtres select { width: auto; min-width: 150px; }
.recherche { position: relative; flex: 1; min-width: 220px; }
.recherche .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--pale); }
.recherche input { padding-left: 36px; }
.tableau-conteneur { padding: 0; overflow-x: auto; }
.tableau-menus { overflow: visible; }
.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--discret); font-weight: 600; padding: 11px 16px; background: var(--survol); border-bottom: 1px solid var(--ligne); white-space: nowrap; }
.tableau td { padding: 12px 16px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover td { background: #fbfcfd; }
.tableau .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau .actions { white-space: nowrap; text-align: right; }
.tableau .actions form { display: inline; margin: 0; }
.tableau tr.annulee td { color: var(--pale); }
.tableau tr.annulee .mono, .tableau tr.annulee .num { text-decoration: line-through; }
.tableau-compact td { padding: 8px 14px; font-size: 13px; }
.tableau tr.alerte td { background: #fffafa; }
.pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.pagination a { min-width: 36px; padding: 6px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--ligne); text-align: center; text-decoration: none; }
.pagination a.actif { background: var(--encre); border-color: var(--encre); color: #fff; }
.infos { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 18px; }
.infos dt { color: var(--discret); }
.infos dd { margin: 0; font-weight: 500; }
.role-form { display: inline-flex; gap: 6px; align-items: center; }
.role-form select { width: auto; min-height: 32px; padding: 4px 28px 4px 8px; font-size: 13px; }

/* ── Paramètres des entités ─────────────────────────────────────────────── */

.entites-liste { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.entite-carte { display: flex; flex-direction: column; gap: 10px; text-decoration: none; margin: 0; border-top: 4px solid var(--c, #64748b); transition: box-shadow .15s; }
.entite-carte:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }
.entite-carte h2 { font-size: 16px; }
.entite-carte dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.entite-carte dt { color: var(--discret); }
.entite-carte dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rib { display: grid; grid-template-columns: 1fr 1.6fr 1fr 36px; gap: 8px; align-items: start; margin-bottom: 8px; }
.couleurs { display: flex; gap: 18px; align-items: flex-end; }
.couleur-champ { display: flex; align-items: center; gap: 8px; }
.variables code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; }
.pied-sticky { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 0; background: linear-gradient(transparent, var(--fond) 35%); }

/* ── Adaptatif ──────────────────────────────────────────────────────────── */

@media (max-width: 1240px) {
    .page-facture { grid-template-columns: 1fr; }
    .panneau-apercu { position: static; }
    .apercu-cadre iframe { height: 80vh; }
}
@media (max-width: 900px) {
    .barre { position: static; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 4px; }
    .marque { padding: 4px 8px; }
    .nav-titre, .version { display: none; }
    .nav { display: contents; }
    .nav a, .nav button { width: auto; }
    .barre-bas { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; }
    .compte small { display: none; }
    .principal { margin-left: 0; }
    .contenu { padding: 18px 14px 40px; }
}
@media (max-width: 640px) {
    .grille-2, .grille-3, .rib { grid-template-columns: 1fr; }
    .carte { padding: 16px; }
}
.champ-rib { margin-top: 14px; }
.tableau-conteneur > .carte-titre { padding: 18px 20px 4px; margin: 0; }

/* ── Menus d’actions « ⋮ » ─────────────────────────────────────────────── */
.menu { position: relative; display: inline-block; text-align: left; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: #f1f5f9; color: var(--texte); }
.menu-liste { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 250px; padding: 6px;
    background: #fff; border: 1px solid var(--ligne); border-radius: 10px; box-shadow: var(--ombre-forte); white-space: normal; }
.menu-liste.vers-le-haut { top: auto; bottom: calc(100% + 4px); }
.menu-liste a, .menu-liste button:not(.btn) { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px;
    background: none; color: var(--texte); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; text-align: left; }
.menu-liste a:hover, .menu-liste button:not(.btn):hover { background: var(--survol); }
.menu-liste .ico { width: 15px; height: 15px; color: var(--discret); }
.menu-liste .danger, .menu-liste .danger .ico { color: var(--danger); }
.menu-liste form { display: block; margin: 0; }
.menu-sep { height: 1px; background: var(--ligne); margin: 5px 4px; }
.menu-form { display: flex !important; flex-direction: column; gap: 6px; padding: 8px 10px; margin: 2px 0; background: var(--survol); border-radius: 8px; }
.menu-form label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #334155; }
.menu-form input[type="date"] { width: auto; min-height: 32px; padding: 4px 8px; flex: 1; }
.menu-form input[type="text"] { min-height: 32px; padding: 5px 8px; font-size: 13px; }
.sous-ligne { font-size: 12px; color: var(--discret); margin-top: 2px; }
.sous-ligne .ico { width: 11px; height: 11px; }
.badge-envoyee { background: var(--info-fond); color: var(--info); }
.badge-retard { background: var(--alerte-fond); color: var(--alerte); }

/* ── Statistiques ──────────────────────────────────────────────────────── */
.segments { display: inline-flex; padding: 3px; background: #f1f5f9; border-radius: 9px; }
.segments a { padding: 6px 14px; border-radius: 7px; text-decoration: none; font-weight: 600; font-size: 13.5px; color: var(--discret); }
.segments a.actif { background: #fff; color: var(--encre); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 18px 20px; border-top: 3px solid var(--ligne-forte); }
.kpi-ok { border-top-color: #22c55e; } .kpi-attente { border-top-color: #3b82f6; } .kpi-retard { border-top-color: #f59e0b; }
.kpi-lib { font-size: 13px; color: var(--discret); font-weight: 600; }
.kpi-val { font-size: 24px; font-weight: 700; color: var(--encre); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-sous { font-size: 12.5px; color: var(--discret); }
.graphique { display: flex; align-items: flex-end; gap: 10px; height: 260px; padding: 10px 4px 0; border-bottom: 1px solid var(--ligne); }
.colonne-graph { flex: 1; min-width: 28px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.barre-graph { width: 100%; max-width: 54px; min-height: 2px; height: 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
    background: color-mix(in srgb, var(--accent) 28%, #fff); border-radius: 6px 6px 0 0; transition: height .4s ease; }
.barre-payee { width: 100%; height: 0; background: var(--accent); transition: height .4s ease; }
.valeur-graph { font-size: 11px; color: var(--discret); white-space: nowrap; font-variant-numeric: tabular-nums; }
.etiquette-graph { font-size: 12px; color: var(--discret); padding: 4px 0 8px; transform: translateY(100%); margin-top: -18px; }
.grille-stats { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.grille-stats .carte { margin: 0; }
.tableau tfoot td { padding: 12px 16px; font-weight: 700; background: var(--survol); border-top: 1px solid var(--ligne); }
.tableau tr.ligne-vide td { color: var(--pale); }
.texte-retard { color: var(--alerte); font-weight: 600; }
.repartition { padding: 10px 0; border-bottom: 1px solid #eef1f5; }
.repartition:last-child { border-bottom: 0; }
.repartition-tete { display: flex; justify-content: space-between; align-items: center; }
.jauge { height: 8px; background: #f1f5f9; border-radius: 99px; margin: 8px 0 6px; overflow: hidden; }
.jauge-plein { height: 100%; width: 0; background: var(--c, var(--accent)); border-radius: 99px; transition: width .4s ease; }
.repartition-pied { font-size: 12.5px; color: var(--discret); }
@media (max-width: 1100px) { .grille-stats { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .tableau-menus { overflow-x: auto; } .graphique { gap: 4px; } .valeur-graph { display: none; } }
/* Fiches clients et articles (v3.3) */
.page-fiches { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 18px; align-items: start; }
.page-fiches .carte { margin-bottom: 14px; }
.fiche-form { position: sticky; top: 20px; }
.fiche-form .barre-actions { margin-top: 4px; }
.tableau td.multi { font-size: 13px; color: var(--discret); line-height: 1.45; }
.tableau tr.selection td { background: var(--info-fond); }
.case { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--texte); cursor: pointer; margin-top: 12px; line-height: 1.4; }
.case input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.choix-fiche { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--ligne); }
.choix-fiche select { flex: 1 1 240px; max-width: 420px; }
.select-petit { width: auto; max-width: 360px; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.entite-nouvelle { align-items: center; justify-content: center; text-align: center; border: 2px dashed var(--ligne-forte); border-top-width: 2px; background: transparent; box-shadow: none; color: var(--discret); min-height: 180px; }
.entite-nouvelle:hover { border-color: var(--accent); color: var(--accent); background: var(--carte); }
.entite-nouvelle-icone { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--survol); }
.entite-nouvelle-icone .ico { width: 18px; height: 18px; }
@media (max-width: 1100px) { .page-fiches { grid-template-columns: 1fr; } .fiche-form { position: static; } }
