/* Console MessagerieDZ — système de design v10 (PRODUCT.md : moderne, premium, souveraine).
   Polices IBM Plex hébergées par la console (licence OFL, fonts/) : aucun appel à un service étranger.
   Propriétés logiques partout : l'arabe est un vrai miroir. Couleurs en OKLCH, texte courant ≥ 7:1. */
@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-Medium-Latin1.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Plex Arabic"; src: url("fonts/IBMPlexSansArabic-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("fonts/IBMPlexSansArabic-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("fonts/IBMPlexSansArabic-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* surfaces : neutres teintés vers le vert de l'identité (teinte 158) */
  --bg: oklch(0.982 0.004 158); --surface: oklch(1 0 0); --side: oklch(0.968 0.006 158); --sunken: oklch(0.958 0.007 158);
  --line: oklch(0.905 0.008 158); --line-strong: oklch(0.60 0.014 158);
  --fg: oklch(0.21 0.02 158); --muted: oklch(0.42 0.016 158); --subtle: oklch(0.56 0.012 158);
  /* accent : actions principales, sélection, focus — jamais de décoration */
  --accent: oklch(0.44 0.115 158); --accent-hover: oklch(0.39 0.105 158); --accent-press: oklch(0.35 0.095 158);
  --accent-ink: oklch(0.40 0.105 158); --accent-fg: oklch(0.99 0.005 158); --accent-soft: oklch(0.952 0.032 158);
  /* états : encre (texte, ≥ 7:1 sur leur fond doux), doux (fond), barre (jauges) */
  --ok: oklch(0.40 0.095 150); --ok-soft: oklch(0.952 0.035 150); --ok-bar: oklch(0.58 0.13 150);
  --warn: oklch(0.41 0.085 60); --warn-soft: oklch(0.955 0.045 80); --warn-bar: oklch(0.6 0.13 62);
  --crit: oklch(0.44 0.155 25); --crit-soft: oklch(0.952 0.026 20); --crit-bar: oklch(0.58 0.19 25); --crit-fg: oklch(0.99 0 0);
  --info: oklch(0.42 0.095 245); --info-soft: oklch(0.952 0.022 245); --info-fg: oklch(0.99 0 0);
  --focus: oklch(0.44 0.115 158);
  --paper: #ffffff; --ink: #111;
  /* typographie : une famille, 7 tailles */
  --font: "Plex", "Plex Arabic", "Segoe UI", system-ui, sans-serif;
  --font-ar: "Plex Arabic", "Plex", "Segoe UI", Tahoma, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Noto Sans Mono", monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 24px; --fs-2xl: 28px;
  /* espace (grille de 4), rayons, élévations */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;
  --r-sm: 6px; --r: 8px; --r-md: 12px; --r-lg: 16px;
  --e1: 0 1px 2px oklch(0.21 0.02 158 / .05), 0 0 0 1px var(--line);
  --e2: 0 4px 16px oklch(0.21 0.02 158 / .08), 0 0 0 1px var(--line);
  --e3: 0 16px 48px oklch(0.21 0.02 158 / .18), 0 0 0 1px var(--line);
  --ease: cubic-bezier(.25, 1, .5, 1); /* sortie quart */
  --tap: 36px; --row: 44px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: oklch(0.165 0.01 158); --surface: oklch(0.2 0.012 158); --side: oklch(0.18 0.011 158); --sunken: oklch(0.235 0.013 158);
  --line: oklch(0.3 0.013 158); --line-strong: oklch(0.55 0.015 158);
  --fg: oklch(0.95 0.006 158); --muted: oklch(0.8 0.012 158); --subtle: oklch(0.66 0.012 158);
  --accent: oklch(0.76 0.14 158); --accent-hover: oklch(0.81 0.13 158); --accent-press: oklch(0.7 0.13 158);
  --accent-ink: oklch(0.82 0.12 158); --accent-fg: oklch(0.17 0.03 158); --accent-soft: oklch(0.28 0.045 158);
  --ok: oklch(0.85 0.12 150); --ok-soft: oklch(0.27 0.045 150); --ok-bar: oklch(0.72 0.14 150);
  --warn: oklch(0.87 0.12 80); --warn-soft: oklch(0.29 0.05 70); --warn-bar: oklch(0.78 0.14 75);
  --crit: oklch(0.83 0.1 22); --crit-soft: oklch(0.29 0.06 22); --crit-bar: oklch(0.7 0.17 25); --crit-fg: oklch(0.17 0.03 22);
  --info: oklch(0.84 0.08 245); --info-soft: oklch(0.28 0.045 245); --info-fg: oklch(0.17 0.03 245);
  --focus: oklch(0.76 0.14 158);
  --e1: 0 0 0 1px var(--line); --e2: 0 6px 20px oklch(0 0 0 / .4), 0 0 0 1px var(--line); --e3: 0 18px 50px oklch(0 0 0 / .55), 0 0 0 1px var(--line);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: oklch(0.165 0.01 158); --surface: oklch(0.2 0.012 158); --side: oklch(0.18 0.011 158); --sunken: oklch(0.235 0.013 158);
  --line: oklch(0.3 0.013 158); --line-strong: oklch(0.55 0.015 158);
  --fg: oklch(0.95 0.006 158); --muted: oklch(0.8 0.012 158); --subtle: oklch(0.66 0.012 158);
  --accent: oklch(0.76 0.14 158); --accent-hover: oklch(0.81 0.13 158); --accent-press: oklch(0.7 0.13 158);
  --accent-ink: oklch(0.82 0.12 158); --accent-fg: oklch(0.17 0.03 158); --accent-soft: oklch(0.28 0.045 158);
  --ok: oklch(0.85 0.12 150); --ok-soft: oklch(0.27 0.045 150); --ok-bar: oklch(0.72 0.14 150);
  --warn: oklch(0.87 0.12 80); --warn-soft: oklch(0.29 0.05 70); --warn-bar: oklch(0.78 0.14 75);
  --crit: oklch(0.83 0.1 22); --crit-soft: oklch(0.29 0.06 22); --crit-bar: oklch(0.7 0.17 25); --crit-fg: oklch(0.17 0.03 22);
  --info: oklch(0.84 0.08 245); --info-soft: oklch(0.28 0.045 245); --info-fg: oklch(0.17 0.03 245);
  --focus: oklch(0.76 0.14 158);
  --e1: 0 0 0 1px var(--line); --e2: 0 6px 20px oklch(0 0 0 / .4), 0 0 0 1px var(--line); --e3: 0 18px 50px oklch(0 0 0 / .55), 0 0 0 1px var(--line);
  color-scheme: dark; }
@media (pointer: coarse) { :root { --tap: 44px; --row: 52px; } }
@media (forced-colors: active) { .pill, .badge, .sev { forced-color-adjust: none; border: 1px solid CanvasText; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 var(--fs-base)/20px var(--font); font-feature-settings: "ss01" 0;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[dir="rtl"] body { font-family: var(--font-ar); font-size: 15px; line-height: 1.75; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.skip { position: absolute; inset-inline-start: 8px; top: 8px; transform: translateY(-300%); background: var(--surface); padding: 8px 12px; z-index: 90; border-radius: var(--r); box-shadow: var(--e2); }
.skip:focus { transform: none; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { margin: 0; text-wrap: balance; color: var(--fg); }
h1 { font-size: var(--fs-xl); line-height: 32px; font-weight: 600; letter-spacing: -0.012em; }
h2 { font-size: var(--fs-md); line-height: 24px; font-weight: 600; }
h3 { font-size: var(--fs-base); line-height: 20px; font-weight: 600; }
[dir="rtl"] h1 { font-size: 26px; line-height: 1.45; letter-spacing: 0; }
[dir="rtl"] h2 { font-size: 17px; line-height: 1.5; } [dir="rtl"] h3 { font-size: 15px; line-height: 1.5; }
h1:focus { outline: none; }
p { margin: 0; text-wrap: pretty; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: var(--fs-sm); }
.num, td.num, .tnum { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] svg.i.dir { transform: scaleX(-1); }

/* en-tête : une seule barre de 56 px */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: oklch(from var(--surface) l c h / .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
@supports not (color: oklch(from red l c h)) { .top { background: var(--surface); } }
.top-in { display: flex; align-items: center; gap: var(--s3); height: 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--fg); min-width: 0; }
.brand svg, .brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand-name { display: grid; line-height: 16px; font-size: var(--fs-base); }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.search { position: relative; flex: 1 1 360px; max-width: 520px; margin-inline: auto; }
.search input { padding-inline-start: 36px; padding-inline-end: 64px; min-height: 36px; background: var(--sunken); border-color: transparent; cursor: pointer; }
.search input::placeholder { color: var(--muted); }
.search input:hover { border-color: var(--line); }
.search input:focus { background: var(--surface); border-color: var(--line-strong); }
.search svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search kbd { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); font: 500 11px/16px var(--font);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--muted); background: var(--surface); }
.results { position: absolute; inset-inline: 0; top: calc(100% + 6px); background: var(--surface); border-radius: var(--r-md);
  box-shadow: var(--e3); max-height: 60vh; overflow: auto; z-index: 25; padding: var(--s1); }
.results a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); color: var(--fg); text-decoration: none; }
.results a:hover, .results a:focus-visible { background: var(--sunken); outline-offset: -2px; }
.results .kind { font-size: var(--fs-xs); color: var(--muted); }
.tools { display: flex; gap: var(--s2); align-items: center; }
.tools .org { max-width: 300px; min-height: 36px; text-overflow: ellipsis; }
.dates { display: none; }
.sov { font-size: var(--fs-sm); background: var(--warn-soft); color: var(--warn); }
.sov:has(> .sov-in:empty) { display: none; }
.sov-in { display: flex; gap: var(--s3); align-items: center; min-height: 32px; overflow: hidden; white-space: nowrap;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.sov-in > span { overflow: hidden; text-overflow: ellipsis; }
.sov b { color: inherit; }
.flag { width: 18px; height: 12px; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px oklch(0 0 0 / .12); }
.tag-demo { background: var(--warn); color: var(--surface); border-radius: 999px; padding: 0 10px; font-weight: 600; font-size: var(--fs-xs); flex: none; }

/* boutons : un seul « primary » par vue ; tous les états */
.btn { font: 500 var(--fs-base)/20px var(--font); border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg);
  padding: 7px 14px; border-radius: var(--r); cursor: pointer; min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; text-decoration: none; white-space: nowrap; box-shadow: 0 1px 0 oklch(0.21 0.02 158 / .04);
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease), box-shadow 120ms var(--ease), transform 120ms var(--ease); }
[dir="rtl"] .btn { font-family: var(--font-ar); }
.btn:hover { background: var(--sunken); }
.btn:active { transform: translateY(1px); background: var(--line); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary:active { background: var(--accent-press); }
.btn.danger { color: var(--crit); border-color: var(--crit); background: var(--surface); }
.btn.danger:hover { background: var(--crit-soft); }
.btn.danger.solid { background: var(--crit); color: var(--crit-fg); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--sunken); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--accent-fg); border-inline-end-color: transparent; animation: spin .7s linear infinite; }
.btn:not(.primary)[aria-busy="true"]::after { border-color: var(--fg); border-inline-end-color: transparent; }
@keyframes spin { to { transform: rotate(1turn); } }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: var(--fs-sm); }
@media (pointer: coarse) { .btn.sm { min-height: 44px; } }
.icon-btn { padding: 0; width: var(--tap); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); flex: none; padding: 2px; gap: 2px; background: var(--surface); }
.seg button { font: 500 var(--fs-sm)/16px var(--font); border: 0; background: transparent; color: var(--muted); padding: 0 10px; cursor: pointer; min-height: 30px; border-radius: var(--r-sm); }
.seg button[lang="ar"] { font-family: var(--font-ar); }
.seg button:hover { color: var(--fg); background: var(--sunken); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--surface); }
.seg button:focus-visible { outline-offset: 1px; position: relative; z-index: 1; }

/* champs */
label.f { display: grid; gap: 6px; font-size: var(--fs-sm); font-weight: 500; color: var(--fg); }
input, select, textarea { font: 400 var(--fs-base)/20px var(--font); color: var(--fg); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: 7px 11px; min-height: var(--tap); width: 100%;
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease); }
[dir="rtl"] :is(input, select, textarea) { font-family: var(--font-ar); }
input:hover, select:hover, textarea:hover { border-color: var(--fg); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px oklch(from var(--accent) l c h / .22); }
input::placeholder, textarea::placeholder { color: var(--subtle); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--crit); box-shadow: 0 0 0 3px oklch(from var(--crit) l c h / .15); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); margin: 0; box-shadow: none; }
textarea { min-height: 120px; font-family: var(--mono); font-size: var(--fs-sm); }
.hint { font-weight: 400; color: var(--muted); font-size: var(--fs-sm); line-height: 18px; }
.err { color: var(--crit); font-size: var(--fs-sm); font-weight: 500; }
.check { display: flex; gap: 10px; align-items: center; font-size: var(--fs-base); min-height: var(--tap); }

/* structure : barre latérale sur une seconde couche neutre */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100% - 56px); }
nav.side { border-inline-end: 1px solid var(--line); background: var(--side); padding: var(--s3) var(--s3) var(--s4); position: sticky; top: var(--hdr, 56px); height: calc(100vh - var(--hdr, 56px)); overflow: auto; display: flex; flex-direction: column; }
body:has(#sov:not(:empty)) { --hdr: 88px; }
nav.side ul, .menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
nav.side a, .menu-list a { display: flex; align-items: center; gap: 10px; padding: 0 10px; min-height: 34px; border-radius: var(--r); color: var(--muted); text-decoration: none; font-size: var(--fs-base); font-weight: 500; }
nav.side a svg.i, .menu-list a svg.i { color: var(--subtle); }
nav.side a:hover, .menu-list a:hover { background: var(--sunken); color: var(--fg); }
nav.side a[aria-current="page"], .menu-list a[aria-current="page"] { background: var(--surface); color: var(--fg); box-shadow: var(--e1); }
nav.side a[aria-current="page"] svg.i, .menu-list a[aria-current="page"] svg.i { color: var(--accent); }
.side-foot { margin-top: auto; padding: var(--s3) 10px 0; display: grid; gap: 6px; font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--line); }
.side-foot .sovb { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--fg); }
.badge { margin-inline-start: auto; font: 600 var(--fs-xs)/18px var(--font); background: var(--crit); color: var(--crit-fg); border-radius: 999px; padding: 0 7px; min-width: 20px; text-align: center; }
.badge.info { background: var(--info); color: var(--info-fg); }
.group { font-size: var(--fs-xs); color: var(--muted); padding: var(--s4) 10px var(--s1); font-weight: 500; }
main:focus { outline: none; }
main { min-width: 0; padding-block: var(--s8) var(--s12);
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1180px; margin-inline: auto; display: grid; gap: var(--s6); }
.head { display: flex; gap: var(--s4); align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.head p { margin-top: 6px; color: var(--muted); max-width: 70ch; font-size: var(--fs-base); }
.head .actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.panel { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--e1); min-width: 0; }
.panel > header, .ph { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); min-height: 56px; }
.panel .body { padding: var(--s5); }
.grid { display: grid; gap: var(--s4); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.kpi { padding: var(--s5); display: grid; gap: 6px; align-content: start; color: inherit; text-decoration: none; }
a.kpi { transition: box-shadow 150ms var(--ease); } a.kpi:hover { box-shadow: var(--e2); }
.kpi .label { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.kpi .value { font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 28px; }
.kpi .value small { font-size: var(--fs-base); color: var(--muted); font-weight: 400; }
.bar { height: 6px; background: var(--sunken); border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.warn > i { background: var(--warn-bar); } .bar.crit > i { background: var(--crit-bar); }
.prog { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 1px 9px 1px 8px; font: 500 var(--fs-xs)/20px var(--font); white-space: nowrap; }
[dir="rtl"] .pill { font-family: var(--font-ar); font-size: var(--fs-sm); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.crit { background: var(--crit-soft); color: var(--crit); } .pill.info { background: var(--info-soft); color: var(--info); }
.pill.off { background: var(--sunken); color: var(--muted); }
.pill.warn::before { border-radius: 1px; transform: rotate(45deg); } .pill.crit::before { border-radius: 1px; }

/* tableaux : lignes de 44 px, en-têtes discrets, chiffres alignés */
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-base); }
th, td { text-align: start; padding: 0 var(--s3); height: var(--row); border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font: 500 var(--fs-xs)/16px var(--font); color: var(--muted); background: transparent; white-space: nowrap; height: 36px; border-bottom-color: var(--line-strong); }
[dir="rtl"] th { font-family: var(--font-ar); font-size: var(--fs-sm); }
th:first-child, td:first-child { padding-inline-start: var(--s5); } th:last-child, td:last-child { padding-inline-end: var(--s5); }
tbody tr { transition: background-color 100ms var(--ease); }
tbody tr:hover { background: oklch(from var(--sunken) l c h / .6); }
tbody tr:last-child td { border-bottom: 0; }
th button.sort { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
th button.sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
tr.sel { background: var(--accent-soft) !important; }
td.act { text-align: end; white-space: nowrap; }
.pager { display: flex; gap: var(--s2); align-items: center; justify-content: space-between; flex-wrap: wrap; padding: var(--s3) var(--s5); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); }
.bulk { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; padding: var(--s2) var(--s5); background: var(--fg); color: var(--surface); }
.bulk .btn { background: transparent; color: inherit; border-color: oklch(from var(--surface) l c h / .35); box-shadow: none; }
.bulk .btn:hover { background: oklch(from var(--surface) l c h / .12); }
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; flex: 1 1 auto; }
@media (min-width: 1100px) { .filters input[type="search"] { flex: 0 1 300px; } }
.filters input[type="search"] { width: min(320px, 100%); }
.filters select { width: auto; }
.cell-name { display: grid; line-height: 18px; gap: 1px; }
.cell-name strong { font-weight: 500; }
.cell-name small { color: var(--muted); font-size: var(--fs-sm); }
.menu-pop { position: absolute; z-index: 35; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--e3); min-width: 240px; padding: var(--s1); }
.menu-pop button { all: unset; display: flex; gap: 10px; align-items: center; width: 100%; box-sizing: border-box; padding: 0 10px; min-height: 34px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-base); }
.menu-pop button:hover { background: var(--sunken); }
.menu-pop button:focus-visible { background: var(--sunken); outline: 2px solid var(--focus); outline-offset: -2px; }

/* listes : la gravité se lit par une icône de forme distincte (pas seulement la couleur) */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.sev { width: 32px; height: 32px; border-radius: 9px; align-self: start; background: var(--info-soft); position: relative; }
.sev::after { content: ""; position: absolute; inset: 7px; background: var(--info);
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E"); }
.sev.crit { background: var(--crit-soft); } .sev.crit::after { background: var(--crit);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20L12 3Z'/%3E%3Cpath d='M12 10v4M12 17v.5'/%3E%3C/svg%3E"); }
.sev.warn { background: var(--warn-soft); } .sev.warn::after { background: var(--warn);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 6v8M12 18v.5'/%3E%3C/svg%3E"); }
.sev.ok { background: var(--ok-soft); } .sev.ok::after { background: var(--ok);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.sev.off { background: var(--sunken); } .sev.off::after { background: var(--subtle); }
.list strong { font-weight: 600; }
.list p { margin-top: 2px; font-size: var(--fs-sm); color: var(--muted); line-height: 20px; }
.list .acts { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.list.stack > li { grid-template-columns: 32px minmax(0, 1fr); }
.list.stack .acts { grid-column: 2; justify-content: flex-start; margin-top: var(--s1); }
.callout { border: 1px solid oklch(from var(--info) l c h / .25); background: var(--info-soft); padding: var(--s3) var(--s4) var(--s3) var(--s4); border-radius: var(--r); font-size: var(--fs-base); color: var(--fg);
  display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: var(--s3); align-items: start; }
.callout > * { grid-column: 2; }
.callout::before { content: ""; grid-column: 1; grid-row: 1 / span 9; width: 20px; height: 20px; margin-top: 0; background: var(--info);
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E"); }
.callout.ok { border-color: oklch(from var(--ok) l c h / .25); background: var(--ok-soft); } .callout.ok::before { background: var(--ok);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.5 3 3 5-6'/%3E%3C/svg%3E"); }
.callout.warn { border-color: oklch(from var(--warn) l c h / .3); background: var(--warn-soft); } .callout.warn::before { background: var(--warn);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20L12 3Z'/%3E%3Cpath d='M12 10v4M12 17v.5'/%3E%3C/svg%3E"); }
.callout.crit { border-color: oklch(from var(--crit) l c h / .3); background: var(--crit-soft); } .callout.crit::before { background: var(--crit);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m15 9-6 6M9 9l6 6'/%3E%3C/svg%3E"); }
.callout strong { font-weight: 600; } .callout p + p { margin-top: 4px; }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 180px; min-width: 0; }
.steps { display: flex; list-style: none; padding: 0; margin: 0; counter-reset: st; flex-wrap: wrap; gap: var(--s2); }
.steps li { flex: 1 1 150px; padding: var(--s2) 0; border-top: 2px solid var(--line); font-size: var(--fs-sm); color: var(--muted); counter-increment: st; }
.steps li::before { content: counter(st) "  "; font-weight: 600; font-variant-numeric: tabular-nums; }
.steps li[aria-current="step"] { border-color: var(--accent); color: var(--fg); font-weight: 500; }
.steps li.done { border-color: var(--ok-bar); color: var(--fg); }
dl.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 10px 20px; margin: 0; font-size: var(--fs-base); }
@media (max-width: 640px) { dl.kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } dl.kv dd { margin-bottom: var(--s3); } dl.kv dt { font-size: var(--fs-sm); } }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.dns { display: grid; gap: var(--s3); }
.rec { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: var(--s3); align-items: start; padding: var(--s4); border-radius: var(--r-md); box-shadow: var(--e1); background: var(--surface); }
.rec code { display: block; font-family: var(--mono); font-size: var(--fs-xs); overflow-wrap: anywhere; background: var(--sunken); padding: 8px 10px; border-radius: var(--r-sm); direction: ltr; text-align: left; margin-top: 6px; }
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding-inline-start: 22px; border-inline-start: 1px solid var(--line); margin-inline-start: 12px; }
.tree .node { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s3); align-items: center; padding: var(--s2) var(--s3); border-radius: var(--r); }
.tree .node:hover { background: var(--sunken); }
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: var(--fs-sm); background: var(--surface); }
.matrix td, .matrix th { text-align: center; }
.matrix thead th { white-space: normal; min-width: 96px; vertical-align: bottom; padding-block: var(--s2); height: auto; }
.matrix td:first-child, .matrix th:first-child { text-align: start; }
.yes { color: var(--ok); font-weight: 600; display: inline-flex; } .no { color: var(--subtle); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.timeline button { width: 100%; text-align: start; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); font: inherit; color: var(--fg); cursor: pointer; min-height: var(--tap);
  transition: border-color 120ms var(--ease), background-color 120ms var(--ease); }
.timeline button:hover { border-color: var(--line-strong); }
.timeline button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.timeline .when { font-weight: 600; }
.timeline .meta { color: var(--muted); font-size: var(--fs-sm); flex-basis: 100%; }
details.fold summary { cursor: pointer; color: var(--accent-ink); font-size: var(--fs-sm); font-weight: 500; min-height: 32px; display: flex; align-items: center; }
.empty { padding: var(--s10) var(--s5); text-align: center; color: var(--muted); display: grid; gap: var(--s3); justify-items: center; }
.empty strong { color: var(--fg); font-size: var(--fs-md); font-weight: 600; }
/* chargement : squelettes, jamais de « … » seul */
.sk { display: block; height: 12px; border-radius: 4px; background: var(--sunken); }
.sk + .sk { margin-top: 12px; }
.sk-rows { padding: var(--s5); display: grid; gap: var(--s4); }
@media (prefers-reduced-motion: no-preference) { .sk { animation: skp 1.2s ease-in-out infinite alternate; } @keyframes skp { from { opacity: .55; } to { opacity: 1; } } }

/* tiroir, voile, notifications */
.scrim { position: fixed; inset: 0; background: oklch(0.17 0.02 158 / .42); z-index: 40; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(520px, 100%); background: var(--surface);
  z-index: 41; display: flex; flex-direction: column; box-shadow: var(--e3);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer.wide { width: min(860px, 100%); }
.drawer > header { display: flex; justify-content: space-between; align-items: center; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); gap: var(--s3); min-height: 64px; }
.drawer > header h2 { font-size: var(--fs-md); }
.drawer .content { padding: var(--s5); overflow: auto; display: grid; gap: var(--s5); align-content: start; flex: 1; }
.drawer footer { padding: var(--s3) var(--s5); border-top: 1px solid var(--line); display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; background: var(--side); }
@media (prefers-reduced-motion: no-preference) {
  .drawer { animation: drw 220ms var(--ease); } [dir="rtl"] .drawer { animation-name: drwr; }
  .scrim { animation: fade 180ms var(--ease); }
  @keyframes drw { from { transform: translateX(24px); opacity: 0; } } @keyframes drwr { from { transform: translateX(-24px); opacity: 0; } }
  @keyframes fade { from { opacity: 0; } } }
.toast { position: fixed; inset-inline-end: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--fg); color: var(--surface); padding: 12px 16px; border-radius: var(--r-md); z-index: 60; max-width: min(460px, calc(100% - 32px)); font-size: var(--fs-base);
  box-shadow: var(--e3); opacity: 0; transform: translateY(8px); pointer-events: none; display: flex; gap: var(--s3); align-items: center; }
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast .undo { all: unset; cursor: pointer; font-weight: 600; color: var(--accent-soft); padding: 4px 8px; border-radius: var(--r-sm); white-space: nowrap; }
.toast .undo:hover { background: oklch(from var(--surface) l c h / .12); }
.toast .undo:focus-visible { outline: 2px solid var(--surface); }
@media (prefers-reduced-motion: no-preference) { .toast { transition: opacity 200ms var(--ease), transform 200ms var(--ease); } .bar > i { transition: width .5s var(--ease); } }

/* document officiel (PV) */
.sheet { background: var(--paper); color: var(--ink); width: min(210mm, 100%); margin-inline: auto; padding: clamp(16px, 4vw, 18mm);
  box-shadow: 0 2px 18px rgb(0 0 0 / .18); font-size: .92rem; display: grid; gap: 14px; }
.sheet .rep { text-align: center; font-weight: 600; line-height: 1.5; }
.sheet .rep .ar { font-family: var(--font-ar); font-size: 1.05rem; }
.sheet .split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sheet .split > div:last-child { direction: rtl; text-align: right; font-family: var(--font-ar); }
.sheet h2 { text-align: center; font-size: 1.15rem; border-block: 1px solid #333; padding-block: 8px; }
.sheet table th { background: #eee; color: #222; }
.sheet td, .sheet th { border: 1px solid #999; }
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.sign > div { border: 1px dashed #888; min-height: 90px; padding: 8px; font-size: .84rem; }

/* connexion : panneau d'identité + carte centrée */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); }
.login-aside { position: relative; overflow: hidden; background: oklch(0.27 0.06 158); color: oklch(0.97 0.01 158); padding: var(--s12);
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s8); }
.login-aside::before { content: ""; position: absolute; inset: 0; opacity: .09; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64' fill='none' stroke='%23fff' stroke-width='1.2'%3E%3Cpath d='M32 4 40 24 60 32 40 40 32 60 24 40 4 32 24 24Z'/%3E%3Cpath d='M32 18 36 28 46 32 36 36 32 46 28 36 18 32 28 28Z'/%3E%3Cpath d='M0 0 8 8M64 0 56 8M0 64 8 56M64 64 56 56'/%3E%3C/svg%3E"); background-size: 64px 64px; }
.login-aside > * { position: relative; }
.login-aside .lb { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: var(--fs-md); }
.login-aside .lb svg { width: 36px; height: 36px; }
.login-aside h2 { color: inherit; font-size: 32px; line-height: 40px; letter-spacing: -0.02em; max-width: 18ch; font-weight: 600; }
[dir="rtl"] .login-aside h2 { font-size: 30px; line-height: 1.5; letter-spacing: 0; }
.login-aside ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); font-size: var(--fs-base); max-width: 44ch; }
.login-aside li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; color: oklch(0.9 0.02 158); }
.login-aside li::before { content: ""; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: oklch(0.85 0.1 158 / .25);
  box-shadow: inset 0 0 0 5px oklch(0.27 0.06 158), inset 0 0 0 9px oklch(0.8 0.12 158); }
.login-aside small { color: oklch(0.82 0.02 158); font-size: var(--fs-xs); }
.login-main { display: grid; place-items: center; padding: var(--s8) var(--s6); background: var(--surface); }
.login .card { width: min(400px, 100%); display: grid; gap: var(--s5); }
.login .card h1 { font-size: var(--fs-xl); }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s2); direction: ltr; }
.otp input { text-align: center; font: 600 22px/28px var(--mono); padding: 0; min-height: 52px; }
@media (max-width: 900px) { .login { grid-template-columns: minmax(0, 1fr); } .login-aside { padding: var(--s6); gap: var(--s4); }
  .login-aside h2 { font-size: 22px; line-height: 30px; } .login-aside ul, .login-aside small { display: none; } }

/* écran de connexion : sans la navigation */
body.is-login .top, body.is-login .bottom, body.is-login nav.side, body.is-login #foot { display: none; }
body.is-login .shell { grid-template-columns: minmax(0, 1fr); }
body.is-login main { padding: 0; }
body.is-login .wrap { max-width: none; display: block; }

/* accueil : brief du matin + bande d'état (pas de cartes de chiffres) */
.brief { display: grid; gap: 6px; }
.brief .date { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.brief h1 { font-size: var(--fs-2xl); line-height: 36px; letter-spacing: -0.02em; }
[dir="rtl"] .brief h1 { font-size: 28px; line-height: 1.5; letter-spacing: 0; }
.brief p { color: var(--muted); font-size: var(--fs-md); line-height: 24px; max-width: 70ch; }
.status-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--e1); }
.status-strip > a { display: grid; gap: 4px; padding: var(--s4) var(--s5); color: inherit; text-decoration: none; min-width: 0; border-radius: var(--r-md);
  transition: background-color 120ms var(--ease); }
.status-strip > a + a { border-inline-start: 1px solid var(--line); border-start-start-radius: 0; border-end-start-radius: 0; }
.status-strip > a:hover { background: var(--side); }
.status-strip .label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; display: flex; gap: 6px; align-items: center; }
.status-strip .value { font-size: var(--fs-lg); line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.status-strip .sub { font-size: var(--fs-xs); color: var(--muted); }
.status-strip .bar { margin-top: 4px; height: 4px; }
.status-strip .value.warn { color: var(--warn); } .status-strip .value.crit { color: var(--crit); } .status-strip .value.ok { color: var(--ok); }
.todo-count { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }

/* palette de commandes (Ctrl+K) */
.cmdk-scrim { position: fixed; inset: 0; z-index: 50; background: oklch(0.17 0.02 158 / .35); display: grid; justify-items: center; align-items: start; padding-top: 12vh; }
.cmdk { width: min(620px, calc(100% - 32px)); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--e3); overflow: hidden; }
.cmdk input { border: 0; border-radius: 0; min-height: 56px; font-size: var(--fs-md); padding-inline: var(--s5); box-shadow: none !important; border-bottom: 1px solid var(--line); }
.cmdk input:focus { border-color: var(--line); }
.cmdk ul { list-style: none; margin: 0; padding: var(--s2); max-height: min(420px, 60vh); overflow: auto; }
.cmdk li[role="option"] { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 0 var(--s3); min-height: 40px; border-radius: var(--r); cursor: pointer; }
.cmdk li[role="option"] svg.i { color: var(--subtle); }
.cmdk li[aria-selected="true"] { background: var(--accent-soft); }
.cmdk li[aria-selected="true"] svg.i { color: var(--accent); }
.cmdk .grp { font-size: var(--fs-xs); color: var(--muted); padding: var(--s3) var(--s3) var(--s1); font-weight: 500; }
.cmdk .kbd { font: 500 11px/16px var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; }
.cmdk footer { display: flex; gap: var(--s4); padding: var(--s2) var(--s5); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); background: var(--side); }
@media (prefers-reduced-motion: no-preference) { .cmdk { animation: cmd 180ms var(--ease); } @keyframes cmd { from { transform: translateY(-6px) scale(.985); opacity: 0; } } }

/* mobile */
.bottom { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  nav.side { display: none; }
  .top-in { height: 52px; gap: var(--s2); }
  .search kbd, .brand small, .tools .org, .brand-name, .tools .seg, #themeBtn { display: none; }
  .search { min-width: 0; flex: 1 1 auto; margin: 0; }
  main { padding: var(--s5) var(--s4) calc(88px + env(safe-area-inset-bottom, 0px)); }
  .wrap { gap: var(--s5); }
  h1 { font-size: 22px; line-height: 28px; }
  .brief h1 { font-size: 24px; line-height: 30px; }
  .brief p { font-size: var(--fs-base); line-height: 22px; }
  .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-strip > a:nth-child(3) { border-inline-start: 0; }
  .status-strip > a:nth-child(n+3) { border-top: 1px solid var(--line); }
  .head .actions { width: 100%; } .head .actions .btn.primary { flex: 1; }
  .panel > header, .ph { padding: var(--s3) var(--s4); }
  .panel .body { padding: var(--s4); }
  th:first-child, td:first-child { padding-inline-start: var(--s4); } th:last-child, td:last-child { padding-inline-end: var(--s4); }
  /* comptes : une carte par ligne sur téléphone */
  table.cards thead { display: none; }
  table.cards tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 10px; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); align-items: center; }
  table.cards td { border: 0; padding: 0; height: auto; min-width: 0 !important; }
  table.cards td:nth-child(1) { grid-row: 1 / span 3; align-self: start; padding-top: 2px; }
  table.cards td:nth-child(2) { grid-column: 2; grid-row: 1; }
  table.cards td:nth-child(8) { grid-column: 3; grid-row: 1; }
  table.cards td:nth-child(3) { grid-column: 2 / span 2; grid-row: 2; overflow-wrap: anywhere; }
  table.cards td:nth-child(5) { grid-column: 2; grid-row: 3; }
  table.cards td:nth-child(4) { grid-column: 3; grid-row: 3; }
  table.cards td:nth-child(6), table.cards td:nth-child(7) { display: none; }
  .bottom { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0; z-index: 22;
    background: oklch(from var(--surface) l c h / .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .bottom a, .bottom button { all: unset; position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 2px; min-height: 56px; box-sizing: border-box;
    font-size: var(--fs-xs); font-weight: 500; color: var(--muted); cursor: pointer; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  [dir="rtl"] .bottom a, [dir="rtl"] .bottom button { font-size: 13px; }
  .bottom a:focus-visible, .bottom button:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
  .bottom [aria-current="page"] { color: var(--accent-ink); }
  .bottom [aria-current="page"] svg.i { stroke-width: 2.1; }
  .bottom svg.i { width: 22px; height: 22px; }
  .bottom .badge { position: absolute; top: 4px; inset-inline-start: calc(50% + 4px); margin: 0; }
  .rec { grid-template-columns: minmax(0, 1fr); }
  .list > li { grid-template-columns: 32px minmax(0, 1fr); padding: var(--s3) var(--s4); }
  .list .acts { grid-column: 2; justify-content: flex-start; }
  .sheet .split, .sign { grid-template-columns: 1fr; }
  .hide-m { display: none; }
  .drawer { width: 100%; }
}
@media print {
  .top, .sov, nav.side, .bottom, .no-print, .toast, .skip { display: none !important; }
  .shell { display: block; } main { padding: 0; } body { background: #fff; }
  .sheet { box-shadow: none; width: auto; padding: 0; }
}

/* tables en cartes génériques (clients, facturation) : titre, puis libellé : valeur */
@media (max-width: 760px) {
  table.kcards thead { display: none; }
  table.kcards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  table.kcards td, table.kcards th { border: 0; padding: 0; min-width: 0 !important; text-align: start; }
  table.kcards .k-title { grid-column: 1; }
  table.kcards .k-act { grid-column: 2; grid-row: 1; }
  table.kcards .k-empty { display: none; }
  table.kcards td[data-l] { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  table.kcards td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: .85rem; }
  table.kcards td[data-l] .prog { flex: 1; max-width: 60%; }
  table.kcards td.empty { grid-column: 1 / -1; }
  table.kcards td.k-wide { grid-column: 1 / -1; text-align: start; white-space: normal; } table.kcards td.k-wide:empty { display: none; }
  table.kcards td { height: auto; }
}

/* pied de page, profil de démonstration, pages de texte */
.foot { border-top: 1px solid var(--line); margin-top: var(--s8); padding: var(--s4) 0 var(--s6); color: var(--muted); font-size: var(--fs-sm); }
.foot p { margin: 4px 0; }
.foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.prof select { width: auto; max-width: 230px; min-height: 26px; padding: 0 26px 0 8px; font-size: var(--fs-xs); background: transparent; border-color: oklch(from var(--warn) l c h / .45); color: inherit; }
.prose p { max-width: 75ch; margin: 0 0 12px; line-height: 1.6; }
@media (max-width: 760px) { .foot { padding-bottom: 88px; } }
@media (max-width: 760px) { .prof select { max-width: 150px; } }

/* PV v6 : arabe à droite, A4 paginé, QR */
.pv .pv-top { font-size: .86rem; line-height: 1.5; }
.pv .pv-title { align-items: stretch; border-block: 1px solid #333; }
.pv .pv-title h2 { border: 0; margin: 0; padding-block: 8px; font-size: 1.05rem; text-align: start; }
.pv .pv-title h2[dir="rtl"] { font-family: var(--font-ar); font-size: 1.15rem; text-align: right; }
.pv-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pv-table th, .pv-table td { padding: 6px 8px; vertical-align: top; }
.pv-table th.fr { width: 24%; text-align: left; }
.pv-table th.ar { width: 22%; text-align: right; font-family: var(--font-ar); font-size: 1rem; }
.pv-table td { overflow-wrap: anywhere; }
.pv .ar-line { display: block; direction: rtl; text-align: right; font-family: var(--font-ar); }
.pv-items { margin: 0; padding-inline-start: 18px; }
.pv .small { font-size: .78rem; } .pv .strong { font-weight: 700; letter-spacing: .04em; }
.pv-verify { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; border: 1px solid #999; padding: 10px; }
.pv-verify .qr svg { display: block; width: 33mm; height: 33mm; }
.pv-verify p { margin: 6px 0 0; }
.pv-sign { grid-template-columns: 1fr 1fr 1fr; break-inside: avoid; }
.pv-sign .seal { border-radius: 50%; aspect-ratio: 1; max-width: 120px; justify-self: center; display: grid; place-items: center; text-align: center; }
.pv-foot { font-size: .75rem; color: #555; text-align: center; margin: 0; }
@media screen and (max-width: 760px) {
  .pv-table, .pv-table tbody { display: block; } .pv-table tr { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #999; border-top: 0; }
  .pv-table tr:first-child { border-top: 1px solid #999; } .pv-table th, .pv-table td { border: 0; width: auto !important; }
  .pv-table th.fr { grid-column: 1; grid-row: 1; } .pv-table th.ar { grid-column: 2; grid-row: 1; } .pv-table td { grid-column: 1 / -1; grid-row: 2; }
  .pv-verify { grid-template-columns: 1fr; } .pv-sign { grid-template-columns: 1fr; } .pv .pv-title h2 { font-size: 1rem; } }
@page { size: A4; margin: 14mm 14mm 16mm;
  @bottom-left { content: "Page " counter(page) " / " counter(pages); font-size: 9pt; color: #444; }
  @bottom-right { content: "صفحة " counter(page) " من " counter(pages); font-size: 9pt; color: #444; } }
@media print {
  .pv { font-size: 9pt; gap: 6px; display: block; } .pv > * + * { margin-top: 8px; } .pv-table th, .pv-table td { padding: 3px 6px; } .pv .pv-top { font-size: 8.5pt; } .pv-table tr, .pv-verify, .pv-sign { break-inside: avoid; } .pv-foot, #foot { display: none !important; }
  .sheet .split { grid-template-columns: 1fr 1fr !important; } .pv-verify { grid-template-columns: auto 1fr !important; }
  .pv-sign { grid-template-columns: 1fr 1fr 1fr !important; } .pv-sign > div { min-height: 70px; } .pv-verify .qr svg { width: 28mm; height: 28mm; }
  .pv-table th.fr { width: 24% !important; } .pv-table th.ar { width: 22% !important; } }

/* dossier de conformité */
.dossier { gap: var(--s5); }
.dossier .ds-title { display: grid; gap: 6px; border-block: 1px solid #333; padding-block: var(--s3); }
.dossier .ds-title h1 { font-size: 22px; line-height: 30px; color: var(--ink); }
.dossier .ds-sec { display: grid; gap: var(--s2); break-inside: avoid; }
.dossier .ds-sec h2 { font-size: 15px; color: var(--ink); border-bottom: 1px solid #ccc; padding-bottom: 4px; }
.dossier table th { background: #f1f3f1; color: #222; height: 30px; } .dossier table td { height: 32px; } .dossier td, .dossier th { border: 1px solid #c8cec9; }
.dossier .ds-fp { font-size: var(--fs-xs); color: #444; border-top: 1px dashed #999; padding-top: var(--s2); }
@media print { .dossier { font-size: 9.5pt; gap: 10px; } .dossier table th, .dossier table td { height: auto; padding: 3px 6px; } }
.home-cols { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .home-cols { grid-template-columns: minmax(0, 1fr); } }

/* arabe : plancher de 13 px et contrôles à 15 px (lisibilité des signes) */
[dir="rtl"] :is(.group, .badge, .status-strip .sub, .side-foot, .kpi .label, .hint, .results .kind, .cmdk .grp, .cmdk footer, .pill, th) { font-size: max(13px, 1em); }
[dir="rtl"] .group, [dir="rtl"] .side-foot, [dir="rtl"] .status-strip .sub { font-size: 13px; line-height: 1.6; }
[dir="rtl"] :is(.btn, input, select, textarea, nav.side a, .menu-list a) { font-size: 15px; }
[dir="rtl"] .btn.sm { font-size: 14px; }
[dir="rtl"] :is(.cell-name, .list strong, .list p, td) { line-height: 1.6; }
/* contraste élevé (Windows) : la page courante reste visible */
@media (forced-colors: active) { nav.side a[aria-current="page"], .bottom [aria-current="page"] { outline: 2px solid CanvasText; } }
/* dossier : les tableaux gardent leur dernière bordure */
.dossier tbody tr:last-child td { border-bottom: 1px solid #c8cec9; }
@media (max-width: 860px) {
  /* connexion : le formulaire d'abord, l'identité réduite à un bandeau */
  .login-aside { padding: var(--s4) var(--s5); flex-direction: row; align-items: center; }
  .login { grid-template-rows: auto 1fr; min-height: 100dvh; }
  .login-aside > div:not(.lb), .login-aside small { display: none !important; }
  .login-main { place-items: start center; padding-top: var(--s6); }
  /* langue toujours accessible sur téléphone */
  .tools .seg { display: inline-flex; } .tools .seg button { padding: 0 8px; }
  /* bande d'état : pas d'arrondis internes */
  .status-strip > a { border-radius: 0; }
  /* comptes : « Sans 2FA » reste visible sur la carte */
  table.cards td:nth-child(6):has(.pill) { display: block; grid-column: 2 / span 2; grid-row: 4; }
  /* la notification passe au-dessus de la barre basse */
  .toast { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); inset-inline: 16px; max-width: none; }
}

/* v11 : bandeau du client actif, facture, ligne de commande */
.scope-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding: var(--s2) var(--s2) var(--s2) var(--s4); border-radius: var(--r-md); background: var(--accent-soft); color: var(--fg); box-shadow: inset 0 0 0 1px oklch(from var(--accent) l c h / .25); }
.scope-bar strong { color: var(--accent-ink); }
.invoice { gap: var(--s5); }
.invoice .iv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); border-bottom: 2px solid #222; padding-bottom: var(--s3); }
.invoice .iv-brand { display: flex; gap: 12px; align-items: center; } .invoice .iv-dot { width: 40px; height: 40px; border-radius: 10px; display: inline-block; }
.invoice .iv-num { text-align: end; } .invoice .iv-num h1 { font-size: 26px; color: var(--ink); letter-spacing: .02em; }
.invoice .iv-table { width: 100%; border-collapse: collapse; } .invoice .iv-table th, .invoice .iv-table td { border: 1px solid #c8cec9; height: 34px; padding: 4px 10px; color: var(--ink); }
.invoice .iv-table th { background: #f1f3f1; font-size: 12px; } .invoice .iv-table tfoot th { text-align: end; background: transparent; font-weight: 500; }
.invoice .iv-table td.num, .invoice .iv-table th.num { text-align: end; } .invoice .iv-total th, .invoice .iv-total td { background: #f1f3f1; font-size: 15px; }
.invoice .small, .dossier .small { font-size: 12px; } .invoice .muted { color: #555; }
.cli summary { gap: 8px; } .cli-pre { margin: 6px 0 10px; padding: 10px 12px; border-radius: var(--r); background: var(--fg); color: var(--surface); font: 12px/18px var(--mono); overflow-x: auto; white-space: pre; text-align: left; }

/* ---------- v12 ---------- */
/* marqueurs neutres : courrier, document, appareil (aucune gravité) */
.sev.mail, .sev.doc, .sev.device { background: var(--sunken); } .sev.mail::after, .sev.doc::after, .sev.device::after { background: var(--muted); }
.sev.mail::after { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3.5 6.5 8.5 7 8.5-7'/%3E%3C/svg%3E"); }
.sev.doc::after { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 3h8l4 4v14H6z'/%3E%3Cpath d='M14 3v4h4M9 12h6M9 16h6'/%3E%3C/svg%3E"); }
.sev.device::after { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E"); }

/* bande d'état en cellules simples (écran Clients) : même rythme que les liens */
.status-strip > div { display: grid; gap: 4px; padding: var(--s4) var(--s5); min-width: 0; align-content: start; }
.status-strip > div + div { border-inline-start: 1px solid var(--line); }
.status-strip > div .muted { font-size: var(--fs-xs); }
#clBody, #blBody { display: grid; gap: var(--s5); }
@media (max-width: 860px) { .status-strip > div + div { border-inline-start: 0; } .status-strip > div:nth-child(even) { border-inline-start: 1px solid var(--line); } .status-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* champs : anneau de focus net (≥ 3:1), en plus du liseré */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* définition sur mobile : l'espacement entre paires n'est plus annulé */
@media (max-width: 640px) { dl.kv dd { margin: 0 0 var(--s3); } }

/* accueil mobile : « À traiter » avant la bande d'état */
@media (max-width: 760px) {
  .wrap > .home-cols { display: contents; }
  .wrap > .home-cols > :first-child { order: 2; }
  .wrap > .status-strip { order: 3; }
  .wrap > .home-cols > :not(:first-child) { order: 4; }
}
.brief .brief-top { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s2); }
.brief .brief-top .sev { width: 24px; height: 24px; border-radius: 7px; align-self: center; } .brief .brief-top .sev::after { inset: 5px; }
.brief .brief-top a { color: inherit; font-weight: 600; text-underline-offset: 3px; }

/* groupes de champs */
fieldset.fold-set { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); margin: 0; display: grid; gap: var(--s2); min-width: 0; }
fieldset.fold-set legend { padding-inline: 6px; font-weight: 600; font-size: var(--fs-sm); }
fieldset.dl-row { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); margin: 0; display: grid; gap: var(--s2); min-width: 0; }
fieldset.dl-row legend { padding-inline: 6px; font-size: var(--fs-sm); color: var(--muted); }
.dl-meta { padding: 0 var(--s5) var(--s3); margin: 0; }

/* toast : raccourci visible */
.toast .undo kbd { font: 500 var(--fs-xs)/1 var(--mono); border: 1px solid oklch(from var(--surface) l c h / .35); border-radius: 4px; padding: 1px 4px; margin-inline-start: 4px; }
.toast .undo .i { width: 16px; height: 16px; }

/* pastille avec icône (2FA) */
.pill .i { width: 13px; height: 13px; }

/* matrice des rôles : lignes repérables */
.matrix tbody th[scope=row] { background: none; color: var(--fg); font-weight: 400; text-align: start; }
.matrix tbody tr:nth-child(even) td, .matrix tbody tr:nth-child(even) th { background: var(--side); }
.matrix tbody tr:hover td, .matrix tbody tr:hover th { background: var(--sunken); }

/* facture : monogramme à la place du carré de couleur */
.invoice .iv-mono { width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .02em; }

/* dossier : un seul trait sous l'en-tête bilingue */
.dossier .ds-title { border-block-start: 0; }

/* arabe : plancher de 13 px partout, y compris dans les documents imprimables */
html[dir=rtl] { --fs-xs: 13px; }
html[dir=rtl] .invoice .small, html[dir=rtl] .dossier .small, html[dir=rtl] .invoice .iv-table th { font-size: 13px; }

/* barre basse : libellés courts sur une ligne */
.bottom a span, .bottom button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pill:has(.i)::before { display: none; }
/* en-tête mobile : bandeau de démonstration réduit à son étiquette et au choix de vue */
@media (max-width: 760px) { .sov-in > span:not(.tag-demo) { display: none; } .sov-in { justify-content: space-between; } }

/* ---------- v13 ---------- */
/* alias et membres de liste */
.al-box { display: grid; gap: var(--s2); margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.al-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.al-list li { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); min-height: 36px; padding: 2px 8px; border-radius: var(--r-sm); }
.al-list li:nth-child(even) { background: var(--side); }
.addr-in { display: flex; align-items: center; gap: 6px; } .addr-in input { flex: 1; min-width: 0; }

/* filtres rapides des comptes */
.qf { display: flex; gap: var(--s2); flex-wrap: wrap; padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line); }
.chip-f { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); font-size: var(--fs-sm); color: var(--fg); background: var(--surface); }
.chip-f .num { color: var(--muted); font-size: var(--fs-xs); }
.chip-f[aria-pressed="true"] { background: var(--fg); color: var(--surface); border-color: var(--fg); } .chip-f[aria-pressed="true"] .num { color: inherit; }
.chip-f:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* journal : dates et filtres repliables (mobile) */
.filters .date-f { flex: 0 1 150px; min-width: 130px; }
.filt-tog { display: none; }
@media (max-width: 760px) {
  .filt-tog { display: inline-flex; margin: var(--s3) var(--s5) 0; }
  #aFilters > :not(#aQ) { display: none; } #aFilters.open > :not(#aQ) { display: flex; }
  #aFilters.open > select, #aFilters.open > .f { width: 100%; }
}

/* sauvegardes : trois étapes dans l'ordre de lecture */
.bk-steps { margin: 0; }
@media (min-width: 1200px) {
  .bk-flow > .grid.g2 { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1.35fr); align-items: start; }
  .bk-flow > .grid.g2 > .grid { display: contents; }
}
.timeline button[aria-pressed="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent); }
.timeline .chosen { display: inline-flex; gap: 4px; align-items: center; color: var(--accent); font-weight: 600; font-size: var(--fs-xs); margin-inline-start: auto; }
.timeline .chosen .i { width: 14px; height: 14px; }

/* migration : phases et actions alignées */
.mg-steps li { display: grid; gap: 2px; }
.mig-acts { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.dh { margin: 0 var(--s5) var(--s4); } .dh-list { margin: var(--s2) 0 0; padding-inline-start: 1.2em; display: grid; gap: 4px; font-size: var(--fs-sm); }

/* boutons désactivés : lisibles comme tels sans dépendre de la transparence */
.btn:disabled, .btn[aria-disabled="true"] { opacity: 1; background: var(--sunken); color: var(--subtle); border-color: var(--line); box-shadow: none; cursor: not-allowed; }

/* v13 (corrections du 5e audit) */
.bk-steps li.done { border-color: var(--line-strong); color: var(--muted); }
.bk-steps li[aria-current="step"] { border-top-width: 3px; font-weight: 600; }
.act.k-wide { white-space: nowrap; } .act .btn .i { vertical-align: -3px; }
#view .head .actions { align-items: flex-end; } #view .head .actions > .btn { min-height: 40px; }
tfoot th, tfoot td { border-top: 1px solid var(--line-strong); }
.nav-more details > summary { cursor: pointer; list-style: none; font-size: var(--fs-xs); color: var(--muted); padding: var(--s4) 10px var(--s1); font-weight: 500; }
.nav-more details > summary::-webkit-details-marker { display: none; }
.nav-more details > summary::after { content: " ▾"; } .nav-more details[open] > summary::after { content: " ▴"; }
.nav-more ul { list-style: none; margin: 0; padding: 0; }
.filters .date-f { display: flex; flex-direction: row; align-items: center; gap: 6px; flex: 0 1 auto; } .filters .date-f input { width: auto; }

/* ---------- v14 ---------- */
.mt-box { display: grid; gap: var(--s2); padding: var(--s3) 0; border-top: 1px solid var(--line); }
#mtOut .callout p + p { margin-top: 4px; }

.nowrap { white-space: nowrap; }
.ip-acts { display: flex; gap: var(--s2); justify-content: flex-end; align-items: center; }
.al-list li > span:first-child { min-width: 0; overflow-wrap: anywhere; }

/* bouton « fichier » (label autour d'un input masqué) : focus visible */
label.btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
/* cartes mobiles : l'intitulé d'une valeur technique reste en police normale */
table.kcards td[data-l]::before { font-family: var(--font); letter-spacing: normal; }
tfoot th, tfoot td { border-bottom: 0; } tfoot th { font-weight: 600; }

/* ---------- v15 ---------- */
/* arabe : les fragments latins (adresses, numéros, empreintes) restent isolés dans la phrase */
html[dir=rtl] .mono, html[dir=rtl] .num, html[dir=rtl] bdi { unicode-bidi: isolate; }
html[dir=rtl] .mono { direction: ltr; }
/* aide et premiers pas */
.help-ul { margin: 0; padding-inline-start: 1.2em; display: grid; gap: var(--s2); line-height: 1.55; }
.ob-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ob-list li { display: flex; gap: var(--s3); align-items: center; min-height: 40px; }
.ob-list li .sev { width: 24px; height: 24px; border-radius: 7px; flex: none; } .ob-list li .sev::after { inset: 5px; }
.ob-list li.done a { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
/* plan de migration */
.mp-src h3 { font-size: var(--fs-sm); margin-bottom: 4px; } .mp-src p, .mp-ul { font-size: var(--fs-sm); color: var(--muted); line-height: 1.55; margin: 0; }
.mp-ul { padding-inline-start: 1.1em; }
.mp-in .f { flex: 1 1 150px; }
/* encaissements : action principale discrète */
.btn.primary-soft { border-color: var(--accent); color: var(--accent); font-weight: 600; }
/* comptes : un rang de filtres */
.qf-sep { width: 1px; align-self: stretch; background: var(--line); margin-inline: var(--s1); }
.qa-bar { padding: var(--s2) var(--s5) var(--s3); border-bottom: 1px solid var(--line); }
.mp-det > summary { list-style: none; cursor: pointer; display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; padding: var(--s4) var(--s5); }
.mp-det > summary::-webkit-details-marker { display: none; }
.mp-det > summary h2 { display: inline; } .mp-det > summary::after { content: "▾"; margin-inline-start: auto; color: var(--muted); }
.mp-det[open] > summary { border-bottom: 1px solid var(--line); } .mp-det[open] > summary::after { content: "▴"; }

/* v15b : arabe sans barré ; plage de dates groupée ; contraste élevé (Windows) ; en-tête mobile */
html[dir=rtl] .ob-list li.done a { text-decoration: none; }
.ob-list li.done a { text-decoration: none; color: var(--muted); }
.filters .date-f + .date-f { margin-inline-start: -4px; }
@media (forced-colors: active) {
  .bar i, .prog .bar i { forced-color-adjust: none; background: Highlight; }
  .chip-f[aria-pressed="true"], .seg button[aria-pressed="true"], .timeline button[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: 2px; }
  .steps li[aria-current="step"] { border-top-color: Highlight; }
  .sev::after { forced-color-adjust: none; background: CanvasText; }
  .pill { border: 1px solid CanvasText; }
}
@media (max-width: 760px) {
  .top .search { flex: 0 0 44px; }
  .top .search input { padding: 0; width: 44px; color: transparent; }
  .top .search input::placeholder { color: transparent; }
  .top .search kbd { display: none; }
  .prof select { max-width: 132px; }
}

/* ---------- v16 ---------- */
/* score de conformité : anneau + liste des exigences */
.sc-wrap { display: flex; gap: var(--s6); padding: var(--s5); align-items: flex-start; flex-wrap: wrap; }
.sc-ring { --p: 0; flex: 0 0 auto; inline-size: 112px; block-size: 112px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--sunken) 0); }
.sc-ring > span { inline-size: 86px; block-size: 86px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; line-height: 1; }
.sc-ring strong { font-size: var(--fs-2xl); font-variant-numeric: tabular-nums; } .sc-ring small { color: var(--muted); font-size: var(--fs-sm); }
.sc-body { flex: 1 1 320px; min-width: 0; } .sc-body h2 { margin: 0 0 var(--s1); font-size: var(--fs-lg); }
.sc-list { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s1) var(--s5); }
.sc-list li { display: flex; align-items: center; gap: var(--s2); min-block-size: 36px; font-size: var(--fs-sm); }
.sc-list li > span:nth-child(2) { flex: 1; min-width: 0; } .sc-list li.ok > span:nth-child(2) { color: var(--muted); }
.sc-list .sev { flex: 0 0 auto; }
/* connexion unique sur l'écran de connexion */
.sso-or { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: var(--fs-sm); margin-block: var(--s2); }
.sso-or::before, .sso-or::after { content: ""; flex: 1; border-block-start: 1px solid var(--line); }
.sso-btn { inline-size: 100%; justify-content: center; }
/* page d'état du service */
.status-page { max-inline-size: 960px; margin-inline: auto; }
.st-row > div { flex: 1; }
.st-days { display: flex; gap: 2px; margin-block-start: var(--s2); block-size: 28px; direction: ltr; }
.st-days i { flex: 1 1 0; min-inline-size: 1px; border-radius: 2px; background: var(--ok); }
.st-days i.warn { background: var(--warn); } .st-days i.down { background: var(--crit); } .st-days i.na { background: var(--sunken); }
.side-foot .st-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
body.is-login .status-page .head .actions { display: flex; }
@media (forced-colors: active) { .sc-ring { border: 2px solid CanvasText; } .st-days i { forced-color-adjust: none; } }
@media (max-width: 640px) { .sc-wrap { padding: var(--s4); gap: var(--s4); } .sc-ring { inline-size: 88px; block-size: 88px; } .sc-ring > span { inline-size: 66px; block-size: 66px; } .st-days { gap: 1px; } }
.sc-more { margin-block-start: var(--s2); } .sc-more > summary { cursor: pointer; color: var(--accent-ink); font-size: var(--fs-sm); min-block-size: var(--tap); display: flex; align-items: center; }
/* largeur intermédiaire (1024–1200 px) : la colonne de droite de l'accueil est étroite, le tableau des serveurs y tient */
@media (min-width: 900px) and (max-width: 1200px) {
  [aria-labelledby="nodesH"] td:last-child { min-width: 64px !important; }
  [aria-labelledby="nodesH"] td:last-child .num { display: none; }
  [aria-labelledby="nodesH"] .cell-name small { display: none; }
  [aria-labelledby="nodesH"] th, [aria-labelledby="nodesH"] td { padding-inline: 10px; }
}
@media (min-width: 900px) and (max-width: 1200px) {
  /* comptes : la dernière connexion reste dans la fiche ; l'adresse ne se coupe plus au tiret */
  table.cards:has(#pageSel) tr > :nth-child(7) { display: none; }
  table.cards:has(#pageSel) td:nth-child(3) { overflow-wrap: normal; word-break: normal; }
  table.cards:has(#pageSel) th { white-space: normal; }
  table.cards:has(#pageSel) td:nth-child(5) .bar { width: 48px; min-width: 48px; flex: 0 0 48px; }
  table.cards:has(#pageSel) th, table.cards:has(#pageSel) td { padding-inline: 8px; }
}
/* page publique d'état : marges propres, marque visible */
.status-page { padding: var(--s8) var(--s4) var(--s10); }
.status-page .st-brand { display: flex; align-items: center; gap: var(--s2); font-weight: 600; margin-block-end: var(--s5); color: var(--ink); }
.status-page .st-brand img, .status-page .st-brand svg { inline-size: 28px; block-size: 28px; }
.status-page > .hint, #stBody > .hint { margin-block-end: var(--s3); }
.status-page .panel + .panel { margin-block-start: var(--s4); }
.st-legend { display: flex; direction: ltr; justify-content: space-between; padding: 0 var(--s5) var(--s3) calc(var(--s5) + 44px); color: var(--muted); font-size: var(--fs-xs); }
[dir="rtl"] .st-legend { padding: 0 calc(var(--s5) + 44px) var(--s3) var(--s5); }
/* journal sur mobile : une carte compacte — date et résultat, phrase, puis IP et empreinte sur une ligne */
@media (max-width: 760px) {
  table.kcards tr:has([data-h]) { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  table.kcards tr:has([data-h]) > td:nth-child(1) { grid-column: 1; grid-row: 1; color: var(--muted); font-size: var(--fs-sm); }
  table.kcards tr:has([data-h]) > td:nth-child(4) { grid-column: 2; grid-row: 1; }
  table.kcards tr:has([data-h]) > td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  table.kcards tr:has([data-h]) > td:nth-child(3) { grid-column: 1; grid-row: 3; justify-content: flex-start; font-size: var(--fs-xs); color: var(--muted); }
  table.kcards tr:has([data-h]) > td:nth-child(5) { grid-column: 2; grid-row: 3; }
  table.kcards tr:has([data-h]) > td:nth-child(2)::before, table.kcards tr:has([data-h]) > td:nth-child(4)::before,
  table.kcards tr:has([data-h]) > td:nth-child(5)::before { content: none; }
  table.kcards tr:has([data-h]) > td:nth-child(3)::before { font-size: var(--fs-xs); }
  table.kcards tr:has([data-h]) [data-h] { min-block-size: 32px; padding-inline: 6px; font-size: var(--fs-xs); }
}
/* v16b : retours du huitième audit */
.status-page .st-brand { color: var(--fg); }
.st-verdict { display: flex; align-items: center; gap: var(--s3); margin-block-end: var(--s4); }
.st-key { display: inline-flex; align-items: center; gap: 6px; }
.st-key i { inline-size: 10px; block-size: 10px; border-radius: 2px; background: var(--ok); display: inline-block; margin-inline-start: 8px; }
.st-key i.warn { background: var(--warn); } .st-key i.down { background: var(--crit); }
.st-days i.warn { background: repeating-linear-gradient(45deg, var(--warn) 0 3px, color-mix(in oklab, var(--warn) 60%, var(--surface)) 3px 6px); }
.st-days i.down { background: repeating-linear-gradient(-45deg, var(--crit) 0 2px, var(--surface) 2px 4px); }
@media (max-width: 640px) { .st-key { display: none; } }
/* valeurs saisies (souvent en français) dans l'interface arabe : chaque valeur prend sa propre direction */
[dir="rtl"] dl.kv dd, [dir="rtl"] .tbl td, [dir="rtl"] .cell-name span, [dir="rtl"] .list p { unicode-bidi: plaintext; }
/* en-tête mobile : le sélecteur de vue n'est plus tronqué */
@media (max-width: 760px) { .prof select { max-width: min(230px, 58vw); } }
/* comptes à largeur intermédiaire : adresse sur une ligne, coupée proprement */
@media (min-width: 900px) and (max-width: 1200px) {
  table.cards:has(#pageSel) td:nth-child(3) { white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- v17 ---------- */
/* densité compacte (touche d ou bouton) : plus de lignes à l'écran, cibles tactiles conservées sur mobile */
@media (min-width: 761px) {
  .density-compact .tbl td, .density-compact .tbl th { padding-block: 5px; }
  .density-compact table.cards td .cell-name small { display: none; }
  .density-compact .tbl .btn.sm { min-block-size: 30px; }
}
tbody tr.kb-on { outline: 2px solid var(--focus); outline-offset: -2px; }
.kb-tbl { width: 100%; border-collapse: collapse; } .kb-tbl td { padding: 8px 4px; border-block-end: 1px solid var(--line); }
.kb-tbl kbd { font-family: var(--mono); font-size: var(--fs-sm); background: var(--sunken); border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.srv-note { padding: 0 var(--s5) var(--s3); margin: 0; }
/* sauvegardes : état de la nuit et action principale */
.bk-night { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-block-end: var(--s4); }
.bk-night p { margin: 0; flex: 1 1 320px; }
#bkNight.ok { margin-block-end: var(--s4); }
.bk-older { margin-block-start: var(--s3); }
/* journal : plage de dates groupée */
.date-range { display: inline-flex; gap: var(--s3); flex-wrap: nowrap; align-items: flex-end; }
@media (max-width: 640px) { .date-range { flex-wrap: wrap; } }
/* accueil revendeur : chiffre d'affaires sur 6 mois et premiers pas */
.rev-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s2); align-items: end; block-size: 120px; direction: ltr; }
.rev-bars li { display: grid; grid-template-rows: 1fr auto; block-size: 100%; text-align: center; }
.rev-bars .rv { align-self: end; block-size: var(--h); min-block-size: 4px; background: var(--accent-soft); border-radius: 4px 4px 0 0; }
.rev-bars li:last-child .rv { background: var(--accent); }
.rev-bars .rl { font-size: var(--fs-xs); color: var(--muted); padding-block-start: 4px; }
.rev-last { margin: var(--s2) 0 0; }
.rh-start summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); cursor: pointer; list-style: none; }
.rh-start summary h2 { margin: 0; font-size: var(--fs-md); } .rh-start .ob-list { padding: 0 var(--s5) var(--s4); }
/* menu revendeur : « Plus d'outils » lisible */
.nav-more details > summary { font-size: var(--fs-sm); color: var(--fg); min-block-size: var(--tap); display: flex; align-items: center; border-radius: var(--r); padding-inline: 10px; }
.nav-more details > summary:hover { background: var(--sunken); }
.rh-side { align-content: start; }
/* mobile : densité et aide clavier n'ont pas de sens au doigt ; pas d'icônes sans libellé */
@media (max-width: 760px) { #dnBtn { display: none; } }
/* v17b : densité nettement plus compacte ; chiffre d'affaires lisible */
@media (min-width: 761px) {
  .density-compact .tbl td, .density-compact .tbl th { padding-block: 2px; font-size: var(--fs-sm); }
  .density-compact .tbl .bar { block-size: 6px; }
  .density-compact table.cards td .cell-name { gap: 0; }
}
#dnBtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.rev-bars li { grid-template-rows: auto 1fr auto; }
.rev-bars .rvv { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.rev-bars .rv { background: color-mix(in oklab, var(--accent) 45%, var(--surface)); }
@media (min-width: 761px) {
  .density-compact .tbl td .btn, .density-compact .tbl td .icon-btn { min-block-size: 26px; min-inline-size: 26px; padding-block: 0; }
  .density-compact .tbl td input[type="checkbox"] { margin-block: 0; }
}
@media (min-width: 761px) and (pointer: fine) { .density-compact { --row: 32px; } }
table.cards:has(#pageSel) td:nth-child(4) { white-space: nowrap; }

/* ---------- v18 ---------- */
.tabs { display: flex; gap: 2px; border-block-end: 1px solid var(--line); margin-block-end: var(--s4); overflow-x: auto; }
.tabs [role="tab"] { appearance: none; background: none; border: 0; border-block-end: 2px solid transparent; padding: 10px 14px; min-block-size: var(--tap);
  font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; margin-block-end: -1px; }
.tabs [role="tab"][aria-selected="true"] { color: var(--fg); border-block-end-color: var(--accent); }
.tabs [role="tab"]:hover { color: var(--fg); }
.tk-perms { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s1) var(--s4); margin: 0; }
.view-chip { display: inline-flex; align-items: center; }
.view-chip .chip-f { border-start-end-radius: 0; border-end-end-radius: 0; }
.view-x { appearance: none; border: 1px solid var(--line-strong); border-inline-start: 0; background: var(--surface); color: var(--muted); min-block-size: 32px; min-inline-size: 32px;
  border-start-end-radius: 999px; border-end-end-radius: 999px; cursor: pointer; font-size: 1rem; line-height: 1; }
.view-x:hover { color: var(--crit); }
.ghost-chip { border-style: dashed !important; }
.qf-and { padding: 0 var(--s5); margin: 0 0 var(--s2); }
#msOut .tbl { margin-block-start: var(--s3); }

.mp-det > summary[data-more]::after { content: attr(data-more) "  \25BE"; font-size: var(--fs-sm); color: var(--accent-ink); white-space: nowrap; }
.mp-det[open] > summary[data-less]::after { content: attr(data-less) "  \25B4"; }

@media (max-width: 640px) { .tabs [role="tab"] { flex: 1 1 0; white-space: normal; text-align: center; padding: 8px 6px; line-height: 1.25; } }

.qf-views { padding-block-start: 0; }
[dir="rtl"] dl.kv dd, [dir="rtl"] .tbl td[lang="fr"] { text-align: right; }
@media (max-width: 640px) { .qf-views { display: none; } }
