/* Gestion compta — design repris tel quel de la version 2.3.2. */
/* Polices servies par le site (avant : Google Fonts, attendu à chaque ouverture). */
@font-face{font-family:'Manrope';font-style:normal;font-weight:400;font-display:swap;src:url(polices/manrope-latin-400-normal.woff2) format('woff2')}
@font-face{font-family:'Manrope';font-style:normal;font-weight:500;font-display:swap;src:url(polices/manrope-latin-500-normal.woff2) format('woff2')}
@font-face{font-family:'Manrope';font-style:normal;font-weight:600;font-display:swap;src:url(polices/manrope-latin-600-normal.woff2) format('woff2')}
@font-face{font-family:'Manrope';font-style:normal;font-weight:700;font-display:swap;src:url(polices/manrope-latin-700-normal.woff2) format('woff2')}
@font-face{font-family:'Manrope';font-style:normal;font-weight:800;font-display:swap;src:url(polices/manrope-latin-800-normal.woff2) format('woff2')}
@font-face{font-family:'Sora';font-style:normal;font-weight:500;font-display:swap;src:url(polices/sora-latin-500-normal.woff2) format('woff2')}
@font-face{font-family:'Sora';font-style:normal;font-weight:600;font-display:swap;src:url(polices/sora-latin-600-normal.woff2) format('woff2')}
@font-face{font-family:'Sora';font-style:normal;font-weight:700;font-display:swap;src:url(polices/sora-latin-700-normal.woff2) format('woff2')}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;font-display:swap;src:url(polices/ibm-plex-mono-latin-400-normal.woff2) format('woff2')}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:500;font-display:swap;src:url(polices/ibm-plex-mono-latin-500-normal.woff2) format('woff2')}

:root{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
body{margin:0}img{max-width:100%}[hidden]{display:none!important}
/* Mise en page : bordereau trimestriel (résumé) → onglets → registre à lignes alternées « papier listing » + panneau d'aperçu de la pièce à droite */
:root {
  --paper: #f2f4f8;
  --sheet: #ffffff;
  --band: #edf0f6;
  --ink: #142033;
  --muted: #5a6577;
  --rule: #d4dbe7;
  --accent: #1d4ea6;
  --accent-ink: #ffffff;
  --accent-soft: #e2eaf7;
  --head-bg: #0f1c33;
  --head-fg: #e9eef7;
  --head-muted: #9fb0c9;
  --ok: #2b7a4b;   --ok-bg: #e2f1e7;
  --warn: #9a6210; --warn-bg: #faefd9;
  --bad: #ad372b;  --bad-bg: #f8e2de;
  --info: #2c5b88; --info-bg: #e2ebf5;
  --neutral: #4f5e62; --neutral-bg: #e9eeec;
  --shadow: 0 1px 2px rgba(20, 36, 43, .06), 0 8px 24px rgba(20, 36, 43, .06);
  --f-display: "Syne", "Avenir Next", "Segoe UI", sans-serif;
  --f-body: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c121c; --sheet: #131c2a; --band: #172131; --ink: #e3e9f3; --muted: #93a0b4; --rule: #243246;
    --accent: #7ea6f0; --accent-ink: #071733; --accent-soft: #18294a;
    --head-bg: #080e18; --head-fg: #e3e9f3; --head-muted: #8a9ab2;
    --ok: #6cc18c; --ok-bg: #15301f; --warn: #e2aa4c; --warn-bg: #33270f; --bad: #ea7d70; --bad-bg: #3b1d19;
    --info: #82b0e2; --info-bg: #172739; --neutral: #a8b6b6; --neutral-bg: #1f2b2e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0c121c; --sheet: #131c2a; --band: #172131; --ink: #e3e9f3; --muted: #93a0b4; --rule: #243246;
  --accent: #7ea6f0; --accent-ink: #071733; --accent-soft: #18294a;
  --head-bg: #080e18; --head-fg: #e3e9f3; --head-muted: #8a9ab2;
  --ok: #6cc18c; --ok-bg: #15301f; --warn: #e2aa4c; --warn-bg: #33270f; --bad: #ea7d70; --bad-bg: #3b1d19;
  --info: #82b0e2; --info-bg: #172739; --neutral: #a8b6b6; --neutral-bg: #1f2b2e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.45; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--head-bg); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.wrap { max-width: 1440px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.eyebrow { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding-block: 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background:
    repeating-linear-gradient(180deg, transparent 0 27px, var(--rule) 27px 28px),
    var(--paper); }
.login-card { width: 100%; max-width: 420px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow); padding: 28px 26px 24px; display: grid; gap: 18px; }
.login-card h1 { font-family: var(--f-display); font-size: 26px; line-height: 1.1; margin: 0; text-wrap: balance; }
.login-card p { margin: 0; color: var(--muted); }
.champ { display: grid; gap: 6px; }
.champ label { font-size: 13px; font-weight: 600; }
.champ input { border: 1px solid var(--rule); background: var(--paper); border-radius: var(--r); padding: 11px 12px; }
.champ #code { font-family: var(--f-mono); letter-spacing: .12em; font-size: 17px; }
.login-err { color: var(--bad); font-size: 13.5px; min-height: 1em; }
.login-tete { display: flex; align-items: center; gap: 14px; }
.login-logo { width: 64px; height: 64px; border-radius: 14px; flex: none; box-shadow: 0 1px 3px rgba(15, 28, 51, .18); background: #fff; }
.aide { font-size: 13px; color: var(--muted); margin: 0; }
.login-liens { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lien { background: none; border: 0; padding: 0; color: var(--accent); font-size: 13.5px; text-decoration: underline; text-underline-offset: 2px; }
.champ input[readonly] { color: var(--muted); }
.logo-tuile { width: 38px; height: 38px; border-radius: 9px; background: #fff; flex: none; display: block; }
.pin-band { background: var(--bad-bg); color: var(--bad); border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.pin-band .wrap { padding-block: 8px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pin-band button { border: 1px solid currentColor; background: none; color: inherit; border-radius: 6px; padding: 3px 10px; font-size: 13px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r); border: 1px solid var(--rule); background: var(--sheet); padding: 8px 14px; font-weight: 500; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--head-muted); }
.btn-ghost:hover { color: var(--head-fg); border-color: transparent; }

/* ---------- En-tête ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--head-bg); color: var(--head-fg); }
.topbar-in { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; padding-block: 12px; }
.marque { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.logo { font-family: var(--f-display); font-weight: 700; font-size: 18px; letter-spacing: .06em; border: 1.5px solid var(--head-fg); border-radius: 6px; padding: 2px 7px; }
.marque-txt { font-family: var(--f-display); font-weight: 600; font-size: 15px; line-height: 1.15; }
.marque-txt small { display: block; font-family: var(--f-body); font-weight: 400; font-size: 12px; color: var(--head-muted); }
.periode { display: flex; align-items: center; gap: 8px; }
.periode select { background: transparent; border: 1px solid rgba(255,255,255,.22); color: var(--head-fg); border-radius: 6px; padding: 6px 8px; font-family: var(--f-mono); }
.periode select option { color: #14242b; }
.seg { display: inline-flex; border: 1px solid rgba(255,255,255,.22); border-radius: 6px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--head-muted); padding: 6px 12px; font-family: var(--f-mono); font-weight: 500; }
.seg button + button { border-left: 1px solid rgba(255,255,255,.14); }
.seg button[aria-pressed="true"] { background: var(--head-fg); color: var(--head-bg); }
.who { display: flex; align-items: center; gap: 8px; }
.chip-role { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 3px 10px; color: var(--head-muted); }
.demo-band { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.demo-band .wrap { padding-block: 8px; }

/* ---------- Bordereau ---------- */
.bordereau { margin-top: 20px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: hidden; }
.bcell { padding: 14px 16px 15px; display: grid; gap: 4px; align-content: start; border-right: 1px solid var(--rule); min-width: 0; }
.bcell:last-child { border-right: 0; }
.bcell .v { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 500; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcell .v small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.bcell .s { font-size: 12.5px; color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--neutral-bg); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.meter.warn i { background: var(--warn); }
.meter.bad i { background: var(--bad); }

/* ---------- Onglets & actions ---------- */
.onglets { display: flex; gap: 4px; margin-top: 22px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.onglets button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px 11px; font-weight: 500; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.onglets button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.badge { font-family: var(--f-mono); font-size: 11.5px; background: var(--neutral-bg); color: var(--neutral); border-radius: 999px; padding: 1px 7px; }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.barre { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-block: 14px; }
.recherche { flex: 1 1 220px; min-width: 0; max-width: 360px; position: relative; }
.recherche input { width: 100%; border: 1px solid var(--rule); background: var(--sheet); border-radius: var(--r); padding: 8px 12px 8px 34px; }
.recherche svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.barre .espace { flex: 1 1 auto; }
.sel-info { font-size: 13px; color: var(--muted); }

/* ---------- Zone liste + aperçu ---------- */
.zone { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 34%); gap: 18px; align-items: start; padding-bottom: 40px; }
.carte { background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; min-width: 0; }
.tbl-wrap { overflow-x: auto; }
table.reg { width: 100%; border-collapse: collapse; font-size: 14px; }
.reg th { text-align: left; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 11px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; background: var(--sheet); }
.reg td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.reg tbody tr:nth-child(even) td { background: var(--band); }
.reg tbody tr { cursor: pointer; }
.reg tbody tr:hover td { background: var(--accent-soft); }
.reg tbody tr.actif td { background: var(--accent-soft); }
.reg tbody tr.actif td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.reg .r { text-align: right; }
.reg td.num { white-space: nowrap; }
.reg tfoot td { font-weight: 600; border-bottom: 0; padding-block: 12px; }
.reg .sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.reg .ck { width: 34px; }
.reg input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.tiers { font-weight: 500; }
.vide { padding: 40px 20px; text-align: center; color: var(--muted); }
.trou { color: var(--bad); font-size: 13px; font-weight: 500; white-space: nowrap; }
.btn-piece { border: 1px solid var(--rule); background: var(--sheet); border-radius: 6px; padding: 4px 8px; display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 12.5px; }
.btn-piece svg { width: 14px; height: 14px; }

.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-ok { background: var(--ok-bg); color: var(--ok); }
.p-warn { background: var(--warn-bg); color: var(--warn); }
.p-bad { background: var(--bad-bg); color: var(--bad); }
.p-info { background: var(--info-bg); color: var(--info); }
.p-neutral { background: var(--neutral-bg); color: var(--neutral); }
.tag { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--rule); border-radius: 4px; padding: 0 5px; color: var(--muted); margin-left: 6px; }

.apercu { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 78px); height: calc(100vh - 100px); min-height: 420px; display: flex; flex-direction: column; overflow: hidden; }
.ap-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--rule); display: grid; gap: 10px; }
.ap-titre { display: flex; align-items: start; gap: 10px; }
.ap-titre h2 { font-family: var(--f-display); font-size: 17px; line-height: 1.2; margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ap-fermer { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); padding: 0 4px; display: none; }
.ap-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; font-size: 13px; }
.ap-meta div { min-width: 0; }
.ap-meta b { display: block; font-family: var(--f-mono); font-weight: 500; font-size: 14px; }
.ap-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ap-doc { flex: 1; min-height: 0; background: var(--band); display: grid; place-items: center; overflow: auto; }
.ap-doc iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.ap-doc img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ap-vide { padding: 30px; text-align: center; color: var(--muted); max-width: 300px; display: grid; gap: 10px; justify-items: center; }
.ap-vide svg { width: 40px; height: 40px; opacity: .5; }
.spin { width: 26px; height: 26px; border: 3px solid var(--rule); border-top-color: var(--accent); border-radius: 50%; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* fausse facture (démo) */
.fausse { width: min(92%, 380px); background: #fff; color: #1b2a30; border-radius: 4px; box-shadow: 0 6px 24px rgba(0,0,0,.15); padding: 22px 22px 26px; font-size: 12px; display: grid; gap: 12px; margin-block: 20px; }
.fausse h4 { margin: 0; font-family: var(--f-display); font-size: 16px; }
.fausse .lignes { border-top: 1px solid #d9e0de; border-bottom: 1px solid #d9e0de; padding-block: 8px; display: grid; gap: 4px; }
.fausse .lg { display: flex; justify-content: space-between; gap: 12px; font-family: var(--f-mono); }
.fausse .tot { font-weight: 600; font-size: 13px; }
.fausse .demo-mark { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #9a6210; }

/* ---------- TGC ---------- */
.tgc-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 16px; }
.tgc-bloc { border: 1px solid var(--rule); border-radius: 10px; padding: 16px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.tgc-bloc h3 { margin: 0; font-family: var(--f-display); font-size: 16px; }
.tgc-l { display: flex; justify-content: space-between; gap: 12px; padding-block: 6px; border-bottom: 1px dashed var(--rule); font-size: 14px; }
.tgc-l:last-child { border-bottom: 0; }
.tgc-l .num { white-space: nowrap; }
.tgc-total { font-family: var(--f-mono); font-size: 24px; font-weight: 500; }
.note { font-size: 13px; color: var(--muted); padding: 0 16px 16px; max-width: 75ch; }

/* ---------- Contrôle (admin) ---------- */
.ctrl { display: grid; gap: 16px; padding-bottom: 40px; }
.ctrl-haut { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.ctrl-bloc { padding: 16px 18px; display: grid; gap: 12px; align-content: start; }
.ctrl-bloc h3 { margin: 0; font-family: var(--f-display); font-size: 16px; display: flex; align-items: center; gap: 8px; }
.ctrl-bloc h3 .pill, .ctrl-bloc h3 .badge { font-family: var(--f-body); }
.depots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.depot { border: 1.5px dashed var(--rule); border-radius: 10px; padding: 14px; display: grid; gap: 6px; text-align: left; background: var(--paper); }
.depot:hover { border-color: var(--accent); }
.depot strong { font-size: 14px; }
.depot span { font-size: 12.5px; color: var(--muted); }
.depot input { display: none; }
.statuts { display: grid; gap: 8px; }
.statut-l { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; padding-block: 4px; border-bottom: 1px solid var(--rule); }
.statut-l:last-child { border-bottom: 0; }
.liste { display: grid; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 12px 0; border-top: 1px solid var(--rule); align-items: start; }
.item:first-child { border-top: 0; }
.item .t { font-weight: 500; overflow-wrap: anywhere; }
.item .d { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.item .m { font-family: var(--f-mono); white-space: nowrap; text-align: right; }
.item .act { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.item .piste { grid-column: 1 / -1; font-size: 13px; background: var(--warn-bg); color: var(--warn); border-radius: 6px; padding: 6px 10px; }
.form-inline { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--band); border-radius: 8px; padding: 10px; }
.form-inline input, .form-inline select { flex: 1 1 220px; min-width: 0; border: 1px solid var(--rule); background: var(--sheet); border-radius: 6px; padding: 6px 10px; }
.ok-msg { color: var(--ok); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.ctrl-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* ---------- Synthèses (par client, par nature) ---------- */
.panneau { margin-bottom: 14px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.panneau-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.panneau-tete h3 { margin: 0; font-family: var(--f-display); font-size: 15px; }
.legende { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.b-ok, .b-accent { background: var(--accent); }
.b-warn { background: var(--warn); }
.b-okc { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.b-neutre { background: var(--neutral-bg); box-shadow: inset 0 0 0 1px var(--rule); }
.panneau-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 24px; }
.pl { display: grid; gap: 5px; min-width: 0; }
.pl-btn { text-align: left; background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; margin: -6px -8px; color: inherit; }
.pl-btn:hover { border-color: var(--rule); }
.pl-btn.actif { border-color: var(--accent); background: var(--accent-soft); }
.pl-t { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.pl-t .tiers { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pl-t .num { white-space: nowrap; }
.pl-s { font-size: 12px; color: var(--muted); }
.barre-h { height: 8px; border-radius: 4px; background: var(--neutral-bg); display: flex; overflow: hidden; }
.barre-h i { display: block; height: 100%; }
.seg-c { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--sheet); }
.seg-c button { border: 0; background: none; padding: 7px 12px; font-size: 13.5px; color: var(--muted); }
.seg-c button + button { border-left: 1px solid var(--rule); }
.seg-c button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.chip-filtre { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; }
.chip-filtre button { border: 0; background: none; font-size: 17px; line-height: 1; color: var(--muted); padding: 0 4px; }
.soldes { display: grid; grid-template-columns: repeat(3, auto) minmax(140px, 1fr); gap: 10px 28px; align-items: end; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.soldes > div { display: grid; gap: 2px; min-width: 0; }
.soldes b { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-weight: 500; font-size: 18px; white-space: nowrap; }
.soldes .neg { color: var(--bad); }
.soldes .pos { color: var(--ok); }
.spark svg { width: 100%; height: 48px; display: block; }
.spark .ligne { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark .aire { fill: var(--accent-soft); }
.spark .pt { fill: var(--accent); }
.cat { font-family: var(--f-body); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.histo-wrap { border-top: 1px solid var(--rule); padding-top: 14px; }
.histo { width: 100%; max-width: 760px; min-width: 520px; height: auto; display: block; }
.histo .axe { stroke: var(--rule); }
.histo .bar { fill: var(--neutral-bg); stroke: var(--rule); }
.histo .bar-ok { fill: var(--accent-soft); stroke: var(--accent); }
.histo .bar-cur { fill: var(--accent); }
.histo .val { font: 500 12px var(--f-mono); fill: var(--ink); }
.histo .lab { font: 500 12px var(--f-mono); fill: var(--muted); }
.histo .lab2 { font: 400 11px var(--f-body); fill: var(--muted); }
.tgc-valid { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 16px 16px; }
.tgc-valid input { flex: 1 1 220px; min-width: 0; max-width: 360px; border: 1px solid var(--rule); background: var(--paper); border-radius: 6px; padding: 6px 10px; }
@media (max-width: 720px) { .soldes { grid-template-columns: 1fr 1fr; } .spark { grid-column: 1 / -1; } }

/* ---------- Toast / progression ---------- */
.item .act select { border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 6px; padding: 5px 8px; font-size: 14px; max-width: 100%; }
.filtres-fac { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.filtres-fac select { border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); border-radius: var(--r); padding: 8px 10px; font-size: 14px; max-width: 100%; }
.fac-kpi { margin-bottom: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .fac-kpi { grid-template-columns: 1fr 1fr; } }
.fac-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.fac-grille .carte { padding: 14px 16px; }
.ages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; font-size: 13px; }
.ages > div { display: grid; gap: 2px; }
.ages b { font-family: var(--f-mono); font-weight: 500; }
.pastille { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.b-ok { background: var(--accent); } .b-warn { background: #d9a441; } .b-bad { background: #d4664f; } .b-bad2 { background: #9e2f22; }
table.reg.mini td, table.reg.mini th { padding-block: 7px; }
tr[data-fclient] { cursor: pointer; }
body.vue-factures #seg-t, body.vue-factures #sel-annee { opacity: .45; }
@media (max-width: 860px) { .fac-grille { grid-template-columns: 1fr; } .ages { grid-template-columns: 1fr 1fr; } }
.sep-onglets { width: 1px; background: var(--rule); margin: 8px 6px; flex: none; }
.sel-ges { border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); border-radius: var(--r); padding: 8px 10px; font-size: 14px; }
.fac-kpi.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .fac-kpi.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .fac-kpi.k6 { grid-template-columns: 1fr 1fr; } }
.bcell .v.neg, td.neg, .neg b { color: var(--bad); }
.graphe { width: 100%; overflow-x: auto; }
.graphe svg { width: 100%; min-width: 520px; height: auto; display: block; max-height: 300px; }
.g-grille { stroke: var(--rule); stroke-width: 1; }
.g-axe { font-size: 11px; fill: var(--muted); font-family: var(--f-body); }
.g-a { fill: var(--accent); } .g-b { fill: var(--accent-soft); } .g-c { fill: #2f8f6f; } .g-d { fill: #d4664f; }
.g-ligne { stroke: #d9a441; stroke-width: 2.5; } .g-ligne-pt { fill: #d9a441; }
.g-moy { stroke: var(--ink); stroke-dasharray: 5 4; stroke-width: 1.5; opacity: .6; }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legende i.g-a { background: var(--accent); } .legende i.g-b { background: var(--accent-soft); } .legende i.g-c { background: #2f8f6f; } .legende i.g-d { background: #d4664f; } .legende i.g-ligne-pt { background: #d9a441; border-radius: 50%; }
.legende i.g-moy-l { height: 0; border-top: 2px dashed var(--ink); border-radius: 0; opacity: .6; }
.cca-solde { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; background: var(--accent-soft); border-radius: 8px; padding: 12px 14px; }
.cca-solde b { font-family: var(--f-mono); font-size: 20px; font-weight: 500; }
.cca-det { display: grid; gap: 4px; font-size: 13.5px; }
.cca-det div { display: flex; justify-content: space-between; } .cca-det b { font-family: var(--f-mono); font-weight: 500; }
.cca-liste { max-height: 260px; overflow-y: auto; }
.opts { display: flex; gap: 8px 22px; flex-wrap: wrap; }
.prev-det { display: grid; gap: 6px; }
.prev-det details { border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px; }
.prev-det summary { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 8px; cursor: pointer; font-size: 14px; }
.prev-det summary span { font-family: var(--f-mono); font-size: 13px; text-align: right; }
.prev-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.prev-cols .pl { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; border-bottom: 1px dashed var(--rule); }
.prev-cols .pl b { font-family: var(--f-mono); font-weight: 500; white-space: nowrap; }
table.grille-c th.cel, table.grille-c td.cel { width: 46px; text-align: center; padding: 6px 2px; }
td.cel span { display: inline-grid; place-items: center; min-width: 34px; height: 26px; border-radius: 6px; font-size: 12px; font-family: var(--f-mono); }
td.c-paye span { background: var(--ok-bg); color: var(--ok); font-family: var(--f-body); font-size: 14px; }
td.c-att span { background: var(--warn-bg); color: var(--warn); }
td.c-manque span { border: 1.5px dashed var(--bad); color: var(--bad); }
td.c-futur::after { content: ''; display: inline-block; width: 30px; height: 4px; border-radius: 2px; background: var(--band); }
td.cel[data-key] { cursor: pointer; }
tr.inactif { opacity: .55; }
.legende-c { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 12.5px; margin: 0 0 10px; }
.legende-c i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }
.legende-c i.c-paye { background: var(--ok-bg); } .legende-c i.c-att { background: var(--warn-bg); } .legende-c i.c-manque { border: 1.5px dashed var(--bad); } .legende-c i.c-futur { background: var(--band); }
.btn-danger { color: var(--bad); border-color: currentColor; }
.modal-actions .espace { flex: 1; }
.mini-filtre.large { width: 100%; }
.aff-liste.seul-libres .aff[data-libre="0"] { display: none; }
#form2 textarea { border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14.5px; resize: vertical; width: 100%; }
@media (max-width: 560px) { .prev-cols { grid-template-columns: 1fr; } .prev-det summary { grid-template-columns: 1fr 1fr; } }
.vue-band { background: var(--accent-soft); color: var(--accent); border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.vue-band .wrap { padding-block: 8px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.vue-band button { border: 1px solid currentColor; background: none; color: inherit; border-radius: 6px; padding: 3px 10px; font-size: 13px; }
.synthese { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.dl-tout .btn { white-space: normal; text-align: left; height: auto; min-height: 36px; }
.dl-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dl-carte { padding: 16px; display: grid; gap: 14px; align-content: space-between; }
.dl-n { font-family: var(--f-display); font-size: 22px; margin: 4px 0 2px; }
.dl-tout { display: flex; gap: 10px; flex-wrap: wrap; }
.pt > span { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pt-ok, .pt-ko { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-weight: 700; font-size: 12px; flex: none; }
.pt-ok { background: var(--ok-bg); color: var(--ok); } .pt-ok svg { width: 12px; height: 12px; }
.pt-ko { background: var(--warn-bg); color: var(--warn); }
.tgc-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; border-top: 1px solid var(--rule); padding-top: 12px; font-size: 13px; color: var(--muted); }
.tgc-mini b { display: block; font-family: var(--f-mono); font-weight: 500; font-size: 16px; color: var(--ink); }
@media (max-width: 760px) { .dl-grille { grid-template-columns: 1fr; } .tgc-mini { grid-template-columns: 1fr 1fr; } }
.note-hors { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--rule); background: var(--warn-bg); color: var(--warn); font-size: 13.5px; }
.maj { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--head-muted); white-space: nowrap; }
.maj[hidden] { display: none; }
.ecr { background: rgba(255,255,255,.08); border-radius: 999px; padding: 4px 10px; color: var(--head-fg); }
.ecr.fait svg { width: 14px; height: 14px; color: #6fd3a6; }
.spin-mini { width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.25); border-top-color: var(--head-fg); border-radius: 50%; animation: tourne .8s linear infinite; display: inline-block; }
.depot { cursor: pointer; }
.depot strong { display: inline-flex; align-items: center; gap: 7px; }
.depot strong svg { width: 17px; height: 17px; color: var(--accent); }
.depot.survol { border-color: var(--accent); background: var(--accent-soft); }
.depots-banque { padding: 14px; border-bottom: 1px solid var(--rule); }
.ap-panneau { align-self: start; justify-self: stretch; padding: 16px; display: grid; gap: 14px; text-align: left; }
.ap-bloc { display: grid; gap: 8px; }
.ap-bloc.ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.ap-panneau .piste { font-size: 13px; background: var(--warn-bg); color: var(--warn); border-radius: 6px; padding: 8px 10px; }
.cands { display: grid; gap: 8px; }
.cand { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; border: 1px solid var(--rule); border-radius: 8px; padding: 9px 10px; background: var(--sheet); }
.cand .t { font-weight: 500; overflow-wrap: anywhere; }
.cand .d { font-size: 12.5px; color: var(--muted); }
.cand .m { font-family: var(--f-mono); white-space: nowrap; }
.cand .act { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag-ok { font-size: 11px; background: var(--ok-bg); color: var(--ok); border-radius: 4px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; font-weight: 500; }
#vue-cand { display: grid; place-items: center; background: var(--band); border-radius: 8px; min-height: 0; }
#vue-cand:empty { display: none; }
#vue-cand img { max-width: 100%; max-height: 420px; object-fit: contain; }
#vue-cand iframe { width: 100%; height: 420px; border: 0; background: #fff; }
.lien-act { color: var(--accent); }
.tag-src { display: inline-block; font-size: 11px; border: 1px solid var(--rule); color: var(--muted); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }
.sub.com { font-style: italic; }
.ap-doc.ap-gestion { display: block; overflow-y: auto; background: var(--sheet); }
.ap-etat { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ap-etat .tag-src { margin-left: 0; }
.ap-sec { display: grid; gap: 8px; border-top: 1px solid var(--rule); padding-top: 12px; }
.sec-tete { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mini-filtre { border: 1px solid var(--rule); background: var(--paper); border-radius: 6px; padding: 5px 8px; font-size: 14px; width: 150px; }
.aff-liste { display: grid; gap: 4px; max-height: 300px; overflow-y: auto; }
.aff { display: flex; align-items: center; gap: 6px; border: 1px solid var(--rule); border-radius: 7px; padding: 6px 8px; background: var(--sheet); }
.aff[hidden] { display: none; }
.aff label { flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 8px; align-items: center; cursor: pointer; min-width: 0; }
.aff input { grid-row: span 2; }
.aff .t { font-weight: 500; font-size: 13.5px; overflow-wrap: anywhere; }
.aff .d { grid-column: 2; font-size: 12px; color: var(--muted); }
.aff .m { grid-column: 3; grid-row: 1 / span 2; font-family: var(--f-mono); font-size: 13px; white-space: nowrap; }
.aff-total { font-size: 13px; min-height: 1em; }
.ok-ecart { color: var(--ok); font-weight: 600; }
.ap-panneau textarea { border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 15px; resize: vertical; width: 100%; }
.modal { position: fixed; inset: 0; z-index: 54; background: rgba(10, 18, 20, .5); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-carte { background: var(--sheet); border-radius: 14px; width: min(660px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow); display: grid; gap: 14px; padding: 20px; }
.modal-tete { display: flex; align-items: start; gap: 10px; }
.modal-tete h2 { font-family: var(--f-display); font-size: 20px; margin: 0; flex: 1; }
.modal-tete button { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); padding: 0 4px; }
.grille-dep { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grille-dep .plein { grid-column: 1 / -1; }
.f { display: grid; gap: 5px; font-size: 13px; min-width: 0; }
.f > span { font-weight: 600; }
.f input, .f select { border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 9px 10px; font-size: 16px; min-width: 0; width: 100%; }
.zone-piece { border: 1.5px dashed var(--rule); border-radius: 10px; padding: 12px; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center; background: var(--paper); cursor: pointer; }
.zone-piece:hover, .zone-piece.survol { border-color: var(--accent); }
.zone-piece .vignette { width: 76px; height: 76px; border-radius: 8px; background: var(--band); display: grid; place-items: center; overflow: hidden; color: var(--accent); }
.zone-piece .vignette img { width: 100%; height: 100%; object-fit: cover; }
.zone-piece .vignette svg { width: 30px; height: 30px; }
.zone-piece strong { display: block; font-size: 14px; }
.zone-piece span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.zone-piece input { display: none; }
.taux-multi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.taux-multi[hidden] { display: none; }
.calc-tgc { font-family: var(--f-mono); font-size: 13px; color: var(--muted); min-height: 1em; }
.lien-banque { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }
.check { display: flex; gap: 8px; align-items: start; font-size: 14px; }
.check input { margin-top: 3px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 560px) {
  .grille-dep { grid-template-columns: 1fr; }
  .taux-multi { grid-template-columns: 1fr 1fr; }
  .modal { padding: 0; place-items: end stretch; }
  .modal-carte { border-radius: 14px 14px 0 0; max-height: 94vh; width: 100%; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .maj span { display: none; }
}
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 60; background: var(--ink); color: var(--paper); border-radius: 10px; padding: 11px 16px; font-size: 14px; box-shadow: var(--shadow); max-width: min(560px, calc(100vw - 32px)); }
.toast.err { background: var(--bad); color: #fff; }
.voile { position: fixed; inset: 0; z-index: 55; background: rgba(10, 18, 20, .45); display: grid; place-items: center; padding: 16px; }
.voile-carte { background: var(--sheet); border-radius: 12px; padding: 22px; width: min(420px, 100%); display: grid; gap: 12px; box-shadow: var(--shadow); }
.voile-carte .meter { height: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .zone { grid-template-columns: minmax(0, 1fr); }
  .apercu { display: none; position: fixed; inset: 0; z-index: 50; height: auto; min-height: 0; border-radius: 0; border: 0;
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .apercu.ouvert { display: flex; }
  .ap-fermer { display: block; }
  .bordereau { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bcell:nth-child(3n) { border-right: 0; }
  .bcell:nth-child(-n+3) { border-bottom: 1px solid var(--rule); }
  .ctrl-haut, .ctrl-col { grid-template-columns: minmax(0, 1fr); }
  .tgc-grille { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .hide-sm { display: none; }
  .bordereau { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bcell { border-bottom: 1px solid var(--rule); }
  .bcell:nth-child(3n) { border-right: 1px solid var(--rule); }
  .bcell:nth-child(2n) { border-right: 0; }
  .bcell:nth-last-child(-n+2) { border-bottom: 0; }
  .bcell .v { font-size: 17px; }
  .depots { grid-template-columns: 1fr; }
  .marque-txt small { display: none; }
  .barre .btn span.long { display: none; }
  .reg td, .reg th { padding: 9px 7px; }
}

/* =====================================================================
   THÈME GLACE (v1.8) : cobalt, argent, blanc — cartes en verre, relief,
   micro-interactions courtes (180 ms), réduction des animations respectée
   ===================================================================== */
:root {
  --paper: #eef3fa; --sheet: #ffffff; --band: #f3f6fb; --ink: #0e1a33; --muted: #4f5d75; --rule: #d6deea;
  --accent: #1747c9; --accent-ink: #ffffff; --accent-soft: #e3ecff;
  --head-bg: rgba(255, 255, 255, .74); --head-fg: #0e1a33; --head-muted: #4f5d75;
  --ok: #136f48; --ok-bg: #e0f3e9; --warn: #964a06; --warn-bg: #fff0e0; --bad: #b0362a; --bad-bg: #fbe5e1;
  --info: #1d56a8; --info-bg: #e3ecff; --neutral: #4a5872; --neutral-bg: #e8edf5;
  --f-display: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 12px; --t: 180ms; --ease: cubic-bezier(.2, .7, .3, 1);
  --fond1: #f4f7fc; --fond2: #e5ecf6; --halo1: #d9e5fb; --halo2: #e3eaf6;
  --verre: linear-gradient(180deg, rgba(255, 255, 255, .93), rgba(255, 255, 255, .78));
  --arete: linear-gradient(155deg, #ffffff 0%, #c3cddc 42%, #f4f6fa 68%, #b7c2d4 100%);
  --reflet: inset 0 1px 0 rgba(255, 255, 255, .95);
  --ombre-carte: 0 18px 40px -26px rgba(13, 42, 122, .42), 0 3px 8px -3px rgba(13, 42, 122, .08);
  --ombre-forte: 0 26px 46px -26px rgba(13, 42, 122, .5), 0 4px 10px -3px rgba(13, 42, 122, .12);
  --creux: rgba(222, 230, 242, .78); --creux-ombre: inset 0 1px 3px rgba(13, 42, 122, .12);
  --fondu: rgba(250, 252, 254, .96);
  --a-bg: linear-gradient(180deg, #ffffff 0%, #eef2f8 60%, #e2e8f1 100%); --a-fg: #123a9c; --a-bord: #bcc6d6; --a-bord-h: #dce3ee;
  --a-ombre: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(120, 135, 160, .14), 0 6px 14px -10px rgba(13, 42, 122, .5), 0 1px 2px rgba(13, 42, 122, .08);
  --a-ombre-h: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(120, 135, 160, .1), 0 14px 24px -14px rgba(13, 42, 122, .55), 0 2px 5px rgba(13, 42, 122, .08);
  --a-ombre-p: inset 0 3px 6px rgba(60, 80, 120, .22), 0 1px 2px rgba(13, 42, 122, .08);
  --anneau: #ffffff;
  --shadow: 0 18px 40px -26px rgba(13, 42, 122, .42), 0 3px 8px -3px rgba(13, 42, 122, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a1430; --sheet: #121f42; --band: #15244a; --ink: #e6ecf8; --muted: #a6b3cd; --rule: #283a64;
    --accent: #7aa0ff; --accent-ink: #071733; --accent-soft: #1b2d5e;
    --head-bg: rgba(12, 24, 56, .78); --head-fg: #e6ecf8; --head-muted: #a6b3cd;
    --ok: #6fd3a3; --ok-bg: #12352a; --warn: #f0b264; --warn-bg: #3a2810; --bad: #f08a7c; --bad-bg: #3d1d1a;
    --info: #8db0ff; --info-bg: #1b2d5e; --neutral: #b4c0d6; --neutral-bg: #1f2c4e;
    --fond1: #0b1633; --fond2: #081026; --halo1: #18306e; --halo2: #13244f;
    --verre: linear-gradient(180deg, rgba(24, 39, 80, .94), rgba(17, 30, 64, .9));
    --arete: linear-gradient(155deg, rgba(170, 195, 245, .5) 0%, rgba(60, 82, 135, .55) 42%, rgba(150, 175, 230, .32) 68%, rgba(52, 72, 122, .6) 100%);
    --reflet: inset 0 1px 0 rgba(255, 255, 255, .08);
    --ombre-carte: 0 20px 40px -24px rgba(0, 0, 0, .65), 0 3px 8px -3px rgba(0, 0, 0, .3);
    --ombre-forte: 0 28px 50px -24px rgba(0, 0, 0, .75), 0 4px 10px -3px rgba(0, 0, 0, .35);
    --creux: rgba(8, 16, 40, .6); --creux-ombre: inset 0 1px 3px rgba(0, 0, 0, .45);
    --fondu: rgba(17, 30, 64, .95);
    --a-bg: linear-gradient(180deg, #26386a 0%, #1d2d58 60%, #18264c 100%); --a-fg: #dbe5ff; --a-bord: #3a4f86; --a-bord-h: #5a72b0;
    --a-ombre: inset 0 1px 0 rgba(255, 255, 255, .1), 0 6px 14px -10px rgba(0, 0, 0, .7);
    --a-ombre-h: inset 0 1px 0 rgba(255, 255, 255, .12), 0 14px 24px -14px rgba(0, 0, 0, .8);
    --a-ombre-p: inset 0 3px 6px rgba(0, 0, 0, .45);
    --anneau: #0a1430;
    --shadow: 0 20px 40px -24px rgba(0, 0, 0, .65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0a1430; --sheet: #121f42; --band: #15244a; --ink: #e6ecf8; --muted: #a6b3cd; --rule: #283a64;
  --accent: #7aa0ff; --accent-ink: #071733; --accent-soft: #1b2d5e;
  --head-bg: rgba(12, 24, 56, .78); --head-fg: #e6ecf8; --head-muted: #a6b3cd;
  --ok: #6fd3a3; --ok-bg: #12352a; --warn: #f0b264; --warn-bg: #3a2810; --bad: #f08a7c; --bad-bg: #3d1d1a;
  --info: #8db0ff; --info-bg: #1b2d5e; --neutral: #b4c0d6; --neutral-bg: #1f2c4e;
  --fond1: #0b1633; --fond2: #081026; --halo1: #18306e; --halo2: #13244f;
  --verre: linear-gradient(180deg, rgba(24, 39, 80, .94), rgba(17, 30, 64, .9));
  --arete: linear-gradient(155deg, rgba(170, 195, 245, .5) 0%, rgba(60, 82, 135, .55) 42%, rgba(150, 175, 230, .32) 68%, rgba(52, 72, 122, .6) 100%);
  --reflet: inset 0 1px 0 rgba(255, 255, 255, .08);
  --ombre-carte: 0 20px 40px -24px rgba(0, 0, 0, .65), 0 3px 8px -3px rgba(0, 0, 0, .3);
  --ombre-forte: 0 28px 50px -24px rgba(0, 0, 0, .75), 0 4px 10px -3px rgba(0, 0, 0, .35);
  --creux: rgba(8, 16, 40, .6); --creux-ombre: inset 0 1px 3px rgba(0, 0, 0, .45);
  --fondu: rgba(17, 30, 64, .95);
  --a-bg: linear-gradient(180deg, #26386a 0%, #1d2d58 60%, #18264c 100%); --a-fg: #dbe5ff; --a-bord: #3a4f86; --a-bord-h: #5a72b0;
  --a-ombre: inset 0 1px 0 rgba(255, 255, 255, .1), 0 6px 14px -10px rgba(0, 0, 0, .7);
  --a-ombre-h: inset 0 1px 0 rgba(255, 255, 255, .12), 0 14px 24px -14px rgba(0, 0, 0, .8);
  --a-ombre-p: inset 0 3px 6px rgba(0, 0, 0, .45);
  --anneau: #0a1430;
  --shadow: 0 20px 40px -24px rgba(0, 0, 0, .65);
  color-scheme: dark;
}

body {
  font-size: 15px; -webkit-font-smoothing: antialiased; min-height: 100vh;
  background:
    radial-gradient(1100px 560px at 88% -8%, var(--halo1) 0%, transparent 62%),
    radial-gradient(900px 520px at -12% 34%, var(--halo2) 0%, transparent 60%),
    linear-gradient(180deg, var(--fond1) 0%, var(--fond2) 100%);
  background-color: var(--fond1);
}
body::before { background: var(--fond1); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.eyebrow { font-weight: 700; letter-spacing: .1em; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -.01em; }

/* ---------- Surfaces en verre ---------- */
.carte, .modal-carte, .voile-carte, .login-card, .bordereau .bcell {
  background: var(--verre) padding-box, var(--arete) border-box;
  border: 1px solid transparent; border-radius: 18px;
  box-shadow: var(--reflet), var(--ombre-carte);
}
.bordereau { margin-top: 18px; background: none; border: 0; border-radius: 0; overflow: visible; gap: 14px; }
.bordereau .bcell { border: 1px solid transparent !important; padding: 16px 18px; gap: 6px; }
.bcell .v { font-family: var(--f-display); font-weight: 700; font-size: 23px; letter-spacing: -.02em; }
.bcell .v small { font-family: var(--f-body); font-weight: 700; font-size: 11px; letter-spacing: .08em; margin-left: 6px; }
.bordereau .bcell.cobalt { background: radial-gradient(130% 150% at 0% 0%, #3468f2 0%, #1747c9 40%, #0b2a7a 100%); border-color: #2a5be0 !important; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(0, 0, 0, .2), 0 22px 40px -22px rgba(11, 42, 122, .8); }
.bcell.cobalt .eyebrow, .bcell.cobalt .s, .bcell.cobalt .v small { color: #dbe5ff; }
.meter { height: 8px; border-radius: 99px; background: #dce4f1; box-shadow: inset 0 1px 2px rgba(13, 42, 122, .15); }
.meter i { border-radius: 99px; background: linear-gradient(90deg, #4174f7, #1747c9); }
.meter.warn i { background: linear-gradient(90deg, #f0a24a, #c46a12); }
.meter.bad i { background: linear-gradient(90deg, #ef7d6a, #b0362a); }
.reg th { background: transparent; }
.reg tbody tr:hover td, .reg tbody tr.actif td { background: var(--accent-soft); }
.tgc-bloc, .cand, .aff, .prev-det details { border-radius: 14px; background: var(--sheet); }
.depot, .zone-piece { border-radius: 14px; transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease), transform var(--t) var(--ease); }
@media (hover: hover) { .depot:hover, .zone-piece:hover { transform: translateY(-2px); } }
.depot:active, .zone-piece:active { transform: translateY(1px) scale(.99); }
@media (max-width: 1180px) { .apercu { border-radius: 0; border: 0; background: var(--sheet); box-shadow: none; } }

/* ---------- En-tête flottant ---------- */
.topbar {
  top: calc(env(safe-area-inset-top, 0px) + 10px); width: calc(100% - 24px); max-width: 1416px; margin: 10px auto 0;
  background: var(--head-bg); color: var(--head-fg); border-radius: 20px;
  border: 1px solid rgba(195, 205, 220, .65);
  box-shadow: var(--reflet), 0 14px 34px -22px rgba(13, 42, 122, .45);
  backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
}
.topbar-in { padding-block: 9px; padding-left: 12px; padding-right: 12px; }
.logo-tuile { width: 40px; height: 47px; border-radius: 0; background: transparent; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(13, 42, 122, .2)); }
.marque-txt { font-family: var(--f-display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.marque-txt small { font-family: var(--f-body); font-weight: 600; font-size: 12px; color: var(--muted); margin-top: 2px; }
.periode select { min-height: 38px; background: var(--sheet); border: 1px solid var(--rule); color: var(--ink); border-radius: 11px; padding: 0 10px; font-family: var(--f-body); font-weight: 700; box-shadow: var(--a-ombre); }
.seg { border: 0; border-radius: 13px; padding: 3px; gap: 2px; background: var(--creux); box-shadow: var(--creux-ombre); overflow: visible; }
.seg button { min-width: 42px; min-height: 36px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); font-family: var(--f-body); font-weight: 700; transition: transform var(--t) var(--ease), background-color var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), color var(--t) var(--ease); }
.seg button + button { border-left: 1px solid transparent; }
.seg button[aria-pressed="true"] { background: var(--sheet); color: var(--a-fg); border-color: var(--rule); box-shadow: 0 4px 10px -6px rgba(13, 42, 122, .45); }
.chip-role { border: 0; background: var(--accent-soft); color: var(--a-fg); font-weight: 700; padding: 6px 12px; box-shadow: inset 0 0 0 1px rgba(23, 71, 201, .2); }
.btn-ghost { color: var(--muted); background: transparent; border-color: transparent; box-shadow: none; }
.demo-band, .pin-band, .vue-band { background: none; border: 0; }
.demo-band .wrap, .pin-band .wrap, .vue-band .wrap { margin-top: 12px; width: calc(100% - 24px); max-width: 1416px; border-radius: 14px; padding: 10px 16px; }
.demo-band .wrap { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(150, 74, 6, .15); }
.pin-band .wrap { background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1px rgba(176, 54, 42, .15); }
.vue-band .wrap { background: var(--accent-soft); color: var(--a-fg); box-shadow: inset 0 0 0 1px rgba(23, 71, 201, .2); }
.pin-band button, .vue-band button { border-radius: 10px; min-height: 34px; padding: 0 12px; font-weight: 700; background: var(--sheet); transition: transform var(--t) var(--ease); }
@media (hover: hover) { .pin-band button:hover, .vue-band button:hover { transform: translateY(-2px); } }

/* Pastille d'enregistrement (en-tête) */
.ecr { background: var(--accent-soft); color: var(--a-fg); border-radius: 999px; padding: 5px 12px; font-weight: 700; animation: entree var(--t) var(--ease); }
.ecr.fait { background: var(--ok-bg); color: var(--ok); }
.ecr.fait svg { color: var(--ok); animation: pop 260ms var(--ease); }
.ecr.echec { background: var(--warn-bg); color: var(--warn); padding: 3px 4px 3px 12px; gap: 8px; box-shadow: inset 0 0 0 1px rgba(150, 74, 6, .25); }
.ecr.echec svg { width: 15px; height: 15px; flex: none; }
.ecr .btn { min-height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 999px; }
.spin-mini { border: 2px solid currentColor; border-right-color: transparent; opacity: .8; }

/* ---------- Onglets ---------- */
.onglets { margin-top: 20px; gap: 4px; padding: 5px; border: 0; border-radius: 16px; background: var(--creux); box-shadow: var(--creux-ombre); }
.onglets button { min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; color: var(--muted); font-weight: 700; transition: transform var(--t) var(--ease), background-color var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), color var(--t) var(--ease); }
.onglets button[aria-selected="true"] { color: #fff; border-color: #1543b8; background: linear-gradient(180deg, #4174f7 0%, #1f52d6 55%, #1747c9 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 14px -8px rgba(23, 71, 201, .8); }
.onglets button[aria-selected="true"] .badge { background: rgba(255, 255, 255, .22); color: #fff; }
.onglets button[aria-selected="true"] .badge.bad { background: #fff; color: #b0362a; }
.badge { font-family: var(--f-body); font-weight: 700; }
.sep-onglets { margin: 8px 4px; }
.seg-c { border: 0; border-radius: 13px; padding: 3px; gap: 2px; background: var(--creux); box-shadow: var(--creux-ombre); overflow: visible; }
.seg-c button { min-height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; transition: transform var(--t) var(--ease), background-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.seg-c button + button { border-left: 1px solid transparent; }
.seg-c button[aria-pressed="true"] { background: var(--sheet); color: var(--a-fg); border-color: var(--rule); box-shadow: 0 4px 10px -6px rgba(13, 42, 122, .45); }

/* ---------- Champs ---------- */
.champ input, .recherche input, .f input, .f select, .form-inline input, .form-inline select, .mini-filtre, .filtres-fac select, .sel-ges, .item .act select, .tgc-valid input, #form2 textarea, .ap-panneau textarea, .reg td select {
  border: 1px solid var(--rule); border-radius: 12px; background: linear-gradient(180deg, var(--band), var(--sheet)); color: var(--ink);
  box-shadow: inset 0 2px 3px rgba(13, 42, 122, .07); transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.champ input, .f input, .f select, .recherche input { min-height: 44px; }
.champ input:focus, .recherche input:focus, .f input:focus, .f select:focus, .form-inline input:focus, .form-inline select:focus, .mini-filtre:focus, .filtres-fac select:focus, .sel-ges:focus, .item .act select:focus, .tgc-valid input:focus, #form2 textarea:focus, .ap-panneau textarea:focus, .reg td select:focus {
  outline: none; border-color: var(--accent); box-shadow: inset 0 2px 3px rgba(13, 42, 122, .05), 0 0 0 3px rgba(23, 71, 201, .22);
}

/* ---------- Boutons : relief et micro-interactions ---------- */
.btn {
  position: relative; overflow: hidden; min-height: 42px; padding: 0 16px; border-radius: 12px; font-weight: 700; font-size: 14px; letter-spacing: .01em;
  color: var(--a-fg); background: var(--a-bg); border: 1px solid var(--a-bord); box-shadow: var(--a-ombre);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), background-color var(--t) var(--ease), color var(--t) var(--ease), opacity var(--t) var(--ease);
}
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  color: #fff; border-color: #1543b8; background: linear-gradient(180deg, #4174f7 0%, #1f52d6 52%, #1543b8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -2px 0 rgba(8, 30, 95, .25), 0 8px 18px -10px rgba(23, 71, 201, .8), 0 1px 2px rgba(10, 31, 92, .25);
}
.btn-primary:hover { filter: none; }
.btn-ghost { box-shadow: none; }
.btn-danger { color: var(--bad); }
.btn.fait { color: #fff; border-color: #127a4e; background: linear-gradient(180deg, #2bb077 0%, #178a5a 60%, #127a4e 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 18px -10px rgba(23, 138, 90, .8); }
.btn.echec { color: #fff; border-color: #a6560b; background: linear-gradient(180deg, #e98a2c 0%, #c86a12 60%, #a6560b 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 18px -10px rgba(166, 86, 11, .8); }
.btn.occupe { cursor: progress; }
.btn .lib { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.btn .prog { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, .22); transition: width 140ms linear; pointer-events: none; }
.btn:not(.btn-primary):not(.fait):not(.echec) .prog { background: rgba(23, 71, 201, .14); }
.spin-b { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; opacity: .9; display: inline-block; flex: none; animation: tourne 700ms linear infinite; }
.btn.fait svg { animation: pop 260ms var(--ease); }
.fleche { transition: transform var(--t) var(--ease); }
.chev { transition: transform 220ms var(--ease); }
.lien, .btn-det { transition: transform var(--t) var(--ease), background-color var(--t) var(--ease), border-color var(--t) var(--ease); }
.btn-piece, .pl-btn, .ap-fermer, .modal-tete button, .chip-filtre button { transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), background-color var(--t) var(--ease); }
.btn-piece { border-radius: 9px; min-height: 30px; padding: 0 10px; font-weight: 700; background: var(--a-bg); border-color: var(--a-bord); box-shadow: var(--a-ombre); }
@media (hover: hover) {
  .btn:not([disabled]):not(.occupe):hover { transform: translateY(-2px); border-color: var(--a-bord-h); box-shadow: var(--a-ombre-h); }
  .btn-primary:not([disabled]):not(.occupe):hover { border-color: #6a93fb; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(8, 30, 95, .2), 0 16px 28px -14px rgba(23, 71, 201, .9), 0 2px 5px rgba(10, 31, 92, .2); }
  .btn.fait:not([disabled]):hover { border-color: #47c792; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 16px 28px -14px rgba(23, 138, 90, .9); }
  .btn.echec:not([disabled]):hover { border-color: #f3a85e; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 16px 28px -14px rgba(166, 86, 11, .9); }
  .btn-ghost:not([disabled]):hover { background: rgba(23, 71, 201, .07); border-color: rgba(23, 71, 201, .16); box-shadow: none; color: var(--a-fg); }
  .btn:hover .fleche { transform: translateY(2.5px); }
  .onglets button:not([aria-selected="true"]):hover, .seg button:not([aria-pressed="true"]):hover, .seg-c button:not([aria-pressed="true"]):hover { transform: translateY(-2px); background: var(--sheet); border-color: var(--rule); color: var(--ink); }
  .btn-piece:hover { transform: translateY(-2px); border-color: var(--a-bord-h); box-shadow: var(--a-ombre-h); }
  .lien:hover, .btn-det:hover { transform: translateY(-2px); }
  .btn-det:hover { background: rgba(23, 71, 201, .07); border-color: rgba(23, 71, 201, .16); }
  .pl-btn:hover { transform: translateY(-2px); }
  .ap-fermer:hover, .modal-tete button:hover { transform: translateY(-2px); color: var(--ink); }
}
.btn:not([disabled]):not(.occupe):active, .onglets button:active, .seg button:active, .seg-c button:active, .btn-piece:active, .lien:active, .btn-det:active, .pl-btn:active { transform: translateY(1px) scale(.975); transition-duration: 90ms; }
.btn:not([disabled]):not(.occupe):active { box-shadow: var(--a-ombre-p); }
.btn-primary:not([disabled]):not(.occupe):active, .btn.fait:active, .btn.echec:active { box-shadow: inset 0 3px 6px rgba(5, 20, 70, .45), 0 2px 6px -3px rgba(23, 71, 201, .6); }
.btn-ghost:active { box-shadow: none; background: rgba(23, 71, 201, .1); }
.btn[disabled] { opacity: .55; }
.btn:focus-visible, .onglets button:focus-visible, .seg button:focus-visible, .seg-c button:focus-visible, .btn-piece:focus-visible, .btn-det:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--anneau), 0 0 0 6px var(--accent);
}
.msg-echec { flex: 1 1 100%; display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(150, 74, 6, .2); font-size: 13px; line-height: 1.45; animation: entree var(--t) var(--ease); }
.msg-echec svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.msg-echec b { display: block; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes entree { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes monte { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (pointer: coarse) { .btn { min-height: 44px; } .btn-small { min-height: 40px; } .onglets button { min-height: 44px; } }

/* ---------- Connexion ---------- */
.login { background: none; padding-block: clamp(16px, 4vw, 44px); }
.login-card { max-width: 1060px; padding: 0; gap: 0; overflow: hidden; border-radius: 28px; }
.login-banniere { position: relative; aspect-ratio: 2.4 / 1; min-height: 150px; overflow: hidden; background: #eef3fa; }
.login-banniere img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; display: block; }
.login-banniere::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%; background: linear-gradient(180deg, transparent, var(--fondu)); }
.login-corps { display: flex; flex-wrap: wrap; gap: 24px 44px; padding: clamp(20px, 4vw, 38px) clamp(18px, 4vw, 46px) clamp(24px, 4vw, 40px); align-items: flex-start; }
.login-intro { flex: 1 1 300px; min-width: 0; display: grid; gap: 10px; }
.login-intro h1 { font-size: clamp(25px, 3vw, 32px); line-height: 1.1; margin: 0; letter-spacing: -.02em; }
.login-intro p { margin: 0; color: var(--muted); font-size: 15.5px; max-width: 44ch; }
.login-puces { display: flex; gap: 10px 18px; flex-wrap: wrap; margin-top: 6px; font-size: 13.5px; font-weight: 600; }
.login-puces span { display: inline-flex; align-items: center; gap: 8px; }
.login-puces svg { width: 18px; height: 18px; color: var(--accent); }
.login-form { flex: 1 1 340px; min-width: 0; display: grid; gap: 14px; }
.login-form .btn { width: 100%; min-height: 48px; font-size: 15px; }
.champ #code { font-family: var(--f-display); letter-spacing: .3em; font-size: 19px; }

/* ---------- Synthèse (vue comptable) ---------- */
.hero { display: flex; flex-wrap: wrap; overflow: hidden; border-radius: 24px; }
.hero-txt { flex: 1 1 420px; min-width: 0; padding: clamp(22px, 4vw, 40px); display: flex; flex-direction: column; justify-content: center; gap: 14px; position: relative; z-index: 1; }
.hero-txt h2 { margin: 0; font-size: clamp(26px, 3vw, 36px); line-height: 1.08; letter-spacing: -.025em; }
.hero-txt p { margin: 0; color: var(--muted); max-width: 46ch; font-size: 15.5px; line-height: 1.55; }
.hero-img { flex: 1 1 380px; min-width: 0; min-height: 250px; position: relative; }
.hero-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 50%; mix-blend-mode: multiply; }
.hero-img::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, var(--fondu) 0%, transparent 34%); pointer-events: none; }
.hero-anneau { position: absolute; z-index: 2; left: 18px; bottom: 18px; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 16px; background: var(--verre) padding-box, var(--arete) border-box; border: 1px solid transparent; box-shadow: var(--reflet), var(--ombre-carte); }
.hero-anneau svg { width: 54px; height: 54px; flex: none; }
.hero-anneau .t { font-size: 13.5px; font-weight: 700; }
.dl-grille { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.dl-carte { padding: 20px; display: flex; flex-direction: column; gap: 14px; transition: transform 220ms var(--ease), box-shadow 220ms var(--ease); }
@media (hover: hover) { .dl-carte:hover { transform: translateY(-2px); box-shadow: var(--reflet), var(--ombre-forte); } }
.dl-tete { display: flex; align-items: center; gap: 14px; }
.dl-n { font-family: var(--f-display); font-weight: 700; font-size: 23px; letter-spacing: -.02em; margin: 3px 0 0; }
.dl-carte > p { margin: 0; color: var(--muted); font-size: 14px; }
.dl-carte .btn-primary { width: 100%; min-height: 46px; }
.pastille-ic { width: 50px; height: 50px; border-radius: 15px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, #4a7bf8 0%, #1747c9 55%, #0f348f 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 rgba(0, 0, 0, .18), 0 10px 18px -10px rgba(23, 71, 201, .9); }
.pastille-ic svg { width: 24px; height: 24px; }
.btn-det { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; margin-left: -10px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--accent); font-weight: 700; font-size: 14px; -webkit-tap-highlight-color: transparent; }
.btn-det svg { width: 18px; height: 18px; }
.btn-det.ouvert .chev { transform: rotate(180deg); }
.deplie { display: grid; grid-template-rows: 0fr; opacity: 0; margin-top: -14px; transition: grid-template-rows 220ms var(--ease), opacity 180ms var(--ease), margin-top 220ms var(--ease), visibility 0s linear 220ms; visibility: hidden; }
.deplie.ouvert { grid-template-rows: 1fr; opacity: 1; margin-top: 0; visibility: visible; transition: grid-template-rows 220ms var(--ease), opacity 180ms var(--ease), margin-top 220ms var(--ease), visibility 0s; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.deplie > div { overflow: hidden; min-height: 0; }
.det-liste { margin: 0; padding: 12px 14px; list-style: none; display: grid; gap: 8px; border-radius: 14px; background: var(--creux); box-shadow: var(--creux-ombre); }
.det-liste li { position: relative; padding-left: 18px; font-size: 13.5px; line-height: 1.45; }
.det-liste li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(23, 71, 201, .15); }
.dl-tout { gap: 12px; margin-top: 4px; }
.dl-tout .btn { white-space: nowrap; min-height: 46px; }
.synth-bas { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.synth-bas > .ctrl-bloc { flex: 999 1 520px; min-width: 0; }
.tgc-carte { flex: 1 1 320px; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.tgc-carte .img { position: relative; height: 140px; overflow: hidden; }
.tgc-carte .img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; mix-blend-mode: multiply; display: block; }
.tgc-carte .img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, var(--fondu) 100%); }
.tgc-carte .corps { padding: 4px 20px 20px; display: grid; gap: 14px; }
.tgc-carte h3 { margin: 0; font-size: 17px; }
.tgc-donut { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tgc-donut svg { width: 120px; height: 120px; flex: none; }
.tgc-donut ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; flex: 1 1 150px; min-width: 0; font-size: 13.5px; }
.tgc-donut li { display: flex; align-items: center; gap: 10px; }
.tgc-donut li span:nth-child(2) { flex: 1 1 auto; }
.tgc-donut li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tgc-donut i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.pt-ok, .pt-ko { width: 26px; height: 26px; font-size: 13px; font-weight: 800; }
.pt-ok { box-shadow: inset 0 0 0 1px rgba(19, 111, 72, .22); } .pt-ok svg { width: 14px; height: 14px; }
.pt-ko { box-shadow: inset 0 0 0 1px rgba(150, 74, 6, .25); }
.statut-l { padding-block: 8px; }
.pt .pt-g { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; min-width: 0; }
.pt .pt-t { min-width: 0; line-height: 1.35; }
.statut-l .btn-small svg { width: 15px; height: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-img img, :root:not([data-theme="light"]) .tgc-carte .img img { mix-blend-mode: normal; opacity: .78; } :root:not([data-theme="light"]) .logo-tuile { background: linear-gradient(180deg, #fff, #e3e9f2); border-radius: 10px; padding: 2px; } }
:root[data-theme="dark"] .hero-img img, :root[data-theme="dark"] .tgc-carte .img img { mix-blend-mode: normal; opacity: .78; }
:root[data-theme="dark"] .logo-tuile { background: linear-gradient(180deg, #fff, #e3e9f2); border-radius: 10px; padding: 2px; }

/* ---------- Fenêtres, voile, message ---------- */
.modal { background: rgba(10, 25, 60, .38); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal:not([hidden]) .modal-carte { animation: entree 200ms var(--ease); }
.modal-carte { border-radius: 22px; padding: 22px; }
.voile { background: rgba(10, 25, 60, .38); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.toast { border-radius: 16px; padding: 12px 18px; color: #fff; background: linear-gradient(180deg, rgba(18, 40, 102, .96), rgba(11, 29, 77, .96)); border: 1px solid rgba(120, 150, 230, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 18px 40px -16px rgba(11, 29, 77, .7); font-weight: 600; animation: monte 220ms var(--ease); }
.toast.err { background: linear-gradient(180deg, #c3591a, #a4470f); border-color: #e08a4f; }
@media (max-width: 720px) {
  .topbar { width: calc(100% - 16px); margin-top: 8px; border-radius: 18px; }
  .topbar-in { gap: 8px 10px; padding-block: 7px; }
  .marque { order: 1; } .who { order: 2; } .periode { order: 3; flex: 1 1 100%; }
  .chip-role { display: none; }
  .logo-tuile { width: 34px; height: 40px; }
  .bcell .v { font-size: 19px; }
  .hero-img { min-height: 210px; }
}

/* ---------- Réduction des animations (réglage système) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .btn:hover, .btn:active, .onglets button:hover, .onglets button:active, .seg button:hover, .seg button:active, .seg-c button:hover, .seg-c button:active,
  .btn-piece:hover, .btn-piece:active, .btn-det:hover, .btn-det:active, .lien:hover, .lien:active, .dl-carte:hover, .depot:hover, .zone-piece:hover, .pl-btn:hover,
  .btn:hover .fleche, .pin-band button:hover, .vue-band button:hover { transform: none !important; }
}
.btn.occupe[disabled] { opacity: 1; }
/* ---------- v2.1 : espaces, clients, base administrative ---------- */
.seg-espace button { min-width: 0; padding: 0 14px; }
body.espace-gestion .periode { display: none; }
.b-txt { font-family: var(--f-body) !important; }
.cli-mise { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.cli-liste { flex: 999 1 720px; min-width: 0; overflow: hidden; }
.cli-cote { flex: 1 1 320px; min-width: 0; display: grid; gap: 16px; }
.cli-cote .carte { padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.cli-cote h3, .cli-col h3, .cli-fac h3 { margin: 0; font-family: var(--f-display); font-size: 16px; }
.cli-tete-l { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; }
.cli-tete-l h3 { flex: 1 1 auto; }
.cli-entete, .cli-ligne { display: grid; grid-template-columns: minmax(0, 2.4fr) 96px 70px 112px 104px 104px 88px 84px; gap: 12px; align-items: center; padding: 11px 16px; }
.cli-table { min-width: 900px; }
.cli-tete-l .seg-c { max-width: 100%; overflow-x: auto; }
.cli-tete-l .seg-c button { white-space: nowrap; }
.cli-entete { background: var(--band); border-top: 1px solid var(--rule); font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.cli-ligne { width: 100%; border: 0; border-top: 1px solid var(--rule); background: transparent; text-align: left; font: inherit; color: var(--ink); cursor: pointer; transition: background-color var(--t) var(--ease); }
@media (hover: hover) { .cli-ligne:hover { background: var(--fondu, #f4f7fc); } }
.cli-ligne:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.cli-ligne .r, .cli-entete .r { text-align: right; }
.cli-ligne .b { font-weight: 700; }
.cli-ligne .du { color: var(--warn); font-weight: 700; }
.cli-ligne small { color: var(--muted); font-weight: 600; }
.cli-nom { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cli-nom > span:last-child { min-width: 0; }
.cli-nom b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-sous { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.cli-av { flex: none; width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font: 700 13px var(--f-display); }
.cli-av.av0 { background: #e3ecff; color: #123a9c; } .cli-av.av1 { background: #e0f3e9; color: #136f48; } .cli-av.av2 { background: #fff0e0; color: #964a06; } .cli-av.av3 { background: #ece8fb; color: #4b3a9c; } .cli-av.av4 { background: #e8edf5; color: #33415c; }
.cli-av.grand { width: 60px; height: 60px; border-radius: 16px; font-size: 24px; }
.tag-c { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--a-fg); font-weight: 700; font-size: 11.5px; white-space: nowrap; }
.tag-c.t-warn { background: var(--warn-bg); color: var(--warn); } .tag-c.t-neutre { background: var(--neutral-bg); color: var(--neutral); }
.fid { display: inline-flex; gap: 4px; vertical-align: middle; }
.fid i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); }
.fid i.p1 { background: var(--accent); } .fid i.p5 { background: linear-gradient(90deg, var(--accent) 50%, var(--rule) 50%); }
.cli-note { margin: 0; padding: 12px 16px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); }
.prop { padding: 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--band); display: grid; gap: 6px; }
.prop-a { display: flex; flex-wrap: wrap; gap: 8px; }
.nf { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); }
.nf:first-of-type { border-top: 0; }
.nf .small { white-space: nowrap; }
.nf b { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cli-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 16px; }
.cli-tete h2 { margin: 0; font: 700 26px var(--f-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.cli-tete .cli-sous { font-size: 13.5px; margin-top: 6px; }
.cli-tete-txt { flex: 1 1 320px; min-width: 0; }
.cli-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cli-alertes { padding: 12px 16px; margin-bottom: 16px; background: var(--warn-bg); color: #5c2d00; border-color: rgba(150, 74, 6, .2); font-size: 13.5px; }
.cli-alertes ul { margin: 6px 0 0; padding-left: 18px; }
.cli-grille { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.cli-col { flex: 1 1 320px; max-width: 420px; min-width: 0; display: grid; gap: 16px; }
.cli-col .carte { padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.cli-col .entete-c { display: flex; align-items: center; gap: 8px; }
.cli-col .entete-c h3 { flex: 1 1 auto; }
.champ { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.champ > span { color: var(--muted); }
.champ b { font-weight: 600; overflow-wrap: anywhere; }
.champ i { color: var(--warn); }
.contact { padding: 8px 0; border-top: 1px solid var(--rule); font-size: 14px; display: grid; gap: 2px; }
.contact a { overflow-wrap: anywhere; }
.cli-fac { flex: 999 1 640px; min-width: 0; padding: 16px; }
.cli-fac .zone { padding-bottom: 0; margin-top: 12px; }
.cli-fac .apercu { height: calc(100vh - 120px); }
.cli-barres { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(44px, 96px); justify-content: start; gap: 12px; align-items: end; height: 120px; margin-top: 10px; }
.cli-barres div { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; height: 100%; text-align: center; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cli-barres i { display: block; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #8eaaf0, #5b84e8); min-height: 3px; }
.cli-barres div.cour i { background: linear-gradient(180deg, #3b6cf0, #1747c9); }
.cli-barres div.cour { color: var(--a-fg); font-weight: 800; }
.cli-barres b { font-weight: 700; color: var(--ink); }
.cli-fac-t { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cli-fac-t > div:first-child { flex: 1 1 200px; }
.doc-l { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); }
.doc-l button { flex: 1 1 auto; min-width: 0; text-align: left; border: 0; background: none; padding: 0; font: inherit; color: var(--a-fg); font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-l button:hover { text-decoration: underline; }
.dv-l { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); }
.dv-l button { flex: 1 1 auto; min-width: 0; text-align: left; border: 0; background: none; padding: 0; font: 600 14px var(--f-mono); color: var(--a-fg); cursor: pointer; }
.dv-l button:hover { text-decoration: underline; }
.notes-txt { margin: 0; white-space: pre-line; font-size: 14px; }
/* fenêtre fiche client */
.ridet-l { display: flex; gap: 8px; }
.ridet-l input { flex: 1 1 auto; min-width: 0; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 9px 10px; font-size: 16px; }
.ridet-res { display: grid; gap: 6px; }
.ridet-r { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--rule); background: var(--sheet); font: inherit; color: var(--ink); cursor: pointer; transition: transform var(--t) var(--ease), border-color var(--t) var(--ease); }
.ridet-r:hover { transform: translateY(-2px); border-color: var(--accent); }
.ridet-r span { font-size: 13px; color: var(--muted); }
.contacts-zone { display: grid; gap: 8px; }
.cz-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cz-tete .espace { flex: 1 1 auto; }
.contact-l { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto; gap: 6px; align-items: center; padding: 8px; border-radius: 11px; background: var(--band); }
.contact-l input[type=text], .contact-l input[type=email], .contact-l input[type=tel] { min-width: 0; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); border-radius: 8px; padding: 8px 9px; font-size: 15px; }
.contact-l .check { font-size: 12.5px; white-space: nowrap; }
.gmail-res, .pj-liste { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-mail { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); font: 600 13px var(--f-body); color: var(--ink); cursor: pointer; }
.chip-mail svg { width: 14px; height: 14px; }
.chip-mail small { color: var(--muted); font-weight: 500; }
.chip-mail[disabled] { opacity: .5; cursor: default; }
textarea { font: inherit; }
.f textarea { border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 9px 10px; font-size: 15px; resize: vertical; }
/* base administrative */
.doc-alertes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.doc-al { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; border: 1px solid transparent; }
.doc-al svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.doc-al.warn, .doc-al.bad { background: var(--warn-bg); color: #5c2d00; border-color: rgba(150, 74, 6, .2); }
.doc-al.bad { background: var(--bad-bg); color: #6d1a12; border-color: rgba(176, 54, 42, .2); }
.doc-al.info { background: var(--accent-soft); color: #12346a; border-color: rgba(23, 71, 201, .18); }
.doc-al.neutre { background: var(--sheet); color: var(--neutral); border-color: var(--rule); }
.doc-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.doc-cats button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--rule); background: var(--sheet); font: 600 13.5px var(--f-body); color: var(--ink); cursor: pointer; transition: transform var(--t) var(--ease); }
.doc-cats button[aria-pressed="true"] { background: var(--accent-soft); color: var(--a-fg); border-color: rgba(23, 71, 201, .3); }
.doc-cats button span { min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--band); font-size: 12px; font-weight: 800; }
@media (hover: hover) { .doc-cats button:hover { transform: translateY(-2px); } }
.doc-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; padding: 14px; }
.doc-carte { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 16px; border: 1px solid var(--rule); background: var(--sheet); transition: box-shadow var(--t) var(--ease); }
.doc-carte.actif { box-shadow: 0 0 0 2px var(--accent), 0 18px 34px -22px rgba(13, 42, 122, .6); }
.doc-ouvrir { display: grid; gap: 7px; justify-items: start; text-align: left; padding: 6px; border: 0; border-radius: 11px; background: none; font: inherit; color: var(--ink); cursor: pointer; transition: transform var(--t) var(--ease); }
@media (hover: hover) { .doc-ouvrir:hover { transform: translateY(-2px); } }
.doc-ouvrir:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.doc-vign { position: relative; width: 100%; height: 110px; border-radius: 9px; background: var(--band); overflow: hidden; }
.doc-page { position: absolute; left: 22%; right: 22%; top: 12px; bottom: 0; border-radius: 4px 4px 0 0; background: #fff; box-shadow: 0 6px 16px -8px rgba(13, 42, 122, .35); display: flex; flex-direction: column; gap: 5px; padding: 12px 10px; }
.doc-page i { display: block; height: 4px; border-radius: 2px; background: var(--rule); }
.doc-page i:first-child { height: 6px; width: 70%; background: var(--accent); }
.doc-vign.t-img .doc-page { left: 12%; right: 12%; top: 22px; bottom: 22px; border-radius: 8px; background: linear-gradient(135deg, #f7f9fc, #dfe6f1); }
.doc-vign em { position: absolute; right: 8px; top: 8px; padding: 2px 7px; border-radius: 6px; background: #0e1a33; color: #fff; font-style: normal; font-size: 10.5px; font-weight: 800; }
.doc-titre { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.doc-meta { font-size: 12.5px; color: var(--muted); }
.doc-pied { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; padding: 0 4px; }
.doc-pied .check { font-size: 12.5px; }
.doc-manque { display: grid; place-items: center; align-content: center; gap: 6px; min-height: 230px; padding: 12px; border-radius: 16px; border: 1.5px dashed var(--a-bord); background: rgba(255, 255, 255, .55); font: inherit; color: var(--a-fg); text-align: center; cursor: pointer; transition: transform var(--t) var(--ease); }
.doc-manque svg { width: 24px; height: 24px; }
.doc-manque span { font-size: 12.5px; color: var(--muted); }
@media (hover: hover) { .doc-manque:hover { transform: translateY(-2px); } }
.bascule { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0; border: 0; background: none; font: 600 12.5px var(--f-body); color: var(--neutral); cursor: pointer; }
.bascule i { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--a-bord); transition: background-color var(--t) var(--ease); }
.bascule i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(13, 42, 122, .35); transition: transform var(--t) var(--ease); }
.bascule[aria-checked="true"] i { background: var(--accent); }
.bascule[aria-checked="true"] i::after { transform: translateX(14px); }
.bascule:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ap-edit { grid-column: 1 / -1; display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.ap-edit .l { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--f-body); }
.ap-edit input[type=date] { min-height: 36px; border: 1px solid var(--rule); border-radius: 10px; padding: 0 8px; font: 600 13.5px var(--f-body); color: var(--ink); background: var(--sheet); }
.ap-edit .versions { font-size: 12.5px; color: var(--muted); }
.ap-edit .act { display: flex; flex-wrap: wrap; gap: 6px; }
.depot.plein { cursor: pointer; }
@media (max-width: 760px) {
  .cli-table { min-width: 0; }
  .cli-entete { display: none; }
  .cli-ligne { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .cli-ligne > :nth-child(2), .cli-ligne > :nth-child(5), .cli-ligne > :nth-child(8) { display: none; }
  .cli-ligne > :nth-child(3) { display: none; }
  .cli-ligne > :nth-child(4) { grid-row: 1; grid-column: 2; }
  .cli-ligne > :nth-child(6) { grid-column: 1; text-align: left; font-size: 12.5px; }
  .cli-ligne > :nth-child(6).du::before { content: "Reste dû "; font-family: var(--f-body); font-weight: 600; color: var(--muted); }
  .cli-ligne > :nth-child(6).muted { visibility: hidden; }
  .cli-ligne > :nth-child(7) { grid-column: 2; }
  .champ { grid-template-columns: 110px minmax(0, 1fr); }
  .contact-l { grid-template-columns: 1fr 1fr; }
  .cli-col { max-width: none; }
  .doc-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; }
}
/* Comptes pro / perso */
.cpt-au { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--muted); }
.cpt-au input { min-height: 40px; border: 1px solid var(--rule); border-radius: 11px; padding: 0 10px; font: 600 14px var(--f-body); color: var(--ink); background: var(--sheet); box-shadow: var(--a-ombre); }
.cpt-au input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23, 71, 201, .22); }
.graphe.g-cpt { overflow: visible; }
.graphe.g-cpt svg { min-width: 0; max-height: none; }
.g-aire { fill: rgba(23, 71, 201, .10); stroke: none; }
.g-courbe { fill: none; stroke: #1747c9; stroke-width: 2.5; stroke-linejoin: round; }
.g-prev { fill: none; stroke: #1747c9; stroke-width: 2; stroke-dasharray: 6 5; opacity: .75; }
.g-zero { stroke: var(--bad); stroke-width: 1.2; stroke-dasharray: 3 3; }
.g-mois { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 5; }
.g-repere { stroke: #1747c9; stroke-width: 1.2; stroke-dasharray: 3 3; opacity: .55; }
.g-point { fill: #fff; stroke: #1747c9; stroke-width: 3; }
.g-cible { fill: transparent; }
.legende i.g-courbe-l { background: #1747c9; height: 3px; width: 18px; border-radius: 2px; vertical-align: 3px; }
.legende i.g-prev-l { background: none; border-top: 2px dashed #1747c9; height: 0; width: 18px; border-radius: 0; vertical-align: 3px; }
.legende i.g-point-l { background: #fff; border: 2.5px solid #1747c9; border-radius: 50%; }
.cats { display: grid; gap: 4px; }
.cat-l { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto 44px; gap: 10px; align-items: center; padding: 7px 8px; border: 1px solid transparent; border-radius: 10px; background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; transition: transform var(--t) var(--ease), background-color var(--t) var(--ease), border-color var(--t) var(--ease); }
@media (hover: hover) { .cat-l:hover { transform: translateY(-2px); background: var(--sheet); border-color: var(--rule); } }
.cat-l:active { transform: translateY(1px) scale(.99); }
.cat-n { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-n small { margin-left: 6px; color: var(--muted); font-weight: 500; }
.cat-b { height: 8px; border-radius: 99px; background: var(--creux); overflow: hidden; }
.cat-b i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4174f7, #1747c9); }
.cat-l b { font-variant-numeric: tabular-nums; font-size: 13.5px; text-align: right; }
.cat-l > small { color: var(--muted); text-align: right; font-size: 12px; }
.top-t { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-size: 13px; border-top: 1px solid var(--rule); padding-top: 10px; }
.top-t strong { width: 100%; font-size: 12.5px; color: var(--muted); }
.top-t b { margin-left: 6px; font-variant-numeric: tabular-nums; }
.prev-mois { display: grid; gap: 8px; }
.prev-mois details { border: 1px solid var(--rule); border-radius: 12px; background: var(--sheet); }
.prev-mois summary { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; padding: 10px 12px; cursor: pointer; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.prev-l { display: grid; gap: 2px; padding: 0 12px 10px; }
.prev-l > div { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 10px; font-size: 13px; padding: 4px 0; border-top: 1px dashed var(--rule); }
.prev-l small { display: block; color: var(--muted); font-size: 11.5px; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.cpt-filtres { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.cpt-filtres .mini-filtre { min-height: 40px; }
.cpt-filtres input[type=search] { flex: 1 1 220px; }
.cpt-total { margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip-per { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 99px; background: var(--accent-soft); color: var(--accent); font: 600 12.5px var(--f-body); cursor: pointer; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
@media (hover: hover) { .chip-per:hover { transform: translateY(-2px); box-shadow: var(--a-ombre); } }
.chip-per:active { transform: translateY(1px) scale(.98); }
.cpt-table td { vertical-align: middle; }
.cpt-lib { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpt-in { width: 100%; min-width: 120px; min-height: 34px; border: 1px solid transparent; border-radius: 9px; background: transparent; padding: 0 8px; font: 500 13px var(--f-body); color: var(--ink); transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.cpt-in:hover { border-color: var(--rule); background: var(--sheet); }
.cpt-in:focus { outline: none; border-color: var(--accent); background: var(--sheet); box-shadow: 0 0 0 3px rgba(23, 71, 201, .2); }
.cpt-in.cpt-modif { background: var(--accent-soft); }
.suivi-pai { display: grid; gap: 6px; }
.ap-pai { grid-column: 1 / -1; display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--creux); box-shadow: var(--creux-ombre); font-family: var(--f-body); }
.ap-pai-t { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ap-pai-t span { color: var(--muted); }
.ap-pai-l { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.ap-pai-l b { margin-left: 6px; color: var(--ink); font-variant-numeric: tabular-nums; }
.aff .m small { color: var(--muted); font-weight: 500; }
@media (max-width: 760px) {
  .cpt-table thead { display: none; }
  .cpt-table, .cpt-table tbody { display: block; }
  .cpt-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 8px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .cpt-table td { display: block; padding: 0; border: 0; }
  .cpt-table td:nth-child(1) { order: 1; color: var(--muted); font-size: 12.5px; }
  .cpt-table td:nth-child(5) { order: 2; text-align: right; font-weight: 700; }
  .cpt-table td:nth-child(2) { order: 3; grid-column: 1 / -1; max-width: none; white-space: normal; font-size: 13px; }
  .cpt-table td:nth-child(3) { order: 4; } .cpt-table td:nth-child(4) { order: 5; }
  .cpt-table td:nth-child(6) { display: none; }
  .cpt-in { min-width: 0; border-color: var(--rule); background: var(--sheet); min-height: 40px; }
  .cpt-filtres .mini-filtre { flex: 1 1 140px; }
  .cat-l { grid-template-columns: minmax(0, 1fr) auto; } .cat-b, .cat-l > small { display: none; } .prev-mois summary { grid-template-columns: 1fr auto; } .cpt-lib { max-width: 160px; } }
.install-carte { width: min(480px, 100%); gap: 16px; }
.inst-tete { display: flex; align-items: center; gap: 14px; }
.inst-tete h2 { margin: 2px 0 0; font-size: 21px; }
.inst-tete > div { flex: 1; min-width: 0; }
.inst-icone { width: 64px; height: 64px; border-radius: 16px; flex: none; box-shadow: 0 10px 22px -12px rgba(13, 42, 122, .6), inset 0 0 0 1px rgba(255, 255, 255, .6); }
.inst-fermer { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); padding: 4px 8px; border-radius: 10px; align-self: flex-start; transition: transform var(--t) var(--ease), background-color var(--t) var(--ease); }
@media (hover: hover) { .inst-fermer:hover { transform: translateY(-2px); background: var(--creux); color: var(--ink); } }
.install-carte p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.inst-points { margin: 0; padding: 12px 14px; list-style: none; display: grid; gap: 8px; border-radius: 14px; background: var(--creux); box-shadow: var(--creux-ombre); }
.inst-points li, .inst-ios li { position: relative; padding-left: 22px; font-size: 14px; }
.inst-points li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 12px; height: 7px; border-left: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg); }
.inst-ios { margin: 0; padding: 12px 14px 12px 16px; display: grid; gap: 10px; border-radius: 14px; background: var(--accent-soft); counter-reset: etape; list-style: none; }
.inst-ios li { counter-increment: etape; padding-left: 30px; line-height: 1.5; }
.inst-ios li::before { content: counter(etape); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
.inst-ios svg { width: 17px; height: 17px; vertical-align: -3px; color: var(--accent); }
#btn-installer svg { width: 16px; height: 16px; }
.tgc-donut b.ok { color: var(--ok); } .tgc-donut b.warn { color: var(--warn); }
/* v2.2 — devis et factures */
.prevision { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; padding: 12px 14px; margin-bottom: 14px; }
.prev-tot { display: grid; gap: 2px; padding-right: 14px; margin-right: 2px; border-right: 1px solid var(--rule); }
.prev-tot b { font: 700 22px var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.prev-tot b small { font: 700 11px var(--f-body); letter-spacing: .08em; margin-left: 6px; color: var(--muted); }
.prev-item { display: grid; gap: 2px; align-content: center; text-align: left; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--rule); background: var(--sheet); font: inherit; color: var(--ink); cursor: pointer; transition: transform var(--t) var(--ease), border-color var(--t) var(--ease); }
.prev-item span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.prev-item b { font-variant-numeric: tabular-nums; font-size: 15px; }
.prev-item.discret b { color: var(--muted); }
@media (hover: hover) { .prev-item:hover { transform: translateY(-2px); border-color: var(--accent); } }
.prev-item:active { transform: translateY(1px) scale(.99); }
.dev-table tbody tr, .reg tr[data-ed-f] { cursor: pointer; }
.reg tr[data-ed-f]:focus-visible, .dev-table tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* éditeur */
.ed-barre { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 64px); z-index: 5; background: var(--fondu, var(--paper)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); margin: 0 -4px; padding-inline: 4px; }
.ed-modif { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--warn); }
.ed-modif::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ed-modif[hidden] { display: none; }
.ed-vue { display: none; margin-bottom: 12px; }
.ed-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 42%); gap: 18px; align-items: start; padding-bottom: 40px; }
.ed-col { display: grid; gap: 14px; min-width: 0; }
.ed-tete { padding: 16px 18px; display: grid; gap: 12px; }
.ed-titre { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ed-titre .eyebrow { width: 100%; }
.ed-titre h2 { margin: 0; font: 700 24px var(--f-display); letter-spacing: -.01em; }
.ed-statuts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ed-statuts .seg-c button[disabled] { opacity: .55; cursor: default; }
.ed-statuts .seg-c button[aria-pressed="true"][disabled] { opacity: 1; }
.ed-statuts > .small { flex: 1 1 220px; }
.ed-liens { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; }
.ed-liens .sep { color: var(--muted); }
.ed-liens .lien { font-size: 13.5px; }
.ed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ed-actions .btn svg { width: 17px; height: 17px; }
.ed-pdfst { margin-left: auto; }
.pdf-et { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pdf-et::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pdf-et.ok { color: var(--ok); } .pdf-et.warn { color: var(--warn); }
.ed-verrou { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; font-size: 13.5px; background: var(--accent-soft); color: #12346a; border-color: rgba(23, 71, 201, .18); }
.ed-verrou svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.ed-bloc { padding: 16px 18px; display: grid; gap: 12px; }
.ed-bloc h3 { margin: 0; }
.ed-bloc .entete-c { display: flex; align-items: baseline; gap: 10px; }
.ed-bloc .entete-c h3 { flex: 1 1 auto; }
.ed-champs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ed-champs .f-client { grid-column: span 2; }
.ed-champs .plein, .ed-bloc-client { grid-column: 1 / -1; }
.f input[disabled], .f select[disabled], .f textarea[disabled], .ed-l input[disabled], .ed-l select[disabled] { color: var(--ink); opacity: 1; background: var(--band); -webkit-text-fill-color: var(--ink); }
.ed-bloc-client { font-size: 13.5px; padding: 9px 12px; border-radius: 11px; background: var(--creux, var(--band)); }
.ed-bloc-client .lien { margin-left: 6px; }
.f-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.f-tete .lien { font-weight: 600; }
.f textarea { line-height: 1.45; }
.ed-freq { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ed-freq > .small { width: 100%; }
.chip-l { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; max-width: 100%; padding: 0 11px 0 8px; border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); font: 600 12.5px var(--f-body); color: var(--ink); cursor: pointer; transition: transform var(--t) var(--ease), border-color var(--t) var(--ease); }
.chip-l svg { width: 13px; height: 13px; color: var(--accent); flex: none; }
.chip-l span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-l small { color: var(--muted); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .chip-l:hover { transform: translateY(-2px); border-color: var(--accent); } }
.chip-l:active { transform: translateY(1px) scale(.98); }
.ed-lignes { display: grid; gap: 6px; }
.ed-l { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1.2fr) 64px; gap: 6px; align-items: end; padding: 8px; border-radius: 12px; background: var(--band); }
.ed-lignes.ro .ed-l { grid-template-columns: minmax(0, 3fr) minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1.2fr); }
.ed-c { display: grid; gap: 3px; min-width: 0; font-size: 11.5px; }
.ed-c > span { color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-l:not(:first-child) .ed-c > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ed-c input, .ed-c select { width: 100%; min-width: 0; min-height: 40px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); border-radius: 9px; padding: 0 9px; font: 500 14px var(--f-body); }
.ed-c input:focus, .ed-c select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23, 71, 201, .2); }
.c-pu input, .c-q input { text-align: right; font-variant-numeric: tabular-nums; }
.c-tot b { display: flex; align-items: center; justify-content: flex-end; min-height: 40px; font-size: 14px; font-variant-numeric: tabular-nums; }
.c-act { display: flex; gap: 4px; justify-content: flex-end; }
.ico-b { width: 30px; height: 40px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--muted); font: 700 16px var(--f-body); cursor: pointer; }
.ico-b:hover:not([disabled]) { background: var(--sheet); border-color: var(--rule); color: var(--ink); }
.ico-b[disabled] { opacity: .3; cursor: default; }
.ed-totaux { justify-self: end; width: min(320px, 100%); display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--creux, var(--band)); box-shadow: var(--creux-ombre, none); font-size: 14px; }
.ed-totaux > div { display: flex; justify-content: space-between; gap: 12px; }
.ed-totaux span { color: var(--muted); }
.ed-totaux .t-det { font-size: 12.5px; padding-left: 10px; }
.ed-totaux .t-ttc { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--rule); }
.ed-totaux .t-ttc span { color: var(--ink); font-weight: 700; }
.ed-totaux .t-ttc b { font: 700 19px var(--f-display); }
.ed-totaux .t-ttc b small { font: 700 11px var(--f-body); letter-spacing: .08em; margin-left: 5px; color: var(--muted); }
.ed-apercu { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 130px); display: grid; gap: 10px; padding: 12px; max-height: calc(100vh - 150px); overflow: auto; }
.ed-ap-act { display: inline-flex; gap: 6px; }
.ed-ap-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ed-pdf { height: calc(100vh - 230px); min-height: 480px; border-radius: 10px; overflow: hidden; background: var(--band); display: grid; }
.ed-pdf iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.ed-pdf .spin { margin: auto; }
.ed-pdf .demo-mark { display: block; padding: 8px 10px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #9a6210; }
/* Réplique du PDF : 1 point = 1/595 de la largeur (A4), polices et couleurs du générateur */
.pdfp-cadre { container-type: inline-size; }
.pdfp { --pt: calc(100cqw / 595); min-height: calc(var(--pt) * 842); box-sizing: border-box; padding: calc(var(--pt) * 36); background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; font-size: calc(var(--pt) * 10); line-height: 1.28; border-radius: 4px; box-shadow: 0 14px 30px -18px rgba(13, 42, 122, .5), 0 0 0 1px rgba(13, 42, 122, .08); }
.pdfp table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pdfp td, .pdfp th { border: calc(var(--pt) * 1) solid #000; padding: calc(var(--pt) * 5); vertical-align: top; overflow-wrap: break-word; hyphens: auto; }
.pdfp-ent td { font-size: calc(var(--pt) * 9); }
.pdfp-ent .g { font-weight: 700; }
.pdfp-ent .d { text-align: right; vertical-align: bottom; }
.pdfp-titre { margin-top: calc(var(--pt) * 8); color: #f4a300; font-weight: 700; font-size: calc(var(--pt) * 16); }
.pdfp-emis { color: #6b7280; font-size: calc(var(--pt) * 9); margin-top: calc(var(--pt) * 2); }
.pdfp-h { margin-top: calc(var(--pt) * 6); color: #1f5fbf; font-weight: 700; }
.pdfp-h2 { margin-top: calc(var(--pt) * 9); }
.pdfp-desc { white-space: pre-wrap; margin-bottom: calc(var(--pt) * 4); }
.pdfp-l th { background: #f4a300; color: #fff; font-weight: 700; text-align: center; vertical-align: middle; }
.pdfp-l td { font-weight: 700; }
.pdfp-l td + td { text-align: center; }
.pdfp-l tbody tr:nth-child(even) td { background: #f7f7f7; }   /* lignes 2, 4, 6… comme le générateur */
.pdfp-t { margin-top: calc(var(--pt) * 8); }
.pdfp-t td { color: #fff; font-weight: 700; background: #f4a300; }
.pdfp-t td + td { background: #f6b43a; text-align: right; }
.pdfp-mode { margin-top: calc(var(--pt) * 8); color: #6b7280; font-size: calc(var(--pt) * 9); font-weight: 700; }
.pdfp-mode + .pdfp-mode { margin-top: calc(var(--pt) * 2); }
.pdfp-pour { text-align: right; font-weight: 700; margin-top: calc(var(--pt) * 2); }
@media (max-width: 1180px) {
  .ed-vue { display: inline-flex; }
  .ed-grille { grid-template-columns: minmax(0, 1fr); }
  .ed-grille .ed-apercu { display: none; position: static; max-height: none; overflow: visible; }
  .ed-grille.voir-apercu .ed-apercu { display: grid; }
  .ed-grille.voir-apercu .ed-col { display: none; }
  .ed-pdf { height: 78vh; min-height: 420px; }
  .ed-barre { top: calc(env(safe-area-inset-top, 0px) + 56px); }
}
@media (max-width: 760px) {
  .prevision { padding: 10px; }
  .prev-tot { width: 100%; border-right: 0; padding-right: 0; }
  .prev-item { flex: 1 1 140px; }
  .ed-champs { grid-template-columns: 1fr 1fr; }
  .ed-champs .f-client { grid-column: 1 / -1; }
  .ed-l, .ed-lignes.ro .ed-l { grid-template-columns: 1fr 1fr 1fr; gap: 6px 8px; padding: 10px; }
  .ed-l .c-d { grid-column: 1 / -1; }
  .ed-l .c-tot { grid-column: 2; }
  .ed-freq { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .ed-freq > .small { display: none; }
  .chip-l { flex: none; max-width: 78vw; }
  .dev-seg { width: 100%; overflow-x: auto; }
  .dev-seg button { flex: 1 0 auto; white-space: nowrap; }
  .ed-l .c-tot b { justify-content: flex-start; font-size: 15px; }
  .ed-l .c-act { grid-column: 3; align-self: end; }
  .ed-l:not(:first-child) .ed-c > span { position: static; width: auto; height: auto; clip: auto; }
  .ed-actions .btn { flex: 1 1 auto; }
  .ed-pdfst { margin-left: 0; width: 100%; }
  .ed-totaux { width: 100%; }
  .ed-titre h2 { font-size: 20px; }
  .ed-tete, .ed-bloc { padding: 14px; }
}
/* v2.3 — identité, démonstration, contrats */
.logo-tuile.perso { object-fit: contain; background: #fff; }
.login-banniere.perso { display: grid; place-items: center; min-height: 150px; background: linear-gradient(135deg, #1747c9 0%, #0f2f8f 100%); }
.ban-perso { display: flex; align-items: center; gap: 16px; padding: 22px; color: #fff; font: 700 20px var(--f-display); }
.ban-perso img { width: 72px; height: 72px; object-fit: contain; border-radius: 16px; background: #fff; padding: 6px; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .45); }
.demo-band .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.demo-band .demo-txt { flex: 1 1 280px; }
.demo-band .seg button { white-space: nowrap; }
#btn-demo { font-weight: 700; }
.reg-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.reg-bloc { padding: 16px 18px; display: grid; gap: 12px; }
.reg-bloc h3 { margin: 0; }
.reg-demo { grid-column: 1 / -1; }
.reg-demo p { margin: 0; font-size: 14px; }
.reg-champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.reg-apercu { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; background: var(--creux, var(--band)); }
.reg-apercu img { width: 56px; height: 56px; object-fit: contain; border-radius: 14px; background: #fff; box-shadow: 0 6px 16px -10px rgba(13, 42, 122, .5); }
.reg-apercu div { display: grid; gap: 2px; min-width: 0; }
.reg-apercu b { font: 700 18px var(--f-display); }
.reg-apercu span { font-size: 13px; color: var(--muted); }
.reg-apercu small { font-size: 12px; color: var(--muted); }
.reg-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.depot-logo { cursor: pointer; }
.reg-pied { margin-top: 14px; }
.auto-carte { padding: 16px 18px; display: grid; gap: 12px; margin-bottom: 14px; }
.auto-tete { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.auto-tete > div:first-child { display: grid; gap: 3px; }
.auto-etat { display: inline-flex; align-items: center; gap: 8px; font: 700 17px var(--f-display); }
.auto-etat::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.auto-etat.ok::before { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.auto-etat.warn::before { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); }
.auto-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.auto-reglages { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.auto-planif { display: inline-flex; align-items: center; gap: 8px; font: 600 12.5px var(--f-body); color: var(--neutral); }
.auto-planif select { min-height: 36px; border: 1px solid var(--rule); border-radius: 9px; background: var(--sheet); color: var(--ink); padding: 0 8px; font: 600 13px var(--f-body); }
.auto-regle { margin: 0; }
.auto-alerte { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; background: var(--warn-bg); color: var(--warn); font-size: 13.5px; }
.auto-alerte svg { width: 18px; height: 18px; flex: none; }
.con-duo { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; margin-bottom: 14px; }
.con-duo > .carte { padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.con-duo > .carte:only-child { grid-column: 1 / -1; }
.con-duo .entete-c, section.carte > .entete-c { display: flex; align-items: baseline; gap: 10px; }
.con-duo .entete-c h3 { margin: 0; flex: 1 1 auto; }
.con-ret { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) auto auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 13.5px; }
tr[data-con-f], td[data-con-f] { cursor: pointer; }
td.c-retard span { background: var(--bad-bg, #fde8e8); color: var(--bad); font-weight: 700; }
td.c-plan span { background: var(--accent-soft); color: var(--a-fg, #123a9c); }
td.c-envoyer span { background: var(--warn-bg); color: var(--warn); outline: 1.5px dashed var(--warn); }
.legende-c i.c-retard { background: var(--bad-bg, #fde8e8); } .legende-c i.c-plan { background: var(--accent-soft); } .legende-c i.c-envoyer { background: var(--warn-bg); outline: 1.5px dashed var(--warn); }
th.cel-cour { color: var(--accent); }
.con-nom { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.con-nom:hover .tiers { text-decoration: underline; }
.con-journal summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none; }
.con-journal summary::-webkit-details-marker { display: none; }
.con-journal summary h3 { margin: 0; flex: 1 1 auto; }
.con-journal summary::after { content: "▾"; color: var(--muted); }
.con-journal[open] summary::after { content: "▴"; }
.con-j { display: grid; grid-template-columns: 90px 112px minmax(0, 1.2fr) minmax(0, 1.4fr); gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 13px; }
section.carte:has(> .con-journal) { padding: 14px 16px; }
.con-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.con-form .f2 { grid-column: span 2; } .con-form .f3 { grid-column: 1 / -1; }
.con-form .radio { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; padding: 4px 0; }
.con-form .radio input[type=radio] { width: 18px; height: 18px; min-height: 0; flex: none; margin: 0 4px 0 0; padding: 0; border: 0; box-shadow: none; background: none; -webkit-appearance: radio; appearance: auto; accent-color: var(--accent); }
.con-form input.mini { width: 64px; min-height: 34px; padding: 0 8px; border: 1px solid var(--rule); border-radius: 8px; font: 600 14px var(--f-body); text-align: center; }
.con-form .con-envoi { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--creux, var(--band)); }
.con-form #ct-ttc { display: flex; align-items: center; min-height: 44px; font-size: 16px; }
.plan-liste { display: grid; gap: 4px; max-height: 50vh; overflow: auto; padding-right: 4px; }
.plan-liste h3 { margin: 10px 0 2px; font-size: 14px; }
.plan-l { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--rule); font-size: 13.5px; }
.plan-liste.rapport .plan-l { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
#form2 .seg-c { align-self: start; }
@media (max-width: 1180px) { .con-duo { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .reg-grille, .reg-champs { grid-template-columns: minmax(0, 1fr); }
  .con-form { grid-template-columns: 1fr 1fr; } .con-form .f2 { grid-column: 1 / -1; }
  .con-ret { grid-template-columns: minmax(0, 1fr) auto; } .con-ret > span:nth-child(2) { grid-column: 1; }
  .con-j { grid-template-columns: 80px minmax(0, 1fr); } .con-j > span:nth-child(n+3) { grid-column: 1 / -1; }
  .auto-tete { flex-direction: column; } .auto-actions .btn { flex: 1 1 auto; }
  .plan-l { grid-template-columns: 76px minmax(0, 1fr) auto; } .plan-l .pill { display: none; }
  .demo-band .seg { width: 100%; } .demo-band .seg button { flex: 1 1 0; }
}
/* v2.3.1 — compte courant d'associé */
.cc-carte, .enc-carte { display: grid; gap: 12px; margin-bottom: 14px; }
.cc-carte .panneau-tete, .enc-carte .panneau-tete { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; }
.cc-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cc-au { display: inline-flex; align-items: center; gap: 8px; font: 600 12.5px var(--f-body); color: var(--neutral); }
.cc-au input { min-height: 36px; border: 1px solid var(--rule); border-radius: 9px; background: var(--sheet); color: var(--ink); padding: 0 8px; font: 600 13px var(--f-body); }
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chip { border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); border-radius: 999px; padding: 5px 11px; font: 600 12.5px var(--f-body); cursor: pointer; }
.cc-chip.on { background: var(--accent-soft); border-color: transparent; color: var(--a-fg, #123a9c); }
.cc-solde { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; }
.cc-solde span { font-weight: 700; }
.cc-solde b { font-family: var(--f-mono); font-size: 24px; font-weight: 500; }
.cc-solde small { flex-basis: 100%; color: var(--muted); font-size: 12.5px; }
.cc-solde.debiteur { background: var(--bad-bg, #fde8e8); color: var(--bad); }
.cc-solde.debiteur small { color: inherit; opacity: .8; }
.cc-familles { display: grid; gap: 2px; }
.cc-fam { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.cc-fam span { display: grid; gap: 1px; } .cc-fam small { color: var(--muted); font-size: 12px; }
.cc-fam b, .cc-liste .m { font-family: var(--f-mono); font-weight: 500; white-space: nowrap; }
.cc-fam b.neg, .cc-liste .m.neg { color: var(--bad); }
.cc-mouv summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none; }
.cc-mouv summary::-webkit-details-marker { display: none; }
.cc-mouv summary h3 { margin: 0; flex: 1 1 auto; font-size: 15px; }
.cc-mouv summary::after { content: "▾"; color: var(--muted); }
.cc-mouv[open] summary::after { content: "▴"; }
.cc-filtre { margin: 10px 0 6px; }
.cc-liste { max-height: 420px; overflow-y: auto; }
.enc-l .d { overflow-wrap: anywhere; }
.enc-autres summary { cursor: pointer; font: 600 13px var(--f-body); color: var(--neutral); padding: 4px 0; }
.cc-sens { display: grid; gap: 6px; }
.dbl-niv { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--warn); margin-left: 6px; }
@media (max-width: 760px) {
  .cc-outils .espace { display: none; } .cc-outils .btn { flex: 1 1 auto; }
  .cc-solde b { font-size: 20px; }
}
/* v2.3.2 — contrats depuis la fiche client, documents joints aux devis */
.contrat-l { display: grid; gap: 3px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--rule); background: none; padding: 10px 4px; font: inherit; color: inherit; cursor: pointer; border-radius: 8px; }
.contrat-l:first-of-type { border-top: 0; }
.contrat-l:hover { background: var(--creux, var(--band)); }
.contrat-l .cz-tete { display: flex; align-items: baseline; gap: 6px; }
.con-filtre { margin-left: auto; }
.con-etat { display: inline-block; margin-left: 6px; font-size: 11.5px; font-weight: 700; color: var(--accent); }
.con-inactif { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.con-resume { padding: 10px 12px; border-radius: 12px; background: var(--creux, var(--band)); font-size: 13.5px; display: grid; gap: 4px; }
.con-resume .tag-c { justify-self: start; }
.ed-docs { display: grid; gap: 6px; }
.ed-doc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 10px; }
.ed-doc .t { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 220px; min-width: 0; }
.ed-doc .t svg { width: 15px; height: 15px; flex: none; }
.ed-doc .t b { overflow-wrap: anywhere; }
.ed-docs-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.ed-docs-act select { min-height: 34px; border: 1px solid var(--rule); border-radius: 9px; background: var(--sheet); color: var(--ink); padding: 0 8px; font: 600 13px var(--f-body); max-width: 100%; }
.doc-devis { font-size: 11.5px; color: var(--accent); font-weight: 600; }
.reg-demo { opacity: .85; }
.reg-demo h3 { font-size: 14px; }
