/* ==========================================================================
   Sanelio Audit — feuille de style
   Charte : Bleu Sanelio #005B7F · Vert Santé #6CC48A · Bleu clair #A7D8E8
            Gris doux #E5EAF0 · Anthracite #2B2E34 · Montserrat / Lato
   ========================================================================== */

@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url("fonts/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("fonts/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url("fonts/montserrat-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-display: swap; src: url("fonts/lato-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/lato-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-display: swap; src: url("fonts/lato-latin-700-normal.woff2") format("woff2"); }

:root {
  --brand: #005B7F;
  --brand-600: #004A68;
  --brand-400: #0A7AA6;
  --brand-soft: rgba(0, 91, 127, .12);
  --sky: #A7D8E8;
  --sky-soft: #E6F4F9;
  --green: #6CC48A;
  --green-600: #3E9E61;
  --green-soft: #E7F6EC;
  --ink: #2B2E34;
  --ink-2: #4A4F58;
  --muted: #6B7280;
  --line: #E5EAF0;
  --line-2: #D5DDE6;
  --bg: #F4F7FA;
  --card: #FFFFFF;
  --ok: #3E9E61;
  --ok-2: #6CC48A;
  --warn: #D99A1E;
  --warn-2: #E07B39;
  --bad: #D14343;
  --unk: #8B5CF6;
  --na: #A0AEC0;
  --track: #E5EAF0;
  --grid: #D5DDE6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .14);
  --font-title: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --side-w: 264px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font-text); color: var(--ink); background: var(--bg); }
h1, h2, h3, h4 { font-family: var(--font-title); color: var(--ink); margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
h4 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .8em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { vertical-align: middle; }
small { font-size: .82em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
code { font-size: .88em; background: var(--sky-soft); padding: .1em .35em; border-radius: 5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.ic { width: 18px; height: 18px; flex: none; }
.ic.xs { width: 13px; height: 13px; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 24px; height: 24px; }
.ic.xl { width: 34px; height: 34px; }

/* ------------------------------------------------------------ Structure */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; z-index: 40; overflow-y: auto;
}
.is-studio .sidebar { background: linear-gradient(180deg, #0B2530 0%, #0E3444 100%); border-right: 0; }
.is-studio .sidebar .brand strong, .is-studio .sidebar .nav-item, .is-studio .me-name { color: #E6F1F5; }
.is-studio .sidebar .brand small, .is-studio .me-name small { color: #8FB3C2; }
.is-studio .nav-item:hover { background: rgba(255,255,255,.06); }
.is-studio .nav-item.is-active { background: rgba(167,216,232,.16); color: #fff; }
.is-studio .nav-item.is-active .ic { color: var(--green); }
.is-studio .side-foot { border-color: rgba(255,255,255,.08); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-family: var(--font-title); font-size: 1.02rem; font-weight: 800; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: .74rem; }
/* Logo de l'outil (comme Sanelio Avocats) : le mot « sanelio » puis un encart plein orange « Audit ». */
.brand.marque-outil { flex-direction: column; align-items: flex-start; gap: 7px; }
.brand.marque-outil .marque { display: flex; flex-direction: row; align-items: center; gap: 8px; line-height: 1; }
.brand.marque-outil .marque img { height: 24px; width: auto; display: block; }
.brand.marque-outil .produit { display: inline-block; font-weight: 600; font-size: 13px; line-height: 1; padding: 5px 8px; border-radius: 7px; color: #fff; background: #E5A33B; white-space: nowrap; }
.brand.marque-outil small { padding-left: 1px; }
.side-cab { display: flex; align-items: center; gap: 8px; margin: 0 4px 14px; padding: 9px 11px; background: var(--sky-soft); border-radius: 10px; font-size: .84rem; font-weight: 700; color: var(--brand-600); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 700; font-size: .92rem; }
.nav-item:hover { background: var(--bg); text-decoration: none; }
.nav-item.is-active { background: var(--brand-soft); color: var(--brand); }
.nav-item.small { font-size: .84rem; font-weight: 600; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.ai-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.ai-pill.on { background: var(--green-soft); color: var(--green-600); }
.ai-pill.off { background: #FFF4E5; color: #A15C07; }
.ai-pill:hover { text-decoration: none; filter: brightness(.97); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font: 700 .8rem var(--font-title); flex: none; }
.me-name { flex: 1; min-width: 0; font-weight: 700; color: var(--ink); font-size: .86rem; line-height: 1.2; overflow: hidden; }
.me-name small { display: block; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: flex-end; gap: 16px; padding: 26px 34px 6px; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { margin: 0; }
.topbar-title p { margin: 4px 0 0; color: var(--muted); }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); font-weight: 700; }
.content { padding: 18px 34px 48px; max-width: 1320px; width: 100%; }
.nav-toggle { display: none; }
.scrim { display: none; }

/* ------------------------------------------------------------- Composants */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.grid > .card + .card, .grid > * + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .ic { color: var(--brand); }
.card.flat { box-shadow: none; }
.card.tight { padding: 16px; }
.card.hero { background: linear-gradient(135deg, #005B7F 0%, #0A7AA6 60%, #2E9CB9 100%); color: #fff; border: 0; position: relative; overflow: hidden; }
.card.hero h2, .card.hero h3 { color: #fff; }
.card.hero p { color: #DCEFF6; }
.card.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(167,216,232,.18); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack-s > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: 700 .9rem var(--font-text); cursor: pointer;
  text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.green { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.btn.green:hover { background: #33874f; }
.btn.ai { background: linear-gradient(135deg, #005B7F, #3E9E61); border: 0; color: #fff; }
.btn.ai:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { color: var(--bad); border-color: #F3C9C9; }
.btn.danger:hover { background: #FDF0F0; }
.btn.sm { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 1rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.hero .btn.primary { background: #fff; color: var(--brand); border-color: #fff; }
.hero .btn.ghost { color: #fff; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.is-studio .icon-btn { color: #8FB3C2; }
.inline { display: inline; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.badge.blue { background: var(--sky-soft); color: var(--brand-600); }
.badge.green { background: var(--green-soft); color: var(--green-600); }
.badge.orange { background: #FFF1E6; color: #B4531A; }
.badge.red { background: #FDECEC; color: #B42318; }
.badge.purple { background: #F1ECFE; color: #6D28D9; }
.badge.gray { background: #EEF1F5; color: #4A5568; }
.badge.dark { background: var(--ink); color: #fff; }
.badge.f-hot { background: #FDECEC; color: #B42318; }
.badge.f-warm { background: #FFF1E6; color: #B4531A; }
.badge.f-mild { background: #FFF8E1; color: #8A6100; }
.badge.f-cool { background: #EEF1F5; color: #4A5568; }

.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 700; font-size: .92rem; }
.flash-success { background: var(--green-soft); color: #256D40; }
.flash-error { background: #FDECEC; color: #9B1C1C; }
.flash-info { background: var(--sky-soft); color: var(--brand-600); }
.flash-warning { background: #FFF4E5; color: #8A4B06; }
.demo-bandeau { padding: 8px 34px; background: var(--brand); color: #fff; font-weight: 700; font-size: .88rem; text-align: center; }
.flash span { flex: 1; }
.flash-x { border: 0; background: transparent; font-size: 1.3rem; line-height: 1; color: inherit; cursor: pointer; opacity: .6; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: .9rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--bad); }

/* ------------------------------------------------------------- Formulaires */
label, .label { display: block; font-weight: 700; font-size: .86rem; color: var(--ink-2); margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; }
input[type=file] { padding: 8px; background: #F8FAFC; cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(10,122,166,.15); }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--ink); margin: 0; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.choice { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 12px; cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--ink); background: #fff; margin: 0; }
.choice:hover { border-color: var(--brand-400); }
.choice input { accent-color: var(--brand); margin-top: 2px; width: 17px; height: 17px; flex: none; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--sky-soft); }
.choice small { display: block; font-weight: 400; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg label { margin: 0; padding: 8px 14px; font-size: .86rem; cursor: pointer; border-right: 1px solid var(--line-2); background: #fff; font-weight: 700; color: var(--ink-2); }
.seg label:last-child { border-right: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--brand-400); outline-offset: -2px; }
.seg label:has(input:checked) { background: var(--brand); color: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend { font: 700 1rem var(--font-title); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
legend .ic { color: var(--brand); }

/* ------------------------------------------------------------ Tableaux */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font: 700 .74rem var(--font-text); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FAFCFD; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table select, .table input { padding: 6px 8px; font-size: .85rem; }

/* ------------------------------------------------------------- Statistiques */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .kpi-lbl { font-size: .8rem; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .kpi-val { font: 800 1.9rem var(--font-title); color: var(--ink); line-height: 1.1; letter-spacing: -.02em; }
.kpi .kpi-sub { font-size: .8rem; color: var(--muted); }
.kpi-val.good { color: var(--ok); } .kpi-val.bad { color: var(--bad); } .kpi-val.warn { color: var(--warn-2); }
.gauge .gauge-val { font: 800 40px var(--font-title); fill: var(--ink); }
.gauge .gauge-sub { font: 700 13px var(--font-text); fill: var(--muted); }
.radar .radar-lbl { font: 700 12px var(--font-text); fill: var(--ink-2); }
.radar .radar-num { fill: var(--brand); font-weight: 800; }
.linechart .line-val { font: 800 12px var(--font-title); fill: var(--brand); }
.linechart .line-lbl { font: 11px var(--font-text); fill: var(--muted); }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar-top { display: flex; justify-content: space-between; gap: 12px; font-size: .86rem; margin-bottom: 5px; }
.hbar-lbl { font-weight: 700; color: var(--ink-2); }
.hbar-val { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-track { height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 99px; background: var(--brand); }
.hbar-fill.f-hot { background: linear-gradient(90deg, #E07B39, #D14343); }
.hbar-fill.f-warm { background: linear-gradient(90deg, #E8B04A, #E07B39); }
.hbar-fill.f-mild { background: #E8B04A; }
.hbar-fill.f-cool { background: var(--sky); }
.hbar-sub { font-size: .76rem; color: var(--muted); margin-top: 3px; }
.stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--track); }
.stk-ok { background: var(--ok); } .stk-warn { background: var(--warn); } .stk-bad { background: var(--bad); } .stk-unk { background: var(--unk); } .stk-na { background: var(--na); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.progress { height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--green)); border-radius: 99px; transition: width .35s; }
.grade { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font: 800 1rem var(--font-title); color: #fff; }
.grade-A { background: var(--ok); } .grade-B { background: var(--ok-2); } .grade-C { background: var(--warn); } .grade-D { background: var(--warn-2); } .grade-E { background: var(--bad); }
.score-pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }

/* ------------------------------------------------------------ Listes */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .li-main { flex: 1; min-width: 0; }
.list .li-title { font-weight: 700; color: var(--ink); }
.list .li-sub { font-size: .82rem; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: none; }
.dot.p1 { background: var(--bad); } .dot.p2 { background: var(--warn-2); } .dot.p3 { background: var(--sky); }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .ic { width: 40px; height: 40px; color: var(--line-2); margin-bottom: 8px; }
.empty h3 { color: var(--ink); }

/* ------------------------------------------------------------ Audit */
.audit-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; align-items: start; }
.audit-nav { position: sticky; top: 18px; }
.audit-nav .card { padding: 14px; }
.tnav { display: flex; flex-direction: column; gap: 2px; }
.tnav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 700; font-size: .86rem; }
.tnav a:hover { background: var(--bg); text-decoration: none; }
.tnav a.is-active { background: var(--brand-soft); color: var(--brand); }
.tnav .tn-title { flex: 1; min-width: 0; line-height: 1.25; }
.tnav .tn-count { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tnav .tn-done .ic { color: var(--green-600); }
.ring { width: 22px; height: 22px; flex: none; }
.ring circle { fill: none; stroke-width: 3.2; }
.ring .r-bg { stroke: var(--track); }
.ring .r-fg[stroke-dasharray^="0 "], .ring .r-fg[stroke-dasharray^="0.00 "] { stroke: transparent; }
.ring .r-fg { stroke: var(--green-600); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dasharray .3s; }
.audit-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.audit-head .theme-ic { width: 46px; height: 46px; border-radius: 12px; background: var(--sky-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.audit-head h2 { margin: 0; }
.audit-head p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.qcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 14px; border-left: 4px solid var(--line-2); transition: border-color .2s; scroll-margin-top: 20px; }
.qcard[data-state=yes] { border-left-color: var(--ok); }
.qcard[data-state=partial] { border-left-color: var(--warn); }
.qcard[data-state=no] { border-left-color: var(--bad); }
.qcard[data-state=unknown] { border-left-color: var(--unk); }
.qcard[data-state=na] { border-left-color: var(--na); }
.qcard:focus-within { box-shadow: 0 0 0 3px rgba(10,122,166,.12), var(--shadow); }
.q-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.q-code { font: 800 .74rem var(--font-title); color: var(--brand); letter-spacing: .03em; }
.q-title { font: 700 .98rem var(--font-title); margin: 0 0 4px; }
.q-question { font-size: 1.02rem; color: var(--ink); margin-bottom: 14px; }
.answers { display: flex; gap: 8px; flex-wrap: wrap; }
.ans { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px; border: 1.5px solid var(--line-2); background: #fff; font: 700 .88rem var(--font-text); color: var(--ink-2); cursor: pointer; transition: all .12s; }
.ans:hover { border-color: var(--brand-400); color: var(--ink); }
.ans kbd { font: 700 .68rem var(--font-text); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; }
.ans.is-on[data-v=yes] { background: var(--ok); border-color: var(--ok); color: #fff; }
.ans.is-on[data-v=partial] { background: var(--warn); border-color: var(--warn); color: #fff; }
.ans.is-on[data-v=no] { background: var(--bad); border-color: var(--bad); color: #fff; }
.ans.is-on[data-v=unknown] { background: var(--unk); border-color: var(--unk); color: #fff; }
.ans.is-on[data-v=na] { background: var(--na); border-color: var(--na); color: #fff; }
.ans.is-on kbd { color: #fff; border-color: rgba(255,255,255,.5); }
.q-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.q-panel { margin-top: 14px; padding: 16px 18px; border-radius: 12px; background: #F8FAFC; border: 1px solid var(--line); font-size: .92rem; }
.q-panel h4 { margin: 12px 0 4px; font-size: .86rem; color: var(--brand-600); text-transform: uppercase; letter-spacing: .03em; }
.q-panel h4:first-child { margin-top: 0; }
.q-panel ul { margin: 4px 0 8px; padding-left: 20px; }
.q-panel p { margin-bottom: 6px; }
.q-panel.ai { background: linear-gradient(135deg, #F0F8FB, #F1FAF4); border-color: #CFE7EF; }
.q-panel .refs { font-size: .82rem; color: var(--muted); }
.q-comment textarea { min-height: 64px; margin-top: 12px; font-size: .9rem; }
.evid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.evid a, .evid span.file { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--sky-soft); border-radius: 8px; font-size: .8rem; font-weight: 700; }
.freq { display: inline-flex; align-items: center; gap: 6px; }
.freq-bar { width: 46px; height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; display: inline-block; }
.freq-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #E8B04A, #D14343); }
.audit-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; }
.save-state { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state.saving::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.save-state.saved::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--brand); font-weight: 700; }

/* ------------------------------------------------------------ Résultats */
.score-hero { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 26px; align-items: center; }
.score-hero .verdict { font: 800 1.3rem var(--font-title); margin: 0 0 6px; }
.theme-scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tscore { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tscore .ic { color: var(--brand); }
.tscore .ts-main { flex: 1; min-width: 0; }
.tscore .ts-title { font-weight: 700; font-size: .86rem; }
.tscore .ts-val { font: 800 1.05rem var(--font-title); }
.risk-row { display: grid; grid-template-columns: 108px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.risk-row:last-child { border-bottom: 0; }
.ai-box { border-radius: var(--radius); border: 1px solid #CFE7EF; background: linear-gradient(135deg, #F0F8FB, #F3FBF6); padding: 20px 22px; }
.ai-box h4 { color: var(--brand-600); margin-top: 14px; }
.ai-box h4:first-child { margin-top: 0; }
.ai-box ul { padding-left: 20px; }

/* ------------------------------------------------------------ Actions */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 150px; }
.act-title { font-weight: 700; }
.act-desc { font-size: .84rem; color: var(--muted); margin-top: 3px; white-space: pre-line; }
.late { color: var(--bad); font-weight: 700; }
tr.is-done .act-title { text-decoration: line-through; color: var(--muted); }

/* ------------------------------------------------------------ Documents */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tpl { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.tpl .tpl-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--sky-soft); color: var(--brand); display: grid; place-items: center; }
.tpl h3 { margin: 4px 0 0; font-size: .95rem; }
.tpl p { font-size: .84rem; color: var(--muted); margin: 0; flex: 1; }
.tpl form { display: flex; gap: 6px; flex-wrap: wrap; }
.tpl.is-recommended { border-color: var(--warn); box-shadow: 0 0 0 3px #FFF1E6; }
.editor-bar { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: #F8FAFC; position: sticky; top: 0; z-index: 5; }
.editor-bar button { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.editor-bar button:hover { background: #fff; }
.doc-body, .editor { font-size: .95rem; line-height: 1.6; }
.editor { min-height: 480px; padding: 28px 34px; border: 1px solid var(--line); border-radius: 0 0 12px 12px; background: #fff; outline: 0; }
.editor:focus { border-color: var(--brand-400); }
.doc-body h2, .editor h2 { font-size: 1.3rem; color: var(--brand); border-bottom: 2px solid var(--sky); padding-bottom: 6px; }
.doc-body h3, .editor h3 { margin-top: 1.3em; color: var(--brand-600); }
.doc-body table, .editor table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: .88rem; }
.doc-body th, .doc-body td, .editor th, .editor td { border: 1px solid var(--line-2); padding: 7px 9px; text-align: left; vertical-align: top; }
.doc-body th, .editor th { background: #F3F7FA; }
.doc-body blockquote, .editor blockquote { margin: 12px 0; padding: 14px 18px; border: 2px solid var(--brand); border-radius: 12px; background: #F7FBFD; }
.todo { background: #FFF4D6; color: #7A5200; border-radius: 4px; padding: 0 3px; font-weight: 700; }

/* ------------------------------------------------------------ Accès */
.blank { background: var(--bg); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-wrap.single { grid-template-columns: 1fr; place-items: center; padding: 24px; }
.auth-side { background: linear-gradient(150deg, #00445F 0%, #005B7F 45%, #0A7AA6 100%); color: #fff; padding: 56px 60px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::before { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; bottom: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(108,196,138,.35), transparent 65%); }
.auth-side h1 { color: #fff; font-size: 2.2rem; font-weight: 800; line-height: 1.15; max-width: 520px; }
.auth-side p { color: #D6ECF4; font-size: 1.05rem; max-width: 500px; }
.auth-side .brand strong { color: #fff; }
.auth-side .brand small { color: var(--sky); }
.auth-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 14px; position: relative; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; color: #EAF6FA; }
.auth-points .ic { color: var(--green); margin-top: 2px; }
.auth-stat { display: flex; gap: 28px; position: relative; }
.auth-stat div { display: flex; flex-direction: column; }
.auth-stat strong { font: 800 1.7rem var(--font-title); }
.auth-stat span { font-size: .82rem; color: var(--sky); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 430px; }
.auth-card.center { text-align: center; background: #fff; padding: 40px; border-radius: 18px; box-shadow: var(--shadow); }
.auth-card h2 { font-size: 1.5rem; }
.auth-card .sub { color: var(--muted); margin-bottom: 24px; }
.auth-foot { margin-top: 18px; font-size: .9rem; color: var(--muted); text-align: center; }
.err-code { font: 800 3rem var(--font-title); color: var(--brand); margin: 12px 0 0; }

/* ------------------------------------------------------------ Onboarding */
.steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.steps span { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: .82rem; color: var(--muted); }
.steps span b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: .72rem; }
.steps span.on { color: var(--brand); border-color: var(--brand); }
.steps span.on b { background: var(--brand); color: #fff; }

/* ------------------------------------------------------------ Assistant */
.chat { display: flex; flex-direction: column; gap: 14px; min-height: 300px; }
.msg { max-width: 82%; padding: 12px 16px; border-radius: 14px; font-size: .94rem; }
.msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.bot h4 { color: var(--brand-600); margin-top: 10px; }
.msg.bot ul { padding-left: 20px; margin: 6px 0; }
.chat-form { display: flex; gap: 10px; margin-top: 16px; }
.chat-form textarea { min-height: 52px; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; }
.suggest button { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 7px 13px; font: 700 .82rem var(--font-text); color: var(--brand); cursor: pointer; }
.suggest button:hover { background: var(--sky-soft); }

/* ------------------------------------------------------------ Divers */
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: 12px; background: var(--sky-soft); color: var(--brand-600); font-size: .92rem; }
.callout.warn { background: #FFF4E5; color: #7A4306; }
.callout.green { background: var(--green-soft); color: #256D40; }
.callout .ic { flex: none; margin-top: 2px; }
.callout p:last-child { margin-bottom: 0; }
.keys { font-size: .8rem; color: var(--muted); }
.keys kbd { font: 700 .72rem var(--font-text); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; background: #fff; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--brand); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pill-tabs a { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: .84rem; color: var(--ink-2); }
.pill-tabs a.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pill-tabs a:hover { text-decoration: none; }
.text-pre { white-space: pre-wrap; font-size: .85rem; max-height: 520px; overflow: auto; background: #F8FAFC; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.provider-meta { font-size: .84rem; color: var(--muted); margin-top: 6px; }

/* ------------------------------------------------------------ Impression */
.print-page { background: #E9EEF3; }
.print-bar { position: sticky; top: 0; display: flex; align-items: center; gap: 14px; padding: 12px 22px; background: #fff; border-bottom: 1px solid var(--line); z-index: 5; font-size: .86rem; color: var(--muted); }
.print-bar span { flex: 1; }
.sheet { max-width: 900px; margin: 26px auto; background: #fff; padding: 52px 58px; box-shadow: var(--shadow); border-radius: 6px; }
.report-cover { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 20px; border-bottom: 3px solid var(--brand); margin-bottom: 26px; }
.report-cover h1 { font-size: 1.7rem; color: var(--brand); margin-bottom: 4px; }
.report-section { margin-top: 30px; page-break-inside: avoid; }
.report-section h2 { color: var(--brand); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.report-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.report-table th, .report-table td { border: 1px solid var(--line-2); padding: 6px 8px; text-align: left; vertical-align: top; }
.report-table th { background: #F3F7FA; }
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 40px; }
.sig-grid div { border-top: 1px solid var(--ink); padding-top: 6px; font-size: .84rem; }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff !important; font-size: 11pt; }
  .no-print, .print-bar { display: none !important; }
  .sheet { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  a { color: inherit; }
  .report-section { page-break-inside: auto; }
  h2, h3 { page-break-after: avoid; }
  tr { page-break-inside: avoid; }
  .todo { background: none; color: #7A5200; }
}

/* ------------------------------------------------------------ Responsive */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .audit-layout { grid-template-columns: 1fr; }
  .audit-nav { position: static; }
  .audit-nav .tnav { flex-direction: row; overflow-x: auto; gap: 6px; }
  .audit-nav .tnav a { flex: none; }
  .audit-nav .tnav .tn-title { white-space: nowrap; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 30; }
  .main { margin-left: 0; }
  .nav-toggle { display: inline-grid; }
  .topbar { padding: 16px 16px 4px; align-items: center; flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .content { padding: 14px 16px 40px; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 32px 24px; }
  .auth-side h1 { font-size: 1.6rem; }
  .score-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .qcard { padding: 16px; }
  .ans { padding: 8px 11px; }
  .ans kbd { display: none; }
  .sheet { padding: 24px 18px; margin: 0; border-radius: 0; }
  .risk-row { grid-template-columns: 1fr; }
}
@media (max-width: 860px) { .hide-sm { display: none !important; } }
.audit-layout > *, .grid > *, .main, .content { min-width: 0; }
@media (max-width: 860px) {
  .audit-nav .keys { display: none; }
  .audit-nav .tnav { padding-bottom: 4px; }
  .answers .ans { flex: 1 1 calc(50% - 8px); justify-content: center; }
  .q-tools .btn { flex: 1 1 auto; }
}

/* Œil des champs de mot de passe (demande du 03/10/2026) */
.mdp-boite { position: relative; display: block; }
.mdp-boite.mdp-ajuste { display: inline-block; max-width: 100%; }
.mdp-boite > input { padding-right: 42px !important; }
.mdp-boite > input::-ms-reveal { display: none; }
.mdp-oeil { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); width: 32px; height: 32px; padding: 0; margin: 0; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: inherit; opacity: .6; cursor: pointer; }
.mdp-oeil:hover { opacity: 1; }
.mdp-oeil:focus-visible { opacity: 1; outline: 2px solid currentColor; outline-offset: 1px; }
