/* ═══════════════════════════════════════════════════════════════════════
   QG — feuille de style de base (refonte « Apple » du 6 septembre 2026)

   Inspirée d'apple.com et d'iOS : fond gris très clair, cartes blanches très
   arrondies à peine soulevées, hiérarchie typographique nette, boutons pilules,
   contrôles segmentés, listes groupées, beaucoup d'air, un accent de couleur.

   TYPOGRAPHIE : San Francisco. Sur iPhone, iPad et Mac, c'est la police du
   système (-apple-system / SF Pro). Apple ne permet pas de l'embarquer sur un
   site : sur Windows, on charge Inter (polices/Inter-latin.woff2, licence
   libre), la jumelle de SF — et si « SF Pro Text/Display » est installée sur
   le PC, elle passe devant. L'axe optique (font-optical-sizing) donne le
   dessin « Display » aux grands titres et « Text » au corps, comme chez Apple.

   Tout le nuancier vit dans :root (mode clair) et html[data-mode="sombre"] ;
   l'accent se choisit dans Réglages → Apparence (html[data-accent]).
   Les composants ne connaissent que des variables, jamais une couleur en dur.
   ═══════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('polices/Inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* ── encres et surfaces (mode clair) ── */
  --encre: #1d1d1f;
  --encre-douce: #6e6e73;
  --encre-pale: #86868b;
  --encre-tres-pale: #aeaeb2;
  --fond: #f5f5f7;
  --carte: #ffffff;
  --voile: #f5f5f7;
  --voile-2: #e8e8ed;
  --bordure: rgba(0, 0, 0, .07);
  --bordure-carte: transparent;
  --separateur: rgba(0, 0, 0, .06);
  --bordure-forte: rgba(0, 0, 0, .16);
  --piste: rgba(120, 120, 128, .12);
  --piste-fort: rgba(120, 120, 128, .2);

  /* ── l'accent : bleu Apple par défaut — redéfini par html[data-accent] ── */
  --accent: #0071e3;
  --accent-vif: #007aff;
  --accent-contraste: #ffffff;
  --accent-fond: rgba(0, 113, 227, .1);
  --accent-voile: rgba(0, 113, 227, .2);
  --donnees: var(--accent);
  --or: var(--accent);
  --or-sombre: var(--accent);

  /* ── les couleurs système d'iOS : un sens chacune ── */
  --rouge: #ff3b30;   --rouge-fond: rgba(255, 59, 48, .12);
  --orange: #ff9500;  --orange-fond: rgba(255, 149, 0, .14);
  --jaune: #ffcc00;   --jaune-fond: rgba(255, 204, 0, .18);
  --vert: #34c759;    --vert-fond: rgba(52, 199, 89, .14);
  --menthe: #00c7be;  --menthe-fond: rgba(0, 199, 190, .14);
  --bleu: #007aff;    --bleu-fond: rgba(0, 122, 255, .12);
  --indigo: #5856d6;  --indigo-fond: rgba(88, 86, 214, .13);
  --violet: #af52de;  --violet-fond: rgba(175, 82, 222, .13);
  --rose: #ff2d55;    --rose-fond: rgba(255, 45, 85, .12);
  --marron: #a2845e;  --marron-fond: rgba(162, 132, 94, .16);
  --gris: #8e8e93;    --gris-fond: rgba(142, 142, 147, .16);

  /* ── sémantique (texte lisible sur fond clair, fond teinté) ── */
  --alerte: #d70015;
  --alerte-fond: rgba(255, 59, 48, .11);
  --succes: #1f8a3d;
  --succes-fond: rgba(52, 199, 89, .13);
  --succes-voile: rgba(52, 199, 89, .22);
  --attention: #b25e00;
  --attention-fond: rgba(255, 149, 0, .13);
  --info-fond: rgba(0, 122, 255, .09);
  --rang-pair: rgba(0, 0, 0, .015);
  --rang-survol: rgba(0, 0, 0, .035);

  /* ── l'en-tête : verre dépoli ── */
  --entete-fond: rgba(255, 255, 255, .78);
  --entete-texte: #1d1d1f;
  --entete-sous: #6e6e73;
  --entete-trait: rgba(0, 0, 0, .08);
  --entete-bouton: rgba(0, 0, 0, .05);

  /* ── formes, ombres, mouvements ── */
  --r-xs: 8px;
  --r-s: 12px;
  --r-m: 18px;
  --r-l: 24px;
  --r-xl: 28px;
  --rayon: var(--r-m);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-sortie: cubic-bezier(.2, .8, .2, 1);
  --ombre-s: 0 1px 2px rgba(0, 0, 0, .03), 0 3px 12px rgba(0, 0, 0, .04);
  --ombre-m: 0 6px 24px rgba(0, 0, 0, .09);
  --ombre-l: 0 24px 64px rgba(0, 0, 0, .2);
  --ombre-segment: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
  --hauteur-entete: 56px;
  --hauteur-barre-mobile: 56px;

  --police: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'SF Pro', 'Inter',
            'Segoe UI Variable Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --police-titres: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'SF Pro', 'Inter',
            'Segoe UI Variable Display', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --police-chiffres: var(--police);
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* les quatre fronts : une couleur d'identité chacun (pastilles, jamais les boutons) */
  --c-designme: #34c759;
  --c-direct: #007aff;
  --c-elo: #af52de;
  --c-ltp: #ff9500;
}

/* ── mode SOMBRE : le noir d'iOS ── */
html[data-mode="sombre"] {
  --encre: #f5f5f7;
  --encre-douce: #a1a1a6;
  --encre-pale: #8e8e93;
  --encre-tres-pale: #636366;
  --fond: #000000;
  --carte: #1c1c1e;
  --voile: #2c2c2e;
  --voile-2: #3a3a3c;
  --bordure: rgba(255, 255, 255, .08);
  --bordure-carte: rgba(255, 255, 255, .08);
  --separateur: rgba(255, 255, 255, .08);
  --bordure-forte: rgba(255, 255, 255, .2);
  --piste: rgba(120, 120, 128, .24);
  --piste-fort: rgba(120, 120, 128, .36);

  --accent: #0a84ff;
  --accent-vif: #0a84ff;
  --accent-fond: rgba(10, 132, 255, .18);
  --accent-voile: rgba(10, 132, 255, .3);

  --rouge: #ff453a; --orange: #ff9f0a; --jaune: #ffd60a; --vert: #30d158; --menthe: #63e6e2;
  --bleu: #0a84ff; --indigo: #5e5ce6; --violet: #bf5af2; --rose: #ff375f; --marron: #ac8e68; --gris: #8e8e93;

  --alerte: #ff453a;
  --alerte-fond: rgba(255, 69, 58, .16);
  --succes: #30d158;
  --succes-fond: rgba(48, 209, 88, .16);
  --succes-voile: rgba(48, 209, 88, .26);
  --attention: #ff9f0a;
  --attention-fond: rgba(255, 159, 10, .16);
  --info-fond: rgba(10, 132, 255, .14);
  --rang-pair: rgba(255, 255, 255, .02);
  --rang-survol: rgba(255, 255, 255, .05);

  --entete-fond: rgba(22, 22, 24, .78);
  --entete-texte: #f5f5f7;
  --entete-sous: #98989d;
  --entete-trait: rgba(255, 255, 255, .1);
  --entete-bouton: rgba(255, 255, 255, .09);

  --ombre-s: 0 1px 2px rgba(0, 0, 0, .4);
  --ombre-m: 0 8px 28px rgba(0, 0, 0, .5);
  --ombre-l: 0 24px 70px rgba(0, 0, 0, .7);
  --ombre-segment: 0 3px 8px rgba(0, 0, 0, .4);
}

/* ── les accents au choix (Réglages → Apparence) ── */
html[data-accent="graphite"] { --accent: #1d1d1f; --accent-vif: #1d1d1f; --accent-contraste: #fff; --accent-fond: rgba(0, 0, 0, .07); --accent-voile: rgba(0, 0, 0, .14); }
html[data-accent="bleu"]     { --accent: #0071e3; --accent-vif: #007aff; --accent-contraste: #fff; --accent-fond: rgba(0, 113, 227, .1);  --accent-voile: rgba(0, 113, 227, .2); }
html[data-accent="vert"]     { --accent: #1f8a3d; --accent-vif: #34c759; --accent-contraste: #fff; --accent-fond: rgba(52, 199, 89, .12);  --accent-voile: rgba(52, 199, 89, .24); }
html[data-accent="orange"]   { --accent: #e8890c; --accent-vif: #ff9500; --accent-contraste: #fff; --accent-fond: rgba(255, 149, 0, .12);  --accent-voile: rgba(255, 149, 0, .24); }
html[data-accent="rose"]     { --accent: #e0305a; --accent-vif: #ff2d55; --accent-contraste: #fff; --accent-fond: rgba(255, 45, 85, .1);   --accent-voile: rgba(255, 45, 85, .2); }
html[data-accent="violet"]   { --accent: #9d45db; --accent-vif: #af52de; --accent-contraste: #fff; --accent-fond: rgba(175, 82, 222, .11); --accent-voile: rgba(175, 82, 222, .22); }
html[data-accent="dore"]     { --accent: #a97e1f; --accent-vif: #cfa251; --accent-contraste: #fff; --accent-fond: rgba(207, 162, 81, .14); --accent-voile: rgba(207, 162, 81, .28); }
html[data-mode="sombre"][data-accent="graphite"] { --accent: #f5f5f7; --accent-vif: #f5f5f7; --accent-contraste: #111113; --accent-fond: rgba(255, 255, 255, .1); --accent-voile: rgba(255, 255, 255, .18); }
html[data-mode="sombre"][data-accent="bleu"]     { --accent: #0a84ff; --accent-vif: #0a84ff; --accent-fond: rgba(10, 132, 255, .18); --accent-voile: rgba(10, 132, 255, .3); }
html[data-mode="sombre"][data-accent="vert"]     { --accent: #30d158; --accent-vif: #30d158; --accent-contraste: #06210f; }
html[data-mode="sombre"][data-accent="orange"]   { --accent: #ff9f0a; --accent-vif: #ff9f0a; --accent-contraste: #2b1d02; }
html[data-mode="sombre"][data-accent="rose"]     { --accent: #ff375f; --accent-vif: #ff375f; }
html[data-mode="sombre"][data-accent="violet"]   { --accent: #bf5af2; --accent-vif: #bf5af2; }
html[data-mode="sombre"][data-accent="dore"]     { --accent: #e0b45c; --accent-vif: #e0b45c; --accent-contraste: #2a2005; }

/* ═══════════════════════════════════════════════════════════ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; scroll-behavior: smooth; }
html[data-mode="sombre"] { color-scheme: dark; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.47;
  letter-spacing: -0.011em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv05' 1, 'ss03' 1;
}
body.fenetre-ouverte { overflow: hidden; }
::selection { background: var(--accent-voile); }
[hidden] { display: none !important; }

h1, h2, h3, h4 { font-family: var(--police-titres); color: var(--encre); }
h1 { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.032em; line-height: 1.1; margin: 0 0 .2em; }
h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.022em; line-height: 1.25; margin: 0 0 .6em; }
h3 { font-size: 1rem; font-weight: 650; letter-spacing: -0.014em; margin: 0 0 .35em; }
p { margin: 0 0 .85em; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 650; }
small { font-size: .85em; }
svg { display: inline-block; vertical-align: middle; }
img { max-width: 100%; }
button { font-family: inherit; }
kbd, code, .touche { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* les nombres alignés en colonne : chiffres de largeur fixe */
.ligne-montant, .fac-montant, .tuile-valeur, .col-nombre, .total-editeur b, .ligne-total, .repartition b,
.saisie-nombre, .barre-etiquette, .graphique-grille i, .num, .tnum, .stat .valeur, .compteur, .chiffre {
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1, 'cv05' 1;
}

/* ═══════════════════════════════════════════════════════════ icônes (SVG en ligne, façon SF Symbols) */
.icone {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.2em;
}
.icone-plein { fill: currentColor; stroke: none; }
.icone-s { width: .95em; height: .95em; }
.icone-l { width: 1.5em; height: 1.5em; }
/* la vignette d'icône : un carré arrondi coloré et son glyphe blanc (comme les Réglages d'iOS) */
.vignette {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--vignette, var(--accent-vif)); color: #fff;
}
.vignette .icone { width: 18px; height: 18px; stroke-width: 2; }
.vignette-l { width: 44px; height: 44px; border-radius: 12px; }
.vignette-l .icone { width: 24px; height: 24px; }
.vignette-xl { width: 64px; height: 64px; border-radius: 18px; }
.vignette-xl .icone { width: 34px; height: 34px; stroke-width: 1.8; }
.vignette-douce { background: var(--vignette-fond, var(--accent-fond)); color: var(--vignette, var(--accent)); }
.vignette-rouge { --vignette: var(--rouge); --vignette-fond: var(--rouge-fond); }
.vignette-orange { --vignette: var(--orange); --vignette-fond: var(--orange-fond); }
.vignette-jaune { --vignette: #e6b800; --vignette-fond: var(--jaune-fond); }
.vignette-vert { --vignette: var(--vert); --vignette-fond: var(--vert-fond); }
.vignette-menthe { --vignette: var(--menthe); --vignette-fond: var(--menthe-fond); }
.vignette-bleu { --vignette: var(--bleu); --vignette-fond: var(--bleu-fond); }
.vignette-indigo { --vignette: var(--indigo); --vignette-fond: var(--indigo-fond); }
.vignette-violet { --vignette: var(--violet); --vignette-fond: var(--violet-fond); }
.vignette-rose { --vignette: var(--rose); --vignette-fond: var(--rose-fond); }
.vignette-marron { --vignette: var(--marron); --vignette-fond: var(--marron-fond); }
.vignette-gris { --vignette: var(--gris); --vignette-fond: var(--gris-fond); }
.vignette-encre { --vignette: var(--encre); --vignette-fond: var(--piste); }
.vignette-designme { --vignette: var(--c-designme); --vignette-fond: var(--vert-fond); }
.vignette-direct { --vignette: var(--c-direct); --vignette-fond: var(--bleu-fond); }
.vignette-elo { --vignette: var(--c-elo); --vignette-fond: var(--violet-fond); }
.vignette-ltp { --vignette: var(--c-ltp); --vignette-fond: var(--orange-fond); }
/* les initiales (clients, tiers) */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--avatar-fond, var(--accent-fond)); color: var(--avatar, var(--accent));
  font-weight: 650; font-size: .85rem; letter-spacing: 0;
}
.avatar-s { width: 28px; height: 28px; font-size: .72rem; }
/* l'anneau de progression (SVG dessiné par QGUI.anneau) */
.anneau { display: inline-grid; place-items: center; position: relative; flex: none; }
.anneau svg { display: block; transform: rotate(-90deg); }
.anneau .anneau-piste { fill: none; stroke: var(--piste); }
.anneau .anneau-trait { fill: none; stroke: var(--anneau, var(--accent-vif)); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.anneau .anneau-texte { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.anneau-ok { --anneau: var(--vert); }
.anneau-alerte { --anneau: var(--rouge); }
.anneau-attention { --anneau: var(--orange); }

/* ═══════════════════════════════════════════════════════════ chargement */
.chargement {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; background: var(--fond); color: var(--encre-pale);
  transition: opacity .35s ease;
}
.chargement.parti { opacity: 0; pointer-events: none; }
.chargement-cercle {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2.5px solid var(--piste); border-top-color: var(--accent);
  animation: tourne .8s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════ en-tête (verre dépoli) */
.entete {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--hauteur-entete) + env(safe-area-inset-top));
  color: var(--entete-texte);
  /* le verre est posé sur un pseudo-élément : un backdrop-filter sur l'en-tête lui-même
     ferait de lui le référent des éléments fixes (la barre d'onglets mobile) */
}
.entete::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--entete-fond);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 var(--entete-trait);
}
.entete-marque { display: flex; flex-direction: column; line-height: 1.1; }
.entete-titre {
  font-weight: 650; letter-spacing: .09em; text-transform: uppercase;
  font-size: .64rem; color: var(--entete-sous);
}
.entete-sous-titre { font-size: .95rem; font-weight: 600; letter-spacing: -0.012em; }
.entete-marque-qg { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: none; }
.entete-marque-qg:hover { text-decoration: none; }
.entete-marque-qg .entete-sous-titre { font-size: .92rem; }
.marque-qg {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--encre); color: var(--fond); font-weight: 800; font-size: .88rem; letter-spacing: .04em;
  text-decoration: none; flex: none; font-family: var(--police-titres);
}
html[data-mode="sombre"] .marque-qg { background: #f5f5f7; color: #111; }

.onglets { display: flex; gap: 2px; margin-left: auto; margin-right: auto; }
.onglet {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; min-height: 36px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--entete-sous);
  font: inherit; font-size: .9rem; font-weight: 500; letter-spacing: -0.01em; text-decoration: none;
  transition: background .18s var(--ease), color .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
a.onglet { text-decoration: none; }
.onglet:hover { background: var(--entete-bouton); color: var(--entete-texte); text-decoration: none; }
.onglet.actif { background: var(--accent-fond); color: var(--accent); font-weight: 600; }
.onglet-icone { display: inline-flex; font-size: 1rem; line-height: 1; }
.onglet-icone .icone { width: 19px; height: 19px; stroke-width: 1.8; }
.onglet-texte { white-space: nowrap; }

.entete-outils { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.bouton-icone {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--entete-bouton); color: var(--entete-texte);
  font-size: 1rem; cursor: pointer; text-decoration: none; padding: 0;
  transition: background .18s var(--ease), transform .12s var(--ease);
}
.bouton-icone .icone { width: 18px; height: 18px; }
.bouton-icone:hover { background: var(--accent-fond); color: var(--accent); text-decoration: none; }
.bouton-icone:active { transform: scale(.94); }
.bouton-icone[aria-pressed="true"], .bouton-icone[aria-current="page"], .bouton-icone.actif { background: var(--accent); color: var(--accent-contraste); }
.bouton-icone:disabled { opacity: .35; cursor: default; }
.bouton-icone:disabled:hover { background: var(--entete-bouton); color: var(--entete-texte); }
#bouton-annuler:disabled { opacity: .35; cursor: default; }
#bouton-annuler, #bouton-retablir { font-size: 1.15rem; line-height: 1; }
.bouton-icone-petit { width: 30px; height: 30px; font-size: 1rem; }

/* ═══════════════════════════════════════════════════════════ mise en page */
#contenu { max-width: 1120px; margin: 0 auto; padding: 28px 24px 96px; }
#page { position: relative; }
.vue { display: none; }
.vue.actif { display: block; animation: apparait .3s var(--ease); }
#contenu > .vue.actif { display: block; }
@keyframes apparait { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-etroite { max-width: 820px; }
.colonnes { display: grid; gap: 16px; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.colonnes-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.colonnes-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }

/* la barre d'écran : grand titre à gauche, actions à droite */
.barre-ecran { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.barre-titre { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.barre-titre h1 { margin: 0; }
.barre-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.compteur {
  font-size: .78rem; font-weight: 600; color: var(--encre-douce);
  background: var(--piste); padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.titre-page { font-size: 2.25rem; letter-spacing: -.032em; font-weight: 700; line-height: 1.1; margin: 0 0 .2em; font-family: var(--police-titres); }
.sous-titre { color: var(--encre-douce); font-size: 1rem; margin: 0 0 24px; line-height: 1.5; max-width: 72ch; }
.intro { color: var(--encre-douce); font-size: 1rem; }
.aide { display: block; font-size: .8125rem; color: var(--encre-douce); margin-top: 6px; line-height: 1.5; }
.aide-centree { text-align: center; }
.note { color: var(--encre-douce); font-size: .8125rem; line-height: 1.5; margin: 2px 0 0; }
.note.erreur { color: var(--alerte); }
.avertissement { color: var(--alerte); font-size: .875rem; }
.texte-ok, .texte-succes { color: var(--succes); }
.texte-alerte { color: var(--alerte); }
.texte-attention { color: var(--attention); }
.absent { color: var(--encre-pale); font-style: italic; }
.vide { text-align: center; padding: 48px 20px; color: var(--encre-douce); }
.vide-titre { font-weight: 650; color: var(--encre); margin: 0 0 6px; font-size: 1.05rem; letter-spacing: -0.015em; }
.vide-petit { color: var(--encre-douce); font-size: .9rem; margin: 8px 0; }
.vide .vignette { margin-bottom: 14px; }
.vide .bouton { margin-top: 12px; }
/* petits libellés de section : gris, jamais criards */
.filtre-nom, .palette-groupe, .repere-libelle, .sous-titre-pli, .sous-titre-panneau, .eyebrow, .echeancier-jour, .libelle-ligne, .ligne-entete {
  text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 650; color: var(--encre-pale);
}
.sous-titre-panneau { margin: 14px 0 6px; }
.sous-titre-panneau:first-of-type { margin-top: 2px; }
.sous-section { font-size: 1rem; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -0.014em; }
.sous-section .note { font-weight: 400; margin-left: 8px; }
.titre-section { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; }
.titre-section h2, .titre-section h3 { margin: 0; }

/* ═══════════════════════════════════════════════════════════ boutons (pilules) */
.bouton, .bouton-vert, .btn-annuler, .mission-suppr {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: .95rem; font-weight: 590; letter-spacing: -0.012em; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  color: var(--encre); background: var(--voile-2);
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease), filter .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.bouton:hover { text-decoration: none; filter: brightness(.97); }
.bouton:active, .bouton-vert:active, .btn-annuler:active { transform: scale(.97); }
.bouton:disabled, .bouton-vert:disabled { opacity: .45; cursor: default; transform: none; }
.bouton .icone { width: 18px; height: 18px; }
.bouton-principal, .bouton-vert { background: var(--accent); color: var(--accent-contraste); }
.bouton-principal:hover:not(:disabled), .bouton-vert:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
.bouton-secondaire { background: var(--voile-2); color: var(--encre); }
.bouton-secondaire:hover:not(:disabled) { background: var(--piste-fort); }
.bouton-discret { background: transparent; color: var(--accent); }
.bouton-discret:hover { background: var(--accent-fond); }
.bouton-danger { background: var(--rouge); color: #fff; }
.bouton-danger-discret { background: transparent; color: var(--alerte); }
.bouton-danger-discret:hover { background: var(--alerte-fond); }
.mission-suppr.danger { background: var(--rouge); color: #fff; }
.bouton-encaisser { background: var(--vert); color: #fff; }
.bouton-encaisser:hover:not(:disabled) { filter: brightness(1.06); }
.bouton-petit, .mission-suppr { min-height: 34px; padding: 6px 14px; font-size: .85rem; }
.bouton-petit.bouton-principal { background: var(--accent); color: var(--accent-contraste); }
.bouton-large { width: 100%; }
.bouton-retour { background: transparent; color: var(--accent); padding-left: 6px; font-weight: 500; }
.bouton-retour:hover { background: var(--accent-fond); }
.mission-suppr { background: transparent; color: var(--encre-pale); }
.mission-suppr:hover { color: var(--alerte); background: var(--alerte-fond); }
.bouton-suppr, .tache-suppr {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: transparent;
  color: var(--encre-pale); cursor: pointer; font-size: .9rem; line-height: 1; padding: 0;
  transition: color .16s ease, background .16s ease;
}
.bouton-suppr:hover, .tache-suppr:hover { color: var(--alerte); background: var(--alerte-fond); }
.lien-discret, .bouton-lien {
  background: none; border: 0; padding: 0 2px; cursor: pointer;
  color: var(--accent); font: inherit; font-size: .875rem; font-weight: 500; text-decoration: none;
}
.lien-discret:hover, .bouton-lien:hover { text-decoration: underline; text-underline-offset: 2px; }
.lien-retour { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); text-decoration: none; font-size: .9rem; font-weight: 500; }
.lien-retour:hover { text-decoration: underline; }
/* un bouton « + » rond, plein */
.bouton-rond { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.bouton-rond .icone { width: 22px; height: 22px; }

/* ═══════════════════════════════════════════════════════════ champs */
.champ, .input, .select, .tache-date, .mission-statut {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--bordure); border-radius: var(--r-s);
  background: var(--carte); color: var(--encre);
  font: inherit; font-size: .95rem; letter-spacing: -0.01em;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
  -webkit-appearance: none; appearance: none; outline: none;
}
html[data-mode="sombre"] .champ, html[data-mode="sombre"] .input, html[data-mode="sombre"] .select { background: var(--voile); }
.champ:hover, .input:hover, .select:hover { border-color: var(--bordure-forte); }
.champ:focus, .input:focus, .select:focus, textarea.champ:focus, textarea.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-voile);
}
.champ::placeholder, .input::placeholder { color: var(--encre-pale); }
.champ:disabled { background: var(--voile); color: var(--encre-douce); border-color: transparent; }
select.champ, .select, .mission-statut {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 11px;
  padding-right: 34px; cursor: pointer;
}
textarea.champ, textarea.input { min-height: 84px; resize: vertical; line-height: 1.5; }
.champ-recherche { max-width: 480px; }
.champ-code { font-size: 1.6rem; letter-spacing: .5em; text-align: center; padding-left: .5em; font-variant-numeric: tabular-nums; }
.champ-numero { font-variant-numeric: tabular-nums; max-width: 240px; }
.champ-petit { flex: 0 1 150px; }
.champ-compact { min-height: 36px; padding: 6px 10px; font-size: .85rem; }
input[type="date"].champ, input[type="time"].champ, input[type="month"].champ { min-width: 0; }
input[type="color"] { border: 1px solid var(--bordure); border-radius: var(--r-xs); background: var(--carte); padding: 2px; height: 36px; width: 44px; }

.bloc-champ { display: block; margin-bottom: 15px; }
.libelle {
  display: block; font-size: .78rem; font-weight: 600; letter-spacing: .01em;
  color: var(--encre-douce); margin-bottom: 6px; text-transform: none;
}
.bloc-case { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 13px; cursor: pointer; }
.bloc-case input { margin-top: 3px; width: 19px; height: 19px; accent-color: var(--accent); flex: 0 0 auto; }
.choix-radio { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 10px; }
.choix-radio label { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: .95rem; }
.choix-radio input { width: 19px; height: 19px; accent-color: var(--accent); }
.case { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--encre-douce); min-height: 44px; cursor: pointer; }
.case input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
/* l'interrupteur (façon iOS) */
.interrupteur { position: relative; display: inline-block; width: 51px; height: 31px; border-radius: 999px; background: var(--piste-fort); cursor: pointer; transition: background .22s var(--ease); flex: none; vertical-align: middle; }
.interrupteur::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .06); transition: transform .22s var(--ease); }
.interrupteur.on, .interrupteur[aria-checked="true"] { background: var(--vert); }
.interrupteur.on::after, .interrupteur[aria-checked="true"]::after { transform: translateX(20px); }

/* ═══════════════════════════════════════════════════════════ contrôles segmentés (façon iOS) */
.barre-recherche { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.filtres, .sous-onglets, .seg-qg, .segment, .seg, .sphere-choix {
  display: inline-flex; gap: 2px; padding: 2px;
  background: var(--piste); border-radius: 999px; max-width: 100%;
}
.sous-onglets { margin-bottom: 22px; flex-wrap: wrap; width: fit-content; }
.puce, .sous-onglet, .seg-qg button, .segment .puce, .seg button, .sphere-choix button {
  padding: 6px 14px; min-height: 32px;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--encre-douce);
  font: inherit; font-size: .85rem; font-weight: 550; letter-spacing: -0.01em; white-space: nowrap;
  cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), transform .12s var(--ease);
  -webkit-tap-highlight-color: transparent; text-decoration: none;
}
.sous-onglet { min-height: 36px; padding: 7px 16px; font-size: .9rem; }
.puce:hover:not(.actif), .sous-onglet:hover:not(.actif), .seg-qg button:hover:not(.on), .seg button:hover:not(.on), .sphere-choix button:hover:not(.actif) { color: var(--encre); }
.puce.actif, .sous-onglet.actif, .seg-qg button.on, .seg button.on, .sphere-choix button.actif, .pastille-statut-fait.actif, .pastille-statut-annule.actif {
  background: var(--carte); color: var(--encre); box-shadow: var(--ombre-segment); font-weight: 600;
}
html[data-mode="sombre"] .puce.actif, html[data-mode="sombre"] .sous-onglet.actif, html[data-mode="sombre"] .seg-qg button.on, html[data-mode="sombre"] .seg button.on, html[data-mode="sombre"] .sphere-choix button.actif { background: #636366; color: #fff; }
.puce:active { transform: scale(.97); }
.puce-nb { opacity: .6; font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }
.filtres-periode { margin-bottom: 20px; }
.puce .icone { width: 15px; height: 15px; }
/* les puces-filtres à plat (rangées) */
.panneau-filtres { padding: 12px 17px; display: flex; flex-direction: column; gap: 8px; }
.rangee-filtre { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rangee-filtre .filtres { flex-wrap: wrap; }
.filtre-nom { flex: 0 0 76px; }
.pastille-statut-fait.actif { color: var(--succes); }
.pastille-statut-annule.actif { color: var(--encre-douce); }

/* ═══════════════════════════════════════════════════════════ étiquettes, pastilles */
.etiquette, .badge, .badge-date, .pill, .ligne-etat, .tag-mini, .badge-soft, .pastille-nombre, .chip-prochaine {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 650; letter-spacing: .01em; line-height: 1.2;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--piste); color: var(--encre-douce); vertical-align: middle;
}
.etiquette .icone, .badge .icone, .pill .icone { width: 12px; height: 12px; }
.etiquette-mineur { background: var(--info-fond); color: var(--accent); }
.etiquette-impaye, .etiquette-alerte, .etiquette-bug, .etat-annulee, .badge-date.retard, .pill-retard, .tone-red { background: var(--alerte-fond); color: var(--alerte); }
.etiquette-corbeille { background: var(--voile); color: var(--encre-pale); }
.etiquette-succes, .etat-reglee, .etat-facturee, .tone-green { background: var(--succes-fond); color: var(--succes); }
.etiquette-attention, .etat-impayee, .etat-a_facturer, .badge-date.bientot, .etiquette-decision, .tone-amber { background: var(--attention-fond); color: var(--attention); }
.etiquette-info, .etiquette-idee, .tone-blue { background: var(--bleu-fond); color: var(--bleu); }
.etiquette-jalon, .tone-indigo { background: var(--indigo-fond); color: var(--indigo); }
.tone-teal { background: var(--menthe-fond); color: #0f8f83; }
.tone-gray { background: var(--piste); color: var(--encre-douce); }
.tone-ink { background: var(--voile-2); color: var(--encre); }
.etiquette-version { font-variant-numeric: tabular-nums; }
.etat-brouillon { background: var(--piste); color: var(--encre-douce); }
.etat-offerte { background: var(--info-fond); color: var(--encre-douce); }
.pill-pro { background: var(--bleu-fond); color: var(--bleu); }
.pill-perso { background: var(--vert-fond); color: var(--succes); }
.pill-compte { background: var(--piste); }
.pill { margin-left: 6px; padding: 2px 8px; font-size: .7rem; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: currentColor; }
.chip-prochaine { color: var(--encre); background: var(--carte); border: 1px solid var(--bordure); margin-left: auto; }
.pastille-nombre { color: var(--encre-pale); background: var(--piste); }
.compteur-rond {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--rouge); color: #fff; font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.point { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 9px; flex: none; }
.point-titre { width: 12px; height: 12px; margin-right: 10px; vertical-align: 1px; }

/* ═══════════════════════════════════════════════════════════ cartes et panneaux */
.panneau, .bloc, .carte, .card, .set-card, .kpi, .bloc-import {
  background: var(--carte); border: 1px solid var(--bordure-carte);
  border-radius: var(--r-m); padding: 20px 22px; margin-bottom: 16px;
  box-shadow: var(--ombre-s);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s var(--ease);
}
.card, .set-card, .kpi { margin-bottom: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.pad-sm { padding: 13px; }
a.carte { display: block; text-decoration: none; color: inherit; cursor: pointer; }
a.carte:hover { transform: translateY(-1px); box-shadow: var(--ombre-m); text-decoration: none; }
.carte h2, .panneau h2, .bloc > h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.0625rem; margin-bottom: .55em; }
.carte h2 .note, .panneau h2 .note { font-weight: 400; }
.panneau-entete { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panneau-entete h2 { margin: 0; margin-right: auto; }
.panneau-entete .note { margin: 0; }
.bloc .panneau-entete h2 { margin: 0; }
.panneau-contenu { margin-top: 14px; }
.panneau-pied { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.panneau-pied .bouton { text-decoration: none; }
.panneau-attention { border-color: var(--orange); }
.panneau-tableau { padding: 0; overflow: hidden; }
.panneau-tableau .tableau-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.panneau-tableau .tableau { width: 100%; }
.bloc-danger { border-color: rgba(255, 59, 48, .3); }
.grille { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grille .carte { margin-bottom: 0; }
.grille-panneaux { align-items: start; }
.page-etroite .bloc + .bloc { margin-top: 16px; }
.carte-reglages { margin-top: 18px; }

.donnees { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: .95rem; }
.donnees dt { color: var(--encre-pale); font-size: .85rem; }
.donnees dd { margin: 0; }
.fiche-entete { margin-bottom: 20px; }
.fiche-entete h1 { font-size: 2rem; }
.fiche-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.commentaire { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--separateur); }

.encart {
  background: var(--voile); border: 0;
  border-radius: var(--r-s); padding: 15px 17px; margin: 14px 0;
}
.encart-discret { background: transparent; }
.encart-alerte { background: var(--attention-fond); }
.encart-attention { background: var(--alerte-fond); }
.encart-gros { background: var(--voile); }
.encart h3 { margin-top: 0; }
.encart p:last-child { margin-bottom: 0; }

/* le pli : une section repliée sur son titre + résumé, le contenu au clic */
.pli {
  margin: 12px 0; border-radius: var(--r-m); overflow: hidden;
  background: var(--carte); border: 1px solid var(--bordure-carte); box-shadow: var(--ombre-s);
}
.pli > summary {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; cursor: pointer; list-style: none;
  font-weight: 600; letter-spacing: -0.012em; -webkit-tap-highlight-color: transparent;
}
.pli > summary::-webkit-details-marker { display: none; }
.pli > summary::after {
  content: ''; width: 8px; height: 8px; flex: none; margin-left: 2px;
  border-right: 1.8px solid var(--encre-pale); border-bottom: 1.8px solid var(--encre-pale);
  transform: rotate(-45deg); transition: transform .25s var(--ease);
}
.pli[open] > summary::after { transform: rotate(45deg); }
.pli > summary:hover { background: var(--rang-survol); }
.pli .pli-titre { font-weight: 600; }
.pli-resume { margin-left: auto; font-weight: 400; color: var(--encre-douce); font-size: .88rem; text-align: right; }
.pli-corps { padding: 2px 18px 18px; }
.pli .panneau, .pli .bloc, .pli .carte { border: 0; padding: 0; margin: 0; background: transparent; box-shadow: none; }
@keyframes pli-ouvre { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.pli[open] > .pli-corps { animation: pli-ouvre .2s var(--ease-sortie); }
.pli-reconnues, .deja-traitees, .aide-banques { margin-top: 22px; }
.pli-reconnues summary, .deja-traitees summary, .aide-banques summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.pli-reconnues .liste-ops { margin-top: 12px; }
.aide-banques p { margin: 10px 0 6px; font-size: .88rem; }
.aide-banques ul { margin: 8px 0; padding-left: 20px; }
.aide-banques li { margin: 7px 0; font-size: .85rem; color: var(--encre-douce); }

/* ═══════════════════════════════════════════════════════════ tuiles chiffrées */
.tuiles, .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tuiles-3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tuiles-5 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.tuiles-bord { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tuile, .stat {
  position: relative; min-width: 0;
  background: var(--carte); border: 1px solid var(--bordure-carte);
  border-radius: var(--r-m); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--ombre-s);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s var(--ease);
}
.stats { margin-bottom: 22px; }
.tuile:hover, .stat:hover, .total-bilan:hover { transform: translateY(-1px); box-shadow: var(--ombre-m); }
.tuile-principale, .action-rapide-forte { border-color: var(--accent-voile); }
.tuile-alerte { border-color: rgba(255, 59, 48, .4); }
.tuile-attention { border-color: var(--orange); }
.tuile-ok { border-color: var(--vert); }
.tuile-libelle, .stat .libelle { font-size: .8125rem; color: var(--encre-douce); font-weight: 500; margin: 0; text-transform: none; display: flex; align-items: center; gap: 6px; }
.tuile-valeur, .stat .valeur {
  font-family: var(--police-titres); font-size: 2rem; font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; margin: 2px 0;
  font-variant-numeric: tabular-nums;
}
.stat .valeur small { font-size: .9rem; color: var(--encre-pale); font-weight: 600; letter-spacing: 0; }
.tuile-valeur-texte { font-size: 1.05rem; line-height: 1.25; letter-spacing: -0.015em; }
.valeur-alerte { color: var(--alerte); }
.tuile-detail { font-size: .8125rem; color: var(--encre-douce); line-height: 1.45; }
.tuile-cliquable { cursor: pointer; }
.tuile-cliquable:active { transform: scale(.985); }
.tuile-lien { display: contents; color: inherit; text-decoration: none; }
.tuile-lien:hover .tuile-libelle { text-decoration: underline; }
.tuile-large { grid-column: 1 / -1; }
.tuile .vignette { position: absolute; top: 16px; right: 16px; }
/* tuiles .stat : le libellé passe au-dessus de la valeur (ordre des tuiles) */
.stat > * { order: 2; }
.stat > .valeur { order: 1; }
.stat > .valeur + .libelle { order: 0; }
.stat .progression { margin-top: 10px; }
/* la mini-courbe dans une tuile */
.mini-courbe { width: 100%; height: 34px; display: block; margin-top: 6px; overflow: visible; }
.mini-courbe path { fill: none; stroke: var(--accent-vif); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mini-courbe .mini-aire { fill: var(--accent-vif); opacity: .1; stroke: none; }
.delta-haut { color: var(--succes); font-weight: 650; }
.delta-bas { color: var(--alerte); font-weight: 650; }

/* les gestes rapides */
.actions-rapides { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.action-rapide {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  padding: 18px 20px; background: var(--carte); border: 1px solid var(--bordure-carte);
  border-radius: var(--r-m); cursor: pointer; font: inherit; text-align: left; color: inherit;
  box-shadow: var(--ombre-s); text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.action-rapide:hover { transform: translateY(-1px); box-shadow: var(--ombre-m); text-decoration: none; }
.action-rapide:active { transform: scale(.985); }
.action-rapide b { font-size: 1rem; font-weight: 650; letter-spacing: -0.015em; }
.action-rapide span:last-child { font-size: .82rem; color: var(--encre-douce); line-height: 1.4; }
.action-icone { font-size: 1.5rem; margin-bottom: 8px; line-height: 1; }
.action-icone.vignette { margin-bottom: 10px; }
.action-rapide-forte { background: var(--accent); color: var(--accent-contraste); border-color: var(--accent); }
.action-rapide-forte:hover { background: var(--accent); filter: brightness(1.06); }
.action-rapide-forte span, .action-rapide-forte b { color: inherit; }
.action-rapide-forte span:last-child { color: inherit; opacity: .78; }
.action-rapide-forte .vignette { background: rgba(255, 255, 255, .22); color: #fff; }
.accueil-entete { margin-bottom: 22px; }
.accueil-entete h1 { font-size: 2.4rem; }
.accueil-date { color: var(--encre-douce); font-size: 1rem; margin: 0; line-height: 1.5; }
.accueil-entete .meteo, .meteo { color: var(--encre); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════ bandeaux, messages */
.bandeau-attention, .bandeau-info, .bandeau-ok, .insight, .bulk-bar {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border-radius: var(--r-s);
  margin-bottom: 16px; font-size: .92rem; line-height: 1.5; border: 0; flex-wrap: wrap;
}
.bandeau-attention { background: var(--attention-fond); color: var(--attention); }
.bandeau-info, .insight, .bulk-bar { background: var(--info-fond); color: var(--encre); }
.bandeau-ok { background: var(--succes-fond); color: var(--succes); }
.bandeau-attention b, .bandeau-ok b { color: inherit; }
.bandeau-attention > div:not(.bandeau-boutons), .bandeau-info > div:not(.bandeau-boutons), .bandeau-ok > div:not(.bandeau-boutons) { flex: 1; min-width: 0; }
.bandeau-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }
.bandeau-filtre { margin-top: -6px; }
.insight { align-items: center; margin-bottom: 13px; font-size: .875rem; }
.insight svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.bulk-bar { flex-wrap: wrap; align-items: center; padding: 12px 15px; margin-bottom: 12px; font-size: .875rem; }

.messages {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(560px, calc(100vw - 32px));
}
.message, .toast {
  pointer-events: auto; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 22px;   /* une pilule sur une ligne, un rectangle arrondi quand le texte passe à la ligne (pas une ellipse) */
  background: var(--encre); color: var(--fond); font-size: .92rem; font-weight: 500; text-align: center;
  box-shadow: var(--ombre-l);
  animation: monte .3s var(--ease);
}
html[data-mode="sombre"] .message, html[data-mode="sombre"] .toast { background: #f5f5f7; color: #111; }
.message-succes { background: var(--vert); color: #fff; }
.message-erreur { background: var(--rouge); color: #fff; }
html[data-mode="sombre"] .message-succes { background: var(--vert); color: #06210f; }
html[data-mode="sombre"] .message-erreur { background: var(--rouge); color: #fff; }
.message-part { opacity: 0; transition: opacity .3s ease; }
@keyframes monte { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(14px) scale(.96); opacity: 0; pointer-events: none; z-index: 200; transition: .26s var(--ease); max-width: min(560px, calc(100vw - 32px)); animation: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

/* ═══════════════════════════════════════════════════════════ listes */
.liste { display: grid; gap: 8px; }
.liste-suite { margin-top: 16px; }
.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple > li {
  display: flex; align-items: center; gap: 13px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--separateur); min-height: 48px;
}
.liste-simple > li:last-child { border-bottom: 0; }
.ligne-facture { cursor: default; }
.ligne-date { color: var(--encre-douce); font-size: .875rem; font-variant-numeric: tabular-nums; }
.ligne-libelle { flex: 1 1 160px; }
.ligne-numero { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 100px; }
.ligne-montant { font-weight: 600; margin-left: auto; }
.ligne-boutons { display: flex; gap: 6px; }
.ligne-corbeille { justify-content: space-between; }
.liste-puces { margin: 0 0 .85em; padding-left: 1.25em; }
.liste-puces li { margin-bottom: .35em; }
.liste-choix { display: grid; gap: 8px; max-height: 340px; overflow-y: auto; margin-top: 13px; }
.liste-choix-fixe { max-height: 340px; list-style: none; padding: 0; }
.choix {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  width: 100%; padding: 12px 16px; text-align: left; color: inherit;
  border: 1px solid var(--bordure); border-radius: var(--r-s);
  background: var(--carte); font: inherit; cursor: pointer;
  transition: border-color .14s ease, background .14s ease, transform .12s var(--ease);
}
.choix:hover { border-color: var(--accent); background: var(--accent-fond); }
.choix:active { transform: scale(.99); }
.choix span { font-size: .84rem; color: var(--encre-douce); }
.choix-coche { padding: 9px 4px; border-bottom: 1px solid var(--separateur); }
.choix-coche label { display: flex; gap: 11px; align-items: center; cursor: pointer; }
.menu-actions { display: grid; gap: 8px; }
/* la liste groupée (façon Réglages d'iOS) : des rangées séparées par un trait, un chevron à droite */
.liste-groupee { list-style: none; margin: 0; padding: 0; background: var(--carte); border: 1px solid var(--bordure-carte); border-radius: var(--r-m); overflow: hidden; box-shadow: var(--ombre-s); }
.liste-groupee > li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; min-height: 52px; border-bottom: 1px solid var(--separateur); }
.liste-groupee > li:last-child { border-bottom: 0; }
.liste-groupee > li.rangee-lien { cursor: pointer; }
.liste-groupee > li.rangee-lien:hover { background: var(--rang-survol); }
.rangee-corps { flex: 1; min-width: 0; }
.rangee-corps b { display: block; font-weight: 600; letter-spacing: -0.012em; }
.rangee-corps .note { display: block; }
.rangee-valeur { color: var(--encre-douce); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chevron { width: 8px; height: 8px; flex: none; border-right: 1.8px solid var(--encre-tres-pale); border-bottom: 1.8px solid var(--encre-tres-pale); transform: rotate(-45deg); margin-left: 4px; }

/* ═══════════════════════════════════════════════════════════ tableaux */
.tableau-defilant, .tableau-defile, .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tableau, table.tbl, .imp-tbl, .tableau-import { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th, table.tbl th, .imp-tbl th, .tableau-import th {
  text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--encre-pale); padding: 10px 12px; border-bottom: 1px solid var(--bordure);
  white-space: nowrap; font-weight: 650; background: var(--carte);
}
.tableau td, table.tbl td, .imp-tbl td, .tableau-import td { padding: 10px 12px; border-bottom: 1px solid var(--separateur); vertical-align: middle; }
.tableau tbody tr:last-child td, table.tbl tr:last-child td, .imp-tbl tr:last-child td { border-bottom: 0; }
.tableau tbody tr { transition: background .12s ease; }
.tableau tr[data-action], table.tbl tbody tr { cursor: pointer; }
.tableau tr[data-action]:hover td, table.tbl tbody tr:hover, .tableau tbody tr:hover td { background: var(--rang-survol); }
.tableau .num, td.num, .col-nombre { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau-compact th, .tableau-compact td { padding: 7px 9px; font-size: .84rem; }
.tableau-journal td { font-size: .85rem; }
.ligne-alerte td { background: var(--alerte-fond); }
.ligne-inactive td { color: var(--encre-pale); }
.tableau-lignes { width: 100%; margin-bottom: 12px; }
.tableau-tiers td:first-child { max-width: 320px; }
.tableau-tiers tr[data-action] { cursor: pointer; }

/* ═══════════════════════════════════════════════════════════ fenêtres (feuilles) */
.fenetre-fond {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 22px;
  background: rgba(0, 0, 0, .32);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: apparaitFond .2s ease;
}
@keyframes apparaitFond { from { opacity: 0; } to { opacity: 1; } }
.fenetre-part { opacity: 0; transition: opacity .18s ease; }
.fenetre {
  background: var(--carte); border-radius: var(--r-l);
  width: min(560px, 100%); max-height: min(88vh, 920px);
  display: flex; flex-direction: column; box-shadow: var(--ombre-l); border: 1px solid var(--bordure);
  animation: monteFenetre .32s var(--ease);
}
@keyframes monteFenetre { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
.fenetre-large .fenetre { width: min(920px, 100%); }
.fenetre-entete {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 22px 12px;
}
.fenetre-entete h2 { margin: 0; flex: 1; font-size: 1.2rem; letter-spacing: -0.02em; }
.fenetre-fermer {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0;
  background: var(--piste); color: var(--encre-douce); font-size: .8rem; cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .12s var(--ease);
}
.fenetre-fermer:hover { background: var(--piste-fort); color: var(--encre); }
.fenetre-fermer:active { transform: scale(.92); }
.fenetre-corps { padding: 10px 22px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.fenetre-pied {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 22px 18px; border-top: 1px solid var(--separateur); flex-wrap: wrap;
}
.fenetre-question { font-size: 1.05rem; margin-bottom: 14px; letter-spacing: -0.014em; line-height: 1.45; }
.fenetre-detail {
  font-size: .9rem; color: var(--encre-douce); background: var(--voile);
  padding: 13px 15px; border-radius: var(--r-s); line-height: 1.55;
}
.apercu-message {
  margin: 10px 0; padding: 12px 14px; border-radius: var(--r-s);
  background: var(--voile); font-family: inherit; font-size: .88rem; white-space: pre-wrap; word-break: break-word;
  max-height: 200px; overflow: auto;
}

/* ═══════════════════════════════════════════════════════════ progression, répartitions, graphiques */
.progression { height: 6px; border-radius: 999px; background: var(--piste); margin-top: 12px; overflow: hidden; }
.progression-barre { height: 100%; background: var(--accent-vif); border-radius: 999px; transition: width .5s var(--ease); }
.progression-texte { font-size: .78rem; color: var(--encre-pale); margin-top: 6px; }
.repartition { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.repartition-ligne { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr auto auto; gap: 10px; align-items: center; font-size: .92rem; }
.repartition-nom { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.repartition-barre, .repartition-jauge, .seg-track { height: 8px; background: var(--piste); border-radius: 999px; overflow: hidden; }
.repartition-barre i, .repartition-jauge i, .seg-fill { display: block; height: 100%; background: var(--accent-vif); border-radius: 999px; transition: width .5s var(--ease); }
.repartition-barre i.barre-alerte { background: var(--rouge); }
.repartition-ligne .note { min-width: 38px; text-align: right; }
.repartition b { text-align: right; font-weight: 600; }
.repartition-part { font-size: .82rem; color: var(--encre-pale); text-align: right; }
.repartition-cliquable > li { cursor: pointer; border-radius: var(--r-xs); padding-left: 6px; padding-right: 6px; margin: 0 -6px; transition: background .14s ease; }
.repartition-cliquable > li:hover { background: var(--voile); }
.repere { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.repere b { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.repere-detail { font-size: .8rem; color: var(--encre-douce); }
.reperes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.legende-point { width: 10px; height: 10px; border-radius: 3px; background: var(--accent-vif); display: inline-block; }
.graphique-legende, .graph-legende, .courbe-legende, .legend { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: .8rem; color: var(--encre-douce); }
.graphique-legende > span, .legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .lg .sw { width: 10px; height: 10px; border-radius: 3px; }
.graph-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.courbe-legende i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--accent-vif); vertical-align: middle; margin-right: 6px; }
.courbe-legende i.prudent { border-top-style: dashed; border-color: var(--encre-pale); }
.graphique-svg { width: 100%; height: 170px; display: block; overflow: visible; }
.graph-libelles { display: grid; font-size: .72rem; color: var(--encre-pale); text-align: center; margin-top: 6px; }
.graphique-svg .barre-recettes { fill: var(--accent-vif); }
.graphique-svg .barre-depenses { fill: var(--encre-tres-pale); }
.graphique-svg .graph-axe { stroke: var(--bordure); stroke-width: .3; }
.legende-recettes { background: var(--accent-vif); }
.legende-depenses { background: var(--encre-tres-pale); }
.chart-svg { width: 100%; display: block; overflow: visible; }
.chart-grid { stroke: var(--separateur); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-ref { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; opacity: .6; }
.chart-line { fill: none; stroke: var(--courbe, var(--accent-vif)); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { stroke: var(--carte); stroke-width: 1.5; fill: var(--accent-vif); }
.chart-x { fill: var(--encre-pale); font-size: 9px; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════ dépôt de fichiers */
.zone-depot {
  display: flex; align-items: center; gap: 18px; justify-content: center;
  padding: 40px 20px; margin: 22px 0;
  border: 2px dashed var(--bordure-forte); border-radius: var(--r-m);
  background: var(--carte); cursor: pointer; text-align: center;
  transition: border-color .16s ease, background .16s ease;
}
.zone-depot:hover, .zone-depot.survol { border-color: var(--accent); background: var(--accent-fond); }
.depot-icone { font-size: 2rem; line-height: 1; }
.depot-texte { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.depot-texte b { font-size: 1.05rem; letter-spacing: -0.014em; }
.depot-texte span { font-size: .85rem; color: var(--encre-pale); }
.cartes-resume { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; margin: 20px 0; }
.carte-resume {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 17px 10px; border-radius: var(--r-m); border: 1px solid var(--bordure);
  background: var(--carte); text-align: center;
}
.carte-resume b { font-size: 1.9rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.carte-resume span { font-size: .8rem; color: var(--encre-pale); }
.carte-nouveau { background: var(--succes-fond); border-color: transparent; }
.carte-nouveau b { color: var(--succes); }
.carte-maj { background: var(--info-fond); border-color: transparent; }
.carte-conflit { background: var(--attention-fond); border-color: transparent; }
.carte-conflit b { color: var(--attention); }
.bloc-depliable > summary { cursor: pointer; list-style: none; padding: 4px 0; }
.bloc-depliable > summary::-webkit-details-marker { display: none; }
.conflit { padding: 15px 0; border-bottom: 1px solid var(--separateur); }
.conflit:last-child { border-bottom: 0; }
.pied-page-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 40px; }
.reussite { text-align: center; padding: 32px 0 12px; }
.reussite-icone {
  width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--succes-fond); color: var(--succes);
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
}

/* ═══════════════════════════════════════════════════════════ réglages, sauvegardes, journal */
.liste-sauvegardes { list-style: none; margin: 14px 0 0; padding: 0; }
.liste-sauvegardes > li {
  display: flex; align-items: center; gap: 13px; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--separateur); flex-wrap: wrap;
}
.liste-sauvegardes > li:last-child { border-bottom: 0; }
.liste-sauvegardes .detail { display: block; font-size: .82rem; color: var(--encre-pale); }
.liste-sauvegardes li .note { flex: 1 1 200px; margin: 0; }
.journal { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: .88rem; max-height: 420px; overflow: auto; }
.journal li { display: grid; grid-template-columns: max-content max-content 1fr max-content; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--separateur); }
.journal li:last-child { border-bottom: 0; }
.etat-coffre { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600; color: var(--encre-douce); text-decoration: none; }
.etat-coffre::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--encre-tres-pale); flex: none; }
.etat-coffre.coffre-ok::before { background: var(--vert); }
.etat-coffre.coffre-attente::before { background: var(--orange); }
.etat-coffre.coffre-erreur::before { background: var(--rouge); }
.etat-coffre.coffre-erreur { color: var(--alerte); }
h2 .etat-coffre { margin-left: 10px; vertical-align: middle; }
.touche { font: 11px/1 var(--mono); padding: 3px 6px; border: 1px solid var(--bordure); border-bottom-width: 2px; border-radius: 5px; background: var(--voile); color: var(--encre-douce); }
.etat-synchro { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--encre-pale); font-size: .85rem; margin: 2px 0 0; }
.reglages-corps { margin-top: 12px; display: grid; gap: 10px; }
.reglages-corps label { display: grid; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--encre-douce); }
.reglages-corps .champ { font-weight: 400; }
.reglages-corps textarea { max-width: 560px; }
/* Apparence : le nuancier et les modes */
.nuancier { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.teinte {
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; padding: 0; position: relative;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.teinte:hover { transform: scale(1.08); }
.teinte.actif { border-color: var(--encre); }
.teinte.actif::after {
  content: '✓'; position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.teinte-graphite { background: linear-gradient(135deg, #1d1d1f 50%, #f5f5f7 50%); box-shadow: inset 0 0 0 1px var(--bordure-forte); }
.apparence-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.apparence-mode {
  border: 2px solid var(--bordure); border-radius: var(--r-m); background: var(--carte);
  padding: 12px; cursor: pointer; font: inherit; color: inherit; text-align: center;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.apparence-mode:hover { transform: translateY(-1px); }
.apparence-mode.actif { border-color: var(--accent); }
.apercu-mode { width: 100%; height: 64px; border-radius: 10px; border: 1px solid var(--separateur); position: relative; overflow: hidden; }
.apercu-mode i { position: absolute; left: 10px; top: 10px; right: 10px; height: 7px; border-radius: 4px; }
.apercu-mode em { position: absolute; left: 10px; top: 24px; width: 55%; height: 26px; border-radius: 6px; }
.apercu-clair { background: #f5f5f7; }
.apercu-clair i { background: #d9d9de; }
.apercu-clair em { background: #fff; border: 1px solid #e4e4e9; }
.apercu-sombre { background: #000; }
.apercu-sombre i { background: #3a3a3c; }
.apercu-sombre em { background: #1c1c1e; }
.apercu-auto { background: linear-gradient(105deg, #f5f5f7 50%, #000 50%); }
.apercu-auto i { background: linear-gradient(105deg, #d9d9de 58%, #3a3a3c 58%); }
.apercu-auto em { background: linear-gradient(115deg, #fff 62%, #1c1c1e 62%); }
.apparence-mode b { font-size: .92rem; }

/* ═══════════════════════════════════════════════════════════ verrou
   (.verrou, .verrou-boite et le pavé sont redessinés plus bas — refonte 2026-09-06) */
.verrou-erreur { color: var(--alerte); font-size: .875rem; min-height: 1.4em; }
.ecran-erreur { max-width: 620px; margin: 60px auto; padding: 30px; font-family: var(--police); }
.ecran-erreur button { min-height: 44px; padding: 11px 20px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-contraste); cursor: pointer; font: inherit; }

/* ═══════════════════════════════════════════════════════════ la palette (Ctrl+K) */
#qg-palette { position: fixed; inset: 0; z-index: 1200; display: none; background: rgba(0, 0, 0, .3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
#qg-palette.ouverte { display: block; animation: apparaitFond .18s ease; }
#qg-palette .pal-boite {
  position: absolute; left: 50%; top: 10vh; transform: translateX(-50%);
  width: min(680px, calc(100vw - 24px));
  background: var(--carte); color: var(--encre); border: 1px solid var(--bordure);
  border-radius: var(--r-l); box-shadow: var(--ombre-l); overflow: hidden;
  font: 15px/1.4 var(--police); animation: palette-entre .2s var(--ease);
}
@keyframes palette-entre { from { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(.985); } }
#qg-palette .pal-champ { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--separateur); }
#qg-palette .pal-champ svg { width: 20px; height: 20px; flex: none; color: var(--encre-pale); }
#qg-palette input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 17px; background: transparent; color: inherit; min-width: 0; letter-spacing: -0.012em; }
#qg-palette input::placeholder { color: var(--encre-pale); }
#qg-palette kbd { font: 11px/1 var(--mono); padding: 3px 6px; border: 1px solid var(--bordure); border-radius: 6px; color: var(--encre-pale); background: var(--voile); }
#qg-palette .pal-liste { max-height: min(62vh, 520px); overflow: auto; padding: 8px; }
#qg-palette .pal-groupe { padding: 10px 12px 4px; }
#qg-palette .pal-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: var(--r-s); cursor: pointer; font: inherit; color: inherit; }
#qg-palette .pal-item.on, #qg-palette .pal-item:hover { background: var(--accent-fond); }
#qg-palette .pal-item.on b { color: var(--accent); }
#qg-palette .pal-item.impossible { opacity: .6; cursor: default; }
#qg-palette .pal-point { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--encre-tres-pale); }
#qg-palette .pal-texte { min-width: 0; flex: 1; }
#qg-palette .pal-texte b { display: block; font-weight: 600; letter-spacing: -0.012em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#qg-palette .pal-texte span { display: block; font-size: 13px; color: var(--encre-pale); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#qg-palette .pal-type { font-size: 11px; font-weight: 600; color: var(--encre-douce); background: var(--piste); border-radius: 999px; padding: 3px 8px; flex: none; }
#qg-palette .pal-aide { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 16px 12px; color: var(--encre-pale); font-size: 12.5px; border-top: 1px solid var(--separateur); }
#qg-palette .pal-aide code { background: var(--piste); border-radius: 5px; padding: 1px 6px; font-family: inherit; color: var(--encre); }
#qg-palette .pal-vide { padding: 24px; text-align: center; color: var(--encre-pale); }
@media (max-width: 640px) {
  #qg-palette .pal-boite { top: 0; left: 0; transform: none; width: 100vw; border-radius: 0 0 var(--r-l) var(--r-l); animation: none; }
  #qg-palette .pal-liste { max-height: calc(100vh - 150px); }
  #qg-palette .pal-champ { padding-top: calc(12px + env(safe-area-inset-top)); }
}

/* ═══════════════════════════════════════════════════════════ zones tactiles (44 px) sans changer le dessin */
.bouton-icone, .fenetre-fermer, .bouton-suppr, .tache-suppr, .bouton-icone-petit, .bouton-petit, .puce, .chip { position: relative; }
@media (pointer: coarse) {
  .bouton-icone::before, .fenetre-fermer::before, .bouton-suppr::before, .tache-suppr::before, .bouton-icone-petit::before, .bouton-petit::before, .puce::before, .chip::before {
    content: ''; position: absolute; inset: -6px; border-radius: inherit;
  }
  .bouton, .btn, .chip { min-height: 44px; }
  .bouton-petit, .btn.sm { min-height: 40px; }
  .liste-simple > li, .liste-groupee > li, .liste-depenses li, .echeancier li, .route-item-qg, .liste-jour li { min-height: 48px; }
}
.onglet:focus-visible, .bouton-icone:focus-visible, .fenetre-fermer:focus-visible, .puce:focus-visible, .sous-onglet:focus-visible, .chip:focus-visible, .tuile-cliquable:focus-visible, .action-rapide:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════ mouvements */
@keyframes barre-pousse { from { transform: scaleY(0); } }
.graphique-barres .barre { animation: barre-pousse .5s var(--ease); transform-origin: bottom; }
@keyframes compte-monte { from { opacity: 0; transform: translateY(4px); } }
.tuile-valeur, .stat .valeur { animation: compte-monte .35s var(--ease-sortie); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ═══════════════════════════════════════════════════════════ responsive */
@media (max-width: 1040px) {
  .editeur { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  :root { --hauteur-entete: 52px; }
  body { font-size: 17px; }
  #contenu { padding: 18px 16px calc(var(--hauteur-barre-mobile) + 40px + env(safe-area-inset-bottom)); }
  h1, .titre-page { font-size: 1.85rem; }
  .fiche-entete h1 { font-size: 1.7rem; }
  .accueil-entete h1 { font-size: 2rem; }
  h2 { font-size: 1.15rem; }
  .entete { gap: 10px; padding-left: 16px; padding-right: 16px; }
  .entete-sous-titre { display: none; }
  .entete-outils { gap: 4px; }

  /* la navigation passe en bas : une barre d'onglets iOS, en verre dépoli */
  .onglets {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    margin: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--entete-fond);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--entete-trait);
    justify-content: space-around; gap: 0;
  }
  .onglet { flex-direction: column; gap: 3px; padding: 4px 2px 2px; border-radius: 10px; flex: 1; min-height: 46px; min-width: 0; font-weight: 500; }
  .onglet-icone { font-size: 1.35rem; }
  .onglet-icone .icone { width: 26px; height: 26px; stroke-width: 1.7; }
  .onglet-texte { font-size: .62rem; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .onglet.actif { background: transparent; color: var(--accent); }
  .onglet:hover { background: transparent; }

  .grille-2, .colonnes-2 { grid-template-columns: 1fr; }
  .messages { bottom: calc(var(--hauteur-barre-mobile) + 16px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(var(--hauteur-barre-mobile) + 16px + env(safe-area-inset-bottom)); }
  /* les fenêtres montent du bas, comme une feuille iOS */
  .fenetre-fond { padding: 0; align-items: flex-end; }
  .fenetre { width: 100%; max-height: 92vh; border-radius: var(--r-l) var(--r-l) 0 0; border: 0; animation: monteFeuille .36s var(--ease); }
  @keyframes monteFeuille { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
  .fenetre::before { content: ''; display: block; width: 36px; height: 5px; border-radius: 999px; background: var(--piste-fort); margin: 8px auto -4px; flex: none; }
  .fenetre-entete { padding: 14px 18px 10px; }
  .fenetre-corps { padding: 8px 18px 18px; }
  .fenetre-pied { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
  .fenetre-pied .bouton { flex: 1 1 auto; }
  .barre-actions { width: 100%; margin-left: 0; }
  .barre-actions .bouton { flex: 1 1 auto; }
  .sous-onglets { width: 100%; flex-wrap: nowrap; overflow-x: auto; border-radius: 999px; scrollbar-width: none; }
  .sous-onglets::-webkit-scrollbar { display: none; }
  .sous-onglet { white-space: nowrap; flex: 1 0 auto; }
  .filtres { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .filtres::-webkit-scrollbar { display: none; }
  .tuiles, .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tuile, .stat { padding: 14px 15px; }
  .tuile-valeur, .stat .valeur { font-size: 1.6rem; }
  .panneau, .bloc, .carte, .card { padding: 16px 16px; border-radius: var(--r-m); }
  .pli > summary { padding: 14px 16px; }
  .pli-corps { padding: 2px 16px 16px; }
  .actions-rapides { grid-template-columns: 1fr 1fr; gap: 10px; }
  .action-rapide { padding: 14px 14px; }
  .action-rapide span:not(.action-icone) { font-size: .78rem; }
  .action-rapide b { font-size: .95rem; }
  .champ, .input, .select, .saisie, .palette-champ, select.champ, textarea.champ, textarea.input, #qg-palette input { font-size: 16px; }
  .zone-depot { padding: 28px 16px; flex-direction: column; gap: 10px; }
  .depot-texte { align-items: center; text-align: center; }
  .liste-groupee > li { padding: 12px 16px; }
}
@media (max-width: 480px) {
  .tuiles-5, .tuiles-3 { grid-template-columns: 1fr 1fr; }
}
@media (hover: none) {
  .tuile:hover, .stat:hover, .action-rapide:hover, a.carte:hover { transform: none; box-shadow: var(--ombre-s); }
}


/* ═══════════ ajouts de la vague du 6 septembre (coquille) ═══════════ */
/* ═══════════════════════════════════════════════════════════ coquille (2026-09-06) : chargement, en-tête, état, messages, fenêtres, verrou, erreur */

/* le voile de chargement : le carré QG qui respire, un mot */
.chargement-marque { width: 56px; height: 56px; border-radius: 16px; font-size: 1.3rem; animation: respire 1.4s var(--ease) infinite; }
.chargement p { margin: 0; font-size: .9rem; }
@keyframes respire { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.92); opacity: .72; } }

/* le fondu rejoué à chaque changement de page */
#page.vue-entre { animation: apparait .28s var(--ease); }

/* en-tête : la date du jour (mobile seulement), le prénom (bureau) */
.entete-date { display: none; font-size: .78rem; font-weight: 600; color: var(--entete-texte); letter-spacing: -0.01em; }
.entete-date::first-letter { text-transform: uppercase; }
/* le point d'état de la sauvegarde en ligne, sur le coin du carré QG */
.marque-qg { position: relative; }
.marque-qg[data-etat]::after {
  content: ''; position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--carte); background: var(--gris); display: none;
}
.marque-qg[data-etat="ok"]::after { display: block; background: var(--vert); }
.marque-qg[data-etat="attente"]::after { display: block; background: var(--orange); animation: pulse-etat 1.2s ease-in-out infinite; }
.marque-qg[data-etat="erreur"]::after { display: block; background: var(--rouge); }
.marque-qg[data-etat="horsligne"]::after { display: block; background: var(--gris); }
@keyframes pulse-etat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

/* le bandeau sous l'en-tête : hors ligne, sauvegarde ratée */
.bandeau-etat {
  position: sticky; top: calc(var(--hauteur-entete) + env(safe-area-inset-top)); z-index: 39;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px; font-size: .84rem; font-weight: 500;
  background: var(--voile-2); color: var(--encre-douce); border-bottom: 1px solid var(--separateur);
}
.bandeau-etat .icone { width: 16px; height: 16px; flex: none; }
.bandeau-etat[data-etat="erreur"] { background: var(--alerte-fond); color: var(--alerte); }
.bandeau-etat .bouton-petit { min-height: 30px; padding: 4px 12px; }

/* le bouton flottant « + » (mobile) : chercher ou saisir, sous le pouce */
.bouton-flottant {
  display: none; position: fixed; right: 18px; bottom: calc(var(--hauteur-barre-mobile) + 18px + env(safe-area-inset-bottom)); z-index: 46;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: var(--accent); color: var(--accent-contraste); box-shadow: var(--ombre-m);
  place-items: center; transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.bouton-flottant .icone { width: 26px; height: 26px; stroke-width: 2.2; }
.bouton-flottant:active { transform: scale(.94); }
.bouton-flottant:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.fenetre-ouverte .bouton-flottant { display: none; }

/* messages : icône, bouton d'action (« Annuler », « Recharger ») */
.message { max-width: 100%; }
.message-icone { display: inline-flex; flex: none; }
.message-icone .icone { width: 18px; height: 18px; }
.message-texte { min-width: 0; }
.message-action {
  flex: none; margin-left: 4px; padding: 6px 12px; border-radius: 999px; border: 0; cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 650; background: rgba(255, 255, 255, .16); color: inherit;
}
.message-action:hover { background: rgba(255, 255, 255, .26); }
html[data-mode="sombre"] .message-action { background: rgba(0, 0, 0, .12); }
html[data-mode="sombre"] .message-action:hover { background: rgba(0, 0, 0, .2); }
.message-succes .message-action, .message-erreur .message-action { background: rgba(255, 255, 255, .22); }

/* fenêtres : texte d'explication, alerte centrée façon iOS, bouton occupé, page figée (iPhone), pied collé */
.fenetre-texte { font-size: .95rem; color: var(--encre-douce); line-height: 1.5; margin: 0 0 12px; }
.fenetre-texte:last-child { margin-bottom: 0; }
label.fenetre-question { display: block; cursor: pointer; }
.fenetre-corps-vide { display: none; }
.fenetre-corps-vide + .fenetre-pied { border-top: 0; padding-top: 4px; }
.fenetre-alerte .fenetre { width: min(420px, 100%); text-align: center; }
.fenetre-alerte .fenetre-entete { flex-direction: column; padding: 26px 24px 8px; }
.fenetre-alerte .fenetre-entete h2 { font-size: 1.12rem; line-height: 1.35; }
.fenetre-alerte .fenetre-corps { padding-top: 0; }
.fenetre-alerte .fenetre-pied { justify-content: center; }
.fenetre-alerte .fenetre-pied .bouton { flex: 1 1 0; }
.bouton-occupe { position: relative; color: transparent !important; pointer-events: none; }
.bouton-occupe::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent;
  color: var(--accent-contraste); animation: tourne .8s linear infinite;
}
.bouton-secondaire.bouton-occupe::after { color: var(--encre); }
body.page-figee { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
.fenetre-corps { overscroll-behavior: contain; }
@media (max-width: 780px) {
  .entete-titre { display: none; }
  .entete-date { display: block; }
  .bouton-flottant { display: grid; }
  .fenetre { max-height: 92vh; max-height: 92dvh; }
  .fenetre-pied { position: sticky; bottom: 0; background: var(--carte); }
  .fenetre-alerte.fenetre-fond { align-items: center; padding: 22px; }
  .fenetre-alerte .fenetre { border-radius: var(--r-l); animation: monteFenetre .32s var(--ease); }
  .fenetre-alerte .fenetre::before { display: none; }
  .fenetre-alerte .fenetre-pied { flex-direction: column-reverse; }
  .bandeau-etat { top: calc(var(--hauteur-entete) + env(safe-area-inset-top)); }
}

/* le verrou façon iPhone : voile flouté, points, pavé de gros ronds */
body.verrouille .entete, body.verrouille #contenu, body.verrouille .onglets, body.verrouille .bandeau-etat, body.verrouille .bouton-flottant { filter: blur(16px); pointer-events: none; user-select: none; }
.verrou {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: var(--entete-fond);
  -webkit-backdrop-filter: saturate(160%) blur(28px); backdrop-filter: saturate(160%) blur(28px);
  animation: apparaitFond .2s ease;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.verrou.verrou-part { opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.verrou-boite {
  background: transparent; box-shadow: none; border: 0; padding: 20px 24px;
  width: min(360px, 100vw); text-align: center; outline: none;
}
.verrou-boite .marque-qg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.5rem; margin: 0 auto 14px; }
.verrou-titre { margin: 0 0 18px; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.012em; color: var(--encre); }
.verrou-points { display: flex; justify-content: center; gap: 14px; min-height: 16px; margin-bottom: 8px; position: relative; }
.verrou-points i { width: 14px; height: 14px; border-radius: 50%; border: 1.6px solid var(--encre); background: transparent; transition: background .12s ease, transform .12s var(--ease); }
.verrou-points i.plein { background: var(--encre); transform: scale(1.08); }
.verrou-points[data-plus]:not([data-plus=""])::after { content: attr(data-plus); position: absolute; right: -28px; top: -2px; font-size: .8rem; color: var(--encre-douce); font-variant-numeric: tabular-nums; }
.verrou-secousse { animation: secousse .45s var(--ease-sortie); }
@keyframes secousse { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-12px); } 35% { transform: translateX(10px); } 55% { transform: translateX(-7px); } 75% { transform: translateX(4px); } }
.verrou-champ { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: 0; }
.verrou-erreur { color: var(--alerte); font-size: .875rem; min-height: 1.4em; margin: 6px 0 10px; }
.verrou-pave { display: grid; grid-template-columns: repeat(3, 72px); gap: 16px 22px; justify-content: center; margin: 14px auto 18px; }
.verrou-touche {
  width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  display: grid; place-items: center; font: inherit; font-size: 1.75rem; font-weight: 400; letter-spacing: -0.01em;
  background: var(--piste); color: var(--encre); font-variant-numeric: tabular-nums;
  transition: background .1s ease, transform .1s var(--ease); -webkit-tap-highlight-color: transparent;
}
.verrou-touche:hover { background: var(--piste-fort); }
.verrou-touche:active { transform: scale(.94); background: var(--accent-fond); }
.verrou-touche:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.verrou-touche-vide { background: transparent; pointer-events: none; }
.verrou-touche-effacer { background: transparent; }
.verrou-touche-effacer .icone { width: 28px; height: 28px; }
.verrou-pave-bloque .verrou-touche { opacity: .35; pointer-events: none; }
.verrou-boite #verrou-valider { max-width: 260px; margin: 0 auto 6px; }
.verrou-oubli { margin-top: 2px; }
.verrou-aide { font-size: .84rem; color: var(--encre-douce); line-height: 1.5; margin: 8px 0 0; text-align: left; background: var(--carte); padding: 12px 14px; border-radius: var(--r-s); box-shadow: var(--ombre-s); }
@media (max-height: 640px) {
  .verrou-boite .marque-qg { width: 48px; height: 48px; font-size: 1.1rem; margin-bottom: 8px; }
  .verrou-pave { grid-template-columns: repeat(3, 62px); gap: 10px 18px; margin: 8px auto 12px; }
  .verrou-touche { width: 62px; height: 62px; font-size: 1.5rem; }
}

/* l'écran d'erreur rassurant (jamais une page blanche) */
.ecran-erreur { text-align: center; }
.ecran-erreur .vignette { margin-bottom: 16px; }
.ecran-erreur h1 { font-size: 1.5rem; margin: 0 0 8px; }
.ecran-erreur p { color: var(--encre-douce); margin: 0 0 20px; line-height: 1.55; }
.ecran-erreur-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ecran-erreur-detail { margin-top: 26px; text-align: left; }
.ecran-erreur-detail summary { cursor: pointer; color: var(--encre-pale); font-size: .85rem; }
.ecran-erreur-detail pre { margin-top: 10px; padding: 12px 14px; background: var(--voile); border-radius: var(--r-s); font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--encre-douce); max-height: 260px; overflow: auto; }

/* la pastille de date « aujourd'hui » (même teinte que « bientôt », plus soutenue) */
.badge-date.aujourdhui { font-weight: 650; }
