/* ===== MIS Compta — charte commune avec MIS Atelier ===== */
@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url(../fonts/figtree-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-display: swap; src: url(../fonts/figtree-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url(../fonts/figtree-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700 900; font-display: swap; src: url(../fonts/figtree-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage"; font-weight: 700; font-display: swap; src: url(../fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage"; font-weight: 800; font-display: swap; src: url(../fonts/bricolage-grotesque-latin-800-normal.woff2) format("woff2"); }

:root {
  --bg: #eef0f4; --surface: #ffffff; --surface-2: #f7f8fa; --line: #dde2ea; --line-2: #eef0f4;
  --text: #111827; --muted: #5b6475; --faint: #8a93a3;
  --navy: #0f172a; --accent: #1d4ed8; --accent-bg: #eef3ff; --accent-bd: #9db4f0;
  --brand: #0f766e; --brand-bg: #e7f6f3;   /* MIS Compta : sarcelle */
  --ok: #15803d; --ok-bg: #e9f8ef; --warn: #b45309; --warn-bg: #fdf3e6; --danger: #b91c1c; --danger-bg: #fdecec;
  --debit: #1d4ed8; --debit-bg: #eaf1ff; --credit: #c2410c; --credit-bg: #fff1e8;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 2px 10px rgba(15,23,42,.05);
  --display: "Bricolage", "Figtree", system-ui, sans-serif;
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.spacer { flex: 1; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.sr { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 20px; min-height: 60px; background: var(--navy); color: #e2e8f0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 18px; white-space: nowrap; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; font-family: "Figtree"; font-size: 11.5px; letter-spacing: .04em; color: #fff; }
.modules { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #1e293b; }
.modules a, .modules span { padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: #e2e8f0; text-decoration: none; }
.modules .on { background: var(--brand); color: #fff; font-weight: 700; }
.modules .soon { color: #94a3b8; }
.modules .soon small { font-size: 10.5px; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav a { color: #cbd5e1; text-decoration: none; padding: 8px 10px; font-size: 14px; border-radius: 8px; font-weight: 600; position: relative; }
.nav a:hover { background: #1e293b; }
.nav a.active { background: #1e293b; color: #fff; box-shadow: inset 0 -2px 0 var(--brand); }
.nav a .badge { position: absolute; top: -4px; right: -4px; background: #fbbf24; color: #451a03; font-size: 10.5px; font-weight: 800; padding: 0 6px; border-radius: 99px; }
.socsel { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 10px; border-radius: 9px; border: 1px solid #334155; background: #1e293b; color: #f1f5f9; font-weight: 600; font-size: 13.5px; }
.socsel select { background: transparent; border: 0; color: #f1f5f9; font-weight: 600; max-width: 180px; cursor: pointer; }
.socsel select option { color: var(--text); }
.socsel .dot { width: 10px; height: 10px; border-radius: 50%; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #e2e8f0; white-space: nowrap; font-weight: 600; }
.btn-ghost-dark { background: transparent; border: 1px solid #334155; color: #cbd5e1; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-weight: 500; }
.btn-ghost-dark:hover { background: #1e293b; }
@media (max-width: 900px) { .topbar { position: static; } .modules { display: none; } }

/* ---------- page ---------- */
.page { max-width: 1360px; margin: 0 auto; padding: 22px 24px 48px; display: flex; flex-direction: column; gap: 18px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.kicker { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
h1.title { font-family: var(--display); font-weight: 800; font-size: 28px; margin: 4px 0 0; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.panel > h2, h2.h { margin: 0 0 12px; font-family: var(--display); font-size: 18px; font-weight: 700; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- boutons, champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: #c3cad6; background: var(--surface-2); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.brand { background: var(--brand); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(15,118,110,.25); }
.btn.ok { background: var(--ok); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(21,128,61,.25); }
.btn.draft { background: #fbbf24; color: #451a03; border-color: transparent; box-shadow: 0 6px 18px rgba(180,83,9,.2); }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 52px; padding: 0 22px; font-size: 16px; font-weight: 800; border-radius: 12px; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary:hover, .btn.brand:hover, .btn.ok:hover, .btn.draft:hover { filter: brightness(1.06); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .cell:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29,78,216,.14); }
.readonly-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 0 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line); font-weight: 600; }
.hint { font-size: 12.5px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: #166534; }
.chip.warn { background: var(--warn-bg); color: #92400e; }
.chip.err { background: var(--danger-bg); color: #991b1b; }
.chip.info { background: var(--accent-bg); color: var(--accent); }
.jbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; padding: 3px 8px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tog { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.tog input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- tableaux ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--surface-2); }
.tbl tr.sub td { background: #f7f8fc; font-weight: 700; font-size: 13px; }
.tbl tr.total td { background: var(--navy); color: #fff; font-weight: 700; }
.tbl tr.group td { padding-top: 16px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); border-bottom: 0; }
.tbl .acc { font-weight: 700; font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- tableau de bord ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.kpi .k { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.kpi .k i { width: 10px; height: 10px; border-radius: 3px; }
.kpi .v { font-family: var(--display); font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi .n { font-size: 12.5px; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 210px; border-bottom: 1px solid var(--line); padding-top: 10px; }
.bars .m { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; justify-content: flex-end; }
.bars .pair { display: flex; align-items: flex-end; gap: 3px; height: 100%; }
.bars .b { width: 12px; border-radius: 4px 4px 0 0; min-height: 1px; }
.bars .lab { font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.todo li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.todo .cnt { min-width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 17px; }

/* ---------- saisie ---------- */
.steps { list-style: none; margin: 0; padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps li { display: flex; align-items: center; gap: 10px; flex: 1 1 170px; font-weight: 600; color: var(--muted); font-size: 14px; }
.steps li b { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #e6e9f2; color: var(--text); flex-shrink: 0; }
.steps li.cur { color: var(--text); }
.steps li.cur b { background: var(--accent); color: #fff; }
.steps li.done { color: var(--text); }
.steps li.done b { background: var(--ok); color: #fff; }
.jtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.jtile { --c: #475569; display: flex; align-items: center; gap: 14px; min-height: 80px; padding: 12px 14px; border-radius: 16px; border: 2px solid color-mix(in srgb, var(--c) 18%, #fff); background: color-mix(in srgb, var(--c) 9%, #fff); text-align: left; cursor: pointer; }
.jtile .code { width: 54px; height: 54px; border-radius: 14px; background: var(--c); color: #fff; display: grid; place-items: center; font-family: var(--display); font-size: 20px; font-weight: 800; flex-shrink: 0; letter-spacing: .02em; }
.jtile .t { display: flex; flex-direction: column; gap: 2px; }
.jtile .t b { font-size: 16px; }
.jtile .t span { font-size: 12.5px; color: var(--text); }
.jtile:hover { border-color: var(--c); }
.jtile.on { background: var(--c); border-color: var(--c); color: #fff; }
.jtile.on .code { background: var(--surface); color: var(--c); }
.jtile.on .t span { color: #fff; }
.docgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.docgrid .wide { grid-column: span 2; }
@media (max-width: 600px) { .docgrid .wide { grid-column: auto; } }

.lines { min-width: 940px; }
.lhead, .lrow { display: grid; grid-template-columns: 170px minmax(0, 1.4fr) minmax(0, 1fr) 150px 150px 40px; gap: 10px; align-items: center; padding: 8px 16px; }
.lhead { background: var(--surface-2); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lhead .num { text-align: right; }
.lrow { border-bottom: 1px solid var(--line-2); }
.lrow.auto { background: var(--surface-2); }
.band { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.band b { font-family: var(--display); font-size: 15px; letter-spacing: .05em; }
.band span { font-size: 13px; color: var(--text); }
.band.d { background: var(--debit-bg); } .band.d b { color: var(--debit); }
.band.c { background: var(--credit-bg); } .band.c b { color: var(--credit); }
.cell { width: 100%; min-height: 40px; padding: 6px 10px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--surface); }
.cell.acc { font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.cell.amt { text-align: right; font-weight: 700; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.cell.amt.computed { background: var(--accent-bg); border-color: var(--accent-bd); color: #1e3a8a; }
.accname { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.accname b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accname small { font-size: 12px; color: var(--accent); font-weight: 600; }
.accname.unknown b { color: var(--danger); }
.accname.vague b { color: var(--muted); font-weight: 500; }
.autoamt { display: flex; align-items: center; justify-content: flex-end; min-height: 40px; padding: 0 10px; border-radius: 9px; background: var(--accent-bg); border: 1px dashed var(--accent-bd); font-weight: 700; font-size: 15.5px; color: #1e3a8a; font-variant-numeric: tabular-nums; }
.autotag { display: inline-flex; margin-left: 8px; font-size: 10.5px; font-weight: 800; color: var(--accent); background: #dbe5ff; padding: 1px 7px; border-radius: 99px; vertical-align: 1px; }
.lockacc { display: flex; align-items: center; gap: 8px; padding: 0 10px; font-weight: 800; color: #1e3a8a; }
.rm { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.rm:hover { color: var(--danger); border-color: #f5b5b5; }
.addl { margin: 8px 16px 10px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 11px; border: 2px dashed currentColor; background: var(--surface); font-weight: 700; cursor: pointer; }
.addl.d { color: var(--debit); } .addl.c { color: var(--credit); }
.totbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 20px; background: var(--navy); color: #fff; }
.totbar .t { display: flex; flex-wrap: wrap; gap: 26px; font-size: 14px; font-variant-numeric: tabular-nums; }
.totbar strong { font-size: 18px; margin-left: 6px; }
.eq { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 800; }
.eq.ok { background: #34d399; color: #052e1f; }
.eq.ko { background: #fca5a5; color: #450a0a; }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.kbd { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
kbd { font-family: inherit; font-size: 12px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; }

/* liste de suggestions de comptes */
.ac-box { position: fixed; z-index: 60; width: 380px; max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(15,23,42,.18); padding: 6px; }
.ac-box .opt { display: flex; gap: 10px; align-items: baseline; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.ac-box .opt b { min-width: 86px; font-variant-numeric: tabular-nums; }
.ac-box .opt small { margin-left: auto; color: var(--accent); font-weight: 700; font-size: 11.5px; }
.ac-box .opt.sel, .ac-box .opt:hover { background: var(--accent-bg); }
.ac-box .new { color: var(--brand); font-weight: 700; }
.ac-box .foot { padding: 7px 10px 4px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-2); margin-top: 4px; }

/* ---------- onglets ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button, .tabs a { min-height: 40px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--text); display: inline-flex; align-items: center; }
.tabs .on { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filters .field { flex: 1 1 150px; }

/* ---------- fenêtre modale ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(15,23,42,.5); }
dialog form, dialog .dlg { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
dialog h2 { margin: 0; font-family: var(--display); font-size: 20px; }
dialog .btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------- divers ---------- */
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #0f172a; color: #f1f5f9; padding: 11px 15px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); font-size: 14px; max-width: 440px; }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.alert.warn { background: var(--warn-bg); color: #92400e; border: 1px solid #f3d3a5; }
.alert.err { background: var(--danger-bg); color: #991b1b; border: 1px solid #f5b5b5; }
.alert.ok { background: var(--ok-bg); color: #166534; border: 1px solid #a7e3c0; }
.hero { border-radius: var(--radius); padding: 22px; background: #1e3a8a; color: #fff; display: flex; flex-direction: column; gap: 8px; }
.hero .big { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.hero span { color: #dbe5ff; font-size: 14px; }
.ca3 td.ln { width: 60px; }
.ca3 td.ln span { display: inline-flex; min-width: 38px; justify-content: center; padding: 3px 6px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 800; }
.copy.ghost { visibility: hidden; }
.copy { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); cursor: pointer; display: inline-grid; place-items: center; margin-left: 8px; vertical-align: middle; }
.lines-detail { background: var(--surface-2); }
.lines-detail td { font-size: 13px; padding: 6px 10px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% 0%, #1e3a8a 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #115e59 0%, transparent 55%), #0b1120; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--surface); border-radius: 18px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.4); display: flex; flex-direction: column; gap: 12px; }
.login-card .brand { color: var(--text); margin-bottom: 6px; }
.login-card .check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.login-card .err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------- impression des états ---------- */
.print-head { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: var(--surface); font-size: 10.5pt; }
  .topbar, .no-print, .toasts, .filters, .tabs, .head .btns { display: none !important; }
  .page { padding: 0; max-width: none; }
  .panel { border: 0; box-shadow: none; padding: 0; }
  .print-head { display: block; margin-bottom: 8px; }
  .tbl th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tbl tr.total td { background: #222 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tbl td, .tbl th { padding: 4px 6px; }
  .tbl-wrap { overflow: visible; }
}

/* ---------- v0.2 : menus, pointage, saisie au kilomètre ---------- */
.menu-pop { position: absolute; right: 0; top: 46px; z-index: 40; min-width: 320px; max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(15,23,42,.18); padding: 6px; display: flex; flex-direction: column; }
.menu-pop button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.menu-pop button:hover { background: var(--accent-bg); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; width: 100%; }
.split { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
.acclist { display: flex; flex-direction: column; max-height: 70vh; overflow: auto; }
.acclist button { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line-2); background: var(--surface); text-align: left; cursor: pointer; }
.acclist button:hover { background: var(--surface-2); }
.acclist button.on { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--accent); }
.acclist b { font-variant-numeric: tabular-nums; }
.acclist small { display: block; color: var(--muted); font-size: 12px; }
.selbar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 18px; background: var(--navy); color: #fff; }
.selbar .t { display: flex; gap: 20px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.lettre { display: inline-flex; min-width: 30px; justify-content: center; padding: 2px 8px; border-radius: 7px; background: #dcfce7; color: #166534; font-weight: 800; font-size: 12.5px; }
.tbl tr.sel td { background: #eef3ff; }
.tbl input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.cand { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cand button { font-size: 12.5px; padding: 4px 9px; border-radius: 8px; border: 1px solid var(--accent-bd); background: var(--accent-bg); color: #1e3a8a; cursor: pointer; font-weight: 600; }
.amt-pos { color: var(--ok); font-weight: 700; }
.amt-neg { color: var(--danger); font-weight: 700; }
.drop { position: relative; overflow: hidden; border: 2px dashed var(--accent-bd); border-radius: 14px; padding: 22px; text-align: center; background: var(--surface-2); cursor: pointer; }
.drop.over { background: var(--accent-bg); border-color: var(--accent); }
.km { width: 100%; border-collapse: collapse; min-width: 980px; }
.km th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.km td { padding: 4px 6px; border-bottom: 1px solid var(--line-2); }
.km td .cell { min-height: 36px; }
.km tr.pstart td { border-top: 2px solid var(--line); }
.km tr.auto td { background: var(--surface-2); }
.km tr.ko td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.km tr.ok td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.km .nm { font-size: 12.5px; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps.small li { flex: 1 1 140px; font-size: 13.5px; }

.lrow.auto .accname b { white-space: normal; }
.alert svg { flex-shrink: 0; }

/* sélecteur de modules du PGI MIS : une couleur par module (Atelier magenta, Facturation orange, Compta sarcelle) */
.modules a[data-m], .modules span[data-m] { display: inline-flex; align-items: center; gap: 7px; }
.modules [data-m]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mc); flex-shrink: 0; }
.modules .on[data-m]::before { background: var(--surface); }
.modules [data-m=atelier] { --mc: #e0119d; }
.modules [data-m=facture] { --mc: #f97316; }
.modules [data-m=compta] { --mc: #14b8a6; }

/* Écritures reçues de MIS Facture à vérifier : compteur qui pulse */
.nav a .badge.pulse { background: #ef4444; color: #fff; animation: pulse-verif 1.3s ease-in-out infinite; }
@keyframes pulse-verif { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.7); transform: scale(1); } 40% { transform: scale(1.2); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(239,68,68,0); transform: scale(1); } }
.todo .a-verifier .cnt { background: #ef4444; color: #fff; animation: pulse-verif 1.3s ease-in-out infinite; }
.chip.facture { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
/* animations Windows désactivées : pas de mouvement, mais un halo qui s'allume et s'éteint */
@media (prefers-reduced-motion: reduce) { .nav a .badge.pulse, .todo .a-verifier .cnt { animation: halo-verif 1.4s ease-in-out infinite; } }
@keyframes halo-verif { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } 50% { box-shadow: 0 0 0 4px rgba(239,68,68,.8); } }

/* ---------- lisibilité (04/10/2026) : trame du module, cadres délimités, zones de saisie marquées ---------- */
@media screen {
  :root { --bg: color-mix(in srgb, var(--brand) 8%, #eef0f4); }   /* trame légère à la couleur du module */
  .panel, .kpi, .steps { border-color: #cbd3de; box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 6px 18px rgba(15,23,42,.06); }
  /* titre de cadre : trait de la couleur du module + filet de séparation */
  .panel > h2, .panel > .panel-titre { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--line); font-family: var(--display); font-size: 18px; font-weight: 700; }
  .panel > h2::before, .panel > .panel-titre::before { content: ""; width: 5px; height: 20px; border-radius: 3px; background: var(--brand); flex-shrink: 0; }
  .panel > .panel-titre { margin: 0; padding: 14px 20px 12px; }
  /* étiquettes plus lisibles, champs bien détachés du fond blanc */
  .field > label, .lbl { color: #334155; }
  .input, .field input, .field select, .field textarea, .cell { background: var(--surface-2); border-color: #b6c0ce; }
  .input:hover, .field input:hover, .field select:hover, .field textarea:hover, .cell:hover { border-color: #8f9bad; }
  .input:focus, .field input:focus, .field select:focus, .field textarea:focus, .cell:focus { background: var(--surface); }
  .input:disabled, .field input:disabled, .field select:disabled, .field textarea:disabled, .cell:disabled { background: var(--surface-2); border-color: var(--line); border-style: dashed; color: var(--muted); }
  /* boutons secondaires : contour net, léger relief */
  .btn { border: 1.5px solid #c3cbd7; box-shadow: 0 1px 2px rgba(15,23,42,.07); }
  .btn:hover { border-color: #8f9bad; }
  .btn.primary, .btn.brand, .btn.ok, .btn.draft { border-color: transparent; }
  /* actions d'en-tête (Créer un avoir, Dupliquer…) : grandes, icône à la couleur du module */
  .head .btn.act { min-height: 46px; padding: 0 18px; font-size: 15px; font-weight: 700; border-color: color-mix(in srgb, var(--brand) 45%, #c3cbd7); }
  .head .btn.act svg { color: var(--brand); }
  .head .btn.act:hover { background: var(--brand-bg); border-color: var(--brand); }
  .head .btn.act.danger { border-color: #e7b4b4; }
  .head .btn.act.danger svg { color: var(--danger); }
  .head .btn.act.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
}

/* croix de fermeture des fenêtres */
dialog .dlg-x { position: sticky; top: 10px; float: right; z-index: 5; margin: 10px 10px -44px 0; width: 34px; height: 34px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer; }
dialog .dlg-x:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
dialog h2 { padding-right: 44px; }

/* ---------- vivacité (05/10/2026) : trame sarcelle, couleur du module plus présente, tableau de bord ---------- */
@media screen {
  :root { --bg: #e6f1ef; --brand-dark: #115e59; --brand-soft: #ccfbf1; }
  body { background: linear-gradient(180deg, #d3ebe6 0, var(--bg) 220px) no-repeat, var(--bg); }
  .kicker { color: var(--brand); }
  .tabs .on { background: var(--brand); border-color: var(--brand); box-shadow: 0 4px 12px rgba(15,118,110,.25); }
  .tabs button:hover:not(.on), .tabs a:hover:not(.on) { border-color: var(--brand); color: var(--brand-dark); }
  .tbl th { background: #eaf6f4; color: #134e4a; border-bottom-color: #c8e6e0; }
  .tbl tr.clickable:hover td { background: #f0faf8; }
  .chip.ok { background: #dcfce7; color: #166534; box-shadow: inset 0 0 0 1px #bbf7d0; }
  .chip.err { background: #fee2e2; color: #991b1b; box-shadow: inset 0 0 0 1px #fecaca; }
  .chip.warn { background: #fef3c7; color: #92400e; box-shadow: inset 0 0 0 1px #fde68a; }
  .panel { border-color: #c9ded9; }
}

/* tableau de bord */
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.action { --c: var(--brand); position: relative; display: flex; align-items: center; gap: 14px; min-height: 86px; padding: 14px 16px; border-radius: 16px;
  border: 2px solid color-mix(in srgb, var(--c) 35%, #fff); background: color-mix(in srgb, var(--c) 8%, #fff); color: var(--c);
  text-decoration: none; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.action:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,.10); border-color: var(--c); }
.action .ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--c); flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.action .t { display: flex; flex-direction: column; gap: 3px; }
.action .t b { font-family: var(--display); font-size: 18px; font-weight: 800; }
.action .t span { font-size: 13px; color: var(--text); font-weight: 600; }
.action.brand { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 22px rgba(15,118,110,.30); }
.action.brand .t span { color: #ccfbf1; }
.action.brouill { --c: #b45309; }
.action.banque { --c: #1d4ed8; }
.action.tva { --c: #7c3aed; }
.act-badge { position: absolute; top: -9px; right: 12px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 99px; background: #b45309; color: #fff;
  font-weight: 800; font-size: 13px; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(180,83,9,.35); }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.dkpi { --c: var(--brand); position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 14px 20px; border-radius: 14px; background: var(--surface);
  border: 1px solid #c9ded9; box-shadow: var(--shadow); text-decoration: none; color: var(--text); overflow: hidden; }
.dkpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--c); }
.dkpi:hover { border-color: var(--c); }
.dkpi .k { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--c); }
.dkpi .v { font-family: var(--display); font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.dkpi .n { font-size: 12.5px; color: var(--muted); }
.graph-vide { margin-top: 14px; padding: 36px 20px; border-radius: 12px; border: 1.5px dashed #b7d8d1; background: #f3faf8; color: #134e4a;
  text-align: center; font-weight: 600; }

/* impression du plan comptable (Paramétrage › Plan comptable › Imprimer) */
@media print {
  body.page-param .head { display: none !important; }
  .plan-tbl td.acc { font-weight: 700; }
  .plan-tbl tr { break-inside: avoid; }
  .plan-tbl thead { display: table-header-group; }
  .plan-tbl .chip { border: 0; background: none !important; padding: 0; }
}

/* ---------- accessibilité et harmonisation (audit du 06/10/2026) ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar :focus-visible { outline-color: #fff; }
.tbl th.num { text-align: right; }
@media (max-width: 1440px) {
  .topbar { gap: 8px 10px; padding: 8px 14px; }
  .brand .brand-nom, .userbox .user-nom { display: none; }
  .nav a { padding: 8px 7px; font-size: 13.5px; }
  .modules a, .modules span { padding: 6px 9px; font-size: 12.5px; }
}

/* ---------- saisie : pièce enregistrée + « Nouvelle saisie » en bas de page ---------- */
.saisie-faite { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 14px 0 0; border-radius: 14px;
  background: var(--ok-bg); border: 1.5px solid var(--ok); color: var(--ok); }
.saisie-faite.hidden { display: none; }
.saisie-faite > span { flex: 1; }
.saisie-faite small { color: var(--muted); }

/* ---------- brouillard : pré-validation (« Vérifiée ») et barre de sélection ---------- */
.verif { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13px;
  border: 1.5px solid var(--warn); color: var(--warn); background: var(--warn-bg); white-space: nowrap; user-select: none; }
.verif input { width: 16px; height: 16px; margin: 0; accent-color: var(--ok); cursor: pointer; }
.verif.on { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.verif-cell .hint { margin-top: 3px; white-space: nowrap; }
tr.verifiee td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin: 0 0 12px; border-radius: 12px;
  background: var(--surface); border: 1.5px solid var(--line); }
.selbar b { margin-right: auto; color: var(--text); font-size: 14.5px; }
.br-actions { display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
.br-actions .btn { justify-content: flex-start; }
.br-lib { min-width: 220px; }
.selbar.hidden { display: none; }

/* ---------- en-tête commun du PGI MIS (option A) : bande blanche d'identité + menu teinté + pied de page ---------- */
.modbar { position: sticky; top: 0; z-index: 31; display: flex; align-items: center; gap: 14px; padding: 8px 20px; background: var(--surface);
  border-bottom: 1px solid var(--line); font-family: "Figtree", Arial, sans-serif; }
.modbar + .topbar { top: var(--mb, 0px); }
.modbar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mb-ident { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.mb-logo { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 12.5px; letter-spacing: .04em; flex: none; }
.mb-txt { display: flex; flex-direction: column; }
.mb-t { font-family: var(--display, "Bricolage"), "Figtree", sans-serif; font-weight: 800; font-size: 21px; line-height: 1.05; white-space: nowrap; }
.mb-t b { color: var(--brand); }
.mb-s { font-size: 11.5px; color: #8a93a3; font-weight: 700; margin-top: 3px; letter-spacing: .02em; white-space: nowrap; }
.mb-sep { width: 1px; height: 30px; background: #e5e7eb; margin: 0 2px; }
.mb-aller { font-size: 11px; font-weight: 800; color: #8a93a3; letter-spacing: .1em; text-transform: uppercase; }
.mb-mods { display: flex; gap: 8px; }
.mb-mod[data-m=atelier] { --m: #c0007f; } .mb-mod[data-m=facture] { --m: #c2410c; } .mb-mod[data-m=compta] { --m: #0f766e; }
.mb-mod { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 9px; font-weight: 800; font-size: 13.5px; color: var(--m);
  text-decoration: none; border: 1.5px solid color-mix(in srgb, var(--m) 35%, #fff); background: var(--surface); white-space: nowrap; }
.mb-mod:hover { background: color-mix(in srgb, var(--m) 8%, #fff); border-color: var(--m); }
.mb-sp { flex: 1; }
.modbar .rp-zone { margin-left: 0; }
.mb-user { display: flex; align-items: center; gap: 9px; padding: 3px 4px 3px 4px; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; font-size: 13.5px; color: #334155; white-space: nowrap; }
.mb-av { width: 30px; height: 30px; border-radius: 50%; background: #334155; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.mb-logout { border: 0; background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 6px 12px; font: inherit; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.mb-logout:hover { background: #e2e8f0; color: var(--text); }
/* menu du module : à la couleur du module, pour tous les comptes */
body.barre-teinte .topbar { background: var(--brand); }
body.barre-teinte .topbar .nav a { color: rgba(255,255,255,.9); display: inline-flex; align-items: center; gap: 7px; }
body.barre-teinte .topbar .nav a svg.mi { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
body.barre-teinte .topbar .nav a:hover { background: rgba(0,0,0,.14); }
body.barre-teinte .topbar .nav a.active { background: rgba(0,0,0,.22); color: #fff; box-shadow: inset 0 -3px 0 #fff; }
body.barre-teinte .topbar .btn-ghost-dark { border-color: rgba(255,255,255,.5); color: #fff; }
body.barre-teinte .topbar .btn-ghost-dark:hover { background: rgba(0,0,0,.14); }
/* pied de page : version et auteur */
.mis-pied { display: flex; gap: 14px; align-items: center; padding: 10px 24px 12px; margin-top: 24px; font-size: 11.5px; color: #8a93a3; border-top: 1px solid rgba(15,23,42,.07); }
.mis-pied b { color: var(--muted); }
.mis-pied .sp { flex: 1; }
@media (max-width: 1100px) { .mb-s, .mb-aller, .mb-nom { display: none; } .mb-t { font-size: 18px; } }
@media (max-width: 760px) { .mb-sep, .mb-mods .mb-mod { font-size: 0; gap: 0; } .mb-mod svg { width: 18px; height: 18px; } }
@media print { .modbar, .mis-pied { display: none !important; } }
body.tv .modbar, body.tv .mis-pied { display: none !important; }

/* ---------- finitions de l'en-tête (08/10/2026) : menu plus lisible, Déconnexion bien visible ---------- */
.mb-logout { border: 1.5px solid #dc2626; background: var(--surface); color: #b91c1c; padding: 5px 13px; font-weight: 800; }
.mb-logout:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
html[data-theme=dark] .mb-logout { color: #fca5a5; border-color: #ef4444; }
html[data-theme=dark] .mb-logout:hover { background: #dc2626; color: #fff; }
body.barre-teinte .topbar { box-shadow: 0 2px 6px rgba(15,23,42,.12); }
body.barre-teinte .topbar .nav a { font-size: 15px; font-weight: 700; color: #fff; padding: 9px 13px; }
body.barre-teinte .topbar .nav a svg.mi { width: 17px; height: 17px; opacity: 1; }
body.barre-teinte .topbar .nav a.active { font-weight: 800; }
/* boutons du menu (atelier : Messages, RDV sur site, gazole) et « En direct » : lisibles sur la couleur du module */
body.barre-teinte .topbar .bell { border: 1.5px solid rgba(255,255,255,.6); color: #fff; background: rgba(255,255,255,.12); font-weight: 700; font-size: 14px; }
body.barre-teinte .topbar .bell:hover { background: rgba(255,255,255,.24); }
body.barre-teinte .topbar .bell.has { border-color: #fff; background: rgba(255,255,255,.22); color: #fff; }
body.barre-teinte .topbar .fuel.alerte { background: #dc2626; border-color: #fff; }
body.barre-teinte .topbar .live { color: #fff; font-weight: 700; }
@media (max-width: 1200px) { body.barre-teinte .topbar .nav a { font-size: 14px; padding: 8px 9px; } }
/* recherche globale dans le menu (comme MIS Atelier) */
.search { position: relative; }
.search input { width: 100%; padding: 9px 14px 9px 36px; border-radius: 10px; border: 1px solid rgba(255,255,255,.55); background: var(--surface); color: var(--text);
  font: inherit; font-size: 14.5px; box-shadow: 0 1px 2px rgba(15,23,42,.12); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 3px solid rgba(255,255,255,.55); outline-offset: 1px; }
.search::before { content: "⌕"; position: absolute; left: 13px; top: 7px; color: var(--muted); font-size: 17px; z-index: 1; }
.topbar .search { flex: 0 1 440px; min-width: 180px; }
.search-results { position: absolute; right: 0; top: calc(100% + 6px); width: min(520px, 94vw); max-height: 70vh; overflow: auto; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.25); padding: 6px; z-index: 70; }
.search-results.hidden { display: none; }
.search-results .res { display: flex; gap: 10px; align-items: center; padding: 9px; border-radius: 8px; color: inherit; text-decoration: none; }
.search-results .res:hover, .search-results .res.on { background: var(--surface-2); }
.search-results .res b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.search-results .res.vide { color: var(--muted); }
.search-results .pill { color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; }
.search-results .m { color: var(--muted); font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .d { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; text-align: right; }

/* ---------- rappels et fin de journée (bande « Modules ») ---------- */
.rp-zone { position: relative; margin-left: auto; display: flex; gap: 8px; align-items: center; align-self: center; }
.modbar.onglets .rp-zone { margin-bottom: 7px; }
.rp-zone.hidden, .rp-zone .hidden { display: none !important; }
.rp-btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 10px; font: inherit; font-weight: 800; font-size: 13.5px; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface); color: var(--muted); white-space: nowrap; }
.rp-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rp-btn.rp-on { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.rp-btn .rp-n { background: #dc2626; color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 7px; }
.rp-fin { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.rp-fin.fini { border-color: #86efac; background: #f0fdf4; color: #15803d; }
.rp-panneau { position: absolute; right: 0; top: calc(100% + 8px); width: min(500px, 92vw); background: var(--surface); color: var(--text); border-radius: 14px; z-index: 60;
  box-shadow: 0 18px 40px rgba(15,23,42,.28); border: 1px solid var(--line); padding: 12px 14px; text-align: left; font-weight: 400; }
.rp-panneau h3 { margin: 4px 4px 8px; font-size: 16px; }
.rp-panneau .rp-h-fin { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.rp-sub { margin: -4px 4px 6px; font-size: 12.5px; color: var(--muted); }
.rp-vide { margin: 4px; color: #15803d; font-weight: 700; }
.rp-it { display: flex; gap: 12px; align-items: center; padding: 9px 6px; border-radius: 10px; --fg: #b45309; }
.rp-it.err { --fg: #b91c1c; }
.rp-it + .rp-it { border-top: 1px solid var(--line); }
.rp-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--fg); font-weight: 900; flex: none; }
.rp-it b { display: block; font-size: 14.5px; }
.rp-it div span { display: block; font-size: 12.5px; color: #5b6475; }
.rp-go { margin-left: auto; border: 1.5px solid var(--fg); color: var(--fg); background: var(--surface); border-radius: 8px; padding: 6px 10px; font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap; }
.rp-ck { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-top: 1px solid var(--line); font-size: 14px; }
.rp-box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none; padding: 0; font-weight: 900; color: #fff; cursor: pointer; }
.rp-box[disabled] { cursor: default; }
.rp-ck.fait .rp-box { background: #15803d; border-color: #15803d; }
.rp-ck.fait .rp-lib { color: var(--muted); text-decoration: line-through; }
.rp-act { margin-left: auto; border: 0; background: none; color: #1d4ed8; font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap; }
@media print { .rp-zone { display: none !important; } }

/* ---------- mode nuit (bouton ☀ / 🌙 de la bande blanche ; html[data-theme=dark]) ---------- */
html[data-theme=dark] {
  --bg: #0e1320; --surface: #171d2b; --surface-2: #1d2434; --line: #2b3446; --line-2: #222a3a;
  --text: #e6e9ef; --muted: #a7b0c0; --faint: #7f899c; --navy: #0b1020;
  --accent: #7aa2ff; --accent-bg: #1a2546; --accent-bd: #3a5bb0;
  --brand-bg: color-mix(in srgb, var(--brand) 22%, #171d2b); --teal-bg: #10302c;
  --ok: #4ade80; --ok-bg: #12301f; --warn: #fbbf24; --warn-bg: #33270f; --danger: #f87171; --danger-bg: #3a1719;
  --debit-bg: #1a2546; --credit-bg: #3a2214;
  --shadow: 0 1px 2px rgba(0,0,0,.45), 0 2px 12px rgba(0,0,0,.35);
  color-scheme: dark;
}
html[data-theme=dark] body { background: var(--bg); color: var(--text); }
html[data-theme=dark] input:not([type=checkbox]):not([type=radio]):not([type=range]), html[data-theme=dark] select, html[data-theme=dark] textarea {
  background-color: var(--surface-2); color: var(--text); border-color: var(--line); }
html[data-theme=dark] input::placeholder, html[data-theme=dark] textarea::placeholder { color: #6f7a8f; }
html[data-theme=dark] dialog { background: var(--surface); color: var(--text); }
html[data-theme=dark] [style*="background:#fff"], html[data-theme=dark] [style*="background: #fff"] { background: var(--surface) !important; }
html[data-theme=dark] [style*="color:#0f172a"], html[data-theme=dark] [style*="color: #0f172a"], html[data-theme=dark] [style*="color:#111827"] { color: var(--text) !important; }
html[data-theme=dark] .mb-mod { border-color: color-mix(in srgb, var(--m) 55%, #171d2b); color: color-mix(in srgb, var(--m) 55%, #fff); }
html[data-theme=dark] .mb-av { background: #475569; }
html[data-theme=dark] .mb-logout { background: var(--surface-2); color: var(--muted); }
html[data-theme=dark] .rp-btn { background: var(--surface-2); }
html[data-theme=dark] .rp-btn.rp-on { background: #33270f; color: #fcd34d; }
html[data-theme=dark] .rp-fin { background: #1a2546; color: #93c5fd; }
html[data-theme=dark] .rp-fin.fini { background: #12301f; color: #86efac; }
html[data-theme=dark] .rp-panneau, html[data-theme=dark] .rp-go { background: var(--surface); color: var(--text); }
html[data-theme=dark] .rp-it b { color: var(--text); }
html[data-theme=dark] .switch::after { background: #e6e9ef; }
/* impressions : toujours en clair */
@media print { html[data-theme=dark] {
  --bg: #eef0f4; --surface: #ffffff; --surface-2: #f7f8fa; --line: #dde2ea; --line-2: #eef0f4;
  --text: #111827; --muted: #5b6475; --faint: #8a93a3;
  --navy: #0f172a; --accent: #1d4ed8; --accent-bg: #eef3ff; --accent-bd: #9db4f0;
  --brand: #0f766e; --brand-bg: #e7f6f3;   /* MIS Compta : sarcelle */
  --ok: #15803d; --ok-bg: #e9f8ef; --warn: #b45309; --warn-bg: #fdf3e6; --danger: #b91c1c; --danger-bg: #fdecec;
  --debit: #1d4ed8; --debit-bg: #eaf1ff; --credit: #c2410c; --credit-bg: #fff1e8;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 2px 10px rgba(15,23,42,.05);
  --display: "Bricolage", "Figtree", system-ui, sans-serif;
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
  color-scheme: light; } html[data-theme=dark] body { background: #fff; color: #111827; } }
/* bouton jour / nuit */
.mb-theme { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.mb-theme:hover { color: var(--text); border-color: var(--muted); }
.mb-theme svg { width: 18px; height: 18px; }

/* ---------- mode nuit : équivalents sombres générés (darkgen.py) ---------- */
@media screen {
:where(html[data-theme=dark]) .nav a .badge { color: #f6b28e; }
:where(html[data-theme=dark]) .btn.draft { color: #f6b28e; }
:where(html[data-theme=dark]) .chip.ok { color: #9ae9b8; }
:where(html[data-theme=dark]) .chip.warn { color: #f4b68f; }
:where(html[data-theme=dark]) .chip.err { color: #ed9797; }
:where(html[data-theme=dark]) .tbl tr.sub td { background: #1e2234; }
:where(html[data-theme=dark]) .steps li b { background: #212531; }
:where(html[data-theme=dark]) .jtile { background: color-mix(in srgb, var(--c) 9%, #1d2434); }
:where(html[data-theme=dark]) .cell.amt.computed { color: #9aafe9; }
:where(html[data-theme=dark]) .autoamt { color: #9aafe9; }
:where(html[data-theme=dark]) .autotag { background: #121f3f; }
:where(html[data-theme=dark]) .lockacc { color: #9aafe9; }
:where(html[data-theme=dark]) .eq.ok { color: #91f3cf; }
:where(html[data-theme=dark]) .eq.ko { background: #3f1212; color: #f09494; }
:where(html[data-theme=dark]) .alert.warn { color: #f4b68f; }
:where(html[data-theme=dark]) .alert.err { color: #ed9797; border-color: #2b3446; }
:where(html[data-theme=dark]) .alert.ok { color: #9ae9b8; }
:where(html[data-theme=dark]) .tbl th { background: #1d2434; }
:where(html[data-theme=dark]) .lettre { background: #143d22; color: #9ae9b8; }
:where(html[data-theme=dark]) .tbl tr.sel td { background: #12203f; }
:where(html[data-theme=dark]) .cand button { color: #9aafe9; }
:where(html[data-theme=dark]) .chip.facture { background: #3f2b12; color: #f6ac8e; border-color: #2b3446; }
:where(html[data-theme=dark]) .field > label, :where(html[data-theme=dark]) .lbl { color: #b2bfd1; }
:where(html[data-theme=dark]) .btn { border-color: #2b3446; }
:where(html[data-theme=dark]) body { background: linear-gradient(180deg, #20322e 0, var(--bg) 220px) no-repeat, var(--bg); }
:where(html[data-theme=dark]) .tbl th { background: #1f332f; color: #9de7e2; }
:where(html[data-theme=dark]) .tbl tr.clickable:hover td { background: #1d3530; }
:where(html[data-theme=dark]) .chip.ok { background: #143d22; color: #9ae9b8; }
:where(html[data-theme=dark]) .chip.err { background: #3f1212; color: #ed9797; }
:where(html[data-theme=dark]) .chip.warn { background: #3f3612; color: #f4b68f; }
:where(html[data-theme=dark]) .action { background: color-mix(in srgb, var(--c) 8%, #1d2434); }
:where(html[data-theme=dark]) .dkpi { border-color: #2b3446; }
:where(html[data-theme=dark]) .graph-vide { background: #1f332d; color: #9de7e2; }
}
/* ---------- fin des équivalents sombres générés ---------- */

/* ---------- mode TEST ---------- */
#pgi-test { position: sticky; top: 0; z-index: 1000; background: repeating-linear-gradient(135deg, #b91c1c 0 18px, #991b1b 18px 36px); color: #fff;
  font: 800 13px/1.2 "Figtree", system-ui, sans-serif; letter-spacing: .04em; text-align: center; padding: 7px 12px; }
@media print { #pgi-test { display: none; } }
