/* Billix Evo — esprit Nexikos/Zeus : anthracite, bentos, bleu discret, clair/sombre. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #1f2329;
  --muted: #6b7280;
  --accent: #2453d6;
  --accent-soft: #e8eefc;
  --accent-text: #ffffff;
  --anthracite: #23262d;
  --ok: #1e8e3e;
  --ok-soft: #e4f4e8;
  --warn: #b26a00;
  --warn-soft: #fff3dc;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --info: #475569;
  --info-soft: #eef1f5;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171c; --surface: #1d2027; --surface-2: #252932; --border: #2f343e; --text: #e8eaee; --muted: #9aa3b2;
    --accent: #7ea2ff; --accent-soft: #233056; --accent-text: #0f1320; --anthracite: #0f1115;
    --ok: #5fd08a; --ok-soft: #173426; --warn: #f2b45c; --warn-soft: #3a2c14; --danger: #ff7b6e; --danger-soft: #3d1d1a; --info: #b4bccb; --info-soft: #262b35;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171c; --surface: #1d2027; --surface-2: #252932; --border: #2f343e; --text: #e8eaee; --muted: #9aa3b2;
  --accent: #7ea2ff; --accent-soft: #233056; --accent-text: #0f1320; --anthracite: #0f1115;
  --ok: #5fd08a; --ok-soft: #173426; --warn: #f2b45c; --warn-soft: #3a2c14; --danger: #ff7b6e; --danger-soft: #3d1d1a; --info: #b4bccb; --info-soft: #262b35;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: .5rem 0; }
code, .mono { font-family: var(--mono); font-size: .85em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--ok); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; flex: none; }
.hash { word-break: break-all; }

/* ---------- Barre supérieure ---------- */
.topbar, .sa-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.25rem; background: var(--anthracite); color: #f1f3f6; }
.brand { display: flex; align-items: center; gap: .55rem; color: inherit; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: block; width: 30px; height: 30px; border-radius: 8px; }
.brand-name em { font-style: normal; color: #8fb0ff; font-weight: 600; }
.public .brand { color: var(--text); }
.mainnav { display: flex; gap: .25rem; flex: 1; overflow-x: auto; }
.mainnav a { display: flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 9px; color: #c7ccd6; white-space: nowrap; }
.mainnav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.mainnav a.active { background: rgba(126,162,255,.18); color: #fff; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1.2rem; }
.icon-btn:hover { background: rgba(127,127,127,.15); }
.avatar { list-style: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #3a3f4b; color: #fff; font-weight: 700; cursor: pointer; }
.avatar::-webkit-details-marker { display: none; }

/* ---------- Menus déroulants ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: .35rem; z-index: 30; display: flex; flex-direction: column; }
.menu-panel a, .menu-panel .linklike { display: block; width: 100%; text-align: left; padding: .45rem .6rem; border-radius: 7px; color: var(--text); }
.menu-panel a:hover, .menu-panel .linklike:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel form { margin: 0; }
.menu-panel .stack { padding: .3rem .6rem; }
.menu-head { padding: .45rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .25rem; display: flex; flex-direction: column; }
.menu-langs { display: flex; gap: .25rem; padding: .35rem .6rem; }
.menu-langs a { padding: .15rem .45rem; width: auto; font-size: .8rem; }
.menu-langs a.active, .langs a.active { background: var(--accent-soft); color: var(--accent); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linklike.danger { color: var(--danger) !important; }

/* ---------- Mise en page ---------- */
.container { max-width: none; margin: 0 auto; padding: 1.25rem 1.25rem 5rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head p { margin: .1rem 0 0; }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.empty { text-align: center; padding: 2.5rem 1rem; }

/* ---------- Bentos ---------- */
.bentos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.bentos-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.bento { display: flex; flex-direction: column; gap: .3rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); color: var(--text); }
a.bento:hover { border-color: var(--accent); text-decoration: none; }
.stat-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.9rem; font-weight: 750; letter-spacing: -.02em; }
.stat-value.small { font-size: 1rem; }
.money-value { font-size: 1.25rem; font-weight: 700; }
.stat-alert { border-color: var(--danger); background: var(--danger-soft); }
.stat-alert .stat-value, .stat-alert .stat-label { color: var(--danger); } /* en retard : rouge */
.stat-warn { border-color: var(--warn); background: var(--warn-soft); }
.stat-warn .stat-value, .stat-warn .stat-label { color: var(--warn); } /* impayées : orange */
.bento.plan.current { border-color: var(--accent); }
.swatch { width: 100%; height: 6px; border-radius: 6px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: .4rem; justify-content: center; border: 1px solid transparent; border-radius: 10px; padding: .55rem .95rem; font: 600 .92rem var(--font); cursor: pointer; background: var(--surface-2); color: var(--text); text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-secondary { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btn-secondary:hover { background: var(--accent); color: var(--accent-text); }
.topbar .btn-ghost, .sa-top .btn-ghost { color: #e5e8ee; border-color: rgba(255,255,255,.2); }
.btn-warning { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.btn-danger-ghost { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: .4rem .7rem; font-size: .85rem; }
.btn-xs { padding: .2rem .5rem; font-size: .8rem; border-radius: 7px; }
.btn-lg { padding: .8rem 1.3rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Formulaires ---------- */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--text); }
label.check, label.switch { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
label.switch { flex-wrap: wrap; }
label.switch small { flex-basis: 100%; font-weight: 400; }
label.inline { flex-direction: row; align-items: center; gap: .35rem; font-weight: 500; }
input, select, textarea { font: 400 .95rem var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: .55rem .7rem; width: 100%; min-width: 0; }
/* Taille fixe, jamais réduite par un libellé long (flex-shrink) */
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; min-width: 1.15rem; flex: none; margin: 0; accent-color: var(--accent); cursor: pointer; }
label.check { align-items: flex-start; }
label.check > input[type="checkbox"], label.check > input[type="radio"] { margin-top: .15em; }
input[type="color"] { padding: .15rem; height: 40px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[readonly] { background: var(--surface-2); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.span2, .form-grid > h2, .form-grid > .row-actions { grid-column: 1 / -1; }
fieldset { border: 0; margin: 0; padding: 0; }
fieldset.seg { display: flex; gap: 1rem; }
fieldset.checks { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
legend { font-weight: 700; margin-bottom: .4rem; }
.field-error { color: var(--danger); font-size: .8rem; font-weight: 500; }
/* §27 : champ signalé par le serveur après un envoi en arrière-plan (la saisie reste en place) */
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 2px var(--danger-soft); }
small.field-error { display: block; margin-top: .25rem; }
form[aria-busy="true"] { cursor: progress; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input[type="search"] { max-width: 260px; }
.filters select { width: auto; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline-form select, .inline-form input { width: auto; flex: 1 1 160px; }
details.more > summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: .25rem 0; }
details.more[open] > summary { margin-bottom: .75rem; }
.w-sm { max-width: 110px; }
.notice { background: var(--info-soft); border-radius: 9px; padding: .6rem .8rem; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
.table.compact td, .table.compact th { padding: .4rem .5rem; font-size: .9rem; }
.table tr:hover td { background: var(--surface-2); }
.table tfoot td { font-weight: 600; }
.table tfoot tr.grand td { font-size: 1.05rem; color: var(--accent); }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.actions { text-align: right; white-space: nowrap; }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr.voided td { text-decoration: line-through; color: var(--muted); }
.table-wrap > .table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; background: var(--info-soft); color: var(--info); vertical-align: middle; white-space: nowrap; }
.badge-draft { background: var(--surface-2); color: var(--muted); }
.badge-sent, .badge-viewed { background: var(--accent-soft); color: var(--accent); }
.badge-partial { background: var(--warn-soft); color: var(--warn); }
.badge-paid, .badge-mail-sent, .badge-health-ok { background: var(--ok-soft); color: var(--ok); }
.badge-overdue, .badge-mail-failed, .badge-health-error { background: var(--danger-soft); color: var(--danger); }
.badge-cancelled { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.badge-credit_note { background: #efe7fb; color: #6a3fb5; }
.badge-mail-stub, .badge-health-warning { background: var(--warn-soft); color: var(--warn); }
.badge-health-info { background: var(--info-soft); color: var(--info); }
.badge-mode-complimentary { background: var(--ok-soft); color: var(--ok); }
.badge-mode-stripe { background: var(--accent-soft); color: var(--accent); }
.fav { color: #e0a800; }
.fav .ico { fill: currentColor; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .3rem .75rem; cursor: pointer; font: 500 .85rem var(--font); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.fav-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.fav-bar > span { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: .3rem; }

/* ---------- Messages ---------- */
.flash { padding: .7rem .9rem; border-radius: 10px; margin-bottom: 1rem; background: var(--info-soft); border: 1px solid transparent; }
.flash ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-warning { background: var(--warn-soft); color: var(--warn); }
.promo { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 1.25rem; background: var(--accent-soft); color: var(--text); font-size: .9rem; }
.promo form { margin: 0; }

/* ---------- Listes ---------- */
.action-list { list-style: none; margin: 0; padding: 0; }
.action-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.action-list li:last-child { border-bottom: 0; }
.action-list .amount { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.action-list form { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 130px 1fr; gap: .6rem; padding: .4rem 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline small { display: block; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.notes { background: var(--surface-2); border-radius: 9px; padding: .6rem .8rem; }
.onboarding ol { margin: 0; padding-left: 1.2rem; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.onboarding li.done a { color: var(--ok); }
.checklist { list-style: none; padding: 0; columns: 2; }
.checklist .ok { color: var(--ok); }
.checklist .ko { color: var(--danger); }

/* ---------- Éditeur de facture ---------- */
.lines { width: 100%; border-collapse: collapse; }
.lines th { font-size: .75rem; text-transform: uppercase; color: var(--muted); text-align: left; padding: .3rem .25rem; }
.lines td { padding: .25rem; vertical-align: top; }
.lines .col-desc { width: 40%; }
.lines .col-num { width: 11%; }
.lines .col-unit { width: 8%; }
.lines .col-pct { width: 8%; }
.lines textarea { min-height: 40px; overflow: hidden; }
.lines [data-line-total] { padding-top: .8rem; font-weight: 600; }
.lines-head { display: flex; justify-content: space-between; align-items: baseline; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1.5rem; max-width: 360px; margin: 1rem 0 0 auto; font-variant-numeric: tabular-nums; }
.totals dd { margin: 0; text-align: right; }
.totals .grand { font-size: 1.15rem; font-weight: 750; color: var(--accent); border-top: 1px solid var(--border); padding-top: .35rem; }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; padding: .75rem; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--border); z-index: 10; }
.payment-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: .6rem; align-items: end; }
.payment-form .span-all { grid-column: 1 / 5; }
.sig-pad { width: 100%; max-width: 600px; height: 180px; border: 1px dashed var(--border); border-radius: 10px; background: #fff; touch-action: none; }
.sig-preview { max-height: 70px; background: #fff; border-radius: 8px; padding: .3rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem; margin-top: 1rem; }
.thumbs figure { margin: 0; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 14px 14px; border-radius: 8px; padding: .4rem; text-align: center; }
.thumbs img { max-width: 100%; max-height: 60px; }
.thumbs figcaption { font-size: .72rem; color: var(--muted); }

/* ---------- Onglets ---------- */
.tabs, .sa-view-tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tabs a, .sa-view-tabs a { padding: .55rem .8rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.tabs a.active, .sa-view-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.sa-view-tabs { background: var(--surface); padding: 0 1.25rem; margin: 0; }
.langs { display: flex; gap: .25rem; }
.langs a { padding: .2rem .5rem; border-radius: 7px; font-size: .8rem; font-weight: 600; color: var(--muted); }

/* ---------- Super console ---------- */
.sa-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding: 1rem 0; margin-bottom: .5rem; }
.env { padding: .15rem .55rem; border-radius: 7px; font-size: .75rem; font-weight: 800; background: #3a3f4b; color: #fff; text-transform: uppercase; white-space: nowrap; }
.env-line { margin: 0 0 .4rem; }
.env-prod { background: #1e8e3e; }
.env-ctlq, .env-test { background: #b26a00; }
.access-pill { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--ok-soft); color: var(--ok); }
.access-pill.warning { background: var(--warn-soft); color: var(--warn); }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1rem; }
.health-list { list-style: none; margin: 0; padding: 0; }
.health-list li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.health-list .h-title small { display: block; font-size: .78rem; }
.health-list .h-value { font-variant-numeric: tabular-nums; text-align: right; max-width: 220px; overflow-wrap: anywhere; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--info); }
.lvl-ok .dot { background: var(--ok); }
.lvl-warning .dot { background: var(--warn); }
.lvl-error .dot { background: var(--danger); }

/* ---------- Pages publiques ---------- */
.public-top { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; max-width: none; margin: 0 auto; }
.public-actions { display: flex; gap: .75rem; align-items: center; }
.public-main { max-width: none; margin: 0 auto; padding: 1rem 1.5rem 3rem; }
.public-footer { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; padding: 1.5rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); }
.public-footer .discreet { color: var(--muted); opacity: .7; font-size: .8rem; }
.app-footer { display: flex; justify-content: center; gap: 1.5rem; padding: 1rem; color: var(--muted); font-size: .78rem; }
.swiss { display: inline-block; width: 13px; height: 13px; border-radius: 2px; vertical-align: -1px; background:
  linear-gradient(#fff, #fff) center / 3px 8px no-repeat, linear-gradient(#fff, #fff) center / 8px 3px no-repeat, #d52b1e; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: center; padding: 3rem 0 2rem; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; letter-spacing: -.03em; }
.lead { font-size: 1.12rem; color: var(--muted); }
.eyebrow { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
.flow { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin: 2rem 0; }
.flow-step { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .4rem .9rem .4rem .4rem; font-weight: 600; }
.flow-step span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: .8rem; }
.auth-card { max-width: 420px; margin: 2rem auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.75rem; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 640px; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--muted); margin: 0; }
.public-doc { max-width: 720px; margin: 1rem auto; }

/* ---------- Navigation mobile ---------- */
.bottomnav { display: none; }
@media (max-width: 900px) {
  .grid-main { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .container { padding: 1rem .9rem 6rem; }
  .topbar { padding: .55rem .9rem; }
  .mainnav { display: none; }
  .hide-sm { display: none !important; }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--anthracite); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .68rem; color: #c7ccd6; padding: .25rem .4rem; border-radius: 8px; }
  .bottomnav a.active { color: #fff; background: rgba(126,162,255,.18); }
  .bottomnav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 68px; }
  .grid2, .form-grid { grid-template-columns: 1fr; }
  .bentos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .bentos-3 { grid-template-columns: 1fr; }
  .bento { padding: .8rem .9rem; }
  .stat-value { font-size: 1.5rem; }
  .features { grid-template-columns: 1fr; }
  .payment-form { grid-template-columns: 1fr 1fr; }
  .payment-form .span-all { grid-column: 1 / -1; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .health-grid { grid-template-columns: 1fr; }
  .health-list li { grid-template-columns: 10px 1fr auto; }
  .health-list .h-value { grid-column: 2 / -1; text-align: left; }
  .sticky-actions { bottom: 58px; justify-content: stretch; }
  .sticky-actions .btn { flex: 1 1 45%; }
  .lines thead { display: none; }
  .lines, .lines tbody, .lines tr, .lines td { display: block; width: 100% !important; }
  .lines tr { border: 1px solid var(--border); border-radius: 10px; padding: .4rem; margin-bottom: .6rem; display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; }
  .lines td:first-child { grid-column: 1 / -1; }
  .lines td::before { content: attr(data-label); display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; }
  .lines td:last-child::before { content: none; }
  .filters input[type="search"] { max-width: none; flex: 1 1 100%; }
  .checklist { columns: 1; }
  .app-footer { padding-bottom: 5rem; }
}
@media print {
  .topbar, .bottomnav, .sticky-actions, .app-footer { display: none; }
}

/* ---------- v0.1.1-cl : page commerciale ---------- */
.landing-nav { display: flex; justify-content: flex-end; gap: 1.25rem; align-items: center; margin: -.5rem 0 .5rem; flex-wrap: wrap; }
.landing-nav a { color: var(--muted); font-weight: 600; }
.landing-nav a.btn-primary { color: #fff; } /* « Ouvrir l’application » (§15) lisible */
.trust { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; justify-content: center; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: .9rem; color: var(--muted); }
.landing-section { margin: 3.5rem 0; scroll-margin-top: 1rem; }
.landing-section > h2 { font-size: clamp(1.4rem, 3vw, 2rem); text-align: center; margin-bottom: 1.5rem; letter-spacing: -.02em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.step-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-weight: 800; }
.qr-show { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; }
.qr-show h2 { text-align: left; }
.checks-list { list-style: none; padding: 0; margin: .75rem 0; display: flex; flex-direction: column; gap: .35rem; }
.checks-list li::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin: 1rem 0; }
.price-card { display: flex; flex-direction: column; gap: .4rem; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.4rem; box-shadow: var(--shadow); }
.price-card.featured { border: 2px solid var(--accent); }
.price-card.current { background: var(--accent-soft); }
.price-card .price { font-size: 1.6rem; margin: .25rem 0; }
.price-card .btn { margin-top: auto; }
.faq { max-width: 780px; margin-left: auto; margin-right: auto; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1.1rem; margin-bottom: .6rem; }
.faq-item summary { cursor: pointer; font-weight: 650; }
.faq-item p { margin: .6rem 0 0; color: var(--muted); }
.cta-band { text-align: center; padding: 2.5rem 1.5rem; border-radius: 22px; background: linear-gradient(135deg, #1b3a99, #2453d6 60%, #4f7bff); color: #fff; margin: 3rem 0 1rem; }
.cta-band p { opacity: .9; }
.cta-band .btn-primary { background: #fff; color: #1b3a99; }
@media (max-width: 720px) {
  .steps, .qr-show { grid-template-columns: 1fr; }
  .landing-nav { justify-content: center; }
}

/* ---------- v0.1.1-cl : bouton œil des mots de passe ---------- */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { padding-right: 2.6rem; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; }
.pw-toggle:hover, .pw-toggle:focus-visible { color: var(--accent); background: var(--surface-2); }
.pw-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* v0.1.5-cl — pages légales et avertissement de sauvegarde */
.legal-page { max-width: 760px; margin: 0 auto; padding: 1rem 0 2rem; }
.legal-page h1 { margin-bottom: .4rem; }
.legal-page h2 { font-size: 1.05rem; margin: 1.4rem 0 .35rem; }
.legal-page p { line-height: 1.6; }
.legal-nav { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: 1rem; font-size: .9rem; }
.legal-nav a[aria-current="page"] { font-weight: 600; text-decoration: none; }
.public-footer .footer-disclaimer { flex-basis: 100%; text-align: center; margin: .2rem 0 0; font-size: .78rem; max-width: 720px; margin-inline: auto; }
.notice-card { border-left: 4px solid var(--accent, #2453d6); }

/* v0.1.6-cl — suppression d’une image importée */
.thumbs figure form { margin-top: .3rem; }

/* v0.1.7-cl — factures archivées */
.badge-muted { background: var(--surface-2); color: var(--muted); }

/* v0.1.9-cl — numéro de version visible à côté du logo */
.app-version { font-size: .68rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: .05rem .45rem; letter-spacing: 0; }
.sa-counters { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
/* Offres (v0.1.19-cl) */
.badge-q-draft, .badge-q-expired { background: var(--surface-2); color: var(--muted); }
.badge-q-sent { background: var(--accent-soft); color: var(--accent); }
.badge-q-accepted, .badge-q-invoiced { background: var(--ok-soft); color: var(--ok); }
.badge-q-declined { background: var(--danger-soft); color: var(--danger); }
.badge-q-expired { text-decoration: line-through; }
.bento > .badge { align-self: flex-start; }
.app-footer .discreet { color: var(--muted); opacity: .7; font-size: .8rem; }
.dash-quotes .card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.dash-quotes .bentos { margin: .5rem 0 0; }
.bento.stat-ok .stat-value { color: var(--ok); }
/* v0.1.22-cl : historiques dans une zone à hauteur limitée avec barre de défilement visible */
.history-scroll { max-height: 22rem; overflow-y: auto; overscroll-behavior: contain; padding-right: .4rem; scrollbar-gutter: stable; }
/* Chrome / Edge : barre dessinée (toujours visible, même avec les barres « superposées » de Windows 11) ; les propriétés
   standard scrollbar-width / scrollbar-color désactiveraient ce style : réservées à Firefox. */
@supports not selector(::-webkit-scrollbar) {
  .history-scroll { scrollbar-width: thin; scrollbar-color: var(--muted) var(--surface-2); }
}
.history-scroll.history-short { max-height: 14rem; }
.history-scroll.history-tall { max-height: 70vh; }
.history-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.history-scroll::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 999px; }
.history-scroll::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 999px; border: 2px solid var(--surface-2); }
.history-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.history-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.table-wrap.history-scroll > .table { overflow: visible; }
.escompte-row td { color: var(--muted); font-size: .88rem; }
.totals .t-escompte { color: var(--muted); font-size: .88rem; }
/* v0.1.24-cl : bandeaux d'alerte (comptes par défaut, superpower) */
.alert-banner { padding: .7rem 1.2rem; font-size: .92rem; text-align: center; }
.alert-danger { background: #b42318; color: #fff; }
.alert-superpower { background: #5b21b6; color: #fff; font-weight: 600; }
/* v0.1.24-cl (exigence commune §7) : toute liste a une hauteur maximale et défile dans son cadre, en-tête toujours visible ;
   les menus d'action sont en position fixe (jamais coupés) ; défilement horizontal conservé sur mobile. */
.table-wrap { max-height: clamp(320px, 70vh, 640px); overflow: auto; overscroll-behavior: contain; }
.table-wrap > .table { overflow: visible; }
.table-wrap thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
.table-wrap.history-scroll { max-height: 22rem; }
.table-wrap.history-scroll.history-tall { max-height: 70vh; }

/* §12 : résultat du test des prix Stripe, ligne par ligne */
.check-lines { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .35rem; font-size: .9rem; }
.check-lines li.ok strong { color: var(--success, #15803d); }
.check-lines li.ko strong { color: var(--danger, #dc2626); }

/* §16 : bandeau « Brouillon du … — Reprendre / Supprimer » */
.draft-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.draft-banner form { display: inline; }

/* §13 : destinataire corrigé pour un document */
.recipient-box { border: 1px dashed var(--border); border-radius: 10px; padding: .6rem .9rem; }
.recipient-box summary { cursor: pointer; font-weight: 600; }
.recipient-box .is-corrected { border-color: var(--warn); background: var(--warn-soft); }

/* Contacts e-mail du client et choix des destinataires */
.contacts, .recipients { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .9rem; display: grid; gap: .45rem; }
.contacts legend, .recipients legend { font-weight: 600; padding: 0 .3rem; }
.contact-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: .5rem; align-items: center; }
@media (max-width: 640px) { .contact-row { grid-template-columns: 1fr; } }

/* §19 : fenêtre de validation des e-mails */
.mail-confirm { border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.mail-confirm::backdrop { background: rgba(15, 23, 42, .55); }
.mail-confirm-body { padding: 1.2rem 1.4rem; display: grid; gap: .7rem; max-height: 85vh; overflow: auto; }
.mail-confirm-kv dd { word-break: break-word; }
.mail-confirm-kv dd > div + div { margin-top: .15rem; }
.alert-warning { background: var(--warn-soft); color: var(--warn); }
.alert-warning a { color: inherit; font-weight: 700; text-decoration: underline; margin-left: .25rem; }

/* ---------- v0.1.38-cl — §21 : le contenu suit la largeur de la fenêtre (320 → 2560 px, aucun défilement horizontal) ---------- */
img, video, iframe, canvas, svg:not(.ico) { max-width: 100%; }
img, video { height: auto; }
.container { max-width: none; width: 100%; padding-left: clamp(.75rem, 2.5vw, 2.5rem); padding-right: clamp(.75rem, 2.5vw, 2.5rem); }
.public-top { max-width: none; width: 100%; padding-left: clamp(.75rem, 3vw, 3rem); padding-right: clamp(.75rem, 3vw, 3rem); }
.public-main { max-width: none; width: 100%; padding-left: clamp(.75rem, 3vw, 3rem); padding-right: clamp(.75rem, 3vw, 3rem); }
/* Piège : un enfant de flex/grid garde sa largeur de contenu tant qu'il n'a pas min-width:0 */
.container > *, .public-main > *, .grid2 > *, .grid-main > *, .bentos > *, .card, .bento, .page-head > *, .topbar > *, .sa-top > * { min-width: 0; }
.grid2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.bentos { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.bentos-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.health-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.pricing-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.thumbs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 90px), 1fr)); }
.features { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.steps { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.kv { grid-template-columns: fit-content(45%) minmax(0, 1fr); }
.kv > * { min-width: 0; overflow-wrap: anywhere; }
.tabs, .sa-view-tabs { flex-wrap: wrap; overflow-x: visible; }
.badge { white-space: normal; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.mainnav { min-width: 0; }
@media (max-width: 720px) {
  .bentos { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
}
/* Exceptions admises (§21) : longueur de ligne des textes longs (.legal-page, .faq, .public-doc) et formulaires de connexion (.auth-card) */
/* Barres supérieures : elles passent à la ligne sur un petit écran au lieu d'élargir la page */
.sa-top, .public-top { flex-wrap: wrap; row-gap: .5rem; }
.sa-top .topbar-actions, .public-actions { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.sa-top .brand, .public-top .brand { min-width: 0; white-space: normal; }
@media (max-width: 480px) {
  .sa-top .topbar-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
}

/* ---------- v0.1.40-cl — §21 précisé : les bentos restent jolis ----------
   La page suit la fenêtre, une carte ne s'étire pas : c'est le nombre de cartes par ligne qui augmente (auto-fill, jamais
   auto-fit ; une carte mesure entre N et ≈ 2N). Pleine largeur : en-têtes, tableaux et journaux seulement. */
.grid2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.form-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.card:not(:has(table, .table-wrap, .timeline, pre)) { max-width: 1240px; }
input:not([type=checkbox]):not([type=radio]), select, textarea { max-width: 1100px; }
.tabs { width: fit-content; max-width: 100%; }
main p, main li, main small { max-width: 120ch; }
.health-list li { max-width: none; }

/* v0.1.40-cl — variables d'e-mail avec leur description (Paramètres → E-mails) */
.var-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .25rem 1.25rem; margin: .25rem 0 .75rem; font-size: .85rem; }
.var-list > div { display: flex; gap: .5rem; align-items: baseline; min-width: 0; }
.var-list dt { flex: none; }
.var-list dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }

/* v0.1.41-cl — §23 code de liaison Zeus */
.copy-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.copy-row input { flex: 1 1 260px; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }

/* v0.1.45-cl — signalement de bugs */
.tab-count { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .35rem; margin-left: .2rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 800; }
.bug-head { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.bug-head h2 { margin: 0; }
.bug-text { white-space: normal; overflow-wrap: anywhere; }
.bug-reply { border-left: 3px solid var(--accent); padding: .4rem .8rem; background: var(--accent-soft); border-radius: 8px; }
.bug-reply p { margin: .25rem 0 0; }
.bug-shot { max-width: 100%; max-height: 420px; border: 1px solid var(--border); border-radius: 8px; }
tr.selected td { background: var(--accent-soft); }

/* v0.1.46-cl — vue Pipeline des factures : une ligne par statut, cartes avec actions directes */
.view-switch { margin-bottom: .75rem; }
.pipeline { display: flex; flex-direction: column; gap: .9rem; }
.lane { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--radius); padding: .75rem .9rem; box-shadow: var(--shadow); min-width: 0; }
.lane-to_send { border-left-color: var(--accent); }
.lane-partial { border-left-color: var(--warn); }
.lane-overdue { border-left-color: var(--danger); background: var(--danger-soft); }
.lane-paid { border-left-color: var(--ok); }
.lane-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; margin-bottom: .6rem; }
.lane-head h2 { font-size: 1rem; margin: 0; }
.lane-count { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--surface-2); font-size: .78rem; margin-left: .25rem; }
.lane-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.lane-cards { display: flex; gap: .7rem; overflow-x: auto; padding-bottom: .35rem; scroll-snap-type: x proximity; }
.lane-empty { margin: .2rem 0; }
.pipe-card { flex: 0 0 clamp(230px, 22vw, 290px); scroll-snap-align: start; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: .65rem .75rem; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.pipe-top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.pipe-amount { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pipe-client { font-weight: 600; overflow-wrap: anywhere; }
.pipe-actions { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; align-items: flex-start; }
.pipe-actions form { margin: 0; }
.pay-pop { position: relative; }
.pay-pop > summary { list-style: none; }
.pay-pop > summary::-webkit-details-marker { display: none; }
.pay-form { display: grid; gap: .4rem; margin-top: .4rem; padding: .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-width: 200px; }
.pay-form label { font-size: .8rem; }

/* v0.1.47-cl — l'œil reste dans le champ mot de passe (le champ est borné à 1100 px depuis la v0.1.40) */
.pw-wrap { max-width: 1100px; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain[disabled] { opacity: .55; }

/* ---------- v0.1.48-cl — §24, précisé le 2026-10-10 : tableau de bord de l'Administration en verre dépoli ----------
   « Pour le dashboard reprendre les couleurs précédentes » : couleurs d'origine de Billix Evo (sombre et clair) ; le style
   reste : police système Segoe UI Variable, verre construit sur la couleur de panneau d'origine (color-mix, 82 % en sombre,
   88 % en clair) et flouté, arrondis de 18 px, graisses ≤ 600, pastilles en pilule (couleurs inchangées). */
body.super.page-dashboard {
  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --glass-mix: 88%;
  font-family: var(--font);
  font-weight: 400;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.super.page-dashboard { --glass-mix: 82%; }
}
:root[data-theme="dark"] body.super.page-dashboard { --glass-mix: 82%; }
body.super.page-dashboard .card,
body.super.page-dashboard .bento,
body.super.page-dashboard .sa-view-tabs,
body.super.page-dashboard .sa-hero {
  background: color-mix(in srgb, var(--surface) var(--glass-mix), transparent);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 18px;
}
body.super.page-dashboard .sa-top {
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  border-radius: 0 0 18px 18px;
}
body.super.page-dashboard .sa-view-tabs { margin: .5rem clamp(.75rem, 2.5vw, 2.5rem) 0; }
body.super.page-dashboard .sa-hero { padding: 1rem 1.25rem; margin-bottom: 1rem; }
body.super.page-dashboard h1, body.super.page-dashboard h2, body.super.page-dashboard h3,
body.super.page-dashboard .stat-value, body.super.page-dashboard .brand { font-weight: 600; letter-spacing: -.01em; }
body.super.page-dashboard strong, body.super.page-dashboard b, body.super.page-dashboard th,
body.super.page-dashboard a, body.super.page-dashboard .btn, body.super.page-dashboard .stat-label,
body.super.page-dashboard .sa-view-tabs a, body.super.page-dashboard .badge, body.super.page-dashboard .access-pill,
body.super.page-dashboard .env, body.super.page-dashboard .tab-count { font-weight: 500; }
body.super.page-dashboard .stat-label { text-transform: none; letter-spacing: 0; }
/* Pastilles : couleurs inchangées, forme de pilule */
body.super.page-dashboard .badge, body.super.page-dashboard .access-pill { border-radius: 999px; }

/* v0.1.49-cl — §26 Administration → Forfaits */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.lang-col { border: 1px solid var(--border); border-radius: 12px; padding: .75rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: .35rem 1rem; }
.plan-badge { align-self: flex-start; }
.plan-preview { border: 1px dashed var(--accent); border-radius: 12px; padding: .75rem; }
form.inline { display: inline; }

/* v0.1.49-cl — pipeline des factures en colonnes (« mettre le pipeline en colonnes ») : une colonne par statut, cartes
   empilées ; le tableau défile horizontalement dans son cadre si l'écran est étroit (jamais la page, §21). */
.pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); flex-direction: initial; gap: .8rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; scroll-snap-type: x proximity; }
.lane { scroll-snap-align: start; border-left-width: 1px; border-top: 4px solid var(--border); display: flex; flex-direction: column; min-height: 8rem; }
.lane-to_send { border-top-color: var(--accent); }
.lane-partial { border-top-color: var(--warn); }
.lane-overdue { border-top-color: var(--danger); }
.lane-paid { border-top-color: var(--ok); }
.lane-head { flex-direction: column; align-items: flex-start; gap: .15rem; }
.lane-cards { flex-direction: column; overflow-x: visible; overflow-y: visible; scroll-snap-type: none; }
.pipe-card { flex: 0 0 auto; width: 100%; }
/* Colonnes défilantes (« les bentos doivent être scrollables ») : chaque colonne défile seule, son en-tête (nombre, total)
   reste visible ; la hauteur suit la fenêtre. */
.lane { max-height: calc(100vh - 220px); min-height: 10rem; }
.lane-head { flex: none; }
.lane-cards { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: .2rem; }
@media (max-width: 720px) { .lane { max-height: 70vh; } }

/* §26 C — limites du forfait : jauges, bandeau, création désactivée (v0.1.51) */
.flash-link { font-weight: 600; text-decoration: underline; white-space: nowrap; }
.quota-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .85rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.quota-head { display: flex; justify-content: space-between; gap: .25rem .5rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .3rem; }
.quota-head strong { white-space: nowrap; margin-left: auto; }
.alert-banner a[data-quota-upgrade] { color: inherit; font-weight: 600; text-decoration: underline; white-space: nowrap; }
.quota-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.quota-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.quota-warn .quota-bar > span { background: var(--warn); }
.quota-full .quota-bar > span, .quota-over .quota-bar > span { background: var(--danger); }
.quota-note { display: block; margin-top: .2rem; font-weight: 600; }
.quota-warn .quota-note { color: var(--warn); }
.quota-full .quota-note, .quota-over .quota-note { color: var(--danger); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; cursor: not-allowed; }
.quota-watch { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.quota-watch li { display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: baseline; }

/* v0.1.54 : cartes du pipeline compactes (« les bentos sont grands si il y a des centaines de factures ») — numéro et montant
   sur une ligne, client et objet tronqués sur une ligne (texte complet au survol), actions en petite taille côte à côte. */
.pipe-card { padding: .4rem .55rem; gap: .1rem; border-radius: 10px; font-size: .85rem; line-height: 1.3; }
.pipe-top { flex-wrap: wrap; column-gap: .5rem; }
.pipe-top .pipe-amount { margin-left: auto; }
.pipe-top a { white-space: nowrap; }
.pipe-client, .pipe-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.pipe-card .muted.small { font-size: .76rem; }
.pipe-actions { gap: .25rem; margin-top: .2rem; align-items: center; }
.pipe-actions .btn-xs, .pipe-actions summary.btn-xs { padding: .12rem .45rem; font-size: .74rem; min-height: 0; line-height: 1.4; }
.pipe-actions .btn-xs .ico { width: .9rem; height: .9rem; }
.lane-cards { gap: .4rem; }/* Carte minimale : actions derrière « … » (ouvertes sous la carte, jamais coupées par le défilement de la colonne) */
.pipe-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 .4rem; }
.pipe-meta > span { min-width: 0; }
.pipe-menu { margin-left: auto; }
.pipe-menu[open] { flex-basis: 100%; }
.pipe-menu > summary { list-style: none; cursor: pointer; display: block; width: fit-content; margin-left: auto; padding: 0 .45rem; border-radius: 6px; font-weight: 600; font-size: 1rem; line-height: 1.3; letter-spacing: .05em; color: var(--muted); }
.pipe-menu > summary::-webkit-details-marker { display: none; }
.pipe-menu > summary:hover, .pipe-menu[open] > summary { background: var(--surface-2); color: var(--text); }
.pipe-menu .pipe-actions { margin-top: .3rem; padding-top: .35rem; border-top: 1px solid var(--border); }

/* v0.1.55 : volume (milliers de factures) — pagination de la liste, « + N autres » dans le pipeline */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: .6rem 0; }
.lane-more { display: block; text-align: center; padding: .4rem; font-size: .8rem; font-weight: 600; border: 1px dashed var(--border); border-radius: 10px; }

/* v0.1.59 : pipeline lisible d'un coup d'œil (« le pipeline est trop large, on n'arrive pas voir tous les bentos ; réduire la
   taille des fonts ») — 7 colonnes de 132 px au moins tiennent dans ~1000 px ; texte plus petit ; en dessous, la bande défile
   dans son cadre (jamais la page, §21). */
.pipeline { grid-auto-columns: minmax(132px, 1fr); gap: .45rem; }
.lane { padding: .5rem .5rem .45rem; border-radius: 12px; }
.lane-head { margin-bottom: .4rem; }
.lane-head h2 { font-size: .8rem; line-height: 1.25; font-weight: 600; }
.lane-count { min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; font-size: .68rem; }
.lane-total { font-size: .78rem; font-weight: 600; }
.pipe-card { padding: .3rem .4rem; font-size: .74rem; line-height: 1.25; border-radius: 8px; }
.pipe-top { column-gap: .3rem; }
.pipe-card .muted.small, .pipe-meta { font-size: .68rem; }
.pipe-menu > summary { font-size: .85rem; padding: 0 .3rem; }
.lane-empty { font-size: .72rem; }
.lane-more { font-size: .72rem; padding: .3rem; }

/* v0.1.59 : nouveau logo (feuilles de verre) sur la page commerciale, posé derrière la carte d'exemple */
.hero-visual { position: relative; display: grid; justify-items: center; }
.hero-logo { width: clamp(120px, 16vw, 200px); height: auto; margin-bottom: -2.2rem; position: relative; z-index: 0; filter: drop-shadow(0 18px 30px rgba(80, 70, 230, .25)); }
@media (max-width: 720px) { .hero-logo { width: 110px; margin-bottom: -1.2rem; } }

/* v0.1.60 : frais en cas de retard annoncés — case toujours active, montants de la facture à côté */
.announce-fees { border: 0; padding: 0; margin: 0; display: grid; gap: .4rem; min-width: 0; }
.announce-fees .form-grid { margin: 0; }

/* §33 : « Compris » sur le bandeau du forfait */
.quota-dismiss { display: inline; margin-left: .4rem; }
.quota-dismiss .btn { color: inherit; border-color: currentColor; }

/* §39 « Envoyer un message » */
.feedback-dialog { width: min(32rem, calc(100vw - 2rem)); border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem 1.2rem; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.feedback-dialog::backdrop { background: rgba(15, 18, 30, .45); }
.feedback-dialog h2 { margin: 0; font-size: 1.05rem; }
.feedback-dialog textarea { width: 100%; }
.segmented { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.segmented label { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 500; }
.segmented label:has(input:checked) { border-color: var(--accent); color: var(--accent); }
.menu-item { display: block; width: 100%; text-align: left; }

/* §40 menu du compte (Nom ▾) */
.account-btn { display: inline-flex; align-items: center; gap: .3rem; max-width: 14rem; list-style: none; }
.account-btn::-webkit-details-marker { display: none; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu .menu-head small { display: block; }
.menu-sep { border: 0; border-top: 1px solid var(--border); margin: .35rem 0; }
@media (max-width: 720px) { .account-name { max-width: 7rem; } }
@media (max-width: 420px) { .account-btn { padding-left: .45rem; padding-right: .45rem; } .account-name { max-width: 2.6rem; } }

/* v0.1.64 : Health Check sans espace vide (« il y a beaucoup d'espace vide dans la console ») — cartes à leur hauteur naturelle,
   lignes serrées en haut, chemins longs repliés dans la carte */
.health-grid { align-items: start; }
.health-grid > .card { align-self: start; }
.health-list { display: block; }
.health-list .h-title { min-width: 0; overflow-wrap: anywhere; }
.health-list .h-title small { overflow-wrap: anywhere; }
/* Colonnes « maçonnerie » : chaque carte se place sous la précédente, sans attendre la plus haute de la rangée */
.health-grid { display: block; columns: 380px; column-gap: 1rem; }
.health-grid > .card { break-inside: avoid; display: block; width: 100%; margin: 0 0 1rem; }
/* Titre jamais écrasé par une valeur longue : au moins la moitié de la ligne, la valeur se replie */
.health-list li { grid-template-columns: 10px minmax(50%, 1fr) minmax(0, auto) auto; }
.health-list .h-value { max-width: 13rem; }
@media (max-width: 720px) { .health-list li { grid-template-columns: 10px 1fr auto; } }

/* v0.1.65 : bouton unique « PDF ▾ » (ouvrir / télécharger chaque document) */
.pdf-menu > summary { list-style: none; }
.pdf-menu > summary::-webkit-details-marker { display: none; }
.menu-label { display: block; padding: .35rem .75rem .1rem; font-weight: 600; }
.ico-mail { vertical-align: -3px; flex: none; }

/* v0.1.65 : signature des quittances au doigt ou à la souris */
.sig-box { border: 1px solid var(--border); border-radius: 12px; padding: .75rem .9rem; display: grid; gap: .5rem; min-width: 0; }
.sig-box .sig-pad { width: 100%; max-width: 600px; height: auto; aspect-ratio: 10 / 3; touch-action: none; }
.sig-preview { background: #fff; border-radius: 6px; vertical-align: middle; }


/* Page commerciale : vraie facture de la société de démo (Démo Immo SA), capturée depuis son PDF */
.hero-sample { position: relative; z-index: 1; margin: 0; width: 100%; max-width: 520px; }
.hero-sample img, .qr-sample img { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 50px rgba(36,83,214,.14); }
.hero-sample figcaption { margin-top: .5rem; font-size: .8rem; color: var(--muted); text-align: center; }
.qr-sample { margin: 0; min-width: 0; }

/* v0.1.67 : bulletin QR du solde */
.balance-qr { border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; }
.balance-qr legend { font-weight: 600; padding: 0 .3rem; }
.balance-modes { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }

/* v0.1.68 : envoi papier */
.badge-paper { background: #f1ede4; color: #6b4f1d; }
:root[data-theme="dark"] .badge-paper { background: #3a3122; color: #f0d9a8; }
.paper-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.paper-alt { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .75rem 0; }
[data-print-paper] { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin: 0; }
[data-print-paper]:has(.btn-block) { display: flex; }
[data-print-paper] .btn-block { width: 100%; }
.paper-mark { font-size: .85rem; font-weight: 400; cursor: pointer; align-items: center; }

/* v0.1.69 : §43 mise à jour annoncée (orange, jamais rouge) */
.announce-banner { font-weight: 600; }
/* v0.1.69 : §44 forfait offert */
.offer-gift { cursor: help; margin-left: .2rem; }

/* v0.1.70 : §45 / §46 zones de suppression et de résiliation */
.danger-zone { border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.danger-zone h2 { color: var(--danger); }
.gdpr-grace { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.gdpr-grace label { display: flex; flex-direction: column; gap: .3rem; }
.gdpr-grace input[type="number"] { width: 7rem; }

/* v0.1.72 : §47 identifiant de connexion */
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .92em; }

/* v0.1.73 : §50 — états du journal des envois */
.badge-mail-pending { background: var(--warn-soft); color: var(--warn); }
.badge-mail-sandbox { background: var(--surface-2, rgba(127,127,127,.12)); color: var(--muted, #667); }
[data-mail-failed] { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
[data-mail-log] .mono { word-break: break-all; }

/* v0.1.74 : facture émise pas encore envoyée */
.badge-to-send { background: var(--warn-soft); color: var(--warn); }

/* v0.1.75 : titres de colonnes triables */
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover, .sort-link:focus-visible { color: var(--accent); text-decoration: underline; }
.sort-link.is-sorted { color: var(--accent); }
.sort-arrow { font-size: .75em; }

/* v0.1.78 : fil d'étapes du document (facture, avoir, offre) */
.doc-steps { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: 0 0 1rem; padding: .55rem .75rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.doc-step { display: flex; align-items: center; gap: .45rem; padding: .3rem .6rem .3rem .35rem; border-radius: 999px; color: var(--muted); }
.doc-step + .doc-step::before { content: '›'; color: var(--muted); margin: 0 .35rem 0 -.35rem; }
.doc-step-dot { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; border: 1.5px solid var(--border); }
.doc-step-text { display: flex; flex-direction: column; line-height: 1.15; }
.doc-step-label { font-weight: 600; }
.doc-step small { font-size: .72rem; color: var(--muted); }
.doc-step.is-done .doc-step-dot { background: var(--muted); border-color: var(--muted); color: var(--surface); }
.doc-step.is-done { color: var(--text); }
.doc-step.is-current { background: var(--accent-soft); color: var(--text); }
.doc-step.is-current .doc-step-dot { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.doc-step.is-warn { background: var(--warn-soft); color: var(--warn); }
.doc-step.is-warn .doc-step-dot { background: var(--warn); border-color: var(--warn); color: #fff; }
.doc-step.is-bad { background: var(--danger-soft); color: var(--danger); }
.doc-step.is-bad .doc-step-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.doc-step.is-skip { opacity: .6; }
@media (max-width: 640px) { .doc-step + .doc-step::before { display: none; } .doc-steps { gap: .3rem; } }

/* §60 (exigence commune du 2026-10-15) : aucun chevauchement — barres d'actions qui passent à la ligne avec un écart, jamais de
   hauteur fixe ; formulaires empilés espacés. Vérifié dans Edge sur tous les écrans (tests/overlap.php). */
.row-actions, .inline-form { display: flex; flex-wrap: wrap; gap: .5rem; height: auto; }
:where(:not(.row-actions, .inline-form, td, th)) > form + form { margin-top: .75rem; }
