/* Fiducio 0.8.0 — feuille commune (site, application, portail, Super console). © Leologic Sàrl.
   Un seul conteneur sur grand écran : min(100% − 2 × gouttière, 1680px), bords alignés (barre du haut, contenu, pied de page). */
:root {
  --gutter: clamp(16px, 2.5vw, 56px);
  --container: 1680px;
  --primary: #1e4fd7; --primary-dark: #163eb0; --accent: #14b8a6; --danger: #b91c1c; --warn: #b45309; --ok: #0e7a56;
  --bg: #f4f6fb; --card: #ffffff; --text: #0f172a; --muted: #5b6475; --line: #e3e8ef; --soft: #f7f9fc; --hover: #eef3ff;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.05);
  --sort-h-active: var(--primary);
  /* 0.8.4 — boutons principaux (RULE_BUTTON_CONTRAST) : mêmes variables pour le bouton, le survol du secondaire, les pastilles actives */
  --btn-bg: #1e4fd7; --btn-text: #ffffff; --btn-border: #1e4fd7; --btn-bg-hover: #163eb0;
  color-scheme: light;
}
html[data-theme="dark"] {
  --primary: #5b8cff; --primary-dark: #7aa2ff; --accent: #2dd4bf; --danger: #f87171; --warn: #fbbf24; --ok: #34d399;
  --bg: #0b1020; --card: #121a2b; --text: #e6e9f0; --muted: #a7b0c0; --line: rgba(255,255,255,.12); --soft: #172036; --hover: rgba(255,255,255,.06);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  /* 0.8.4 — mode sombre : boutons principaux « bleu nuit » (choix de l'utilisateur du 29.10.2026) */
  --btn-bg: #22356b; --btn-text: #ffffff; --btn-border: #4a6fd6; --btn-bg-hover: #2a4182;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
main { flex: 1 0 auto; }
a { color: var(--primary); }
img, svg { max-width: 100%; }
h1 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); letter-spacing: -.02em; margin: 0 0 .4rem; font-weight: 750; }
h2 { font-size: 1.08rem; margin: 0 0 .75rem; font-weight: 700; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
p { margin: 0 0 .75rem; }
code { font-size: .88em; background: var(--soft); padding: 1px 5px; border-radius: 6px; overflow-wrap: anywhere; }
.wrap { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 8px; top: 8px; z-index: 999; background: var(--card); padding: 8px 12px; border-radius: 8px; }

/* Barre du haut (application, portail, pages publiques) */
.topbar { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--card) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(8px); }
/* 0.8.10 — téléphone : un backdrop-filter fait de la barre le repère des éléments « position: fixed » qu'elle contient ; le panneau du
   menu Compte (apps-core, fixé en bas de l'écran ≤ 560 px) et la cloche partaient hors de l'écran (top −371 px à 390 px). */
@media (max-width: 600px) { .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--card); } }
.topbar-inner { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand img { height: 30px; width: auto; display: block; }
.brand .logo-dark { display: none; }
html[data-theme="dark"] .brand .logo-light { display: none; } html[data-theme="dark"] .brand .logo-dark { display: block; }
.mainnav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .93rem; white-space: nowrap; }
.mainnav a:hover { background: var(--hover); }
.mainnav a[aria-current="page"] { background: var(--hover); color: var(--primary); }
.tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: auto; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 800; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.chip-secure { color: var(--ok); }
.chip svg { width: 14px; height: 14px; flex: 0 0 14px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; }
.icon-btn:hover { background: var(--hover); }
.icon-btn .count { position: absolute; top: -6px; right: -6px; }
.leo-link { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.leo-link:hover { background: var(--hover); }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.lang-switch a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 9px; font-size: .74rem; font-weight: 800; color: var(--text); text-decoration: none; }
.lang-switch a[aria-current="true"] { background: var(--btn-bg); color: var(--btn-text); }
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; padding-block: 6px; }
  .mainnav { order: 3; flex-basis: 100%; }
  .chip-secure span { display: none; }
}

/* Contenu */
.page { padding-block: 24px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(16px, 2vw, 22px); margin-bottom: 16px; min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid { margin-top: 16px; }
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.kpi strong { display: block; font-size: 1.9rem; line-height: 1.1; letter-spacing: -.03em; }
.kpi span { color: var(--muted); font-size: .9rem; }
.kpi.warn strong { color: var(--warn); } .kpi.bad strong { color: var(--danger); } .kpi.good strong { color: var(--ok); }
.cols-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 960px) { .cols-2 { grid-template-columns: 1fr; } }

/* Formulaires */
label { display: block; font-size: .84rem; font-weight: 650; margin-bottom: 5px; min-width: 0; overflow-x: clip; overflow-clip-margin: 4px; }
input, select, textarea { width: 100%; max-width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--card); color: var(--text); min-height: 42px; }
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--primary); flex: 0 0 auto; vertical-align: middle; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.field { margin-bottom: 14px; min-width: 0; }
.field small { display: block; color: var(--muted); margin-top: 4px; font-size: .8rem; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: .92rem; margin: 10px 0; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row > .field { flex: 1 1 200px; margin-bottom: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-text); font: inherit; font-weight: 700; font-size: .93rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover, .btn:focus-visible { background: var(--btn-bg-hover); color: var(--btn-text); }
.btn-outline, button.btn-outline { background: var(--card); color: var(--text); border-color: var(--line); }
.btn-outline:hover, .btn-outline:focus-visible { background: var(--hover); color: var(--text); }
.btn-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; } .btn-danger:hover { background: #991b1b; color: #fff; }
.btn-sm { min-height: 34px; padding: 5px 11px; font-size: .84rem; }
.btn-block { width: 100%; white-space: normal; text-align: center; overflow-wrap: anywhere; }
.linklike { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }
form.inline { display: inline; }

/* Messages */
.flash { padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; border: 1px solid var(--line); background: var(--card); }
.flash-ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 9%, var(--card)); }
.flash-error { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 9%, var(--card)); }
.flash-warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, var(--card)); }
.banner { padding: 10px 0; font-weight: 650; font-size: .93rem; }
.banner .wrap { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner-danger { background: #b91c1c; color: #fff; } .banner-danger a:not(.btn) { color: #fff; } /* 0.8.9 : même rouge foncé en thème sombre (contraste ≥ 4,5:1) */
.btn-on-danger, a.btn-on-danger { background: #fff; color: #991b1b; border: 1px solid #fff; text-decoration: none; }
.btn-on-danger:hover, .btn-on-danger:focus-visible { background: #fee2e2; color: #7f1d1d; }
.banner-info { background: #0b3d91; color: #fff; } .banner-info a { color: #fff; }
.banner-warn { background: #fef3c7; color: #78350f; } .banner-warn a { color: #78350f; }

/* Tableaux */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: var(--soft); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .sel { width: 44px; }
.table-tools { display: flex; gap: 10px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.table-tools form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.table-tools input[type="search"] { max-width: 320px; }
.table-tools select { width: auto; }
.bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.bulk select { width: auto; }
.empty { color: var(--muted); padding: 18px 12px; }
@media (max-width: 720px) {
  .table.stack thead { display: none; }
  .table.stack tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .table.stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; text-align: right; }
  .table.stack td::before { content: attr(data-label); font-weight: 700; color: var(--muted); text-align: left; }
  .table.stack td.sel::before { content: none; }
}
.pager { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.pager a, .pager span { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--text); font-size: .9rem; }
.pager .is-on { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-border); }
.pager .is-off { color: var(--muted); opacity: .6; } .pager .gap { border: 0; background: none; }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 750; white-space: nowrap; }
.badge-missing, .badge-warn { background: #fff4e5; color: #9a3412; } .badge-received, .badge-ok { background: #e8f8f2; color: #0e6b4b; }
.badge-off { background: var(--soft); color: var(--muted); } .badge-bad { background: #fee2e2; color: #991b1b; } .badge-info { background: #e0ecff; color: #1e3a8a; }
html[data-theme="dark"] .badge-missing, html[data-theme="dark"] .badge-warn { background: rgba(251,191,36,.18); color: #fde68a; }
html[data-theme="dark"] .badge-received, html[data-theme="dark"] .badge-ok { background: rgba(52,211,153,.16); color: #a7f3d0; }
html[data-theme="dark"] .badge-bad { background: rgba(248,113,113,.18); color: #fecaca; } html[data-theme="dark"] .badge-info { background: rgba(91,140,255,.2); color: #c7d7ff; }
.progress { display: inline-block; width: 90px; height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.progress i { display: block; height: 100%; background: var(--accent); }
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.list-plain { list-style: none; margin: 0; padding: 0; } .list-plain li { padding: 10px 0; border-bottom: 1px solid var(--line); } .list-plain li:last-child { border-bottom: 0; }

/* Dépôt de pièces (portail) */
.dropzone { border: 2px dashed #94a3b8; border-radius: 14px; padding: 18px 14px; text-align: center; background: var(--soft); cursor: pointer; transition: border-color .15s; }
.dropzone.dragover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.dropzone.uploading { border-color: var(--primary); } .dropzone.success { border-color: var(--ok); } .dropzone.error { border-color: var(--danger); }
.dropzone strong { display: block; }
.dz-row { min-width: 160px; padding: 10px; }
progress { width: 100%; height: 6px; }

/* Aide contextuelle */
details.help { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 16px; }
details.help summary { cursor: pointer; padding: 10px 14px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.help summary::-webkit-details-marker { display: none; }
details.help[open] summary { border-bottom: 1px solid var(--line); }
details.help .help-body { padding: 12px 14px; color: var(--muted); }
.help-icon { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-size: .8rem; font-weight: 800; }

/* Pied de page : éléments groupés et centrés (RULE_FOOTER_CENTER, 0.8.4), retour à la ligne propre sur mobile */
.footer { border-top: 1px solid var(--line); padding-block: 18px 26px; color: var(--muted); font-size: .85rem; flex-shrink: 0; text-align: center; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; text-align: center; gap: 6px 16px; }
.footer-row a { color: var(--muted); text-decoration: none; } .footer-row a:hover, .footer-row a:focus-visible { color: var(--text); }
.footer-row .sep { color: var(--muted); }
/* Mot de passe : bouton « œil » dans le champ, à droite, sans toucher le texte */
.pw-wrap { position: relative; display: block; width: 100%; min-width: 0; } .form-row > .pw-wrap { flex: 1 1 auto; width: auto; }
.pw-wrap > input { width: 100%; padding-right: 46px; }
.pw-eye { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; box-shadow: none; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--text); background: color-mix(in srgb, var(--muted) 16%, transparent); } .pw-eye:focus-visible { outline-offset: 0; }
.pw-eye > svg[hidden] { display: none; }
.log-purge form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-block: 10px; } .log-purge form small { flex-basis: 100%; }

/* Pages d'authentification */
.auth { display: grid; place-items: start center; padding-block: clamp(24px, 6vh, 64px); }
.auth .card { width: min(100%, 440px); }
.auth .card.wide { width: min(100%, 620px); }
.auth-logo { display: block; margin: 0 auto 12px; height: 46px; width: auto; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.secret-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.05rem; background: var(--soft); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; word-break: break-all; }
.legal { max-width: 900px; } .legal article p { line-height: 1.65; } .legal h2 { margin-top: 1.4rem; }
.cga-box { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--soft); font-size: .9rem; }

/* Console : contenu sous la navigation standard (console-nav) */
.console-body .page { padding-top: 20px; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.st-ok { background: #16a34a; } .st-info { background: #3b82f6; } .st-warning { background: #f59e0b; } .st-error { background: #dc2626; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; border-bottom: 1px solid var(--line); padding-top: 8px; }
.bars span { flex: 1 1 0; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.bars-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; margin-top: 4px; }
.copy-list { white-space: pre; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }

/* Super Leo */
.leo-picto { display: block; }

@media print { .topbar, .footer, .cn-top, .actions, .no-print { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Menu Compte : boutons (« Envoyer un message », « Se déconnecter ») alignés à gauche comme les liens — en attendant apps-core 0.1.63 */
button.am-item { justify-content: flex-start; text-align: left; }

/* 320 px : barre de la Super console (logo seul, sans le nom), boutons qui passent à la ligne, liste des événements Stripe coupée */
@media (max-width: 420px) { .cn-top .cn-brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .cn-top .cn-bar { gap: 8px; } }
@media (max-width: 480px) { .btn, button.btn { white-space: normal; text-align: center; } }
.ac-bill-dl dd, .ac-bill-dl dd small { overflow-wrap: anywhere; min-width: 0; }
/* 320 px : listes (sélecteurs d'action groupée et filtres plus longs en français), barre publique sous Firefox */
.table-tools form, .table-tools form > *, .bulk > * { min-width: 0; max-width: 100%; }
.table.stack td { overflow-wrap: anywhere; }
@media (max-width: 360px) { .topbar .tools { gap: 6px; } .lang-switch a { padding: 0 7px; } }
.legal h1, .legal h2, .page-head h1 { overflow-wrap: break-word; hyphens: auto; }

/* 0.8.3 — Super console › Forfaits : aperçu de la ligne de prix du site commercial */
.price-preview { display: grid; gap: 2px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--soft); border: 1px dashed var(--line); }
.price-preview strong { font-size: 1.15rem; letter-spacing: -.01em; }
fieldset.field legend { padding: 0 6px; }

/* 0.8.3 — règle UI : aucun lien de navigation brut et souligné (retour, liens d'accès, bandeaux, liens des tableaux) */
.back-row { margin: 0 0 10px; }
.back-link, .nav-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px 6px 8px; margin-left: -8px; border-radius: 10px; color: var(--primary); font-weight: 650; text-decoration: none; }
.nav-link { margin-left: 0; padding: 6px 10px; }
.back-link:hover, .nav-link:hover { background: var(--hover); color: var(--primary-dark); }
.back-link:focus-visible, .nav-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.back-link svg { flex: 0 0 auto; }
.banner .wrap > a { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 12px; border-radius: 9px; border: 1px solid currentColor; text-decoration: none; font-weight: 700; white-space: nowrap; }
.banner .wrap > a:hover { background: rgba(255,255,255,.14); }
.banner-warn .wrap > a:hover { background: rgba(120,53,15,.08); }
.table td a:not(.btn):not(.badge) { color: var(--primary); font-weight: 650; text-decoration: none; }
.table td a:not(.btn):not(.badge):hover { text-decoration: underline; }
.flash a:not(.btn) { color: inherit; font-weight: 700; }
/* 0.8.3 — jauge du nombre de clients du forfait */
.quota-bar { height: 10px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); overflow: hidden; }
.quota-bar span { display: block; height: 100%; background: var(--primary); }
.quota-near .quota-bar span { background: var(--warn); } .quota-full .quota-bar span { background: var(--danger); }
.quota-full { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }

/* 0.8.3 — portail client : « Mes fichiers déposés » (voir, télécharger, supprimer) */
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form { display: inline-flex; margin: 0; }
.btn-danger-outline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger-outline:hover, .btn-danger-outline:focus-visible { background: color-mix(in srgb, var(--danger) 10%, transparent); }
/* 0.8.3 — fiche client (résumé) */
.dl-grid { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; margin: 0; }
.dl-grid dt { color: var(--muted, #5b6472); font-weight: 600; }
.dl-grid dd { margin: 0; min-width: 0; }
@media (max-width: 520px) { .dl-grid { grid-template-columns: 1fr; } .dl-grid dd { margin-bottom: 6px; } }

/* 0.8.4 — tableau de bord simple (sans bandeau) : recherche, actions rapides, chiffres clés, dossiers, tâches, échéances, messages */
.dh-head { align-items: center; }
.dh-tools { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.dh-switch { display: inline-flex; gap: 8px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.dh-switch-btn { min-height: 42px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-weight: 650; font-size: .88rem; cursor: pointer; }
.dh-switch-btn:hover { background: var(--hover); }
.dh-switch-btn[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-text); }
.dh-search { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); color: var(--muted); }
.dh-search svg { flex: 0 0 auto; }
.dh-search input { border: 0; min-height: 38px; padding: 6px 4px; background: transparent; flex: 1 1 auto; min-width: 0; }
.dh-search input:focus-visible { outline: none; }
.dh-search:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.dh-actions { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin-bottom: 16px; }
.dh-action { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.dh-action:hover, .dh-action:focus-visible { background: var(--hover); }
.dh-action-text { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.dh-action-text strong { font-size: .98rem; } .dh-action-text small { color: var(--muted); font-size: .84rem; }
.dh-ico { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; }
.dh-blue .dh-ico, .dh-ico.dh-blue { background: #e3edff; color: #1e4fd7; }
.dh-green .dh-ico, .dh-ico.dh-green { background: #dcf5ea; color: #0b7a4f; }
.dh-violet .dh-ico, .dh-ico.dh-violet { background: #ece6ff; color: #5b34c7; }
.dh-amber .dh-ico, .dh-ico.dh-amber { background: #fff1d6; color: #9a5b00; }
html[data-theme="dark"] .dh-blue .dh-ico, html[data-theme="dark"] .dh-ico.dh-blue { background: rgba(91,140,255,.18); color: #b9ccff; }
html[data-theme="dark"] .dh-green .dh-ico, html[data-theme="dark"] .dh-ico.dh-green { background: rgba(52,211,153,.16); color: #a7f3d0; }
html[data-theme="dark"] .dh-violet .dh-ico, html[data-theme="dark"] .dh-ico.dh-violet { background: rgba(167,139,250,.18); color: #ddd6fe; }
html[data-theme="dark"] .dh-amber .dh-ico, html[data-theme="dark"] .dh-ico.dh-amber { background: rgba(251,191,36,.16); color: #fde68a; }
.dh-chev { flex: 0 0 auto; color: var(--muted); }
.dh-kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin-bottom: 16px; }
.dh-kpi { position: relative; display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.dh-kpi:hover, .dh-kpi:focus-within { background: var(--hover); }
.dh-kpi-main { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.dh-kpi-main::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.dh-kpi-text { display: grid; min-width: 0; }
.dh-kpi-value { font-size: 1.9rem; font-weight: 750; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.dh-kpi-label { color: var(--text); font-weight: 600; font-size: .92rem; }
.dh-kpi-sub { position: relative; z-index: 1; justify-self: start; margin-left: 56px; font-size: .85rem; font-weight: 650; text-decoration: none; border-radius: 6px; }
a.dh-kpi-sub:hover { text-decoration: underline; }
.dh-good { color: var(--ok); } .dh-bad { color: var(--danger); }
.dh-panels { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.dh-panels > .card { margin-bottom: 0; }
.dh-clients { grid-row: span 2; }
.dh-messages { grid-column: 2 / 4; }
@media (max-width: 1180px) { .dh-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dh-clients { grid-row: auto; grid-column: 1 / -1; } .dh-messages { grid-column: 1 / -1; } }
@media (max-width: 760px) { .dh-panels { grid-template-columns: 1fr; } .dh-messages { grid-column: auto; } }
.dh-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.dh-panel-head h2 { margin: 0; }
.dh-panel-head .nav-link { min-height: 40px; font-size: .9rem; }
.dh-list { list-style: none; margin: 0; padding: 0; }
.dh-list > li { border-bottom: 1px solid var(--line); }
.dh-list > li:last-child { border-bottom: 0; }
.dh-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; color: var(--text); text-decoration: none; border-radius: 10px; min-height: 56px; }
.dh-row:hover, .dh-row:focus-visible { background: var(--hover); }
.dh-row-main { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.dh-row-main strong, .dh-row-main small { overflow-wrap: anywhere; }
.dh-snippet { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dh-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; background: #e3edff; color: #173e9e; font-weight: 750; font-size: .9rem; }
html[data-theme="dark"] .dh-avatar { background: rgba(91,140,255,.2); color: #dbe5ff; }
.dh-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.dh-tag { display: inline-flex; padding: 1px 8px; border-radius: 6px; background: var(--soft); border: 1px solid var(--line); color: var(--text); font-size: .76rem; font-weight: 600; }
.dh-state { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; font-size: .84rem; font-weight: 650; white-space: nowrap; }
.dh-state i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.dh-state-ok { color: var(--ok); } .dh-state-pending { color: var(--warn); } .dh-state-late { color: var(--danger); }
.dh-task { display: flex; align-items: center; gap: 10px; padding: 10px 4px; min-height: 56px; }
.dh-check { display: inline-flex; margin: 0; flex: 0 0 auto; }
.dh-box { width: 26px; height: 26px; min-height: 0; padding: 0; border: 2px solid var(--muted); border-radius: 7px; background: var(--card); cursor: pointer; position: relative; }
.dh-box::before { content: ""; position: absolute; inset: -9px; }
.dh-box:hover, .dh-box:focus-visible { border-color: var(--primary); }
.dh-box.is-on { background: var(--ok); border-color: var(--ok); }
.dh-box.is-on::after { content: ""; position: absolute; left: 7px; top: 2px; width: 6px; height: 12px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dh-date { flex: 0 0 auto; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dh-date.dh-bad { color: var(--danger); font-weight: 700; }
.dh-prio { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 750; white-space: nowrap; }
.dh-prio-urgent { background: #fde2e2; color: #9b1c1c; } .dh-prio-important { background: #fff1d6; color: #7a4a00; } .dh-prio-normal { background: var(--soft); color: var(--muted); }
html[data-theme="dark"] .dh-prio-urgent { background: rgba(248,113,113,.18); color: #fecaca; } html[data-theme="dark"] .dh-prio-important { background: rgba(251,191,36,.18); color: #fde68a; }
.dh-day { display: grid; place-items: center; flex: 0 0 auto; width: 52px; min-height: 52px; padding: 4px 0; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); line-height: 1.1; }
.dh-day strong { font-size: 1.15rem; } .dh-day small { color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.dh-day.dh-bad strong { color: var(--danger); }
.dh-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.dh-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: .88rem; font-weight: 600; text-decoration: none; }
.dh-chip:hover, .dh-chip:focus-visible { background: var(--hover); }
.dh-chip[aria-current="page"] { background: var(--btn-bg); border-color: var(--btn-border); color: var(--btn-text); }
.dh-filter-pill { margin: 0 0 12px; }
.table tr.is-done td { color: var(--muted); } .table tr.is-done strong { text-decoration: line-through; }
.dh-pick { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.dh-pick-list { max-height: 70vh; overflow: auto; margin-top: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 0 14px; }
.dh-pick-list .check { margin: 6px 0; }
.dh-pick [hidden] { display: none; }
.dh-mandates { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.dh-results { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.dh-results .card { margin-bottom: 0; }
.dh-types-body { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; }
.dh-ring { flex: 0 0 auto; }
.dh-ring-n { font-size: 8px; font-weight: 750; fill: var(--text); }
.dh-ring-l { font-size: 3.2px; fill: var(--muted); }
.dh-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; flex: 1 1 220px; max-width: 360px; }
.dh-legend a, .dh-legend-row { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 2px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.dh-legend a:hover, .dh-legend a:focus-visible { background: var(--hover); }
.dh-legend i { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.dh-legend span { flex: 1 1 auto; } .dh-legend strong { font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .dh-kpi-sub { margin-left: 0; } .dh-row .dh-state { font-size: .78rem; } .dh-task { flex-wrap: wrap; } .dh-task .dh-row-main { flex-basis: calc(100% - 40px); } }

/* 0.8.4 — croix « Fermer » (au lieu des liens « Retour ») : carré à coins arrondis en haut à droite de l'en-tête de la page */
.page-head.has-close { position: relative; padding-right: 56px; }
.close-x { position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); text-decoration: none; }
.close-x:hover { background: var(--hover); color: var(--primary); }
.close-x:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (max-width: 640px) { .close-x { width: 44px; height: 44px; } .page-head.has-close { padding-right: 60px; } }

/* 0.8.4 — « ↩ Retour » vers la page précédente (avec son tri et ses filtres), sur la ligne des boutons de l'en-tête */
.back-dash { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.back-dash:hover { background: var(--hover); color: var(--primary); }
.back-dash:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (max-width: 640px) { .back-dash { min-height: 44px; } }
.back-dash-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-head > .back-dash:only-child, .back-dash.is-alone { margin-left: auto; }

/* 0.8.4 — choix sélectionné nettement marqué dans toute rangée de choix : coche ✓, gras, fond plein (aria-pressed / aria-current) */
.dh-switch-btn[aria-pressed="true"], .dh-chip[aria-current="page"], .lang-switch a[aria-current="true"] { font-weight: 700; }
.dh-switch-btn[aria-pressed="true"]::before, .dh-chip[aria-current="page"]::before, .lang-switch a[aria-current="true"]::before { content: "✓"; margin-right: 6px; font-weight: 700; }
.dh-switch-btn[aria-pressed="false"], .dh-chip:not([aria-current]) { font-weight: 500; }
.dh-switch-btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--btn-border, var(--primary)); }
.check:has(input[type="radio"]:checked), .check:has(input[type="checkbox"]:checked) { font-weight: 600; }
.check.is-off { color: var(--muted); cursor: not-allowed; }

/* 0.8.5 — plusieurs photos → un PDF, documents de la fiduciaire, type proposé, suivi du tableau de bord */
/* 0.8.8 — zone de dépôt unique : case « Un PDF par photo » sous la zone */
.dz-one { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .85rem; color: var(--muted); }
.shared-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.shared-list li:last-child { border-bottom: 0; }
.inline-details summary { list-style: none; cursor: pointer; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] { flex-basis: 100%; }
.suggest-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 10px; }
.suggest-row select { width: auto; min-height: 36px; }
.doc-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.dh-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.tpl-items { padding-left: 1.4em; }
.tpl-items li { margin-bottom: 6px; }

/* 0.8.5 — clients choisis par recherche (plus de 50 clients) */
.pick-chosen { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.pick-chosen:empty { display: none; }
/* 0.8.5 — bouton principal de l'onglet « Tâches planifiées » (apps-core scheduler) : couleurs des boutons de l'app (contraste ≥ 4,5:1,
   bleu nuit en mode sombre) au lieu de la couleur d'accent turquoise */
.ac-cron .ac-cron-primary, button.ac-cron-primary { background: var(--btn-bg); border-color: var(--btn-border); color: var(--btn-text); font-weight: 700; }
.ac-cron .ac-cron-primary:hover, .ac-cron .ac-cron-primary:focus-visible, button.ac-cron-primary:hover, button.ac-cron-primary:focus-visible { background: var(--btn-bg-hover); color: var(--btn-text); }
/* 0.8.5 — règle de l'œil : valeur enregistrée affichée sous le champ (60 s), coupée si elle est longue */
.secret-kept { display: block; margin-top: 4px; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.secret-kept.secret-shown .secret-value { display: block; padding: 6px 8px; border-radius: 8px; background: var(--soft); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; user-select: all; }
/* 0.8.5 — purge des journaux (apps-core log-purge, boutons sans classe) : boutons de l'app, lisibles en clair et en sombre
   (WebKit gardait le bouton natif gris clair avec le texte blanc du thème sombre : 1,82:1) */
.log-purge button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-text); font: inherit; font-weight: 700; cursor: pointer; -webkit-appearance: none; appearance: none; }
.log-purge button:hover, .log-purge button:focus-visible { background: var(--btn-bg-hover); color: var(--btn-text); }
.log-purge button.danger { background: var(--card); color: var(--danger); border-color: var(--danger); }
.log-purge button.danger:hover, .log-purge button.danger:focus-visible { background: var(--hover); color: var(--danger); }
/* 0.8.6 — « Documents en attente » : pastilles cliquables du tableau de bord, carte de la fiche client, validation des dépôts */
.dh-list > li.dh-client { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dh-client > .dh-row { flex: 1 1 260px; min-width: 0; }
.dh-pend { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: 0 1 auto; padding: 4px 4px 4px 0; }
.dh-pend-pill { min-height: 32px; padding: 4px 11px; border-radius: 999px; border: 1px solid currentColor; background: var(--card); text-decoration: none; }
.dh-pend-pill:hover, .dh-pend-pill:focus-visible { background: var(--hover); text-decoration: none; }
.dh-state-validate { color: var(--primary); }
@media (max-width: 520px) { .dh-pend { justify-content: flex-start; padding-left: 52px; } }
/* 320 px, italien (« 1 documento da convalidare ») : la pastille dépassait de 3 px — le texte peut passer à la ligne */
@media (max-width: 520px) { .dh-pend { min-width: 0; max-width: 100%; box-sizing: border-box; } .dh-pend-pill { white-space: normal; max-width: 100%; } }
@media (max-width: 380px) { .dh-pend { padding-left: 0; } }
.pending-card { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.pending-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.pending-head h2 { margin: 0; }
.pending-sum { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pending-list { list-style: none; margin: 6px 0 12px; padding: 0; }
.pending-list > li { border-top: 1px solid var(--line); }
.pending-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 0; }
.pending-main { display: grid; gap: 3px; flex: 1 1 280px; min-width: 0; }
.pending-main strong, .pending-main small { overflow-wrap: anywhere; }
.pending-main small { color: var(--muted); }
.pending-main small.pending-next { color: var(--text); }
.pending-state { color: var(--primary); font-weight: 650; }
.pending-late { color: var(--danger); font-weight: 650; }
.pending-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pending-actions .inline-form { margin: 0; }
.pending-reject { display: inline-block; }
.pending-reject > summary { list-style: none; cursor: pointer; }
.pending-reject > summary::-webkit-details-marker { display: none; }
.pending-reject[open] { display: block; flex-basis: 100%; }
.pending-reject-form { margin-top: 8px; display: grid; gap: 6px; max-width: 520px; }
.pending-main small.review-reject, .review-reject { color: var(--danger); }
.pending-none { font-weight: 600; color: var(--ok); }
.review-row { margin-top: 6px; }
.due-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.due-form input[type="date"] { max-width: 160px; }
/* 0.8.6 — règle du 01.11.2026 : « Lire les conditions » en pastille, comme « J'ai pris connaissance » */
.btn-pill { border-radius: 999px; text-decoration: none; }
.btn-pill:hover, .btn-pill:focus-visible { text-decoration: none; }
.terms-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
/* 0.8.6 — section « Comptes inactifs » : les contournements locaux (défilement à 320 px, écart des pastilles, texte blanc sur l’accent)
   sont retirés en 0.8.7 ; apps-core 0.1.82 finale (f38352a) les corrige dans inactive-accounts.css. */

/* 0.8.7 — liste de suspens */
.sus-new-form, .sus-filters, .sus-remind { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.sus-new-form label, .sus-filters label, .sus-remind label { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; }
.sus-new-form label.check { flex-direction: row; align-items: center; }
.sus-form-row { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.sus-item-form, .sus-head-form { display: grid; gap: 10px; }
.sus-item-form label, .sus-head-form label, .sus-answer-form label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sus-item-form textarea, .sus-head-form textarea, .sus-answer-form textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
.sus-table td { vertical-align: top; }
.sus-table td:first-child { width: 4.5rem; }
.sus-move, .sus-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sus-row.sus-settled td, .sus-row.sus-cancelled td { color: var(--muted); }
.sus-row.sus-cancelled td:nth-child(2) { text-decoration: line-through; }
.sus-subs { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0; }
.sus-subs dt { font-weight: 600; } .sus-subs dd { margin: 0; }
.sus-docs { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.sus-docs li { overflow-wrap: anywhere; }
.sus-drop { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.sus-drop .dropzone { flex: 1 1 200px; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; cursor: pointer; }
.sus-drop .dropzone input[type=file] { max-width: 100%; min-width: 0; }
.sus-drop .dropzone.error span { color: var(--danger); font-weight: 600; }
.sus-history { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.sus-client-lists { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.sus-years { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sus-years .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: inherit; background: var(--card); }
.sus-years .chip.is-active { border: 2px solid var(--primary); font-weight: 700; }
.sus-portal-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.sus-portal-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; min-width: 0; }
.sus-portal-q { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.sus-portal-q > div { min-width: 0; overflow-wrap: anywhere; }
.sus-portal-nr { flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--soft); font-weight: 700; }
.sus-answer-form { display: grid; gap: 8px; }
.sus-done { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.sus-portal-banner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); background: color-mix(in srgb, var(--primary) 8%, var(--card)); }

/* 0.8.7 — colonne Réf de la feuille de suspens : réf. du dossier sur une ligne, comptes lisibles */
.sus-ref { min-width: 6.5rem; }
.sus-ref .sus-fref { white-space: nowrap; }
.sus-ref .sus-acc { overflow-wrap: anywhere; }

/* 0.8.7 — feuille de suspens empilée (téléphone) : libellé AU-DESSUS du contenu ; côte à côte, le long libellé allemand
   (« Erledigung / Stellungnahme des Kunden ») poussait la zone de dépôt et « OK, erledigt » hors du cadre à 320 px (Firefox) */
@media (max-width: 720px) {
  .table.stack.sus-table td { display: block; text-align: left; }
  .table.stack.sus-table td::before { display: block; margin-bottom: 2px; }
}

/* 0.8.8 — menu à gauche (barre latérale, comme Billix Evo / Fixly) ; tiroir ouvert par ☰ sous 860 px */
.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.app-col { min-width: 0; display: flex; flex-direction: column; }
.app-col > main { flex: 1 0 auto; }
.sidenav { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; background: var(--card); border-right: 1px solid var(--line); z-index: 70; }
.sidenav-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 6px; }
.sidenav-nav { display: grid; gap: 2px; }
.sidenav-nav a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.sidenav-nav a:hover, .sidenav-nav a:focus-visible { background: var(--hover); }
.sidenav-nav a[aria-current="page"] { background: var(--hover); color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.sidenav-nav .sn-ico { flex: 0 0 auto; opacity: .85; }
.sidenav-nav .sn-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.sidenav-nav .count { margin-left: auto; }
.sidenav-foot { margin: auto 6px 0; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
/* 0.8.9 — bas du menu : pastilles « Connexion chiffrée » et « Données hébergées en Suisse », version dessous (contraste ≥ 4,5:1) */
.sn-trust { display: flex; flex-wrap: wrap; gap: 6px; }
.sn-trust .chip { position: relative; white-space: normal; text-align: left; line-height: 1.2; }
.sidenav .chip span { display: inline; }
.chip-swiss { color: var(--text); }
.chip-swiss svg { width: 14px; height: 14px; border-radius: 3px; }
.sn-version { margin: 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.brand .brand-mark { display: none; }
/* « Documentation » : dans le tiroir du téléphone seulement (sur grand écran, dans le menu du compte) */
.sidenav-docs { display: none; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.sidenav-docs:hover, .sidenav-docs:focus-visible { background: var(--hover); }
@media (max-width: 860px) { .sidenav-docs { display: flex; margin-top: auto; } .sidenav-docs + .sidenav-foot { margin-top: 0; } }
.am-item[data-menu-docs] { box-shadow: 0 -1px 0 var(--am-line, var(--line)); border-radius: 0 0 9px 9px; margin-top: 6px; }
/* 0.8.9 — documentation et recherche dans l'aide (index statique, recherche dans le navigateur) */
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.docs-toc { position: sticky; top: 76px; }
.docs-toc h2 { font-size: 1rem; margin: 0 0 8px; }
.docs-toc ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: .9rem; }
.docs-body { overflow-wrap: anywhere; line-height: 1.6; }
.docs-body h2 { margin-top: 1.6em; } .docs-body h2:first-child { margin-top: 0; }
.docs-body img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }
.docs-body figure { margin: 12px 0; }
.docs-body blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--primary); background: var(--soft); border-radius: 0 8px 8px 0; }
.docs-body code { font-size: .9em; background: var(--soft); padding: 1px 4px; border-radius: 4px; }
@media (max-width: 1100px) { .docs-layout { grid-template-columns: 1fr; } .docs-toc { position: static; } }
.help-search label { display: block; font-weight: 700; margin-bottom: 6px; }
.help-search input { width: 100%; }
.help-results { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.help-results:empty { display: none; }
.help-results a { font-weight: 700; }
.help-results p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.sidenav-mini-btn { width: 32px; height: 32px; flex: 0 0 auto; }
@media (min-width: 861px) {
  html.sidenav-mini .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  html.sidenav-mini .sidenav { padding-inline: 8px; align-items: stretch; }
  html.sidenav-mini .sidenav-head { flex-direction: column; padding-inline: 0; }
  html.sidenav-mini .sidenav .brand img:not(.brand-mark) { display: none !important; }
  html.sidenav-mini .sidenav .brand .brand-mark { display: block; height: 30px; width: 30px; }
  html.sidenav-mini .sidenav-mini-btn svg { transform: scaleX(-1); }
  html.sidenav-mini .sidenav-nav a { justify-content: center; padding-inline: 0; position: relative; }
  html.sidenav-mini .sidenav-nav .sn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html.sidenav-mini .sidenav-nav .count { position: absolute; top: 2px; right: 2px; }
  html.sidenav-mini .sn-trust { flex-direction: column; align-items: center; }
  html.sidenav-mini .sn-trust .chip { padding: 3px 7px; }
  html.sidenav-mini .sidenav .sn-trust .chip span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html.sidenav-mini .sn-version { font-size: .72rem; text-align: center; }
}
.sidenav-close, .sidenav-toggle, .topbar-brand { display: none; }
.app-topbar .topbar-inner { padding-inline: 20px; }
.sidenav-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 80; }
.sidenav-backdrop[hidden] { display: none; }
@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidenav { position: fixed; top: 0; left: 0; bottom: 0; width: min(290px, 86vw); height: auto; z-index: 90; transform: translateX(-105%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; box-shadow: 0 10px 40px rgba(15, 23, 42, .25); }
  html.sidenav-open .sidenav { transform: none; visibility: visible; transition: transform .2s ease; }
  html.sidenav-open body { overflow: hidden; }
  .sidenav-close, .sidenav-toggle { display: inline-flex; }
  .sidenav-mini-btn { display: none; }
  .topbar-brand { display: inline-flex; }
  .app-topbar .topbar-inner { flex-wrap: nowrap; padding-inline: 12px; }
}
/* très petit écran : le logo est déjà dans le tiroir ; sans lui, ☰ et les outils (dont Super Leo) tiennent sur une ligne à 320 px */
@media (max-width: 400px) { .app-topbar .topbar-brand { display: none; } }
@media print { .sidenav, .sidenav-backdrop { display: none !important; } .app-shell { display: block; } }
/* la barre latérale (232 px) retire de la place à la page : les points de rupture larges de la page sont décalés d'autant */
@media (min-width: 861px) and (max-width: 1412px) { .app-shell .dh-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); } .app-shell .dh-clients { grid-row: auto; grid-column: 1 / -1; } .app-shell .dh-messages { grid-column: 1 / -1; } }
@media (min-width: 861px) and (max-width: 992px) { .app-shell .dh-panels { grid-template-columns: 1fr; } .app-shell .dh-messages { grid-column: auto; } }
@media (min-width: 861px) and (max-width: 1192px) { .app-shell .cols-2 { grid-template-columns: 1fr; } }

/* 0.8.8 — dépôt du client et accès des contacts */
.depot-fields { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.depot-drop { display: grid; gap: 8px; justify-items: start; padding: 16px; border: 2px dashed var(--line); border-radius: 12px; margin-top: 8px; }
.depot-drop.over { border-color: var(--primary); background: var(--hover); }
.depot-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.depot-item { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.depot-name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.depot-state.depot-ok { color: var(--ok); font-weight: 600; }
.depot-state.depot-error { color: var(--danger); font-weight: 600; }
.access-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.access-list li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.access-list .who { min-width: 0; overflow-wrap: anywhere; }
.access-form { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); align-items: end; }

/* 0.8.8 — « Renvoyer le lien » : fiche client et menu ⋯ de la ligne (liste des clients) */
.access-contact-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.access-resend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; }
.row-actions { white-space: nowrap; }
.row-menu { display: inline-block; position: relative; vertical-align: middle; }
.row-menu > summary { list-style: none; cursor: pointer; min-width: 36px; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: grid; gap: 6px; min-width: 200px; max-width: min(280px, 80vw); padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); white-space: normal; text-align: left; }

.doc-actions { margin-top: 0; }

/* 0.8.9 — champ piège invisible (connexion, inscription, mot de passe oublié, lien de dépôt) : hors écran, jamais focalisable */
.hp-field { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* 0.8.9 — factures d'honoraires */
.field-error { display: block; color: var(--danger); font-weight: 600; }
.btn.is-disabled { pointer-events: none; opacity: .55; }
[data-invoice-preview] tfoot th, [data-invoice-preview] tfoot td { border-top: 1px solid var(--line, #d0d7de); }

/* 0.8.9 — « Afficher le lien » : champ + Copier ; listes jamais dans une petite boîte de défilement, menu « … » flottant jamais coupé */
.link-show { display: inline-block; vertical-align: middle; max-width: 100%; }
.link-show > summary { list-style: none; cursor: pointer; }
.link-show > summary::-webkit-details-marker { display: none; }
.link-show-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); max-width: min(560px, 100%); }
.link-show-box input { flex: 1 1 220px; min-width: 0; font-size: .85rem; }
.link-show-box small { flex-basis: 100%; }
.shown-link { margin: 0 0 12px; }
.row-menu[open] > .row-menu-pop.is-floating { position: fixed; right: auto; top: auto; max-height: calc(100vh - 16px); overflow-y: auto; }
/* 0.8.9 — RULE_ACCOUNT_MENU : « Connexion chiffrée » + version sous le nom, dans le menu Compte */
.am-secure { padding: 2px 14px 8px; font-size: .8rem; color: var(--ok-text, #166534); font-weight: 600; }
.am-secure .am-muted { font-weight: 400; color: var(--muted); }

/* 0.8.9 — cloche 🔔 (notifications) séparée de l'enveloppe (messages) : deux pictos, deux compteurs ; panneau jamais plus haut que 70vh */
.notify-menu { position: relative; }
.notify-menu > summary { list-style: none; cursor: pointer; }
.notify-menu > summary::-webkit-details-marker { display: none; }
.icon-btn .count-msg { background: var(--primary, #2563eb); }
.notify-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.18); z-index: 90; padding: 10px 0 6px; text-align: left; }
.notify-head { display: flex; flex-direction: column; gap: 2px; padding: 2px 14px 8px; border-bottom: 1px solid var(--line); }
.notify-list { list-style: none; margin: 0; padding: 0; }
.notify-list li { padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: .9rem; overflow-wrap: anywhere; }
.notify-list li.is-new { background: color-mix(in srgb, var(--primary, #2563eb) 7%, transparent); }
.notify-empty { padding: 12px 14px; margin: 0; }
.notify-all { display: block; padding: 9px 14px 4px; font-weight: 600; }
@media (max-width: 600px) { .notify-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; } }
/* 0.8.10 — accès direct au modèle de facture (page Factures, Mon compte) */
.tpl-access { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 22rem; }
.tpl-access small { line-height: 1.3; }
.tpl-error { margin: 4px 0 0; color: var(--danger, #b42318); font-weight: 600; }
/* 0.8.10 — RULE_SHOW_KEYS : clé masquée, Afficher / Copier, mot de passe demandé */
.secret-mask { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 1px 6px; border-radius: 6px; background: var(--soft); color: var(--text); }
.secret-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.secret-tools .btn svg { vertical-align: -3px; }
.secret-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.secret-confirm[hidden] { display: none; } /* 0.8.10 : sinon toujours visible (display: flex l'emporte sur [hidden]) et trop large à 320 px */
.secret-confirm input { width: min(14rem, 100%); max-width: 100%; min-width: 0; }
.secret-confirm label { min-width: 0; max-width: 100%; }
@media (max-width: 480px) { dl.kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; } dl.kv dd { margin-bottom: 8px; } }
/* 0.8.10 — logo « Dossier F » (SVG) : variante claire / sombre sur les pages de connexion */
.auth-logo.logo-dark { display: none; }
html[data-theme="dark"] .auth-logo.logo-light { display: none; } html[data-theme="dark"] .auth-logo.logo-dark { display: block; }
/* 0.8.10 — assistant d'aide « Posez votre question » */
.help-ask { margin: 10px 0; display: grid; gap: 6px; }
.help-ask-row { display: flex; gap: 6px; flex-wrap: wrap; }
.help-ask-row input { flex: 1 1 14rem; min-width: 0; }
.help-answer:empty { display: none; }
.help-hit { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--card); }
.help-hit-title { margin: 2px 0 6px; font-size: 1rem; }
.help-excerpt mark { background: rgba(250, 204, 21, .35); color: inherit; border-radius: 3px; padding: 0 1px; }
.help-steps { margin: 6px 0 6px 20px; }
.help-more { margin-top: 6px; }
/* 0.8.10 — lecture automatique des justificatifs */
.docread { margin-top: 8px; }
.docread.card-sub { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--soft); }
.docread summary { cursor: pointer; }
.docread-form .form-grid { margin: 8px 0; }
.docread .badge { font-size: .72rem; }
