/* ============================================================
   GoodBeauty — feuille de style commune
   Jetons de couleur en haut ; mode sombre automatique ;
   menu latéral sur ordinateur, tiroir + barre du bas sur téléphone.
   ============================================================ */

:root {
  --accent: #9d3b6e;
  --accent-fonce: color-mix(in oklab, var(--accent) 82%, black);
  --accent-doux: color-mix(in oklab, var(--accent) 11%, white);
  --accent-ligne: color-mix(in oklab, var(--accent) 28%, white);
  --sur-accent: #fff;
  --fond: #f6f3f1;
  --surface: #ffffff;
  --surface-2: #faf8f7;
  --surface-3: #f1ece9;
  --encre: #241d21;
  --encre-2: #54474e;
  --muet: #85777e;
  --ligne: #e9e2df;
  --ligne-forte: #d8cfcb;
  --ok: #2f7d55;      --ok-doux: #e5f3ec;
  --info: #2c6aa8;    --info-doux: #e6eff8;
  --alerte: #a8650f;  --alerte-doux: #fbf0dc;
  --danger: #c0392b;  --danger-doux: #fbe7e4;
  --r: 14px; --r-s: 10px; --r-xs: 7px;
  --ombre: 0 1px 2px rgb(36 29 33 / .05), 0 4px 16px rgb(36 29 33 / .05);
  --ombre-forte: 0 10px 40px rgb(36 29 33 / .16);
  --police: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --nav-l: 264px;
  --barre-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --accent-doux: color-mix(in oklab, var(--accent) 22%, #1c171a);
    --accent-ligne: color-mix(in oklab, var(--accent) 45%, #1c171a);
    --fond: #151114; --surface: #1e191c; --surface-2: #231d21; --surface-3: #2b2429;
    --encre: #f3edf0; --encre-2: #cdbfc6; --muet: #9d8e96; --ligne: #342c31; --ligne-forte: #44393f;
    --ok-doux: #17322a; --info-doux: #172739; --alerte-doux: #3a2a12; --danger-doux: #3d1b18;
    --ombre: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}

/* Passage doux d'une page à l'autre (navigateurs récents ; ignoré ailleurs) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--police); color: var(--encre); background: var(--fond); -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-fonce); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--ligne); margin: 20px 0; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saut { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 14px; z-index: 100; border-radius: 8px; }
.saut:focus { left: 8px; }
.muted, .muet { color: var(--muet); }
.petit { font-size: .85em; }
.mono { font-family: var(--mono); font-size: .92em; }
.nowrap { white-space: nowrap; }
.droite { text-align: right; }
.centre-txt { text-align: center; }
.gras { font-weight: 600; }
kbd { font: 600 .72rem var(--mono); padding: 2px 6px; border: 1px solid var(--ligne-forte); border-bottom-width: 2px; border-radius: 6px; color: var(--muet); background: var(--surface); }

/* ---------- Icônes ---------- */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.ic.xl { width: 40px; height: 40px; stroke-width: 1.5; }
.ic.l { width: 24px; height: 24px; }

/* ---------- Structure ---------- */
.nav {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-l); z-index: 40;
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--ligne);
  padding: 14px 12px calc(12px + env(safe-area-inset-bottom));
}
.principal { margin-left: var(--nav-l); min-height: 100vh; display: flex; flex-direction: column; }
.nav-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 12px; }
.marque { display: flex; align-items: center; gap: 10px; color: var(--encre); text-decoration: none; min-width: 0; }
.marque-logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: var(--sur-accent);
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 60%, #f0a)); box-shadow: 0 4px 14px color-mix(in oklab, var(--accent) 35%, transparent); flex: none; }
.marque-nom { display: flex; flex-direction: column; font-weight: 650; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marque-nom small { font-weight: 500; color: var(--muet); font-size: .74rem; }
.centre-choix { display: flex; align-items: center; gap: 8px; margin: 0 4px 12px; padding: 6px 10px; border: 1px solid var(--ligne); border-radius: var(--r-s); background: var(--surface-2); color: var(--muet); }
.centre-choix select { border: 0; background: transparent; font: inherit; color: var(--encre); font-weight: 600; flex: 1; min-width: 0; padding: 4px 0; }
.nav-liens { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.nav-groupe { margin-bottom: 10px; }
.nav-titre { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muet); margin: 12px 10px 4px; font-weight: 650; }
.nav-lien { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-s); color: var(--encre-2); text-decoration: none; font-weight: 520; position: relative; transition: background .15s, color .15s; }
.nav-lien:hover { background: var(--surface-3); color: var(--encre); }
.nav-lien.actif { background: var(--accent-doux); color: var(--accent-fonce); font-weight: 620; }
.nav-lien.actif::before { content: ""; position: absolute; left: -4px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav-lien.verrou { opacity: .62; }
.nav-lien span { flex: 1; }
.pastille-version { font-style: normal; font-size: .64rem; font-weight: 700; padding: 2px 6px; border-radius: 99px; background: var(--surface-3); color: var(--muet); }
.compteur { font-size: .7rem; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 99px; background: var(--accent); color: var(--sur-accent); font-weight: 700; }
.nav-pied { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--ligne); padding-top: 10px; margin-top: 8px; }
.moi { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--encre); text-decoration: none; padding: 6px; border-radius: var(--r-s); min-width: 0; }
.moi:hover { background: var(--surface-3); }
.moi span:last-child { display: flex; flex-direction: column; font-weight: 600; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moi small { font-weight: 500; color: var(--muet); font-size: .74rem; }

.barre { position: sticky; top: 0; z-index: 30; height: var(--barre-h); display: flex; align-items: center; gap: 10px; padding: 0 24px;
  background: color-mix(in oklab, var(--fond) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; }
.recherche-ouvrir { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--ligne); border-radius: 12px; background: var(--surface); color: var(--muet); font: inherit; cursor: pointer; text-align: left; box-shadow: var(--ombre); }
.recherche-ouvrir span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recherche-ouvrir:hover { border-color: var(--ligne-forte); }
.barre-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.contenu { width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px 24px 40px; flex: 1; }
.contenu.large { max-width: 1600px; }
.tete-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.tete-page h1 { margin: 0; }
.sous-titre { color: var(--muet); margin: 4px 0 0; }
.tete-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pied { padding: 18px 24px 90px; }
.credit { text-align: center; font-size: .78rem; color: var(--muet); margin: 0; }
.credit a { color: inherit; }
.voile { display: none; }
.nav-mobile { display: none; }

/* ---------- Boutons ---------- */
.btn { --b: var(--surface); --t: var(--encre); --l: var(--ligne-forte);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; min-height: 40px;
  border: 1px solid var(--l); border-radius: 11px; background: var(--b); color: var(--t); font: 600 .92rem var(--police);
  text-decoration: none; cursor: pointer; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { --l: var(--muet); color: var(--t); }
.btn:active { transform: translateY(1px); }
.btn.primaire { --b: var(--accent); --t: var(--sur-accent); --l: var(--accent); box-shadow: 0 2px 10px color-mix(in oklab, var(--accent) 30%, transparent); }
.btn.primaire:hover { --b: var(--accent-fonce); --l: var(--accent-fonce); }
.btn.discret { --b: transparent; --l: transparent; --t: var(--encre-2); }
.btn.discret:hover { --b: var(--surface-3); }
.btn.danger { --t: var(--danger); --l: color-mix(in oklab, var(--danger) 40%, white); }
.btn.danger:hover { --b: var(--danger); --t: #fff; --l: var(--danger); }
.btn.ok { --b: var(--ok); --t: #fff; --l: var(--ok); }
.btn.petit { padding: 5px 10px; min-height: 32px; font-size: .84rem; border-radius: 9px; }
.btn.seul { padding: 8px; aspect-ratio: 1; }
.btn[disabled], .btn.inactif { opacity: .5; pointer-events: none; }
.btn-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 11px; background: transparent; color: var(--encre-2); cursor: pointer; }
.btn-ic:hover { background: var(--surface-3); color: var(--encre); }
.btn-ic.nav-fermer, .btn-ic.menu-ouvrir { display: none; }
.ligne-boutons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ligne-boutons.fin { justify-content: flex-end; }

/* ---------- Badges, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--encre-2); }
.badge.ok { background: var(--ok-doux); color: var(--ok); }
.badge.info { background: var(--info-doux); color: var(--info); }
.badge.alerte { background: var(--alerte-doux); color: var(--alerte); }
.badge.danger { background: var(--danger-doux); color: var(--danger); }
.badge.accent { background: var(--accent-doux); color: var(--accent-fonce); }
.avatar { --c: var(--accent); width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: .8rem; font-weight: 700; color: #fff; background: var(--c); }
.avatar.l { width: 56px; height: 56px; font-size: 1.1rem; }
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--accent)); vertical-align: middle; }

/* ---------- Cartes et grilles ---------- */
.carte { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r); box-shadow: var(--ombre); padding: 18px 20px; margin-bottom: 16px; }
.carte > h2:first-child, .carte > h3:first-child, .carte-tete { margin-top: 0; }
.carte-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.carte-tete h2, .carte-tete h3 { margin: 0; }
.carte.plate { box-shadow: none; }
.carte.accent { border-color: var(--accent-ligne); background: linear-gradient(180deg, var(--accent-doux), var(--surface) 70%); }
.carte.alerte { border-color: color-mix(in oklab, var(--alerte) 35%, white); background: var(--alerte-doux); }
.grille { display: grid; gap: 16px; }
.grille.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grille.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grille.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grille.auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.deux-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r); box-shadow: var(--ombre); color: var(--encre); text-decoration: none; position: relative; overflow: hidden; }
a.stat:hover { border-color: var(--accent-ligne); }
.stat > .ic { position: absolute; right: 14px; top: 14px; color: var(--accent); opacity: .8; }
.stat-lib { font-size: .8rem; color: var(--muet); font-weight: 600; }
.stat-val { font-size: 1.55rem; font-weight: 720; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-det { font-size: .8rem; color: var(--muet); }

/* ---------- Listes et tableaux ---------- */
.table-cadre { overflow-x: auto; border: 1px solid var(--ligne); border-radius: var(--r); background: var(--surface); box-shadow: var(--ombre); margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muet); font-weight: 650; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--ligne); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--ligne); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table a.ligne-lien { color: inherit; text-decoration: none; font-weight: 600; }
.table tfoot td { font-weight: 700; background: var(--surface-2); }
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--ligne); }
.liste > li:last-child { border-bottom: 0; }
.liste .grandit { flex: 1; min-width: 0; }
.liste .detail { overflow-wrap: anywhere; }
.liste .titre { font-weight: 620; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste .detail { color: var(--muet); font-size: .85rem; }
.liste a.couvre { color: inherit; text-decoration: none; }

/* ---------- Formulaires ---------- */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }   /* minmax(0, …) : un tableau large défile dans son cadre au lieu d'élargir la page */
.form .rangee { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.champ label, .champ legend { font-weight: 600; font-size: .88rem; color: var(--encre-2); }
.requis { color: var(--danger); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=datetime-local],
input[type=password], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; min-height: 42px; border: 1px solid var(--ligne-forte); border-radius: var(--r-s);
  background: var(--surface); color: var(--encre); font: inherit; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent); }
input[type=color] { width: 64px; height: 42px; padding: 3px; border: 1px solid var(--ligne-forte); border-radius: var(--r-s); background: var(--surface); }
.aide { color: var(--muet); font-size: .8rem; }
.case { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 500; }
.case input { width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.case .aide { display: block; }
fieldset.champ { border: 0; padding: 0; margin: 0; }
.radios { gap: 8px; }
.montant { display: flex; align-items: stretch; }
.montant input { border-radius: var(--r-s) 0 0 var(--r-s); text-align: right; font-variant-numeric: tabular-nums; }
.montant span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--ligne-forte); border-left: 0; border-radius: 0 var(--r-s) var(--r-s) 0; background: var(--surface-2); color: var(--muet); font-weight: 600; font-size: .85rem; }
.form-pied { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; padding-top: 6px; }
.form-collant { position: sticky; bottom: 0; background: color-mix(in oklab, var(--fond) 88%, transparent); backdrop-filter: blur(8px); padding: 12px 0; margin-top: 8px; z-index: 5; }
.cases-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; }

/* ---------- Onglets, filtres ---------- */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--ligne); margin: -4px 0 18px; overflow-x: auto; scrollbar-width: none; }
.onglets a { padding: 10px 14px; color: var(--muet); text-decoration: none; font-weight: 600; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.onglets a:hover { color: var(--encre); }
.onglets a.actif { color: var(--accent-fonce); border-color: var(--accent); }
.outils { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.outils .champ-recherche { flex: 1; min-width: 200px; position: relative; }
.outils .champ-recherche .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muet); }
.outils .champ-recherche input { padding-left: 38px; }
.puces { display: flex; gap: 6px; flex-wrap: wrap; }
.puce { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--ligne-forte); background: var(--surface); color: var(--encre-2); text-decoration: none; font-size: .85rem; font-weight: 600; cursor: pointer; }
.puce.active, .puce[aria-pressed=true] { background: var(--encre); border-color: var(--encre); color: var(--surface); }

/* ---------- Messages ---------- */
.flashs { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-s); background: var(--ok-doux); color: var(--ok); font-weight: 560; animation: entrer .25s ease-out; }
.flash.info { background: var(--info-doux); color: var(--info); }
.flash.alerte { background: var(--alerte-doux); color: var(--alerte); }
.flash.erreur { background: var(--danger-doux); color: var(--danger); }
.flash span { color: var(--encre); font-weight: 500; }
.note { padding: 12px 14px; border-radius: var(--r-s); background: var(--surface-2); border: 1px dashed var(--ligne-forte); color: var(--encre-2); font-size: .9rem; }
.note.alerte { background: var(--alerte-doux); border: 1px solid color-mix(in oklab, var(--alerte) 30%, white); color: var(--encre); }
.note.danger { background: var(--danger-doux); border: 1px solid color-mix(in oklab, var(--danger) 30%, white); color: var(--encre); }
.note.info { background: var(--info-doux); border: 1px solid color-mix(in oklab, var(--info) 25%, white); color: var(--encre); }
.vide { text-align: center; padding: 48px 20px; color: var(--muet); }
.vide .ic.xl { color: var(--accent); opacity: .85; margin-bottom: 10px; }
.vide h2 { color: var(--encre); font-size: 1.15rem; }
.vide.option { max-width: 560px; margin: 0 auto; }
@keyframes entrer { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Fenêtres (palette, confirmation) ---------- */
dialog { border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--encre); box-shadow: var(--ombre-forte); max-width: calc(100vw - 24px); }
dialog::backdrop { background: rgb(20 14 18 / .38); backdrop-filter: blur(3px); }
dialog[open] { animation: fenetre .18s ease-out; }
@keyframes fenetre { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.palette { width: 620px; margin-top: 10vh; }
.palette-form { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--ligne); }
.palette-form input { border: 0; box-shadow: none !important; padding: 6px 0; font-size: 1.05rem; min-height: 0; }
.palette-liste { list-style: none; margin: 0; padding: 8px; max-height: 60vh; overflow-y: auto; }
.palette-liste li a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--encre); text-decoration: none; }
.palette-liste li a[aria-selected=true], .palette-liste li a:hover { background: var(--accent-doux); }
.palette-liste li a small { display: block; color: var(--muet); }
.palette-liste .groupe { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muet); padding: 10px 12px 4px; font-weight: 650; }
.confirmer { width: 420px; }
.confirmer form { padding: 22px; }
.confirmer p { font-size: 1.02rem; margin-bottom: 18px; }
.confirmer .ligne-boutons { justify-content: flex-end; }
.feuille { width: 640px; }
.feuille-tete { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--ligne); }
.feuille-tete h2 { margin: 0; }
.feuille-corps { padding: 18px 20px; max-height: 72vh; overflow-y: auto; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--encre); color: var(--surface); box-shadow: var(--ombre-forte); font-weight: 560; animation: entrer .2s ease-out; max-width: 360px; }

/* ---------- Divers ---------- */
.chronologie { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--ligne); }
.chronologie > li { position: relative; padding: 0 0 18px 14px; }
.chronologie > li::before { content: ""; position: absolute; left: -26px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--accent); }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; color: var(--muet); font-size: .88rem; }
.pagination a { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; text-decoration: none; }
.progression { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progression > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.signature-zone { border: 1.5px dashed var(--ligne-forte); border-radius: var(--r-s); background: var(--surface-2); touch-action: none; width: 100%; height: 190px; display: block; }
.entete-fiche { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.entete-fiche .grandit { flex: 1; min-width: 200px; }
.etiquettes { display: flex; gap: 6px; flex-wrap: wrap; }
.etiquettes .badge { white-space: normal; }   /* une étiquette longue passe à la ligne (téléphone) */
.contenu-nu { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.boite-acces { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--ligne); border-radius: 22px; box-shadow: var(--ombre-forte); padding: 30px 28px; }
.boite-acces.large { max-width: 640px; }
.boite-acces .marque { margin-bottom: 20px; }
.boite-acces h1 { font-size: 1.35rem; }
.nue .credit { position: fixed; bottom: 12px; left: 0; right: 0; }
.etapes { display: flex; gap: 6px; margin-bottom: 18px; }
.etapes span { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); }
.etapes span.fait { background: var(--accent); }

/* ---------- Téléphone et tablette ---------- */
@media (max-width: 1024px) {
  .nav { transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--ombre-forte); width: min(86vw, 320px); }
  body.nav-ouverte .nav { transform: none; }
  body.nav-ouverte .voile { display: block; position: fixed; inset: 0; background: rgb(20 14 18 / .35); z-index: 35; }
  .btn-ic.nav-fermer { display: inline-grid; }
  .principal { margin-left: 0; }
  .btn-ic.menu-ouvrir { display: inline-grid; }
  .barre { padding: 0 12px; }
  .contenu { padding: 12px 16px 32px; }
  .deux-col { grid-template-columns: 1fr; }
  .grille.g3, .grille.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .recherche-ouvrir span, .recherche-ouvrir kbd { display: none; }
  .recherche-ouvrir { flex: 0; padding: 10px; box-shadow: none; }
  .barre-actions .btn span { display: none; }
  .grille.g2, .grille.g3, .grille.g4 { grid-template-columns: minmax(0, 1fr); }   /* une adresse longue ne fait plus déborder la page */
  .carte-tete { flex-wrap: wrap; }
  h1 { font-size: 1.3rem; }
  .tete-page { align-items: flex-start; }
  .tete-actions { width: 100%; }
  .tete-actions .btn { flex: 1; }
  .carte { padding: 14px; border-radius: 12px; }
  .nav-mobile { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in oklab, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px); border-top: 1px solid var(--ligne); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .nav-mobile a, .nav-mobile button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font: 600 .68rem var(--police); color: var(--muet); text-decoration: none; background: none; border: 0; padding: 4px 0; cursor: pointer; }
  .nav-mobile .actif { color: var(--accent); }
  .nav-mobile .ic { width: 22px; height: 22px; }
  .pied { padding-bottom: 96px; }
  .table.cartes thead { display: none; }
  .table.cartes, .table.cartes tbody, .table.cartes tr, .table.cartes td { display: block; width: 100%; }
  .table.cartes tr { padding: 10px 12px; border-bottom: 1px solid var(--ligne); }
  .table.cartes td { border: 0; padding: 2px 0; }
  .table.cartes td[data-l]::before { content: attr(data-l) " : "; color: var(--muet); font-size: .82rem; }
  .table.cartes .num { text-align: left; }
  .palette { margin-top: 0; width: 100vw; max-width: 100vw; border-radius: 0 0 18px 18px; }
  .toasts { left: 12px; right: 12px; bottom: 80px; }
}

/* ---------- Impression (factures, dossiers) ---------- */
@media print {
  .nav, .barre, .nav-mobile, .pied, .tete-actions, .onglets, .flashs, .pas-imprimer, .form-pied { display: none !important; }
  .principal { margin: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .carte, .table-cadre { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .contenu { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
}

/* ---------- Compléments communs (retours des modules) ---------- */
[hidden] { display: none !important; }
:where(.contenu-nu > *) { max-width: 100%; }   /* sans poids : la carte de connexion garde ses 420 px sur ordinateur */
.nue .credit { position: static; margin: 24px 0 12px; }
@media (max-width: 720px) {
  .table.cartes tfoot { display: block; }
  .table.cartes tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 10px 12px; }
  .table.cartes tfoot td { display: inline; width: auto; padding: 0; }
  .table.cartes tfoot td:empty { display: none; }
}
@media print { .nue .credit { display: none; } }
@media (max-width: 1024px) { .deux-col { grid-template-columns: minmax(0, 1fr); } }
.case > .aide { flex-basis: 100%; margin-left: 29px; margin-top: -6px; }
.case { flex-wrap: wrap; }
@media (max-width: 720px) { .stat > .ic { position: static; margin-bottom: 4px; } }
.contenu-nu.document, .document .contenu-nu { display: block; place-items: normal; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="clair"]) .onglets a.actif { color: color-mix(in oklab, var(--accent) 55%, white); } }
