/* =============================================================================
   AURYVO Business — système visuel
   Toile froide, grands panneaux blancs très arrondis, pilule noire pour
   l'élément actif, rouge pour l'alerte (« ! »), orange pour l'attention, accent bleu
   #0071E3 pour le validé et les repères, vert pour le seul « payé / fait ». Hachures pour les jauges.
   Mouvement : entrées échelonnées, glissière de navigation à ressort,
   projecteur au survol, chiffres qui défilent. Tout se coupe si l'utilisateur
   demande moins d'animations.
   ============================================================================= */
@font-face { font-family: "Urbanist"; src: url("/static/fonts/urbanist-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Urbanist"; src: url("/static/fonts/urbanist-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Urbanist"; src: url("/static/fonts/urbanist-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Urbanist"; src: url("/static/fonts/urbanist-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/manrope-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/manrope-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/manrope-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/manrope-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

/* ---------- thème sombre (par défaut ; l'apparence claire est celle choisie à l'ouverture, voir js/theme.js) ---------- */
:root {
  /* niveaux de gris bien séparés (passe 2, consigne des associés) : toile, barre latérale, cartes, sous-blocs */
  --bg: #0E0F12;
  --bg-glow: transparent;
  --panel: #141518;              /* barre latérale */
  --panel-line: transparent;
  --card: #1A1B1F;
  --card-2: #232429;
  --card-3: #2C2D33;
  --field: #232429;
  --ink: #F5F5F7;
  --ink-2: #D1D1D6;
  --ink-3: #9C9CA3;
  --line: rgba(255, 255, 255, .10);
  --line-2: rgba(255, 255, 255, .16);
  --nav-actif: rgba(255, 255, 255, .09);   /* élément ouvert de la barre latérale et des menus : gris doux, pas de pilule */
  /* verre dépoli : barres et objets qui flottent au-dessus du contenu */
  --verre: rgba(28, 29, 34, .55);
  --verre-fort: rgba(28, 29, 34, .78);
  --verre-filet: inset 0 0 0 1px rgba(255, 255, 255, .10), inset 0 1px 0 rgba(255, 255, 255, .08);
  --verre-flou: blur(20px) saturate(160%);
  /* « black » = l'action principale : pilule claire sur fond sombre */
  --black: #F5F5F7;
  --on-black: #0B0B0F;
  /* accent bleu : liens, focus, sélection, repères, courbes, « validé » */
  --accent: #3B9BFF;
  --accent-2: #6CB4FF;
  --accent-soft: rgba(59, 155, 255, .14);
  --accent-fort: #1A7FF0;        /* remplissage bleu qui porte un texte blanc */
  --blue: var(--accent);
  --blue-soft: var(--accent-soft);
  --danger: #FF5A5F;
  --danger-soft: rgba(255, 90, 95, .14);
  --amber: #F5A524;
  --amber-soft: rgba(245, 165, 36, .14);
  --amber-text: #F5A524;
  --green: #22C55E;              /* le seul vert : « payé / fait » */
  --green-soft: rgba(34, 197, 94, .13);
  --hatch: rgba(255, 255, 255, .14);
  --survol: rgba(255, 255, 255, .06);
  --entete-tableau: #232429;
  /* dégradés bleus (cartes héros, fonds doux) */
  --degrade-bleu: linear-gradient(135deg, #0A4FB8 0%, #1D7BF5 45%, #5D9FF5 80%, #8DBBF7 100%);
  --degrade-heros: radial-gradient(70% 120% at 100% 0%, rgba(141, 187, 247, .34) 0%, rgba(141, 187, 247, 0) 62%),
                   linear-gradient(115deg, #083F9A 0%, #0B5FD6 55%, #1D7BF5 100%);
  --degrade-ciel: linear-gradient(180deg, #121C2B 0%, #0E0F12 60%);
  /* « nuit » : les grandes cartes inversées (récapitulatifs, ticket de TVA, solde prévu…). Noires en clair ; en sombre, bleu nuit relevé
     (une grande carte blanche éblouirait) : graphite relevé, au-dessus des cartes. */
  --nuit: #26272C;
  --nuit-fond: linear-gradient(160deg, #2D2F35 0%, #222328 100%);
  --on-nuit: #F5F5F7;
  /* forme */
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --pill: 999px;
  --sh-card: inset 0 1px 0 rgba(255, 255, 255, .04), 0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -14px rgba(0, 0, 0, .8);
  --sh-float: 0 30px 80px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .07);
  --sh-pill: 0 1px 2px rgba(0, 0, 0, .5);
  /* mouvement */
  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.36, .5, 1);
  --display: "Urbanist", "Manrope", system-ui, sans-serif;
  --text: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
/* ---------- thème clair : toile froide, panneaux blancs ---------- */
:root[data-theme="light"] {
  /* toile nettement grise, barre latérale d'un gris distinct, cartes blanches qui se détachent, filets visibles */
  --bg: #ECEDEF;
  --bg-glow: transparent;
  --panel: #E2E3E6;              /* barre latérale */
  --panel-line: transparent;
  --card: #FFFFFF;
  --card-2: #F3F4F6;
  --card-3: #E8E9EC;
  --field: #F3F4F6;
  --ink: #0B0B0F;
  --ink-2: #33333A;
  --ink-3: #5B5B63;
  --line: #DCDDE1;
  --line-2: #CDCED3;
  --nav-actif: rgba(11, 11, 15, .075);
  --verre: rgba(255, 255, 255, .62);
  --verre-fort: rgba(255, 255, 255, .82);
  --verre-filet: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 0 0 1px rgba(16, 24, 40, .07);
  --verre-flou: blur(20px) saturate(160%);
  --entete-tableau: #E8E9EC;
  --black: #0B0B0F;
  --on-black: #FFFFFF;
  --accent: #0071E3;
  --accent-2: #2B8CFF;
  --accent-soft: rgba(0, 113, 227, .10);
  --accent-fort: #0071E3;
  --danger: #E5484D;
  --danger-soft: rgba(229, 72, 77, .10);
  --amber: #E8890C;
  --amber-soft: rgba(232, 137, 12, .12);
  --amber-text: #B4650A;
  --green: #16A34A;
  --green-soft: rgba(22, 163, 74, .10);
  --hatch: rgba(16, 24, 40, .12);
  --survol: rgba(11, 11, 15, .05);
  --degrade-bleu: linear-gradient(135deg, #0B5FD6 0%, #2B8CFF 38%, #8DBBF7 72%, #EAF2FD 100%);
  --degrade-heros: radial-gradient(70% 120% at 100% 0%, rgba(234, 242, 253, .62) 0%, rgba(141, 187, 247, .28) 38%, rgba(141, 187, 247, 0) 70%),
                   linear-gradient(115deg, #0B5FD6 0%, #1D7BF5 52%, #4A93F6 100%);
  --degrade-ciel: linear-gradient(180deg, #DCEBFD 0%, #ECEDEF 60%);
  --nuit: #0B0B0F;
  --nuit-fond: #0B0B0F;
  --on-nuit: #FFFFFF;
  --sh-card: 0 0 0 1px rgba(16, 24, 40, .035), 0 1px 2px rgba(16, 24, 40, .06), 0 12px 30px -14px rgba(16, 24, 40, .16);
  --sh-float: 0 28px 70px -24px rgba(16, 24, 40, .28), 0 0 0 1px rgba(16, 24, 40, .05);
  --sh-pill: 0 1px 2px rgba(16, 24, 40, .08), 0 2px 8px -2px rgba(16, 24, 40, .08);
  color-scheme: light;
}
/* ---------- l'ancien citron n'existe plus (refonte du 01/12, passe 2) : plus aucun jeton --coral / --lime.
   Bleu (--accent) = validé, repères ; vert (--green) = payé / fait, seulement ; rouge (--danger) = alerte ; orange (--amber) = attention. */
:root, :root[data-theme="light"] {
  --blue: var(--accent);
  --blue-soft: var(--accent-soft);
}

/* Inachevé (brouillon, pièce manquante, à compléter, emplacement vide) : contour pointillé, une seule règle pour toute l'app. */
:root { --inacheve-motif: none; --inacheve-contour: 1.5px dashed color-mix(in srgb, var(--ink-3) 75%, transparent); --inacheve-decal: -1.5px; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--text); font-size: 14px; line-height: 1.5; color: var(--ink); background-color: var(--bg);
  background-image: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "ss01";
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: middle; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }
.num, .t td.num, .t td.r { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
* { scrollbar-width: thin; scrollbar-color: var(--card-3) transparent; }

/* =============================================================================
   COQUILLE
   ============================================================================= */
.shell { display: grid; grid-template-columns: 92px minmax(0, 1fr); min-height: 100vh; }

/* rail d'actions */
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 0; z-index: 30; }
.mark { width: 48px; height: 48px; border-radius: 50%; background: var(--black); color: var(--on-black); border: 0; display: grid; place-items: center; margin-bottom: 20px;
  box-shadow: var(--sh-pill); transition: transform .5s var(--spring); }
.mark:hover { transform: rotate(-8deg) scale(1.05); }
.mark svg { width: 24px; height: 24px; }
.logo-sym { display: block; width: 28px; height: 28px; background: currentColor; margin-top: 2px;
  -webkit-mask: url("/static/img/auryvo-symbole.png") center / contain no-repeat; mask: url("/static/img/auryvo-symbole.png") center / contain no-repeat; }
.wm-txt { display: block; height: 15px; aspect-ratio: 795 / 111; background: var(--ink);
  -webkit-mask: url("/static/img/auryvo-texte.png") center / contain no-repeat; mask: url("/static/img/auryvo-texte.png") center / contain no-repeat; }
.wordmark .wm-sym { display: none; }
.rail-btn { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--card);
  border: 1px solid var(--panel-line); color: var(--ink); cursor: pointer;
  transition: transform .35s var(--spring), background .25s var(--ease), color .25s, border-color .25s; }
.rail-btn:hover { background: var(--card-3); transform: translateY(-2px) scale(1.04); }
.rail-btn:active { transform: scale(.94); }
.rail-btn svg.i, .circle svg.i, .icon-btn svg.i { stroke-width: 1.8; }
.rail-btn[data-tip]::after { content: attr(data-tip); position: absolute; left: 60px; top: 50%; transform: translate(-6px, -50%) scale(.96); opacity: 0; pointer-events: none;
  white-space: nowrap; background: var(--black); color: var(--on-black); font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: var(--pill);
  transition: opacity .2s var(--ease), transform .3s var(--spring); }
.rail-btn:hover::after { opacity: 1; transform: translate(0, -50%) scale(1); }
.rail-sep { width: 22px; height: 1px; background: var(--line-2); margin: 6px 0; }
.rail-spacer { flex: 1; }
.theme-switch { display: flex; flex-direction: column; gap: 6px; padding: 5px; border-radius: var(--pill); background: var(--card); border: 1px solid var(--panel-line); }
.theme-switch button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3); display: grid; place-items: center; cursor: pointer;
  transition: background .3s var(--ease), color .3s; }
.theme-switch button.on { background: var(--black); color: var(--on-black); }

/* en-tête */
.main { min-width: 0; padding: 0 36px 70px 8px; }
.topbar { position: sticky; top: 0; z-index: 35; display: flex; align-items: center; gap: 20px; padding: 18px 0 14px; }
/* fond plein, toujours au premier plan : rien ne passe au travers au défilement */
.topbar::before { content: ""; position: absolute; inset: 0 -36px 0 -100px; z-index: -1; pointer-events: none;
  background: var(--bg); border-bottom: 1px solid transparent; transition: border-color .25s, box-shadow .25s; }
.topbar.defile::before { border-bottom-color: var(--panel-line); box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .35); }
.wordmark { margin-right: 4px; display: inline-flex; align-items: center; gap: 10px; line-height: 1; }
.wordmark .wm-col { display: inline-flex; flex-direction: column; gap: 5px; }
.wordmark small { font-size: 9px; letter-spacing: .38em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.navpill { position: relative; display: flex; gap: 2px; padding: 5px; border-radius: var(--pill); background: var(--panel); border: 1px solid var(--panel-line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
:root[data-theme="light"] .navpill { background: var(--card); box-shadow: var(--sh-pill); }
.navpill::-webkit-scrollbar { display: none; }
.nav-glider { position: absolute; top: 5px; left: 0; height: calc(100% - 10px); width: 0; border-radius: var(--pill); background: var(--black); z-index: 0;
  box-shadow: var(--sh-pill); transition: transform .55s var(--spring), width .55s var(--spring), opacity .2s; pointer-events: none; }
.navpill a { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--pill);
  color: var(--ink-2); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: color .35s var(--ease); }
.navpill a:hover { color: var(--ink); }
.navpill a.active { color: var(--on-black); }
.navcount { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--pill); background: var(--danger); color: #fff; font-size: 10.5px;
  font-weight: 700; display: inline-grid; place-items: center; }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
/* ordinateur : onglets centrés dans la barre, logo calé à gauche, réglages et compte calés à droite */
@media (min-width: 821px) {
  .topbar { display: grid; grid-template-columns: 1fr auto 1fr; }
  .topbar .wordmark { justify-self: start; }
  .topbar .navpill { justify-self: center; min-width: 0; }
  .topbar .hdr-right { justify-self: end; margin-left: 0; }
}
.circle { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--panel-line);
  color: var(--ink); cursor: pointer; position: relative; transition: background .25s, transform .35s var(--spring); }
.circle:hover { background: var(--card-3); transform: translateY(-1px); }
.circle .dot-alert { position: absolute; top: 12px; right: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px var(--card);
  animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { 0%, 70%, 100% { box-shadow: 0 0 0 3px var(--card), 0 0 0 3px rgba(229, 72, 77, 0); } 35% { box-shadow: 0 0 0 3px var(--card), 0 0 0 8px rgba(229, 72, 77, .22); } }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--black); color: var(--on-black);
  font-family: var(--display); font-weight: 700; font-size: 15px; cursor: pointer; border: 0; box-shadow: none;
  transition: transform .35s var(--spring); }
.avatar:hover { transform: scale(1.05); }
.menu { position: absolute; right: 0; top: 60px; width: 268px; background: var(--verre-fort); -webkit-backdrop-filter: var(--verre-flou); backdrop-filter: var(--verre-flou); --r-parent: 18px; --marge: 8px; border-radius: var(--r-parent); box-shadow: var(--verre-filet), var(--sh-float); padding: 8px; z-index: 40;
  opacity: 0; transform: translateY(-8px) scale(.97); transform-origin: top right; pointer-events: none; transition: opacity .2s var(--ease), transform .4s var(--spring); }
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu .who { padding: 12px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu a, .menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 10px 12px; border-radius: max(8px, calc(var(--r-parent, 18px) - var(--marge, 8px)));   border: 0; background: none; cursor: pointer;
  font-size: 13.5px; text-align: left; color: var(--ink); transition: background .15s, padding .25s var(--ease); }
.menu a:hover, .menu button:hover { background: var(--survol); padding-left: 15px; }
/* apparence en un geste : la ligne porte un petit sélecteur Clair / Sombre */
.menu .menu-app { display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 12px; font-size: 13.5px; color: var(--ink); }
.menu .menu-app > span { flex: 1; min-width: 0; white-space: nowrap; }
.menu .menu-seg { flex-shrink: 0; }
.menu .menu-seg button { width: auto; height: 28px; padding: 0 11px; border-radius: var(--pill); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.menu .menu-seg button:hover { padding-left: 11px; background: none; color: var(--ink); }
.menu .menu-seg button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .14), 0 0 0 .5px rgba(16, 24, 40, .05); }
:root:not([data-theme="light"]) .menu .menu-seg button.active { background: #3A3B42; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }

/* bandeau démo */
.demo-banner { display: flex; align-items: center; gap: 12px; padding: 6px; margin: 2px 0 6px; border-radius: 24px;   /* = moitié de 36 + 2 × 6 : capsule sur une ligne, rectangle concentrique si les boutons passent dessous */
  background: var(--verre); -webkit-backdrop-filter: var(--verre-flou); backdrop-filter: var(--verre-flou); border: 0; box-shadow: var(--verre-filet); font-size: 13px; color: var(--ink-2); flex-wrap: wrap; animation: rise .6s var(--ease-out) both; }
.demo-banner b { color: var(--ink); }
.demo-banner .tag { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: var(--pill); background: var(--card-3); color: var(--ink); font-weight: 700; font-size: 11.5px; letter-spacing: .01em; }
.demo-banner .actions { margin-left: auto; }
.demo-banner .btn { border-radius: var(--pill); }   /* capsule dans une capsule (marge 6) : concentrique */

/* en-tête de page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 20px; margin: 22px 0 26px; flex-wrap: wrap; }
.eyebrow { display: inline-block; font-size: 13px; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
a.eyebrow { transition: color .2s, transform .3s var(--spring); }
a.eyebrow:hover { color: var(--ink); transform: translateX(-3px); }
.page-head h1 { font-family: var(--display); font-size: 42px; line-height: 1.05; font-weight: 700; letter-spacing: -.03em; margin: 0; color: var(--ink); }
.page-head p { margin: 10px 0 0; color: var(--ink-3); font-size: 14px; line-height: 1.5; max-width: 680px; }
/* ligne de contexte AU-DESSUS du titre (« 64 clients · 412,8 k€ ouverts ») : <p class="ctx"> placé avant ou après le h1 */
.page-head > div:first-child:has(> .ctx) { display: flex; flex-direction: column; min-width: 0; }
.page-head .ctx { order: -1; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.page-head .meta { display: flex; gap: 10px; flex-wrap: wrap; }
.meta-item { padding: 12px 16px; border-radius: var(--r-md); background: var(--card); border: 0; box-shadow: var(--sh-card); min-width: 120px; }
.meta-item .k { font-size: 12px; color: var(--ink-3); }
.meta-item .v { font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.content { max-width: none; }

/* sous-navigation : pastilles contour, l'active en blanc */
.subnav { display: inline-flex; gap: 2px; margin: -6px 0 24px; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 3px; border-radius: var(--pill); background: var(--card-3); }
.subnav a { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 15px; border-radius: var(--pill); font-weight: 600; font-size: 13px;
  background: transparent; border: 0; color: var(--ink-2); transition: background .2s, color .2s, box-shadow .2s; }
.subnav a:hover { color: var(--ink); }
.subnav a.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .14), 0 0 0 .5px rgba(16, 24, 40, .05); }
:root:not([data-theme="light"]) .subnav a.active { background: #3A3B42; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.subnav .count { font-size: 11.5px; opacity: .6; }

/* =============================================================================
   BOUTONS
   ============================================================================= */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: var(--pill);
  border: 1px solid transparent; font-weight: 600; font-size: 13.5px; letter-spacing: -.005em; cursor: pointer; white-space: nowrap; overflow: hidden;
  transition: transform .35s var(--spring), background .25s var(--ease), box-shadow .3s var(--ease), border-color .25s, color .25s; }
.btn:hover:not(:disabled) { transform: none; }
.btn:active:not(:disabled) { transform: scale(.97); transition-duration: .1s; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--black); color: var(--on-black); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 24px -12px rgba(11, 11, 15, .55); }
/* secondaire : pilule blanche à filet fin ; fantôme : sans fond */
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover:not(:disabled) { background: var(--card-2); border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--survol); color: var(--ink); }
/* ancien bouton citron : c'est désormais l'action principale, en pilule noire */
.btn-lime { background: var(--black); color: var(--on-black); }
.btn-lime:hover:not(:disabled) { box-shadow: 0 10px 24px -12px rgba(11, 11, 15, .55); }
.btn-lime::after, .btn-primary::after { display: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-accent { background: var(--accent-fort); color: #fff; }
.btn-sm { height: 36px; padding: 0 15px; font-size: 12.5px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: inline-grid; place-items: center;
  cursor: pointer; color: var(--ink-2); transition: background .2s, color .2s; flex-shrink: 0; }
.icon-btn:hover { background: var(--card-2); color: var(--ink); }
.link-btn { background: none; border: none; color: var(--accent); text-decoration: none; cursor: pointer; font-weight: 600; padding: 0; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* =============================================================================
   SURFACES
   ============================================================================= */
.panel { background: var(--panel); border: 0; border-radius: var(--r-xl); padding: 22px; }
.card, .kpi, .task { position: relative; isolation: isolate; }
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-card); border: 0; min-width: 0;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), background .3s, border-color .3s; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 6px; }
.card-head h2, .card-head h3 { font-family: var(--display); margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.02em; display: flex; gap: 10px; align-items: center; color: var(--ink); }
.card-head h2 svg.i, .card-head h3 svg.i { display: none; }
.card-head a.small, .card-head > a { display: inline-flex; align-items: center; height: 32px; font-size: 12.5px; font-weight: 600; color: var(--ink); padding: 0 12px; border-radius: var(--pill); flex-shrink: 0; white-space: nowrap;
  border: 1px solid var(--line-2); background: var(--card); transition: color .2s, border-color .2s, background .2s; }
.card-head a.small:hover, .card-head > a:hover { color: var(--ink); background: var(--card-2); }
.card-body { padding: 14px 24px 22px; }
.card-body.tight { padding: 6px 8px 10px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.g-editor { grid-template-columns: minmax(0, 2.3fr) minmax(280px, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 16px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 16px; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: 13px; } .xs { font-size: 12px; }
.strong { font-weight: 700; } .r { text-align: right; } .nowrap { white-space: nowrap; }
code { font-size: 12px; background: var(--card-3); padding: 2px 7px; border-radius: 7px; }

/* tuiles chiffres : libellé, grand chiffre, flèche ronde en bas à droite */
.kpi { display: block; padding: 20px 22px 22px; overflow: hidden; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-card);
  border: 0; transition: transform .45s var(--ease-out), background .3s, box-shadow .3s; }
a.kpi::after { content: ""; position: absolute; right: 16px; bottom: 16px; width: 34px; height: 34px; border-radius: 50%; background-color: var(--card-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
  background-size: 14px; background-position: center; background-repeat: no-repeat; transition: transform .45s var(--spring), background-color .25s; }
a.kpi:hover { transform: none; box-shadow: var(--sh-float); }
a.kpi:hover::after { transform: rotate(45deg); background-color: var(--card-3); }
.kpi-label { color: var(--ink-3); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi-value { font-family: var(--display); font-size: 42px; font-weight: 700; letter-spacing: -.035em; line-height: 1.04; margin: 18px 0 6px; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi-value .u { font-size: 18px; font-weight: 500; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.kpi-sub { font-size: 12.5px; color: var(--ink-3); padding-right: 44px; }
.kpi-ico { display: none; }
/* tuile « à surveiller » : carte blanche cerclée de rouge, « ! » rouge (une alerte est toujours rouge) */
.kpi.accent { background: var(--card); color: var(--ink); box-shadow: var(--sh-card), inset 0 0 0 1.5px var(--danger); }
.kpi.accent .kpi-value { color: var(--danger); }
.kpi.accent .kpi-value .u { color: color-mix(in srgb, var(--danger) 60%, transparent); }
.kpi.accent .kpi-label::before { content: "!"; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 12px; font-weight: 800;
  display: inline-grid; place-items: center; }
.kpi.lime { background: var(--card); color: var(--ink); }
.kpi.lime .kpi-label, .kpi.lime .kpi-sub { color: var(--ink-3); }
.kpi .trend { position: absolute; right: 18px; top: 18px; }
.tone-blue, .tone-green, .tone-red, .tone-amber { background: var(--card-2); color: var(--ink-2); }
/* anneau de progression */
.ring { position: absolute; right: 18px; top: 18px; width: 44px; height: 44px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: var(--line-2); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease-out); }
.ring.coral .fg { stroke: var(--danger); }
.kpi.accent .ring .fg { stroke: var(--danger); }

/* pastilles d'état */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; font-size: 12px; font-weight: 600; padding: 0 10px 0 9px; border-radius: var(--pill);
  background: var(--card-3); color: var(--ink-2); white-space: nowrap; border: 0; line-height: 1; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge svg.i { display: none; }
.badge.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.red { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.amber { background: var(--amber-soft); color: var(--amber-text); border-color: transparent; }
.badge.blue { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.gray { color: var(--ink-3); }
.badge.noir { background: var(--black); color: var(--on-black); }

/* tableaux : lignes-pilules */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 13.5px; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 12px 16px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.t td { padding: 15px 16px; vertical-align: middle; background: transparent; transition: background .2s var(--ease); }
.t tbody tr td { border-top: 1px solid var(--line); }
.t tbody tr:first-child td { border-top-color: transparent; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: var(--card-2); border-top-color: transparent; }
.t tbody tr.click:hover + tr td { border-top-color: transparent; }
.t tbody tr.click:hover td:first-child { border-radius: 14px 0 0 14px; }
.t tbody tr.click:hover td:last-child { border-radius: 0 14px 14px 0; }
.t .r { text-align: right; }
/* état vide : une pastille ronde grise, un titre noir, une phrase grise */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty > svg.i { display: block; box-sizing: content-box; width: 22px; height: 22px; padding: 13px; margin: 0 auto 14px; border-radius: 50%; background: var(--card-3); color: var(--ink-3); opacity: 1; }
.empty b { color: var(--ink); font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -.015em; }

/* onglets / filtres */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; align-items: center; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--pill); font-weight: 600; font-size: 13px;
  background: transparent; border: 1px solid transparent; color: var(--ink-2); cursor: pointer; white-space: nowrap;
  transition: background .25s, color .25s, border-color .25s; }
.tab:hover { color: var(--ink); background: var(--survol); }
.tab.active { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: 0 1px 3px rgba(16, 24, 40, .10); }
.tab .count { font-size: 11.5px; opacity: .6; font-weight: 700; font-variant-numeric: tabular-nums; }
.tab.active .count { color: var(--ink-3); opacity: 1; }
/* contrôle segmenté (filtres, vues) : rail gris, segment choisi blanc ombré (sombre : gris plus clair) ; compteur discret (.count / .cs-compte) */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--pill); background: var(--card-3); border: 0; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; height: 34px; padding: 0 14px; border-radius: var(--pill); font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer;
  transition: background .2s var(--ease), color .2s, box-shadow .2s; }
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .14), 0 0 0 .5px rgba(16, 24, 40, .05); }
:root:not([data-theme="light"]) .seg button.active { background: #3A3B42; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.seg .count, .segment .count, .cs-compte { font-size: 11.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* formulaires */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.field .hint a { text-decoration: underline; }
.input, select.input, textarea.input { height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; background: var(--field);
  color: var(--ink); width: 100%; font-size: 14px; transition: background .2s, border-color .2s, box-shadow .3s var(--ease); }
select.input { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a93' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
select.input option { background: var(--card); color: var(--ink); }
textarea.input { height: auto; padding: 12px 16px; resize: vertical; line-height: 1.6; border-radius: 12px; }
.input:hover { border-color: var(--line-2); }
.input:focus { outline: none; background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.sm { height: 36px; border-radius: 10px; font-size: 13.5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; }
.section-title { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -.015em; color: var(--ink); margin: 26px 0 12px; }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 46px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: var(--pill); cursor: pointer; transition: background .3s var(--ease); }
.switch span::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform .45s var(--spring); box-shadow: 0 1px 3px rgba(16, 24, 40, .25), 0 1px 1px rgba(16, 24, 40, .06); }
/* interrupteur : bleu quand il est actif (jamais citron) */
.switch input:checked + span { background: var(--accent-fort); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:checked + span::before { transform: translateX(18px); }

/* listes « à traiter » : lignes-pilules avec icône ronde */
.todo { display: flex; gap: 14px; padding: 10px 12px 10px 10px; border-radius: var(--pill); align-items: center; color: var(--ink); transition: background .2s, transform .35s var(--spring); }
.todo + .todo { margin-top: 4px; }
.todo:hover { background: var(--card-2); transform: none; }
.todo-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: var(--ink); background: var(--card-2); }
.todo:hover .todo-ico { background: var(--card-3); }
.todo-ico.hot { background: var(--danger-soft); color: var(--danger); }
.todo-title { font-weight: 700; }
.todo .chev { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); flex-shrink: 0; background: var(--card-2);
  transition: background .25s, color .25s, transform .4s var(--spring); }
.todo:hover .chev { background: var(--black); color: var(--on-black); transform: rotate(-45deg); }

.tl-item { display: flex; gap: 12px; padding: 10px 16px; font-size: 13px; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); margin-top: 6px; flex-shrink: 0; }
.tl-dot.ordo { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-when { color: var(--ink-3); font-size: 12px; }

/* graphique : colonnes arrondies, le mois en cours à l'encre */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 54px; border-radius: 14px; min-height: 8px; border: 0;
  background: var(--card-3); transform-origin: bottom; animation: grow .9s var(--ease-out) both; }
.bar.current { background: var(--ink); }
.bar-col:nth-child(2) .bar { animation-delay: .05s; } .bar-col:nth-child(3) .bar { animation-delay: .1s; } .bar-col:nth-child(4) .bar { animation-delay: .15s; }
.bar-col:nth-child(5) .bar { animation-delay: .2s; } .bar-col:nth-child(6) .bar { animation-delay: .25s; } .bar-col:nth-child(n+7) .bar { animation-delay: .3s; }
@keyframes grow { from { transform: scaleY(0); } }
.bar-val { font-size: 11.5px; color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-lbl { font-size: 12px; color: var(--ink-3); }

/* graphique signé (solde projeté) : ligne zéro, vert au-dessus, rouge en dessous, colonnes alignées */
.bars.signe { gap: 0; height: 230px; }
.bars.signe .bar-col { gap: 0; padding: 0 5px; justify-content: stretch; min-width: 0; }
.bars.signe .bar-val, .bars.signe .bar-lbl { overflow: visible; }
.bars.signe .zone-pos, .bars.signe .zone-neg { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; }
.bars.signe .zone-pos { justify-content: flex-end; padding-bottom: 0; }
.bars.signe .zone-neg { justify-content: flex-start; border-top: 1.5px solid var(--line-2); padding-top: 0; }
.bars.signe .bar { border: 0; max-width: 46px; flex-shrink: 0; min-height: 0; }
.bars.signe .bar.pos { background: var(--green); border-radius: 8px 8px 2px 2px; transform-origin: bottom; }
.bars.signe .bar.neg { background: var(--danger); border-radius: 2px 2px 8px 8px; transform-origin: top; }
.bars.signe .bar-val { line-height: 16px; white-space: nowrap; }
.bars.signe .bar-val.neg { color: var(--danger); }
.bars.signe .bar-lbl { line-height: 16px; height: 16px; margin-top: 8px; white-space: nowrap; }
.bars.grand.signe { gap: 0; }
.bars.grand.signe .bar { max-width: 110px; }
.bars.grand.signe .bar-lbl { height: 20px; line-height: 20px; }
.legende-solde { display: flex; gap: 18px; justify-content: flex-end; margin-top: 12px; }
.legende-solde span { display: inline-flex; align-items: center; gap: 6px; }
.legende-solde .pt { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legende-solde .pt.pos { background: var(--green); } .legende-solde .pt.neg { background: var(--danger); }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
tr.retard td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.retard-txt { color: var(--danger); margin-top: 2px; }

/* échéances */
.deadline { display: flex; gap: 14px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); transition: background .2s; }
.deadline:hover { background: var(--card-2); }
.deadline + .deadline { margin-top: 2px; }
.date-chip { width: 54px; height: 58px; border-radius: 18px; background: var(--card-3); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.date-chip .m { font-size: 10.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; }
.date-chip .d { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.05; }
.date-chip.urgent { background: var(--danger); color: #fff; }
.date-chip.urgent .m { color: #fff; opacity: .8; }

/* encarts */
.callout { display: flex; gap: 12px; padding: 14px 18px; border-radius: var(--r-md); font-size: 13px; align-items: flex-start; background: var(--card-2); color: var(--ink-2); border: 0; }
.callout svg.i { margin-top: 1px; flex-shrink: 0; }
.callout a { color: var(--accent); text-decoration: none; font-weight: 600; }
.callout a:hover { text-decoration: underline; text-underline-offset: 2px; }
.callout.info, .callout.warn, .callout.danger, .callout.ok { color: var(--ink); }
.callout.info { background: var(--card-2); border-color: transparent; } .callout.info svg.i { color: var(--ink-2); }
.callout.warn { background: var(--amber-soft); border-color: transparent; } .callout.warn svg.i { color: var(--amber-text); }
.callout.danger { background: var(--danger-soft); border-color: transparent; } .callout.danger svg.i { color: var(--danger); }
.callout.ok { background: var(--green-soft); border-color: transparent; } .callout.ok svg.i { color: var(--green); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; padding: 7px 0; font-size: 13px; align-items: flex-start; }
.checklist li > span:first-child { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.checklist .ok { background: var(--green-soft); color: var(--green); }
.checklist .ko { background: var(--danger-soft); color: var(--danger); }
.checklist .av { background: var(--amber-soft); color: var(--amber-text); }
.checklist .in { background: var(--card-3); color: var(--ink); }
.checklist svg.i.sm { width: 12px; height: 12px; stroke-width: 2.4; }
details.ok-list summary { cursor: pointer; font-size: 13px; color: var(--green); font-weight: 600; padding: 8px 0; list-style: none; }
details.ok-list summary::-webkit-details-marker { display: none; }

/* lignes de facture */
.lines .line { display: grid; grid-template-columns: minmax(170px, 1fr) 70px 104px 74px 92px 104px 42px; gap: 8px; align-items: center; margin-bottom: 8px;
  animation: rise .45s var(--ease-out) both; }
.lines .head { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; animation: none; }
.totals { margin-left: auto; width: 330px; padding: 18px 20px; border-radius: var(--r-md); background: var(--card-2); }
.totals .row { justify-content: space-between; padding: 4px 0; }
.totals .grand { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line-2); font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }

/* récapitulatif (carte inversée) */
.sticky-side { position: sticky; top: 96px; align-self: start; }
.summary { position: relative; background: var(--black); color: var(--on-black); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--sh-float); overflow: hidden; }
.summary .k { font-size: 13px; font-weight: 600; opacity: .55; }
.summary .big { font-family: var(--display); font-size: 42px; font-weight: 700; letter-spacing: -.035em; margin: 8px 0 14px; font-variant-numeric: tabular-nums; }
.sum-rows { border-top: 1px solid color-mix(in srgb, var(--on-black) 12%, transparent); padding-top: 12px; font-size: 13.5px; }
.sum-rows .row { padding: 4px 0; } .sum-rows .row > span:first-child { opacity: .6; }
.summary .btn { width: 100%; }
.summary .btn-primary { background: var(--on-black); color: var(--black); }
.meter { height: 10px; border-radius: var(--pill); background: color-mix(in srgb, var(--on-black) 10%, transparent); overflow: hidden; margin-bottom: 14px; }
.meter > div { height: 100%; border-radius: var(--pill); background: var(--accent);
  transition: width 1s var(--ease-out); }
.doc-frame { overflow: hidden; padding: 10px; background: var(--card-2); }
.doc-frame iframe { width: 100%; height: 900px; border: 0; border-radius: var(--r-md); background: #fff; display: block; }
.btn-ghost-dark { background: transparent; color: var(--on-black); border-color: color-mix(in srgb, var(--on-black) 22%, transparent); }
.btn-ghost-dark:hover { border-color: var(--on-black); }
.amount-lg { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.summary .retard { background: var(--danger); color: #fff; padding: 0 7px; border-radius: 7px; }

/* parcours devis */
.steps-bar { display: flex; gap: 6px; margin: -6px 0 18px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px 0 6px; border-radius: var(--pill); background: transparent;
  border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--ink-3); }
.step > span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); font-size: 11.5px; color: var(--ink-3); }
.step.done { color: var(--ink); background: var(--card); border-color: transparent; box-shadow: var(--sh-pill); }
.step.done > span { background: var(--black); color: var(--on-black); }
.step.done > span svg.i { width: 12px; height: 12px; stroke-width: 2.6; }

/* abonnements */
.abo { padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.abo.off { opacity: .55; }
.abo-client { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-top: 14px; }
.abo-objet { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.abo-montant { font-family: var(--display); font-size: 32px; font-weight: 700; letter-spacing: -.03em; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.abo-montant span { font-family: var(--text); font-size: 13px; color: var(--ink-3); letter-spacing: 0; font-weight: 500; }
.abo-foot { display: flex; gap: 18px; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); }
.abo-foot .icon-btn { margin-left: auto; }

/* lignes de déclaration */
.ca3-line { border-radius: var(--r-md); }
.ca3-line + .ca3-line { border-top: 1px solid var(--line); border-radius: 0; }
.ca3-line summary { display: flex; align-items: center; gap: 14px; padding: 13px 16px; cursor: pointer; list-style: none; transition: background .2s; }
.ca3-line summary::-webkit-details-marker { display: none; }
.ca3-line[data-nopieces] summary { cursor: default; }
.ca3-line .code { min-width: 42px; height: 30px; padding: 0 9px; border-radius: var(--pill); background: var(--card-2); display: inline-grid; place-items: center;
  font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; transition: background .25s, color .25s; }
.ca3-line .lib { flex: 1; font-size: 13.5px; }
.ca3-line .val { font-weight: 700; font-size: 15px; white-space: nowrap; }
.ca3-line.vide .code { color: var(--ink-3); }
.ca3-line:not([data-nopieces]) summary:hover { background: var(--card-2); border-radius: var(--pill); }
.ca3-line[open] .code { background: var(--black); color: var(--on-black); }
.pieces { padding: 0 16px 12px 72px; display: flex; flex-direction: column; gap: 4px; animation: rise .35s var(--ease-out) both; }
.piece { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; font-size: 12.5px; padding: 7px 12px; border-radius: var(--pill); background: var(--card-2); }
.piece:hover { background: var(--card-3); }
.seg a { display: contents; }

/* traçabilité */
.trace { border-radius: var(--r-md); padding: 14px 16px; background: var(--card-2); font-size: 12.5px; }
.trace-title { font-weight: 700; display: flex; gap: 6px; align-items: center; margin-bottom: 8px; color: var(--ink); }
.trace-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.trace-row a { color: var(--ink-3); }
.src { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; padding: 6px 12px; border-radius: var(--pill); background: var(--card-2);
  color: var(--ink); font-weight: 600; cursor: pointer; border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.src:hover { border-color: var(--ink-3); }
.src.unverified { background: var(--amber-soft); border-color: transparent; color: var(--amber); }

/* assistant (espace expert) */
.chat { display: flex; flex-direction: column; height: calc(100vh - 250px); min-height: 520px; }
.chat-log { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.msg { max-width: 760px; animation: rise .45s var(--ease-out) both; }
.msg.user { align-self: flex-end; background: var(--black); color: var(--on-black); padding: 12px 18px; border-radius: 24px 24px 6px 24px; }
.msg.bot { align-self: flex-start; width: 100%; }
.bot-bubble { background: var(--card-2); border-radius: 6px 24px 24px 24px; padding: 16px 20px; }
.bot-bubble p { margin: 0 0 8px; } .bot-bubble p:last-child { margin: 0; }
.bot-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.chat-hero { position: relative; overflow: hidden; margin: 10px; padding: 28px 28px 24px; border-radius: 24px; color: #fff; background: var(--degrade-heros); }
.chat-hero .k { font-size: 12.5px; opacity: .6; font-weight: 600; }
.chat-hero .t1 { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: 8px 0 18px; max-width: 560px; }
.glass-chip { border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .1); color: #fff; border-radius: var(--pill); padding: 9px 15px;
  font-size: 12.5px; cursor: pointer; font-weight: 500; backdrop-filter: blur(8px); transition: background .25s, border-color .25s, transform .35s var(--spring); }
.glass-chip:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); transform: translateY(-2px); }
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
ol.steps li { counter-increment: s; display: flex; gap: 12px; padding: 7px 0; font-size: 13px; color: var(--ink-2); }
ol.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--card-2); color: var(--ink); font-weight: 700;
  font-size: 11.5px; display: grid; place-items: center; flex-shrink: 0; }
ol.steps b { color: var(--ink); }
.chat-input { padding: 14px; display: flex; gap: 10px; align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; height: 54px; border-radius: 27px; padding: 15px 20px; }
.chat-input .btn { height: 54px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); background: transparent; border-radius: var(--pill); padding: 9px 15px; font-size: 12.5px; cursor: pointer; color: var(--ink-2);
  font-weight: 500; transition: border-color .2s, color .2s, background .2s, transform .35s var(--spring); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); background: var(--card-2); transform: translateY(-1px); }
.excerpt { padding: 14px 16px; background: var(--card-2); border-radius: var(--r-md); margin-top: 10px; }
.excerpt h4 { margin: 0 0 6px; font-size: 13px; }
.typing { display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; }
.typing span { display: inline-block; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; animation: blink 1.2s infinite var(--ease); }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* contenu des fiches */
.md { line-height: 1.7; }
.md h1 { font-family: var(--display); font-size: 30px; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 700; }
.md h2 { font-family: var(--display); font-size: 19px; margin: 28px 0 10px; font-weight: 700; letter-spacing: -.015em; }
.md h3 { font-size: 14px; margin: 18px 0 6px; } .md p { margin: 0 0 12px; } .md ul, .md ol { margin: 0 0 12px; padding-left: 22px; } .md li { margin: 4px 0; }
.md table { border-collapse: collapse; margin: 8px 0 16px; font-size: 13px; } .md td, .md th { border-bottom: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.md blockquote { border-left: 3px solid var(--accent); margin: 0 0 12px; padding: 4px 14px; color: var(--ink-2); }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* panneau mis en avant : carte héros au dégradé bleu */
.feature { position: relative; border-radius: var(--r-xl); padding: 26px; color: #fff; overflow: hidden; background: var(--degrade-heros); border: 0;
  box-shadow: 0 24px 50px -28px rgba(11, 95, 214, .65); }
.feature .k { font-size: 13px; opacity: .6; font-weight: 600; }
.feature .big { font-family: var(--display); font-size: 58px; font-weight: 700; letter-spacing: -.04em; line-height: 1; margin: 14px 0 6px; font-variant-numeric: tabular-nums; }
.feature .t1 { font-family: var(--display); font-size: 19px; font-weight: 700; }
.feature .sub { opacity: .65; font-size: 13px; }
.feature .glass { margin-top: 18px; padding: 12px 14px; border-radius: var(--r-md); background: rgba(255, 255, 255, .16); font-size: 13px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.feature a.btn { background: #fff; color: #0B0B0F; }

/* modales */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 60px 16px; overflow-y: auto; animation: fade .3s var(--ease); }
:root[data-theme="light"] .modal-bg { background: rgba(11, 12, 15, .26); }
.modal { background: var(--card); border-radius: var(--r-xl); box-shadow: var(--sh-float); border: 0; width: 100%; max-width: 640px; animation: modal-in .55s var(--spring); }
.modal.wide { max-width: 1000px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 26px 28px 6px; }
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
.modal-body { padding: 16px 28px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 28px 24px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: 0; } }
@keyframes modal-in { from { transform: translateY(24px) scale(.96); opacity: 0; filter: blur(6px); } }

/* notifications */
#toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; }
.toast { background: var(--black); color: var(--on-black); padding: 10px 20px 10px 10px; border-radius: var(--pill); box-shadow: var(--sh-float); font-size: 13.5px;
  display: flex; gap: 10px; align-items: center; max-width: 560px; animation: toast-in .6s var(--spring) both; font-weight: 600; }
.toast.out { animation: toast-out .35s var(--ease) both; }
.toast svg.i { width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: var(--green); color: #fff; stroke-width: 2.6; }
.toast.err svg.i { background: var(--danger); color: #fff; }
@keyframes toast-in { from { transform: translateY(30px) scale(.9); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(12px) scale(.96); opacity: 0; } }

/* connecteurs, automatisations */
.conn { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.conn-head { display: flex; gap: 12px; align-items: center; }
.conn-ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--ink); }
.envlist code { margin: 2px 4px 2px 0; display: inline-block; }
.auto { display: flex; gap: 16px; padding: 20px 18px; align-items: flex-start; border-radius: var(--r-md); }
.auto + .auto { border-top: 1px solid var(--line); }
.auto-ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--card-2); color: var(--ink); }

.progress { height: 8px; background: var(--card-3); border-radius: var(--pill); overflow: hidden; }
.progress > div { height: 100%; border-radius: var(--pill); background: var(--accent);
  transition: width 1s var(--ease-out); }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
/* squelette de chargement : panneau gris clair qui luit doucement */
.skeleton { background: linear-gradient(100deg, var(--card-3) 30%, var(--card-2) 50%, var(--card-3) 70%); background-size: 200% 100%; animation: sk 1.4s var(--ease) infinite;
  border-radius: var(--r-lg); }
@keyframes sk { to { background-position: -200% 0; } }
.kbd { font-size: 11px; border: 0; border-radius: var(--pill); padding: 2px 8px; background: var(--card-3); color: var(--ink-3); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex-shrink: 0; }
.dot.on { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dot.warn { background: var(--amber); }

/* connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 440px; background: var(--card); border-radius: var(--r-xl); box-shadow: var(--sh-float); padding: 36px; animation: modal-in .7s var(--spring) both; }
.login-card h1 { font-family: var(--display); font-size: 36px; letter-spacing: -.03em; margin: 20px 0 6px; font-weight: 700; }

/* =============================================================================
   MOUVEMENT — entrées de page échelonnées (classe posée par le routeur)
   ============================================================================= */
/* apparition d'une page : sans flou (le flou coûte cher à l'affichage) ; toute la page est là en 0,65 s (css/mouvement.css) */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* .view-enter .stagger : voir css/mouvement.css (montée en cascade, 0,65 s pour toute la page) */
#view { transition: opacity .16s var(--ease), transform .2s var(--ease); }
#view.view-leave { opacity: 0; transform: translateY(6px); }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 1280px) {
  .navpill a { padding: 0 14px; font-size: 13px; }
  .topbar { gap: 14px; }
}
@media (max-width: 1180px) {
  .wordmark .wm-col { display: none; }               /* le symbole seul laisse la place aux onglets */
  .wordmark .wm-sym { display: block; }
  .navpill a { padding: 0 11px; font-size: 12.5px; }
  .topbar { gap: 10px; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-editor { grid-template-columns: minmax(0, 1fr); }
  .g-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 0 16px 40px; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar::before { left: -16px; right: -16px; }
  .navpill { order: 3; width: 100%; }
  .wordmark .wm-sym { display: block; width: 30px; height: 30px; color: var(--ink); }
  .page-head h1 { font-size: 36px; }
  .g-2, .g-4, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .lines .line { grid-template-columns: 1fr 1fr; }
  .lines .head { display: none; }
  .totals { width: 100%; }
  .kpi-value { font-size: 38px; }
  #toasts { width: calc(100% - 32px); }
  .rail { display: none !important; }
}

/* expert-comptable : consultation seule. Le serveur refuse toute écriture ; on retire seulement les raccourcis de saisie. */
body.lecture-seule a.rail-btn[href="#/factures/nouvelle"], body.lecture-seule label.rail-btn, body.lecture-seule [data-act="auto"],
body.lecture-seule .demo-banner .actions { display: none !important; }
.ro-pill { display: none; height: 32px; padding: 0 13px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; align-items: center; }
body.lecture-seule .ro-pill { display: inline-flex; }

/* =============================================================================
   ACCUEIL « AUJOURD'HUI » — Sophystia agit, le gérant valide
   ============================================================================= */
.hello { margin: 30px 0 22px; }
.hello h1 { font-family: var(--display); font-size: 46px; font-weight: 700; letter-spacing: -.035em; margin: 4px 0 10px; line-height: 1.04; }
.hello p { margin: 0; font-size: 16px; color: var(--ink-3); max-width: 640px; }
.hello p b { color: var(--ink); font-weight: 600; }

/* la boîte de Sophystia : bleu nuit vitré, bordure en aura bleue qui tourne lentement */
.ask { position: relative; isolation: isolate; border-radius: var(--r-xl); padding: 24px; color: #fff; box-shadow: var(--sh-float); overflow: hidden;
  background: #0C1A33; transition: transform .45s var(--spring), box-shadow .3s;
  background-image: radial-gradient(70% 120% at 50% -40%, rgba(255, 255, 255, .14), transparent 70%),
                    radial-gradient(45% 90% at 100% 120%, rgba(43, 140, 255, .32), transparent 70%),
                    radial-gradient(35% 70% at 0% 120%, rgba(141, 187, 247, .14), transparent 70%); }
.ask::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: 2; pointer-events: none;
  background: conic-gradient(from var(--ang), rgba(255, 255, 255, .06) 0 55%, rgba(43, 140, 255, .9) 72%, rgba(141, 187, 247, .85) 82%, rgba(255, 255, 255, .06) 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: aura 7s linear infinite; }
@keyframes aura { to { --ang: 360deg; } }
.ask.over { transform: scale(1.012); }
.ask.over::before { animation-duration: 1.6s; }
.ask-k { font-size: 13px; font-weight: 600; color: rgba(243, 243, 241, .92); display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.ask-k .faint { color: rgba(243, 243, 241, .45); font-weight: 500; }
/* l'orbe de Sophystia : respire, s'accélère quand elle travaille */
.orb { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: radial-gradient(circle at 32% 30%, #ffffff 0%, #a9cdf7 22%, #2B8CFF 52%, #0B5FD6 82%);
  box-shadow: 0 0 18px rgba(43, 140, 255, .55), inset 0 -2px 6px rgba(0, 0, 0, .35); animation: breathe 3.6s var(--ease) infinite; }
.orb.busy { animation: breathe .9s var(--ease) infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); box-shadow: 0 0 14px rgba(43, 140, 255, .45), inset 0 -2px 6px rgba(0, 0, 0, .35); }
  50% { transform: scale(1.12); box-shadow: 0 0 26px rgba(43, 140, 255, .8), inset 0 -2px 6px rgba(0, 0, 0, .35); } }
.ask-row { display: flex; gap: 8px; align-items: center; background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--pill); padding: 6px 6px 6px 22px; transition: border-color .3s, background .3s, box-shadow .4s var(--ease); }
.ask-row:focus-within { border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 5px rgba(43, 140, 255, .18); }
.ask-row input { flex: 1; min-width: 0; background: none; border: 0; color: #fff; font-size: 16px; height: 46px; outline: none; }
.ask-row input::placeholder { color: rgba(243, 243, 241, .4); transition: opacity .3s; }
.ask-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: #0B0B0F; display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0; transition: transform .4s var(--spring), background .2s; }
.ask-btn:hover { transform: scale(1.05); }
.ask-btn:active { transform: scale(.92); }
.ask-btn.ghost { background: rgba(255, 255, 255, .12); color: #fff; }
.ask-btn.ghost:hover { background: rgba(255, 255, 255, .16); transform: translateY(-2px); }
.ask-btn svg.i { stroke-width: 2; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ask-drop { margin-top: 14px; font-size: 12.5px; color: rgba(243, 243, 241, .42); display: flex; align-items: center; gap: 8px; }
.ask-drop::before { content: ""; width: 18px; height: 1px; background: rgba(243, 243, 241, .25); }

.reply { margin-top: 14px; background: var(--card); border: 0; border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--sh-card);
  animation: rise .6s var(--ease-out) both; }
.reply-t { font-size: 15px; line-height: 1.6; }
.reply-t p { margin: 0 0 8px; }
.reply .cards { margin-top: 14px; }
.reply .cards > * { animation: rise .6s var(--ease-out) both; }
.reply .cards > *:nth-child(2) { animation-delay: .08s; } .reply .cards > *:nth-child(3) { animation-delay: .16s; }

.block { margin-top: 34px; }
.block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.block-head h2 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -.025em; margin: 0; }
.block-head a { margin-left: auto; display: inline-flex; align-items: center; height: 32px; font-size: 12.5px; font-weight: 600; color: var(--ink); padding: 0 14px; border-radius: var(--pill);
  border: 1px solid var(--line-2); background: var(--card); transition: color .2s, background .2s; }
.block-head a:hover { color: var(--ink); background: var(--card-2); }
/* compteur façon « ! 3 » : pilule noire, point d'exclamation rouge */
.pill-n { height: 28px; border-radius: var(--pill); background: var(--black); color: var(--on-black); font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px; padding: 0 11px 0 5px; }
.pill-n::before { content: "!"; width: 18px; height: 18px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.task { padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 8px; transition: transform .45s var(--ease-out), background .5s var(--ease), border-color .5s; }
.task:hover { transform: none; box-shadow: var(--sh-float); }
.task-t { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: -.015em; display: flex; gap: 10px; align-items: center; line-height: 1.25; }
.task-x { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.task-a { display: flex; gap: 6px; margin-top: auto; padding-top: 10px; }
/* marqueurs : « ! » rouge = urgent, portrait = préparé par Sophystia */
.task.urgent .task-t::before, .task.ordo .task-t::before { content: ""; width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; }
.task.urgent .task-t::before { content: "!"; background: var(--danger); color: #fff; font-family: var(--text); font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.task.ordo { box-shadow: var(--sh-card), inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.task.ordo .task-t::before { width: 18px; height: 18px; background: radial-gradient(circle at 32% 30%, #fff 0%, #a9cdf7 24%, #2B8CFF 55%, #0B5FD6 85%);
  box-shadow: 0 0 14px rgba(43, 140, 255, .6); animation: breathe 3.6s var(--ease) infinite; }
.task.ok { background: var(--card); box-shadow: var(--sh-card), inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.task.ok .task-t svg.i { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--black); color: var(--on-black); stroke-width: 2.8;
  animation: check-in .6s var(--spring) both; }
.task.ok .task-t svg.i path, .task.ok .task-t svg.i polyline { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .15s var(--ease-out) forwards; }
@keyframes check-in { from { transform: scale(0) rotate(-40deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.block.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.done { padding: 20px 22px; }
.done ul { list-style: none; margin: 0; padding: 0; }
.done li { display: flex; gap: 12px; align-items: center; padding: 7px 0; font-size: 14px; }
.done li svg.i { width: 24px; height: 24px; padding: 5px; border-radius: 50%; background: var(--card-3); color: var(--ink); stroke-width: 2.6; }
.done-big { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -.035em; }
.done-big span { display: block; font-family: var(--text); font-size: 13px; color: var(--ink-3); letter-spacing: 0; }
@media (max-width: 820px) {
  .hello h1 { font-size: 40px; }
  .demo-banner { border-radius: var(--r-md); padding: 10px 10px 10px 14px; }
  .block.two { grid-template-columns: 1fr; }
  .ask { padding: 18px; }
  .ask-row input { font-size: 15px; }
}

/* moins d'animations si l'utilisateur le demande */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* =============================================================================
   SOPHYSTIA — portrait, buste, signature
   ============================================================================= */
.soph-av { position: relative; width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center; }
.soph-av img { width: 100%; height: 100%; border-radius: 50%; display: block; position: relative; z-index: 1; }
.soph-av::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; padding: 2px;
  background: conic-gradient(from var(--ang), var(--accent), #8DBBF7, var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .9; animation: aura 6s linear infinite; }
.soph-av::after { content: ""; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2.5px var(--card); z-index: 2; }
.soph-av.sm { width: 22px; height: 22px; }
.soph-av.sm::before { inset: -2px; padding: 1.5px; }
.soph-av.sm::after { display: none; }
.soph-av.busy::before { animation-duration: .9s; }
.soph-av.busy img { animation: breathe .9s var(--ease) infinite; }
.ask-k { gap: 12px; }
.ask-qui { display: flex; flex-direction: column; line-height: 1.25; }
.ask-qui b { font-family: var(--display); font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.ask-qui .faint { font-size: 12.5px; }
/* le buste de Sophystia, au téléphone, posé sur le bord droit de sa boîte */
.ask-soph { position: absolute; right: 18px; bottom: -40px; height: calc(100% + 14px); max-height: 300px; width: auto; z-index: 1; pointer-events: none;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55)); animation: soph-in .9s var(--ease-out) both .15s; }
@keyframes soph-in { from { opacity: 0; transform: translateY(24px); } }
.ask > :not(.ask-soph) { position: relative; z-index: 2; }
@media (min-width: 1000px) { .ask { padding-right: 250px; } }
@media (max-width: 999px) { .ask-soph { display: none; } }
.soph-sig { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 10px; }
.msg.bot { display: flex; gap: 12px; align-items: flex-start; }
.msg.bot .bot-av { width: 32px; height: 32px; margin-top: 4px; }
.msg.bot .bot-col { flex: 1; min-width: 0; }
.rail-btn.soph { padding: 0; overflow: visible; background: transparent; border: 0; }
.rail-btn.soph img { width: 48px; height: 48px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent); transition: box-shadow .3s; }
.rail-btn.soph:hover img { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent-2); }
.task.ordo .task-t::before { width: 26px; height: 26px; background: url("/static/img/sophystia/portrait-96.webp") center / cover; animation: none;
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--accent); }

/* logos des connecteurs */
.conn-ico.logo { background: transparent; border-radius: 14px; overflow: hidden; }
.conn-ico.logo img { width: 48px; height: 48px; object-fit: contain; display: block; border-radius: 12px; }
/* logos sans fond propre ou sombres : posés sur une tuile claire, comme une icône d'application */
.conn-ico.logo img[src*="email"], .conn-ico.logo img[src*="fec"], .conn-ico.logo img[src*="facture-electronique"] { background: #F4F5F7; padding: 7px; }
.conn-ico.logo img[src$=".svg"] { background: #F4F5F7; padding: 10px; }   /* symboles maison, comme sur le site */

/* =============================================================================
   COMPOSANTS MAISON — listes, dates, cases, fichiers, infobulles, erreurs
   ============================================================================= */
.natif-cache { position: absolute !important; opacity: 0 !important; pointer-events: none !important; width: 1px !important; height: 1px !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip-path: inset(50%); }
.sel, .dp { position: relative; width: 100%; min-width: 0; }
.sel-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; background-image: none !important;
  padding-right: 14px !important; }
.sel-btn .sel-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-btn .sel-val.vide { color: var(--ink-3); }
.sel-btn svg.i { color: var(--ink-3); transition: transform .35s var(--spring); flex-shrink: 0; }
.sel-btn.ouvert { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 4px var(--accent-soft); }
.sel-btn.ouvert svg.i { transform: rotate(180deg); }
.sel-btn:disabled { opacity: .5; cursor: not-allowed; }
.dp-txt { padding-right: 46px !important; }
.dp-ico { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent;
  color: var(--ink-3); display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s; }
.dp-ico:hover, .dp-txt.ouvert + .dp-ico { background: var(--card-3); color: var(--ink); }
.input.sm + .dp-ico { width: 30px; height: 30px; }

.pop { position: fixed; z-index: 400; background: var(--verre-fort); -webkit-backdrop-filter: var(--verre-flou); backdrop-filter: var(--verre-flou); border: 0; --r-parent: 18px; --marge: 6px; border-radius: var(--r-parent); box-shadow: var(--verre-filet), var(--sh-float);
  padding: 6px; opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top center; transition: opacity .18s var(--ease), transform .35s var(--spring); }
.pop.haut { transform-origin: bottom center; transform: translateY(6px) scale(.97); }
.pop.on { opacity: 1; transform: none; }
.pop.off { opacity: 0; transform: scale(.98); transition-duration: .15s; }
.pop:focus { outline: none; }
.pop-liste { max-height: 300px; overflow-y: auto; }
.pop-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border-radius: max(8px, calc(var(--r-parent, 18px) - var(--marge, 6px))); cursor: pointer; font-size: 13.5px;
  color: var(--ink); transition: background .12s; white-space: nowrap; }
.pop-opt.actif { background: var(--card-2); }
.pop-opt.choisi { font-weight: 700; }
.pop-opt.choisi svg.i { color: var(--accent); stroke-width: 2.6; }
.pop-opt.off { opacity: .4; cursor: not-allowed; }
.pop-opt[hidden] { display: none; }
.pop-groupe { padding: 10px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.pop-cherche { padding: 4px 4px 8px; }
.pop-cherche input { width: 100%; height: 38px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--field); padding: 0 12px; font-size: 13px; color: var(--ink); outline: none; }
.pop-date { width: 300px; padding: 14px; }
.cal-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-tete b { font-family: var(--display); font-size: 15px; font-weight: 700; text-transform: capitalize; }
.cal-nav { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--card-2); color: var(--ink); display: grid; place-items: center; cursor: pointer;
  transition: background .2s, transform .3s var(--spring); }
.cal-nav:hover { background: var(--card-3); transform: scale(1.06); }
.cal-jours, .cal-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-jours span { font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 4px 0; }
.cal-grille button { height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .25s var(--spring); font-variant-numeric: tabular-nums; }
.cal-grille button:hover:not(:disabled) { background: var(--card-2); transform: scale(1.08); }
.cal-grille button.auj { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.cal-grille button.choisi { background: var(--black); color: var(--on-black); box-shadow: none; }
.cal-grille button:disabled { opacity: .25; cursor: not-allowed; }
.cal-pied { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.cal-pied button { border: 0; background: none; color: var(--ink-2); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 6px 10px; border-radius: var(--pill); }
.cal-pied button:hover { background: var(--card-2); color: var(--ink); }

/* cases à cocher et boutons radio */
input[type="checkbox"], input[type="radio"] { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; flex-shrink: 0;
  border: 1.5px solid var(--line-2); background: var(--field); cursor: pointer; display: inline-grid; place-items: center; vertical-align: middle;
  transition: background .2s, border-color .2s, transform .25s var(--spring); }
input[type="checkbox"] { border-radius: 7px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--ink-3); }
input[type="checkbox"]:checked { background: var(--accent-fort); border-color: var(--accent-fort); }
input[type="checkbox"]:checked::after { content: ""; width: 12px; height: 12px; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: check-in .35s var(--spring); }
input[type="radio"]:checked { border-color: var(--accent-fort); }
input[type="radio"]:checked::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-fort); animation: check-in .35s var(--spring); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"]:active, input[type="radio"]:active { transform: scale(.9); }
.switch input[type="checkbox"] { appearance: auto; width: 0; height: 0; border: 0; opacity: 0; }
.switch input[type="checkbox"]::after { display: none; }

/* nombres sans flèches, fichiers en bouton maison */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="file"]:not([hidden]) { font-size: 13px; color: var(--ink-2); }
input[type="file"]::file-selector-button { height: 38px; padding: 0 16px; margin-right: 12px; border-radius: var(--pill); border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); font-family: var(--text); font-weight: 600; font-size: 12.5px; cursor: pointer; transition: background .2s; }
input[type="file"]::file-selector-button:hover { background: var(--card-3); }
input::-webkit-calendar-picker-indicator { display: none; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, select:-webkit-autofill {
  -webkit-text-fill-color: var(--ink); caret-color: var(--ink); box-shadow: 0 0 0 1000px var(--field) inset !important; transition: background-color 9999s; }
input, textarea { caret-color: var(--accent); }

/* barres de défilement */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card-3); border-radius: var(--pill); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* infobulles */
.bulle { position: fixed; z-index: 500; max-width: 280px; padding: 7px 12px; border-radius: 12px; background: var(--verre-fort); -webkit-backdrop-filter: var(--verre-flou); backdrop-filter: var(--verre-flou); color: var(--ink); box-shadow: var(--verre-filet), var(--sh-float);
  font-size: 12px; font-weight: 600; line-height: 1.4; pointer-events: none; opacity: 0; transform: translateY(3px); transition: opacity .15s, transform .25s var(--spring); }
.bulle.on { opacity: 1; transform: none; }

/* erreurs de saisie */
.err, .input.err { border-color: var(--danger) !important; box-shadow: 0 0 0 4px var(--danger-soft) !important; }
.field-err { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--danger); animation: rise .3s var(--ease-out) both; }
.field-err::before { content: "!"; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.secoue { animation: secoue .4s var(--ease); }
@keyframes secoue { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

/* =============================================================================
   AUTHENTIFICATION — Sophystia accueille, carte de connexion à droite
   ============================================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); }
/* scène de Sophystia : le dégradé bleu de la marque (ciel → blanc) */
.auth-scene { position: relative; overflow: hidden; background: #0B5FD6; border-right: 0;
  background-image: radial-gradient(70% 55% at 45% 30%, rgba(255, 255, 255, .22), transparent 70%),
                    radial-gradient(60% 50% at 90% 100%, rgba(234, 242, 253, .5), transparent 70%),
                    linear-gradient(160deg, #0B5FD6 0%, #1D7BF5 50%, #8DBBF7 100%); }
.auth-marque { position: absolute; top: 34px; left: 40px; display: flex; align-items: center; gap: 14px; z-index: 3; color: #fff; }
.auth-marque .wm-txt { background: #fff; height: 16px; }
.auth-logo { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); display: grid; place-items: center;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.auth-soph { position: absolute; bottom: -2%; left: 50%; height: 88%; max-height: 900px; transform: translateX(-50%); z-index: 2;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .6)); animation: soph-entree 1.1s var(--ease-out) both .1s; }
@keyframes soph-entree { from { opacity: 0; transform: translate(-50%, 40px) scale(.97); } }
.auth-halo { position: absolute; left: 50%; bottom: 0; width: 70%; height: 22%; transform: translateX(-50%); z-index: 1;
  background: radial-gradient(50% 60% at 50% 100%, rgba(255, 255, 255, .35), transparent 70%); filter: blur(10px); }
.auth-bulle { position: absolute; z-index: 3; top: 15%; left: calc(50% + 70px); max-width: min(300px, calc(50% - 90px)); padding: 16px 20px; border-radius: 22px 22px 22px 6px;
  background: #fff; color: #0B0B0F; font-family: var(--display); font-size: 17px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em;
  box-shadow: 0 24px 50px -16px rgba(8, 40, 100, .55); opacity: 0; }
.auth-bulle.on { animation: bulle-in .7s var(--spring) both .55s; }
@keyframes bulle-in { from { opacity: 0; transform: translateY(14px) scale(.9); transform-origin: left bottom; } to { opacity: 1; transform: none; } }
.auth-panneau { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 28px; gap: 22px; background: var(--bg); }
.auth-carte { width: 100%; max-width: 420px; }
.auth-carte.entre > * { animation: rise .6s var(--ease-out) both; }
.auth-carte.entre > *:nth-child(2) { animation-delay: .05s; } .auth-carte.entre > *:nth-child(3) { animation-delay: .1s; }
.auth-carte.entre > *:nth-child(4) { animation-delay: .15s; } .auth-carte.entre > *:nth-child(5) { animation-delay: .2s; }
.auth-carte.sortie { animation: auth-sortie .45s var(--ease) forwards; }
@keyframes auth-sortie { to { opacity: 0; transform: scale(.97) translateY(-8px); filter: blur(6px); } }
.auth-mark { width: 52px; height: 52px; border-radius: 50%; background: var(--black); border: 0; display: grid; place-items: center; color: var(--on-black); margin-bottom: 26px; }
.auth-mark .logo-sym { width: 30px; height: 30px; }
.auth h1 { font-family: var(--display); font-size: 40px; font-weight: 700; letter-spacing: -.03em; margin: 0 0 8px; line-height: 1.05; }
.auth-sous { color: var(--ink-2); margin: 0 0 24px; font-size: 14.5px; }
.auth-onglets { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--pill); background: var(--card-3); border: 0; margin-bottom: 22px; }
.auth-onglets button { position: relative; z-index: 1; height: 40px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 13.5px; cursor: pointer;
  border-radius: var(--pill); transition: color .3s; }
.auth-onglets button.on { color: var(--on-black); }
.auth-glisse { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: var(--pill); background: var(--black); transition: transform .5s var(--spring); }
.auth-onglets button.on:last-of-type ~ .auth-glisse { transform: translateX(100%); }
.auth-form { gap: 14px; }
.auth-go { width: 100%; height: 52px; margin-top: 6px; font-size: 14.5px; }
.auth-go.ok { background: var(--green); color: #fff; }
.auth-plus-tard { width: 100%; margin-top: 10px; }
.auth-rester { font-size: 13px; color: var(--ink-2); }
.auth-erreur { min-height: 22px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--danger); text-align: center; }
.auth-pied { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.auth-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 17px; letter-spacing: .14em; text-transform: uppercase; }
.auth-invit { min-height: 26px; margin-top: 6px; }
.mdp { position: relative; }
.mdp .input { padding-right: 50px; }
.mdp-voir { position: absolute; right: 6px; top: 7px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3);
  display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s; }
.mdp-voir:hover { background: var(--card-3); color: var(--ink); }
.maj-active { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--amber); }
.force { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 5px; align-items: center; margin-top: 8px; }
.force i { height: 5px; border-radius: 5px; background: var(--card-3); transition: background .3s; }
.force span { font-size: 11.5px; font-weight: 700; color: var(--ink-3); min-width: 74px; text-align: right; }
.force[data-n="0"] i:nth-child(-n+1) { background: var(--danger); }
.force[data-n="1"] i:nth-child(-n+1) { background: var(--danger); }
.force[data-n="2"] i:nth-child(-n+2) { background: var(--amber); }
.force[data-n="3"] i:nth-child(-n+3) { background: var(--accent-2); }
.force[data-n="4"] i:nth-child(-n+4) { background: var(--accent); }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }              /* jamais plus large que l'écran */
  .auth-panneau { min-width: 0; padding: 32px 20px; }
  .auth-carte .btn { white-space: normal; }
  .auth-scene { display: none; }
  .auth h1 { font-size: 34px; }
}

/* invitations (Mon entreprise) */
.invit-code { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r-md); background: var(--card-2); margin: 10px 0; }
.invit-code code { font-size: 18px; letter-spacing: .14em; background: none; padding: 0; color: var(--ink); font-weight: 700; flex: 1; }
.invit-lien { font-size: 12px; color: var(--ink-3); word-break: break-all; }

/* =============================================================================
   BUREAU — fichiers enregistrés, mises à jour, accès en ligne
   ============================================================================= */
.toast.fichier { padding: 8px 8px 8px 10px; gap: 12px; }
.toast.fichier span { display: flex; flex-direction: column; line-height: 1.3; max-width: 260px; }
.toast.fichier b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.fichier small { font-size: 11.5px; opacity: .6; font-weight: 600; }
.toast.fichier button { height: 32px; padding: 0 13px; border-radius: var(--pill); border: 0; background: color-mix(in srgb, var(--on-black) 10%, transparent);
  color: inherit; font: 700 12px var(--text); cursor: pointer; transition: background .2s; }
.toast.fichier button:hover { background: color-mix(in srgb, var(--on-black) 18%, transparent); }
.toast .spin { margin: 0 4px; }
.maj-pill { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px; border-radius: var(--pill); border: 0; cursor: pointer;
  background: var(--accent-fort); color: #fff; font: 700 12.5px var(--text); animation: rise .6s var(--ease-out) both, maj-pouls 2.6s var(--ease) 1s infinite; }
@keyframes maj-pouls { 0%, 70%, 100% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0); } 35% { box-shadow: 0 0 0 7px rgba(0, 113, 227, .18); } }
.maj-corps { display: flex; gap: 18px; align-items: flex-start; }
.maj-soph { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--accent); }
.maj-notes { padding: 12px 14px; border-radius: var(--r-md); background: var(--card-2); font-size: 13px; color: var(--ink-2); max-height: 180px; overflow: auto; }
.maj-prog { margin-top: 14px; }
.prog-maj { height: 8px; border-radius: var(--pill); background: var(--card-3); overflow: hidden; margin-bottom: 6px; }
.prog-maj i { display: block; height: 100%; width: 0; border-radius: var(--pill); transition: width .3s var(--ease-out);
  background: var(--accent); }
.etapes { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 4px; }
.etape-ligne { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: var(--r-md); transition: background .2s; }
.etape-ligne:hover { background: var(--card-2); }
.etape-ligne b { font-size: 13.5px; }
.etape-ligne a { text-decoration: underline; }
.etape-pt { width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed var(--line-2); flex-shrink: 0; display: grid; place-items: center; }
.etape-ligne.faite .etape-pt { border: 0; background: var(--black); color: var(--on-black); }
.etape-ligne.faite .etape-pt svg.i { stroke-width: 2.8; width: 14px; height: 14px; }

/* mode nuit : la boîte de Sophystia n'éclaire plus sous la souris */
:root:not([data-theme="light"]) .ask::after { display: none; }

/* boutons icône qui se déplient au survol (Loi, Fait…) : interface plus légère */
.btn-deplie { display: inline-flex; align-items: center; height: 36px; min-width: 36px; padding: 0 10px; gap: 0; border-radius: var(--pill); border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink-2); cursor: pointer; overflow: hidden; white-space: nowrap; font: 600 12.5px var(--text);
  transition: gap .35s var(--spring), padding .35s var(--spring), background .2s, color .2s, border-color .2s; }
.btn-deplie span { max-width: 0; opacity: 0; transition: max-width .4s var(--spring), opacity .25s; }
.btn-deplie:hover, .btn-deplie:focus-visible { gap: 7px; padding: 0 14px 0 11px; background: var(--card-2); color: var(--ink); }
.btn-deplie:hover span, .btn-deplie:focus-visible span { max-width: 140px; opacity: 1; }
.btn-deplie.ok:hover { background: var(--black); color: var(--on-black); border-color: transparent; }

/* retour en haut à gauche (fiches) */
.retour { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 10px; margin: 0 0 14px; border-radius: var(--pill);
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); font: 600 13px var(--text); cursor: pointer;
  transition: background .2s, color .2s; }
.retour:hover { background: var(--card-2); color: var(--ink); }

/* graphiques : cliquables, plein écran */
.card.graphe { cursor: zoom-in; }
.card.graphe .agrandir { width: 34px; height: 34px; }
.plein-ecran { position: fixed; inset: 0; z-index: 450; display: grid; place-items: center; padding: 3vh 3vw;
  background: rgba(0, 0, 0, .5); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); animation: fade .25s var(--ease); }
:root[data-theme="light"] .plein-ecran { background: rgba(11, 12, 15, .26); }
.plein-ecran.off { opacity: 0; transition: opacity .22s; }
.pe-carte { width: 100%; height: 100%; max-width: 1600px; display: flex; flex-direction: column; background: var(--card); border: 0;
  border-radius: var(--r-xl); box-shadow: var(--sh-float); padding: 26px 30px; animation: modal-in .55s var(--spring); }
.pe-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.pe-tete h2 { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin: 0; }
.pe-corps { flex: 1; min-height: 0; display: flex; }
.bars.grand { flex: 1; height: auto; gap: 3%; padding: 10px 1% 0; }
.bars.grand .bar { max-width: 140px; border-radius: 22px; cursor: pointer; transition: filter .2s, transform .35s var(--spring); }
.bars.grand .bar:hover { filter: brightness(1.25); transform: scaleX(1.04); }
.bars.grand .bar-val { font-size: 16px; }
.bars.grand .bar-lbl { font-size: 14px; font-weight: 600; }

/* =============================================================================
   VERSION MOBILE — iPhone / Android (application installable, ≤ 820 px)
   ============================================================================= */
.tabbar { display: none; }
/* éléments propres au téléphone (affichés par css/mobile.css, chargée sous 820 px) */
.m-seul { display: none; }
.m-txt { display: contents; }                 /* texte masqué sur téléphone (plus court) */
@media (max-width: 820px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
  .main { padding: 0 14px calc(104px + env(safe-area-inset-bottom)); }
  .topbar { padding: calc(10px + env(safe-area-inset-top)) 0 10px; gap: 8px; flex-wrap: nowrap; }
  .topbar::before { left: -14px; right: -14px; }
  .navpill { display: none; }                       /* remplacée par la barre d'onglets */
  .wordmark .wm-col { display: none; }
  .wordmark .wm-sym { display: block; width: 34px; height: 34px; }
  .hdr-right { gap: 6px; }
  .hdr-reglages { display: none; }                  /* réglages : volet « Plus » */
  .circle, .avatar { width: 42px; height: 42px; }
  .ro-pill { display: none !important; }
  .demo-banner { font-size: 12px; padding: 10px 12px; border-radius: var(--r-md); }
  .demo-banner .actions { width: 100%; margin: 4px 0 0; justify-content: flex-end; }
  .page-head { margin: 14px 0 16px; }
  .page-head h1, .hello h1 { font-size: 32px; }
  .hello { margin: 14px 0 14px; }
  .hello p { font-size: 15px; }
  .subnav, .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -14px; margin-right: -14px; padding: 0 14px; }
  .subnav::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .subnav a, .tab { flex-shrink: 0; }
  .g-3, .g-main, .g-editor, .block.two { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 16px; }
  .kpi-value { font-size: 30px; margin-top: 12px; }
  .card-head { padding: 18px 16px 4px; }
  .card-body { padding: 12px 16px 18px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .task:hover, a.kpi:hover, .card:hover { transform: none; }
  /* la boîte de Sophystia */
  .ask { padding: 16px; border-radius: 26px; }
  .ask-qui .faint { display: none; }
  .ask-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 12px -16px 0; padding: 0 16px; }
  .ask-chips::-webkit-scrollbar { display: none; }
  .ask-chips .glass-chip { flex-shrink: 0; }
  .ask-drop { display: none; }
  /* champs : 16 px minimum, sinon iOS zoome à chaque saisie */
  .input, select.input, textarea.input, .ask-row input, .pop-cherche input, .champ { font-size: 16px; }
  .input { height: 50px; }
  .btn { height: 48px; }
  .btn-sm { height: 40px; }
  /* tableaux : chaque ligne devient une carte */
  .table-wrap { overflow: visible; }
  table.t, .t tbody, .t tr, .t td { display: block; width: 100%; }
  .t thead { display: none; }
  .t tbody tr { background: var(--card-2); border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 8px; }
  .t tbody tr td { border: 0 !important; padding: 5px 0; display: flex; justify-content: space-between; gap: 14px; text-align: right; }
  .t tbody tr td::before { content: attr(data-label); color: var(--ink-3); font-size: 12px; font-weight: 600; text-align: left; flex-shrink: 0; }
  .t tbody tr td:not([data-label])::before, .t tbody tr td[data-label=""]::before { content: none; }
  .t tbody tr td:first-child { font-weight: 700; font-size: 14.5px; }
  .t tbody tr.click:hover td { background: transparent; }
  /* fenêtres : volets qui montent du bas */
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: 28px 28px 0 0; max-height: 92vh; overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom); animation: volet-in .45s var(--ease-out); }
  .modal-head { padding: 22px 20px 4px; }
  .modal-body { padding: 14px 20px 20px; }
  .modal-foot { padding: 12px 16px 18px; position: sticky; bottom: 0; background: var(--card); }
  .modal-foot .btn { flex: 1; }
  /* listes déroulantes et calendrier : en volet, au pouce */
  .pop { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)); min-width: 0 !important;
    width: auto !important; --r-parent: 24px; border-radius: var(--r-parent); transform: translateY(20px); transform-origin: bottom center; }
  .pop.on { transform: none; }
  .pop-liste { max-height: 55vh; }
  .pop-opt { padding: 14px; font-size: 15px; }
  .pop-date { padding: 16px; }
  .cal-grille button { height: 44px; }
  /* barre d'onglets */
  .tabbar { position: fixed; z-index: 60; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 68px;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 0 6px; border-radius: var(--pill);
    background: color-mix(in srgb, var(--panel) 86%, transparent); border: 1px solid var(--line-2);
    backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: var(--sh-float); }
  :root[data-theme="light"] .tabbar { background: color-mix(in srgb, var(--card) 86%, transparent); }
  .tab-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 56px; border: 0; background: none;
    color: var(--ink-2); font: 600 10.5px var(--text); border-radius: var(--pill); cursor: pointer; transition: color .2s, background .2s; }
  .tab-item svg.i { width: 22px; height: 22px; }
  .tab-item.on { color: var(--ink); }
  .tab-item.on svg.i { color: var(--ink); }
  .tab-item:active { background: rgba(255, 255, 255, .06); }
  .tab-soph { justify-self: center; width: 58px; height: 58px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center;
    box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent), 0 14px 30px -8px rgba(0, 0, 0, .7); transition: transform .3s var(--spring); }
  .tab-soph img { width: 100%; height: 100%; border-radius: 50%; }
  .tab-soph:active { transform: scale(.92); }
  #toasts { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .plein-ecran { padding: 0; }
  .pe-carte { border-radius: 0; padding: calc(16px + env(safe-area-inset-top)) 14px 16px; }
  .bars.grand .bar-val { font-size: 12px; }
  .lines .line { grid-template-columns: 1fr 1fr; padding: 12px; border-radius: var(--r-md); background: var(--card-2); }
  .lines .line > :first-child { grid-column: 1 / -1; }
  .sticky-side { position: static; }
  .retour { margin-top: 4px; }
}
/* écrans tactiles : pas de survol, les boutons « Loi », « Fait »… montrent leur libellé */
@media (hover: none) {
  .btn-deplie { gap: 7px; padding: 0 14px 0 11px; }
  .btn-deplie span { max-width: 140px; opacity: 1; }
}
/* volet « Plus » */
.volet-fond { position: fixed; inset: 0; z-index: 300; background: rgba(5, 5, 6, 0); transition: background .3s; display: flex; align-items: flex-end; }
.volet-fond.on { background: rgba(0, 0, 0, .3); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); }
.volet { width: 100%; background: var(--card); border-radius: 28px 28px 0 0; padding: 8px 14px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .45s var(--ease-out); box-shadow: var(--sh-float); max-height: 88vh; overflow-y: auto; }
.volet-fond.on .volet { transform: none; }
.volet-poignee { width: 40px; height: 5px; border-radius: 5px; background: var(--card-3); margin: 4px auto 14px; }
.volet-qui { display: flex; align-items: center; gap: 12px; padding: 4px 6px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.volet-liste a { display: flex; align-items: center; gap: 14px; padding: 13px 8px; border-radius: var(--r-md); color: var(--ink); }
.volet-liste a:active { background: var(--card-2); }
.volet-liste a > svg.i:first-child { width: 22px; height: 22px; color: var(--ink-2); }
.volet-liste a span { flex: 1; display: flex; flex-direction: column; }
.volet-liste a small { font-size: 12px; color: var(--ink-3); }
.volet-liste a > svg.i:last-child { color: var(--ink-3); }
.volet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.volet-actions button { height: 50px; border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  font: 600 14px var(--text); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
@keyframes volet-in { from { transform: translateY(100%); } }

/* mémoire de l'entreprise : détail chiffré sous la réponse de Sophystia */
.donnees { margin-top: 12px; border-radius: var(--r-md); background: var(--card-2); padding: 4px; }
.donnee { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border-radius: 13px; color: var(--ink);
  transition: background .15s; }
a.donnee:hover { background: var(--card-3); }
.donnee span:first-child { display: flex; flex-direction: column; min-width: 0; }
.donnee small { font-size: 12px; color: var(--ink-3); }
.donnee .num { font-weight: 700; white-space: nowrap; }
.donnee.total { border-top: 1px solid var(--line); border-radius: 0; margin-top: 2px; font-weight: 700; }

/* Documents : dépôt dans chaque catégorie, glisser-déposer */
.doc-depot { display: flex; align-items: center; gap: 8px; margin: 6px 12px 12px; padding: 10px 14px; border-radius: 14px; cursor: pointer;
  border: 1.5px dashed var(--line-2); color: var(--ink-2); font-size: 13px; font-weight: 600; transition: border-color .2s, background .2s; }
.doc-depot:hover { border-color: var(--accent); background: var(--accent-soft); }
.doc-cat.survol { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-icon { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); display: inline-grid; place-items: center;
  cursor: pointer; flex-shrink: 0; transition: background .2s, color .2s; }
.btn-icon:hover { background: var(--card-2); color: var(--ink); }

/* Choix segmenté (filtres, Apparence) : rail gris, choix en pilule blanche, compteurs discrets */
.segment { display: inline-flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; gap: 2px; padding: 3px; border-radius: var(--pill); background: var(--card-3); border: 0; }
.subnav > a, .segment > button, .segment > a { flex-shrink: 0; white-space: nowrap; }  /* capsule sur une ligne : on défile, on ne replie pas */
.segment button, .segment a { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: var(--pill);
  background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.segment button:hover, .segment a:hover { color: var(--ink); }
.segment button.on, .segment a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .14), 0 0 0 .5px rgba(16, 24, 40, .05); }
:root:not([data-theme="light"]) .segment button.on, :root:not([data-theme="light"]) .segment a.on { background: #3A3B42; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }

/* Visite guidée */
#visite { position: fixed; right: 24px; bottom: 24px; z-index: 420; width: min(420px, calc(100vw - 32px)); background: var(--card); color: var(--ink);
  border: 0; border-radius: var(--r-xl); padding: 20px 22px 18px; box-shadow: var(--sh-float); animation: visite-in .5s var(--ease-out); }
@keyframes visite-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.visite-tete { display: flex; align-items: center; gap: 12px; }
.visite-tete img { border-radius: 50%; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.visite-tete div { flex: 1; min-width: 0; }
.visite-tete b { display: block; font-family: var(--display); font-size: 17px; letter-spacing: -.01em; }
.visite-tete span { font-size: 12px; color: var(--ink-3); }
.visite-x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--card-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.visite-barre { height: 4px; border-radius: 4px; background: var(--card-2); margin: 14px 0 12px; overflow: hidden; }
.visite-barre i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s var(--ease-out); }
#visite p { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); margin: 0 0 12px; }
.visite-ok { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--green); margin-bottom: 12px; }
.visite-liste { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.visite-liste li { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 12px; border-radius: 12px; background: var(--card-2); color: var(--ink-2); }
.visite-liste li span { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.visite-liste li.on { color: var(--ink); }
.visite-liste li.on svg { color: var(--green); }
.visite-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.visite-cible { position: relative; z-index: 5; outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 22px; animation: visite-pulse 1.8s var(--ease) infinite; }
@keyframes visite-pulse { 50% { outline-color: color-mix(in srgb, var(--accent) 30%, transparent); } }
.visite-reprise { position: fixed; right: 24px; bottom: 24px; z-index: 410; display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: 600 14px/1 var(--body, inherit); box-shadow: var(--sh-float); cursor: pointer; }
.visite-reprise img { border-radius: 50%; }
@media (max-width: 760px) { #visite { right: 12px; left: 12px; width: auto; bottom: calc(92px + env(safe-area-inset-bottom)); } .visite-reprise { bottom: calc(92px + env(safe-area-inset-bottom)); right: 12px; } }
.carte-paiement { display: inline-grid; place-items: center; min-width: 64px; height: 40px; padding: 0 10px; border-radius: 8px; background: var(--black); color: var(--on-black); font-weight: 700; font-size: 12px; }
.offre-app.reco { outline: 2px solid var(--accent); }

/* Sécurité de connexion */
.auth-cle { width: 100%; margin-top: 10px; }
.auth-modes { gap: 10px; margin-top: 8px; }

/* tuile d'un mode de connexion : encre et gris, jauge de protection, sélection par un filet noir */
.mode-tuile { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; text-align: left; padding: 18px 18px 16px;
  border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: inherit; cursor: pointer;
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease), transform .25s var(--spring); }
.mode-tuile:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.mode-tuile:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mode-tuile.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 14px 30px -22px rgba(0, 0, 0, .45); }
.mode-tuile.off { cursor: default; opacity: .5; transform: none; border-style: dashed; }
.mt-haut { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.mt-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line); color: var(--ink); }
.mt-ico svg.i { width: 20px; height: 20px; stroke-width: 1.6; }
.mode-tuile.on .mt-ico { background: var(--black); color: var(--on-black); border-color: transparent; }
.mt-reco { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); padding: 4px 9px;
  border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--card-2); }
.mt-radio { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--card); flex-shrink: 0;
  transition: border-color .2s, box-shadow .2s; }
.mode-tuile.on .mt-radio { border-color: var(--ink); box-shadow: inset 0 0 0 4px var(--card), inset 0 0 0 10px var(--ink); }
.mt-titre { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.mt-texte { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); flex: 1; }
.mt-niveau { display: flex; align-items: center; gap: 8px; padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--line); }
.mt-raison { font-size: 11.5px; color: var(--ink-3); }
.jauge { display: inline-flex; gap: 3px; }
.jauge i { width: 16px; height: 4px; border-radius: 2px; background: var(--line-2); }
.jauge[data-n="1"] i:nth-child(-n+1), .jauge[data-n="2"] i:nth-child(-n+2), .jauge[data-n="3"] i { background: var(--ink); }
.jauge-txt { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.auth-modes .mode-tuile { padding: 14px 16px; }
.auth-modes .mt-texte { font-size: 12px; }

/* page Sécurité */
.secu-etat { display: flex; align-items: center; gap: 18px; padding: 22px 24px; flex-wrap: wrap; }
.secu-etat-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--black); color: var(--on-black); flex-shrink: 0; }
.secu-etat-ico svg.i { width: 26px; height: 26px; stroke-width: 1.6; }
.secu-etat-txt { display: grid; gap: 6px; flex: 1; min-width: 220px; }
.secu-etat-titre { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.secu-etat-note { display: flex; gap: 8px; align-items: flex-start; max-width: 320px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--card-2); }
.secu-etat-note svg.i { flex-shrink: 0; margin-top: 2px; }
.secu-titre { margin: 28px 0 12px; }
.secu-modes { align-items: stretch; }
.secu-cle { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.secu-cle:last-child { border-bottom: 0; }
.secu-cle-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line); flex-shrink: 0; }
.secu-vide { display: flex; gap: 18px; align-items: flex-start; padding: 22px 24px; }
.secu-vide p { margin: 4px 0 14px; max-width: 520px; }
.secu-vide-ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line); flex-shrink: 0; }
.secu-vide-ico svg.i { width: 24px; height: 24px; stroke-width: 1.6; }
.secu-aide { display: flex; gap: 6px; align-items: center; margin-top: 12px; }

.visite-image { display: block; width: 150px; height: auto; margin: 4px auto 10px; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .18)); }

/* réglages de l'application */
.hdr-reglages { flex-shrink: 0; color: var(--ink); }
.lien-reglages { display: block; color: inherit; text-decoration: none; transition: background .2s; }
.lien-reglages:hover { background: var(--card-2); }
.reglages .card-head h3 svg.i { margin-right: 6px; vertical-align: -3px; }

/* Windows « Contraste élevé » (thèmes de contraste) : les couleurs sont imposées par Windows,
   on garde des repères visibles (onglet actif encadré, graphique lisible) */
@media (forced-colors: active) {
  .nav-glider { display: none; }
  .navpill a.active, .subnav a.active, .tab.active, .segment button.on { outline: 2px solid Highlight; outline-offset: -2px; }
  .bars.signe .bar { forced-color-adjust: none; }
  .badge, .btn, .icon-btn, .avatar, .rail-btn { border: 1px solid CanvasText; }
}
.hdr-reglages.on { background: var(--black); color: var(--on-black); border-color: transparent; }

/* personnalisation des factures */
.logo-apercu { width: 168px; height: 64px; border-radius: var(--r-sm); border: 1px dashed var(--line-2); background: #fff;
  display: grid; place-items: center; overflow: hidden; padding: 6px; }
.logo-apercu img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pastille-couleur { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--card); background: var(--c);
  box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; transition: transform .25s var(--spring), box-shadow .2s; padding: 0; }
.pastille-couleur:hover { transform: scale(1.08); }
.pastille-couleur.on { box-shadow: 0 0 0 2px var(--ink); }
.perso-libre { background: conic-gradient(#e5484d, #f5a524, #46a758, #3e63dd, #8e4ec6, #e5484d); }
.perso-libre.on { background: var(--c); }
.perso-libre input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
@media (max-width: 820px) {   /* graphique du solde sur téléphone : une valeur sur deux, colonnes resserrées */
  .bars.signe .bar-col { padding: 0 2px; }
  .bars.signe .bar-val { font-size: 9.5px; }
  .bars.signe .bar-col:nth-child(even) .bar-val { visibility: hidden; }
  .bars.signe .bar-lbl { font-size: 10px; }
}

/* échéancier : calendrier mensuel */
.seg button svg.i { margin-right: 6px; vertical-align: -3px; }
.ech-mois { font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -.02em; min-width: 150px; text-align: center; }
.ech-cal { padding: 0; overflow: hidden; }
.ech-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ech-entete div { padding: 12px 12px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.ech-case { min-height: 112px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ech-case:nth-child(7n) { border-right: 0; }
.ech-case.vide { background: var(--card-2); opacity: .5; }
.ech-case.we { background: color-mix(in srgb, var(--card-2) 55%, var(--card)); }
.ech-case.passe .ech-num { color: var(--ink-3); }
.ech-num { font-size: 12.5px; font-weight: 700; color: var(--ink-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.ech-case.auj .ech-num { background: var(--black); color: var(--on-black); }
.ech-evt { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 7px; border: 0; border-radius: 8px; background: var(--card-2); color: var(--ink);
  font: inherit; font-size: 11.5px; font-weight: 600; text-align: left; cursor: pointer; transition: background .2s, transform .2s var(--spring); }
.ech-evt:hover { background: var(--card-3); transform: translateY(-1px); }
.ech-evt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ech-evt i, .ech-leg i { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--ink-3); display: inline-block; }
.ech-evt.fiscal i, .ech-leg i.fiscal { background: var(--accent); }
.ech-evt.social i, .ech-leg i.social { background: var(--ink); }
.ech-evt.fait { opacity: .5; } .ech-evt.fait span { text-decoration: line-through; }
.ech-leg { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 820px) {
  .ech-case { min-height: 64px; padding: 4px; }
  .ech-entete div { padding: 8px 4px; font-size: 10px; text-align: center; }
  .ech-evt { padding: 3px; justify-content: center; } .ech-evt span { display: none; } .ech-evt i { width: 8px; height: 8px; }
  .ech-num { margin: 0 auto; }
  .ech-mois { min-width: 0; font-size: 16px; }
}

/* « Scanner une facture » pendant la lecture : on ne relance pas un second envoi */
#scanner.occupe { pointer-events: none; opacity: .75; }
#scanner .scan-ico { display: inline-flex; }

/* choix de la banque à connecter (Connexions) */
.ligne-banque { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 8px; border: 0; border-radius: 12px;
  background: none; color: var(--ink); font: 600 14.5px var(--text, inherit); text-align: left; cursor: pointer; }
.ligne-banque:hover, .ligne-banque:active { background: var(--field, rgba(0,0,0,.05)); }
.ligne-banque img, .ligne-banque .bq-ini { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; background: #fff; flex-shrink: 0; }
.ligne-banque .bq-ini { display: grid; place-items: center; background: var(--field, #eee); color: var(--ink-2); font-weight: 700; }

/* =============================================================================
   SOPHYSTIA — panneau de conversation sur toutes les pages (sophystia.js)
   ============================================================================= */
.sp-lanceur { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px 0 6px;
  border-radius: 999px; border: 0; background: var(--verre); -webkit-backdrop-filter: var(--verre-flou); backdrop-filter: var(--verre-flou); color: var(--ink); font: 600 14px var(--text, inherit);
  box-shadow: var(--verre-filet), var(--sh-float); cursor: pointer; padding-right: 11px; transition: opacity .15s, transform .15s; }
.sp-lanceur:hover { transform: translateY(-1px); }
.sp-lanceur img { width: 36px; height: 36px; border-radius: 50%; }
.sp-lanceur kbd, .sp-barre-k { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; font: 600 11.5px var(--text); color: var(--ink-3); border: 0; border-radius: var(--pill); background: var(--card-3); }
html.sp-ouvert .sp-lanceur { opacity: 0; pointer-events: none; }
/* panneau de conversation : voir css/sophystia.css */
/* accueil : la barre « Demander à Sophystia » (ouvre le panneau ; on peut y glisser un document) */
.sp-barre { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 8px 8px 8px; border: 0; border-radius: 999px;
  background: var(--card); color: var(--ink); cursor: text; text-align: left; margin: 2px 0 28px; box-shadow: var(--sh-card); font: inherit; transition: box-shadow .2s; }
.sp-barre:hover { box-shadow: var(--sh-float); }
.sp-barre img { width: 40px; height: 40px; border-radius: 50%; }
.sp-barre-t { flex: 1; font-size: 15px; font-weight: 600; }
.sp-barre .sp-barre-k { margin-right: 7px; }   /* même marge (15 px) au-dessus, en dessous et à droite */
.sp-barre-t .faint { font-weight: 500; }
.sp-barre.over { outline: 2px dashed var(--accent); outline-offset: 3px; }

/* =============================================================================
   NOUVELLE IDENTITÉ (01/12) — signature et composants communs ajoutés
   ============================================================================= */
/* Carte HÉROS au dégradé bleu : une ou deux par écran au plus, texte blanc, grand chiffre en points (js/points.js).
   Elle redéfinit pour son contenu l'encre « sur noir » et le repère des cinq niveaux, pour rester lisible sur le bleu. */
.heros-bleu { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r-xl); background: var(--degrade-heros); color: #fff;
  box-shadow: 0 24px 50px -28px rgba(11, 95, 214, .65); --on-black: #fff; --nv-accent: #fff; }
.heros-bleu::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 80% at 18% 0%, rgba(255, 255, 255, .22), transparent 60%), radial-gradient(40% 60% at 70% 120%, rgba(255, 255, 255, .25), transparent 70%); }
.heros-bleu .nv-fait { background: rgba(255, 255, 255, .72); }
.heros-bleu a:not(.btn) { color: #fff; }
/* variante sobre : panneau blanc légèrement teinté de ciel, chiffre en points noir */
.heros-ciel { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r-xl); background: var(--card); color: var(--ink); box-shadow: var(--sh-card); }
.heros-ciel::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--degrade-ciel); opacity: .9; }
/* chiffre en matrice de points : points allumés pleins (couleur du texte), points éteints très pâles.
   Hauteur voulue --h-pts ; la largeur suit le rapport du dessin (--r, posé par points.js) et se réduit pour tenir dans la carte. */
svg.points { display: block; width: calc(var(--h-pts, 64px) * var(--r, 4)); max-width: 100%; height: auto; overflow: visible; }
svg.points .eteint { opacity: .16; }
.heros-ciel svg.points .eteint { opacity: .09; }
.heros-n { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.heros-n svg.points { flex: 0 1 auto; min-width: 0; color: inherit; }
.heros-n .nv { flex: none; margin: 2px 0 0 !important; vertical-align: 0 !important; }
.heros-n .heros-u { flex: none; align-self: flex-end; margin: 0 0 -3px -2px; font: 600 20px/1 var(--display); opacity: .78; letter-spacing: 0; }
.heros-bleu svg.points { color: #fff; }
/* variante alerte (solde négatif…) : le même héros, en rouge */
.heros-bleu.heros-alerte { background: radial-gradient(70% 120% at 100% 0%, rgba(255, 220, 220, .35), transparent 62%), linear-gradient(115deg, #B4232A 0%, #E5484D 100%);
  box-shadow: 0 24px 50px -28px rgba(180, 35, 42, .6); }
/* dans un héros : l'action principale devient une pilule blanche, les textes secondaires restent lisibles */
.heros-bleu .btn-primary, .heros-bleu .btn-lime { background: #fff; color: #0B0B0F; }
.heros-bleu .muted, .heros-bleu .faint { color: rgba(255, 255, 255, .82); }

/* les deux premiers héros (passe 1) : solde du jour (Trésorerie › Vue d'ensemble) et « N décisions à prendre » (À valider) */
.heros-bleu.heros-bleu { border-radius: var(--r-xl); background: var(--degrade-heros); color: #fff; box-shadow: 0 24px 50px -28px rgba(11, 95, 214, .65); }
.heros-bleu.heros-alerte.heros-alerte { background: radial-gradient(70% 120% at 100% 0%, rgba(255, 220, 220, .35), transparent 62%), linear-gradient(115deg, #B4232A 0%, #E5484D 100%);
  box-shadow: 0 24px 50px -28px rgba(180, 35, 42, .6); }
.pl-jour.heros-bleu { --h-pts: 52px; padding: 22px 24px; }
.pl-jour.heros-bleu .pl-k, .pl-jour.heros-bleu .pl-date { opacity: .86; }
.pl-jour.heros-bleu .pl-v { margin: 14px 0 10px; color: #fff; }
.pl-jour.heros-bleu .pl-maj { background: rgba(255, 255, 255, .18); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.pl-jour.heros-bleu .pl-maj:hover { background: rgba(255, 255, 255, .28); }
.aj-tete.heros-bleu { --h-pts: 76px; gap: 26px; padding: 28px 30px; margin-bottom: 18px; }
.aj-tete.heros-bleu .aj-n { flex: none; line-height: 1; }
.aj-tete.heros-bleu .aj-tete-t { flex: 1 1 auto; min-width: 0; }
.pl-jour.heros-bleu .pl-solde .input { background: #fff; color: #0B0B0F; border-color: transparent; }
.pl-jour.heros-bleu .pl-solde .dc-saisie > span { color: #8A8A93; }
.aj-tete.heros-bleu .aj-tete-t { gap: 4px; }
.aj-tete.heros-bleu .aj-tete-t b { color: #fff; font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
.aj-tete.heros-bleu .aj-aide { border-color: rgba(255, 255, 255, .5); color: #fff; }
.aj-tete.heros-bleu .aj-aide:hover, .aj-tete.heros-bleu .aj-aide:focus-visible { background: rgba(255, 255, 255, .16); border-color: #fff; }
@media (max-width: 820px) {
  .pl-jour.heros-bleu { --h-pts: 56px; padding: 20px 22px; }
  .aj-tete.heros-bleu { --h-pts: 58px; gap: 18px; padding: 20px 22px; border-radius: 26px; }
  .aj-tete.heros-bleu .aj-tete-t b { font-size: 21px; }
  .aj-tete.heros-bleu { flex-wrap: wrap; }
  .aj-tete.heros-bleu .aj-tout { flex: 1 0 100%; margin-left: 0; }
}

/* info-bulle maison au survol des chiffres (title remplacé) : déjà .bulle ; repère d'aide rond */
.aide-rond { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--card-3); color: var(--ink-3); font: 700 11px/1 var(--text); cursor: help; }

/* =============================================================================
   CARTES « NUIT » (passe 2) : les grandes surfaces inversées. Noires en clair, bleu nuit en sombre — jamais une grande carte
   blanche éblouissante. Pour leur contenu, l'encre « sur noir » devient celle de la nuit ; l'action principale y est une pilule blanche.
   ============================================================================= */
:root :is(.summary, .ticket, .pv-arrivee, .ab-vedette, .sim-ecran, .dp-scanner, .ao-membre, .ex-couverture, .ap-bordereau,
          .nf-rembourser, .nf-photo, .nf-rabat, .obl-total, .dv-envoye, .fx-emise) {
  --black: var(--nuit); --on-black: var(--on-nuit); background: var(--nuit-fond); color: var(--on-nuit); }
:root .ex-onglets .actif { background: var(--nuit-fond); color: var(--on-nuit); }   /* l'onglet de la chemise suit sa couverture */
:root:not([data-theme="light"]) :is(.summary, .ticket, .pv-arrivee, .ab-vedette, .sim-ecran, .dp-scanner, .ao-membre, .ex-couverture, .ap-bordereau,
          .nf-rembourser, .nf-photo, .obl-total, .dv-envoye, .fx-emise) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 40px -20px rgba(0, 0, 0, .8); }
:root :is(.summary, .ticket, .pv-arrivee, .ab-vedette, .sim-ecran, .dp-scanner, .ao-membre, .ex-couverture, .ap-bordereau, .nf-rembourser, .nf-photo)
  :is(.btn-primary, .btn-lime) { background: var(--on-nuit); color: var(--nuit); }

/* symboles maison (js/symboles.js) : une taille par défaut partout (le téléphone a la sienne dans mobile.css) */
.sym { display: inline-block; width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
/* page « Mon compte » (#/plus) ouverte sur ordinateur : la même liste groupée, en colonne lisible */
@media (min-width: 821px) {
  .plus-tete { margin-bottom: 18px; }
  .plus-tete ~ * { max-width: 640px; }
  .plus-identite { display: flex; align-items: center; gap: 14px; padding: 14px 18px 14px 14px; margin: 0 0 18px; border-radius: var(--r-lg);
    background: var(--card); color: var(--ink); box-shadow: var(--sh-card); transition: background .2s; }
  .plus-identite:hover { background: var(--card-2); }
  .plus-identite .monogramme { width: 52px; height: 52px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--black); color: var(--on-black);
    font: 700 19px/1 var(--display); }
  .plus-identite .id-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  .plus-identite .id-texte b { font: 700 17px/1.2 var(--text); letter-spacing: -.015em; overflow-wrap: anywhere; }
  .plus-identite .id-texte small { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .plus-identite .chev, .plus-tete ~ .groupe .ligne .chev { width: 15px; height: 15px; color: var(--ink-3); }
  .plus-tete ~ .groupe { margin: 0 0 18px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--sh-card); overflow: hidden; }
  .plus-tete ~ .groupe .ligne { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 18px; border: 0;
    background: none; color: var(--ink); text-align: left; font: inherit; cursor: pointer; transition: background .2s; }
  .plus-tete ~ .groupe .ligne:hover { background: var(--survol); }
  .plus-tete ~ .groupe .ligne + .ligne::before { content: ""; position: absolute; top: 0; right: 0; left: 18px; height: 1px; background: var(--line); }
  .plus-tete ~ .groupe .lig-titre { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; }
  .plus-tete ~ .groupe .lig-valeur { font-size: 14px; color: var(--ink-3); white-space: nowrap; }
  .plus-tete ~ .groupe .lig-valeur:empty { display: none; }
  .plus-tete ~ .groupe .ligne.centre { justify-content: center; }
  .plus-tete ~ .groupe .ligne.danger { color: var(--danger); }
  .plus-pied { font-size: 12.5px; color: var(--ink-3); margin: 4px 0 0; text-align: center; }
}

/* =============================================================================
   PASSE 2 — contraste et verre (consignes des associés du 01/12)
   ============================================================================= */
/* en-têtes de tableaux : bande grise, coins arrondis aux extrémités */
.t thead th { background: var(--entete-tableau); color: var(--ink-2); border-bottom: 0; }
.t thead th:first-child { border-radius: 10px 0 0 10px; }
.t thead th:last-child { border-radius: 0 10px 10px 0; }
/* éléments posés sur une carte héros en dégradé : verre clair */
.heros-bleu :is(.badge, .pl-maj, .aj-aide, .nv) { -webkit-backdrop-filter: var(--verre-flou); backdrop-filter: var(--verre-flou); }
.heros-bleu .badge { background: rgba(255, 255, 255, .18); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
/* sans flou d'arrière-plan (anciens navigateurs) : des fonds opaques, jamais un texte illisible sur une transparence */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .demo-banner, .menu, .pop, .bulle, .sp-lanceur, .cs-menu { background: var(--card) !important; }
  .modal-bg, .rg-fond { background: rgba(11, 12, 15, .6) !important; }
}

/* champs de recherche : capsule, comme iOS 26 (les autres champs restent en rectangle arrondi) */
#bq.input, #bq-cherche.input { border-radius: var(--pill); }

/* ---------- raccourcis clavier : un bouton dans le menu du compte, la liste dans une fenêtre ---------- */
@media (hover: none) and (pointer: coarse) { .menu .menu-raccourcis { display: none; } }   /* sans clavier : rien à montrer */
.rk-liste { display: grid; gap: 18px; }
.rk-liste h3 { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.rk-ligne { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 34px; font-size: 14px; color: var(--ink); }
.rk-ligne + .rk-ligne { border-top: 1px solid var(--line); }
.rk-touches { display: inline-flex; gap: 4px; flex-shrink: 0; }
.rk-touches kbd { min-width: 24px; height: 24px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 7px;
  background: var(--card-2); color: var(--ink); font: 600 12px var(--text); box-shadow: inset 0 -1px 0 var(--line-2); }

/* ---------- rouge au survol : tout ce qui supprime, déconnecte ou ferme ---------- */
:is(#logout, [data-sortir], .cs-v-sortir, #rm, #del, #sup, #vider, #tk-suppr, #fo-suppr, #logo-retirer, .of-suppr, [data-retirer], [data-ret],
   button:has(> svg[data-i="trash"]), button:has(> svg[data-i="logout"]), button:has(> svg[data-s="sortir"])):hover {
  color: var(--danger) !important; background: var(--danger-soft) !important; }
:is(#logout, [data-sortir], button:has(> svg[data-i="trash"]), button:has(> svg[data-i="logout"]), button:has(> svg[data-s="sortir"])):hover :is(svg.i, .sym) { color: var(--danger); }

/* ---------- page ou liste vide, façon Things : un signe calme, une phrase (partagé par toutes les rubriques) ---------- */
.vide-calme { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 24px 44px; animation: aj-fondu .4s both; }
.vide-calme svg { width: 56px; height: 56px; margin-bottom: 6px; }
.vide-calme circle { fill: none; stroke: var(--line-2); stroke-width: 2.5; }
.vide-calme path { fill: none; stroke: var(--ink-3); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.vide-calme b { font: 700 18px var(--display); letter-spacing: -.01em; color: var(--ink); }
.vide-calme span { max-width: 380px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.vide-calme .btn { margin-top: 10px; }
@keyframes aj-fondu { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
