/* Plateforme d'audit : surfaces claires, accent bleu/turquoise repris du logo, couleurs de statut dédiées.
   Arrondis : contrôles 8px, cartes 12px, panneaux et fenêtres 16px, étiquettes 6px.
   Thème : clair par défaut ; sombre ou « auto » (selon le système) au choix de l'utilisateur (html[data-theme]). */
@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  /* surfaces : gris bleutés clairs */
  --canvas: #eef2f8; --bg: #f7f9fc; --panel: #ffffff; --soft: #eef2f7; --hover: #f3f6fb;
  --line: #e1e7f0; --line2: #cfd8e5;
  /* texte (contraste AA sur --bg et --panel) */
  --tx: #172033; --txm: #55607a; --txl: #6b7690;
  /* marque (logo) : bleu et turquoise */
  --brand: #2563eb; --brand-hover: #1d4fd8; --brand2: #0ea5b7; --brand-bg: #e8f0ff; --brand-tx: #1d4ed8; --brand-line: #bfd3fb;
  --grad: linear-gradient(135deg, #2563eb 0%, #0ea5b7 100%);
  /* encre : boutons principaux, sélection */
  --ink: var(--brand); --ink-hover: var(--brand-hover); --on-ink: #ffffff;
  --acc: var(--brand); --acc2: var(--brand-tx); --accbg: var(--brand-bg); --accline: #a9c0ea;
  --side: var(--ink); --side2: var(--canvas); --sidetx: #3b4660;
  /* teintes des rubriques (icônes de navigation, cartes du guide) */
  --c-blue: #2563eb; --c-teal: #0e9fb0; --c-violet: #7c3aed; --c-amber: #d97706; --c-rose: #e11d48; --c-green: #16a34a; --c-slate: #64748b;
  /* statuts */
  --ok: #2e7d4f; --part: #d4931c; --nc: #d23f31; --nc-strong: #9e2a20; --na: #8b95a8; --info: #3a64a8; --warn: #a86412;
  --ok-bg: #e8f2eb; --part-bg: #fbf0da; --nc-bg: #fbe8e5; --info-bg: #e7edf7; --na-bg: #eceff4;
  --ok-tx: #1f5c39; --part-tx: #7a4d0c; --nc-tx: #8f261d; --info-tx: #284a80; --na-tx: #4b5568;
  --ok-line: #c3dccb; --part-line: #ecd5a2; --nc-line: #efc6bf; --info-line: #c8d6ec;
  --signal: #e2551b;
  /* texte sur les couleurs claires venant du catalogue (niveaux de risque) : identique dans les deux thèmes */
  --on-data: #1c1c1a;
  /* forme */
  --radius: 12px; --radius-sm: 8px; --radius-xs: 6px; --radius-lg: 16px;
  --shade: 23 32 51;
  --shadow: 0 1px 2px rgb(var(--shade) / .05), 0 1px 1px rgb(var(--shade) / .03);
  --shadow-pop: 0 1px 2px rgb(var(--shade) / .06), 0 12px 32px -8px rgb(var(--shade) / .2);
  --scrim: rgb(var(--shade) / .32);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --z-side: 50; --z-modal: 1000; --z-toast: 2000;
}
/* thème sombre (bleu nuit) : choisi explicitement, ou « auto » quand le système est en sombre */
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0f172a; --bg: #131c31; --panel: #182238; --soft: #1f2a42; --hover: #1c2740;
  --line: #27324b; --line2: #34405c;
  --tx: #e6ebf5; --txm: #a3aec5; --txl: #8995ae;
  --brand: #5b8def; --brand-hover: #79a3f3; --brand2: #2cc3d3; --brand-bg: rgb(91 141 239 / .16); --brand-tx: #a9c4fa; --brand-line: rgb(91 141 239 / .4);
  --ink: var(--brand); --ink-hover: var(--brand-hover); --on-ink: #0b1222;
  --accbg: rgb(91 141 239 / .14); --accline: #4a5a7d; --sidetx: #c1cadc;
  --c-blue: #6f9cf2; --c-teal: #33c2d1; --c-violet: #a78bfa; --c-amber: #f0b44c; --c-rose: #fb7185; --c-green: #4ade80; --c-slate: #94a3b8;
  --ok: #4fae74; --part: #e0a63a; --nc: #ec5c4e; --nc-strong: #f07a6d; --na: #8995ae; --info: #6d93d6; --warn: #e0a63a;
  --ok-bg: rgb(79 174 116 / .14); --part-bg: rgb(224 166 58 / .14); --nc-bg: rgb(236 92 78 / .14); --info-bg: rgb(109 147 214 / .15); --na-bg: #222d45;
  --ok-tx: #8fd3a8; --part-tx: #f0c677; --nc-tx: #f59a90; --info-tx: #a9c2ee; --na-tx: #c1cadc;
  --ok-line: rgb(79 174 116 / .35); --part-line: rgb(224 166 58 / .35); --nc-line: rgb(236 92 78 / .35); --info-line: rgb(109 147 214 / .35);
  --shade: 0 0 0;
  --shadow: 0 1px 0 rgb(0 0 0 / .2);
  --shadow-pop: 0 0 0 1px #27324b, 0 16px 40px -8px rgb(0 0 0 / .6);
  --scrim: rgb(2 6 23 / .6);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --canvas: #0f172a; --bg: #131c31; --panel: #182238; --soft: #1f2a42; --hover: #1c2740;
    --line: #27324b; --line2: #34405c;
    --tx: #e6ebf5; --txm: #a3aec5; --txl: #8995ae;
    --brand: #5b8def; --brand-hover: #79a3f3; --brand2: #2cc3d3; --brand-bg: rgb(91 141 239 / .16); --brand-tx: #a9c4fa; --brand-line: rgb(91 141 239 / .4);
    --ink: var(--brand); --ink-hover: var(--brand-hover); --on-ink: #0b1222;
    --accbg: rgb(91 141 239 / .14); --accline: #4a5a7d; --sidetx: #c1cadc;
    --c-blue: #6f9cf2; --c-teal: #33c2d1; --c-violet: #a78bfa; --c-amber: #f0b44c; --c-rose: #fb7185; --c-green: #4ade80; --c-slate: #94a3b8;
    --ok: #4fae74; --part: #e0a63a; --nc: #ec5c4e; --nc-strong: #f07a6d; --na: #8995ae; --info: #6d93d6; --warn: #e0a63a;
    --ok-bg: rgb(79 174 116 / .14); --part-bg: rgb(224 166 58 / .14); --nc-bg: rgb(236 92 78 / .14); --info-bg: rgb(109 147 214 / .15); --na-bg: #222d45;
    --ok-tx: #8fd3a8; --part-tx: #f0c677; --nc-tx: #f59a90; --info-tx: #a9c2ee; --na-tx: #c1cadc;
    --ok-line: rgb(79 174 116 / .35); --part-line: rgb(224 166 58 / .35); --nc-line: rgb(236 92 78 / .35); --info-line: rgb(109 147 214 / .35);
    --shade: 0 0 0;
    --shadow: 0 1px 0 rgb(0 0 0 / .2);
    --shadow-pop: 0 0 0 1px #27324b, 0 16px 40px -8px rgb(0 0 0 / .6);
    --scrim: rgb(2 6 23 / .6);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.55 var(--font); color: var(--tx); background: var(--canvas); -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11"; }
::selection { background: var(--ink); color: var(--on-ink); }
a { color: var(--tx); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; transition: text-decoration-color .15s ease; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 1.75rem; letter-spacing: -0.035em; line-height: 1.1; }
h2 { font-size: 1.02rem; } h3 { font-size: .95rem; } h4 { font-size: .86rem; }
p { margin: 0 0 .7em; text-wrap: pretty; }
code, .mono { font-family: var(--mono); font-size: .84em; }
.muted { color: var(--txm); } .small { font-size: .82rem; } .tiny { font-size: .72rem; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--tx); outline-offset: 2px; border-radius: 4px; }
svg.i { flex-shrink: 0; display: inline-block; vertical-align: -0.2em; width: 1.15em; height: 1.15em; }
#side svg.i, #top svg.i { width: 18px; height: 18px; }
.btn svg.i { width: 16px; height: 16px; margin-left: -2px; color: inherit; }
.btn-sm svg.i { width: 14px; height: 14px; }
svg.i.flip { transform: scaleX(-1); }
.done-ic { display: inline-grid; color: var(--ok); }
.btn-sm:has(> svg.i:only-child) { padding: 0 7px; }

/* ---------- coquille ---------- */
#app { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr); height: 100vh; height: 100dvh; }
#app.no-side { grid-template-columns: minmax(0, 1fr); }
#app.no-side #side, #app.no-side #top { display: none; }
#app.no-side #main { grid-column: 1; grid-row: 1 / -1; margin: 0; border: 0; border-radius: 0; padding: 0; background: var(--bg); }

#side { grid-row: 1 / -1; grid-column: 1; background: var(--canvas); color: var(--sidetx); overflow-y: auto; padding: 14px 12px 32px; scrollbar-width: thin; }
#side .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; color: var(--tx); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; font-size: .95rem; }
.mark { width: 30px; height: 30px; flex-shrink: 0; background: url("/img/logo-64.png") center / contain no-repeat; }
#side .brand-n { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
#side .grp { font-size: .68rem; color: var(--txl); margin: 20px 10px 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
#side a.nav { display: flex; align-items: center; gap: 10px; padding: 6px 10px; min-height: 36px; border-radius: var(--radius-sm); color: var(--sidetx); font-size: .875rem; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
/* chaque rubrique a sa teinte (--c), pour se repérer d'un coup d'œil */
#side a.nav .nav-ic { width: 26px; height: 26px; border-radius: var(--radius-sm); display: inline-grid; place-items: center; flex-shrink: 0; color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 12%, transparent); transition: background-color .15s ease, color .15s ease; }
#side a.nav .nav-ic svg.i { width: 16px; height: 16px; }
#side a.nav .nav-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#side a.nav:hover { background: rgb(var(--shade) / .05); color: var(--tx); }
#side a.nav.on { background: var(--panel); color: var(--tx); font-weight: 600; box-shadow: 0 0 0 1px var(--line), 0 2px 6px -2px rgb(var(--shade) / .12); }
#side a.nav.on .nav-ic { background: var(--c, var(--brand)); color: var(--on-ink); }
#side .count { margin-left: auto; font: 500 .72rem/1 var(--mono); color: var(--txl); font-variant-numeric: tabular-nums; }
#side .count.err { color: var(--nc); } #side .count.warn { color: var(--warn); }
#side .sub { padding-left: 14px; }

#top { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 6px; padding: 0 16px 0 20px; background: var(--canvas); color: var(--tx); min-width: 0; }
#top .crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; font-size: .86rem; color: var(--txm); }
#top .crumbs a { text-decoration: none; color: var(--txm); }
#top .crumbs a:hover { color: var(--tx); }
#top .crumbs .crumb-cur { color: var(--tx); font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
#top .crumbs .crumb-sep { color: var(--line2); }
#top .crumbs .crumb-meta { color: var(--txl); overflow: hidden; text-overflow: ellipsis; padding-left: 8px; border-left: 1px solid var(--line2); }
#top .tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; padding: 2px 7px; border-radius: var(--radius-xs); background: var(--panel); border: 1px solid var(--line); color: var(--txm); }
#top .tag svg.i { width: 12px; height: 12px; }
/* le point traduit un état réel (enregistrement) */
#top .sync { font-size: .76rem; color: var(--txm); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
#top .sync::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line2); }
#top .sync.saving::before, #top .sync.pending::before { background: var(--part); animation: pulse 1.2s ease-in-out infinite; }
#top .sync.saved::before { background: var(--ok); }
#top .sync.offline::before { background: var(--nc); }
@keyframes pulse { 50% { opacity: .35; } }
#top .btn-top { display: inline-flex; align-items: center; gap: 7px; height: 34px; background: transparent; border: 0; color: var(--txm); border-radius: var(--radius-sm); padding: 0 10px; font: inherit; font-size: .82rem; font-weight: 500; cursor: pointer; text-decoration: none; transition: background-color .15s ease, color .15s ease, transform .16s var(--ease-out); }
#top .btn-top:hover { background: rgb(var(--shade) / .06); color: var(--tx); }
#top .btn-top:active { transform: scale(.97); }
#top .btn-top.icon-only { padding: 0 8px; }
/* sélecteur de langue FR | EN */
.lang-sw { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); flex-shrink: 0; }
.lang-sw button { min-width: 34px; height: 28px; padding: 0 8px; border: 0; border-radius: calc(var(--radius-sm) - 2px); background: transparent; color: var(--txm); font: inherit; font-size: .78rem; font-weight: 600; letter-spacing: .02em; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.lang-sw button:hover { color: var(--tx); }
.lang-sw button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.lang-sw button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.auth-main { position: relative; }
.auth-lang { position: absolute; top: 20px; right: 24px; }
#top .menu-btn { display: none; padding: 0 8px; margin-left: -8px; }
#top .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: #fff; display: inline-grid; place-items: center; font-size: .66rem; font-weight: 600; letter-spacing: .02em; }
#top .user { color: var(--tx); }

#main { grid-column: 2; grid-row: 2; overflow-y: auto; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius-lg); padding: 36px 44px 80px; scrollbar-gutter: stable; }
#main:focus { outline: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 260px; }
.page-head h1 { margin: 0; }
.page-head h1::after { content: ""; display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--grad); margin-top: 12px; }
.page-head .sub { color: var(--txm); margin-top: 8px; max-width: 68ch; font-size: .9rem; }

/* ---------- composants ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.stack > * + * { margin-top: 12px; }
.sep { height: 1px; background: var(--line); margin: 16px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; border: 1px solid var(--line2); background: var(--panel); color: var(--tx); border-radius: var(--radius-sm); padding: 0 13px; font: inherit; font-size: .84rem; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; box-shadow: 0 1px 1px rgb(var(--shade) / .04);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .16s var(--ease-out); }
.btn:hover { background: var(--hover); border-color: var(--accline); text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-ink); box-shadow: 0 1px 2px rgb(37 99 235 / .25), inset 0 1px 0 rgb(255 255 255 / .15); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-ink); }
.btn-danger { background: var(--panel); border-color: var(--nc-line); color: var(--nc-tx); }
.btn-danger:hover { background: var(--nc-bg); border-color: var(--nc); color: var(--nc-tx); }
.btn-sm { height: 28px; padding: 0 10px; font-size: .78rem; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: rgb(var(--shade) / .05); border-color: transparent; }
.icon-btn { border: none; background: transparent; cursor: pointer; font-size: 1rem; color: var(--txm); padding: 4px 7px; border-radius: var(--radius-xs); transition: background-color .15s ease, color .15s ease; }
.icon-btn:hover { background: var(--soft); color: var(--tx); }

.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 7px 11px; min-height: 36px; font: inherit; font-size: .875rem; color: var(--tx); background: var(--panel); transition: border-color .15s ease, box-shadow .15s ease; }
.input::placeholder { color: var(--txl); }
select.input { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256' fill='%2373736d'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
select.input[multiple] { background-image: none; padding-right: 11px; }
textarea.input { resize: vertical; min-height: 76px; line-height: 1.5; }
.input:hover { border-color: var(--accline); }
.input:focus { outline: none; border-color: var(--tx); box-shadow: 0 0 0 3px rgb(var(--shade) / .1); }
.input[readonly], .input:disabled { background: var(--soft); color: var(--txm); }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); width: 15px; height: 15px; }
.lbl { display: block; font-size: .78rem; font-weight: 500; color: var(--txm); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.help { font-size: .76rem; color: var(--txl); margin-top: 5px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: .86rem; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: var(--radius-xs); font-size: .72rem; font-weight: 500; background: var(--soft); color: var(--txm); white-space: nowrap; line-height: 1.45; }
.badge.ok { background: var(--ok-bg); color: var(--ok-tx); } .badge.part { background: var(--part-bg); color: var(--part-tx); }
.badge.nc { background: var(--nc-bg); color: var(--nc-tx); } .badge.na { background: var(--na-bg); color: var(--na-tx); }
.badge.acc { background: var(--ink); color: var(--on-ink); } .badge.info { background: var(--info-bg); color: var(--info-tx); }
.badge.err { background: var(--nc); color: var(--on-ink); } .badge.warn { background: var(--part); color: var(--on-ink); }
.pill { display: inline-block; padding: 2px 8px; border-radius: var(--radius-xs); font-size: .74rem; font-weight: 500; color: var(--on-ink); }
.pill.pill-data { color: var(--on-data); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border: 1px solid var(--line2); border-radius: var(--radius-xs); font-size: .78rem; background: var(--panel); max-width: 100%; }
.chip .x { cursor: pointer; color: var(--txl); border: 0; background: none; padding: 0 2px; font-size: .9rem; }
.chip .x:hover { color: var(--nc); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; background: var(--panel); color: var(--txm); font-size: .74rem; font-weight: 500; padding: 10px 12px; position: sticky; top: 0; z-index: 1; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl tr:first-child td { border-top: 0; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable a { color: inherit; text-decoration: none; } .tbl tr.clickable:hover td { background: var(--hover); }
.tbl tr.sel td { background: var(--accbg); }
.tbl input.input, .tbl select.input { padding: 4px 8px; min-height: 30px; font-size: .82rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin-bottom: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpi { background: var(--panel); padding: 16px 20px 18px; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); min-width: 0; }
.kpi a { text-decoration: none; color: inherit; display: block; }
.kpi a:hover .v { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
/* la teinte de rubrique reste sur le bandeau : la valeur garde la couleur du texte (une couleur de statut ne s'applique que si elle a un sens) */
.kpi .v { font-size: 1.85rem; font-weight: 600; line-height: 1.1; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; color: var(--tx); }
.kpi { border-top: 3px solid var(--kc, transparent) !important; }
.kpis .kpi:nth-child(6n+1), .grid > .kpi:nth-child(6n+1) { --kc: var(--c-blue); }
.kpis .kpi:nth-child(6n+2), .grid > .kpi:nth-child(6n+2) { --kc: var(--c-teal); }
.kpis .kpi:nth-child(6n+3), .grid > .kpi:nth-child(6n+3) { --kc: var(--c-violet); }
.kpis .kpi:nth-child(6n+4), .grid > .kpi:nth-child(6n+4) { --kc: var(--c-amber); }
.kpis .kpi:nth-child(6n+5), .grid > .kpi:nth-child(6n+5) { --kc: var(--c-green); }
.kpis .kpi:nth-child(6n+6), .grid > .kpi:nth-child(6n+6) { --kc: var(--c-rose); }
.kpi .l { font-size: .78rem; color: var(--txm); margin-top: 6px; }
.grid > .kpi, .grid-4 > .kpi { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.bar { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; display: flex; gap: 1px; }
.bar > span { display: block; height: 100%; }
.progress { height: 4px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad); border-radius: 2px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 9px 12px; font-weight: 500; font-size: .86rem; color: var(--txm); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; transition: color .15s ease, border-color .15s ease; }
.tab:hover { color: var(--tx); }
.tab.on { color: var(--brand-tx); border-bottom-color: var(--brand); }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--soft); border-radius: var(--radius-sm); }
.seg button { border: 0; background: transparent; padding: 4px 10px; height: 28px; font: inherit; font-size: .8rem; font-weight: 500; cursor: pointer; color: var(--txm); border-radius: var(--radius-xs); transition: background-color .15s ease, color .15s ease; }
.seg button:hover { color: var(--tx); }
.seg button.on { background: var(--panel); color: var(--tx); box-shadow: 0 1px 2px rgb(var(--shade) / .1), 0 0 0 1px var(--line); }

/* ---------- évaluation ---------- */
.audit-layout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.req-list { max-height: calc(100vh - 230px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); scrollbar-width: thin; }
.req-sec { padding: 10px 14px; background: color-mix(in srgb, var(--brand-bg) 70%, var(--panel)); backdrop-filter: blur(6px); font-weight: 600; font-size: .8rem; color: var(--tx); position: sticky; top: 0; z-index: 1; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; cursor: pointer; user-select: none; transition: background-color .15s ease; }
.req-sec:hover { background: color-mix(in srgb, var(--brand-bg) 100%, var(--panel)); }
.req-sec:first-child { border-top: 0; }
.req-sec .caret { color: var(--brand); display: inline-grid; place-items: center; width: 12px; transition: transform .15s ease; }
.req-sec .caret svg.i { width: 12px; height: 12px; }
.req-sec.open .caret { transform: rotate(90deg); }
.req-sec .sec-n { font: 500 .7rem/1 var(--mono); color: var(--txm); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 3px 7px; }
.list-tools { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
.list-tools + .req-sec { border-top: 0; }
.req-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; font-size: .84rem; transition: background-color .12s ease; }
.req-item:hover { background: var(--hover); }
.req-item.on { background: var(--accbg); box-shadow: inset 3px 0 0 var(--brand); }
.req-item .ref { font-family: var(--mono); font-size: .74rem; color: var(--txm); min-width: 54px; padding-top: 1px; }
.req-item .t { flex: 1; min-width: 0; }
.req-item .t .d { color: var(--txm); font-size: .76rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* pastille = résultat réel de l'exigence */
.dotr { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; border: 1.5px solid transparent; }
.detail { position: sticky; top: 0; }
.req-text { white-space: pre-wrap; background: var(--soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .86rem; line-height: 1.6; max-height: 280px; overflow-y: auto; }
.res-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.res-btn { border: 1px solid var(--line2); background: var(--panel); border-radius: var(--radius-sm); padding: 0 12px; height: 34px; font: inherit; font-weight: 500; font-size: .82rem; cursor: pointer; color: var(--txm); transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .16s var(--ease-out); }
.res-btn:hover { border-color: var(--txm); color: var(--tx); }
.res-btn:active { transform: scale(.97); }
.res-btn.on { color: var(--on-ink); }
.res-btn[data-v=compliant].on { background: var(--ok); border-color: var(--ok); }
.res-btn[data-v=partially_compliant].on { background: var(--part); border-color: var(--part); }
.res-btn[data-v=non_compliant].on { background: var(--nc); border-color: var(--nc); }
.res-btn[data-v=not_applicable].on { background: var(--na); border-color: var(--na); }
.score-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.score-btn { min-width: 34px; height: 30px; border: 1px solid var(--line2); background: var(--panel); color: var(--tx); border-radius: var(--radius-sm); padding: 0 8px; font: inherit; font-family: var(--mono); font-size: .8rem; font-weight: 500; cursor: pointer; transition: background-color .15s ease, color .15s ease, transform .16s var(--ease-out); }
.score-btn:hover { border-color: var(--txm); }
.score-btn:active { transform: scale(.95); }
.score-btn.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chk-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); font-size: .84rem; }
.chk-row:first-child { border-top: 0; }
.chk-row .t { flex: 1; }
.chk-btns { display: flex; gap: 3px; flex-shrink: 0; }
.chk-btns button { border: 1px solid var(--line2); background: var(--panel); border-radius: var(--radius-xs); font: inherit; font-size: .7rem; font-weight: 500; padding: 2px 7px; cursor: pointer; color: var(--txm); transition: background-color .12s ease, color .12s ease; }
.chk-btns button:hover { color: var(--tx); border-color: var(--txm); }
.chk-btns button.on[data-v=ok] { background: var(--ok); color: var(--on-ink); border-color: var(--ok); }
.chk-btns button.on[data-v=partial] { background: var(--part); color: var(--on-ink); border-color: var(--part); }
.chk-btns button.on[data-v=missing] { background: var(--nc); color: var(--on-ink); border-color: var(--nc); }
.chk-btns button.on[data-v=na] { background: var(--na); color: var(--on-ink); border-color: var(--na); }
.hint { background: var(--brand-bg); border-left: 3px solid var(--brand); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 10px 14px; font-size: .82rem; }
.notice { border-radius: var(--radius-sm); padding: 10px 14px; font-size: .84rem; border: 1px solid; }
.notice.warn { background: var(--part-bg); border-color: var(--part-line); color: var(--part-tx); }
.notice.err { background: var(--nc-bg); border-color: var(--nc-line); color: var(--nc-tx); }
.notice.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info-tx); }
.notice.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-tx); }
.notice a { color: inherit; }
details.more > summary { cursor: pointer; font-weight: 500; font-size: .82rem; color: var(--txm); margin: 8px 0; }
details.more > summary:hover { color: var(--tx); }
ul.compact { margin: 4px 0; padding-left: 18px; } ul.compact li { margin: 3px 0; }

/* ---------- entretien (mode flash) ---------- */
.flash { max-width: 920px; margin: 0 auto; }
.flash .card { padding: 32px 36px; }
.flash .big-ref { font-family: var(--mono); color: var(--txm); font-weight: 500; }
.flash h2 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; }
.kbd { display: inline-block; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: var(--radius-xs); padding: 0 5px; font-size: .72rem; font-family: var(--mono); background: var(--panel); color: var(--txm); }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; }
.kcol { background: var(--soft); border-radius: var(--radius); padding: 10px; min-height: 220px; }
.kcol h4 { display: flex; justify-content: space-between; margin: 2px 4px 10px; font-weight: 500; color: var(--txm); }
.kcol.drop { outline: 1.5px dashed var(--tx); outline-offset: -2px; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; cursor: grab; font-size: .82rem; box-shadow: 0 1px 2px rgb(var(--shade) / .04); transition: box-shadow .15s ease; }
.kcard:hover { box-shadow: 0 2px 8px rgb(var(--shade) / .1); }
.kcard:active { cursor: grabbing; }

/* ---------- risques ---------- */
.heat { border-collapse: separate; border-spacing: 3px; }
.heat td { width: 46px; height: 38px; text-align: center; font-weight: 600; border-radius: var(--radius-xs); color: var(--on-data); font-size: .84rem; font-variant-numeric: tabular-nums; }
.heat td.no-lv { color: var(--tx); }
.heat th { font-size: .68rem; color: var(--txm); font-weight: 500; padding: 2px 4px; max-width: 90px; }

/* ---------- connexion ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr); background: var(--bg); }
.auth-aside { position: relative; overflow: hidden; background: linear-gradient(155deg, #1e3a8a 0%, #2563eb 55%, #0ea5b7 100%); color: #fff; padding: 40px 56px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-aside::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgb(255 255 255 / .18), transparent 70%); pointer-events: none; }
.auth-aside .brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1.05rem; color: #fff; }
.auth-aside .brand .mark { width: 52px; height: 52px; background-image: url("/img/logo-192.png"); background-color: rgb(255 255 255 / .92); border-radius: var(--radius); background-size: 80%; }
.auth-aside .statement { font-size: clamp(2.2rem, 3.6vw, 3.3rem); font-weight: 600; line-height: 1.06; letter-spacing: -0.045em; margin: 0; max-width: 18ch; color: #fff; text-wrap: balance; }
.auth-aside .statement span { display: block; color: rgb(255 255 255 / .72); }
.auth-aside .lede { color: rgb(255 255 255 / .88); max-width: 44ch; margin: 18px 0 0; font-size: .95rem; }
/* les deux métiers de l'outil : audit de conformité et analyse de risques */
.auth-aside .pillars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 32px; max-width: 600px; }
.auth-aside .pillar { border-top: 1px solid rgb(255 255 255 / .32); padding-top: 14px; }
.auth-aside .pillar b { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; color: #fff; }
.auth-aside .pillar b svg.i { width: 18px; height: 18px; }
.auth-aside .pillar span { display: block; margin-top: 6px; color: rgb(255 255 255 / .82); font-size: .84rem; line-height: 1.5; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 360px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .lead { color: var(--txm); margin-bottom: 28px; }
.auth-card .btn-primary { height: 42px; font-size: .9rem; }
.auth-card .input { min-height: 42px; }

/* ---------- informations légales ---------- */
.auth-main { flex-direction: column; gap: 28px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .76rem; }
.legal-links a { color: var(--txl); text-decoration: none; }
.legal-links a:hover { color: var(--tx); text-decoration: underline; }
.auth-legal { justify-content: center; max-width: 360px; }
.side-legal { margin: 28px 10px 0; padding-top: 14px; border-top: 1px solid var(--line); gap: 4px 12px; }
.legal-page { max-width: 920px; }
.legal-public { margin: 0 auto; padding: 36px 44px 80px; }
.legal-doc h2 { margin-top: 28px; }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc p, .legal-doc li { max-width: 68ch; }
.legal-doc .table-wrap { margin: 8px 0 4px; }
.legal-list { padding-left: 18px; margin: 8px 0; }
.legal-list li + li { margin-top: 4px; }
.legal-tbl td { font-size: .84rem; vertical-align: top; }
.legal-tbl td:first-child { font-weight: 500; }
.legal-missing { background: var(--part-bg); color: var(--part-tx); border-radius: var(--radius-xs); padding: 1px 6px; font-size: .82rem; }
.legal-meta { color: var(--txl); font-size: .78rem; margin-top: 20px; }
.legal-doc > .legal-meta:first-child { margin: 0 0 8px; }
.legal-accept { margin-top: 16px; position: sticky; bottom: 0; box-shadow: var(--shadow-pop); }
.legal-accept .row { margin-top: 12px; }
.lbl .req { color: var(--nc-tx); }
@media (max-width: 720px) { .legal-public { padding: 24px 16px 60px; } }

/* ---------- modales & toasts ---------- */
.modal-backdrop { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); z-index: var(--z-modal); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow-y: auto; animation: fade .18s ease-out; }
.modal { background: var(--panel); border-radius: var(--radius-lg); width: 100%; max-width: 560px; box-shadow: var(--shadow-pop), 0 0 0 1px rgb(var(--shade) / .06); animation: modal-in .22s var(--ease-out); }
.modal-wide { max-width: 980px; }
.modal-head { display: flex; align-items: center; padding: 18px 22px 6px; }
.modal-head h3 { flex: 1; margin: 0; font-size: 1.05rem; }
.modal-body { padding: 12px 22px 18px; max-height: 70vh; overflow-y: auto; }
/* liste d'actions dans une fenêtre : une action par ligne, avec son explication */
.act-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.act-list .btn { justify-content: flex-start; height: auto; min-height: 40px; padding: 8px 12px; white-space: normal; text-align: left; }
.act-list .btn .act-d { display: block; font-size: .76rem; font-weight: 400; color: var(--txm); }
.act-list .btn-danger .act-d { color: var(--nc-tx); }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@keyframes fade { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
/* sortie plus rapide que l'entrée, par le même chemin */
.modal-backdrop.out { pointer-events: none; animation: fade-out .14s ease-out forwards; }
.modal-backdrop.out .modal { animation: modal-out .14s ease-out forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(4px) scale(.98); } }
/* erreur de saisie sous le champ, jusqu'à correction */
.field-err { color: var(--nc-tx); font-size: .76rem; margin-top: 5px; }
.input[aria-invalid="true"] { border-color: var(--nc); }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { background: var(--ink); color: var(--on-ink); padding: 11px 16px 11px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); font-size: .85rem; display: flex; align-items: center; gap: 10px; transition: opacity .2s ease, transform .2s ease; animation: toast-in .3s var(--ease-out); }
/* le point indique le type de message (erreur / succès) */
.toast-error::before, .toast-ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.toast-error::before { background: var(--nc); } .toast-ok::before { background: var(--ok); }
.toast.out { opacity: 0; transform: translateY(4px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.empty { text-align: center; color: var(--txm); padding: 48px 16px; }
.loading { color: var(--txm); padding: 20px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--line2); border-top-color: var(--tx); border-radius: 50%; animation: spin .6s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
svg text { font-family: var(--font); }

/* ---------- missions ---------- */
.m-card { position: relative; display: flex; flex-direction: column; gap: 16px; height: 100%; margin: 0; padding: 20px 22px; transition: border-color .15s ease, box-shadow .2s ease; }
.m-card:hover { border-color: var(--line2); box-shadow: 0 4px 16px -6px rgb(var(--shade) / .12); }
.m-card .m-title { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.m-card .m-title a { text-decoration: none; }
.m-card .m-title a::after { content: ""; position: absolute; inset: 0; }
.m-card .btn { position: relative; z-index: 1; }
.m-card .m-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--txl); }
.fw-line { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; margin-bottom: 6px; }
.fw-line .n { font-family: var(--mono); font-size: .74rem; color: var(--txm); }
/* accès & fonctionnalités : un module, puis son périmètre (référentiels, méthodes) */
.module-row { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.module-row .scope-block { margin: 12px 0 0; }
.scope-items { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--panel);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 4px 16px; }
.scope-items .check { align-items: flex-start; }
.scope-items .check input { margin-top: 3px; }
/* choix du type de mission (création) : deux options exclusives, boutons radio natifs */
.kind-pick { border: 0; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kind-pick legend { padding: 0; grid-column: 1 / -1; }
.kind-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line2); border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.kind-opt:hover { border-color: var(--accline); }
.kind-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-bg); }
.kind-opt input { margin-top: 3px; }
.kind-opt b { display: block; font-weight: 600; font-size: .9rem; }
.kind-opt .kind-ic { color: var(--brand); display: inline-flex; margin-top: 1px; }
@media (max-width: 640px) { .kind-pick { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.search { position: relative; flex: 0 1 340px; }
.search svg.i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--txl); width: 16px; height: 16px; pointer-events: none; }
.search .input { padding-left: 34px; }

/* ---------- accueil, guide ---------- */
.hero { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 26px 28px; margin-bottom: 24px; color: #fff; background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #0ea5b7 100%); box-shadow: 0 10px 30px -14px rgb(37 99 235 / .6); }
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgb(255 255 255 / .2), transparent 70%); pointer-events: none; }
.hero h2 { font-size: 1.35rem; margin: 0 0 6px; letter-spacing: -0.02em; color: #fff; }
.hero p { margin: 0; color: rgb(255 255 255 / .9); max-width: 70ch; }
.hero .hero-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero .hero-steps span { display: inline-flex; align-items: center; gap: 8px; background: rgb(255 255 255 / .16); border: 1px solid rgb(255 255 255 / .25); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: .8rem; font-weight: 500; }
.hero .hero-steps b { width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #1d4ed8; display: inline-grid; place-items: center; font-size: .72rem; }
.hero .btn { position: relative; z-index: 1; background: #fff; color: #1d4ed8; border-color: #fff; }
.hero .btn:hover { background: #eef4ff; color: #1d4ed8; }
.hero .btn-ghost-w { background: transparent; color: #fff; border-color: rgb(255 255 255 / .5); }
.hero .btn-ghost-w:hover { background: rgb(255 255 255 / .12); color: #fff; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; margin-bottom: 24px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border-top: 3px solid var(--c, var(--brand)); }
.step .n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--c, var(--brand)) 14%, transparent); color: var(--c, var(--brand)); margin-bottom: 10px; }
.step h3 { margin: 0 0 6px; font-size: .95rem; }
.step p { margin: 0; font-size: .84rem; color: var(--txm); }
.legend-res { display: flex; flex-wrap: wrap; gap: 8px; }
.legend-res span { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.legend-res i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
details.fwg { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--brand)); border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow); }
details.fwg > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 12px; }
details.fwg > summary::-webkit-details-marker { display: none; }
/* chevron de la famille d'icônes (Phosphor caret-right), en masque pour suivre la couleur */
:root { --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z'/%3E%3C/svg%3E"); }
details.fwg > summary::after { content: ""; width: 12px; height: 12px; background: var(--c, var(--brand)); -webkit-mask: var(--caret) center / contain no-repeat; mask: var(--caret) center / contain no-repeat; margin-left: auto; transition: transform .15s ease; }
details.fwg[open] > summary::after { transform: rotate(90deg); }
details.fwg > summary:hover { background: var(--hover); border-radius: var(--radius); }
details.fwg .fwg-body { padding: 0 18px 16px; font-size: .88rem; }
details.fwg .fwg-body h4 { margin: 14px 0 4px; color: var(--c, var(--brand)); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
details.fwg .fwg-body p { margin: 0 0 6px; }
.fwg-t { font-weight: 600; }
.cat-h { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.cat-h h2 { margin: 0; }
.cat-h .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--brand)); }
.fw-card { border-top: 3px solid var(--c, var(--brand)) !important; transition: transform .15s var(--ease-out), box-shadow .15s ease; }
.fw-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px -12px rgb(var(--shade) / .35); }
/* arbre du catalogue : sections repliables */
/* Bibliothèque de référence : textes consultables, repliés sous les référentiels d'audit */
details.ref-lib { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 4px; }
details.ref-lib > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; padding: 8px 4px; border-radius: var(--radius-xs); }
details.ref-lib > summary::-webkit-details-marker { display: none; }
details.ref-lib > summary::before { content: ""; width: 12px; height: 12px; background: var(--txm); -webkit-mask: var(--caret) center / contain no-repeat; mask: var(--caret) center / contain no-repeat; transition: transform .15s ease; display: inline-block; flex-shrink: 0; }
details.ref-lib[open] > summary::before { transform: rotate(90deg); }
details.ref-lib > summary:hover { background: var(--hover); }
details.ref-lib > summary h2 { color: var(--txm); }
#fwlist details.ref-lib { margin-top: 12px; }
#fwlist details.ref-lib > summary { font-size: .82rem; font-weight: 500; color: var(--txm); padding: 6px 2px; }
details.tree-sec { border-top: 1px solid var(--line); }
details.tree-sec > summary { cursor: pointer; padding: 8px 4px; font-weight: 600; list-style: none; display: flex; gap: 8px; align-items: center; }
details.tree-sec > summary::-webkit-details-marker { display: none; }
details.tree-sec > summary::before { content: ""; width: 12px; height: 12px; background: var(--brand); -webkit-mask: var(--caret) center / contain no-repeat; mask: var(--caret) center / contain no-repeat; transition: transform .15s ease; display: inline-block; flex-shrink: 0; }
details.tree-sec[open] > summary::before { transform: rotate(90deg); }
details.tree-sec > summary:hover { background: var(--hover); border-radius: var(--radius-xs); }
/* choix de la langue des livrables */
.lang-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.lang-pick label { flex: 1; min-width: 150px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; background: var(--panel); transition: border-color .15s ease, background-color .15s ease; }
.lang-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-bg); }
.lang-pick input { margin-top: 3px; }

/* ---------- incidents ---------- */
.inc-card { border-left: 4px solid var(--c-amber); }
.inc-card.inc-late { border-left-color: var(--nc); }
.inc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 12px; }
.inc-reg { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.inc-step { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: .84rem; }
.inc-reg .lbl + .inc-step { border-top: 0; }
.inc-step .badge { min-width: 104px; justify-content: center; }

@media (max-width: 1100px) { #dashGrid { grid-template-columns: minmax(0, 1fr) !important; } }
#top .top-search { position: relative; flex: 0 1 260px; margin-right: 6px; }
#top .top-search svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--txl); pointer-events: none; }
#top .top-search input { height: 34px; min-height: 34px; padding-left: 32px; font-size: .82rem; background: var(--panel); }
@media (max-width: 900px) { #top .top-search { display: none; } }

/* ---------- registres réglementaires ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 12px; }
.form-sep { margin: 8px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--brand-tx); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 700px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.reg-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.tag-crit { background: var(--nc-bg); color: var(--nc-tx); }
.tbl td .chips { gap: 4px; }

/* ---------- assistant d'applicabilité ---------- */
.wiz-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .wiz-grid { grid-template-columns: minmax(0, 1fr); } }
.wiz-q { margin-bottom: 18px; }
.wiz-q > .lbl { font-size: .86rem; color: var(--tx); font-weight: 600; margin-bottom: 8px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice label { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 6px 12px; cursor: pointer; background: var(--panel); font-size: .84rem; transition: border-color .15s ease, background-color .15s ease; }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-bg); color: var(--brand-tx); font-weight: 500; }
.choice input { margin: 0; }
.res-card { border-left: 4px solid var(--c, var(--brand)); }
.res-card .card-head h3 { font-size: 1rem; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 6px 0 10px; font-size: .86rem; }
.tl-item::before { content: ""; position: absolute; left: -21px; top: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 3px solid var(--c, var(--brand)); }
.tl-item.past { opacity: .7; }
.tl-item.past::before { background: var(--c, var(--brand)); }
.tl-item .d { font: 600 .78rem var(--mono); color: var(--c, var(--brand)); }

/* ---------- analyse de risque guidée ---------- */
.study-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.study-grid > aside { position: sticky; top: 0; }
@media (max-width: 1200px) { .study-grid { grid-template-columns: minmax(0, 1fr); } .study-grid > aside { position: static; } }
.phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin-bottom: 20px; }
.phase { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--txm); text-decoration: none; font-size: .8rem; font-weight: 500; min-width: 0; transition: background-color .15s ease, border-color .15s ease; }
.phase:hover { background: var(--hover); color: var(--tx); }
.phase .n { flex-shrink: 0; width: 24px; height: 24px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--soft); color: var(--txm); font-size: .74rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.phase .n svg.i { width: 13px; height: 13px; }
.phase .t { min-width: 0; line-height: 1.25; }
.phase.done .n { background: var(--ok-bg); color: var(--ok-tx); }
.phase.on { border-color: var(--brand); background: var(--brand-bg); color: var(--brand-tx); }
.phase.on .n { background: var(--brand); color: var(--on-ink); }
.issue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .8rem; }
.issue-list li { display: flex; gap: 8px; align-items: flex-start; }
.issue-list .badge { flex-shrink: 0; min-width: 74px; justify-content: center; }
.gate { border-top: 3px solid var(--line2); }
.gate.ok { border-top-color: var(--ok); } .gate.stale { border-top-color: var(--part); }
.input.input-sm, select.input.input-sm { min-height: 30px; padding: 4px 8px; font-size: .8rem; }
.measure-list { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; gap: 6px; }
.measure-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .84rem; }
.linklike { border: 0; background: none; padding: 0; font: inherit; font-weight: 500; color: var(--tx); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; cursor: pointer; text-align: left; }
.linklike:hover { text-decoration-color: currentColor; }
.chip.chip-warn { border-color: var(--part-line); background: var(--part-bg); color: var(--part-tx); }
.prop-group { margin: 8px 0; } .prop-group > summary { cursor: pointer; padding: 4px 0; }
.prop-list { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; gap: 6px; max-height: 340px; overflow-y: auto; }
.prop-list .check { align-items: flex-start; font-size: .84rem; }
fieldset.cand { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0 0 10px; padding: 8px 12px; display: grid; gap: 4px; }
fieldset.cand legend { padding: 0 4px; font-size: .84rem; }
details.fair { margin-top: 6px; } details.fair > summary { cursor: pointer; color: var(--brand-tx); }
.fair-tbl { border-collapse: collapse; margin: 6px 0; font-size: .78rem; }
.fair-tbl th { text-align: left; font-weight: 500; color: var(--txm); padding: 2px 6px 2px 0; }
.fair-tbl td { padding: 2px 4px; } .fair-tbl input { width: 96px; font-variant-numeric: tabular-nums; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media print { .study-grid { display: block; } .print-avoid { break-inside: avoid; } }

/* ---------- graphiques (svg.js) ---------- */
.ch-track { stroke: var(--soft); }
.ch-grid { stroke: var(--line); }
.ch-tx { fill: var(--tx); }
.ch-txm { fill: var(--txm); }

/* ---------- module SRA : niveaux de risque (libellé toujours écrit, la couleur ne fait que le doubler) ---------- */
.lv { display: inline-block; padding: 2px 7px; border-radius: var(--radius-xs); font-size: .74rem; font-weight: 500; white-space: nowrap; background: var(--na-bg); color: var(--na-tx); }
.lv-vl { background: var(--ok-bg); color: var(--ok-tx); }
.lv-l { background: var(--info-bg); color: var(--info-tx); }
.lv-m { background: var(--part-bg); color: var(--part-tx); }
.lv-h { background: var(--nc-bg); color: var(--nc-tx); }
.lv-vh { background: var(--nc); color: var(--on-ink); }
.sra-heat td { width: 52px; height: 40px; color: var(--tx); }
.sra-heat td.lv-vh { color: var(--on-ink); }
.sra-sheet-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; margin-bottom: 16px; background: var(--soft); border-radius: var(--radius-sm); font-size: .86rem; }
.stride-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
/* proposition + action : l'action passe sous le texte quand la place manque (mobile) */
.sra-sug { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; }
.sra-sug > :first-child { flex: 1 1 240px; min-width: 0; }
.lv-def { font-size: .78rem; color: var(--txm); }

/* ---------- impression (rapport) : toujours en clair ---------- */
.print-only { display: none; }
@media print {
  :root { color-scheme: light; --canvas: #fff; --bg: #fff; --panel: #fff; --soft: #eef1f5; --line: #e1e6ee; --line2: #cfd6e1; --tx: #172033; --txm: #55607a; --txl: #6b7690; --ink: #172033; --on-ink: #fff; }
  #top, #side, .no-print, #toasts { display: none !important; }
  #app { display: block; height: auto; }
  #main { overflow: visible; padding: 0; border: 0; background: #fff; }
  body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; break-inside: avoid; }
  .print-only { display: block; }
  .page-break { break-before: page; }
  .tbl th { position: static; }
  .table-wrap { overflow: visible; border: 0; }
}

@media (hover: none) { .m-card:hover { box-shadow: var(--shadow); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 1100px) { #main { padding: 28px 28px 64px; } }
@media (max-width: 900px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  #top { grid-column: 1; padding: 0 12px; gap: 2px; }
  #top .menu-btn { display: inline-flex; }
  #top .hide-sm { display: none; }
  #top .crumbs .crumb-root, #top .crumbs .crumb-sep, #top .crumbs .crumb-meta { display: none; }
  #side { display: none; }
  #app.side-open #side { display: block; position: fixed; top: 0; bottom: 0; left: 0; width: 272px; z-index: var(--z-side); box-shadow: var(--shadow-pop); animation: side-in .22s var(--ease-out); }
  #main { grid-column: 1; border-left: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 22px 16px 56px; }
  h1 { font-size: 1.5rem; }
  .audit-layout { grid-template-columns: 1fr; }
  .req-list { max-height: 45vh; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { padding: 24px 20px 28px; gap: 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-aside .statement { font-size: 2.1rem; }
  .auth-aside .lede { display: none; }
  .auth-aside .pillars { grid-template-columns: 1fr; gap: 12px; margin-top: 20px; }
  .auth-aside .pillar span { display: none; }
}
@keyframes side-in { from { transform: translateX(-12px); opacity: 0; } }

/* ---------------------------------------------------------------- cartographie (carte par couches) */
.carto-tools { gap: 10px; margin-bottom: 12px; }
.carto-tools .seg button { display: inline-flex; align-items: center; gap: 4px; }
.carto-tools .seg button svg { width: 16px; height: 16px; }
.carto-perf { font-variant-numeric: tabular-nums; }
.carto-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.carto-map { position: relative; height: calc(100vh - 230px); min-height: 420px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.carto-canvas { position: absolute; inset: 0; }
.carto-flow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.carto-mini { z-index: 2; }
.carto-mini { position: absolute; right: 12px; bottom: 12px; width: 180px; height: 116px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius-sm); box-shadow: var(--shadow); cursor: crosshair; touch-action: none; }
.carto-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--txm); background: var(--bg); }
.carto-overlay[hidden] { display: none; }
.carto-overlay .empty { padding: 24px; max-width: 52ch; }
.carto-overlay .empty .small { margin: 6px 0 10px; }
.carto-side { position: sticky; top: 12px; width: 300px; max-height: calc(100vh - 230px); overflow: auto; }
.carto-side.wide { width: 400px; }
/* fiche objet dans le panneau latéral */
.sheet-tabs { gap: 0; margin: 12px 0 14px; }
.sheet-tabs .tab { padding: 7px 6px; font-size: .78rem; white-space: nowrap; flex-shrink: 0; }
.sheet-tabs .tab .count { font-size: .7rem; color: var(--txl); font-variant-numeric: tabular-nums; }
.sheet-desc { margin: 0 0 12px; white-space: pre-line; max-width: 68ch; }
.sheet-sum { margin: 0 0 12px; line-height: 1.9; }
.sheet-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.sheet-list li { display: grid; gap: 3px; min-width: 0; }
.sheet-list a { color: var(--brand-tx); overflow-wrap: anywhere; }
.sheet-list .badge { justify-self: start; }
.sheet-req .mono { color: var(--txm); margin-right: 4px; }
.sheet-levels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sheet-ov dd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; white-space: normal; }
.sheet-ov .badge svg { width: 12px; height: 12px; }
.sheet-chain { margin: 8px 0 0; }
.sheet-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sheet-hist > li { border-left: 2px solid var(--line); padding-left: 10px; }
.sheet-diff { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.sheet-diff del { color: var(--txl); }
.sheet-diff ins { color: var(--tx); font-weight: 500; text-decoration: none; }
.carto-name { margin: 2px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carto-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0 12px; }
.carto-dl dt { color: var(--txm); }
.carto-dl dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.carto-nb { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.carto-nb li { display: grid; gap: 1px; min-width: 0; }
.carto-link { border: 0; background: none; padding: 0; font: inherit; color: var(--brand-tx); cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carto-link:hover { text-decoration: underline; }
/* liste des objets pour le clavier et les lecteurs d'écran : masquée, visible dès qu'elle reçoit le focus */
.carto-a11y { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.carto-a11y:focus-within { position: static; width: auto; height: auto; clip: auto; overflow: auto; max-height: 220px; margin-top: 12px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.carto-a11y ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }
.carto-a11y button { border: 0; background: none; padding: 2px 4px; font: inherit; font-size: .82rem; color: var(--tx); cursor: pointer; text-align: left; border-radius: var(--radius-xs); }
.carto-a11y button:hover { background: var(--hover); }
.carto-legend ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; color: var(--txm); }
.carto-legend li { display: flex; align-items: flex-start; gap: 8px; }
.carto-legend li > svg, .carto-legend li > .carto-key { flex-shrink: 0; margin-top: 4px; }
.carto-dir { display: block; }
.carto-key { display: inline-block; width: 28px; height: 14px; border-radius: var(--radius-xs); background: var(--panel); }
.carto-key.crit { border: 3px double var(--tx); }
.carto-key.grp { border: 1.5px dashed var(--line2); background: var(--soft); }
@media (max-width: 1100px) {
  .carto-layout { grid-template-columns: 1fr; }
  .carto-side, .carto-side.wide { position: static; max-height: none; width: auto; }
  .carto-map { height: 62vh; }
}
@media (max-width: 600px) { .carto-mini { width: 112px; height: 72px; right: 8px; bottom: 8px; } }

/* calques de la carte : sélecteur et légende flottante (états, effectifs, isolement) */
.carto-ovsel { display: inline-flex; align-items: center; gap: 6px; }
.carto-ovsel .input { width: auto; height: 30px; padding: 2px 8px; font-size: .82rem; }
.carto-ovlegend { position: absolute; top: 12px; left: 12px; z-index: 2; max-width: 270px; max-height: calc(100% - 150px); overflow: auto; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.carto-ovlegend[hidden] { display: none; }
.carto-ovlegend .lbl { margin-bottom: 6px; }
.carto-ovlist { display: grid; gap: 2px; margin-bottom: 6px; }
.carto-ovitem { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; border: 1px solid transparent; background: none; padding: 3px 6px; font: inherit; font-size: .8rem; color: var(--tx); text-align: left; cursor: pointer; border-radius: var(--radius-xs); }
.carto-ovitem:hover { background: var(--hover); }
.carto-ovitem.on { border-color: var(--brand); background: var(--brand-bg); }
.carto-ovitem .count { color: var(--txm); font-variant-numeric: tabular-nums; }
.carto-sw { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 14px; border-radius: var(--radius-xs); border: 1.5px solid var(--line2); background: var(--panel); }
.carto-sw svg { width: 10px; height: 10px; }
.carto-sw.ov-compliant, .carto-sw.ov-cov_full { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.carto-sw.ov-partially_compliant, .carto-sw.ov-cov_low { background: var(--part-bg); border-color: var(--part); color: var(--part); }
.carto-sw.ov-cov_partial { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.carto-sw.ov-non_compliant, .carto-sw.ov-cov_none { background: var(--nc-bg); border-color: var(--nc); color: var(--nc); }
.carto-sw.ov-presumed { background: var(--info-bg); border-color: var(--info); border-style: dashed; color: var(--info); }
.carto-sw.ov-not_assessed, .carto-sw.ov-not_estimated, .carto-sw.ov-unavailable { border-style: dashed; color: var(--txl); }
.carto-sw.ov-none { color: var(--txl); }

/* inventaire de la cartographie : tableau virtualisé (hauteur de ligne fixe, voir ROW_H dans inventory.js) */
.inv-card { padding: 16px 18px; }
.inv-filters { gap: 8px; margin-bottom: 12px; }
.inv-filters .input { width: auto; max-width: 220px; height: 32px; padding: 2px 8px; font-size: .82rem; }
.inv-filters .inv-q { min-width: 220px; }
.inv-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.inv-scroll { position: relative; height: calc(100vh - 300px); min-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.inv-tbl { table-layout: fixed; width: 100%; min-width: 1080px; margin: 0; }
.inv-tbl thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.inv-tbl tbody tr:not(.inv-spacer) td { height: 38px; padding-top: 0; padding-bottom: 0; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-tbl .inv-spacer td { padding: 0; border: 0; }
.inv-tbl th:first-child { width: 24%; }
.inv-tbl .inv-name .carto-link { max-width: 100%; display: inline-block; vertical-align: middle; }
.inv-tbl .badge svg { width: 12px; height: 12px; }
.inv-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.inv-sort:hover { color: var(--tx); }
.inv-state:empty { display: none; }
.inv-filters [hidden] { display: none; }

/* heatmap des risques de la cartographie */
.hm-card { padding: 18px 20px; }
.hm-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.hm-levels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hm-grid { gap: 24px; }
.hm-block h3 { margin: 0 0 8px; }
.carto-heat .hm-y { text-align: right; max-width: 140px; }
.carto-heat .hm-x { max-width: 96px; vertical-align: top; }
.carto-heat td { padding: 0; width: 64px; height: 50px; }
.hm-cell { width: 100%; height: 100%; min-height: 46px; border: 2px solid transparent; border-radius: var(--radius-xs); color: var(--on-data); font: inherit; cursor: pointer; display: grid; place-items: center; align-content: center; gap: 0; }
.hm-cell b { font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hm-cell .hm-lv { font-size: .66rem; opacity: .85; }
.hm-cell.no-lv { color: var(--tx); }
.hm-cell.empty { cursor: default; opacity: .55; }
.hm-cell:not(.empty):hover { border-color: var(--tx); }
.hm-cell.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.carto-filter[hidden] { display: none; }
.carto-filter .chip { gap: 6px; }

/* étape 8 : vues sauvegardées, édition, instantanés, demandes d'effacement */
.carto-bar { gap: 8px; margin-bottom: 8px; }
.carto-bar .btn svg { width: 14px; height: 14px; }
.carto-snap { margin-bottom: 12px; }
.carto-snap[hidden] { display: none; }
.carto-snap .row { gap: 10px; }
.carto-snap .grow, .carto-bar .grow { flex: 1; }
.sheet-actions { gap: 6px; margin: 4px 0 2px; }
.sheet-del { margin-left: auto; color: var(--nc-tx); }
.sheet-list li { position: relative; }
.sheet-list li:has(> .sheet-rm) { padding-right: 30px; }
.sheet-rm { position: absolute; top: -2px; right: 0; width: 26px; height: 26px; color: var(--txl); }
.sheet-rm:hover { color: var(--nc-tx); }
.sheet-rm svg { width: 14px; height: 14px; }
.snap-sha { user-select: all; }
.er-ctx { overflow-wrap: anywhere; max-width: 68ch; }
/* export PDF de la carte : seule l'image filigranée est imprimée */
.carto-print { display: none; }
@media print {
  body.carto-print-mode > :not(#cartoPrint) { display: none !important; }
  body.carto-print-mode #cartoPrint { display: block; }
  #cartoPrint img { display: block; width: 100%; height: auto; }
}