/* =============================================================================
   AURYVO Business — système visuel
   Graphite profond, halo lumineux, cartes-pilules très arrondies, pastille
   blanche pour l'élément actif, corail pour l'alerte (« ! »), bleu pour
   Sophystia, sarcelle pour le « 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) ---------- */
:root {
  --bg: #0b0b0c;
  --bg-glow: rgba(255, 255, 255, .085);
  --panel: #131314;
  --panel-line: rgba(255, 255, 255, .055);
  --card: #18181a;
  --card-2: #212123;
  --card-3: #2a2a2d;
  --field: #1f1f21;
  --ink: #f3f3f1;
  --ink-2: #a5a5aa;
  --ink-3: #6c6c72;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .11);
  /* « black » = l'action principale : pastille blanche sur graphite */
  --black: #f3f3f1;
  --on-black: #0b0b0c;
  /* marque / Sophystia */
  --lime: #5d9cec;
  --lime-ink: #ffffff;
  --blue: #5d9cec;
  --blue-soft: rgba(93, 156, 236, .13);
  --coral: #c9fb48;              /* alerte = lime AURYVO (remplissages) */
  --coral-ink: #162000;          /* texte posé sur le lime */
  --coral-text: #c9fb48;         /* lime utilisé comme couleur de texte */
  --coral-soft: rgba(201, 251, 72, .12);
  --danger: #ff5d5d;
  --danger-soft: rgba(255, 93, 93, .12);
  --amber: #f2b33d;
  --amber-soft: rgba(242, 179, 61, .12);
  --green: #3fd0bb;
  --green-soft: rgba(63, 208, 187, .11);
  --hatch: rgba(255, 255, 255, .16);
  /* forme */
  --r-xl: 32px;
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 13px;
  --pill: 999px;
  --sh-card: inset 0 1px 0 rgba(255, 255, 255, .035), 0 1px 0 rgba(0, 0, 0, .4), 0 18px 40px -24px rgba(0, 0, 0, .85);
  --sh-float: 0 30px 80px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .06);
  --spot: rgba(255, 255, 255, .055);
  /* 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 ---------- */
:root[data-theme="light"] {
  --bg: #e8e8e9;
  --bg-glow: rgba(255, 255, 255, .9);
  --panel: rgba(255, 255, 255, .55);
  --panel-line: rgba(0, 0, 0, .05);
  --card: #f8f8f8;
  --card-2: #efeff0;
  --card-3: #e4e4e6;
  --field: #efeff0;
  --ink: #0e0e0f;
  --ink-2: #55555b;
  --ink-3: #8d8d93;
  --line: rgba(0, 0, 0, .06);
  --line-2: rgba(0, 0, 0, .11);
  --black: #0e0e0f;
  --on-black: #ffffff;
  --lime: #3a7fd6;
  --blue: #3a7fd6;
  --blue-soft: rgba(58, 127, 214, .1);
  --coral: #c9fb48;
  --coral-ink: #162000;
  --coral-text: #4f6b00;
  --coral-soft: rgba(150, 200, 20, .16);
  --danger: #d93a3a;
  --danger-soft: rgba(217, 58, 58, .1);
  --amber: #c98a1e;
  --amber-soft: rgba(201, 138, 30, .12);
  --green: #13a58f;
  --green-soft: rgba(19, 165, 143, .1);
  --hatch: rgba(0, 0, 0, .14);
  --sh-card: inset 0 1px 0 rgba(255, 255, 255, .9), 0 14px 34px -24px rgba(0, 0, 0, .35);
  --sh-float: 0 30px 70px -26px rgba(0, 0, 0, .4), 0 0 0 1px rgba(0, 0, 0, .04);
  --spot: rgba(255, 255, 255, .9);
  color-scheme: light;
}

* { 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: radial-gradient(56% 46% at 50% -12%, var(--bg-glow), transparent 72%),
                    radial-gradient(40% 30% at 100% 0%, rgba(93, 156, 236, .05), transparent 70%);
  background-attachment: fixed; background-repeat: no-repeat;
  -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(--blue); 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(--blue); outline-offset: 3px; border-radius: 10px; }
* { 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: 17px; background: #0b0b0c; color: var(--coral); border: 1px solid rgba(255, 255, 255, .08); display: grid; place-items: center; margin-bottom: 20px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .7); 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: 25; display: flex; align-items: center; gap: 20px; padding: 18px 0 14px; }
.topbar::before { content: ""; position: absolute; inset: 0 -36px 0 -100px; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--bg) 40%, color-mix(in srgb, var(--bg) 0%, transparent));
  -webkit-mask: linear-gradient(#000 60%, transparent); mask: linear-gradient(#000 60%, transparent); }
.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: #0e0e0f; border-color: transparent; }
.navpill::-webkit-scrollbar { display: none; }
.nav-glider { position: absolute; top: 5px; left: 0; height: calc(100% - 10px); width: 0; border-radius: var(--pill); background: #f3f3f1; z-index: 0;
  box-shadow: 0 8px 22px -10px rgba(0, 0, 0, .8); 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: rgba(243, 243, 241, .62); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: color .35s var(--ease); }
.navpill a:hover { color: #f3f3f1; }
.navpill a.active { color: #0b0b0c; }
.navcount { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--pill); background: var(--coral); color: var(--coral-ink); 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; }
.search { position: relative; }
.search input { width: 250px; height: 48px; border-radius: var(--pill); border: 1px solid var(--panel-line); background: var(--card); padding: 0 52px 0 46px;
  font-size: 13.5px; transition: width .45s var(--ease-out), background .25s, border-color .25s; }
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; width: 340px; background: var(--card-2); border-color: var(--line-2); }
.search .search-ico { position: absolute; left: 17px; top: 15px; color: var(--ink-3); }
.search .kbd { position: absolute; right: 15px; top: 14px; }
.search-results { position: absolute; top: 58px; right: 0; width: 430px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-float);
  padding: 8px; max-height: 460px; overflow: auto; opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none;
  transition: opacity .2s var(--ease), transform .35s var(--spring); }
.search-results.open { opacity: 1; transform: none; pointer-events: auto; }
.sr-group { font-size: 11.5px; color: var(--ink-3); padding: 10px 12px 4px; font-weight: 600; }
.sr-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); transition: background .15s; }
.sr-item:hover { background: var(--card-2); }
.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(--coral); 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(201, 251, 72, 0); } 35% { box-shadow: 0 0 0 3px var(--card), 0 0 0 8px rgba(201, 251, 72, .3); } }
.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: 0 0 0 1px var(--line-2), 0 0 0 4px var(--bg), 0 0 0 5px var(--line-2);
  transition: transform .35s var(--spring); }
.avatar:hover { transform: scale(1.05); }
.menu { position: absolute; right: 0; top: 60px; width: 268px; background: var(--card); border-radius: var(--r-lg); box-shadow: 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: var(--r-sm); 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(--card-2); padding-left: 15px; }

/* bandeau démo */
.demo-banner { display: flex; align-items: center; gap: 12px; padding: 7px 7px 7px 10px; margin: 2px 0 6px; border-radius: var(--pill);
  background: var(--panel); border: 1px solid var(--panel-line); 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 { background: var(--coral); color: var(--coral-ink); font-weight: 700; font-size: 11px; padding: 4px 10px; border-radius: var(--pill); }
.demo-banner .actions { margin-left: auto; }

/* en-tête de page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 26px 0 24px; 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: 46px; line-height: 1.02; font-weight: 500; letter-spacing: -.04em; margin: 0; }
.page-head p { margin: 12px 0 0; color: var(--ink-2); max-width: 640px; }
.page-head .meta { display: flex; gap: 10px; flex-wrap: wrap; }
.meta-item { padding: 12px 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--panel-line); 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: 600; letter-spacing: -.02em; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.content { max-width: 1440px; }

/* sous-navigation : pastilles contour, l'active en blanc */
.subnav { display: flex; gap: 6px; margin: -6px 0 24px; flex-wrap: wrap; }
.subnav a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 17px; border-radius: var(--pill); font-weight: 600; font-size: 13px;
  background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); transition: background .25s, color .25s, border-color .25s, transform .3s var(--spring); }
.subnav a:hover { color: var(--ink); border-color: var(--ink-3); transform: translateY(-1px); }
.subnav a.active { background: var(--black); color: var(--on-black); border-color: transparent; }
.subnav .count { font-size: 11.5px; opacity: .6; }

/* =============================================================================
   BOUTONS
   ============================================================================= */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: var(--pill);
  border: 1px solid transparent; font-weight: 600; font-size: 13.5px; 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: translateY(-1px); }
.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 14px 30px -14px color-mix(in srgb, var(--black) 70%, transparent); }
.btn-secondary { background: var(--card-2); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { background: var(--card-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--card-2); color: var(--ink); }
.btn-lime { background: var(--lime); color: var(--lime-ink); }
.btn-lime:hover:not(:disabled) { box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--lime) 75%, transparent); }
.btn-lime::after, .btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .8s var(--ease-out); pointer-events: none; }
.btn-lime:hover::after, .btn-primary:hover::after { transform: translateX(120%); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--green); color: #06231e; }
.btn-sm { height: 36px; padding: 0 15px; font-size: 12.5px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card-2); display: inline-grid; place-items: center;
  cursor: pointer; color: var(--ink); transition: background .2s, transform .35s var(--spring); flex-shrink: 0; }
.icon-btn:hover { background: var(--card-3); transform: rotate(-6deg) scale(1.05); }
.link-btn { background: none; border: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; padding: 0; }

/* =============================================================================
   SURFACES — projecteur qui suit le pointeur (--mx / --my posés en JS)
   ============================================================================= */
.panel { background: var(--panel); border: 1px solid var(--panel-line); 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: 1px solid var(--panel-line); min-width: 0;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), background .3s, border-color .3s; }
.card::before, .kpi::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 42%); transition: opacity .35s var(--ease); }
.card:hover::before, .kpi:hover::before { opacity: 1; }
.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: 19px; font-weight: 600; letter-spacing: -.02em; display: flex; gap: 10px; align-items: center; }
.card-head h2 svg.i, .card-head h3 svg.i { display: none; }
.card-head a.small, .card-head > a { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 8px 14px; border-radius: var(--pill); border: 1px solid var(--line-2);
  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: 14px; }
.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: 14px; }
.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-2); 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: 1px solid var(--panel-line); transition: transform .45s var(--ease-out), background .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='%23a5a5aa' 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: translateY(-3px); }
a.kpi:hover::after { transform: rotate(45deg); background-color: var(--card-3); }
.kpi-label { color: var(--ink-2); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi-value { font-family: var(--display); font-size: 46px; font-weight: 500; letter-spacing: -.045em; line-height: 1.02; margin: 18px 0 6px; font-variant-numeric: tabular-nums; }
.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 « mise en avant » : carte inversée, comme une fiche profil blanche */
.kpi.accent { background: var(--coral); color: var(--coral-ink); border-color: transparent; }
.kpi.accent .kpi-label, .kpi.accent .kpi-sub { color: color-mix(in srgb, var(--coral-ink) 68%, transparent); }
.kpi.accent .kpi-value .u { color: color-mix(in srgb, var(--coral-ink) 50%, transparent); }
.kpi.accent .kpi-label::before { content: "!"; width: 20px; height: 20px; border-radius: 50%; background: var(--coral-ink); color: var(--coral); font-size: 12px; font-weight: 800;
  display: inline-grid; place-items: center; }
a.kpi.accent::after { background-color: rgba(22, 32, 0, .1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E"); }
.kpi.accent::before { --spot: rgba(0, 0, 0, .05); }
.kpi.lime { background: var(--lime); color: var(--lime-ink); }
.kpi.lime .kpi-label, .kpi.lime .kpi-sub { color: color-mix(in srgb, var(--lime-ink) 75%, transparent); }
.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(--green); stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease-out); }
.ring.coral .fg { stroke: var(--coral); }
.kpi.accent .ring .bg { stroke: rgba(22, 32, 0, .14); }
.kpi.accent .ring .fg { stroke: var(--coral-ink); }

/* pastilles d'état */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 5px 12px 5px 10px; border-radius: var(--pill);
  background: var(--card-2); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--line); }
.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(--coral-soft); color: var(--coral-text); border-color: transparent; }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.badge.gray { color: var(--ink-3); }

/* 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: 10px 16px 4px; white-space: nowrap; }
.t td { padding: 14px 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: var(--pill) 0 0 var(--pill); }
.t tbody tr.click:hover td:last-child { border-radius: 0 var(--pill) var(--pill) 0; }
.t .r { text-align: right; }
.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty svg.i { width: 30px; height: 30px; margin-bottom: 10px; opacity: .5; }
.empty b { color: var(--ink); font-family: var(--display); font-size: 18px; font-weight: 600; }

/* 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: 38px; padding: 0 16px; border-radius: var(--pill); font-weight: 600; font-size: 13px;
  background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); cursor: pointer; white-space: nowrap;
  transition: background .25s, color .25s, border-color .25s, transform .3s var(--spring); }
.tab:hover { color: var(--ink); border-color: var(--ink-3); }
.tab.active { background: var(--black); color: var(--on-black); border-color: transparent; }
.tab .count { font-size: 11.5px; opacity: .6; font-weight: 700; }
.tab.active .count { color: var(--on-black); opacity: .6; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--pill); background: var(--card); border: 1px solid var(--panel-line); }
.seg button { border: 0; background: none; height: 36px; padding: 0 15px; border-radius: var(--pill); font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer;
  transition: background .3s var(--ease), color .3s; }
.seg button.active { background: var(--black); color: var(--on-black); }

/* 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: 48px; border: 1px solid var(--line); border-radius: var(--r-md); 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='%238d8d93' 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: 14px 16px; resize: vertical; line-height: 1.6; }
.input:hover { border-color: var(--line-2); }
.input:focus { outline: none; background: var(--card-2); border-color: var(--ink-3); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.input.sm { height: 40px; border-radius: var(--r-sm); 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: 15px; font-weight: 600; color: var(--ink); margin: 26px 0 12px; }
.switch { position: relative; width: 46px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--card-3); 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 2px 6px rgba(0, 0, 0, .35); }
.switch input:checked + span { background: var(--green); }
.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: translateX(3px); }
.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(--coral); color: var(--coral-ink); }
.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(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.tl-when { color: var(--ink-3); font-size: 12px; }

/* graphique : colonnes hachurées */
.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: 18px; min-height: 8px; border: 1px solid var(--line-2);
  background: repeating-linear-gradient(-45deg, var(--hatch) 0 3px, transparent 3px 8px); transform-origin: bottom; animation: grow .9s var(--ease-out) both; }
.bar.current { border-color: var(--coral); background: repeating-linear-gradient(-45deg, var(--coral) 0 3px, transparent 3px 8px); }
.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); }

/* é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: 19px; background: var(--card-2); 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(--coral); color: var(--coral-ink); }
.date-chip.urgent .m { color: var(--coral-ink); opacity: .7; }

/* 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); border: 1px solid var(--line); }
.callout svg.i { margin-top: 1px; flex-shrink: 0; }
.callout a { text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.callout.info { background: var(--blue-soft); border-color: transparent; } .callout.info svg.i { color: var(--blue); }
.callout.warn { background: var(--amber-soft); border-color: transparent; } .callout.warn svg.i { color: var(--amber); }
.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); }
.checklist .in { background: var(--blue-soft); color: var(--blue); }
.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: 600; font-size: 24px; letter-spacing: -.02em; }

/* 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: 44px; font-weight: 500; letter-spacing: -.045em; 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: repeating-linear-gradient(-45deg, var(--coral) 0 3px, color-mix(in srgb, var(--coral) 62%, #000) 3px 7px);
  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: 500; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.summary .retard { background: var(--coral); color: var(--coral-ink); 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; }
.step.done > span { background: var(--green); color: #06231e; }
.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: 500; letter-spacing: -.035em; margin: 8px 0 12px; }
.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: #f3f3f1; background: #111112;
  background-image: radial-gradient(60% 90% at 50% -20%, rgba(255, 255, 255, .14), transparent 70%), radial-gradient(50% 80% at 100% 100%, rgba(93, 156, 236, .22), transparent 70%); }
.chat-hero .k { font-size: 12.5px; opacity: .6; font-weight: 600; }
.chat-hero .t1 { font-family: var(--display); font-size: 28px; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; margin: 8px 0 18px; max-width: 560px; }
.glass-chip { border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: #f3f3f1; 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(--blue); 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: 500; }
.md h2 { font-family: var(--display); font-size: 19px; margin: 28px 0 10px; font-weight: 600; }
.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(--blue); margin: 0 0 12px; padding: 4px 14px; color: var(--ink-2); }
.md a { text-decoration: underline; }

/* panneau mis en avant */
.feature { position: relative; border-radius: var(--r-lg); padding: 26px; color: #f3f3f1; overflow: hidden; background: #111112; border: 1px solid rgba(255, 255, 255, .06);
  background-image: radial-gradient(70% 90% at 50% -25%, rgba(255, 255, 255, .16), transparent 70%), radial-gradient(60% 80% at 100% 110%, rgba(63, 208, 187, .2), transparent 70%); }
.feature .k { font-size: 13px; opacity: .6; font-weight: 600; }
.feature .big { font-family: var(--display); font-size: 58px; font-weight: 500; letter-spacing: -.05em; line-height: 1; margin: 14px 0 6px; }
.feature .t1 { font-family: var(--display); font-size: 19px; font-weight: 600; }
.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, .07); font-size: 13px; }
.feature a.btn { background: #f3f3f1; color: #0b0b0c; }

/* modales */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 5, 6, .55); backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px);
  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(30, 30, 34, .25); }
.modal { background: var(--card); border-radius: var(--r-xl); box-shadow: var(--sh-float); 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: 25px; font-weight: 500; letter-spacing: -.03em; }
.modal-body { padding: 16px 28px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 22px; }
@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: #06231e; 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: 10px; background: var(--card-2); border-radius: var(--pill); overflow: hidden; }
.progress > div { height: 100%; border-radius: var(--pill); background: repeating-linear-gradient(-45deg, var(--green) 0 3px, color-mix(in srgb, var(--green) 40%, transparent) 3px 7px);
  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); } }
.skeleton { background: linear-gradient(100deg, var(--card) 30%, var(--card-2) 50%, var(--card) 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: 1px solid var(--line-2); border-radius: 7px; padding: 1px 7px; 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(--green); box-shadow: 0 0 0 4px var(--green-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: -.04em; margin: 20px 0 6px; font-weight: 500; }

/* =============================================================================
   MOUVEMENT — entrées de page échelonnées (classe posée par le routeur)
   ============================================================================= */
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.992); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
.view-enter .stagger { animation: rise .75s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); }
#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 small { display: none; }
  .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)); }
  .search input { width: 48px; padding: 0; color: transparent; cursor: pointer; }
  .search input::placeholder { color: transparent; }
  .search input:focus { width: 280px; padding: 0 16px 0 46px; color: var(--ink); }
  .search input:focus::placeholder { color: var(--ink-3); }
  .search .kbd { display: none; }
}
@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(--coral); }
  .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(--blue-soft); color: var(--blue); 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: 52px; font-weight: 500; letter-spacing: -.045em; margin: 4px 0 10px; line-height: 1.02; }
.hello p { margin: 0; font-size: 17px; color: var(--ink-2); max-width: 640px; }
.hello p b { color: var(--ink); font-weight: 600; }

/* la boîte de Sophystia : halo, bordure en aura qui tourne lentement */
.ask { position: relative; isolation: isolate; border-radius: var(--r-xl); padding: 24px; color: #f3f3f1; box-shadow: var(--sh-float); overflow: hidden;
  background: #111112; transition: transform .45s var(--spring), box-shadow .3s;
  background-image: radial-gradient(70% 120% at 50% -40%, rgba(255, 255, 255, .13), transparent 70%),
                    radial-gradient(45% 90% at 100% 120%, rgba(93, 156, 236, .2), transparent 70%),
                    radial-gradient(35% 70% at 0% 120%, rgba(201, 251, 72, .1), 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(93, 156, 236, .9) 72%, rgba(201, 251, 72, .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::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .07), transparent 45%); }
.ask:hover::after { opacity: 1; }
.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%, #5d9cec 52%, #2a4f8a 78%, #c9fb48 120%);
  box-shadow: 0 0 18px rgba(93, 156, 236, .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(93, 156, 236, .45), inset 0 -2px 6px rgba(0, 0, 0, .35); }
  50% { transform: scale(1.12); box-shadow: 0 0 26px rgba(93, 156, 236, .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(93, 156, 236, .14); }
.ask-row input { flex: 1; min-width: 0; background: none; border: 0; color: #f3f3f1; 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: #f3f3f1; color: #0b0b0c; display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0; transition: transform .4s var(--spring), background .2s; }
.ask-btn:hover { transform: scale(1.08) rotate(-12deg); }
.ask-btn:active { transform: scale(.92); }
.ask-btn.ghost { background: rgba(255, 255, 255, .09); color: #f3f3f1; }
.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: 1px solid var(--panel-line); 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: 24px; font-weight: 500; letter-spacing: -.03em; margin: 0; }
.block-head a { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 8px 14px; border-radius: var(--pill); border: 1px solid var(--line-2);
  transition: color .2s, background .2s; }
.block-head a:hover { color: var(--ink); background: var(--card-2); }
/* compteur façon « ! 3 » : pastille blanche, point d'exclamation corail */
.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(--coral); color: var(--coral-ink); 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: translateY(-3px); }
.task-t { font-family: var(--display); font-weight: 600; 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 : « ! » corail = urgent, orbe = 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(--coral); color: var(--coral-ink); font-family: var(--text); font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.task.ordo { border-color: color-mix(in srgb, var(--blue) 35%, transparent); }
.task.ordo .task-t::before { width: 18px; height: 18px; background: radial-gradient(circle at 32% 30%, #fff 0%, #a9cdf7 24%, #5d9cec 55%, #2a4f8a 85%);
  box-shadow: 0 0 14px rgba(93, 156, 236, .6); animation: breathe 3.6s var(--ease) infinite; }
.task.ok { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.task.ok .task-t svg.i { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--green); color: #06231e; 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(--green-soft); color: var(--green); 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: 500; letter-spacing: -.04em; }
.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(--blue), var(--coral), var(--blue));
  -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(--coral);
  box-shadow: 0 0 0 2.5px #111112; 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: 600; color: #f3f3f1; 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: -6px; height: calc(100% + 26px); 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(--blue); transition: box-shadow .3s; }
.rail-btn.soph:hover img { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--coral); }
.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(--blue); }

/* 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: #f3f3f1; padding: 7px; }

/* =============================================================================
   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(--ink-3); background: var(--card-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.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(--card); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 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: 12px; 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(--coral-text); 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: 12px; 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: 600; 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(--ink-3); }
.cal-grille button.choisi { background: var(--black); color: var(--on-black); }
.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: 10px; }
.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(--coral); border-color: var(--coral); }
input[type="checkbox"]:checked::after { content: ""; width: 12px; height: 12px; background: var(--coral-ink);
  -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(--coral); }
input[type="radio"]:checked::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); animation: check-in .35s var(--spring); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--blue); 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);
  background: var(--card-2); 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(--coral-text); }

/* barres de défilement */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card-3); border-radius: 12px; 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: 10px; background: var(--black); color: var(--on-black);
  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); }
.auth-scene { position: relative; overflow: hidden; background: #0e0e0f; border-right: 1px solid rgba(255, 255, 255, .06);
  background-image: radial-gradient(70% 55% at 45% 30%, rgba(255, 255, 255, .11), transparent 70%),
                    radial-gradient(45% 40% at 85% 95%, rgba(201, 251, 72, .1), transparent 70%),
                    radial-gradient(45% 40% at 10% 100%, rgba(93, 156, 236, .16), transparent 70%); }
.auth-marque { position: absolute; top: 34px; left: 40px; display: flex; align-items: center; gap: 14px; z-index: 3; color: #c9fb48; }
.auth-marque .wm-txt { background: #f3f3f1; height: 16px; }
.auth-logo { width: 46px; height: 46px; border-radius: 16px; background: #0b0b0c; border: 1px solid rgba(255, 255, 255, .1); display: grid; place-items: center; }
.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(93, 156, 236, .28), 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: #f3f3f1; color: #0b0b0c; font-family: var(--display); font-size: 17px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em;
  box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .7); 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: 18px; background: #0b0b0c; border: 1px solid var(--line-2); display: grid; place-items: center; color: #c9fb48; margin-bottom: 26px; }
.auth-mark .logo-sym { width: 30px; height: 30px; }
.auth h1 { font-family: var(--display); font-size: 40px; font-weight: 500; letter-spacing: -.045em; 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: 5px; border-radius: var(--pill); background: var(--card); border: 1px solid var(--panel-line); 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: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); 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(--coral); color: var(--coral-ink); }
.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(--coral); }
.force[data-n="4"] i:nth-child(-n+4) { background: var(--coral); }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .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(--coral); color: var(--coral-ink); 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(201, 251, 72, 0); } 35% { box-shadow: 0 0 0 7px rgba(201, 251, 72, .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(--blue); }
.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: 10px; border-radius: var(--pill); background: var(--card-2); 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: repeating-linear-gradient(-45deg, var(--coral) 0 4px, color-mix(in srgb, var(--coral) 62%, #000) 4px 9px); }
.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(--coral); color: var(--coral-ink); }
.etape-ligne.faite .etape-pt svg.i { stroke-width: 2.8; width: 14px; height: 14px; }
