/* =========================================================
   African Manpower · Maquette plateforme
   Identité reprise du site vitrine : vert brand, ocre accent,
   Space Grotesk (titres), Inter (texte), IBM Plex Mono (chiffres)
   ========================================================= */

:root {
  --brand: oklch(48.9% .117 155.6);
  --brand-strong: oklch(41% .105 155.6);
  --brand-soft: oklch(95.5% .035 155);
  --brand-ring: oklch(48.9% .117 155.6 / .25);
  --accent: oklch(62% .14 58);
  --accent-soft: oklch(95.5% .04 70);
  --ink: oklch(17% .014 160);

  --bg: oklch(98.2% .004 160);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(96.4% .005 160);
  --text: var(--ink);
  --muted: oklch(50% .012 160);
  --border: oklch(17% .014 160 / .10);
  --border-strong: oklch(17% .014 160 / .18);

  --danger: oklch(57.7% .215 27);
  --danger-soft: oklch(95.5% .03 25);
  --warn: oklch(70% .16 70);
  --warn-soft: oklch(96.5% .05 85);
  --info: oklch(55% .14 250);
  --info-soft: oklch(95.5% .03 250);
  --ok: var(--brand);
  --ok-soft: var(--brand-soft);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px oklch(17% .014 160 / .06);
  --shadow: 0 1px 2px oklch(17% .014 160 / .05), 0 8px 24px -8px oklch(17% .014 160 / .12);
  --shadow-lg: 0 24px 60px -16px oklch(17% .014 160 / .30);

  --font-title: "Space Grotesk", system-ui, sans-serif;
  --font-text: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --sidebar-w: 264px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: oklch(68% .14 155.6);
    --brand-strong: oklch(74% .13 155.6);
    --brand-soft: oklch(30% .05 155);
    --brand-ring: oklch(68% .14 155.6 / .30);
    --accent: oklch(72% .14 62);
    --accent-soft: oklch(31% .05 60);
    --bg: oklch(15.5% .01 160);
    --surface: oklch(19.5% .012 160);
    --surface-2: oklch(23.5% .012 160);
    --text: oklch(95% .005 160);
    --muted: oklch(70% .012 160);
    --border: oklch(100% 0 0 / .08);
    --border-strong: oklch(100% 0 0 / .16);
    --danger: oklch(68% .19 25);
    --danger-soft: oklch(30% .07 25);
    --warn: oklch(78% .15 75);
    --warn-soft: oklch(31% .06 75);
    --info: oklch(70% .13 250);
    --info-soft: oklch(30% .05 250);
    --shadow: 0 1px 2px oklch(0% 0 0 / .3), 0 8px 24px -8px oklch(0% 0 0 / .5);
    --shadow-lg: 0 24px 60px -16px oklch(0% 0 0 / .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: oklch(68% .14 155.6);
  --brand-strong: oklch(74% .13 155.6);
  --brand-soft: oklch(30% .05 155);
  --brand-ring: oklch(68% .14 155.6 / .30);
  --accent: oklch(72% .14 62);
  --accent-soft: oklch(31% .05 60);
  --bg: oklch(15.5% .01 160);
  --surface: oklch(19.5% .012 160);
  --surface-2: oklch(23.5% .012 160);
  --text: oklch(95% .005 160);
  --muted: oklch(70% .012 160);
  --border: oklch(100% 0 0 / .08);
  --border-strong: oklch(100% 0 0 / .16);
  --danger: oklch(68% .19 25);
  --danger-soft: oklch(30% .07 25);
  --warn: oklch(78% .15 75);
  --warn-soft: oklch(31% .06 75);
  --info: oklch(70% .13 250);
  --info-soft: oklch(30% .05 250);
  --shadow: 0 1px 2px oklch(0% 0 0 / .3), 0 8px 24px -8px oklch(0% 0 0 / .5);
  --shadow-lg: 0 24px 60px -16px oklch(0% 0 0 / .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
h1, h2, h3, h4 { font-family: var(--font-title); letter-spacing: -.02em; margin: 0; line-height: 1.2; }
h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.mono { font-family: var(--font-mono); font-feature-settings: "zero"; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 oklch(62% .14 58 / .5); } 50% { box-shadow: 0 0 0 6px oklch(62% .14 58 / 0); } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

.reveal { opacity: 0; animation: fadeUp .6s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 60ms); }
.view-enter { animation: fadeIn .35s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .reveal { opacity: 1; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid transparent; font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, border-color .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn svg.lucide { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); color: oklch(99% 0 0); box-shadow: 0 6px 16px -6px var(--brand); }
:root[data-theme="dark"] .btn-primary { color: var(--ink); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-accent { background: var(--accent); color: oklch(99% 0 0); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border-radius: 10px; border: 1px solid transparent; background: transparent; position: relative;
  transition: background .2s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); animation: pulseDot 2s infinite; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--muted);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.badge svg.lucide { width: 13px; height: 13px; }
.tone-ok { background: var(--ok-soft); color: var(--brand); }
.tone-warn { background: var(--warn-soft); color: oklch(50% .13 60); }
:root[data-theme="dark"] .tone-warn { color: var(--warn); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-accent { background: var(--accent-soft); color: oklch(50% .13 55); }
:root[data-theme="dark"] .tone-accent { color: var(--accent); }
.tone-muted { background: var(--surface-2); color: var(--muted); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface);
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.input.is-error, .select.is-error { border-color: var(--danger); box-shadow: 0 0 0 4px oklch(57.7% .215 27 / .15); }
.field-error { color: var(--danger); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.field-error svg.lucide { width: 14px; height: 14px; }
.input-icon { position: relative; }
.input-icon svg.lucide { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon .input { padding-left: 38px; }
.hint { font-size: 12.5px; color: var(--muted); }

.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  font-weight: 500; transition: all .2s var(--ease); user-select: none;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--brand); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.choice:has(input:checked)::after { content: ""; }
.choice .check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; transition: all .2s; }
.choice:has(input:checked) .check { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px var(--surface); }
.choice:has(input[type="checkbox"]) .check { border-radius: 5px; }

.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: .25s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .25s var(--ease); box-shadow: var(--shadow-sm); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(18px); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; padding: 18px 20px 0; }
.card-head h2 { display: flex; align-items: center; gap: 10px; }
.card-head h2 svg.lucide { color: var(--brand); }
.card-body { padding: 16px 20px 20px; }
.hover-lift { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-visual {
  position: relative; overflow: hidden; color: #fff; padding: 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--ink) url("../img/hero-solar.jpg") center/cover;
}
.login-visual::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, oklch(17% .014 160 / .55), oklch(30% .09 155 / .75) 55%, oklch(17% .014 160 / .92));
}
.login-visual > * { position: relative; }
.login-visual .map { position: absolute; right: -60px; bottom: 60px; width: 380px; opacity: .14; filter: brightness(0) invert(1); animation: float 8s ease-in-out infinite; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand img { width: 52px; height: 52px; background: #fff; border-radius: 14px; padding: 4px; }
.login-brand b { font-family: var(--font-title); font-size: 18px; display: block; }
.login-brand small { opacity: .8; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.login-hero h1 { font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.08; max-width: 14ch; }
.login-hero h1 em { font-style: normal; color: oklch(82% .13 70); }
.login-hero p { margin-top: 16px; max-width: 46ch; opacity: .85; font-size: 15.5px; }
.login-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.login-stats div b { font-family: var(--font-title); font-size: 26px; display: block; }
.login-stats div span { font-size: 12.5px; opacity: .75; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-form { width: 100%; max-width: 400px; display: grid; gap: 18px; }
.login-form h2 { font-size: 1.6rem; }
.otp { display: flex; gap: 8px; justify-content: space-between; }
.otp input { width: 100%; max-width: 52px; height: 56px; text-align: center; font-family: var(--font-mono); font-size: 22px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); outline: none; transition: .2s; }
.otp input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.client-link { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; border: 1px dashed var(--border-strong); transition: .2s; }
.client-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.client-link .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 4px; z-index: 40;
}
.sidebar > * { flex-shrink: 0; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.side-brand img { width: 40px; height: 40px; }
.side-brand b { font-family: var(--font-title); font-size: 15px; display: block; line-height: 1.1; }
.side-brand small { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.nav-title { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; padding: 14px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px; border-radius: 10px;
  color: var(--muted); font-weight: 500; position: relative; transition: background .2s, color .2s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-link.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-link .count { margin-left: auto; font-size: 11.5px; font-family: var(--font-mono); padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.nav-link.active .count { background: var(--brand); color: #fff; }
.nav-link.soon { opacity: .55; }
.nav-link.soon .tag { margin-left: auto; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.side-foot { margin-top: auto; padding-top: 14px; }
.side-card { padding: 14px; border-radius: 12px; background: linear-gradient(140deg, var(--brand), oklch(36% .09 160)); color: #fff; position: relative; overflow: hidden; }
.side-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: oklch(100% 0 0 / .08); }
.side-card b { font-family: var(--font-title); display: block; margin-bottom: 4px; }
.side-card p { font-size: 12.5px; opacity: .85; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px; padding: 0 24px;
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .search { flex: 1; max-width: 420px; }
.topbar .search .input { height: 38px; background: var(--surface); padding-right: 64px; text-overflow: ellipsis; }
.topbar .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--muted); }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.pill-select { height: 38px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); padding: 0 10px; font-weight: 500; outline: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: #fff; background: linear-gradient(140deg, var(--brand), var(--accent)); flex-shrink: 0; font-family: var(--font-title); }
.avatar.lg { width: 44px; height: 44px; border-radius: 12px; font-size: 15px; }
.user-chip b { font-size: 13px; display: block; line-height: 1.2; }
.user-chip small { font-size: 11.5px; color: var(--muted); }

.content { padding: 28px 24px 56px; max-width: 1360px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.page-head p { color: var(--muted); margin-top: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 10px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--brand); }
.crumbs svg.lucide { width: 14px; height: 14px; }

.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row > .input, .row > .select, .row > .field { min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }

/* ---------- KPI ---------- */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi.accent .ico { background: var(--accent-soft); color: var(--accent); }
.kpi.danger .ico { background: var(--danger-soft); color: var(--danger); }
.kpi.info .ico { background: var(--info-soft); color: var(--info); }
.kpi .val { font-family: var(--font-title); font-size: 30px; font-weight: 700; margin-top: 14px; letter-spacing: -.03em; line-height: 1; }
.kpi .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.kpi-delta svg.lucide { width: 14px; height: 14px; }
.kpi-delta small { font-size: 11.5px; font-weight: 500; opacity: .75; margin-left: 2px; }
.kpi-delta.good { background: var(--brand-soft); color: var(--brand); }
.kpi-delta.bad { background: var(--danger-soft); color: var(--danger); }
.kpi-spark { margin: 12px -4px -6px; height: 34px; }
.kpi .spark { display: block; width: 100%; height: 34px; opacity: .8; }
.kpi .val, .kpi .lbl { position: relative; z-index: 1; }

/* ---------- Task list ---------- */
.tasks { display: grid; grid-template-columns: minmax(0, 1fr); }
.task { min-width: 0; }
.task { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border); transition: .2s; }
.task:first-child { border-top: 0; }
.task:hover { padding-left: 6px; }
.task .t-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.task .t-main { flex: 1; min-width: 0; }
.task .t-main b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task .t-main span { font-size: 12.5px; color: var(--muted); }
.task .chev { color: var(--muted); transition: transform .2s; }
.task:hover .chev { transform: translateX(3px); color: var(--brand); }

/* ---------- Bars ---------- */
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 12px; font-size: 13px; }
.bar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--brand); transform-origin: left; animation: grow 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms + 200ms); }
.bar-row .v { text-align: right; font-family: var(--font-mono); font-weight: 500; }
.funnel { display: grid; gap: 0; }
.f-row { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 14px; padding: 5px 6px; margin: 0 -6px; border-radius: 10px; outline: none; transition: background .15s; }
.f-row:hover, .f-row:focus-visible { background: var(--surface-2); }
.f-row:focus-visible { box-shadow: 0 0 0 3px var(--brand-ring); }
.f-lbl { font-size: 13.5px; font-weight: 600; }
.f-track { position: relative; display: flex; align-items: center; gap: 8px; height: 22px; border-left: 1px solid var(--border-strong); }
.f-bar { display: block; height: 18px; min-width: 4px; background: var(--s1); border-radius: 0 4px 4px 0; transform-origin: left; animation: grow .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 150ms); transition: filter .15s; }
.f-row:hover .f-bar, .f-row:focus-visible .f-bar { filter: brightness(1.12); }
.f-val { font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.f-conv { display: flex; align-items: center; gap: 6px; padding: 1px 0 1px 164px; font-size: 12px; color: var(--muted); }
.f-conv svg.lucide { width: 13px; height: 13px; }
.f-conv b { color: var(--text); font-weight: 600; }
.f-conv.worst { color: oklch(50% .13 60); }
.f-conv.worst b { color: inherit; }
:root[data-theme="dark"] .f-conv.worst { color: var(--warn); }
.f-tip { position: absolute; z-index: 5; right: 8px; top: 50%; transform: translateY(-50%); padding: 8px 11px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.4; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; }
.f-tip b { font-family: var(--font-mono); font-size: 14px; }
.f-tip span { color: var(--muted); }
.f-row:hover .f-tip, .f-row:focus-visible .f-tip { opacity: 1; }
.f-insights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.f-ins { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border-radius: 12px; background: var(--brand-soft); font-size: 13px; line-height: 1.45; }
.f-ins svg.lucide { color: var(--brand); width: 17px; height: 17px; margin-top: 1px; }
.f-ins.warn { background: var(--warn-soft); }
.f-ins.warn svg.lucide { color: oklch(55% .14 60); }
@media (max-width: 720px) {
  .f-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .f-conv { padding-left: 0; }
  .f-tip { display: none; }
  .f-insights { grid-template-columns: minmax(0, 1fr); }
}

.delays { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.delay { padding: 14px; border-radius: 12px; background: var(--surface-2); }
.delay b { font-family: var(--font-title); font-size: 22px; display: block; }
.delay > span { font-size: 12px; color: var(--muted); }

.feed { display: grid; gap: 2px; }
.feed-item { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.feed-item::before { content: ""; position: absolute; left: 15px; top: 40px; bottom: -6px; width: 1px; background: var(--border); }
.feed-item:last-child::before { display: none; }
.feed-item .f-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); color: var(--muted); }
.feed-item .f-ico svg.lucide { width: 15px; height: 15px; }
.feed-item p { font-size: 13.5px; }
.feed-item time { font-size: 12px; color: var(--muted); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; }
.notice svg.lucide { margin-top: 2px; }
.notice b { display: block; margin-bottom: 2px; }

/* ---------- Table ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.toolbar .input-icon { flex: 1; min-width: 220px; }
.toolbar .select { width: auto; min-width: 140px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 16px; background: var(--surface-2); white-space: nowrap; }
td { padding: 14px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: color-mix(in oklab, var(--brand-soft) 55%, transparent); }
.cell-main b { display: block; font-weight: 600; }
.cell-main span { font-size: 12.5px; color: var(--muted); }
.ref { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty svg.lucide { width: 34px; height: 34px; margin: 0 auto 10px; opacity: .5; }
.seg-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); flex-shrink: 0; }
.seg-ico svg.lucide { width: 16px; height: 16px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 500; transition: .2s; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--brand); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
:root[data-theme="dark"] .chip.active { background: var(--text); color: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.active { background: var(--text); color: var(--bg); } }
.chip .n { font-family: var(--font-mono); font-size: 11.5px; opacity: .7; }

/* ---------- Dossier ---------- */
.dossier-hero { padding: 22px; display: grid; gap: 18px; }
.dossier-hero .top { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.dossier-hero .big-ico { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.dossier-hero .big-ico svg.lucide { width: 26px; height: 26px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; margin-top: 6px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg.lucide { width: 15px; height: 15px; }

.stepper { display: flex; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.step { flex: 1; min-width: 110px; position: relative; padding-top: 30px; font-size: 12px; text-align: center; color: var(--muted); }
.step::before { content: ""; position: absolute; top: 11px; left: 0; right: 0; height: 2px; background: var(--border-strong); }
.step:first-child::before { left: 50%; }
.step:last-child::before { right: 50%; }
.step .dot { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); display: grid; place-items: center; z-index: 1; }
.step .dot svg.lucide { width: 12px; height: 12px; stroke-width: 3; }
.step.done { color: var(--text); }
.step.done::before { background: var(--brand); }
.step.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.current { color: var(--brand); font-weight: 600; }
.step.current::before { background: linear-gradient(90deg, var(--brand) 50%, var(--border-strong) 50%); }
.step.current .dot { border-color: var(--brand); box-shadow: 0 0 0 5px var(--brand-ring); }
.step.current .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }

.next-action { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 14px; background: linear-gradient(120deg, var(--accent-soft), var(--surface)); border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent); }
.next-action .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; flex-shrink: 0; }
.next-action .grow { flex: 1; min-width: 0; }
.next-action small { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; height: 44px; padding: 0 14px; background: none; border: 0; color: var(--muted); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; transition: color .2s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); font-weight: 600; }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); animation: grow .3s var(--ease); }
.tab .n { font-family: var(--font-mono); font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); }
.tab-panel { animation: fadeUp .35s var(--ease); }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

.criteria { display: grid; gap: 12px; }
.crit { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.crit b { font-weight: 600; font-size: 13.5px; }
.crit span { font-size: 12.5px; color: var(--muted); grid-column: 1 / -1; }
.level { display: inline-flex; border-radius: 9px; padding: 3px; background: var(--surface); border: 1px solid var(--border); }
.level button { border: 0; background: none; height: 26px; padding: 0 10px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--muted); transition: .2s; }
.level button.on { background: var(--ink); color: #fff; }
:root[data-theme="dark"] .level button.on { background: var(--text); color: var(--bg); }
.decision { display: grid; gap: 8px; }
.decision label { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; transition: .2s; }
.decision label:hover { border-color: var(--border-strong); }
.decision label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.decision input { accent-color: var(--brand); width: 18px; height: 18px; }
.decision .sugg { margin-left: auto; }

.doc-list { display: grid; gap: 8px; }
.doc { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.doc .d-ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.doc .grow { flex: 1; min-width: 0; }
.doc b { font-size: 13.5px; font-weight: 600; display: block; }

/* ---------- Formulaire client (lien sécurisé) ---------- */
.cf-page { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.cf-top { position: sticky; top: 0; z-index: 20; height: 68px; padding: 0 24px; display: flex; align-items: center; gap: 14px; background: color-mix(in oklab, var(--surface) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.cf-top .brand { display: flex; align-items: center; gap: 10px; }
.cf-top .brand img { width: 40px; height: 40px; }
.cf-top .brand b { font-family: var(--font-title); font-size: 15px; display: block; line-height: 1.15; }
.cf-top .brand small { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.cf-top .secure { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.cf-top .secure svg.lucide { color: var(--brand); width: 16px; height: 16px; }
.cf-top .help { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); font-size: 13px; font-weight: 600; }
.cf-top .help:hover { border-color: var(--brand); color: var(--brand); }

.cf-hero { background: linear-gradient(135deg, oklch(46% .115 155.6), oklch(29% .075 160)); color: #fff; position: relative; overflow: hidden; }
.cf-hero::after { content: ""; position: absolute; right: 4%; top: -40px; width: 300px; height: 300px; background: url("../img/africa-map.png") center/contain no-repeat; opacity: .1; filter: brightness(0) invert(1); }
.cf-hero-in { max-width: 1120px; margin: 0 auto; padding: 36px 24px 84px; position: relative; z-index: 1; }
.cf-hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: oklch(85% .12 75); }
.cf-hero h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-top: 10px; max-width: 28ch; }
.cf-hero p { margin-top: 10px; opacity: .85; max-width: 60ch; }
.cf-hero .facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-size: 13.5px; opacity: .9; }
.cf-hero .facts span { display: inline-flex; align-items: center; gap: 7px; }
.cf-hero .facts svg.lucide { width: 16px; height: 16px; }

.cf-wrap { max-width: 1120px; width: 100%; margin: -56px auto 0; padding: 0 24px 64px; display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; position: relative; z-index: 2; }
.cf-side { position: sticky; top: 88px; display: grid; gap: 14px; }
.cf-prog { padding: 18px; }
.cf-prog .ring { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cf-prog .ring svg { width: 56px; height: 56px; transform: rotate(-90deg); flex-shrink: 0; }
.cf-prog .ring circle { transition: stroke-dashoffset .6s var(--ease); }
.cf-prog .ring b { font-family: var(--font-title); font-size: 20px; display: block; }
.cf-prog .ring span { font-size: 12.5px; color: var(--muted); }
.cf-secs { display: grid; gap: 2px; }
.cf-sec { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; border: 0; background: none; text-align: left; width: 100%; transition: background .2s; }
.cf-sec:hover { background: var(--surface-2); }
.cf-sec .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); flex-shrink: 0; border: 2px solid transparent; transition: .25s; }
.cf-sec .n svg.lucide { width: 14px; height: 14px; stroke-width: 3; }
.cf-sec b { font-size: 13.5px; font-weight: 600; display: block; line-height: 1.25; }
.cf-sec small { font-size: 12px; color: var(--muted); }
.cf-sec.active { background: var(--brand-soft); }
.cf-sec.active .n { background: var(--surface); border-color: var(--brand); color: var(--brand); }
.cf-sec.done .n { background: var(--brand); color: #fff; }
.cf-trust { display: flex; gap: 12px; padding: 14px 16px; font-size: 12.5px; color: var(--muted); }
.cf-trust svg.lucide { color: var(--brand); margin-top: 1px; }
.cf-trust b { color: var(--text); display: block; font-size: 13px; margin-bottom: 2px; }

.cf-card { overflow: hidden; }
.cf-card-head { padding: 24px 28px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 16px; align-items: center; }
.cf-card-head .ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.cf-card-head small { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.cf-card-head h2 { font-size: 1.3rem; margin-top: 2px; }
.cf-card-body { padding: 4px 28px 8px; }
.cf-card-foot { padding: 18px 28px; border-top: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cf-card-foot .grow { flex: 1; }
.cf-mobile-prog { display: none; }

.q { padding: 22px 0; border-top: 1px solid var(--border); display: grid; gap: 14px; }
.q:first-child { border-top: 0; }
.q.q-new { animation: fadeUp .4s var(--ease); }
.q-num { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-family: var(--font-mono); font-size: 12px; font-weight: 600; flex-shrink: 0; transition: .25s; }
.q.answered .q-num { background: var(--brand); color: #fff; }
.q-title { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; font-size: 15px; line-height: 1.45; }
.q-title .req { color: var(--danger); }
.q-content { display: grid; gap: 12px; padding-left: 40px; }
.q .choice { min-height: 46px; }
.q.has-error .q-num { background: var(--danger); color: #fff; }
.q-error { display: flex; gap: 6px; align-items: center; color: var(--danger); font-size: 13px; font-weight: 500; }
.q-error svg.lucide { width: 15px; height: 15px; }
.q-sub { padding: 14px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--brand); display: grid; gap: 10px; animation: fadeUp .3s var(--ease); }
.q-unit { display: flex; align-items: center; gap: 8px; max-width: 420px; }

.prefilled { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 22px 0; }
.prefilled div { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); min-width: 0; overflow-wrap: anywhere; }
.prefilled small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.prefilled b { font-size: 14px; font-weight: 600; }

.review { display: grid; gap: 14px; padding: 22px 0; }
.review-sec { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.review-sec .rh { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--surface-2); }
.review-sec .rh b { display: flex; align-items: center; gap: 8px; font-family: var(--font-title); font-weight: 600; }
.review-sec .rh b svg.lucide { color: var(--brand); width: 16px; height: 16px; }
.review-row { display: grid; grid-template-columns: 34px 1fr minmax(0, .9fr); gap: 10px; padding: 11px 16px; border-top: 1px solid var(--border); font-size: 13.5px; }
.review-row .n { font-family: var(--font-mono); color: var(--muted); font-size: 12px; padding-top: 1px; }
.review-row .a { font-weight: 600; text-align: right; }
.review-row .a.empty { color: var(--muted); font-weight: 400; font-style: italic; }
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px; border: 1.5px solid var(--border-strong); cursor: pointer; transition: .2s; }
.consent:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.consent input { accent-color: var(--brand); width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; }
.consent.has-error { border-color: var(--danger); }

.cf-success { max-width: 620px; margin: 0 auto; padding: 64px 24px; text-align: center; display: grid; gap: 16px; justify-items: center; animation: scaleIn .5s var(--ease); }
.cf-success .big { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; box-shadow: 0 0 0 12px var(--brand-soft); }
.cf-success .big svg.lucide { width: 44px; height: 44px; stroke-width: 2.4; }
.cf-success .card { width: 100%; text-align: left; }
.cf-steps-next { display: grid; gap: 12px; text-align: left; width: 100%; }
.cf-steps-next div { display: flex; gap: 12px; align-items: flex-start; }
.cf-steps-next .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-family: var(--font-mono); font-size: 12px; font-weight: 600; flex-shrink: 0; }
.cf-foot-note { text-align: center; font-size: 12.5px; color: var(--muted); padding: 0 24px 28px; }
.cf-foot-note a { color: var(--brand); font-weight: 600; }

@media (max-width: 900px) {
  .cf-wrap { grid-template-columns: minmax(0, 1fr); margin-top: -48px; padding: 0 12px 40px; }
  .cf-side { display: none; }
  .cf-mobile-prog { display: block; padding: 14px 20px; border-bottom: 1px solid var(--border); }
  .cf-mobile-prog .track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
  .cf-mobile-prog .fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .5s var(--ease); }
  .cf-top { padding: 0 14px; }
  .cf-top .secure span, .cf-top .help span { display: none; }
  .cf-hero-in { padding: 26px 18px 70px; }
  .cf-card-head, .cf-card-body, .cf-card-foot { padding-left: 18px; padding-right: 18px; }
  .q-content { padding-left: 0; }
  .prefilled { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-row { grid-template-columns: 30px 1fr; }
  .review-row .a { grid-column: 2; text-align: left; }
  .cf-card-foot .btn { flex: 1; }
  .cf-card-foot .grow { display: none; }
  .cf-card-head small { display: none; }
}

/* ---------- Visite ---------- */
.visit { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.visit-steps { position: sticky; top: 84px; padding: 10px; display: grid; gap: 2px; }
.vstep { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; border: 0; background: none; text-align: left; width: 100%; transition: .2s; }
.vstep:hover { background: var(--surface-2); }
.vstep.active { background: var(--brand-soft); }
.vstep .n { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; flex-shrink: 0; transition: .2s; }
.vstep.active .n { background: var(--brand); color: #fff; }
.vstep.done .n { background: var(--brand-soft); color: var(--brand); }
.vstep b { font-size: 13.5px; font-weight: 600; display: block; }
.vstep small { font-size: 12px; color: var(--muted); }
.check-item { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.check-item:first-child { border-top: 0; }
.check-item .ci-text b { display: block; font-weight: 600; font-size: 14px; }
.check-item .ci-text span { font-size: 12.5px; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); gap: 2px; }
.seg button { border: 0; background: none; height: 34px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; transition: .2s; }
.seg button svg.lucide { width: 14px; height: 14px; }
.seg button.on[data-v="ok"] { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.seg button.on[data-v="ko"] { background: var(--danger); color: #fff; }
.seg button.on[data-v="nv"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.safety { background: var(--warn-soft); border: 1px solid color-mix(in oklab, var(--warn) 40%, transparent); }
.safety svg.lucide { color: oklch(55% .14 60); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; position: relative; background: var(--surface-2) center/cover; border: 1px solid var(--border); animation: scaleIn .4s var(--ease); }
.photo span { position: absolute; left: 6px; right: 6px; bottom: 6px; font-size: 11px; padding: 3px 7px; border-radius: 6px; background: oklch(17% .014 160 / .75); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-add { aspect-ratio: 4 / 3; border-radius: 12px; border: 1.5px dashed var(--border-strong); background: none; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; transition: .2s; }
.photo-add:not([disabled]):hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.photo-add[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Expertise ---------- */
.origin { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.origin svg.lucide { width: 12px; height: 12px; }
.anom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.anom { overflow: hidden; display: flex; flex-direction: column; }
.anom-img { height: 120px; background: var(--surface-2) center/cover; position: relative; }
.anom-img .badge { position: absolute; top: 10px; left: 10px; }
.anom-body { padding: 14px 16px; display: grid; gap: 10px; flex: 1; }
.anom-body h3 { font-size: 15px; }
.reco { padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); font-size: 13px; display: flex; gap: 8px; }
.reco svg.lucide { color: var(--brand); width: 16px; height: 16px; margin-top: 2px; }
.reco.missing { background: var(--danger-soft); color: var(--danger); }
.reco.missing svg.lucide { color: var(--danger); }
.ctrl-row { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ctrl-row:first-child { border-top: 0; }
.ctrl-row .grow { flex: 1; min-width: 200px; }
.ctrl-row .reason { flex-basis: 100%; }
.sum-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sum-tile { padding: 14px; border-radius: 12px; background: var(--surface-2); }
.sum-tile small { font-size: 12px; color: var(--muted); display: block; }
.sum-tile b { font-family: var(--font-title); font-size: 22px; }
.sum-tile b.pending { font-size: 14px; font-family: var(--font-text); color: var(--muted); font-weight: 600; }

/* ---------- Validation ---------- */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.flow-step { padding: 16px; border-radius: 14px; border: 1.5px solid var(--border); position: relative; display: grid; gap: 10px; }
.flow-step.done { border-color: color-mix(in oklab, var(--brand) 40%, transparent); background: color-mix(in oklab, var(--brand-soft) 50%, var(--surface)); }
.flow-step.current { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 16%, transparent); }
.flow-step .role { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.checklist { display: grid; gap: 4px; }
.cl-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: 10px; transition: background .3s; }
.cl-item .c-ico { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.cl-item .c-ico svg.lucide { width: 14px; height: 14px; stroke-width: 2.6; }
.cl-item.ok .c-ico { background: var(--brand); color: #fff; }
.cl-item.ko { background: var(--danger-soft); }
.cl-item.ko .c-ico { background: var(--danger); color: #fff; }
.cl-item.warn .c-ico { background: var(--warn); color: #fff; }
.cl-item .grow { flex: 1; }
.cl-item b { font-weight: 600; font-size: 13.5px; display: block; }
.cl-item span { font-size: 12.5px; color: var(--muted); }

.paper-wrap { background: var(--surface-2); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 18px; max-height: 780px; overflow-y: auto; container-type: inline-size; }
.paper { flex-shrink: 0; width: 100%; max-width: 520px; aspect-ratio: 1 / 1.414; background: #fff; color: #17201b; box-shadow: var(--shadow); border-radius: 4px; padding: 7% 8%; position: relative; overflow: hidden; font-size: 10.5px; display: flex; flex-direction: column; }
.paper.draft::after { content: "BROUILLON"; position: absolute; top: 48%; left: 50%; transform: translate(-50%, -50%) rotate(-32deg); font-family: var(--font-title); font-weight: 700; font-size: clamp(30px, 11cqi, 56px); letter-spacing: .1em; color: oklch(57.7% .215 27 / .10); pointer-events: none; white-space: nowrap; }
.paper .p-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid oklch(48.9% .117 155.6); padding-bottom: 10px; }
.paper .p-head img { width: 54px; }
.paper .p-title { margin: auto 0; text-align: center; }
.paper .p-title h3 { font-family: var(--font-title); font-size: clamp(14px, 3.6cqi, 19px); color: oklch(41% .105 155.6); line-height: 1.25; }
.paper .p-title h4 { font-family: var(--font-title); font-size: clamp(18px, 4.6cqi, 24px); margin-top: 10px; color: oklch(55% .14 58); }
.paper .p-title p { margin-top: 8px; letter-spacing: .14em; text-transform: uppercase; font-size: 10px; color: #5b6660; }
.paper .p-table { border-collapse: collapse; width: 100%; font-size: 9.5px; }
.paper .p-table td { border: 1px solid #d9dfdb; padding: 4px 7px; line-height: 1.3; }
.paper .p-table td:first-child { background: #f2f5f3; font-weight: 600; width: 36%; }
.paper .p-foot { margin-top: 12px; display: flex; justify-content: space-between; font-size: 9px; color: #6b746f; border-top: 1px solid #d9dfdb; padding-top: 8px; }
.paper .toc-line { display: flex; gap: 6px; font-size: 11px; padding: 4px 0; }
.paper .toc-line .dots { flex: 1; border-bottom: 1px dotted #b4bbb7; transform: translateY(-4px); }
.paper .toc-line.sub { padding-left: 16px; color: #4b5550; }
.paper h5 { font-family: var(--font-title); font-size: 14px; color: oklch(41% .105 155.6); margin: 0 0 12px; }

.versions { display: grid; gap: 8px; }
.version { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.version b { font-family: var(--font-mono); }

/* ---------- SweetAlert2 : thème African Manpower ---------- */
@keyframes ampIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ampOut { to { opacity: 0; transform: scale(.97); } }
@keyframes ampToastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.amp-in { animation: ampIn .16s var(--ease) both !important; }
.amp-out { animation: ampOut .12s ease-in both !important; }
.amp-toast-in { animation: ampToastIn .18s var(--ease) both !important; }

.swal2-container.swal2-center.swal2-backdrop-show { background: oklch(17% .014 160 / .45) !important; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.swal2-popup.amp-pop { width: min(500px, calc(100vw - 32px)); padding: 22px; border-radius: 18px; background: var(--surface); color: var(--text); font-family: var(--font-text); box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.amp-pop .amp-title { display: flex !important; align-items: center; gap: 12px; padding: 0; margin: 0; text-align: left; font-family: var(--font-title); font-size: 1.2rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.amp-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.amp-ico.danger { background: var(--danger-soft); color: var(--danger); }
.amp-pop .amp-html { margin: 14px 0 0; padding: 0; text-align: left; font-size: 14px; color: var(--text); overflow: visible; }
.amp-sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.amp-body { display: grid; gap: 14px; }
.amp-pop .amp-actions { width: 100%; justify-content: flex-end; gap: 8px; margin: 20px 0 0; padding: 0; }
.amp-pop .swal2-loader { border-color: var(--brand) transparent var(--brand) transparent; }
.amp-pop .swal2-validation-message { background: var(--danger-soft); color: var(--danger); border-radius: 10px; margin: 14px 0 0; }

.swal2-container.swal2-top-end { padding: 12px !important; background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; pointer-events: none; }
body .swal2-container .swal2-popup.amp-toast { pointer-events: auto; display: block !important; width: min(380px, calc(100vw - 24px)) !important; padding: 0 !important; border-radius: 14px; background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-family: var(--font-text); overflow: hidden; }
body .swal2-popup.amp-toast .swal2-html-container { margin: 0 !important; padding: 0 !important; text-align: left; overflow: visible; color: inherit !important; }
.amp-t { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 15px; }
.amp-t-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--brand-soft); color: var(--brand); }
.amp-t-ico svg.lucide { width: 18px; height: 18px; stroke-width: 2.2; }
.amp-t-ico.warn { background: var(--accent-soft); color: var(--accent); }
.amp-t b { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--text); }
.amp-t span.msg { display: block; font-size: 13px; line-height: 1.45; color: var(--muted); margin-top: 2px; }
body .swal2-popup.amp-toast .swal2-timer-progress-bar-container { border-radius: 0; }
body .swal2-popup.amp-toast .swal2-timer-progress-bar { background: var(--brand); height: 3px; }
body .swal2-popup.amp-toast.warn .swal2-timer-progress-bar { background: var(--accent); }

/* Fenêtres centrées : résultats et confirmations */
@keyframes ampIco { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.swal2-popup.amp-center { width: min(440px, calc(100vw - 32px)); padding: 28px 24px 22px; }
.amp-center .amp-html { margin: 0; text-align: center; }
.amp-c { display: grid; justify-items: center; gap: 8px; }
.amp-c-ico { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px; background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 10px color-mix(in oklab, var(--brand-soft) 45%, transparent); animation: ampIco .25s var(--ease) .05s both; }
.amp-c-ico svg.lucide { width: 36px; height: 36px; stroke-width: 2; }
.amp-c-ico.warn { background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 10px color-mix(in oklab, var(--accent-soft) 45%, transparent); }
.amp-c-ico.danger { background: var(--danger-soft); color: var(--danger); box-shadow: 0 0 0 10px color-mix(in oklab, var(--danger-soft) 45%, transparent); }
.amp-c h2 { font-family: var(--font-title); font-size: 1.35rem; font-weight: 700; color: var(--text); }
.amp-c p { color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 38ch; }
.amp-c-rows { width: 100%; margin: 10px 0 0; padding: 2px 14px; border-radius: 12px; background: var(--surface-2); text-align: left; }
.amp-c-rows div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.amp-c-rows div:first-child { border-top: 0; }
.amp-c-rows dt { color: var(--muted); flex-shrink: 0; }
.amp-c-rows dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.amp-center .amp-actions { justify-content: center; margin-top: 22px; }
.swal2-popup.amp-center.amp-form { width: min(500px, calc(100vw - 32px)); }
.amp-form .amp-c-ico { width: 64px; height: 64px; }
.amp-form .amp-c-ico svg.lucide { width: 30px; height: 30px; }
.amp-form .amp-c-ico.info { background: var(--brand-soft); color: var(--brand); }
.amp-form .amp-c h2 { font-size: 1.25rem; }
.amp-form .amp-body { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); text-align: left; }

.amp-center .amp-actions { flex-wrap: nowrap; }
.amp-center .amp-actions .btn { flex: 1 1 0; min-width: 0; max-width: none; height: auto; min-height: 48px; padding: 10px 18px; white-space: normal; line-height: 1.25; text-align: center; }
.amp-center .amp-actions .swal2-cancel { flex: 0 1 34%; }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.input-group:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.input-group.is-error { border-color: var(--danger); box-shadow: 0 0 0 4px oklch(57.7% .215 27 / .15); }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; border-right: 1px solid var(--border); color: var(--muted); font-size: 13.5px; background: var(--surface-2); border-radius: 10px 0 0 10px; }
.input-group .input { border: 0; box-shadow: none !important; flex: 1; min-width: 0; }
@media (max-width: 560px) {
  .swal2-popup.amp-center { padding: 22px 16px 16px; }
  .amp-body .row { flex-direction: column; align-items: stretch !important; gap: 14px; }
  .amp-body .row > .field { width: 100% !important; flex: none !important; }
  .amp-center .amp-actions { flex-direction: column-reverse; }
  .amp-center .amp-actions .btn, .amp-center .amp-actions .swal2-cancel { flex: none; width: 100%; margin: 0; }
}
.amp-center .swal2-timer-progress-bar { background: var(--brand); height: 3px; }
.amp-pop .btn:focus { outline: none; }
.amp-pop .btn:focus-visible { box-shadow: 0 0 0 3px var(--brand-ring); }
.amp-pop .btn-solid-danger:focus-visible { box-shadow: 0 0 0 3px oklch(57.7% .215 27 / .3); }
.btn-solid-danger { background: var(--danger); color: #fff; box-shadow: 0 6px 16px -6px var(--danger); }
.btn-solid-danger:hover { filter: brightness(.94); }
.photo-del { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 8px; border: 0; display: grid; place-items: center; background: oklch(17% .014 160 / .65); color: #fff; opacity: 0; transition: opacity .15s, background .15s; }
.photo:hover .photo-del, .photo-del:focus-visible { opacity: 1; }
.photo-del:hover { background: var(--danger); }
.photo-del svg.lucide { width: 15px; height: 15px; }
@media (hover: none) { .photo-del { opacity: 1; } }

/* ---------- Panneau de notifications ---------- */
.bell-count { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); font-family: var(--font-mono); animation: pulseDot 2.4s infinite; }
.icon-btn.open { background: var(--surface-2); }
.notif-panel { position: fixed; top: 70px; right: 16px; z-index: 60; width: 400px; max-width: calc(100vw - 16px); max-height: min(640px, calc(100vh - 90px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; transform-origin: top right; animation: ampIn .16s var(--ease); }
.notif-head { padding: 16px 16px 0; }
.notif-head h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.notif-head .link { border: 0; background: none; color: var(--brand); font-size: 12.5px; font-weight: 600; padding: 4px 6px; border-radius: 6px; }
.notif-head .link:hover { background: var(--brand-soft); }
.notif-head .link[disabled] { color: var(--muted); cursor: default; background: none; }
.notif-tabs { display: flex; gap: 4px; margin-top: 12px; border-bottom: 1px solid var(--border); }
.notif-tabs button { position: relative; border: 0; background: none; height: 36px; padding: 0 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.notif-tabs button.on { color: var(--brand); font-weight: 600; }
.notif-tabs button.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.notif-list { overflow-y: auto; padding: 6px; }
.notif-day { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.notif { display: flex; gap: 12px; padding: 11px 10px; border-radius: 12px; cursor: pointer; position: relative; transition: background .15s; width: 100%; border: 0; background: none; text-align: left; }
.notif:hover { background: var(--surface-2); }
.notif .n-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.notif .n-ico svg.lucide { width: 17px; height: 17px; }
.notif .grow { flex: 1; min-width: 0; }
.notif b { display: block; font-size: 13.5px; font-weight: 500; }
.notif.unread b { font-weight: 700; }
.notif p { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.notif time { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: block; }
.notif.unread::after { content: ""; position: absolute; right: 12px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.notif.unread { background: color-mix(in oklab, var(--accent-soft) 45%, transparent); }
.notif.unread:hover { background: var(--accent-soft); }
.notif-empty { padding: 36px 16px; text-align: center; color: var(--muted); font-size: 13px; display: grid; justify-items: center; gap: 8px; }
.notif-empty svg.lucide { width: 30px; height: 30px; color: var(--brand); }
.notif-foot { padding: 11px 16px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.notif-foot svg.lucide { width: 15px; height: 15px; color: var(--brand); }
@media (max-width: 720px) { .notif-panel { left: 8px; right: 8px; width: auto; top: 66px; } }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.overlay { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .35s var(--ease); box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .overlay { display: block; position: fixed; inset: 0; background: oklch(17% .014 160 / .4); z-index: 35; animation: fadeIn .2s; }
  .menu-btn { display: inline-grid; }
  .visit { grid-template-columns: 1fr; }
  .visit-steps { position: static; display: flex; overflow-x: auto; padding: 8px; }
  .visit-steps .vstep { min-width: 190px; }
  .g-3 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-visual { min-height: 320px; padding: 24px; }
  .login-visual .map { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }
  .content { padding: 20px 16px 48px; }
  .topbar { padding: 0 12px; gap: 6px; }
  .topbar .search, .user-chip .who, .hide-sm { display: none; }
  .g-4, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .flow, .sum-tiles, .delays { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 96px 1fr 36px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .login-stats { gap: 20px; }
  .paper-wrap { padding: 12px; }
  .paper.draft::after { font-size: 40px; }
  .page-head .actions { width: 100%; }
  .anom-grid { grid-template-columns: 1fr; }
  td, th { padding: 12px; }
}

/* ---------- Menu utilisateur ---------- */
.um-wrap { position: relative; }
button.user-chip { cursor: pointer; font: inherit; color: inherit; text-align: left; transition: border-color .2s, background .2s; }
button.user-chip:hover, button.user-chip.open { border-color: var(--border-strong); background: var(--surface-2); }
button.user-chip > svg.lucide { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
button.user-chip.open > svg.lucide { transform: rotate(180deg); }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; z-index: 70; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); transform-origin: top right; animation: ampIn .16s var(--ease); }
.um-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.um-head b { display: block; font-size: 14px; }
.um-head span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.um-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border-radius: 9px; border: 0; background: none; font-size: 13.5px; font-weight: 500; color: var(--text); text-align: left; }
.um-item svg.lucide { width: 17px; height: 17px; color: var(--muted); }
.um-item:hover { background: var(--surface-2); }
.um-item.danger { color: var(--danger); }
.um-item.danger svg.lucide { color: var(--danger); }
.um-item.danger:hover { background: var(--danger-soft); }
.um-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------- Profil ---------- */
.avatar.xl { width: 92px; height: 92px; border-radius: 24px; font-size: 32px; border: 4px solid var(--surface); box-shadow: var(--shadow); }
.pf-hero { overflow: hidden; }
.pf-cover { height: 110px; background: linear-gradient(120deg, oklch(46% .115 155.6), oklch(32% .08 160) 60%, oklch(55% .13 60)); position: relative; }
.pf-cover::after { content: ""; position: absolute; right: 6%; top: -30px; width: 200px; height: 200px; background: url("../img/africa-map.png") center/contain no-repeat; opacity: .12; filter: brightness(0) invert(1); }
.pf-main { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; padding: 16px 24px 22px; position: relative; }
.pf-main .avatar.xl { margin-top: -62px; }
.pf-id { flex: 1; min-width: 240px; padding-bottom: 2px; }
.pf-id h1 { font-size: 1.6rem; }
.rights { display: grid; gap: 4px; }
.right { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; color: var(--muted); }
.right.ok { color: var(--text); background: color-mix(in oklab, var(--brand-soft) 55%, transparent); }
.r-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex-shrink: 0; }
.r-ico svg.lucide { width: 13px; height: 13px; stroke-width: 3; }
.right.ok .r-ico { background: var(--brand); color: #fff; }
table.prefs td { padding: 12px 16px; }
table.prefs td svg.lucide { color: var(--brand); width: 17px; height: 17px; }
.pw-meter { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--danger); transition: width .3s var(--ease), background .3s; }
.pw-meter span[data-level="2"] { background: var(--accent); }
.pw-meter span[data-level="3"] { background: var(--brand); }
.pw-rules { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.pw-rules span { display: inline-flex; align-items: center; gap: 5px; }
.pw-rules svg.lucide { width: 14px; height: 14px; }
.pw-rules span.on { color: var(--brand); font-weight: 600; }

/* ---------- Utilisateurs ---------- */
.kpi.mini { padding: 14px 16px; }
.kpi.mini .row { gap: 14px; }
.kpi.mini .val { margin-top: 0; font-size: 24px; }
.kpi.mini .lbl { margin-top: 2px; }
tr.is-off td { opacity: .55; }
.choice.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.choice-group.is-error { padding: 6px; border-radius: 12px; outline: 1.5px solid var(--danger); }
@media (max-width: 720px) {
  .pf-main { padding: 0 16px 18px; }
  .avatar.xl { width: 76px; height: 76px; font-size: 26px; }
  .pf-main .avatar.xl { margin-top: -52px; }
  .user-menu { position: fixed; left: 8px; right: 8px; top: 66px; width: auto; }
}

/* ---------- Modifier mon profil ---------- */
.ep-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ep-sec { overflow: hidden; }
.ep-head { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.ep-head h2 { font-size: 1.05rem; }
.ep-head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ep-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.ep-body { padding: 18px 20px 20px; display: grid; gap: 16px; }
.ep-photo { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.ep-photo .avatar.xl { border-color: var(--surface-2); }
.avatar.has-photo { background: var(--surface-2) center/cover no-repeat; color: transparent; }
.input-group.is-locked { background: var(--surface-2); }
.input-group.is-locked .addon svg.lucide { width: 15px; height: 15px; }
.input-group.is-locked .input { background: transparent; color: var(--muted); cursor: not-allowed; }
.seg-theme { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-theme .choice { flex: 1; justify-content: center; min-width: 96px; }
.seg-theme .choice svg.lucide { width: 16px; height: 16px; }
.sig-pad { position: relative; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: #fff; overflow: hidden; touch-action: none; }
.sig-pad canvas { display: block; width: 100%; height: auto; aspect-ratio: 560 / 180; cursor: crosshair; }
.sig-pad::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 34px; height: 1px; background: #d9dfdb; pointer-events: none; }
.sig-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: #8a948f; font-size: 13px; pointer-events: none; transition: opacity .2s; }
.sig-hint svg.lucide { width: 16px; height: 16px; }
.sig-pad.has-sig .sig-hint { opacity: 0; }
.sig-pad:focus-within, .sig-pad:hover { border-color: var(--brand); }
.sig-view { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 8px; }
.sig-view img { width: 100%; max-height: 110px; object-fit: contain; }
.ep-bar { position: fixed; left: calc(var(--sidebar-w) + 24px); right: 24px; bottom: 16px; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); transform: translateY(140%); opacity: 0; transition: transform .25s var(--ease), opacity .2s; pointer-events: none; }
.ep-bar.show { transform: none; opacity: 1; pointer-events: auto; }
.ep-bar svg.lucide { color: oklch(80% .14 70); }
.ep-bar .btn-ghost { color: #fff; }
.ep-bar .btn-ghost:hover { background: oklch(100% 0 0 / .1); }
:root[data-theme="dark"] .ep-bar { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); }
:root[data-theme="dark"] .ep-bar .btn-ghost { color: var(--text); }
@media (max-width: 1100px) { .ep-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1024px) { .ep-bar { left: 12px; right: 12px; } }
@media (max-width: 720px) {
  .ep-grid .row { flex-direction: column; align-items: stretch !important; }
  .ep-grid .row > .field { width: 100% !important; }
  .ep-bar { padding: 10px; gap: 8px; }
  .ep-bar .actions { width: 100%; flex-wrap: nowrap; } .ep-bar .actions .btn { flex: 1; }
}

/* ---------- Courbe d'évolution (couleurs validées avec validate_palette.js, clair et sombre) ---------- */
:root { --s1: #087342; --s2: #1f74bf; --s3: #c8800d; }
:root[data-theme="dark"] { --s1: #157d4a; --s2: #3e87ce; --s3: #cb8315; }
.trend-switch button { height: 30px; font-size: 12px; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-bottom: 12px; }
.tl-item { display: flex; gap: 10px; align-items: flex-start; }
.tl-key { width: 16px; height: 3px; border-radius: 2px; margin-top: 8px; flex-shrink: 0; }
.tl-key.s1, .tt-key.s1 { background: var(--s1); }
.tl-key.s2, .tt-key.s2 { background: var(--s2); }
.tl-key.s3, .tt-key.s3 { background: var(--s3); }
.tl-name { display: block; font-size: 12.5px; color: var(--muted); }
.tl-val { font-family: var(--font-title); font-size: 20px; font-weight: 700; margin-right: 6px; }
.tl-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.tl-delta svg.lucide { width: 13px; height: 13px; color: var(--brand); }
.trend-chart { position: relative; width: 100%; border-radius: 10px; outline: none; }
.trend-chart:focus-visible { box-shadow: 0 0 0 3px var(--brand-ring); }
.trend-chart { min-width: 0; }
.trend-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.stack > .card { min-width: 0; }
.tr-grid { stroke: var(--border); stroke-width: 1; }
.tr-tick { fill: var(--muted); font-size: 11.5px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tr-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: trDraw 1s var(--ease) .2s forwards; }
.tr-line.s1 { stroke: var(--s1); }
.tr-line.s2 { stroke: var(--s2); animation-delay: .32s; }
.tr-line.s3 { stroke: var(--s3); animation-delay: .44s; }
@keyframes trDraw { to { stroke-dashoffset: 0; } }
.tr-dot, .tr-hover { stroke: var(--surface); stroke-width: 2; }
.tr-dot.s1, .tr-hover.s1 { fill: var(--s1); }
.tr-dot.s2, .tr-hover.s2 { fill: var(--s2); }
.tr-dot.s3, .tr-hover.s3 { fill: var(--s3); }
.tr-dot { opacity: 0; animation: fadeIn .3s 1.1s forwards; }
.tr-hover { opacity: 0; transition: opacity .1s; pointer-events: none; }
.tr-hover.on { opacity: 1; }
.tr-end { fill: var(--muted); font-size: 12px; }
.tr-end-v { fill: var(--text); font-weight: 700; font-family: var(--font-mono); }
.tr-cross { stroke: var(--border-strong); stroke-width: 1; opacity: 0; pointer-events: none; }
.tr-cross.on { opacity: 1; }
.tr-hit { fill: transparent; cursor: crosshair; }
.tr-tip { position: absolute; z-index: 5; min-width: 170px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 12.5px; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.tr-tip.on { opacity: 1; transform: none; }
.tt-head { font-weight: 600; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.tt-row { display: grid; grid-template-columns: 14px 28px 1fr; align-items: center; gap: 6px; padding: 2px 0; }
.tt-key { width: 12px; height: 3px; border-radius: 2px; }
.tt-row b { font-family: var(--font-mono); font-size: 13px; text-align: right; }
.tt-row span:last-child { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .tr-line { stroke-dashoffset: 0; animation: none; } .tr-dot { opacity: 1; animation: none; } }

/* ---------- Accès refusé ---------- */
.denied { max-width: 560px; margin: 40px auto; padding: 36px 28px; text-align: center; display: grid; justify-items: center; gap: 14px; }
.denied .amp-c-ico { margin-bottom: 4px; }
.denied p { color: var(--muted); max-width: 44ch; }
.denied .hint { display: flex; gap: 6px; align-items: flex-start; text-align: left; max-width: 46ch; }
.denied .hint svg.lucide { flex-shrink: 0; margin-top: 1px; }

/* ---------- Navigation : section repliable et zone démo ---------- */
.nav-soon summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px; user-select: none; }
.nav-soon summary::-webkit-details-marker { display: none; }
.nav-soon summary svg.lucide { width: 13px; height: 13px; transition: transform .2s; }
.nav-soon[open] summary svg.lucide { transform: rotate(90deg); }
.nav-soon summary:hover { color: var(--text); }
.side-demo { padding: 12px; border-radius: 12px; border: 1px dashed var(--border-strong); background: var(--surface-2); }
.side-demo b { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.side-demo b svg.lucide { width: 15px; height: 15px; color: var(--accent); }
.side-demo p { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.demo-link { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--brand); }
.demo-link svg.lucide { width: 14px; height: 14px; }
.demo-link:hover { text-decoration: underline; }
.lnk { color: var(--brand); font-weight: 600; }
.lnk:hover { text-decoration: underline; }

/* ---------- Missions ---------- */
.t-qualification { --tc: var(--muted); } .t-preaudit { --tc: var(--s2); } .t-audit { --tc: var(--s3); }
.t-expertise { --tc: var(--s1); } .t-controle { --tc: var(--info); } .t-maintenance { --tc: var(--accent); }
.big-ico[class*="t-bg-"] { background: var(--surface-2); }
.t-bg-preaudit { color: var(--s2) !important; } .t-bg-audit { color: var(--s3) !important; } .t-bg-expertise { color: var(--s1) !important; } .t-bg-controle { color: var(--info) !important; }
.week-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.week-nav b { font-family: var(--font-title); font-size: 15px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
.w-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 220px; display: flex; flex-direction: column; min-width: 0; }
.w-col.weekend { background: var(--surface-2); }
.w-col.today { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.w-head { display: flex; align-items: baseline; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.w-head span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.w-head b { font-family: var(--font-title); font-size: 18px; }
.w-col.today .w-head span, .w-col.today .w-head b { color: var(--brand); }
.w-body { padding: 8px; display: grid; gap: 8px; }
.w-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 12px 0; }
.m-card { display: grid; gap: 4px; padding: 10px 10px 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--tc, var(--brand)); transition: transform .15s var(--ease), box-shadow .15s; min-width: 0; }
.m-card:hover, .m-card:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow); outline: none; }
.m-card .badge { height: 20px; font-size: 11px; padding: 0 7px; }
.m-time { font-size: 12px; font-weight: 600; color: var(--muted); }
.m-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; line-height: 1.25; }
.m-title svg.lucide { width: 14px; height: 14px; color: var(--tc, var(--brand)); flex-shrink: 0; }
.m-client { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 2px; min-width: 0; }
.m-meta .avatar { width: 22px; height: 22px; border-radius: 7px; font-size: 9.5px; }
.m-meta > span:not(.avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-none { display: inline-flex; align-items: center; gap: 5px; color: var(--danger); font-weight: 600; }
.m-none svg.lucide, .m-warn svg.lucide, .m-rep svg.lucide { width: 14px; height: 14px; }
.m-warn { color: var(--warn); display: inline-flex; } .m-rep { color: var(--accent); display: inline-flex; margin-left: auto; }
.m-card.realisee { opacity: .65; } .m-card.incomplete { opacity: .8; }
.m-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; padding: 12px 16px 16px; }
.today-card .m-list { padding: 14px 20px 20px; }
.m-day-head { padding: 14px 16px 0; font-weight: 600; text-transform: capitalize; font-family: var(--font-title); }
.m-day-head.today { color: var(--brand); }
.legend-inline { display: flex; gap: 12px; flex-wrap: wrap; margin-left: auto; font-size: 12px; color: var(--muted); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline .lg { width: 10px; height: 10px; border-radius: 3px; background: var(--tc); }
.assign-list { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; padding: 2px; }
.assign { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; transition: .15s; }
.assign:hover { border-color: var(--border-strong); }
.assign:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.assign input { accent-color: var(--brand); width: 18px; height: 18px; }
.assign .grow { flex: 1; min-width: 0; }
.assign b { display: block; font-size: 13.5px; }
.assign-list.is-error { outline: 1.5px solid var(--danger); border-radius: 12px; }

/* ---------- Clients et sites ---------- */
.client-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 16px; align-items: start; }
.site-card { padding: 16px; display: grid; gap: 12px; }
.site-card .seg-ico { width: 38px; height: 38px; }
.site-sec { display: grid; gap: 6px; }
.site-dos { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; transition: background .15s; }
.site-dos:hover { background: var(--brand-soft); }
.site-dos .grow { flex: 1; min-width: 0; }
.site-dos svg.lucide { width: 15px; height: 15px; color: var(--muted); }
.site-hist { display: grid; gap: 4px; }
.site-hist div { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--border); }
.site-hist div:first-child { border-top: 0; }

/* ---------- Rapports à valider ---------- */
.v-steps { display: flex; align-items: center; margin-bottom: 4px; }
.v-steps i { width: 18px; height: 2px; background: var(--border-strong); }
.v-step { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; font-family: var(--font-mono); background: var(--surface-2); color: var(--muted); border: 2px solid var(--border-strong); }
.v-step svg.lucide { width: 12px; height: 12px; stroke-width: 3; }
.v-step.done { background: var(--brand); border-color: var(--brand); color: #fff; }
.v-step.cur { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

@media (max-width: 1200px) { .week { grid-template-columns: repeat(7, minmax(150px, 1fr)); overflow-x: auto; padding-bottom: 6px; } .client-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .week { grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .w-col { min-height: 0; }
  .w-col.weekend:not(.today) .w-body:has(.w-empty) { display: none; }
  .legend-inline { margin-left: 0; }
  .m-list { grid-template-columns: minmax(0, 1fr); }
  .today-card .m-list { padding: 12px 16px 16px; }
  .grid.g-4:has(.kpi.mini) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi.mini .row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---------- Espace client ---------- */
.portal-wrap { max-width: 1120px; width: 100%; margin: -56px auto 0; padding: 0 24px 56px; display: grid; gap: 16px; position: relative; z-index: 2; }
.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cp-sec { padding: 20px; display: grid; gap: 14px; align-content: start; }
.cp-sec h2 { display: flex; align-items: center; gap: 10px; }
.cp-sec h2 svg.lucide { color: var(--brand); }
.cp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cp-steps li { position: relative; display: grid; justify-items: center; text-align: center; gap: 4px; padding: 0 6px; }
.cp-steps li::before { content: ""; position: absolute; top: 18px; left: -50%; right: 50%; height: 2px; background: var(--border-strong); z-index: 0; }
.cp-steps li:first-child::before { display: none; }
.cp-steps li.done::before, .cp-steps li.cur::before { background: var(--brand); }
.cp-steps .dot { position: relative; z-index: 1; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); border: 2px solid var(--border-strong); }
.cp-steps .dot svg.lucide { width: 17px; height: 17px; }
.cp-steps li.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.cp-steps li.cur .dot { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 5px color-mix(in oklab, var(--accent) 16%, transparent); }
.cp-steps b { font-size: 13px; }
.cp-steps small { font-size: 12px; color: var(--muted); }
.doc .d-ico.ok { background: var(--brand-soft); color: var(--brand); }
.doc.is-wait { background: var(--surface-2); }
.drop { display: grid; justify-items: center; gap: 4px; padding: 22px 16px; border-radius: 14px; border: 1.5px dashed var(--border-strong); background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop svg.lucide { width: 26px; height: 26px; color: var(--brand); }
.drop b { font-size: 14px; }
.drop span { font-size: 12.5px; color: var(--muted); }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.cp-hyp { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--accent); font-size: 14px; }
@media (max-width: 900px) {
  .portal-wrap { margin-top: -48px; padding: 0 12px 40px; }
  .portal-grid { grid-template-columns: minmax(0, 1fr); }
  .portal .doc { flex-wrap: wrap; }
  .portal .doc .grow { flex: 1 1 calc(100% - 52px); }
  .portal .doc .btn, .portal .doc > .badge { margin-left: 48px; }
  .cp-steps { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cp-steps li { grid-template-columns: 38px 1fr; justify-items: start; text-align: left; column-gap: 12px; padding: 0; }
  .cp-steps li .dot { grid-row: span 2; }
  .cp-steps li::before { display: none; }
}

/* ---------- Compte client : connexion ---------- */
.cl-page { background: radial-gradient(900px 420px at 50% -10%, var(--brand-soft), transparent 70%), var(--bg); }
.cl-main { flex: 1; display: grid; place-items: center; align-content: center; gap: 14px; padding: 40px 16px; }
.cl-card { width: 100%; max-width: 440px; padding: 32px 28px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.cl-card h1 { font-size: 1.5rem; }
.cl-card p { max-width: 36ch; }
.cl-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.cl-note svg.lucide { width: 15px; height: 15px; color: var(--brand); }

/* ---------- Compte client : espace connecté ---------- */
.ca-org { display: inline-flex; align-items: center; gap: 8px; margin-left: 18px; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 13px; }
.ca-org svg.lucide { width: 15px; height: 15px; }
.ca-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ca-user b { display: block; font-size: 13px; line-height: 1.2; }
.ca-user small { font-size: 11.5px; color: var(--muted); }
.ca-hero .cf-hero-in { padding: 28px 24px 72px; }
.ca-hero h1 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.ca-wrap { max-width: 1120px; width: 100%; margin: -52px auto 0; padding: 0 24px 56px; position: relative; z-index: 2; }
.ca-tabs { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 10px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
@media (max-width: 900px) {
  .ca-org { display: none; }
  .ca-wrap { padding: 0 12px 40px; margin-top: -48px; }
  .ca-hero .cf-hero-in { padding: 22px 18px 64px; }
}
.cl-page .cf-top .help { margin-left: auto; }

/* ---------- Estimation de mise en conformité ---------- */
.est-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.est-table td { vertical-align: top; }
.est-table tbody + tbody { border-top: 2px solid var(--border); }
.est-group td { background: var(--surface-2); padding: 10px 16px; font-size: 13px; }
.est-group td .badge { margin-right: 6px; }
.est-group svg.lucide { width: 15px; height: 15px; color: var(--brand); vertical-align: -2px; }
.est-in { height: 34px; padding: 0 8px; font-size: 13px; text-align: right; }
.est-in[data-f="qte"] { width: 64px; }
.est-in[data-f="pu"] { width: 112px; }
.est-table th, .est-table td { padding-left: 10px; padding-right: 10px; }
.est-table td:first-child { min-width: 220px; }
.est-table th { white-space: nowrap; }
.est-missing { color: var(--danger); font-weight: 600; font-size: 13px; background: var(--danger-soft); }
.est-missing svg.lucide { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.est-table .low { color: var(--danger); font-weight: 600; }
.est-tot { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0; font-size: 13.5px; }
.est-tot dt { color: var(--muted); }
.est-tot dd { margin: 0; text-align: right; font-weight: 600; }
.est-tot .big { font-size: 16px; color: var(--text); font-weight: 700; padding-top: 8px; border-top: 1px solid var(--border); }
.est-tot .int { color: var(--muted); font-style: italic; }
@media (max-width: 1500px) { .est-grid { grid-template-columns: minmax(0, 1fr); } .est-grid > .stack { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); display: grid; } }

/* ---------- Rapport complet ---------- */
.page-jump { margin-bottom: 12px; }
.page-jump .chip { height: 28px; font-size: 12px; }
.paper.p-auto { aspect-ratio: auto; min-height: 0; font-size: 10px; gap: 6px; }
.paper.p-auto p, .paper.p-auto li { line-height: 1.5; margin: 0 0 6px; }
.paper.p-auto ul { margin: 0 0 6px; padding-left: 16px; }
.paper h6 { font-family: var(--font-title); font-size: 11.5px; color: #17201b; margin: 8px 0 6px; }
.paper .p-grid { width: 100%; border-collapse: collapse; font-size: 9.5px; margin-bottom: 6px; }
.paper .p-grid th { background: oklch(48.9% .117 155.6); color: #fff; text-transform: none; letter-spacing: 0; font-size: 9.5px; padding: 5px 7px; text-align: left; }
.paper .p-grid td { border: 1px solid #d9dfdb; padding: 4px 7px; line-height: 1.35; vertical-align: top; }
.paper .p-grid td.num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.paper .p-grid .p-warn { color: #b3261e; }
.paper .p-sum td { background: #f2f5f3; font-weight: 600; }
.paper .p-sum.big td { background: #e3efe8; font-size: 10.5px; }
.paper .p-note { font-size: 9.5px; color: #4b5550; background: #f6f8f7; border-left: 3px solid oklch(62% .14 58); padding: 6px 8px; }
.paper .p-sigs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.paper .p-sig { border: 1px solid #d9dfdb; border-radius: 4px; padding: 8px; display: grid; gap: 2px; font-size: 9.5px; }
.paper .p-sig .r { text-transform: uppercase; letter-spacing: .08em; color: #6b746f; font-size: 8.5px; }
.paper .p-sig .s { height: 44px; display: grid; place-items: center; border-top: 1px dashed #d9dfdb; margin-top: 4px; color: #6b746f; }
.paper .p-sig .s img { max-height: 42px; max-width: 100%; }
.paper.p-auto .p-foot { margin-top: auto; }

/* ---------- Impression : seules les pages du rapport sortent ---------- */
@media print {
  body.printing-report > *:not(#app) { display: none !important; }
  body.printing-report #app .sidebar, body.printing-report #app .topbar, body.printing-report #app .crumbs, body.printing-report #app .page-head,
  body.printing-report #app .flow, body.printing-report #app .grid > .stack, body.printing-report #app .card-head, body.printing-report #app .page-jump { display: none !important; }
  body.printing-report, body.printing-report #app, body.printing-report .main, body.printing-report .content { background: #fff !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  body.printing-report .shell, body.printing-report .grid.g-main { display: block !important; }
  body.printing-report .card { border: 0 !important; box-shadow: none !important; background: none !important; }
  body.printing-report .card-body { padding: 0 !important; }
  body.printing-report .paper-wrap { max-height: none !important; overflow: visible !important; padding: 0 !important; background: none !important; display: block !important; }
  body.printing-report .paper { max-width: none !important; width: 100% !important; box-shadow: none !important; border-radius: 0 !important; break-after: page; page-break-after: always; margin: 0 !important; }
  body.printing-report .paper:last-child { break-after: auto; page-break-after: auto; }
  body.printing-report .reveal { opacity: 1 !important; animation: none !important; }
  @page { size: A4; margin: 12mm; }
}
.est-table .int-cell { white-space: nowrap; color: var(--muted); }
.est-table .int-cell span { display: block; font-size: 11.5px; }

/* ---------- Compte client : barre latérale ---------- */
.ca-orgcard { display: flex; gap: 10px; align-items: center; margin: 0 2px 6px; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); }
.ca-orgcard .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--brand); flex-shrink: 0; }
.ca-orgcard b { display: block; font-size: 13.5px; line-height: 1.2; }
.ca-orgcard small { font-size: 11.5px; color: var(--muted); }
.ca-advisor { display: grid; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.ca-advisor > small { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ca-advisor b { display: block; font-size: 13.5px; }
.ca-advisor .row span:not(.avatar) { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.ca-advisor .btn { flex: 1; min-width: 0; padding: 0 8px; box-shadow: none; }
.ca-crumb { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.ca-crumb svg.lucide { color: var(--brand); }

/* ---------- V2 · Scénarios ---------- */
.sc-fact { padding: 14px 16px; display: grid; gap: 4px; }
.sc-fact small { font-size: 12px; color: var(--muted); }
.sc-fact b { font-size: 14.5px; }
.sc-fact .origin { justify-self: start; }
.sc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sc-card { text-align: left; padding: 16px; display: grid; gap: 8px; align-content: start; cursor: pointer; font: inherit; color: inherit; border: 1.5px solid var(--border); transition: border-color .15s, box-shadow .15s, transform .15s; }
.sc-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.sc-card.sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.sc-card.recommande { background: linear-gradient(160deg, var(--brand-soft), var(--surface) 60%); }
.sc-card.ecarte { background: var(--surface-2); }
.sc-card.ecarte b { color: var(--muted); }
.sc-card.incomplet { border-color: var(--warn); }
.sc-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); }
.sc-card b { font-family: var(--font-title); font-size: 15px; }
.sc-kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 6px 0 0; font-size: 12.5px; }
.sc-kv dt { color: var(--muted); }
.sc-kv dd { margin: 0; font-weight: 600; font-family: var(--font-mono); text-align: right; }
.sc-rec td { background: color-mix(in oklab, var(--brand-soft) 55%, transparent); }
.sc-rule { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; }

/* ---------- V3 · Projets ---------- */
.pr-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pr-steps li { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pr-steps li:first-child { border-top: 0; }
.pr-steps .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 2px solid var(--border-strong); flex-shrink: 0; }
.pr-steps .dot svg.lucide { width: 15px; height: 15px; stroke-width: 3; }
.pr-steps li.fait .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.pr-steps li.encours .dot { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pr-steps .grow { flex: 1; min-width: 160px; }
.pr-steps b { display: block; }

/* ---------- V3 · Application terrain ---------- */
.terrain-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
.phone { width: 360px; max-width: 100%; border-radius: 40px; padding: 12px; background: var(--ink); box-shadow: var(--shadow-lg); position: sticky; top: 84px; }
:root[data-theme="dark"] .phone { background: #000; }
.phone-notch { width: 110px; height: 24px; border-radius: 0 0 14px 14px; background: inherit; margin: -12px auto 0; position: relative; z-index: 2; }
.phone-screen { border-radius: 30px; overflow: hidden; background: var(--bg); height: 680px; display: flex; flex-direction: column; margin-top: -12px; }
.mob-status { display: flex; justify-content: space-between; align-items: center; padding: 22px 16px 8px; font-size: 12px; font-weight: 600; }
.mob-status span { display: inline-flex; align-items: center; gap: 6px; }
.mob-status svg.lucide { width: 15px; height: 15px; }
.mob-status.on > span:first-child { color: var(--brand); }
.mob-status.off { background: var(--warn-soft); }
.mob-status.off > span:first-child { color: oklch(50% .13 60); }
.mob-pill { padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; }
.mob-top { display: flex; gap: 10px; align-items: center; padding: 10px 16px 12px; border-bottom: 1px solid var(--border); }
.mob-top b { display: block; font-size: 14px; }
.mob-top small { font-size: 12px; color: var(--muted); }
.mob-body { flex: 1; overflow-y: auto; padding: 14px; display: grid; gap: 10px; align-content: start; }
.mob-h { font-family: var(--font-title); font-size: 15px; margin-top: 4px; }
.mob-card { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-align: left; font: inherit; color: inherit; }
.mob-card span { font-size: 12.5px; }
.mob-mission { cursor: pointer; }
.mob-mission:hover { border-color: var(--brand); }
.mob-off { display: inline-flex; align-items: center; gap: 5px; color: var(--brand); font-size: 11.5px !important; margin-top: 4px; }
.mob-off svg.lucide { width: 13px; height: 13px; }
.mob-back { justify-self: start; display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 13px; padding: 0; }
.mob-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mob-actions button { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text); }
.mob-actions button svg.lucide { width: 22px; height: 22px; color: var(--brand); }
.mob-actions button:hover { border-color: var(--brand); }
.mob-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.mob-item > span { color: var(--brand); display: grid; }
.mob-item b { display: block; font-size: 12.5px; }
.mob-item small { font-size: 11.5px; color: var(--muted); }
.mob-item.attente { border-color: var(--accent); background: var(--accent-soft); }
.mob-item.conflit { border-color: var(--danger); background: var(--danger-soft); }
.mob-empty { font-size: 12.5px; color: var(--muted); }
.mob-conflict { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); }
.mob-conflict b { display: block; font-size: 13px; }
.mob-conflict small { font-size: 11.5px; }
.mob-conflict button { margin-left: auto; border: 0; border-radius: 8px; padding: 6px 10px; background: var(--danger); color: #fff; font-weight: 600; font-size: 12px; }
.mob-sync { margin: 0 14px 16px; height: 46px; border: 0; border-radius: 14px; background: var(--brand); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
@media (max-width: 1100px) { .sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .terrain-grid { grid-template-columns: minmax(0, 1fr); } .phone { position: static; margin: 0 auto; } }
@media (max-width: 720px) { .sc-grid { grid-template-columns: minmax(0, 1fr); } .phone-screen { height: 600px; } }

/* ---------- V2 · Pilotage ---------- */
.filters-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filters-row .field { min-width: 200px; }
.filters-row .hint { flex: 1; min-width: 240px; padding-bottom: 10px; }
.pi-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.pi-bar span { display: block; height: 10px; border-radius: 0 4px 4px 0; background: var(--s1); }

/* ---------- V2 · Éditeur de questionnaires ---------- */
.qe-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.qe-card { padding: 16px; display: grid; gap: 12px; }
.qe-card.ro { background: var(--surface-2); }
.qe-preview { position: sticky; top: 84px; }
.qe-preview .card-body { display: grid; gap: 0; max-height: 640px; overflow-y: auto; }
@media (max-width: 1100px) { .qe-grid { grid-template-columns: minmax(0, 1fr); } .qe-preview { position: static; } }

/* ---------- Tableau de bord par rôle : agenda, avancement, états ---------- */
/* Un tableau large défile dans son bloc au lieu d'élargir la colonne */
.stack > * { min-width: 0; }

.agenda { display: grid; }
.ag-item { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.ag-item:first-child { border-top: 0; }
.ag-time { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--muted); }
.ag-item b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-item .ag-main span { font-size: 12.5px; color: var(--muted); }
a.ag-item:hover b { color: var(--brand); }

.progress-list { display: grid; gap: 16px; }
.pg-item { display: grid; gap: 7px; }
.pg-item .between b { font-weight: 600; }
.pg-item .between span { font-size: 12.5px; color: var(--muted); }
.pg-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pg-fill { height: 100%; border-radius: inherit; background: var(--brand); transform-origin: left; animation: grow 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms + 200ms); }
.pg-fill.accent { background: var(--accent); }
.pg-fill.danger { background: var(--danger); }

.status-list { display: grid; }
.st-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.st-item:first-child { border-top: 0; }
.st-item .t-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.st-item .t-ico svg.lucide { width: 16px; height: 16px; }
.st-item .grow { flex: 1; min-width: 0; }
.st-item b { display: block; font-size: 13.5px; font-weight: 600; }
.st-item .grow span { font-size: 12px; color: var(--muted); }

.dash-empty { display: grid; justify-items: center; gap: 6px; padding: 18px 0; color: var(--muted); text-align: center; }
.dash-empty svg.lucide { width: 26px; height: 26px; color: var(--brand); }
@media (max-width: 720px) {
  .ag-item { grid-template-columns: 48px minmax(0, 1fr); }
  .ag-item .badge { grid-column: 2; justify-self: start; }
}

/* ---------- Nouvel utilisateur ---------- */
.nu-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.nu-side { position: sticky; top: 84px; }
.nu-row { align-items: flex-start; flex-wrap: wrap; }
.nu-titre { width: 130px; }
.nu-tel { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px; }
.nu-warn { display: flex; gap: 6px; align-items: flex-start; color: oklch(50% .13 60); }
:root[data-theme="dark"] .nu-warn { color: var(--warn); }
.nu-warn svg.lucide { width: 14px; height: 14px; margin-top: 2px; }
.nu-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nu-roles.is-error { padding: 6px; border-radius: 12px; outline: 1.5px solid var(--danger); }
.nu-role { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; transition: border-color .15s, background .15s; }
.nu-role:hover { border-color: var(--border-strong); }
.nu-role input { position: absolute; opacity: 0; pointer-events: none; }
.nu-role:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.nu-role:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--brand-ring); }
.nu-role-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); flex-shrink: 0; }
.nu-role:has(input:checked) .nu-role-ico { background: var(--brand); color: #fff; }
.nu-role b { display: block; font-size: 13.5px; }
.nu-role small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.nu-droits { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.nu-droits li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.nu-droits li svg.lucide { width: 15px; height: 15px; margin-top: 2px; color: var(--muted); opacity: .6; }
.nu-droits li.yes { color: var(--text); font-weight: 500; }
.nu-droits li.yes svg.lucide { color: var(--brand); opacity: 1; }
.nu-switch { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.nu-switch.is-locked { cursor: default; }
.nu-switch.is-locked .switch span { opacity: .75; cursor: not-allowed; }
.nu-switch b { display: block; font-size: 13.5px; }
.nu-switch small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.choice small { font-size: 11px; font-weight: 500; color: var(--muted); }
.choice.is-locked { cursor: default; opacity: .85; }
.nu-all { border-style: dashed; }
.nu-file { width: 100%; justify-content: flex-start; overflow: hidden; }
.nu-file span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nu-who { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.nu-who b { display: block; }
.nu-who span:not(.avatar) { font-size: 12.5px; color: var(--muted); }
.nu-progress { display: grid; gap: 6px; margin-bottom: 12px; }
.nu-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.nu-steps li { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.nu-steps li svg.lucide { width: 15px; height: 15px; }
.nu-steps li.ok { color: var(--text); }
.nu-steps li.ok svg.lucide { color: var(--brand); }
.nu-kv { grid-template-columns: 110px 1fr; font-size: 13px; padding-top: 12px; border-top: 1px solid var(--border); }
.nu-mail { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-size: 13px; }
.nu-mail-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.nu-mail-head > span { color: var(--brand); display: grid; }
.nu-mail-head b { display: block; font-size: 12.5px; }
.nu-mail-head small { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.nu-mail-body { padding: 14px; display: grid; gap: 10px; }
.nu-mail-body blockquote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; white-space: pre-line; }
.nu-mail-btn { justify-self: start; padding: 8px 14px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 600; font-size: 12.5px; }
.nu-actions { justify-content: flex-end; }
@media (max-width: 1100px) {
  .nu-grid { grid-template-columns: minmax(0, 1fr); }
  .nu-side { position: static; }
}
@media (max-width: 720px) {
  .nu-roles, .nu-droits, .nu-steps { grid-template-columns: minmax(0, 1fr); }
  .nu-tel { grid-template-columns: 120px minmax(0, 1fr); }
  .nu-titre { width: 100%; }
  .nu-actions .btn { flex: 1; }
}

/* ---------- Pré-audit énergétique (rubriques A à K) ---------- */
.pa-steps { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.pa-step { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 11.5px; font-weight: 600; text-align: center; transition: border-color .15s, background .15s; }
.pa-step:hover { border-color: var(--border-strong); }
.pa-key { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); color: var(--text); position: relative; }
.pa-step.ok .pa-key::after, .pa-step.warn .pa-key::after, .pa-step.bad .pa-key::after { content: ""; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface); }
.pa-step.ok .pa-key::after { background: var(--brand); }
.pa-step.warn .pa-key::after { background: var(--warn); }
.pa-step.bad .pa-key::after { background: var(--danger); }
.pa-step.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.pa-step.on .pa-key { background: var(--brand); color: #fff; }
.pa-lbl { line-height: 1.2; }
.pa-lead { color: var(--muted); font-size: 13.5px; }
.pa-row { align-items: flex-start; flex-wrap: wrap; }
.pa-row > .field { min-width: 160px; }
.pa-table table { font-size: 13px; }
.pa-table td, .pa-table th { padding: 6px 6px; }
.pa-table .input, .pa-table .select { height: 34px; padding: 0 8px; font-size: 13px; min-width: 0; }
.pa-charges td:first-child .input { min-width: 150px; }
.pa-charges td:nth-child(2) .input { width: 56px; }
.pa-charges td:nth-child(3) .input, .pa-charges td:nth-child(4) .input, .pa-charges td:nth-child(5) .input { width: 76px; }
.pa-table .num { text-align: right; white-space: nowrap; }
.pa-table tfoot td { border-top: 1px solid var(--border-strong); padding-top: 10px; }
.pa-src { min-width: 112px; }
tr.pa-missing td { background: var(--warn-soft); }
tr.pa-bad td { background: var(--danger-soft); }
tr.pa-errrow td { padding-top: 0; background: var(--danger-soft); }
.pa-err { color: var(--danger); font-family: var(--font-text); font-size: 12px; font-weight: 600; }
.pa-range { display: flex; align-items: center; gap: 14px; }
.pa-range input { flex: 1; accent-color: var(--brand); }
.pa-fit { height: 40px; display: flex; align-items: center; font-weight: 600; }
.pa-inspect { display: grid; gap: 2px; }
.pa-insp { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: 13.5px; }
.pa-insp:first-child { border-top: 0; }
.pa-crit.on { border-color: var(--danger); background: var(--danger-soft); }
.pa-results { display: grid; gap: 2px; }
.pa-res { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.pa-res:first-child { border-top: 0; }
.pa-res span { color: var(--muted); }
.pa-res b { font-size: 15px; }
.pa-res b small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.pa-res em { grid-column: 1 / -1; font-style: normal; font-size: 11.5px; color: var(--muted); }
.pa-engine { margin-top: 8px; display: flex; gap: 6px; align-items: flex-start; }
.pa-engine svg.lucide { width: 14px; height: 14px; margin-top: 2px; }
.pa-checks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.pa-checks button { width: 100%; display: flex; gap: 8px; align-items: flex-start; text-align: left; padding: 8px 10px; border-radius: 10px; border: 0; font-size: 12.5px; line-height: 1.4; color: var(--text); }
.pa-checks .bloquant button { background: var(--danger-soft); }
.pa-checks .reserve button { background: var(--warn-soft); }
.pa-checks svg.lucide { width: 15px; height: 15px; margin-top: 1px; }
.pa-checks .bloquant svg.lucide { color: var(--danger); }
.pa-checks .reserve svg.lucide { color: oklch(55% .14 60); }
.pa-checks b { font-family: var(--font-mono); margin-right: 4px; }
.pa-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.pa-nav { display: flex; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
@media (max-width: 1100px) { .pa-steps { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .pa-steps { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .pa-step { flex: 0 0 84px; }
}
/* Rubriques à tableau (factures, charges) : formulaire en pleine largeur, résultats en dessous */
.nu-grid.pa-wide { grid-template-columns: minmax(0, 1fr); }
.pa-wide .nu-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.pa-total { align-items: flex-start; }
.pa-total .pa-lead { flex: 1; min-width: 260px; }
.pa-total-v { display: grid; justify-items: end; padding: 8px 14px; border-radius: 12px; background: var(--brand-soft); }
.pa-total-v small { font-size: 11.5px; color: var(--muted); }
.pa-total-v b { font-size: 20px; color: var(--brand); }
.pa-total-v b small { font-size: 12px; color: var(--brand); }
@media (max-width: 1100px) { .pa-wide .nu-side { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Cycle des statuts du dossier ---------- */
.st-opts { display: grid; gap: 6px; }
.st-opts.is-error { padding: 6px; border-radius: 12px; outline: 1.5px solid var(--danger); }
.st-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; text-align: left; }
.st-opt:hover { border-color: var(--border-strong); }
.st-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.st-opt input { margin-top: 4px; accent-color: var(--brand); }
.st-opt > span { display: grid; gap: 4px; justify-items: start; }
.st-opt small { font-size: 12px; color: var(--muted); }
.st-opt.off { opacity: .55; cursor: not-allowed; }

/* ---------- Indicateurs du cahier des charges ---------- */
.kpi-cdc { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.kc { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.kc-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--brand); flex-shrink: 0; }
.kc-ico svg.lucide { width: 16px; height: 16px; }
.kc > div { display: grid; gap: 2px; min-width: 0; }
.kc-l { font-size: 12px; font-weight: 600; }
.kc-v { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.kc-d { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
@media (max-width: 1280px) { .kpi-cdc { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .kpi-cdc { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Langue et lecture seule ---------- */
.lang-select { width: 70px; padding: 0 6px; font-family: var(--font-mono); font-size: 12.5px; }
.lang-banner, .ro-banner { margin-bottom: 16px; }
.ro-banner { background: var(--surface-2); }
@media (max-width: 720px) { .lang-select { display: none; } }

/* ---------- Permissions par rôle ---------- */
.perm-table th { font-size: 11px; white-space: normal; min-width: 92px; text-align: center; }
.perm-table th:first-child { text-align: left; min-width: 260px; }
.perm-cell { text-align: center; }
.switch.sm { width: 34px; height: 20px; display: inline-block; }
.switch.sm span::before { width: 14px; height: 14px; }
.switch.sm input:checked + span::before { transform: translateX(14px); }
.switch input:disabled + span { opacity: .55; cursor: not-allowed; }

/* ---------- Stock ---------- */
.stk { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.stk small { font-size: 11px; color: var(--muted); }
.inv-in { width: 100px; }
.flow-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.fs { position: relative; display: grid; gap: 4px; align-content: start; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.fs-n { position: absolute; top: 10px; right: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.fs-i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--brand); margin-bottom: 4px; }
.fs b { font-size: 13.5px; }
.fs small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.wg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wg-item { display: grid; gap: 6px; align-content: start; padding: 14px; border-radius: 12px; border: 1px solid var(--border); }
.wg-perms { display: grid; gap: 3px; }
.wg-perms i { font-style: normal; font-size: 12px; display: flex; gap: 6px; align-items: center; color: var(--brand); }
.wg-perms i svg.lucide { width: 13px; height: 13px; }
.wg-perms i.none { color: var(--muted); }

/* ---------- Création d’un devis ---------- */
.dv-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dv-steps button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--muted); text-align: left; }
.dv-steps button:disabled { cursor: default; }
.dv-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-family: var(--font-mono); font-size: 12.5px; flex-shrink: 0; }
.dv-n svg.lucide { width: 14px; height: 14px; stroke-width: 3; }
.dv-steps li.on button { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.dv-steps li.on .dv-n, .dv-steps li.done .dv-n { background: var(--brand); color: #fff; }
.dv-steps li.done button { color: var(--text); }
.dv-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dv-grid.dv-last { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.dv-side { position: sticky; top: 84px; }
.dv-client { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.dv-client > div { display: grid; gap: 3px; }
.dv-pick { display: grid; gap: 8px; }
.dv-cat { display: grid; gap: 4px; max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
.dv-cat-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; }
.dv-cat-row:hover { background: var(--surface-2); }
.dv-cat-row .grow { min-width: 0; }
.dv-cat-row b { display: block; font-size: 13px; }
.dv-table td { vertical-align: top; }
.dv-table .input { height: 36px; }
.dv-range { display: block; margin-top: 3px; font-family: var(--font-mono); }
.dv-fin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dv-fin-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; }
.dv-fin-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.dv-fin-opt input { margin-top: 3px; accent-color: var(--brand); }
.dv-fin-opt b { display: block; font-size: 13px; }
.dv-fin-opt small { font-size: 12px; color: var(--muted); }
.dv-after { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 13px; }
.dv-track { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.dv-track li { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.dv-track li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-family: var(--font-mono); font-size: 12px; }
.dv-track li span svg.lucide { width: 13px; height: 13px; stroke-width: 3; }
.dv-track li.done, .dv-track li.on { color: var(--text); font-weight: 600; }
.dv-track li.done span { background: var(--brand); color: #fff; }
.dv-track li.on span { background: var(--accent-soft); color: var(--accent); border: 2px solid var(--accent); }
.dv-preview { background: var(--surface-2); border-radius: var(--radius); padding: 24px; display: flex; justify-content: center; }
.devis-paper { position: relative; width: 100%; max-width: 640px; background: #fff; color: #17201b; box-shadow: var(--shadow); border-radius: 4px; padding: 32px 34px; font-size: 12px; display: grid; gap: 14px; overflow: hidden; }
.devis-paper.draft::after { content: "BROUILLON"; position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%) rotate(-28deg); font-family: var(--font-title); font-weight: 700; font-size: 64px; letter-spacing: .1em; color: oklch(57.7% .215 27 / .08); pointer-events: none; }
.dp-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid oklch(48.9% .117 155.6); padding-bottom: 12px; }
.dp-head img { width: 44px; }
.dp-head b { display: block; font-family: var(--font-title); font-size: 15px; }
.dp-head small { font-size: 10.5px; color: #5b6660; }
.dp-num { text-align: right; display: grid; }
.dp-num b { font-size: 20px; color: oklch(41% .105 155.6); letter-spacing: .08em; }
.dp-num span { font-size: 12px; }
.dp-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dp-parties > div { display: grid; gap: 2px; padding: 10px 12px; background: #f4f7f5; border-radius: 6px; }
.dp-parties small { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #6b746f; margin-top: 4px; }
.dp-obj { font-size: 12.5px; }
.dp-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.dp-table th { background: oklch(48.9% .117 155.6); color: #fff; text-align: left; padding: 6px 8px; font-weight: 600; }
.dp-table th:not(:first-child), .dp-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.dp-table td { border-bottom: 1px solid #e1e6e3; padding: 6px 8px; vertical-align: top; }
.dp-table td b { display: block; font-weight: 600; }
.dp-table td small { color: #6b746f; font-size: 10px; }
.dp-empty { text-align: center !important; color: #8a938e; }
.dp-tot { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; justify-self: end; min-width: 280px; margin: 0; font-size: 12px; }
.dp-tot dd { margin: 0; text-align: right; font-family: var(--font-mono); }
.dp-tot .big { font-weight: 700; font-size: 14px; color: oklch(41% .105 155.6); border-top: 1px solid #cfd6d2; padding-top: 6px; }
.dp-cond { display: grid; gap: 6px; font-size: 11.5px; }
.dp-cond > div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; }
.dp-cond small { color: #6b746f; }
.dp-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 6px; }
.dp-sign > div { display: grid; gap: 4px; }
.dp-sign small { font-size: 10px; color: #6b746f; }
.dp-line { height: 34px; border-bottom: 1px solid #9aa39e; }
.dp-foot { font-size: 9.5px; color: #8a938e; border-top: 1px solid #e1e6e3; padding-top: 8px; }

/* ---------- Suivi des formulaires ---------- */
.fs-pipe { display: flex; align-items: stretch; }
.fs-col { flex: 1; min-width: 0; display: grid; justify-items: center; gap: 4px; padding: 14px 8px; border-radius: 12px; border: 1.5px solid var(--border); text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.fs-col.tone-muted, .fs-col.tone-info, .fs-col.tone-accent, .fs-col.tone-warn, .fs-col.tone-ok, .fs-col.tone-danger { background: var(--surface); }
.fs-col b { font-family: var(--font-title); font-size: 22px; color: var(--text); }
.fs-col .fs-i { margin: 0; width: 30px; height: 30px; background: var(--surface-2); }
.fs-col.tone-muted .fs-i { color: var(--muted); }
.fs-col.tone-info .fs-i { color: var(--info); }
.fs-col.tone-accent .fs-i { color: var(--accent); }
.fs-col.tone-warn .fs-i { color: oklch(55% .14 60); }
.fs-col.tone-ok .fs-i { color: var(--brand); }
.fs-col.tone-danger .fs-i { color: var(--danger); }
.fs-col.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.fs-arrow { flex: 0 0 14px; align-self: center; height: 2px; background: var(--border-strong); }
.fs-bar { min-width: 120px; }

/* ---------- Rédaction des rapports ---------- */
.r-process { display: flex; align-items: stretch; gap: 4px; }
.rp { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); text-align: left; }
.rp:hover { border-color: var(--border-strong); }
.rp.on { border-color: var(--brand); background: var(--brand-soft); }
.rp-i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); flex-shrink: 0; }
.rp-t { flex: 1; min-width: 0; display: grid; }
.rp-t b { font-size: 13px; }
.rp-t small { font-size: 11.5px; color: var(--muted); }
.rp-n { font-family: var(--font-title); font-size: 20px; font-weight: 700; }
.rp-arrow { align-self: center; color: var(--muted); display: grid; }
.r-read { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; white-space: pre-line; }
.r-mini { max-width: none; font-size: 9.5px; padding: 18px; }

/* ---------- Méthode de calcul du pré-audit ---------- */
.pa-method td { vertical-align: top; }
.pa-method td.mono { font-size: 12px; }

@media (max-width: 1100px) {
  .flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dv-grid, .dv-grid.dv-last { grid-template-columns: minmax(0, 1fr); }
  .dv-side { position: static; }
  .fs-pipe, .r-process { flex-wrap: wrap; gap: 8px; }
  .fs-col { flex: 1 1 140px; }
  .rp { flex: 1 1 220px; }
  .fs-arrow, .rp-arrow { display: none; }
}
@media (max-width: 720px) {
  .flow-steps, .wg, .dv-fin, .dp-parties { grid-template-columns: minmax(0, 1fr); }
  .dv-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .devis-paper { padding: 20px 16px; }
  .dv-preview { padding: 10px; }
  .dp-cond > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ---------- Impression : seul le devis sort ---------- */
@media print {
  body.printing-devis > *:not(#app) { display: none !important; }
  body.printing-devis #app .sidebar, body.printing-devis #app .topbar, body.printing-devis #app .crumbs, body.printing-devis #app .page-head,
  body.printing-devis #app .dv-steps, body.printing-devis #app .dv-side, body.printing-devis #app .ep-head, body.printing-devis #app .pa-nav, body.printing-devis #app .notice { display: none !important; }
  body.printing-devis, body.printing-devis #app, body.printing-devis .main, body.printing-devis .content, body.printing-devis .dv-preview, body.printing-devis .card { background: #fff !important; padding: 0 !important; margin: 0 !important; max-width: none !important; border: 0 !important; box-shadow: none !important; }
  body.printing-devis .shell, body.printing-devis .dv-grid { display: block !important; }
  body.printing-devis .devis-paper { box-shadow: none; max-width: none; }
  body.printing-devis .devis-paper.draft::after { display: none; }
}
.dv-grid.dv-single, .dv-grid.dv-wide { grid-template-columns: minmax(0, 1fr); }
.dv-wide .dv-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.perm-table th { min-width: 0; padding-left: 6px; padding-right: 6px; }
.perm-table th:first-child { min-width: 220px; }
@media (max-width: 1100px) { .dv-wide .dv-side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .dp-head { flex-wrap: wrap; gap: 10px; }
  .dp-num { text-align: left; }
  .dv-preview { overflow-x: auto; justify-content: flex-start; }
  .devis-paper { min-width: 320px; font-size: 11px; }
  .dp-tot { min-width: 0; justify-self: stretch; }
  .dp-sign { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .devis-paper { min-width: 0; padding: 16px 12px; font-size: 10.5px; }
  .dv-preview { padding: 6px; }
  .dp-table { font-size: 10px; }
  .dp-table th, .dp-table td { padding: 5px 4px; }
  .dp-table td small { display: none; }
  .ep-sec .ep-body:has(.dv-preview) { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 720px) {
  .pa-nav { flex-wrap: wrap; }
  .pa-nav .actions { width: 100%; }
  .pa-nav .actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* ---------- Fusion des doublons, photos géolocalisées, empreinte ---------- */
.mg-head, .mg-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.mg-head { margin-bottom: 4px; font-size: 13px; }
.mg-row { padding: 6px 0; border-top: 1px solid var(--border); }
.mg-row .choice { width: 100%; justify-content: flex-start; overflow: hidden; }
.ph-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 10.5px; opacity: .9; margin-top: 2px; }
.ph-meta svg.lucide { width: 11px; height: 11px; }
.hash { overflow-wrap: anywhere; }
@media (max-width: 720px) { .mg-head, .mg-row { grid-template-columns: minmax(0, 1fr); } .mg-head span { display: none; } }
