/* ════════════════════════════════════════════════════════════════════════
   PILOTAGE — design system du portail Le Pain du Jour.

   Une seule feuille, chargée seule : elle remplace main.css, odoo-theme.css,
   fournil.css, polish.css et stock.css. Clair et sombre via
   html[data-theme]. Les noms de classes des gabarits sont conservés : ce
   sont les règles qui changent, pas le balisage.
   ════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ─── Jetons ─────────────────────────────────────────────────────────── */
:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --bg: #F7F7F8;
  --panel: #FFFFFF;
  --panel-2: #FAFAFB;
  --side: #FBFBFB;
  --line: #EAEAED;
  --line-strong: #DADADF;
  --ink: #0C0C0E;
  --ink-2: #4B4B53;
  --ink-3: #84848E;
  --hover: #F3F3F5;
  --active: #EDEDF0;

  --brand: #C2410C;
  --brand-hover: #9F340A;
  --brand-ink: #B23B0B;
  --brand-soft: #FFF4ED;
  --brand-line: #FBD5BF;

  --ok: #127A3A;      --ok-soft: #EBF9F0;
  --bad: #B42318;     --bad-soft: #FEF2F1;
  --warn: #A15C07;    --warn-soft: #FFF8E6;
  --info: #175CD3;    --info-soft: #EFF6FF;

  --c1: #EA580C; --c2: #2563EB; --c3: #0D9488; --c4: #7C3AED; --c5: #DB2777; --c6: #CA8A04;
  --chart-grid: #F0F0F2;
  --tooltip-bg: #18181B;
  --tooltip-ink: #FAFAFA;

  --shadow-xs: 0 1px 2px rgba(15, 15, 20, .04);
  --shadow-sm: 0 1px 2px rgba(15, 15, 20, .05), 0 1px 3px rgba(15, 15, 20, .05);
  --shadow-md: 0 6px 16px -4px rgba(15, 15, 20, .10), 0 2px 4px -2px rgba(15, 15, 20, .05);
  --shadow-lg: 0 24px 48px -12px rgba(15, 15, 20, .22), 0 0 0 1px rgba(15, 15, 20, .04);
  --ring: 0 0 0 3px rgba(194, 65, 12, .20);

  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px;
  --side-w: 252px;
  --top-h: 56px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0A0A0C;
  --panel: #111114;
  --panel-2: #16161A;
  --side: #0D0D10;
  --line: #232329;
  --line-strong: #2E2E35;
  --ink: #F4F4F6;
  --ink-2: #B4B4BD;
  --ink-3: #7C7C87;
  --hover: #1A1A1F;
  --active: #202026;

  --brand: #EA580C;
  --brand-hover: #F97316;
  --brand-ink: #FB923C;
  --brand-soft: rgba(234, 88, 12, .12);
  --brand-line: rgba(234, 88, 12, .32);

  --ok: #4ADE80;      --ok-soft: rgba(74, 222, 128, .10);
  --bad: #F87171;     --bad-soft: rgba(248, 113, 113, .10);
  --warn: #FBBF24;    --warn-soft: rgba(251, 191, 36, .10);
  --info: #60A5FA;    --info-soft: rgba(96, 165, 250, .10);

  --c1: #FB923C; --c2: #60A5FA; --c3: #2DD4BF; --c4: #A78BFA; --c5: #F472B6; --c6: #FACC15;
  --chart-grid: #1F1F25;
  --tooltip-bg: #F4F4F6;
  --tooltip-ink: #0C0C0E;

  --shadow-xs: 0 1px 0 rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 24px -6px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 64px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
  --ring: 0 0 0 3px rgba(251, 146, 60, .25);
  color-scheme: dark;
}

/* Anciens noms de variables, encore présents dans des styles en ligne des
   gabarits : ils pointent vers les jetons, donc suivent aussi le thème. */
:root {
  --color-text-primary: var(--ink);
  --color-text-secondary: var(--ink-2);
  --color-text-tertiary: var(--ink-3);
  --color-text-disabled: var(--ink-3);
  --color-success: var(--ok);
  --color-success-bg: var(--ok-soft);
  --color-success-stroke: color-mix(in srgb, var(--ok) 30%, transparent);
  --color-danger: var(--bad);
  --color-warning: var(--warn);
  --color-bg-canvas: var(--bg);
  --color-bg-subtle: var(--panel-2);
  --color-stroke: var(--line);
  --color-stroke-subtle: var(--line);
  --r-medium: var(--r);
  --brand-60: var(--brand);
  --brand-130: var(--brand-line);
  --brand-150: var(--brand-soft);
  --stk-out: var(--bad);
  --odoo-text-muted: var(--ink-3);
}

/* ─── Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img, svg { display: block; }
button { font-family: inherit; }
::selection { background: var(--brand-soft); color: var(--ink); }

.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none;
       stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.t-num, .num, [data-count], [data-countfg], [data-counter] { font-variant-numeric: tabular-nums; }
.t-mono { font-family: var(--mono); font-size: 12.5px; }
.t-display { font-weight: 600; letter-spacing: -.02em; }
.t-eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-muted { color: var(--ink-3) !important; }
.text-ok { color: var(--ok) !important; }
.text-bad { color: var(--bad) !important; }
.u { color: var(--ink-3); font-weight: 500; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ════════════════════════════════════════════════════════════════════════
   COQUILLE : barre latérale + barre du haut
   ════════════════════════════════════════════════════════════════════════ */
.sx { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
html[data-side="collapsed"] .sx { grid-template-columns: 64px minmax(0, 1fr); }

.sx-side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--side);
  border-right: 1px solid var(--line);
  z-index: 40;
}

.sx-ws {
  display: flex; align-items: center; gap: 10px;
  height: var(--top-h); padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--line);
}
.sx-ws__logo {
  width: 30px; height: 30px; border-radius: 8px; flex: none; object-fit: cover;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-xs);
}
.sx-ws__txt { min-width: 0; flex: 1; line-height: 1.2; }
.sx-ws__name { font-weight: 600; font-size: 13.5px; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.sx-ws__sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.sx-ws a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }

.sx-iconbtn {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: var(--r);
  background: transparent; border: 0; color: var(--ink-3); cursor: pointer;
  position: relative; text-decoration: none;
  transition: background .15s, color .15s;
}
.sx-iconbtn:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.sx-iconbtn .ico { width: 18px; height: 18px; }

.sx-search {
  margin: 12px 12px 4px;
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); color: var(--ink-3);
  font-size: 13px; cursor: pointer; box-shadow: var(--shadow-xs);
  transition: border-color .15s, color .15s;
}
.sx-search:hover { border-color: var(--line-strong); color: var(--ink-2); }
.sx-search span { flex: 1; text-align: left; }
kbd, .kbd {
  font: 500 11px/1 var(--font); color: var(--ink-3);
  padding: 3px 5px; border-radius: 5px;
  background: var(--panel-2); border: 1px solid var(--line);
  box-shadow: inset 0 -1px 0 var(--line);
}

.sx-nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; scrollbar-width: thin; }
.sx-nav__label {
  padding: 16px 8px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3);
}
.sx-nav__item {
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 8px; margin: 1px 0;
  border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  text-decoration: none; position: relative;
  transition: background .12s, color .12s;
}
.sx-nav__item .ico { color: var(--ink-3); transition: color .12s; }
.sx-nav__item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.sx-nav__item:hover .ico { color: var(--ink-2); }
.sx-nav__item.active { background: var(--active); color: var(--ink); }
.sx-nav__item.active .ico { color: var(--brand-ink); }
.sx-nav__item.active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.sx-nav__txt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  font-size: 11px; font-weight: 600; display: inline-grid; place-items: center;
  background: var(--bad-soft); color: var(--bad);
  font-variant-numeric: tabular-nums;
}

.sx-side__foot { border-top: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.sx-me { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r); }
.sx-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #F59E0B);
  color: #fff; font-weight: 600; font-size: 12.5px;
}
.sx-me__txt { min-width: 0; flex: 1; line-height: 1.2; }
.sx-me__name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-me__role { font-size: 11.5px; color: var(--ink-3); }
.sx-foot-row { display: flex; gap: 2px; }

/* barre latérale repliée : icônes seules */
html[data-side="collapsed"] .sx-ws__txt,
html[data-side="collapsed"] .sx-search span,
html[data-side="collapsed"] .sx-search kbd,
html[data-side="collapsed"] .sx-nav__label,
html[data-side="collapsed"] .sx-nav__txt,
html[data-side="collapsed"] .sx-me__txt,
html[data-side="collapsed"] .sx-collapse-hide { display: none; }
html[data-side="collapsed"] .sx-search { justify-content: center; padding: 0; margin: 12px 14px 4px; }
html[data-side="collapsed"] .sx-nav__item { justify-content: center; padding: 0; }
html[data-side="collapsed"] .sx-nav__label { height: 10px; padding: 0; }
html[data-side="collapsed"] .sx-count { position: absolute; top: -2px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
html[data-side="collapsed"] .sx-me { justify-content: center; }
html[data-side="collapsed"] .sx-foot-row { flex-direction: column; align-items: center; }
html[data-side="collapsed"] .sx-ws { padding: 0; justify-content: center; }
html[data-side="collapsed"] .sx-ws a { flex: none; }

.sx-body { min-width: 0; display: flex; flex-direction: column; }
.sx-top {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.sx-top__menu { display: none; }
.sx-crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--ink-3); }
.sx-crumbs .ico { width: 14px; height: 14px; color: var(--line-strong); }
.sx-crumbs b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-top__right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.sx-live {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-xs);
}
.sx-live__dot {
  width: 7px; height: 7px; border-radius: 50%; background: #16A34A;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); animation: sxPulse 2.4s infinite;
}
@keyframes sxPulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); }
  70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.sx-dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--bad); box-shadow: 0 0 0 2px var(--bg);
}
.pwa-install-btn { display: none; }
.sx-top__search { display: none; }
.th-sun { display: none; }
html[data-theme="dark"] .th-sun { display: block; }
html[data-theme="dark"] .th-moon { display: none; }

.main {
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 28px 32px 40px;
  flex: 1;
}
.footer {
  max-width: 1280px; width: 100%; margin: 0 auto;
  padding: 18px 32px 26px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-3);
}
.footer__divider { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

.sx-scrim {
  position: fixed; inset: 0; z-index: 35;
  background: rgba(10, 10, 12, .45);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sx-scrim.open { opacity: 1; pointer-events: auto; }

/* ─── Palette de commandes (Ctrl+K) ──────────────────────────────────── */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(10, 10, 12, .38);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .16s;
}
.cmdk {
  position: fixed; z-index: 301; left: 50%; top: 12vh;
  width: min(640px, calc(100vw - 32px));
  transform: translate(-50%, -8px) scale(.985);
  background: var(--panel); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .16s var(--ease), transform .16s var(--ease);
  overflow: hidden;
}
.cmdk-open .cmdk-overlay { opacity: 1; pointer-events: auto; }
.cmdk-open .cmdk { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(1); }
.cmdk__field { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 54px; border-bottom: 1px solid var(--line); }
.cmdk__field .ico { width: 18px; height: 18px; color: var(--ink-3); }
.cmdk__input {
  flex: 1; height: 100%; border: 0; outline: 0; background: transparent;
  font: 400 15px var(--font); color: var(--ink);
}
.cmdk__input::placeholder { color: var(--ink-3); }
.cmdk__list { max-height: min(56vh, 420px); overflow-y: auto; padding: 6px; }
.cmdk__group { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.cmdk__item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: var(--r);
  color: var(--ink-2); font-size: 13.5px; text-decoration: none; cursor: pointer;
}
.cmdk__item .ico { color: var(--ink-3); }
.cmdk__item[aria-selected="true"] { background: var(--hover); color: var(--ink); text-decoration: none; }
.cmdk__item[aria-selected="true"] .ico { color: var(--brand-ink); }
.cmdk__item-main { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk__item-meta { font-size: 12px; color: var(--ink-3); }
.cmdk__empty { padding: 28px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.cmdk__foot {
  display: flex; gap: 14px; align-items: center; padding: 9px 14px;
  border-top: 1px solid var(--line); background: var(--panel-2);
  font-size: 11.5px; color: var(--ink-3);
}
.cmdk__foot span { display: inline-flex; align-items: center; gap: 5px; }

/* ════════════════════════════════════════════════════════════════════════
   EN-TÊTE DE PAGE
   ════════════════════════════════════════════════════════════════════════ */
.page-header { margin-bottom: 24px; }
.page-header__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 650; letter-spacing: -.025em; line-height: 1.2; color: var(--ink); }
.page-subtitle { margin-top: 6px; color: var(--ink-3); font-size: 14px; max-width: 62ch; }
.page-header__meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.page-header__meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* sélecteur de période */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--hover); border: 1px solid var(--line); border-radius: var(--r);
}
.seg a, .seg button {
  height: 28px; padding: 0 12px; border-radius: 6px;
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  border: 0; background: transparent; cursor: pointer; text-decoration: none;
  transition: background .12s, color .12s, box-shadow .12s;
}
.seg a:hover, .seg button:hover { color: var(--ink); text-decoration: none; }
.seg .on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ─── Boutons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border-radius: var(--r); border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--ink);
  font: 500 13.5px/1 var(--font);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: background .12s, border-color .12s, box-shadow .12s, transform .08s;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 16px; height: 16px; color: var(--ink-3); }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(194, 65, 12, .3), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-primary .ico { color: rgba(255, 255, 255, .85); }
.btn-ghost { background: var(--panel); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-danger { color: var(--bad); }

/* ════════════════════════════════════════════════════════════════════════
   CARTES, INDICATEURS, PANNEAUX
   ════════════════════════════════════════════════════════════════════════ */
.anim-stack > * { animation: sxRise .38s var(--ease) both; }
.anim-stack > *:nth-child(2) { animation-delay: .03s; }
.anim-stack > *:nth-child(3) { animation-delay: .06s; }
.anim-stack > *:nth-child(4) { animation-delay: .09s; }
.anim-stack > *:nth-child(5) { animation-delay: .12s; }
.anim-stack > *:nth-child(n+6) { animation-delay: .15s; }
@keyframes sxRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.kpi-grid, .stk-summary, .reperes {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.kpi-card, .stk-tile, .repere {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--shadow-xs); position: relative; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
.kpi-card:hover, .stk-tile:hover, .repere:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.kpi-card__label, .stk-tile__label, .repere__lab {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; text-transform: none;
}
.kpi-card__icon { display: none; }
.kpi-card__value, .stk-tile__value, .repere__val {
  margin-top: 8px; font-size: 26px; font-weight: 600; letter-spacing: -.025em;
  line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stk-tile__value .u, .repere__val .u, .kpi-card__value .u { font-size: 14px; font-weight: 500; margin-left: 2px; }
.kpi-card__sub, .stk-tile__foot, .repere__sub { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.kpi-card__sub strong { color: var(--ink-2); font-weight: 600; }
.stk-tile[data-tone="warn"] .stk-tile__value { color: var(--warn); }
.stk-tile[data-tone="out"] .stk-tile__value { color: var(--bad); }
.stk-tile[data-tone="warn"]::after, .stk-tile[data-tone="out"]::after {
  content: ""; position: absolute; top: 18px; right: 18px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft);
}
.stk-tile[data-tone="out"]::after { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.stk-tile[data-tone="hero"] {
  background: linear-gradient(180deg, var(--brand-soft), var(--panel) 70%);
  border-color: var(--brand-line);
}

.delta {
  display: inline-flex; align-items: center; gap: 3px;
  height: 22px; padding: 0 7px; border-radius: 999px;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.delta .ico { width: 13px; height: 13px; stroke-width: 2.2; }
.delta[data-s="up"] { background: var(--ok-soft); color: var(--ok); }
.delta[data-s="down"] { background: var(--bad-soft); color: var(--bad); }
.delta[data-s="flat"] { background: var(--hover); color: var(--ink-3); }

.spark { width: 100%; height: 34px; margin-top: 10px; overflow: visible; }
.spark path.l { fill: none; stroke: var(--c1); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark path.a { fill: var(--c1); opacity: .10; stroke: none; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs); padding: 18px 20px; margin-bottom: 20px; min-width: 0;
}
.panel__header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: -18px -20px 16px; padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.panel__title { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.panel__sub { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.panel > .table-wrap { margin-left: -20px; margin-right: -20px; }
.panel > .table-wrap:last-child { margin-bottom: -18px; }
.panel > .table-wrap:last-child table.gn tbody tr:last-child td { border-bottom: 0; }
.panel > .table-wrap:last-child table.gn tbody tr:last-child td:first-child { border-bottom-left-radius: var(--r-lg); }
.panel > .table-wrap:last-child table.gn tbody tr:last-child td:last-child { border-bottom-right-radius: var(--r-lg); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.grid-half { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid-2 > .panel, .grid-half > .panel { margin-bottom: 0; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.detail-grid > .panel { margin-bottom: 0; }

.chart-container { position: relative; height: 280px; }
.chart-container.tall { height: 340px; }

/* ─── Tables ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.gn { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.gn thead th {
  background: var(--panel-2); color: var(--ink-3);
  font-size: 12px; font-weight: 500; text-align: left; letter-spacing: 0; text-transform: none;
  padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.gn tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  color: var(--ink-2); vertical-align: middle;
}
table.gn th:first-child, table.gn td:first-child { padding-left: 20px; }
table.gn th:last-child, table.gn td:last-child { padding-right: 20px; }
table.gn tbody tr { transition: background .1s; }
table.gn tbody tr[onclick] { cursor: pointer; }
table.gn tbody tr:hover td { background: var(--panel-2); }
table.gn tbody td strong, table.gn tbody td b { color: var(--ink); font-weight: 550; }
table.gn tbody td a { color: var(--ink); font-weight: 500; }
table.gn tbody td a:hover { color: var(--brand-ink); }
table.gn tfoot td { padding: 11px 14px; font-weight: 600; color: var(--ink); border-top: 1px solid var(--line-strong); }

.progress-bar { height: 6px; border-radius: 999px; background: var(--hover); overflow: hidden; min-width: 60px; }
.progress-bar__fill { height: 100%; border-radius: 999px; background: var(--c1); transition: width .6s var(--ease); }

/* ─── Badges ─────────────────────────────────────────────────────────── */
.badge, .stk-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--hover); color: var(--ink-2); border: 0;
}
.badge-ok, .stk-badge[data-s="ok"] { background: var(--ok-soft); color: var(--ok); }
.badge-bad, .stk-badge[data-s="rupture"] { background: var(--bad-soft); color: var(--bad); }
.badge-warn, .stk-badge[data-s="bas"] { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--hover); color: var(--ink-2); }
.badge-live::before, .badge-ok::before, .badge-bad::before, .badge-warn::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none;
}
.badge-live::before { animation: sxBlink 1.6s ease-in-out infinite; }
@keyframes sxBlink { 50% { opacity: .35; } }
.badge-dot { display: none !important; }

/* ─── Formulaires ────────────────────────────────────────────────────── */
.form-field, .stk-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-label, .stk-field > label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.form-input, .stk-input, .stk-select {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--panel); color: var(--ink);
  font: 400 14px var(--font);
  box-shadow: var(--shadow-xs);
  transition: border-color .12s, box-shadow .12s;
}
textarea.form-input { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.form-input:hover, .stk-input:hover, .stk-select:hover { border-color: var(--ink-3); }
.form-input:focus, .stk-input:focus, .stk-select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
select.form-input, .stk-select {
  -webkit-appearance: none; appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2384848E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.stk-input.big { height: 46px; font-size: 20px; font-weight: 600; text-align: center; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stk-hint { margin-top: 6px; font-size: 12px; color: var(--ink-3); min-height: 16px; }
.stk-preview b { color: var(--ink); font-weight: 600; }
.amount-input { text-align: right; font-variant-numeric: tabular-nums; }
.payment-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.remove-row { flex: none; }

/* ─── Messages & encarts ─────────────────────────────────────────────── */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--r-lg);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: 13.5px; color: var(--ink);
  animation: sxRise .3s var(--ease) both;
  transition: opacity .4s, transform .4s, max-height .4s, margin .4s;
  overflow: hidden;
}
.flash::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--info);
  box-shadow: 0 0 0 3px var(--info-soft);
}
.flash.success::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.flash.danger::before { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.flash.warning::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.flash.fading { opacity: 0; transform: translateY(-4px); max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; border-width: 0; }

.alert-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-xs);
}
.alert-card__icon {
  flex: none; width: 32px; height: 32px; border-radius: var(--r);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--warn-soft); color: var(--warn);
}
.alert-card[data-niveau="danger"] .alert-card__icon { background: var(--bad-soft); color: var(--bad); }
.alert-card[data-niveau="info"] .alert-card__icon { background: var(--info-soft); color: var(--info); }
.alert-card__body { flex: 1; min-width: 0; }
.alert-card__title { font-weight: 600; font-size: 14px; color: var(--ink); }
.alert-card__msg { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.alert-card__time { margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.alert-card > form { flex: none; }
.alert-card__details { margin-top: 10px; }
.alert-card__details summary { cursor: pointer; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.alert-card__details summary:hover { color: var(--ink); }
.alert-card__details pre {
  margin: 8px 0 0; padding: 12px; overflow-x: auto; font-size: 11.5px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r);
}

.story-banner, .rnt-warn {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; margin-bottom: 20px; border-radius: var(--r-lg);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-xs);
}
.story-banner__icon {
  flex: none; width: 32px; height: 32px; border-radius: var(--r);
  display: grid; place-items: center; font-size: 15px;
  background: var(--brand-soft); color: var(--brand-ink);
}
.story-banner__content { flex: 1; min-width: 0; }
.story-banner__title { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.story-banner__sub { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.story-banner__sub em, .story-banner__title em { font-style: normal; color: var(--ink); font-weight: 600; }
.story-banner__illustration { display: none; }
.rnt-warn { border-color: rgba(161, 92, 7, .25); background: var(--warn-soft); }
.rnt-warn__ico {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--warn); color: var(--panel); font-weight: 700; font-size: 13px;
}
.rnt-warn__txt { flex: 1; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.rnt-warn__txt strong { color: var(--ink); }

/* ─── Listes classées ────────────────────────────────────────────────── */
.ranked-list { display: flex; flex-direction: column; }
/* En flex et non en grille : selon la page, une ligne a un rang, un avatar,
   une icône de paiement… ou pas. Chaque élément garde sa largeur. */
.ranked-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.ranked-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ranked-item__rank { flex: none; width: 18px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }
.ranked-item__avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; font-size: 13px;
}
.ranked-item__pay {
  flex: none; width: 32px; height: 32px; border-radius: var(--r);
  display: grid; place-items: center; background: var(--hover); color: var(--ink-2);
}
.ranked-item__info { flex: 1; min-width: 0; }
.ranked-item__value { flex: none; }
.ranked-item__name { font-size: 13.5px; font-weight: 550; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranked-item__sub { font-size: 12px; color: var(--ink-3); }
.ranked-item__value { font-weight: 600; font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink); }

dl.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; font-size: 13.5px; }
dl.detail-list dt { color: var(--ink-3); }
dl.detail-list dd { margin: 0; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ─── États vides ────────────────────────────────────────────────────── */
.rbt-empty, .empty {
  text-align: center; padding: 40px 16px; color: var(--ink-3); font-size: 13.5px;
}
.rbt-empty__ico {
  width: 42px; height: 42px; margin: 0 auto 12px; border-radius: 12px;
  display: grid; place-items: center; font-size: 18px;
  background: var(--hover); color: var(--ink-3);
}

/* ════════════════════════════════════════════════════════════════════════
   TABLEAU DE BORD — bloc du jour et rythme horaire
   ════════════════════════════════════════════════════════════════════════ */
.jour {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm); padding: 22px 24px 18px; margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.jour::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 160px; pointer-events: none;
  background: radial-gradient(600px 160px at 0% 0%, var(--brand-soft), transparent 70%);
}
.jour__haut { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; position: relative; }
.jour__quand { font-size: 12.5px; font-weight: 500; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.jour__montant {
  margin-top: 8px; font-size: clamp(34px, 5.4vw, 48px); font-weight: 650; line-height: 1;
  letter-spacing: -.035em; color: var(--ink); font-variant-numeric: tabular-nums;
}
.jour__montant .u { font-size: 17px; font-weight: 500; letter-spacing: 0; margin-left: 6px; color: var(--ink-3); }
.jour__compare { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.jour__delta {
  display: inline-flex; align-items: center; gap: 3px;
  height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.jour__delta[data-s="up"] { background: var(--ok-soft); color: var(--ok); }
.jour__delta[data-s="down"] { background: var(--bad-soft); color: var(--bad); }
.jour__delta[data-s="flat"] { background: var(--hover); color: var(--ink-3); }
.jour__cotes { display: flex; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--panel); }
.jour__cotes > div { padding: 12px 18px; min-width: 128px; }
.jour__cotes > div + div { border-left: 1px solid var(--line); }
.jour__cote-lab { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.jour__cote-val { margin-top: 4px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.jour__cote-sub { font-size: 12px; color: var(--ink-3); }

.rythme { margin-top: 22px; position: relative; }
.rythme__barres { display: flex; align-items: flex-end; gap: 4px; height: 76px; }
.rythme__h { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.rythme__bar {
  width: 100%; height: 0; min-height: 2px; border-radius: 4px 4px 2px 2px;
  background: color-mix(in srgb, var(--c1) 70%, transparent);
  transition: height .7s var(--ease), background .2s;
}
.rythme__h:hover .rythme__bar { background: var(--c1); }
.rythme__h[data-etat="futur"] .rythme__bar {
  background: repeating-linear-gradient(135deg, var(--hover), var(--hover) 3px, transparent 3px, transparent 6px);
  height: 100% !important; opacity: .7; border-radius: 4px;
}
.rythme__h[data-etat="maintenant"] .rythme__bar { background: var(--c1); box-shadow: 0 0 0 3px var(--brand-soft); }
.rythme__h[data-etat="maintenant"]::after {
  content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--c1);
}
.rythme__axe { display: flex; gap: 4px; margin-top: 12px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rythme__axe span { flex: 1; text-align: center; min-width: 0; }
.rythme__axe span[data-fort] { color: var(--brand-ink); font-weight: 600; }
.rythme__legende {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-3);
}
.rythme__legende strong { color: var(--ink) !important; font-weight: 600; }

.repere__val { font-size: 21px; }

.jour__quand .sx-live__dot { flex: none; }
.jour__delta .ico { width: 13px; height: 13px; stroke-width: 2.2; }
.jour__cote-val { white-space: nowrap; }

/* Indicateurs : variation sur la ligne du libellé, mini-courbe en pied. */
.kpi-card { display: flex; flex-direction: column; }
.kpi-card .spark { margin-top: auto; padding-top: 14px; height: 46px; }
.spark--bars rect { fill: color-mix(in srgb, var(--c1) 24%, transparent); }
.spark--bars rect.on { fill: var(--c1); }

/* Légende des graphiques, dans l'en-tête du panneau. */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend__sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c1); }
.legend__sw--soft { background: color-mix(in srgb, var(--c1) 32%, transparent); }
.legend__sw--dash { height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--ink-3); width: 14px; }

.panel__link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  padding: 4px 8px; margin: -4px -8px; border-radius: var(--r-sm);
  transition: background .12s, color .12s;
}
.panel__link .ico { width: 14px; height: 14px; transition: transform .15s var(--ease); }
.panel__link:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.panel__link:hover .ico { transform: translateX(2px); }
.panel__header > .panel__link { margin-left: auto; }

/* Colonne droite du tableau de bord : panneaux empilés. */
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stack > .panel { margin-bottom: 0; }
.ranked-item__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ranked-item__row .ranked-item__name { min-width: 0; }

/* Accès rapides : liste de liens d'action. */
.quick { display: flex; flex-direction: column; margin: -6px -10px; }
.quick a {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r);
  font-size: 13.5px; font-weight: 500; color: var(--ink);
  transition: background .12s;
}
.quick a:hover { background: var(--hover); text-decoration: none; }
.quick a > .ico:first-child {
  width: 30px; height: 30px; padding: 7px; border-radius: var(--r);
  background: var(--brand-soft); color: var(--brand-ink); stroke-width: 1.9;
}
.quick a span { flex: 1; min-width: 0; }
.quick a > .ico:last-child { width: 14px; height: 14px; color: var(--ink-3); transition: transform .15s var(--ease); }
.quick a:hover > .ico:last-child { transform: translateX(2px); color: var(--ink); }

.progress-bar--thin { height: 4px; margin-top: 7px; min-width: 0; }
.share { display: flex; align-items: center; gap: 10px; }
.share .progress-bar { flex: 1; }
.share span { width: 40px; text-align: right; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Une teinte par personne, pour les reconnaître d'un coup d'œil. */
.ranked-item__avatar[data-i="1"] { background: color-mix(in srgb, var(--c2) 14%, transparent); color: var(--c2); }
.ranked-item__avatar[data-i="2"] { background: color-mix(in srgb, var(--c3) 14%, transparent); color: var(--c3); }
.ranked-item__avatar[data-i="3"] { background: color-mix(in srgb, var(--c4) 14%, transparent); color: var(--c4); }
.ranked-item__avatar[data-i="4"] { background: color-mix(in srgb, var(--c5) 14%, transparent); color: var(--c5); }
.ranked-item__avatar[data-i="5"] { background: color-mix(in srgb, var(--c6) 16%, transparent); color: var(--c6); }

.story-banner__icon .ico { width: 17px; height: 17px; }
.story-banner[data-ton="warn"] { border-color: color-mix(in srgb, var(--warn) 28%, var(--line)); }
.story-banner[data-ton="warn"] .story-banner__icon { background: var(--warn-soft); color: var(--warn); }
.rbt-empty__ico .ico { width: 20px; height: 20px; }

.btn-icon { width: 34px; padding: 0; }
.btn-alert .ico { color: var(--warn); }

/* ════════════════════════════════════════════════════════════════════════
   STOCK, REBUT, RENTABILITÉ, PRODUCTION, DÉPENSES
   ════════════════════════════════════════════════════════════════════════ */
.stk-list { margin: -2px -20px -18px; }
.stk-head, .stk-row {
  display: grid; grid-template-columns: minmax(150px, 1.4fr) 96px minmax(150px, 1.3fr) 120px auto;
  align-items: center; gap: 14px; padding: 0 20px;
}
.stk-head { height: 36px; background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--ink-3); }
.stk-head .r, .stk-row .r { text-align: right; }
.stk-row { min-height: 60px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); transition: background .1s; }
.stk-row:last-child { border-bottom: 0; }
.stk-row:hover { background: var(--panel-2); }
.stk-name { display: flex; align-items: center; gap: 10px; font-weight: 550; font-size: 13.5px; color: var(--ink); min-width: 0; }
.stk-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); }
.stk-dot[data-s="bas"] { background: var(--warn); }
.stk-dot[data-s="rupture"] { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.stk-qty { text-align: right; font-variant-numeric: tabular-nums; }
.stk-qty b { font-size: 15px; font-weight: 600; color: var(--ink); }
.stk-qty .u { font-size: 12px; margin-left: 3px; }
.stk-gauge { display: flex; flex-direction: column; gap: 6px; }
.stk-gauge__track { position: relative; height: 6px; border-radius: 999px; background: var(--hover); }
.stk-gauge__fill { height: 100%; width: 0; border-radius: 999px; background: var(--ok); transition: width .8s var(--ease); }
.stk-gauge__fill[data-s="bas"] { background: var(--warn); }
.stk-gauge__fill[data-s="rupture"] { background: var(--bad); }
.stk-gauge__mark { position: absolute; top: -3px; bottom: -3px; left: 50%; width: 2px; border-radius: 2px; background: var(--ink-3); opacity: .5; }
.stk-gauge__cap { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.stk-gauge__cap span[style] { margin-left: 0 !important; }
.stk-val { text-align: right; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stk-actions { display: flex; gap: 6px; justify-content: flex-end; }
.stk-act {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink-2);
  font: 500 12.5px var(--font); cursor: pointer; box-shadow: var(--shadow-xs);
  transition: background .12s, color .12s, border-color .12s;
}
.stk-act:hover { background: var(--hover); color: var(--ink); }
.stk-act .g { font-size: 12px; color: var(--ink-3); }

.stk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--r);
  font: 500 13.5px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  box-shadow: var(--shadow-xs); transition: background .12s, filter .12s, transform .08s;
}
.stk-btn:hover { background: var(--hover); text-decoration: none; }
.stk-btn:active { transform: translateY(1px); }
.stk-btn--go { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(194, 65, 12, .3), inset 0 1px 0 rgba(255, 255, 255, .14); }
.stk-btn--go:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

/* boîtes de dialogue */
.stk-backdrop {
  position: fixed; inset: 0; z-index: 400; background: rgba(10, 10, 12, .45);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.stk-backdrop.open { opacity: 1; pointer-events: auto; }
.stk-modal {
  position: fixed; z-index: 401; left: 50%; top: 50%;
  width: min(440px, calc(100vw - 32px));
  transform: translate(-50%, -48%) scale(.98);
  background: var(--panel); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; overflow: hidden;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.stk-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.stk-modal--large { width: min(680px, calc(100vw - 32px)); }
.stk-modal__head { padding: 18px 20px 0; }
.stk-modal__title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.stk-modal__sub { margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.stk-modal__body { padding: 16px 20px 20px; }
.stk-modal__cur {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px;
  padding: 10px 14px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line);
}
.stk-modal__cur b { font-size: 18px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stk-modal__cur span { font-size: 12.5px; color: var(--ink-3); }
.stk-modal__foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.stk-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; margin-bottom: 16px; background: var(--hover); border-radius: var(--r); border: 1px solid var(--line); }
.stk-seg button {
  height: 34px; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 13px var(--font); color: var(--ink-2);
}
.stk-seg button .s { font-size: 13px; color: var(--ink-3); }
.stk-seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }
.stk-seg button.on .s { color: var(--brand-ink); }

/* rebut */
.rbt-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.rbt-form {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--shadow-xs); position: sticky; top: calc(var(--top-h) + 16px);
}
.rbt-form h3 { font-size: 14.5px; font-weight: 600; margin: 0 0 14px; }
.rbt-motifs { display: flex; flex-wrap: wrap; gap: 6px; }
.rbt-chip {
  height: 28px; padding: 0 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink-2);
  font: 500 12.5px var(--font); transition: all .12s;
}
.rbt-chip:hover { background: var(--hover); }
.rbt-chip.on { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.rbt-tag { display: inline-flex; align-items: center; gap: 8px; }
.rbt-tag::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c1); }

/* rentabilité */
.rnt-cout {
  font: 500 13px var(--font); font-variant-numeric: tabular-nums;
  height: 26px; padding: 0 9px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px dashed var(--line-strong); background: transparent; color: var(--ink-2);
  transition: all .12s;
}
.rnt-cout:hover { border-style: solid; border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.rnt-cout[data-vide] { color: var(--warn); border-color: rgba(161, 92, 7, .35); font-size: 12px; }
.rnt-neg { color: var(--bad) !important; }
.rnt-pct { display: inline-flex; height: 22px; padding: 0 8px; align-items: center; border-radius: 999px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rnt-pct[data-lvl="bon"] { background: var(--ok-soft); color: var(--ok); }
.rnt-pct[data-lvl="moyen"] { background: var(--info-soft); color: var(--info); }
.rnt-pct[data-lvl="faible"] { background: var(--warn-soft); color: var(--warn); }
.rnt-masse { max-height: min(58vh, 520px); overflow-y: auto; }
.rnt-masse__row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 74px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rnt-masse__name { font-size: 13.5px; font-weight: 550; color: var(--ink); min-width: 0; }
.rnt-masse__meta { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); margin-top: 1px; }
.rnt-masse__input { height: 32px; font-size: 13px; }
.rnt-masse__hint { font-size: 12px; font-weight: 600; color: var(--ok); text-align: right; }
.rnt-masse__hint[data-neg] { color: var(--bad); }

.fam-list { display: flex; flex-direction: column; margin: -6px 0; }
.fam-row {
  display: grid; grid-template-columns: minmax(140px, 1.1fr) minmax(90px, 1.6fr) 48px 120px 80px;
  align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line);
}
.fam-row:last-child { border-bottom: 0; }
.fam-row__nom { font-size: 13.5px; font-weight: 550; color: var(--ink); }
.fam-row__nb { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.fam-row__bar { height: 6px; border-radius: 999px; background: var(--hover); overflow: hidden; }
.fam-row__fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--c1); transition: width .8s var(--ease); }
.fam-row__part { text-align: right; font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.fam-row__ca { text-align: right; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fam-row__marge { text-align: right; }
.fam-row__inconnu { font-size: 12px; color: var(--ink-3); }

/* dépenses : cascade du résultat */
.cascade {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1.15fr;
  align-items: stretch; margin-bottom: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs); overflow: hidden;
}
.cascade__step { padding: 16px 18px; min-width: 0; }
.cascade__op { display: grid; place-items: center; width: 28px; color: var(--ink-3); font-size: 16px; background: var(--panel-2); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.cascade__lab { font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.cascade__val { margin-top: 6px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cascade__val .u { font-size: 12.5px; }
.cascade__sub { margin-top: 3px; font-size: 12px; color: var(--ink-3); }
.cascade__step[data-t="positif"] { background: var(--ok-soft); }
.cascade__step[data-t="positif"] .cascade__val { color: var(--ok); }
.cascade__step[data-t="negatif"] { background: var(--bad-soft); }
.cascade__step[data-t="negatif"] .cascade__val { color: var(--bad); }

/* production */
.prd-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 18px 20px; margin-bottom: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
}
.prd-head__label { font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.prd-head__value { margin-top: 2px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.prd-head__meta { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }
.prd-head__optlabel { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.prd-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--hover); border: 1px solid var(--line); border-radius: var(--r); }
.prd-seg a { height: 28px; padding: 0 12px; border-radius: 6px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.prd-seg a:hover { color: var(--ink); text-decoration: none; }
.prd-seg a.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }
.prd-list { margin: -6px -20px 0; }
.prd-item {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 64px 160px 72px;
  align-items: center; gap: 14px; padding: 11px 20px; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background .1s, opacity .2s;
}
.prd-item:hover { background: var(--panel-2); }
.prd-item.done { opacity: .5; }
.prd-item.done .prd-item__name { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.prd-check { position: absolute; opacity: 0; width: 0; height: 0; }
.prd-item__box {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong);
  display: grid; place-items: center; background: var(--panel); transition: all .15s;
}
.prd-item__box::after {
  content: ""; width: 9px; height: 5px; margin-top: -2px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(.4); opacity: 0; transition: all .15s;
}
.prd-item.done .prd-item__box { background: var(--ok); border-color: var(--ok); }
.prd-item.done .prd-item__box::after { opacity: 1; transform: rotate(-45deg) scale(1); }
.prd-check:focus-visible + .prd-item__box { box-shadow: var(--ring); }
.prd-item__name { font-size: 13.5px; font-weight: 550; color: var(--ink); min-width: 0; }
.prd-item__qty { text-align: right; }
.prd-item__qty b { font-size: 18px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.prd-item__range { font-size: 12px; color: var(--ink-3); }
.prd-tag {
  display: inline-flex; height: 18px; align-items: center; padding: 0 6px; margin-left: 6px; border-radius: 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  background: var(--warn-soft); color: var(--warn); vertical-align: 1px;
}
.prd-tag[data-t="instable"] { background: var(--bad-soft); color: var(--bad); }
.prd-tag[data-t="unique"] { background: var(--hover); color: var(--ink-3); }
.prd-spark { display: flex; align-items: flex-end; gap: 3px; height: 24px; justify-content: flex-end; }
.prd-spark__bar { width: 6px; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--c1) 60%, transparent); transition: height .45s var(--ease); }
.prd-foot { display: flex; align-items: center; gap: 12px; padding-top: 14px; font-size: 12.5px; color: var(--ink-3); }
.prd-progress { flex: 1; height: 6px; border-radius: 999px; background: var(--hover); overflow: hidden; }
.prd-progress__fill { display: block; height: 100%; width: 0; background: var(--ok); transition: width .35s var(--ease); }
.prd-bilan { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.prd-bilan__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.prd-bilan__title { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.prd-mini { list-style: none; margin: 0; padding: 0; }
.prd-mini li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.prd-mini li b { color: var(--ink); font-variant-numeric: tabular-nums; }
.prd-mini__empty { font-size: 13px; color: var(--ink-3); padding: 6px 0; }
.prd-link { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 500; }

/* ════════════════════════════════════════════════════════════════════════
   CONNEXION
   ════════════════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(800px 400px at 50% -10%, var(--brand-soft), transparent 70%),
    var(--bg);
  position: relative; overflow: hidden;
}
.login-page::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(520px 340px at 50% 30%, #000, transparent 75%);
  mask-image: radial-gradient(520px 340px at 50% 30%, #000, transparent 75%);
}
.login-card {
  position: relative; width: min(400px, 100%);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: 30px 28px 24px;
  animation: sxRise .45s var(--ease) both;
}
.login-card__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-card__logo-img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.login-card__title { font-size: 20px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.login-card__subtitle { margin-top: 4px; margin-bottom: 20px; font-size: 13.5px; color: var(--ink-3); }
.login-card__sub { margin-top: 18px; text-align: center; font-size: 12px; color: var(--ink-3); }
.login-card .btn { width: 100%; height: 38px; margin-top: 6px; }
.login-card .form-input { height: 40px; }

/* ════════════════════════════════════════════════════════════════════════
   COMPORTEMENTS : progression, boutons occupés, évitement
   ════════════════════════════════════════════════════════════════════════ */
.nav-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 9999;
  background: linear-gradient(90deg, var(--brand), #F59E0B);
  opacity: 0; pointer-events: none; transition: width .25s ease, opacity .2s ease;
}
.nav-progress.on { opacity: 1; }
.is-busy { position: relative; pointer-events: none; color: transparent !important; }
.is-busy .ico { opacity: 0; }
.is-busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; color: var(--ink-2);
  animation: sxSpin .6s linear infinite;
}
.btn-primary.is-busy::after, .stk-btn--go.is-busy::after { color: #fff; }
@keyframes sxSpin { to { transform: rotate(360deg); } }
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 10000;
  background: var(--ink); color: var(--panel); padding: 9px 14px; border-radius: var(--r);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 8px; }

/* ════════════════════════════════════════════════════════════════════════
   COMPARER, OUTILS ADMIN
   ════════════════════════════════════════════════════════════════════════ */
.cmp-form {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: end; gap: 16px; padding: 16px 20px;
}
.cmp-periode { border: 0; margin: 0; padding: 0; min-width: 0; }
.cmp-periode legend {
  display: inline-flex; align-items: center; gap: 7px; padding: 0; margin-bottom: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.cmp-periode legend i, .cmp-legende i {
  width: 10px; height: 10px; border-radius: 3px; background: var(--c1); flex: none;
}
.cmp-periode[data-p="b"] legend i, .cmp-legende [data-p="b"] i { background: var(--ink-3); }
.cmp-periode__dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp-periode__dates .form-field { margin-bottom: 0; }
.cmp-vs {
  align-self: end; height: 36px; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em;
}
.cmp-go { height: 36px; }
.cmp-legende { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 14px; font-size: 13px; color: var(--ink-3); }
.cmp-legende span { display: inline-flex; align-items: center; gap: 7px; }
.cmp-legende b { color: var(--ink); font-weight: 600; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 24px; }
.tool-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px; box-shadow: var(--shadow-xs); color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s var(--ease);
}
.tool-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.tool-card__ico {
  flex: none; width: 36px; height: 36px; border-radius: var(--r);
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink);
}
.tool-card__ico .ico { width: 18px; height: 18px; }
.tool-card__title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink); }
.tool-card__title .ico { width: 14px; height: 14px; color: var(--ink-3); transition: transform .15s var(--ease); }
.tool-card:hover .tool-card__title .ico { transform: translateX(2px); color: var(--ink); }
.tool-card__txt { margin-top: 3px; font-size: 13px; color: var(--ink-3); line-height: 1.45; }

.stk-btn--ghost { background: var(--panel); }
.stk-act .ico { width: 14px; height: 14px; color: var(--ink-3); }
.alert-card__icon .ico { width: 16px; height: 16px; }
.back-link {
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3);
}
.back-link .ico { width: 14px; height: 14px; transform: rotate(180deg); }
.back-link:hover { color: var(--ink); text-decoration: none; }
code, .t-code {
  font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 5px;
  background: var(--hover); color: var(--ink-2);
}

/* ════════════════════════════════════════════════════════════════════════
   PETITS ÉCRANS
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .rbt-grid { grid-template-columns: minmax(0, 1fr); }
  .rbt-form { position: static; }
}
@media (max-width: 960px) {
  .sx, html[data-side="collapsed"] .sx { grid-template-columns: minmax(0, 1fr); }
  .sx-side {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(288px, 86vw); height: auto;
    transform: translateX(-102%); transition: transform .22s var(--ease); box-shadow: var(--shadow-lg);
  }
  .sx-side.open { transform: none; }
  html[data-side="collapsed"] .sx-ws__txt, html[data-side="collapsed"] .sx-search span,
  html[data-side="collapsed"] .sx-nav__label, html[data-side="collapsed"] .sx-nav__txt,
  html[data-side="collapsed"] .sx-me__txt, html[data-side="collapsed"] .sx-collapse-hide { display: revert; }
  .sx-collapse-btn { display: none; }
  .sx-top { padding: 0 16px; }
  .sx-top__menu, .sx-top__search { display: inline-grid; }
  .main { padding: 20px 16px 32px; }
  .footer { padding: 14px 16px 22px; }
  .sx-live__txt { display: none; }
}
@media (max-width: 820px) {
  .page-title { font-size: 21px; }
  .grid-half, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-grid, .stk-summary, .reperes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi-card__value, .stk-tile__value { font-size: 21px; }
  .jour { padding: 18px 16px 16px; }
  .jour__cotes { width: 100%; }
  .jour__cotes > div { flex: 1; min-width: 0; padding: 10px 12px; }
  .jour__cote-val { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
  .page-header__actions .btn:not(.btn-icon):not(.btn-primary):not(.btn-alert) { padding: 0 10px; }
  .rythme__barres { height: 58px; gap: 2px; }
  .rythme__axe span:nth-child(even) { visibility: hidden; }
  .stk-head { display: none; }
  .stk-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding-top: 14px; padding-bottom: 14px; }
  .stk-row .stk-gauge, .stk-row .stk-actions { grid-column: 1 / -1; }
  .stk-row .stk-val { grid-column: 1 / -1; text-align: left; font-size: 12px; color: var(--ink-3); }
  .stk-actions { justify-content: flex-start; }
  .cascade { grid-template-columns: minmax(0, 1fr); }
  .cascade__op { width: auto; height: 22px; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .prd-item { grid-template-columns: 20px minmax(0, 1fr) 56px; }
  .prd-item__range, .prd-spark { display: none; }
  .prd-bilan, .prd-bilan__cols { grid-template-columns: minmax(0, 1fr); }
  .fam-row { grid-template-columns: minmax(0, 1fr) 52px 70px; gap: 8px 10px; }
  .fam-row__bar { grid-column: 1 / -1; order: 3; }
  .fam-row__ca { grid-column: 1 / -1; order: 4; text-align: left; font-size: 12px; color: var(--ink-3); }
  .rnt-warn, .story-banner { flex-wrap: wrap; }
  .rnt-masse__row { grid-template-columns: minmax(0, 1fr) 100px; }
  .rnt-masse__hint { grid-column: 2; }
  .payment-row { flex-wrap: wrap; }
  .cmp-form { grid-template-columns: minmax(0, 1fr); }
  .cmp-vs { height: auto; justify-self: start; }
  .cmp-go { width: 100%; }
}
@media (max-width: 420px) {
  .kpi-grid, .stk-summary, .reperes { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .sx-side, .sx-top, .footer, .page-header__actions, .nav-progress, .skip-link, .cmdk, .cmdk-overlay { display: none !important; }
  .sx { display: block; }
  body { background: #fff; }
  .panel, .kpi-card { box-shadow: none; break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
