/* SmartSIM, composants repris de app.css, communs aux lots K et L (9eb0343).
   Adaptations Dashboard Yeastar ci-dessous ; ni JS métier ni routes SmartSIM. */

@font-face { font-family: "Urbanist"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/statistics/assets/urbanist-latin.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --font: "Urbanist", system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  --fs-2xs: 11px; --fs-xs: 12px; --fs-sm: 12.5px; --fs-md: 13.5px; --fs-base: 14px; --fs-lg: 15px; --fs-xl: 17px; --fs-2xl: 20px; --fs-3xl: 22px; --fs-4xl: 26px;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 26px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --max: 1560px; --gap: 18px; --pad: 28px; --side-w: 248px;
  --bg: #e7e6e4; --side: #f2f1ef; --card: #f7f6f4; --card-2: #efeeeb; --card-3: #e3e1de; --panel: #faf9f7; --well: #1414180d;
  --ink: #1d1e21; --ink-2: #3a3b40; --muted: #65666c; --line: #14141814; --line-2: #14141826;
  --shadow: 0 1px 2px #1e18140d, 0 16px 34px -22px #1e181452; --shadow-lg: 0 2px 6px #1e181414, 0 30px 60px -24px #1e181466;
  --accent: var(--brand-accent, #ee5230); --accent-from: var(--brand-from, #ff7b3a); --accent-to: var(--brand-to, #e4402f); --accent-ink: var(--brand-ink, #1f0a04); --accent-soft: var(--brand-soft, #ee523024); --accent-text: var(--brand-text-light, #b5361b); --accent-glow: var(--brand-glow, #e43c2473);
  --grad: linear-gradient(140deg, var(--accent-from), var(--accent) 50%, var(--accent-to));
  --thumb: #1d1e21; --on-thumb: #f7f6f4;
  --data: #7d8087; --data-2: #b4b6bb;
  --good: #1d7446; --warn: #8a5807; --bad: #b3222f; --info: #2a5c99;
  --good-soft: #1e825021; --warn-soft: #d7961e2e; --bad-soft: #cd283c1c; --info-soft: #2a5c991f;
  font-family: var(--font); font-size: 14px; line-height: 1.5;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #26282c; --side: #1f2124; --card: #2f3135; --card-2: #36383d; --card-3: #3f4147; --panel: #323439; --well: #ffffff0a;
  --ink: #f3f1ed; --ink-2: #d4d2ce; --muted: #a4a4a9; --line: #ffffff0f; --line-2: #ffffff1f;
  --shadow: 0 1px 1px #00000040, 0 22px 40px -22px #000000bf; --shadow-lg: 0 2px 6px #0006, 0 34px 70px -24px #000000e6;
  --accent: var(--brand-accent, #f0552f); --accent-from: var(--brand-from, #ff7c3c); --accent-to: var(--brand-to, #e8402f); --accent-ink: var(--brand-ink, #1f0a04); --accent-soft: var(--brand-soft, #f0552f2b); --accent-text: var(--brand-text-dark, #ff8c62); --accent-glow: var(--brand-glow, #f046286b);
  --thumb: #f3f1ed; --on-thumb: #26282c;
  --data: #85888e; --data-2: #6a6d73;
  --good: #74d6a0; --warn: #f4c46e; --bad: #ff8a92; --info: #94bcf2;
  --good-soft: #74d6a021; --warn-soft: #f4c46e24; --bad-soft: #ff8a9221; --info-soft: #94bcf221;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scrollbar-color: var(--data-2) var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button, select, summary { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, a, input, select, summary { scroll-margin-top: 110px; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: fixed; top: 8px; left: 8px; padding: 12px 16px; background: var(--card); color: var(--ink); border: 2px solid var(--accent); border-radius: var(--r-sm); z-index: 60; transform: translateY(-160%); }
.skip:focus { transform: none; }


.side { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--side-w); display: flex; flex-direction: column; gap: 6px; padding: 18px 16px 16px; background: var(--side); box-shadow: inset -1px 0 0 var(--line-2); overflow: hidden auto; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.side__head { display: flex; align-items: center; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 11px; min-height: 44px; color: var(--ink); text-decoration: none; border-radius: var(--r-md); }
.brand__text { display: grid; min-width: 0; line-height: 1.15; }
.brand__text b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.brand__text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand__text b { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.01em; }
.brand__text small { font-size: var(--fs-2xs); color: var(--muted); font-weight: 500; }
.mark { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; color: var(--accent-ink); background: var(--grad); box-shadow: inset 0 1px 0 #ffffff80, 0 8px 16px -8px var(--accent-glow); }

.snav { display: flex; flex: 1; flex-direction: column; gap: 4px; min-height: 0; }
.snav__group { display: grid; gap: 2px; margin-bottom: 14px; }
.side__group { padding: 0 12px 6px; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.snav__item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--r-md); color: var(--muted); font-size: var(--fs-md); font-weight: 600; text-decoration: none; transition: background .2s var(--ease), color .2s var(--ease); }
.snav__item:hover { background: var(--well); color: var(--ink); text-decoration: none; }
.snav__item[aria-current="page"] { background: var(--grad); color: var(--accent-ink); box-shadow: inset 0 1px 0 #ffffff59, 0 10px 22px -12px var(--accent-glow); }

.frame { margin-left: var(--side-w); min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 16px var(--pad) 14px; background: var(--bg); }
.top__mark, .top__title { display: none; }
.topsearch { display: flex; align-items: center; gap: 10px; flex: 0 1 420px; min-width: 0; height: 44px; padding: 0 14px; border-radius: 99px; background: var(--card); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; }
.today { display: flex; align-items: center; gap: 10px; margin: 0 10px 0 0; font-size: var(--fs-md); font-weight: 600; text-transform: capitalize; white-space: nowrap; }
.today::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ibtn { display: grid; place-items: center; flex: none; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 13px; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .2s var(--ease); }
.ibtn:hover { background: var(--card-2); }
.ibtn__sun { display: none; }
.ibtn__moon { display: grid; }
[data-theme="dark"] .ibtn__sun { display: grid; }
[data-theme="dark"] .ibtn__moon { display: none; }
.me { display: flex; align-items: center; gap: 10px; height: 46px; margin: 0; padding: 0 14px 0 4px; border-radius: 15px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.me__av { width: 38px; height: 38px; padding: 8px; border-radius: 50%; color: var(--accent-ink); background: linear-gradient(140deg, #f7c9a5, #f09a7a); background: linear-gradient(140deg, color-mix(in srgb, var(--accent-from) 42%, #fff), color-mix(in srgb, var(--accent) 58%, #fff)); }
.who { color: var(--ink-2); }
.who:empty { display: none; }
main { max-width: var(--max); margin: 0 auto; padding: 6px var(--pad) 56px; }


h1 { margin: 0 0 6px; font-size: clamp(26px, 2.6vw, 37px); line-height: 1.1; font-weight: 600; letter-spacing: -.025em; overflow-wrap: anywhere; }
h2 { margin: 0 0 10px; font-size: var(--fs-lg); line-height: 1.35; font-weight: 600; }
p { margin: 0 0 12px; overflow-wrap: anywhere; }
.meta, .lead { color: var(--muted); font-size: var(--fs-sm); line-height: 1.55; }
.meta { margin: 4px 0 0; }
.phead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 22px; }
.phead__eyebrow { margin: 0 0 4px; font-size: var(--fs-md); color: var(--muted); font-weight: 500; }
.phead__lead { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-md); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 13px; color: var(--accent-ink); background: var(--grad); font-size: var(--fs-md); font-weight: 600; text-decoration: none; box-shadow: inset 0 1px 0 #ffffff59, 0 12px 24px -12px var(--accent-glow); transition: filter .2s var(--ease), transform .2s var(--ease); }
.btn:hover:not(:disabled) { filter: brightness(1.06); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.secondary { color: var(--ink); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.secondary:hover:not(:disabled) { background: var(--card-3); filter: none; }
button:disabled, select:disabled, input:disabled { cursor: not-allowed; }
.btn:disabled { color: var(--muted); background: var(--card-3); box-shadow: none; opacity: .75; }
.panel { min-width: 0; margin: 0 0 var(--gap); padding: 20px 22px 22px; border-radius: var(--r-lg); background: var(--card); box-shadow: inset 0 1px 0 var(--line), inset 0 0 0 1px var(--line), var(--shadow); }
.panel > :last-child, .panel > div > :last-child { margin-bottom: 0; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 6px; min-width: 0; }

select {
  display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 44px; padding: 9px 12px; border: 0; border-radius: var(--r-md); background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); font-size: var(--fs-md);
}
select { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

select:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--accent-text); }

select:disabled { opacity: .6; }

.kpis { display: grid; grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.kpi { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 136px; padding: 16px 18px 14px; border-radius: var(--r-lg); background: var(--card); box-shadow: inset 0 1px 0 var(--line), inset 0 0 0 1px var(--line), var(--shadow); }
.kpi__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kpi__head .ico { width: 18px; height: 18px; color: var(--accent-text); }
.kpi--ember .kpi__head .ico { color: var(--accent-ink); }
.kpi__label { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.kpi__value { margin-top: auto; font-size: 32px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; }
.kpi__sub { color: var(--muted); font-size: var(--fs-sm); }
.kpi--ember { color: var(--accent-ink); background: var(--grad); box-shadow: inset 0 1px 0 #ffffff4d, 0 22px 40px -20px var(--accent-glow); }
.kpi--ember .kpi__label, .kpi--ember .kpi__sub { color: var(--accent-ink); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.two > .panel { margin: 0; }
.chead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.chead h2 { margin: 0; }

.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 14px 0 0; color: var(--muted); font-size: var(--fs-xs); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }

.tabbar { display: none; }

/* Adaptations aux seuls contrôles et indicateurs Yeastar. */
html { scroll-padding-bottom: 12px; }
main:focus { outline: none; }
.tools { flex: none; }
.topsearch { text-decoration: none; }
.topsearch:hover { background: var(--card-2); color: var(--ink); }
.topsearch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sign-in { min-height: 44px; }
.phead > div { min-width: 0; }
.scope-details { min-width: 0; max-width: 100%; }
.scope-details[open] { width: 100%; }
.scope-summary { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; min-height: 46px; padding: 8px 14px; border-radius: 13px; background: var(--card-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); font-size: var(--fs-md); font-weight: 600; cursor: pointer; }
.scope-summary::-webkit-details-marker { display: none; }
.scope-summary::after { content: ""; flex: none; width: 8px; height: 8px; margin: -4px 2px 0 4px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.scope-details[open] .scope-summary::after { transform: rotate(225deg); margin-top: 4px; }
.filter-panel { margin: 10px 0 0; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); align-items: end; gap: 12px; min-width: 0; margin: 0 0 12px; padding: 0; border: 0; }
.field { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.field select { text-overflow: ellipsis; }
#apply, #refresh { min-height: 44px; }
.notice { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; margin: -10px 0 10px; }
.notice p { margin: 0; }
#status { font-weight: 600; }
#status[data-tone="complete"] { color: var(--good); }
#status[data-tone="partial"] { color: var(--warn); }
#status[data-tone="error"], #status[data-tone="unavailable"] { color: var(--bad); }
#applied-scope, #freshness, footer { color: var(--muted); font-size: var(--fs-xs); }
#freshness span { display: block; }
.kpis { margin-top: 0; }
.kpi dd { margin-left: 0; margin-right: 0; }
.table-scroll { overflow-x: auto; margin: 10px 0; border-radius: var(--r-sm); scroll-margin-top: 110px; }
table { border-collapse: collapse; width: 100%; min-width: 850px; font-size: var(--fs-sm); }
th, td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th:first-child { text-align: left; min-width: 132px; overflow-wrap: anywhere; }
thead { background: var(--card-2); color: var(--ink-2); }
tbody tr:first-child { background: var(--well); }
.detail-sub { display: block; color: var(--muted); font-weight: 500; font-size: var(--fs-xs); }
.scroll-hint { display: none; }
.explainer { max-width: 100ch; }
footer p:last-child { margin-bottom: 0; }
@media (max-width: 1120px) { .scroll-hint { display: block; } }
@media (max-width: 1100px) { .today { display: none; } .topsearch { flex-basis: 320px; } }
@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 760px) {

  :root { --side-w: 0px; --pad: 14px; --gap: 12px; }
  .side { display: none; }
  .frame { margin-left: 0; }
  main { padding: 4px var(--pad) calc(112px + env(safe-area-inset-bottom)); }
  .top { flex-wrap: wrap; gap: 10px; padding: 10px var(--pad); }
  .top__mark { display: block; }
  .top__mark .mark { width: 36px; height: 36px; }
  .top__title { display: block; flex: 1 1 0; min-width: 0; margin: 0; overflow: hidden; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.015em; white-space: nowrap; text-overflow: ellipsis; }
  .tools { margin-left: 0; gap: 6px; }
  .ibtn { width: 44px; height: 44px; }
  .me { height: 44px; padding: 0 4px; }
  .me__av { width: 36px; height: 36px; padding: 7px; }
  body::after { content: ""; position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; height: calc(110px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 68%, transparent); pointer-events: none; }
  .topsearch { order: 5; flex: 1 1 100%; height: 44px; }
  .tabbar { position: fixed; z-index: 40; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 6px; border-radius: 24px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-lg); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; height: 54px; border-radius: 18px; color: var(--muted); font-size: 10.5px; font-weight: 600; text-decoration: none; transition: background .25s var(--ease), color .25s var(--ease); }
  .tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a[aria-current="page"] { background: var(--grad); color: var(--accent-ink); box-shadow: inset 0 1px 0 #ffffff59, 0 10px 20px -10px var(--accent-glow); }
  .panel { padding: 16px; border-radius: 18px; }
  .phead { margin: 4px 0 16px; }
  h1 { font-size: 26px; }
  .kpi { min-height: 112px; padding: 14px 14px 12px; }
  .kpi__value { font-size: 24px; }
html { scroll-padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  :is(main a, main button, main select, main summary, .table-scroll) { scroll-margin-top: 132px; }
  .me .who { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .topsearch, select { font-size: 16px; }
  .filters { gap: 10px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  #tenant-field { grid-column: 1 / -1; }
}
@media (pointer: coarse) { .btn { min-height: 44px; } }
@media (max-width: 380px) { .panel { padding: 14px; } .kpi__value { font-size: 22px; } .tabbar a { gap: 2px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (prefers-contrast: more) { :root, [data-theme="dark"] { --muted: var(--ink-2); --line: var(--line-2); } }
@media (forced-colors: active) {
  .panel, .btn, .kpi, .tabbar, .topsearch, .scope-summary, .ibtn, .me { border: 1px solid CanvasText; background: Canvas; color: CanvasText; }
  .snav__item[aria-current="page"], .tabbar a[aria-current="page"], button[aria-pressed="true"] { outline: 3px solid Highlight; }
  select { border: 1px solid FieldText; background: Field; color: FieldText; }
}
@media print {
  .side, .top, .tabbar, body::after, .scope-details, #refresh { display: none; }
  .frame { margin-left: 0; }
  .panel { break-inside: avoid; }
}

/* ---- STAT-V2 : onglets Entrants / Sortants, période, barres empilées, carte de chaleur, fiches mobiles. ----
   Sens fixes des couleurs : vert = traité / décroché, orange = manqué / non décroché, gris = non classé.
   Chaque couleur a aussi un motif (plein, hachures, points) et une icône dans la légende. */
:root { --ok: #1f8049; --miss: #d1620f; --unk: #7d8087; --ok-soft: #1f804933; --miss-soft: #d1620f33; }
[data-theme="dark"] { --ok: #4cc38a; --miss: #f59a42; --unk: #9a9da3; --ok-soft: #4cc38a33; --miss-soft: #f59a4233; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 14px; }
.controls .meta { margin: 0; }
/* Même composant que « .seg » du lot L (SmartSIM) : rayon 13/10, pastille --thumb. */
.seg { display: inline-flex; gap: 3px; max-width: 100%; padding: 3px; border-radius: 13px; background: var(--card-3); box-shadow: inset 0 0 0 1px var(--line); }
.seg__btn { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: var(--fs-md); font-weight: 600; white-space: nowrap; transition: background .2s var(--ease), color .2s var(--ease); }
.seg__btn:hover:not(:disabled) { color: var(--ink); }
.seg__btn[aria-pressed="true"] { background: var(--thumb); color: var(--on-thumb); box-shadow: 0 4px 10px -4px #00000059; }
.seg__btn:disabled { color: var(--muted); opacity: .6; }
.tabs { display: flex; gap: 8px; margin: 0 0 14px; border-bottom: 1px solid var(--line-2); }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 0; border-bottom: 3px solid transparent; border-radius: 12px 12px 0 0; background: transparent; color: var(--muted); font-size: var(--fs-lg); font-weight: 600; }
.tab:hover { background: var(--well); color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); background: var(--card); }
#panel:focus { outline: none; }
.kpi__delta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.kpi__arrow { font-size: 11px; }
.kpi__delta[data-tone="good"] { color: var(--good); }
.kpi__delta[data-tone="bad"] { color: var(--bad); }
.kpi--ember .kpi__delta, .kpi--ember .kpi__delta[data-tone] { color: var(--accent-ink); }
.kpi__value { overflow-wrap: anywhere; }
.empty { display: flex; align-items: flex-start; gap: 16px; }
.empty__ico { width: 40px; height: 40px; color: var(--muted); }
.empty h2 { margin-bottom: 6px; }
.ico--sm { width: 15px; height: 15px; }

.stack { display: flex; align-items: stretch; gap: 4px; height: 250px; margin: 0; padding: 6px 12px 0; list-style: none; overflow-x: auto; }
.stack__col { position: relative; display: flex; flex: 1 0 11px; flex-direction: column; align-items: center; gap: 6px; min-width: 11px; }
.stack__track { position: relative; display: flex; flex: 1; align-items: flex-end; justify-content: center; width: 100%; min-height: 0; padding-top: 22px; border-bottom: 1px solid var(--line-2); }
.stack__bar { display: flex; flex-direction: column-reverse; width: min(100%, 26px); height: max(var(--h, 0%), 3px); border-radius: 5px 5px 0 0; overflow: hidden; }
.stack__value { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: var(--fs-2xs); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.stack__label { height: 1.5em; color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
.stack--dense .stack__value { display: none; }
.tech__pair { break-inside: avoid; }
.stack__none { align-self: center; margin-bottom: 8px; color: var(--muted); }
.stack__col.is-missing .stack__track { border-bottom-style: dashed; }
.part { display: block; min-height: 2px; }
.part--ok, .key--ok { background: var(--ok); }
.part--miss, .key--miss { background: var(--miss) repeating-linear-gradient(135deg, transparent 0 4px, #00000030 4px 6px); }
.part--unk, .key--unk { background: var(--unk) radial-gradient(circle at 50% 50%, #ffffff66 0 1.2px, transparent 1.6px) 0 0 / 6px 6px; }
.key { display: inline-block; width: 12px; height: 12px; flex: none; border-radius: 3px; }
.chart-legend .ico { color: var(--muted); }

.heat-scroll { margin: 0; }
.heat__corner { width: 40px; }
.heat { min-width: 500px; table-layout: fixed; font-size: var(--fs-2xs); }
.heat th, .heat td, .heat caption { position: relative; padding: 0; text-align: center; border: 0; vertical-align: middle; }
.heat .heat__day { width: 38px; padding-right: 6px; text-align: right; color: var(--muted); font-weight: 600; font-size: var(--fs-xs); min-width: 0; }
.heat thead { background: transparent; }
.heat__hour { color: var(--muted); font-weight: 500; padding-bottom: 4px; }
.heat__cell { position: relative; height: 28px; border-radius: 5px; box-shadow: inset 0 0 0 2px var(--card); background: var(--card-2); color: var(--ink); font-weight: 700; }
.heat__cell[data-level="1"], .heat-key[data-level="1"] { background: color-mix(in srgb, var(--miss) 28%, var(--card-2)); }
.heat__cell[data-level="2"], .heat-key[data-level="2"] { background: color-mix(in srgb, var(--miss) 50%, var(--card-2)); }
.heat__cell[data-level="3"], .heat-key[data-level="3"] { background: color-mix(in srgb, var(--miss) 76%, var(--card-2)); color: #1f0a04; }
.heat__cell[data-level="4"], .heat-key[data-level="4"] { background: var(--miss); color: #1f0a04; }
.heat__cell[data-level="-1"], .heat-key[data-level="-1"] { background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--muted) 35%, transparent) 4px 5px), var(--card); color: var(--muted); }
.heat__cell[data-coverage="partial"], .heat-key[data-coverage="partial"] { outline: 1px dashed var(--ink-2); outline-offset: -3px; }
.stack__col.is-partial .stack__bar { outline: 1px dashed var(--muted); outline-offset: 1px; }
.heat-key { display: inline-block; width: 16px; height: 12px; border-radius: 3px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.heat tbody tr:first-child { background: transparent; }

.sortbtn { display: inline-flex; align-items: center; gap: 2px; padding: 4px 2px; border: 0; background: transparent; color: inherit; font-weight: 700; text-align: right; }
.sortbtn:hover { color: var(--accent-text); }
.cards-table { min-width: 640px; }
.cards-table tbody tr:first-child { background: transparent; }
.cards-table .row-total { background: var(--well); font-weight: 700; }
.tech { padding: 0; }
.tech__summary { display: flex; align-items: center; min-height: 52px; padding: 0 22px; font-size: var(--fs-lg); font-weight: 600; cursor: pointer; }
.tech[open] .tech__summary { border-bottom: 1px solid var(--line-2); }
.tech__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0 28px; margin: 0; padding: 8px 22px; }
.tech__list dt { margin-top: 12px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.tech__list dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.tech > .meta { margin: 0; padding: 4px 22px 18px; }
@media (max-width: 960px) { .stack { height: 220px; } }
@media (max-width: 760px) {
  .controls { gap: 8px; }
  .seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .seg__btn { padding: 0 6px; font-size: var(--fs-sm); }
  .tabs { gap: 4px; }
  .tab { flex: 1; justify-content: center; padding: 0 8px; }
  .stack { height: 190px; gap: 3px; }
  .tech__summary { padding: 0 16px; }
  .tech__list { padding: 6px 16px; }
  .tech > .meta { padding: 4px 16px 16px; }
  .empty { flex-direction: column; gap: 8px; }
  .scroll-hint { display: none; }
  /* Tableau en fiches : une carte par utilisateur, le total en tête. */
  .table-scroll:not(.heat-scroll) { overflow: visible; }
  .cards-table { min-width: 0; }
  .cards-table thead { display: block; background: transparent; margin-bottom: 8px; }
  .cards-table thead tr { display: flex; flex-wrap: wrap; gap: 6px; }
  .cards-table thead th:first-child { display: none; }
  .cards-table thead th { padding: 0; border: 0; text-align: left; }
  .cards-table .sortbtn { min-height: 40px; padding: 0 10px; border-radius: 99px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-2); font-size: var(--fs-xs); }
  .cards-table, .cards-table tbody { display: block; width: 100%; }
  .cards-table tbody tr { display: block; margin: 0 0 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-2); }
  .cards-table .row-total { background: var(--card-3); }
  .cards-table tbody th { display: block; padding: 0 0 6px; border: 0; text-align: left; min-width: 0; }
  .cards-table tbody td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; border-top: 1px solid var(--line); text-align: right; }
  .cards-table tbody td::before { content: attr(data-label); color: var(--muted); font-weight: 600; text-align: left; }
  .heat { min-width: 600px; }
}
@media (forced-colors: active) {
  .part--ok, .part--miss, .part--unk { border: 2px solid CanvasText; }
  .heat__cell { border: 1px solid CanvasText; }
  .seg__btn[aria-pressed="true"], .tab[aria-selected="true"] { outline: 3px solid Highlight; }
}
@media print { .controls .seg, .tabs { display: none; } }

/* STAT-SOURCE : une mesure non disponible reste visible, atténuée, sans chiffre ni zéro. */
.kpi--na .kpi__value { font-size: 20px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.kpi--na .kpi__sub { font-size: var(--fs-xs); }
.cards-table td.is-na { color: var(--muted); }
/* L2-ID : « aucun appel au rapport » (rapport complet sans ligne pour le poste), distinct de « Non disponible » et jamais un zéro. */
.cards-table td.is-norow, .kpi--norow .kpi__value { color: var(--muted); font-style: italic; }
.kpi--norow .kpi__value { font-size: 18px; }
.cards-table td.poste__none { text-align: left; }
.poste__ext { font-weight: 700; font-variant-numeric: tabular-nums; }
.poste__name { margin-left: 8px; color: var(--ink-2); font-weight: 500; overflow-wrap: anywhere; }
.stack__norow { color: var(--muted); }
.heat__na { caption-side: top; padding: 14px 4px; color: var(--muted); text-align: left; }
.tech__undecided { padding: 4px 22px 14px; }
.tech__undecided summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.tech__undecided-list { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: var(--fs-sm); display: grid; gap: 6px; }
.tech__undecided-list b { color: var(--ink-2); font-weight: 600; }
@media (max-width: 720px) { .tech__undecided { padding: 4px 16px 12px; } }
